Repository navigation
feat: add durable captain decision holds - #593
Merged
Merged
Conversation
kunchenguid
force-pushed
the
fm/fm-decision-hold-lifecycle-k9
branch
from
July 16, 2026 03:13
e7fe825 to
d39703b
Compare
Marl0nL
added a commit
to Marl0nL/firstmate
that referenced
this pull request
Jul 16, 2026
Intent
The developer wanted to fix firstmate bearings so registered secondmates are summarized from authoritative structured state in each secondmate home rather than stale append-only parent status events, while preserving a complete standalone four-section report contract. They required an end-to-end reproduction of a stale parent event case, regression coverage for structured authority, externally held work, captain decisions, invalid or timed-out homes, bounded counts, zero-network default behavior, live-PR opt-in compatibility, and repeated reports retaining the same current recent-completions baseline. They also required loading and preserving the firstmate coding and bearings skills as contract owners, keeping AGENTS.md concise, updating script headers and help for mechanics, adding colocated tests, using plain dashes and one sentence per Markdown line, and avoiding agent co-author metadata. During review they explicitly approved fixes to keep parent decisions and terminal tails as untrusted contradiction evidence only, correctly classify parked/failed/done and inconsistent child state, surface registry-level unavailability, bound and timeout registry parsing with truncation metadata, avoid false unregistered labels when registry completeness is unknown, and treat unkeyed legacy evidence as inconclusive unless reliably matched. They wanted the no-mistakes pipeline driven through review, tests, lint, docs, push, PR, and green CI without using --yes, then report the final PR URL.
What Changed
fm-decision-hold.shand a documented durable lifecycle for recording, verifying, retrying, and completing captain decision holds.Risk Assessment
Testing
The configured full baseline was already green; I reran the focused bearings, decision-hold lifecycle, fleet snapshot view, and brief tests, then manually exercised the CLI against a stale parent secondmate event with authoritative structured secondmate-home state and captured JSON/TOON evidence showing no default network access and the expected Captain's Call, Charted Next, and Recently Landed projection.
Evidence: Manual bearings structured-authority summary
Manual bearings structured-authority fixture passed. It shows stale parent event absent from in_flight, authoritative secondmate home as captain_decision, captain hold, legal gate, phase7 landed record, local-only PR mode, and an empty net log.Evidence: Manual bearings JSON output
Evidence: Manual bearings TOON output
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
🔧 **Rebase** - 1 issue found → auto-fixed ✅
AGENTS.md- merge conflict rebasing onto origin/main🔧 Fix applied.
✅ Re-checked - no issues remain.
bin/fm-decision-hold.sh:293-complete/verifycheck the rawstatus_open_decisionsfold, so a single-owner scout that loggedneeds-decision:and laterdone:is still treated as having an opendefaultdecision. The fleet snapshot already clears that stale status state for terminal scout/ship tasks, but this new teardown gate does not, sofm-decision-hold.sh complete <id> --noneand later scout teardown can be refused for a completed report whose semantic inventory has no unresolved decision. Apply the same lifecycle reconciliation here, or otherwise ignore terminal stale status decisions for non-secondmate origins.🔧 Fix: Reconcile terminal decision holds
1 warning still open:
bin/fm-bearings-snapshot.sh:360-decisions_openis now built only from structured captain-hold backlog rows, so a live main-home crewmate that follows the existing brief and appendsneeds-decision:will no longer appear in Bearings' Captain's Call. That is intentional for untrusted secondmate parent/status evidence, but for ordinary direct reports the canonical snapshot still exposes.tasks[].hints.open_decisions, and without projecting those rows the captain can get an empty decision list while a task is parked waiting for them.✅ **Test** - passed
✅ No issues found.
command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"Configured baseline already ran successfully before this validation:command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"bash tests/fm-bearings-snapshot.test.shbash tests/fm-decision-hold-lifecycle.test.shbash tests/fm-fleet-snapshot-view.test.shbash tests/fm-brief.test.shManual evidence fixture under/var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T/no-mistakes-evidence/01KXMCCRPBVVP0ADE5WJ3NXGDN/manual-bearings-authority: ranbin/fm-bearings-snapshot.sh --jsonand default TOON against a parent stale secondmate event plus authoritative secondmate-home backlog, then asserted the JSON fields withjqand verified the default net log stayed empty.Final cleanup/status checks:git status --shortandfind . -maxdepth 3 \( -name '.pytest_cache' -o -name 'node_modules' -o -name 'coverage' -o -name '.cache' -o -name 'tmp' -o -name '*.tmp' \) -print✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.