Skip to content

[3485 by Claude Opus 5.5] Expose retry lineage in MCP and OpenAPI and document idempotency contracts - #3517

Merged
integry merged 2 commits into
3482-epic-integration-signals-100from
3485/claude-opus-5-5-expose-retry-lineage-in-m-20261113-0031-wu6
Nov 13, 2026
Merged

integry merged 2 commits into
3482-epic-integration-signals-100from
3485/claude-opus-5-5-expose-retry-lineage-in-m-20261113-0031-wu6

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #3485

Branch: 3485/claude-opus-5-5-expose-retry-lineage-in-m-20261113-0031-wu6
Commits: ✅ 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: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.

Detailed Logs:

  • Conversation: 317 messages
  • Session: 9841369d-2a88-4819-8a1d-a0bcaf40a55c

Log files stored at:

  • conversation: /usr/src/app/logs/executions/issue-3485-2026-11-13T00-53-17-423Z-conversation.json
  • output: /usr/src/app/logs/executions/issue-3485-2026-11-13T00-53-17-423Z-output.txt
Latest Conversation Messages
ASSISTANT: [content unavailable]

ASSISTANT: 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" sec...


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!

…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.
@propr-dev

propr-dev Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

/ultrafix goal=8 max=10
Triggered automatically by the requested execution settings.

@propr-dev propr-dev Bot added the ultrafix label Nov 13, 2026
@propr-dev

propr-dev Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 10)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev

propr-dev Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

CI failed: Validate unsigned darwin-arm64 package

Please investigate and fix this CI failure.

  • Check: Validate unsigned darwin-arm64 package
  • Result: failure
  • Commit: 0c1a5487d7f1 (0c1a5487d7f14880ceeaebbb091da5c349810860)
  • Details: View CI failure

Failure evidence

.github:98
Process completed with exit code 1.

.github:1
Due to capacity constraints, jobs targeting macOS arm64 runners may experience longer queue times.

@propr-dev

propr-dev Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

CI failed: Validate unsigned linux-arm64 package

Please investigate and fix this CI failure.

  • Check: Validate unsigned linux-arm64 package
  • Result: failure
  • Commit: 0c1a5487d7f1 (0c1a5487d7f14880ceeaebbb091da5c349810860)
  • Details: View CI failure

Failure evidence

.github:98
Process completed with exit code 1.

@propr-dev

propr-dev Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

CI failed: Validate unsigned darwin-x64 package

Please investigate and fix this CI failure.

  • Check: Validate unsigned darwin-x64 package
  • Result: failure
  • Commit: 0c1a5487d7f1 (0c1a5487d7f14880ceeaebbb091da5c349810860)
  • Details: View CI failure

Failure evidence

.github:98
Process completed with exit code 1.

@propr-dev

propr-dev Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit edd511c

Processed 2 comments:

Summary of Changes

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.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-dev[bot]
  • Time: 4m 26s
  • Tokens: 640,955 (637,563 in / 3,392 out)
  • Cost: $0.41

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment IDs: 6840510365✓, 6840510709✓

@propr-dev

propr-dev Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

CI failed: Validate unsigned linux-x64 package

Please investigate and fix this CI failure.

  • Check: Validate unsigned linux-x64 package
  • Result: failure
  • Commit: 0c1a5487d7f1 (0c1a5487d7f14880ceeaebbb091da5c349810860)
  • Details: View CI failure

Failure evidence

.github:144
Process completed with exit code 1.

@propr-dev

propr-dev Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

CI failed: Finalize unsigned validation checksums

Please investigate and fix this CI failure.

  • Check: Finalize unsigned validation checksums
  • Result: failure
  • Commit: 0c1a5487d7f1 (0c1a5487d7f14880ceeaebbb091da5c349810860)
  • Details: View CI failure

Failure evidence

.github:42
Process completed with exit code 1.

.github:41
Unsigned packaging matrix finished with result 'failure'.

.github:1
"The ubuntu-latest label will migrate to Ubuntu 26 beginning October 19, 2026. For more information, see actions/runner-images#14748"

…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
@propr-dev

propr-dev Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

ℹ️ Analyzed the follow-up request by @propr-dev[bot]

Analysis Summary

I 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 0c1a548. In each packaging job (linux-x64, darwin-x64, and also darwin-arm64 and linux-arm64), the step that failed was "Audit committed dependency resolution" (npm run audit:runtime), and the log shows it flagging hono and @hono/node-server. "Finalize unsigned validation checksums" isn't a separate problem: it fails whenever any job in the packaging matrix fails.

This is the hono advisory problem that the latest commit (edd511ca0) already fixed by moving the root overrides pin from 4.13.12 to 4.13.18. With that commit checked out, npm run audit:runtime passes locally ("runtime dependency audit passed"), and it is the only audit script the root package.json defines.

I couldn't confirm it on CI. Every workflow run for edd511ca0, including "Desktop Package and Release", shows as cancelled, so the packaging checks need a re-run to go green.

No code changes were necessary based on the current state of the branch.


🤖 Analysis Details

  • Model: Claude Opus 5.5 (medium)
  • Time: 3m 6s
  • Tokens: 227,082 (225,736 in / 1,346 out)
  • Cost: $0.24

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment IDs: 6840513338✓, 6840516362✓, 6840517304✓

@propr-dev

propr-dev Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR exposes retry lineage consistently across MCP task reads and adds explicit first/latest submission pointers while preserving existing taskId semantics. The implementation is merge-ready within the reviewed scope, conditional on the pending Validate Changes check.

✅ Compatibility preserved — REST retains the first execution in taskId; MCP submission reads continue following the latest execution, with both pointers now explicit.

✅ 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 blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Include lineage in focused MCP suite

packages/api/test/mcpTaskLineage.test.ts is absent from the explicit test:mcp file list in package.json. Adding it would ensure the focused MCP command exercises the new lineage contract and response-budget regression. This is optional because omission from that focused command does not demonstrate a runtime defect or exclusion from the full test suite.

Score

The 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

  • Model: GPT-6 Astra
  • Time: 27s
  • Tokens: 66,803 (66,398 in / 405 out)
  • Cost: $0.57

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S1

🤖 Review by ProPR

@propr-dev propr-dev Bot removed the ultrafix label Nov 13, 2026
@integry
integry merged commit 87f0633 into 3482-epic-integration-signals-100 Nov 13, 2026
63 of 94 checks passed
@propr-dev propr-dev Bot mentioned this pull request Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant