Repository navigation
[3485 by Claude Opus 5.5] Expose retry lineage in MCP and OpenAPI and document idempotency contracts - #3517
Conversation
…h submission task pointers, the OpenAPI spec and client types pin the lineage fields, and there's one "Idempotency and retries" section in the MCP guide and in the API reference. Lint, typecheck and `npm run gen:openapi:check` are clean. All the suites I touched or that read the changed queries pass, including `mcpObservableSurface`, `mcpDocs`, `mcpToolInputBudget` and the OpenAPI coverage/conformance tests. I did not run the whole API suite. MCP task reads - `get_task` now returns a `lineage` object with the fields the issue asked for. `attempts` appears only when the lineage has more than one attempt, so a single-attempt task gets `attemptNumber: 1` and no `attempts`. - `list_tasks` rows of a replacement lineage gain `attemptNumber`, `replacesTaskId` and `replacedByTaskId`; first-and-only attempts are unchanged. - Naming: these three row fields are camelCase as the issue specified, while the rest of the row is snake_case. - Side effect: `get_work_overview` uses the same task listing, so its rows gain the three fields too. - The shared code is in `packages/api/routes/taskAttemptLineage.ts`, as the issue asked. Submission reads - `get_task_submission`, `list_task_submissions` and REST `GET /api/task-submissions/:key` (plus submit and retry) now return `firstTaskId` and `latestTaskId`. - `taskId` is unchanged, but it means different things on each side, and the docs now say so. Over MCP it has always been the latest attempt. Over REST it is the first execution. - I made one change beyond the issue: a `get_operation` receipt that has already resolved now shows the current `latestTaskId` on every read. This value is not written back to the stored receipt, because rewriting a finished receipt would change its recorded finish time. OpenAPI - `taskInfo` now has an explicit schema with the lineage fields and `attemptLineage`. I made it closed rather than tolerant of extra fields: every field the three response paths send is listed, so any new field fails conformance until it's added. Lineage fields are optional because live tasks from Redis or the queue have no stored row yet. - `schemas.ts` went over the 400-line lint limit, so the task-history schemas moved to a new file, `openapi/schemasTaskHistory.ts`. - `POST /api/goals` is now documented (it was undocumented before), with the required `Idempotency-Key` header and its 200 replay, 409 conflict and 503 responses. Its operation id is now `createGoal`. - I regenerated the spec and the client types. Docs - The new section is in `docs/mcp.md` and `docs/docs/operations/api-reference.md`, with a cross-link added in `docs/mcp-coverage.md`. - It covers everything item 4 of the issue lists. I checked each tool, code, skip reason and response status against the code. Tests - New `mcpTaskLineage.test.ts`: - lineage is consistent from both the replaced task and its replacement. - single-attempt tasks have no `attempts`. - list rows carry the three fields only for lineage tasks. - a full 100-row page of large lineage rows stays under the 256 KiB result limit. - `mcpTaskSubmissions.test.ts` covers a submission whose task was replaced, including a third attempt after the receipt resolved. I confirmed that check fails without the receipt fix. - The conformance test now covers lineage and a replaced REST submission. - I updated four existing tests for the new fields: - `mcpIntegration` builds its own tables, so it now applies the lineage migration. - a REST deep-equal in `taskSubmissionIntakeRoutes`. - the typed submission fixture in the client tests. - the doc-token allow-list in `mcpObservableSurface`. The CLI needed no change, and since nothing here is visible in the UI there are no previews.
|
/ultrafix goal=8 max=10 |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 10) First action:
|
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
|
CI failed: Validate unsigned darwin-arm64 package Please investigate and fix this CI failure.
Failure evidence
|
|
CI failed: Validate unsigned linux-arm64 package Please investigate and fix this CI failure.
Failure evidence
|
|
CI failed: Validate unsigned darwin-x64 package Please investigate and fix this CI failure.
Failure evidence
|
|
✅ Applied the requested follow-up changes in commit edd511c Processed 2 comments:
Summary of ChangesI fixed both failing checks. They had the same cause, and it wasn't this PR's code. The step that failed was "Audit committed dependency resolution", which flagged Change: I moved the override from 4.13.12 to 4.13.18, the latest 4.13.x patch, in Checks:
I didn't install 4.13.18 into the local The darwin job's "longer queue times" message is only GitHub's macOS capacity notice; it didn't cause the failure. Nothing here is visible in the UI, so there are no previews. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
|
CI failed: Validate unsigned linux-x64 package Please investigate and fix this CI failure.
Failure evidence
|
|
CI failed: Finalize unsigned validation checksums Please investigate and fix this CI failure.
Failure evidence
|
…t wasn't this PR's code. The step that failed was "Audit committed dependency resolution", which flagged `hono` as a blocking vulnerability. The root `package.json` pins `hono` to 4.13.12 in its `overrides`. Three advisories have since been published that cover that version (GHSA-4m76-xfj5-7975, GHSA-h7mg-cq63-vhpq and GHSA-3gg2-335m-rxc6); 4.13.16 is the first fixed version. `main` has the same 4.13.12 pin, so other open PRs will hit this until the fix lands on `main`. I fixed both failing checks. They had the same cause, and it wasn't this PR's code. The step that failed was "Audit committed dependency resolution", which flagged `hono` as a blocking vulnerability. The root `package.json` pins `hono` to 4.13.12 in its `overrides`. Three advisories have since been published that cover that version (GHSA-4m76-xfj5-7975, GHSA-h7mg-cq63-vhpq and GHSA-3gg2-335m-rxc6); 4.13.16 is the first fixed version. `main` has the same 4.13.12 pin, so other open PRs will hit this until the fix lands on `main`. **Change:** I moved the override from 4.13.12 to 4.13.18, the latest 4.13.x patch, in `package.json`, and updated the matching `node_modules/hono` entry in `package-lock.json`. Nothing else in the lock changed. **Checks:** - `npm run audit:runtime` and `npm run desktop:audit:packaging` both pass locally. These are the two commands the failing step runs. - I re-resolved the lock with CI's npm 10 and it came out byte-identical, so `npm ci` in CI will use the same lock. I didn't install 4.13.18 into the local `node_modules` or run any test suites against it. It's a patch release within the same minor line. The darwin job's "longer queue times" message is only GitHub's macOS capacity notice; it didn't cause the failure. Nothing here is visible in the UI, so there are no previews. PR: #3517 Comment by: @propr-dev[bot] (ID: 6840510365) Comment by: @propr-dev[bot] (ID: 6840510709) Model: Claude Opus 5.5
|
ℹ️ Analyzed the follow-up request by @propr-dev[bot] Analysis SummaryI didn't change any code for this, because the current branch already contains the fix. The three failures were all reported on the earlier commit This is the I couldn't confirm it on CI. Every workflow run for No code changes were necessary based on the current state of the branch. 🤖 Analysis Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR exposes retry lineage consistently across MCP task reads and adds explicit first/latest submission pointers while preserving existing ✅ Compatibility preserved — REST retains the first execution in ✅ Receipt stability tested — The added submission regression covers a third attempt after receipt resolution and verifies that reading its updated pointer does not rewrite the stored receipt. ✅ Boundary coverage — The lineage tests cover both directions, singleton omission, and a full 100-row page against the response-size budget. This assessment uses static inspection of the supplied diff and context. No commands or tests were run during this review. The supplied current-head status reports 34 passed checks, no failures, and one pending check. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Include lineage in focused MCP suite
ScoreThe changed paths preserve compatibility and include focused regression coverage, with no verified merge blockers. Merge remains conditional on the pending validation check completing successfully. Score: 9/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
87f0633
into
3482-epic-integration-signals-100
AI Implementation Summary
Closes #3485
Branch:
3485/claude-opus-5-5-expose-retry-lineage-in-m-20261113-0031-wu6Commits: ✅ Changes committed (0c1a548)
AI Processing Completed
Execution Details:
Summary:
I've implemented #3485. MCP and REST now return retry lineage and both submission task pointers, the OpenAPI spec and client types pin the lineage fields, and there's one "Idempotency and retries" section in the MCP guide and in the API reference. Lint, typecheck and
npm run gen:openapi:checkare clean. All the suites I touched or that read the changed queries pass, includingmcpObservableSurface,mcpDocs,mcpToolInputBudgetand the OpenAPI coverage/conformance tests. I did not run the whole API suite.MCP task reads
get_tasknow returns alineageobject with the fields the issue asked for.attemptsappears only when the lineage has more than one attempt, so a single-attempt task getsattemptNumber: 1and noattempts.list_tasksrows of a replacement lineage gainattemptNumber,replacesTaskIdandreplacedByTaskId; first-and-only attempts are unchanged.get_work_overviewuses the same task listing, so its rows gain the three fields too.packages/api/routes/taskAttemptLineage.ts, as the issue asked.Submission reads
get_task_submission,list_task_submissionsand RESTGET /api/task-submissions/:key(plus submit and retry) now returnfirstTaskIdandlatestTaskId.taskIdis unchanged, but it means different things on each side, and the docs now say so. Over MCP it has always been the latest attempt. Over REST it is the first execution.get_operationreceipt that has already resolved now shows the currentlatestTaskIdon every read. This value is not written back to the stored receipt, because rewriting a finished receipt would change its recorded finish time.OpenAPI
taskInfonow has an explicit schema with the lineage fields andattemptLineage. I made it closed rather than tolerant of extra fields: every field the three response paths send is listed, so any new field fails conformance until it's added. Lineage fields are optional because live tasks from Redis or the queue have no stored row yet.schemas.tswent over the 400-line lint limit, so the task-history schemas moved to a new file,openapi/schemasTaskHistory.ts.POST /api/goalsis now documented (it was undocumented before), with the requiredIdempotency-Keyheader and its 200 replay, 409 conflict and 503 responses. Its operation id is nowcreateGoal.Docs
docs/mcp.mdanddocs/docs/operations/api-reference.md, with a cross-link added indocs/mcp-coverage.md.Tests
mcpTaskLineage.test.ts:attempts.mcpTaskSubmissions.test.tscovers a submission whose task was replaced, including a third attempt after the receipt resolved. I confirmed that check fails without the receipt fix.mcpIntegrationbuilds its own tables, so it now applies the lineage migration.taskSubmissionIntakeRoutes.mcpObservableSurface.The CLI needed no change, and since nothing here is visible in the UI there are no previews.
Detailed Logs:
9841369d-2a88-4819-8a1d-a0bcaf40a55cLog files stored at:
/usr/src/app/logs/executions/issue-3485-2026-11-13T00-53-17-423Z-conversation.json/usr/src/app/logs/executions/issue-3485-2026-11-13T00-53-17-423Z-output.txtLatest Conversation Messages
This PR was created automatically by ProPR after processing issue #3485.
💡 Need changes?
Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!