Skip to content

fix: keep every origin on a captain-held task - #63

Merged
peterOC26 merged 2 commits into
mainfrom
fm/fm-captain-hold-multi-origin-m1
Nov 14, 2026
Merged

peterOC26 merged 2 commits into
mainfrom
fm/fm-captain-hold-multi-origin-m1

Conversation

@peterOC26

Copy link
Copy Markdown
Owner

Intent

Fix bin/fm-captain-hold.sh so that one held task can carry more than one --origin. Found 2026-10-11: three consult scouts (pv-voice-any-question-consult-{fable,astra,grok}-c1) all gated one captain call held on pv-voice-any-question-q1. Each hold --origin overwrote the previous origin, so complete for fable and astra was recorded against a task held for grok, and complete --none is refused afterwards. Fix: allow several origins per held task, or let complete be re-recorded once the call is answered.
Q1994 (2026-11-10): "q1994 use grok and deepseek" - firstmate upkeep fixes are built on Grok and checked on DeepSeek.

What Changed

  • bin/fm-captain-hold.sh hold --origin now adds a new Captain hold origin: line after any existing ones. Before, each hold replaced the previous origin. Holding again with an origin that is already recorded leaves the task body unchanged.
  • complete and verify (verify_entry_durable) now read every recorded origin and accept a held task when any of them matches the origin being completed, compared by backend identity. A task is refused only when none of its origins match, and the error lists all of them. Holds with no recorded origin are still accepted on the durability check alone.
  • Updated docs/captain-hold-lifecycle.md and the script's header comments to describe multiple origins per task. Added a lifecycle test where three origins hold one call. It checks that all three origins are kept, that holding again with the same origin adds nothing, that complete --none is refused while a decision is still open, and that the mismatch error names every recorded origin.

🤖 Generated with Claude Code

Risk Assessment

✅ Low: The change is small and bounded: hold now appends canonicalized origin lines idempotently, complete/verify accept any recorded origin by backend identity, the docs match, and a regression test replays the reported three-scout scenario; the one semantic tradeoff (no reassociation path) was already declined by the user.

Testing

I ran the real fm-captain-hold.sh CLI with real tasks-axi in disposable lab homes. With the fix, three origins holding one call are all recorded in hold order, and repeating an origin adds nothing. Fable, astra and grok each complete, verify and then complete --none successfully. An unrelated origin is refused, the error names all three recorded origins, and no attestation is written. The base-commit script, run the same way, keeps only grok and refuses fable, which is the reported bug. The six origin-related tests in the lifecycle file passed; I stopped that file early because broader regression belongs to CI. The lab homes are removed. A mistyped cleanup path also ran rm -rf on an unrelated /tmp/fm-lab.3gC0nG path (see findings).

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Three consult scouts hold one captain call with different --origin values; the task body keeps all three origin lines in hold order ✅ pass live multi-origin-cli-transcript.txt S1: body has fable, astra and grok Captain hold origin: lines
Re-holding with an origin already recorded adds no duplicate line ✅ pass live multi-origin-cli-transcript.txt S2: one grok line, set unchanged
complete, verify and then complete --none succeed for every recorded origin (fable and astra were previously refused) ✅ pass live multi-origin-cli-transcript.txt S3: all nine commands exit 0; baseline-before-fix-transcript.txt shows the old script refusing fable
Adversarial: an origin that never held the call is refused, the error names every recorded origin, and no attestation is written ✅ pass live multi-origin-cli-transcript.txt S4: exit 1 with the full origin list; decisions_reviewed count 0
Evidence: Fixed CLI transcript (multi-origin hold/complete/verify/adversarial)

Source: Fixed CLI transcript (multi-origin hold/complete/verify/adversarial)

=== S1: three scouts hold the same call ===
$ fm-captain-hold.sh hold pv-voice-any-question-q1 --title Voice question --reason captain must answer the voice question --repo sample --origin pv-voice-any-question-consult-fable-c1
pv-voice-any-question-q1
[exit 0]
$ fm-captain-hold.sh hold pv-voice-any-question-q1 --title Voice question --reason captain must answer the voice question --repo sample --origin pv-voice-any-question-consult-astra-c1
pv-voice-any-question-q1
[exit 0]
$ fm-captain-hold.sh hold pv-voice-any-question-q1 --title Voice question --reason captain must answer the voice question --repo sample --origin pv-voice-any-question-consult-grok-c1
pv-voice-any-question-q1
[exit 0]
task:
  id: pv-voice-any-question-q1
  title: Voice question
  state: queued
  blocked: no
  blocked_by: none
  held: yes
  hold_reason: "fm-hold-v1:Y2FwdGFpbiBtdXN0IGFuc3dlciB0aGUgdm9pY2UgcXVlc3Rpb24="
  hold_kind: captain
  hold_until: "-"
  kind: captain
  repo: sample
  priority: "-"
  created: 2026-11-14
  closed: "-"
  deps: none
  links: none
  body: "Captain hold set: 2026-11-14T13:42:04Z\nCaptain hold origin: pv-voice-any-question-consult-fable-c1\nCaptain hold origin: pv-voice-any-question-consult-astra-c1\nCaptain hold origin: pv-voice-any-question-consult-grok-c1\n\nOrigin: pv-voice-any-question-consult-fable-c1"
=== S2: repeat hold with grok origin (idempotent) ===
$ fm-captain-hold.sh hold pv-voice-any-question-q1 --reason captain must answer the voice question --origin pv-voice-any-question-consult-grok-c1
pv-voice-any-question-q1
[exit 0]
1
Captain hold origin: pv-voice-any-question-consult-fable-c1
Captain hold origin: pv-voice-any-question-consult-astra-c1
Captain hold origin: pv-voice-any-question-consult-grok-c1
=== S3: complete + verify for each origin (fable/astra previously refused) ===
$ fm-captain-hold.sh complete pv-voice-any-question-consult-fable-c1 pv-voice-any-question-q1
complete: pv-voice-any-question-consult-fable-c1 captain-call inventory reviewed (pv-voice-any-question-q1)
[exit 0]
$ fm-captain-hold.sh verify pv-voice-any-question-consult-fable-c1
verified: pv-voice-any-question-consult-fable-c1 captain-call inventory
[exit 0]
$ fm-captain-hold.sh complete pv-voice-any-question-consult-fable-c1 --none
complete: pv-voice-any-question-consult-fable-c1 captain-call inventory reviewed (pv-voice-any-question-q1)
[exit 0]
$ fm-captain-hold.sh complete pv-voice-any-question-consult-astra-c1 pv-voice-any-question-q1
complete: pv-voice-any-question-consult-astra-c1 captain-call inventory reviewed (pv-voice-any-question-q1)
[exit 0]
$ fm-captain-hold.sh verify pv-voice-any-question-consult-astra-c1
verified: pv-voice-any-question-consult-astra-c1 captain-call inventory
[exit 0]
$ fm-captain-hold.sh complete pv-voice-any-question-consult-astra-c1 --none
complete: pv-voice-any-question-consult-astra-c1 captain-call inventory reviewed (pv-voice-any-question-q1)
[exit 0]
$ fm-captain-hold.sh complete pv-voice-any-question-consult-grok-c1 pv-voice-any-question-q1
complete: pv-voice-any-question-consult-grok-c1 captain-call inventory reviewed (pv-voice-any-question-q1)
[exit 0]
$ fm-captain-hold.sh verify pv-voice-any-question-consult-grok-c1
verified: pv-voice-any-question-consult-grok-c1 captain-call inventory
[exit 0]
$ fm-captain-hold.sh complete pv-voice-any-question-consult-grok-c1 --none
complete: pv-voice-any-question-consult-grok-c1 captain-call inventory reviewed (pv-voice-any-question-q1)
[exit 0]
=== S4 adversarial: unrelated origin ===
$ fm-captain-hold.sh complete pv-voice-any-question-consult-other-c1 pv-voice-any-question-q1
fm-captain-hold: captain-held task pv-voice-any-question-q1 was held for origin pv-voice-any-question-consult-fable-c1, pv-voice-any-question-consult-astra-c1, pv-voice-any-question-consult-grok-c1, not pv-voice-any-question-consult-other-c1; hold a task for pv-voice-any-question-consult-other-c1 or list the right one
[exit 1]
0
Evidence: Baseline (pre-fix ac22532) transcript reproducing the bug

Source: Baseline (pre-fix ac22532) transcript reproducing the bug

  body: "Captain hold set: 2026-11-14T13:42:57Z\nCaptain hold origin: pv-voice-any-question-consult-grok-c1\n\nOrigin: pv-voice-any-question-consult-fable-c1"
$ [base ac22532] fm-captain-hold.sh complete pv-voice-any-question-consult-fable-c1 pv-voice-any-question-q1
fm-captain-hold: captain-held task pv-voice-any-question-q1 was held for origin pv-voice-any-question-consult-grok-c1, not pv-voice-any-question-consult-fable-c1; hold a task for pv-voice-any-question-consult-fable-c1 or list the right one
[exit 1]
Evidence: Lifecycle test log (partial; origin tests ok)

Source: Lifecycle test log (partial; origin tests ok)

