Repository navigation
fix(bin): let captain-hold complete inventory an existing call held for another origin - #123
Merged
Merged
Conversation
…or another origin complete --cross-origin <task-id> attests an existing, still-open captain call whose recorded origin is a different task, so a report that lists it no longer has to register the same question twice. Unknown ids, closed or released calls, same-origin calls, and calls with no recorded origin are refused, and the call itself is never changed. The entry's origin is pinned in cross_origin_keys= metadata, and both complete and verify refuse a pinned entry whose recorded origin later changes.
Pibomeister
marked this pull request as ready for review
November 3, 2026 03:04
cursor Bot
pushed a commit
that referenced
this pull request
Nov 3, 2026
Bring in #122, #124, #123, and #121. No textual conflicts; keep the published-head resync owner on main's driving-block signature, freshen_spawn_worktree_base, and t3code skip. Co-authored-by: Eduardo Picazo <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
bin/fm-captain-hold.sh complete exits 1 when a report inventories an existing captain call whose origin is a different task. AgentKit example: existing call agent-kit-unattended-operator-setup has origin agent-kit-unattended-audit, and the resume report lists it (agent-kit-mate data/ak-resume-council-20261102/main-actions.md under ~/orca/workspaces/firstmate/). captain-hold-lifecycle forbids registering the same question twice, so the report cannot complete honestly.
What Changed
bin/fm-captain-hold.sh completenow takes--cross-origin <task-id>. A report can list a captain call that is already held for a different origin, so nobody has to register the same question twice. The flag accepts only an exact task id for a call that is still open, still held for the captain, and recorded under a different origin. The flag never changes the call or its recorded origin.decision_keys=and are also written to a newcross_origin_keys=metadata line. Latercompleteandverifypasses check them for durability only and skip the origin comparison. A later answer or a move of the call to another origin keeps the gate green. The refusal for a mismatched origin now names--cross-originas a fix. Thecompleteoutput lists the cross-origin calls.docs/captain-hold-lifecycle.mdand thecaptain-hold-lifecycleskill document the new flag.tests/fm-captain-hold-lifecycle.test.shadds coverage for the new behavior.Risk Assessment
✅ Low: The fix round does what the user decided. It removes the origin pin and the re-label guard, and it records cross-origin entries by id only. It keeps every attestation refusal the user asked for: unknown ids, closed calls, same-origin calls, calls with no recorded origin, and the origin itself. I traced the moved-call and repair sequences through the code, and both now complete and verify without rewriting the call's origin.
Testing
I made a disposable lab home and built the AgentKit case in it with the real script and the real tasks-axi backlog: the call
agent-kit-unattended-operator-setupis held foragent-kit-unattended-audit, andak-resume-council-20261102inventories it. A plaincompletestill exits 1, and its message now names the--cross-originpath.complete --cross-originexits 0 and writescross_origin_keys=to the metadata. The backlog keeps one row for the call, and the call's origin stays the same.verifypasses. Unknown ids, closed calls, the origin's own calls, calls with no origin, and the origin itself are all refused, and a refusal writes no attestation. After the call moves to another origin and then gets an answer,verifyand a repeatcompleteboth still pass. An ordinary entry whose call moved failsverifywith the repair advice, and the advised--cross-originrepair then works. I also ran the two focused regression tests, and both pass. I removed the lab home afterwards. This change has no UI, so the evidence is CLI transcripts.Evidence: Live lab-home CLI transcript (AgentKit scenario)
Source: Live lab-home CLI transcript (AgentKit scenario)
Evidence: Focused cross-origin regression tests
Source: Focused cross-origin regression tests
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 2 issues found → auto-fixed ✅
bin/fm-captain-hold.sh:1059- The origin-pin enforcement is not required by the intent, and it creates a permanent dead end whose error message gives a remedy that cannot work. The intent only needs a report to inventory an existing call held for another origin without registering it twice. It does not ask for later origin changes to be refused. Sequence:complete R --cross-origin Xpins X=A. Thenhold X --reason ... --origin Bruns, which is a supported move exercised by the new test.verify Rnow fails with 'review the call again and re-run complete'. Re-running can never succeed. bin/fm-captain-hold.sh:1981 skips re-attestation for an already pinned entry, bin/fm-captain-hold.sh:1988 keeps the old pin because pins only grow, and bin/fm-captain-hold.sh:1993 refuses again. The test confirms this at tests/fm-captain-hold-lifecycle.test.sh, wherecomplete --cross-origin sample-moved-callmust fail. Scout teardown callsverifybefore removing state (bin/fm-teardown.sh:3635), so R's teardown stays blocked until someone hand-edits the metadata, and docs/captain-hold-lifecycle.md documents no such repair for this case. Recommended remedy: remove the pin comparison and record only which entries are cross-origin (for examplecross_origin_keys=<id>,...), soverifyapplies the durability check alone. If the pin stays, the captain must decide what re-attestation does, andcomplete --cross-originmust then be able to re-pin after a fresh review. Same invariant also at bin/fm-captain-hold.sh:1905 (pin parsing), bin/fm-captain-hold.sh:1939 (pin creation) and bin/fm-captain-hold.sh:2066 (verify's pin check).bin/fm-captain-hold.sh:1983- The guard that refuses to re-attest an ordinary entry as cross-origin is not required by the intent, and it contradicts the new refusal advice. bin/fm-captain-hold.sh:1066 now tells the operator to 'list an existing call from another origin with --cross-origin $entry'. Sequence:complete R Xattests X with no recorded origin or with origin R. Thenhold X --reason ... --origin Bmoves it.verify Randcomplete Rboth fail with the new advice. Following it,complete R --cross-origin X, fails here with 'X is already attested as a call held for R', which is also false because X is now held for B. Removing the guard loses no safety: attest_cross_origin_entry already refuses same-origin calls (bin/fm-captain-hold.sh:1937) and calls with no origin (bin/fm-captain-hold.sh:1934). Without the guard, this path becomes a working repair for the moved call. Recommended remedy: remove the guard and its test block.🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
Live run in a disposable lab home made withbin/fm-lab-home.sh create, using the realbin/fm-captain-hold.shand the realtasks-aximarkdown backlog. Fleet override env vars were unset. Steps: hold, complete (plain and--cross-origin), verify, refusal cases, move, answer and the repair path.tests/fm-captain-hold-lifecycle.test.sh, limited totest_complete_refuses_an_entry_held_for_another_originandtest_complete_accepts_an_existing_call_held_for_another_origin✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.