Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
199 changes: 199 additions & 0 deletions apps/gittensory-ui/public/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2250,6 +2250,9 @@
}
}
},
"recommendationOutcomeFeedback": {
"$ref": "#/components/schemas/AgentRecommendationOutcomeSummary"
},
"evidenceGraph": {
"type": "object",
"additionalProperties": {
Expand Down Expand Up @@ -2296,6 +2299,7 @@
"avoidRepos",
"maintainerLaneRepos",
"scoreBlockers",
"recommendationOutcomeFeedback",
"dataQuality",
"summary",
"nextActions"
Expand All @@ -2310,6 +2314,201 @@
"missing"
]
},
"AgentRecommendationOutcomeSummary": {
"type": "object",
"properties": {
"login": {
"type": "string"
},
"generatedAt": {
"type": "string"
},
"windowDays": {
"type": "number"
},
"totals": {
"type": "object",
"properties": {
"total": {
"type": "number"
},
"accepted": {
"type": "number"
},
"ignored": {
"type": "number"
},
"stale": {
"type": "number"
},
"merged": {
"type": "number"
},
"closed": {
"type": "number"
},
"improved": {
"type": "number"
},
"positive": {
"type": "number"
},
"negative": {
"type": "number"
},
"maintainerLaneTotal": {
"type": "number"
}
},
"required": [
"total",
"accepted",
"ignored",
"stale",
"merged",
"closed",
"improved",
"positive",
"negative",
"maintainerLaneTotal"
]
},
"states": {
"type": "array",
"items": {
"$ref": "#/components/schemas/AgentRecommendationOutcomeStateBucket"
}
},
"repos": {
"type": "array",
"items": {
"$ref": "#/components/schemas/AgentRecommendationOutcomeRepoSummary"
}
},
"maintainerLane": {
"type": "object",
"properties": {
"total": {
"type": "number"
},
"states": {
"type": "array",
"items": {
"$ref": "#/components/schemas/AgentRecommendationOutcomeStateBucket"
}
}
},
"required": [
"total",
"states"
]
},
"privateSummary": {
"type": "string"
}
},
"required": [
"login",
"generatedAt",
"windowDays",
"totals",
"states",
"repos",
"maintainerLane",
"privateSummary"
]
},
"AgentRecommendationOutcomeStateBucket": {
"type": "object",
"properties": {
"state": {
"$ref": "#/components/schemas/AgentRecommendationOutcomeState"
},
"count": {
"type": "number"
}
},
"required": [
"state",
"count"
]
},
"AgentRecommendationOutcomeState": {
"type": "string",
"enum": [
"accepted",
"ignored",
"stale",
"merged",
"closed",
"improved"
]
},
"AgentRecommendationOutcomeRepoSummary": {
"type": "object",
"properties": {
"repoFullName": {
"type": "string"
},
"total": {
"type": "number"
},
"accepted": {
"type": "number"
},
"ignored": {
"type": "number"
},
"stale": {
"type": "number"
},
"merged": {
"type": "number"
},
"closed": {
"type": "number"
},
"improved": {
"type": "number"
},
"positive": {
"type": "number"
},
"negative": {
"type": "number"
},
"maintainerLaneTotal": {
"type": "number"
},
"latestOutcomeAt": {
"type": "string",
"nullable": true
},
"signal": {
"type": "string",
"enum": [
"positive",
"negative",
"mixed",
"neutral"
]
}
},
"required": [
"repoFullName",
"total",
"accepted",
"ignored",
"stale",
"merged",
"closed",
"improved",
"positive",
"negative",
"maintainerLaneTotal",
"signal"
]
},
"ContributorOpenPrMonitor": {
"type": "object",
"properties": {
Expand Down
37 changes: 37 additions & 0 deletions migrations/0017_agent_recommendation_outcomes.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
CREATE TABLE IF NOT EXISTS agent_recommendation_outcomes (
id TEXT PRIMARY KEY NOT NULL,
action_id TEXT NOT NULL,
run_id TEXT NOT NULL,
actor_login TEXT NOT NULL,
action_type TEXT NOT NULL,
target_repo_full_name TEXT,
target_pull_number INTEGER,
target_issue_number INTEGER,
outcome_state TEXT NOT NULL,
outcome_target_type TEXT NOT NULL,
outcome_repo_full_name TEXT,
outcome_pull_number INTEGER,
outcome_issue_number INTEGER,
maintainer_lane INTEGER NOT NULL DEFAULT 0,
confidence TEXT NOT NULL,
reason TEXT NOT NULL,
source_updated_at TEXT,
detected_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
metadata_json TEXT NOT NULL DEFAULT '{}',
created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY(action_id) REFERENCES agent_actions(id),
FOREIGN KEY(run_id) REFERENCES agent_runs(id)
);

CREATE UNIQUE INDEX IF NOT EXISTS agent_recommendation_outcomes_action_unique
ON agent_recommendation_outcomes(action_id);

CREATE INDEX IF NOT EXISTS agent_recommendation_outcomes_actor_state_idx
ON agent_recommendation_outcomes(actor_login, outcome_state, updated_at);

CREATE INDEX IF NOT EXISTS agent_recommendation_outcomes_target_idx
ON agent_recommendation_outcomes(target_repo_full_name, target_pull_number, target_issue_number);

CREATE INDEX IF NOT EXISTS agent_recommendation_outcomes_maintainer_idx
ON agent_recommendation_outcomes(actor_login, maintainer_lane, updated_at);
Loading