ok - marked hold reasons round-trip through public reads, fleet, startup, and return without changing other fields
ok - new, active, and released holds publish origins after backend success, keep earlier origins, and work with and without deferral
Terminated
Terminated
Terminated
Terminated
ok - failed and interrupted origin moves cannot inherit active, expired, replayed, or completed calls
ok - historical self-inventories name a workable repair that preserves sibling entries
ok - completion and verification compare backend identities for entries and current or stored origins
ok - complete refuses the origin as its own captain-call inventory
ok - complete refuses an entry held for another origin and flags one with none recorded
ok - one captain call keeps every origin that held it
ok - report-only unresolved captain call is reproduced and completion refuses before loss
ok - both body-decoding paths work without the allow_nonref default
ok - cleanup preserves every byte of a retained body's non-ASCII characters
ok - the completion gate attests captain-held inventory and transfers open status decisions
ok - answer records the captain's words, closes idempotently, and releases routed work
ok - release frees held work with the captain's words recorded and the body preserved
ok - a captain hold is released only in an attended session: away refuses, quiet and no record release
ok - a release waiting on the task lock rechecks the away posture under the lock
ok - captain holds become visible only after their hold-set timestamp is durable
ok - an interrupted answer preserves its hold age until close retry
ok - a deferred captain call leaves the live Captain's Call until its date and stays answerable
ok - an out-of-band close is recordable with the captain's word and nothing else
ok - ended visual review follows the same captain-hold completion owner
ok - resolved findings and decision-like prose do not create captain-held tasks
ok - completion keeps an armed PR identity last in the task record
ok - completion replaces a completion pair recorded after pr= by the previous writer
ok - terminal single-owner stale status decisions do not block empty inventory
ok - main-home and secondmate-home captain calls remain correctly routed
ok - a secondmate home publishes each hold occurrence and its answer on the parent channel
ok - secondmate resolutions publish before retiring durable retry triggers
ok - a bound channel's captured answers close their captain-held tasks at answer time
ok - only a bound captured source creates reconcile requests
Terminated
  • Outcome: ⚠️ 1 info across 1 run (12m2s)

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

⚠️ **Test** - 1 info
  • ℹ️ Cleanup mistake during testing: a mistyped path made me run rm -rf /tmp/fm-lab.3gC0nG instead of my own lab (/tmp/fm-lab.R8wure). That path was not created by this run, and I could not confirm whether it existed beforehand. If another session was using a lab with that name, it may have been removed. No repository or fleet data was involved.
  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Three consult scouts hold one captain call with different --origin values; the task body keeps all three origin lines in hold order ✅ pass live multi-origin-cli-transcript.txt S1: body has fable, astra and grok Captain hold origin: lines
Re-holding with an origin already recorded adds no duplicate line ✅ pass live multi-origin-cli-transcript.txt S2: one grok line, set unchanged
complete, verify and then complete --none succeed for every recorded origin (fable and astra were previously refused) ✅ pass live multi-origin-cli-transcript.txt S3: all nine commands exit 0; baseline-before-fix-transcript.txt shows the old script refusing fable
Adversarial: an origin that never held the call is refused, the error names every recorded origin, and no attestation is written ✅ pass live multi-origin-cli-transcript.txt S4: exit 1 with the full origin list; decisions_reviewed count 0
  • Lab home from bin/fm-lab-home.sh create, markdown tasks backend, three origins (fable/astra/grok consult scouts), each with a status decision: ran fm-captain-hold.sh hold pv-voice-any-question-q1 --origin <each> and printed the call with tasks-axi show --full
  • Repeated hold ... --origin pv-voice-any-question-consult-grok-c1 and counted the origin lines
  • For each origin: complete <origin> pv-voice-any-question-q1, verify <origin>, complete <origin> --none
  • Adversarial: complete pv-voice-any-question-consult-other-c1 pv-voice-any-question-q1 for an origin that never held the call, then checked its meta for an attestation
  • Baseline: the same holds plus complete fable using the base commit ac22532 script in a second lab home
  • bash tests/fm-captain-hold-lifecycle.test.sh: ran until the origin-related tests (including test_one_call_keeps_every_origin_that_held_it) reported ok, then stopped it
✅ **Document** - passed

✅ No issues found.

🔧 **Lint** - 1 issue found → no changes applied (2) ✅
  • ⚠️ linter found issues (exit code 1)

🔧 No changes applied.
1 warning still open:

  • ⚠️ linter found issues (exit code 1)

🔧 No changes applied.
✅ Re-checked - no issues remain.

✅ **Push** - passed

✅ No issues found.

A later hold --origin replaced the earlier association, so several
reviews of one call could not complete against it. Append each origin,
ignore a repeated one, and accept any recorded origin in complete and
verify.
The first-hold branch only runs when the body has no origin line, so
the filter that strips those lines never matches.
@peterOC26
peterOC26 merged commit 4cdc3a7 into main Nov 14, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant