Repository navigation
fix(bin): surface unrecognized status prefixes instead of reading them as silence - #5588
Conversation
A parked or holding declaration, and a verb whose correlation token did not parse, never became an event, so the supervisor still saw the earlier line.
…, add continuation tests
…e locally and fixed it by changing the test data in one test. No product code changed. **What failed:** `tests/fm-session-start.test.sh`, in `test_orphan_status_logs_are_printed`, with "matched status log was printed 2 times". **Why:** the test writes status lines with made-up prefixes, `matched: surfaced once` and `orphan: step N`. The test only uses them as placeholder text. It checks that the session-start digest prints each task's status tail exactly once. This PR (kunchenguid#4763) deliberately makes an unrecognized one-word lowercase prefix a status event. So those lines now surface as captain-relevant events, and the wake queue's STATUS OUTCOME BACKSTOP section prints them a second time. The code under review is behaving as the issue asks. Only the test's placeholder data had become meaningful. **Rule the test depends on:** its status lines must not be captain-relevant, so the digest is the only place they are printed. Both lines in this test broke that rule. The orphan line would have failed the same count check right after the matched line did. **Fix:** in that test only, I switched both lines to the recognized, non-captain verb `working:`: `working: surfaced once` and `working: orphan step 1..6`. I updated the matching assertions and counts to use the new text. What the test checks is unchanged: orphan logs are labelled, the tail is bounded, the log path is printed, and each tail appears once. **Verification:** before the fix, the test failed locally the same way as in CI. After it, `bash tests/fm-session-start.test.sh` reports "all assertions passed
…kunchenguid#5599/kunchenguid#5544 Keep unrecognized status-prefix eventing from kunchenguid#5588 inside main's shared _fm_status_line_is_event helper, and keep both the unrecognized- prefix latest-event sentence and the declared-wait foreign-key sentence in docs/architecture.md.
|
Speaking as Kun's firstmate: Verdict: Was otherwise auto-merge-ready restore (Fixes #4763 verified; green CI/NM; attestation MATCH at Conflict resolve (maintainerCanModify, existing branch contract-class: VISION: Interface honesty — aligns (bad declaration no longer silence). Authority — aligns. Scripts — aligns. Restart — aligns. Spine/vendor/scope — align. Attestation: MISMATCH vs body (still |
|
Speaking as Kun's firstmate: this is merged. Thank you @tiago-peixoto — really appreciate you taking the time on this. |
…m as silence (kunchenguid#5588) * fix(bin): surface an unrecognized status prefix instead of dropping it A parked or holding declaration, and a verb whose correlation token did not parse, never became an event, so the supervisor still saw the earlier line. * no-mistakes(review): Require verb-shaped unrecognized status prefixes, add continuation tests * no-mistakes(document): Document unrecognized status prefix escalation in afk skill * no-mistakes(ci): I reproduced the "Behavior portable serial 6" failure locally and fixed it by changing the test data in one test. No product code changed. **What failed:** `tests/fm-session-start.test.sh`, in `test_orphan_status_logs_are_printed`, with "matched status log was printed 2 times". **Why:** the test writes status lines with made-up prefixes, `matched: surfaced once` and `orphan: step N`. The test only uses them as placeholder text. It checks that the session-start digest prints each task's status tail exactly once. This PR (kunchenguid#4763) deliberately makes an unrecognized one-word lowercase prefix a status event. So those lines now surface as captain-relevant events, and the wake queue's STATUS OUTCOME BACKSTOP section prints them a second time. The code under review is behaving as the issue asks. Only the test's placeholder data had become meaningful. **Rule the test depends on:** its status lines must not be captain-relevant, so the digest is the only place they are printed. Both lines in this test broke that rule. The orphan line would have failed the same count check right after the matched line did. **Fix:** in that test only, I switched both lines to the recognized, non-captain verb `working:`: `working: surfaced once` and `working: orphan step 1..6`. I updated the matching assertions and counts to use the new text. What the test checks is unchanged: orphan logs are labelled, the tail is bounded, the log path is printed, and each tail appears once. **Verification:** before the fix, the test failed locally the same way as in CI. After it, `bash tests/fm-session-start.test.sh` reports "all assertions passed * no-mistakes(review): Detect unrecognized prefixes on unstamped lines; share verb list --------- Co-authored-by: Kun's firstmate <[email protected]>
…m as silence (kunchenguid#5588) * fix(bin): surface an unrecognized status prefix instead of dropping it A parked or holding declaration, and a verb whose correlation token did not parse, never became an event, so the supervisor still saw the earlier line. * no-mistakes(review): Require verb-shaped unrecognized status prefixes, add continuation tests * no-mistakes(document): Document unrecognized status prefix escalation in afk skill * no-mistakes(ci): I reproduced the "Behavior portable serial 6" failure locally and fixed it by changing the test data in one test. No product code changed. **What failed:** `tests/fm-session-start.test.sh`, in `test_orphan_status_logs_are_printed`, with "matched status log was printed 2 times". **Why:** the test writes status lines with made-up prefixes, `matched: surfaced once` and `orphan: step N`. The test only uses them as placeholder text. It checks that the session-start digest prints each task's status tail exactly once. This PR (kunchenguid#4763) deliberately makes an unrecognized one-word lowercase prefix a status event. So those lines now surface as captain-relevant events, and the wake queue's STATUS OUTCOME BACKSTOP section prints them a second time. The code under review is behaving as the issue asks. Only the test's placeholder data had become meaningful. **Rule the test depends on:** its status lines must not be captain-relevant, so the digest is the only place they are printed. Both lines in this test broke that rule. The orphan line would have failed the same count check right after the matched line did. **Fix:** in that test only, I switched both lines to the recognized, non-captain verb `working:`: `working: surfaced once` and `working: orphan step 1..6`. I updated the matching assertions and counts to use the new text. What the test checks is unchanged: orphan logs are labelled, the tail is bounded, the log path is printed, and each tail appears once. **Verification:** before the fix, the test failed locally the same way as in CI. After it, `bash tests/fm-session-start.test.sh` reports "all assertions passed * no-mistakes(review): Detect unrecognized prefixes on unstamped lines; share verb list --------- Co-authored-by: Kun's firstmate <[email protected]>
…m as silence (kunchenguid#5588) * fix(bin): surface an unrecognized status prefix instead of dropping it A parked or holding declaration, and a verb whose correlation token did not parse, never became an event, so the supervisor still saw the earlier line. * no-mistakes(review): Require verb-shaped unrecognized status prefixes, add continuation tests * no-mistakes(document): Document unrecognized status prefix escalation in afk skill * no-mistakes(ci): I reproduced the "Behavior portable serial 6" failure locally and fixed it by changing the test data in one test. No product code changed. **What failed:** `tests/fm-session-start.test.sh`, in `test_orphan_status_logs_are_printed`, with "matched status log was printed 2 times". **Why:** the test writes status lines with made-up prefixes, `matched: surfaced once` and `orphan: step N`. The test only uses them as placeholder text. It checks that the session-start digest prints each task's status tail exactly once. This PR (kunchenguid#4763) deliberately makes an unrecognized one-word lowercase prefix a status event. So those lines now surface as captain-relevant events, and the wake queue's STATUS OUTCOME BACKSTOP section prints them a second time. The code under review is behaving as the issue asks. Only the test's placeholder data had become meaningful. **Rule the test depends on:** its status lines must not be captain-relevant, so the digest is the only place they are printed. Both lines in this test broke that rule. The orphan line would have failed the same count check right after the matched line did. **Fix:** in that test only, I switched both lines to the recognized, non-captain verb `working:`: `working: surfaced once` and `working: orphan step 1..6`. I updated the matching assertions and counts to use the new text. What the test checks is unchanged: orphan logs are labelled, the tail is bounded, the log path is printed, and each tail appears once. **Verification:** before the fix, the test failed locally the same way as in CI. After it, `bash tests/fm-session-start.test.sh` reports "all assertions passed * no-mistakes(review): Detect unrecognized prefixes on unstamped lines; share verb list --------- Co-authored-by: Kun's firstmate <[email protected]>
Intent
Fixes #4763.
Implement ready-for-pr issue #4763: an unrecognized status prefix is silently not an event, so declared work reads as silence.
What Changed
bin/fm-classify-lib.shaddsstatus_prefix_unrecognized, which flags two kinds of declaration: a status line that starts with an unknown lowercase verb such asparked:orholding:, and a known verb whose correlation token is missing, mismatched, or written before the verb.The latest-event scan now counts such a line as an event, so an earlier recognized line can no longer hide it.
status_is_captain_relevantescalates it as the line itself.Recognized nonterminal verbs keep their existing classification.
Continuation prose is not treated as a prefix, including labels like
Reason:, URLs, and clock times._fm_status_verb_recognized), and the stamp is stripped from a line before its prefix is checked./afkskill anddocs/architecture.mdnow describe the new escalation.Tests cover it in
tests/fm-watch-triage.test.sh.Tests in
fm-classify-corr-tokenandfm-session-startwhose fixtures or assertions assumed unknown prefixes were silent are updated.Risk Assessment
✅ Low: The fix-round changes are small and correct: the prefix check now runs on the unstamped line, and the event scan uses the shared verb list with the same verb set as before; the added tests would fail on the pre-fix code.
Testing
I ran fm-watch.sh on the base and target commits against the same isolated status logs. The five failing line shapes from the issue were silently dropped on the base and woke the captain on the target. Recognized verbs and continuation lines produced the same watcher decision on both commits. The paused rows woke the captain on both commits. A control with a
paused:line alone did the same, so that wake is the watcher's normal first-sighting behavior, not something the continuation line causes. The new behavior test and the modified corr-token suite both pass. None of this ran against the live product, for two reasons. The runbook's bin/fm-lab-home.sh does not exist in this tree, so I could not start a lab primary. The runs also used the test suite's stand-in tmux and fm-crew-state.sh instead of a real crew pane. That is why every scenario below is marked untested. This change has no UI, so there are no screenshots.parked:afterworking:: the watcher wakes the captain with the parked lineholding:afterworking:: the watcher wakes the captaindonewith a mismatched corr token wakes the captain as itself and is not treated as a terminal doneparked [at=17:00]:anddone corr=deadbeef [at=17:00]:wake the captaindone:still wakes the captain,working:is still absorbedReason:,Note:,e.g.:or10:30afterpaused:/working:does not replace the declaration or change the watcher decisionEvidence: Watcher results on base a8572f6 (bug reproduced)
Source: Watcher results on base a8572f6 (bug reproduced)
Evidence: Watcher results on target 23ac31e (fixed)
Source: Watcher results on target 23ac31e (fixed)
Evidence: Paused-only control on both trees
Source: Paused-only control on both trees
Evidence: Watcher driver script
Source: Watcher driver script
Evidence: New behavior test result
Source: New behavior test result
Evidence: Base vs target summary
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
⏭️ **Rebase** - skipped
bin/fm-classify-lib.sh- merge conflict rebasing onto origin/maindocs/architecture.md- merge conflict rebasing onto origin/main🔧 **Review** - 2 issues found → auto-fixed ✅
bin/fm-classify-lib.sh:197-status_prefix_unrecognizedchecks for a space after the first colon on the raw line, not on the unstamped copy. The brief tells workers to write{state} [at=<epoch>]: ..., and the library already handles readable times like[at=17:00]as real worker output (see_fm_status_unstampedand tests/fm-classify-corr-token.test.sh:609 and 694). A readable time adds a colon inside the tag, so${line#*:}becomes00]: waiting, which does not start with a space, and the function returns 1. Reproduced on this commit:parked [at=17:00]: waitinggives unrecognized=1 and captain-relevant=1.parked [at=1790000000]: waitinggives 0 and 0.done corr=deadbeef [at=17:00]: xis also not relevant. Withworking [at=1]: afollowed byparked [at=17:00]: waiting upstream,last_status_linestill returns the working line. So the An unrecognized status prefix is silently not an event, so declared work reads as silence #4763 failure (a declared prefix reads as silence) is still reachable for a stamped line. The same check backs all three callers:_fm_status_line_is_event(line 258),status_is_captain_relevant(line 307), and the span reader through it (line 2333). Fix it in one place, the predicate: run the colon and space check on the_fm_status_unstampedcopy of the line (asstatus_line_notedoes), then add a behaviour case withparked [at=17:00]:anddone corr=deadbeef [at=17:00]:after aworking:line.bin/fm-classify-lib.sh:165- The new_fm_status_verb_recognizedrepeats the recognized-verb case list that_fm_status_line_is_event(lines 250-255) spells out inline. If one list gains or loses a verb without the other, the event scan and the unrecognized check disagree on the same line. Have_fm_status_line_is_eventcall_fm_status_verb_recognized "$verb" && return 0instead of keeping its own copy.🔧 Fix applied.
✅ Re-checked - no issues remain.
parked:afterworking:: the watcher wakes the captain with the parked line, Worker writesholding:afterworking:: the watcher wakes the captain,donewith a mismatched corr token wakes the captain as itself and is not treated as a terminal done, Readable-stampedparked [at=17:00]:anddone corr=deadbeef [at=17:00]:wake the captain, Recognized verbs unchanged:done:still wakes the captain,working:is still absorbed, Adversarial: a URL,Reason:,Note:,e.g.:or10:30afterpaused:/working:does not replace the declaration or change the watcher decisionparked:afterworking:: the watcher wakes the captain with the parked lineholding:afterworking:: the watcher wakes the captaindonewith a mismatched corr token wakes the captain as itself and is not treated as a terminal doneparked [at=17:00]:anddone corr=deadbeef [at=17:00]:wake the captaindone:still wakes the captain,working:is still absorbedReason:,Note:,e.g.:or10:30afterpaused:/working:does not replace the declaration or change the watcher decisiondrive-watch.sh <base-tree>anddrive-watch.sh <worktree>: 17 status-log scenarios run through the real bin/fm-watch.sh against isolated FM_STATE_OVERRIDE state dirs, with the tests' stand-in tmux and fm-crew-state.sh; base and target results compareddrive-paused-control.shon both trees: apaused:line alone, as a control for the paused-with-continuation rowstests/fm-watch-triage.test.sh::test_unrecognized_status_prefix_is_visible(the new behavior test, run on its own)bash tests/fm-classify-corr-token.test.sh(modified suite, 0 failures)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.