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
95 changes: 95 additions & 0 deletions apps/loopover-ui/public/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -14056,6 +14056,52 @@
"amsCohort",
"humanCohort"
]
},
"GateConfigEffectiveResponse": {
"type": "object",
"properties": {
"repoFullName": {
"type": "string"
},
"effective": {
"type": "object",
"properties": {
"confidenceFloor": {
"type": "number",
"nullable": true
},
"scopeCap": {
"type": "object",
"properties": {
"files": {
"type": "integer",
"nullable": true
},
"lines": {
"type": "integer",
"nullable": true
}
},
"required": [
"files",
"lines"
]
}
},
"required": [
"confidenceFloor",
"scopeCap"
]
},
"shadowPending": {
"type": "boolean"
}
},
"required": [
"repoFullName",
"effective",
"shadowPending"
]
}
},
"parameters": {},
Expand Down Expand Up @@ -18114,6 +18160,55 @@
}
]
}
},
"/v1/repos/{owner}/{repo}/gate-config/effective": {
"get": {
"summary": "Current effective self-tuned gate config for a repo (#6247)",
"parameters": [
{
"schema": {
"type": "string"
},
"required": true,
"name": "owner",
"in": "path"
},
{
"schema": {
"type": "string"
},
"required": true,
"name": "repo",
"in": "path"
}
],
"responses": {
"200": {
"description": "Effective TunableOverride values (confidenceFloor / scopeCap.files / scopeCap.lines) with a shadowPending flag — never the raw override_audit history",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GateConfigEffectiveResponse"
}
}
}
},
"401": {
"description": "Missing or invalid static protected API token"
},
"403": {
"description": "Static mcp credential is outside MCP_READ_REPO_ALLOWLIST for this repo"
}
},
"security": [
{
"LoopOverBearer": []
},
{
"LoopOverSessionCookie": []
}
]
}
}
},
"servers": [
Expand Down
14 changes: 14 additions & 0 deletions src/openapi/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1749,6 +1749,20 @@ export const LiveGateThresholdsResponseSchema = z
})
.openapi("LiveGateThresholdsResponse");

export const GateConfigEffectiveResponseSchema = z
.object({
repoFullName: z.string(),
effective: z.object({
confidenceFloor: z.number().nullable(),
scopeCap: z.object({
files: z.number().int().nullable(),
lines: z.number().int().nullable(),
}),
}),
shadowPending: z.boolean(),
})
.openapi("GateConfigEffectiveResponse");

export const BurdenForecastSchema = z
.object({
repoFullName: z.string(),
Expand Down
16 changes: 16 additions & 0 deletions src/openapi/spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
InstallationRepairSchema,
IssueQualityReportSchema,
IssueQualityResponseSchema,
GateConfigEffectiveResponseSchema,
LabelAuditSchema,
LaneAdviceSchema,
LiveGateThresholdsResponseSchema,
Expand Down Expand Up @@ -150,6 +151,7 @@ export function buildOpenApiSpec() {
registry.register("ScorePreview", ScorePreviewSchema);
registry.register("IssueQualityReport", IssueQualityReportSchema);
registry.register("IssueQualityResponse", IssueQualityResponseSchema);
registry.register("GateConfigEffectiveResponse", GateConfigEffectiveResponseSchema);
registry.register("LiveGateThresholdsResponse", LiveGateThresholdsResponseSchema);
registry.register("BurdenForecast", BurdenForecastSchema);
registry.register("ContributorScoringProfile", ContributorScoringProfileSchema);
Expand Down Expand Up @@ -423,6 +425,20 @@ export function buildOpenApiSpec() {
404: { description: "Repo is unknown or has no issue-quality coverage yet" },
},
});
registry.registerPath({
method: "get",
path: "/v1/repos/{owner}/{repo}/gate-config/effective",
summary: "Current effective self-tuned gate config for a repo (#6247)",
request: { params: z.object({ owner: z.string(), repo: z.string() }) },
responses: {
200: {
description: "Effective TunableOverride values (confidenceFloor / scopeCap.files / scopeCap.lines) with a shadowPending flag — never the raw override_audit history",
content: { "application/json": { schema: GateConfigEffectiveResponseSchema } },
},
401: { description: "Missing or invalid static protected API token" },
403: { description: "Static mcp credential is outside MCP_READ_REPO_ALLOWLIST for this repo" },
},
});
registry.registerPath({
method: "get",
path: "/v1/repos/{owner}/{repo}/live-gate-thresholds",
Expand Down
1 change: 1 addition & 0 deletions test/unit/openapi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ describe("OpenAPI contract", () => {
expect(spec.paths["/v1/repos/{owner}/{repo}/intelligence"]).toBeDefined();
expect(spec.paths["/v1/repos/{owner}/{repo}/issue-quality"]).toBeDefined();
expect(spec.paths["/v1/repos/{owner}/{repo}/outcome-patterns"]).toBeDefined();
expect(spec.paths["/v1/repos/{owner}/{repo}/gate-config/effective"]).toBeDefined();
expect(spec.paths["/v1/repos/{owner}/{repo}/registration-readiness"]).toBeDefined();
expect(spec.paths["/v1/repos/{owner}/{repo}/gittensor-config-recommendation"]).toBeDefined();
expect(spec.paths["/v1/repos/{owner}/{repo}/pulls/{number}/maintainer-packet"]).toBeDefined();
Expand Down
Loading