Repository navigation
Closed
Description
Problem
Retry lineage and idempotency are implemented but only partly visible:
- Replacement lineage (
attemptNumber,replacesTaskId,replacedByTaskId,attemptLineage[]) is returned by RESTGET /api/task/:taskId/historyandpropr task get --json, but not by MCPget_task/list_tasks. Over MCP it is visible only inside rawget_task_eventsmetadata. - In OpenAPI,
TaskHistory.taskInfois a loose object, so the lineage fields are neither pinned by the conformance test nor present in the generated client types. - A task submission has two task pointers (
task_id= first execution,latest_task_id= latest attempt); only one is returned and the relation to replacement attempts is undocumented. - Three idempotency key contracts exist (MCP
idempotencyKey8-128 chars[\w.-]; RESTIdempotency-Keyup to 255 chars, required for submissions and goals; optional for automation runs) andcreate_taskrewrites the key tomcp-{operationId}for the REST layer. None of this is documented in one place, and the goalIdempotency-Keycontract is absent from OpenAPI.
What to build
- MCP task reads.
get_taskreturnslineage: { attemptNumber, rootTaskId, replacesTaskId, replacedByTaskId, replacementCause, replacementState, attempts: [{taskId, attemptNumber, replacementCause, state, createdAt}] }(attempts only when more than one).list_tasksrows gainattemptNumber,replacesTaskId,replacedByTaskId(omit when the task is a first and only attempt, to keep rows small). Reusepackages/api/routes/taskAttemptLineage.ts. - Submission reads.
get_task_submission/list_task_submissionsand RESTGET /api/task-submissions/:keyreturn bothfirstTaskIdandlatestTaskId(keeptaskIdas it is today for compatibility and document which one it is). - OpenAPI. Give
TaskHistory.taskInfoan explicit schema including the lineage fields andattemptLineage; keep it tolerant of extra fields only where needed so existing responses still conform. Document the goal createIdempotency-Keyheader and its 409 conflict in the route docs. Regenerate the spec and client types. - Docs. One section "Idempotency and retries" in
docs/mcp.mdand the API reference covering: the three key contracts and their formats; same key + same payload replays, same key + different payload conflicts;OUTCOME_UNKNOWN; how an MCP key maps to the REST submission key;IMPLEMENTATION_ALREADY_REQUESTEDforimplement_plan; how to follow a submission through replacement attempts (latestTaskId,lineage); which task kinds are replaced (issue tasks only, never goal tasks) and the replacement causes and skip reasons.
Out of scope
No change to idempotency or replacement behaviour, key formats, or caps.
Acceptance criteria
get_taskon a replaced task and on its replacement returns consistent lineage in both directions; a task with a single attempt returnsattemptNumber: 1and noattemptsarray.list_tasksrows expose the three fields for replacement attempts and stay within the tool result budget.- Submission reads return both task pointers; a test covers a submission whose task was replaced.
- The OpenAPI conformance test now pins the lineage fields; generated client types include them.
mcpObservableSurface,mcpDocs,mcpToolInputBudget, OpenAPI coverage/conformance tests pass; committed spec matches the generator.- The docs section exists in both places and names only real tools and codes.
Implementation
- MCP: extend
packages/api/mcp/goalTaskDetail.ts/listSummaries.tsand theget_task/list_tasksprojections inpackages/api/mcp/tools.tsusingtaskAttemptLineage.ts. - Submissions:
submissionResultinpackages/api/mcp/toolsTaskSubmissions.ts, the public shape inpackages/api/routes/taskSubmissionRoutes.ts. - OpenAPI: schema in
packages/api/openapi/schemas.ts, goal route docs,npm run gen:openapi. - Tests:
packages/api/test/mcpTaskSubmissions.test.ts, a new MCP lineage test,taskHistoryRoutes.test.ts,packages/cli/src/commands/taskCommands.test.tsif output changes. - Docs in
docs/mcp.md,docs/mcp-coverage.md,docs/docs/operations/api-reference.md; allow-list any new non-tool backticked tokens inpackages/api/test/mcpObservableSurface.test.ts.
Notes
Lineage storage: packages/core/src/db/migrations/20261006000000_add_task_replacement_lineage.js. Existing lineage docs: docs/docs/architecture/worker.md, docs/docs/operations/troubleshooting.md.
Activity
propr-dev commentedon Nov 13, 2026
🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
claudeclaude-opus-5-53485/claude-opus-5-5-expose-retry-lineage-in-m-20261113-0031-wu63482-epic-integration-signals-100issue-3485-20261113-0031-claude-opus-5-5-wu6🔍 Track Task Execution
I've implemented #3485. MCP and REST now return retry lineage and bot…