Repository navigation
fix(bin): report declared pauses instead of unknown for parked crew seats - #6191
Open
RooseveltAdvisors wants to merge 3 commits into
Open
RooseveltAdvisors wants to merge 3 commits into
RooseveltAdvisors wants to merge 3 commits into
Conversation
|
| # holds unlanded work - endpoint gone, no attributable run - is a crew on a | ||
| # DECLARED wait, not unexplained silence. A current paused: declaration in the | ||
| # status log outranks every unknown verdict (emit's declared-pause read owns | ||
| # the rule for every source except remote-endpoint). Both directions pin the |
There was a problem hiding this comment.
Remote exception lacks a test. The new tests cover several cases where
unknown becomes paused, but none checks the remote-endpoint exception. A test with a current paused: log and an unreachable or dead remote endpoint would catch a future regression that hides a remote connectivity failure as a declared wait.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
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
A seat that is intentionally stopped while it holds unlanded work cannot be read as parked, so supervision never sees its pause and keeps treating it as unexplained silence. Reproduced this tick on two long-parked tasks: bin/fm-crew-state.sh answers state: unknown - source: run-step - selected run code identity unverified for a task whose worktree still holds two unlanded modified files with its seat gone, and state: unknown - source: none - worktree gone for another - even though BOTH status logs carry a declared pause. A declared wait that the supervisor cannot read is not a declared wait.
What Changed
bin/fm-crew-state.sh:emitnow checks the current status-log line before it prints anyunknownverdict. If that line is a pause, the output becomesstate: paused · source: status-log, followed by the pause note and then the original unknown detail. Unknown verdicts with theremote-endpointsource are exempt. A pause that a later status event has superseded no longer counts, so the verdict staysunknown.tests/fm-crew-state.test.sh: five regression tests cover these cases:pausedpausedpausedunknownunknown🤖 Generated with Claude Code
Risk Assessment
✅ Low: The change is limited to one
emitchoke point: a current declared pause turns every non-remote unknown verdict into paused and keeps the original evidence in the detail. It reusesstatus_current_line, so a pause that was superseded or is not current cannot hide real silence. The only machine consumer (crew_absorb_class) parses just the state and source, and new behavior-level tests cover the dead-window, torn-down-worktree, run-step, superseded-pause and no-pause cases.Testing
I ran the targeted fm-crew-state behaviour suite and it passes on the target commit. Its new regressions fail on the base script, which proves they catch the reported bug. I also captured a before/after CLI transcript of the two scenarios from the intent. On the base commit it gives the exact reported lines:unknown · run-step · selected run code identity unverifiedandunknown · none · worktree gone. On the fix both readpaused · status-log · <pause reason> · <original evidence>. No UI surface is involved; temporary harness files were removed and the worktree is clean.Evidence: Before/after fm-crew-state transcript for the two parked-seat scenarios from the intent
Source: Before/after fm-crew-state transcript for the two parked-seat scenarios from the intent
BEFORE: state: unknown · source: run-step · selected run code identity unverified; run ids: 01RUN BEFORE: state: unknown · source: none · worktree gone (torn down?) AFTER: state: paused · source: status-log · holding for upstream release before landing · selected run code identity unverified; run ids: 01RUN AFTER: state: paused · source: status-log · waiting on captain decision · worktree gone (torn down?)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-crew-state.sh:229- When emit turns an unknown verdict into paused, it replaces the original detail with the pause note, so the evidence behind the unknown disappears. For example, a dead tmux window withpaused: holding for Xnow reportsstate: paused · source: status-log · holding for X, and 'backend target gone: fm:...' / 'worktree gone (torn down?)' / 'selected run code identity unverified; run ids: ...' are all dropped. A supervisor or the captain reading the line cannot tell that the seat is gone or the worktree is missing, which the intent's parked-seat case needs to know (for example, whether to relaunch or tear down after the wait clears). crew_absorb_class only parses state and source, so appending the original detail after the pause note (e.g.detail="$(status_line_note "$current")${detail:+${SEP}$detail}") keeps the evidence and changes no consumer.tests/fm-crew-state.test.sh:3032- The new tests cover the endpoint-gone and worktree-gone cases, but not the run-step case the intent reproduced ('state: unknown - source: run-step - selected run code identity unverified' with a declared pause). emit handles all sources centrally, so the behaviour follows, but a regression test on one run-step unknown path with a current pause would pin the reported failure directly.🔧 Fix: Keep unknown evidence in paused output; add run-step test
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-crew-state.test.shat target e4e40fb3: every case passes, including the 5 new ones (dead window with pause, dead window without pause, torn-down worktree with pause, superseded pause, run-step 'selected run code identity unverified' with pause)Fail-before check: swapped ingit show c35b9a69:bin/fm-crew-state.shand ran the same suite; it failed attest_dead_window_declared_pause_reads_pausedwithstate: unknown · source: none · backend target gone. Restored withgit checkout -- bin/fm-crew-state.shManual before/after CLI transcript using the suite's hermetic fakes (fake tmux with the window gone, fake no-mistakes run record whose identity cannot be verified, a real git worktree holding 2 unlanded files, and a missing-worktree case), each with apaused:status log, run throughbin/fm-crew-state.shon the base and target commits✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.