Skip to content
Closed
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
245 changes: 245 additions & 0 deletions apps/loopover-ui/public/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -16134,6 +16134,129 @@
]
}
}
},
"ValidateLinkedIssueRequest": {
"type": "object",
"properties": {
"issueNumber": {
"type": "integer",
"minimum": 0,
"exclusiveMinimum": true
},
"plannedChange": {
"type": "object",
"properties": {
"title": {
"type": "string",
"minLength": 1,
"maxLength": 300
},
"changedFiles": {
"type": "array",
"items": {
"type": "string",
"maxLength": 300
},
"maxItems": 200
},
"contributorLogin": {
"type": "string",
"minLength": 1,
"maxLength": 100
}
}
}
},
"required": [
"issueNumber"
]
},
"ValidateLinkedIssueResponse": {
"type": "object",
"properties": {
"status": {
"type": "string"
},
"repoFullName": {
"type": "string"
},
"issueNumber": {
"type": "number"
},
"found": {
"type": "boolean"
},
"multiplierStatus": {
"type": "string"
},
"multiplierWouldApply": {
"type": "boolean"
},
"blockingReason": {
"type": "string"
},
"reasons": {
"nullable": true
},
"report": {
"nullable": true
}
}
},
"CheckBeforeStartRequest": {
"type": "object",
"properties": {
"issueNumber": {
"type": "integer",
"minimum": 0,
"exclusiveMinimum": true
},
"title": {
"type": "string",
"minLength": 1,
"maxLength": 300
},
"plannedPaths": {
"type": "array",
"items": {
"type": "string",
"maxLength": 300
},
"maxItems": 200
}
}
},
"CheckBeforeStartResponse": {
"type": "object",
"properties": {
"status": {
"type": "string"
},
"repoFullName": {
"type": "string"
},
"found": {
"type": "boolean"
},
"claimStatus": {
"type": "string"
},
"duplicateClusterRisk": {
"type": "string"
},
"recommendation": {
"type": "string"
},
"reasons": {
"nullable": true
},
"blockers": {
"nullable": true
},
"report": {
"nullable": true
}
}
}
},
"parameters": {},
Expand Down Expand Up @@ -21768,6 +21891,128 @@
}
]
}
},
"/v1/repos/{owner}/{repo}/validate-linked-issue": {
"post": {
"summary": "Validate a linked-issue claim before opening work — REST mirror of loopover_validate_linked_issue (#9304)",
"parameters": [
{
"schema": {
"type": "string"
},
"required": true,
"name": "owner",
"in": "path"
},
{
"schema": {
"type": "string"
},
"required": true,
"name": "repo",
"in": "path"
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidateLinkedIssueRequest"
}
}
}
},
"responses": {
"200": {
"description": "Linked-issue validation report — mirrors the loopover_validate_linked_issue MCP tool. Advisory only; it does not open issues or PRs",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidateLinkedIssueResponse"
}
}
}
},
"400": {
"description": "Invalid validate-linked-issue request body"
},
"401": {
"description": "Missing or invalid authentication"
},
"403": {
"description": "Authenticated principal cannot access this repo"
}
},
"security": [
{
"LoopOverBearer": []
},
{
"LoopOverSessionCookie": []
}
]
}
},
"/v1/repos/{owner}/{repo}/check-before-start": {
"post": {
"summary": "Pre-start claim and duplicate-risk check — REST mirror of loopover_check_before_start (#9304)",
"parameters": [
{
"schema": {
"type": "string"
},
"required": true,
"name": "owner",
"in": "path"
},
{
"schema": {
"type": "string"
},
"required": true,
"name": "repo",
"in": "path"
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CheckBeforeStartRequest"
}
}
}
},
"responses": {
"200": {
"description": "Pre-start check with claim status, duplicate-cluster risk, and recommendation — mirrors the loopover_check_before_start MCP tool. Advisory only",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CheckBeforeStartResponse"
}
}
}
},
"400": {
"description": "Invalid check-before-start request body"
},
"401": {
"description": "Missing or invalid authentication"
},
"403": {
"description": "Authenticated principal cannot access this repo"
}
},
"security": [
{
"LoopOverBearer": []
},
{
"LoopOverSessionCookie": []
}
]
}
}
},
"servers": [
Expand Down
10 changes: 6 additions & 4 deletions src/mcp/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,9 @@ const bountyShape = {
id: z.string().min(1),
};

const validateLinkedIssueShape = {
// Exported for OpenAPI contract tests (#9304) — request/response components must stay field-for-field
// in parity with these tool shapes (owner/repo are path params on the REST mirror).
export const validateLinkedIssueShape = {
owner: z.string().min(1),
repo: z.string().min(1),
issueNumber: z.number().int().positive(),
Expand All @@ -333,7 +335,7 @@ const validateLinkedIssueShape = {
.optional(),
};

const checkBeforeStartShape = {
export const checkBeforeStartShape = {
owner: z.string().min(1),
repo: z.string().min(1),
issueNumber: z.number().int().positive().optional(),
Expand Down Expand Up @@ -1609,7 +1611,7 @@ const localStatusOutputSchema = {
supportedTools: z.unknown().optional(),
};

const validateLinkedIssueOutputSchema = {
export const validateLinkedIssueOutputSchema = {
status: z.string().optional(),
repoFullName: z.string().optional(),
issueNumber: z.number().optional(),
Expand All @@ -1621,7 +1623,7 @@ const validateLinkedIssueOutputSchema = {
report: z.unknown().optional(),
};

const checkBeforeStartOutputSchema = {
export const checkBeforeStartOutputSchema = {
status: z.string().optional(),
repoFullName: z.string().optional(),
found: z.boolean().optional(),
Expand Down
65 changes: 65 additions & 0 deletions src/openapi/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2013,6 +2013,71 @@ export const ScoreBreakdownResponseSchema = z
})
.openapi("ScoreBreakdownResponse");

/**
* Request body for POST /v1/repos/{owner}/{repo}/validate-linked-issue. Field-level parity with
* `validateLinkedIssueShape` in src/mcp/server.ts minus owner/repo (path params) — #9304.
*/
export const ValidateLinkedIssueRequestSchema = z
.object({
issueNumber: z.number().int().positive(),
plannedChange: z
.object({
title: z.string().min(1).max(300).optional(),
changedFiles: z.array(z.string().max(300)).max(200).optional(),
contributorLogin: z.string().min(1).max(100).optional(),
})
.optional(),
})
.openapi("ValidateLinkedIssueRequest");

/**
* Response body for POST /v1/repos/{owner}/{repo}/validate-linked-issue. Field-level parity with
* `validateLinkedIssueOutputSchema` (the `loopover_validate_linked_issue` MCP tool `outputSchema`) — #9304.
*/
export const ValidateLinkedIssueResponseSchema = z
.object({
status: z.string().optional(),
repoFullName: z.string().optional(),
issueNumber: z.number().optional(),
found: z.boolean().optional(),
multiplierStatus: z.string().optional(),
multiplierWouldApply: z.boolean().optional(),
blockingReason: z.string().optional(),
reasons: z.unknown().optional(),
report: z.unknown().optional(),
})
.openapi("ValidateLinkedIssueResponse");

/**
* Request body for POST /v1/repos/{owner}/{repo}/check-before-start. Field-level parity with
* `checkBeforeStartShape` in src/mcp/server.ts minus owner/repo (path params) — #9304.
*/
export const CheckBeforeStartRequestSchema = z
.object({
issueNumber: z.number().int().positive().optional(),
title: z.string().min(1).max(300).optional(),
plannedPaths: z.array(z.string().max(300)).max(200).optional(),
})
.openapi("CheckBeforeStartRequest");

/**
* Response body for POST /v1/repos/{owner}/{repo}/check-before-start. Field-level parity with
* `checkBeforeStartOutputSchema` (the `loopover_check_before_start` MCP tool `outputSchema`) — #9304.
*/
export const CheckBeforeStartResponseSchema = z
.object({
status: z.string().optional(),
repoFullName: z.string().optional(),
found: z.boolean().optional(),
claimStatus: z.string().optional(),
duplicateClusterRisk: z.string().optional(),
recommendation: z.string().optional(),
reasons: z.unknown().optional(),
blockers: z.unknown().optional(),
report: z.unknown().optional(),
})
.openapi("CheckBeforeStartResponse");

/**
* Request body for POST /v1/loop/evaluate-escalation. Field-level parity with `evaluateEscalationShape`
* (the `loopover_evaluate_escalation` MCP tool `inputSchema`) in src/mcp/server.ts — #9309.
Expand Down
Loading
Loading