Repository navigation
fix(bin): absorb routine secondmate working and paused status appends - #5535
kunchenguid merged 2 commits into
Conversation
…replies Fixes kunchenguid#2959 A kind=secondmate task's status signal was never absorbable, so a healthy mate's routine working: and paused: appends woke the primary every time. signal_crew_provably_working now reads the mate's lines new since the watcher's classified position: a decision, blocker, terminal outcome, note:, correlation-marked line, or unknown verb still surfaces regardless of busy evidence, while unmarked working:, paused:, and resolved: fall through to the same provably-working absorb an ordinary crewmate gets.
|
Speaking as Kun's firstmate: whole thread read (body; linked #2959 + prior stamps). Diff + green CI reviewed against main Verdict: merge · contract-class: restore · Firstmate flag: no · closes #2959: yes Tip check: main VISION.md per-rule:
CI CLEAN (19 checks). Squash-merging. |
|
Speaking as Kun's firstmate: this is merged. Thank you @karotkriss — really appreciate you taking the time on this. |
…kunchenguid#5535) * fix(bin): absorb routine second-mate progress while surfacing routed replies Fixes kunchenguid#2959 A kind=secondmate task's status signal was never absorbable, so a healthy mate's routine working: and paused: appends woke the primary every time. signal_crew_provably_working now reads the mate's lines new since the watcher's classified position: a decision, blocker, terminal outcome, note:, correlation-marked line, or unknown verb still surfaces regardless of busy evidence, while unmarked working:, paused:, and resolved: fall through to the same provably-working absorb an ordinary crewmate gets. * no-mistakes(review): narrow secondmate routine absorb to working and paused
…kunchenguid#5535) * fix(bin): absorb routine second-mate progress while surfacing routed replies Fixes kunchenguid#2959 A kind=secondmate task's status signal was never absorbable, so a healthy mate's routine working: and paused: appends woke the primary every time. signal_crew_provably_working now reads the mate's lines new since the watcher's classified position: a decision, blocker, terminal outcome, note:, correlation-marked line, or unknown verb still surfaces regardless of busy evidence, while unmarked working:, paused:, and resolved: fall through to the same provably-working absorb an ordinary crewmate gets. * no-mistakes(review): narrow secondmate routine absorb to working and paused
Intent
Fixes #2959
Every status line a second mate appends is treated as non-absorbable, so routine
working:andpaused:progress from a healthy second mate wakes the primary model on every append.Keep surfacing what the primary must read (decisions, blockers, terminal outcomes, explicit parent-directed notes, marked routed replies, and any line whose verb is unknown or whose mate cannot be proven healthy) and absorb unmarked routine progress the way ordinary crew status is absorbed.
This closes upstream issue #2959.
What Changed
_fm_secondmate_status_new_lines_routinetobin/fm-classify-lib.sh, which reads only the.statuslines appended since the watcher's classified position (fm_wake_signal_seen_size) and returns "routine" only when every new non-blank line is an unmarkedworking:orpaused:verb; any decision/blocker/terminal/note:/correlation-marked (corr=) line, unknown verb, or unreadable span keeps surfacing.signal_crew_provably_workingso akind=secondmate.statussignal now defers to the ordinary provably-working absorb for routine progress instead of unconditionally returning 1, stopping healthy-mateworking:/paused:appends from waking the primary on every append while unproven mates still surface.docs/architecture.mdto describe the status stream as absorbable for unmarked routine progress and surfacing for parent-directed content, and expandtests/fm-watch-triage.test.shcoverage for the new absorb/surface split.Risk Assessment
✅ Low: The change is well-bounded and correct: the routine-absorb path reads only lines new since the aligned classified byte offset, absorbs only working/paused from a provably-working mate, surfaces every marked, terminal, note, or unknown-verb line, and the fix round's narrowing to working+paused matches the intent and round-1 decision with a regression test proving unmarked resolved: still wakes the primary.
Testing
I derived scenarios from the intent and drove each against the real product: the classifier function signal_crew_provably_working() and a real fm-watch.sh watcher subprocess (via the suite's watch_bg harness). A healthy mate's unmarked working/paused progress is absorbed (no exit, no durable wake, suppressor advanced); decisions, blockers, terminal outcomes including an unmarked resolved:, note:, both correlation-marker forms, and any unknown verb surface; a mate that is not provably healthy still surfaces routine progress; an ordinary crewmate is unaffected. A direct 12-case drive of the classifier confirmed the absorb/surface split independently and captured a reviewer-visible transcript. No worktree artifacts left behind; all scenarios passed.
Evidence: secondmate absorb/surface behavior transcript
Source: secondmate absorb/surface behavior transcript
HEALTHY mate: working/paused absorbed; resolved/needs-decision/blocked/done/note/corr-marked/unknown-verb all surface. UNPROVEN mate: working surfaces. 12/12 cases matched expectation.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed ✅
bin/fm-classify-lib.sh:2462- The routine-absorb verb set is {working, paused, resolved}, but the User intent names only "unmarked routineworking:andpaused:progress" as absorbable and lists "terminal outcomes" among what must keep surfacing. Addingresolved(also codified in docs/architecture.md:86 and the tests) is a component the stated intent does not require: a secondmate that self-closes a decision with a bare, unmarkedresolved: ...line (the needs-decision already surfaced in a prior, classified span) will now be absorbed and will not wake the primary. It is defensible - the codebase already treatsresolvedas nonterminal (status_is_captain_relevant, fm-classify-lib.sh:221) and any corr-markedresolved corr=...still surfaces via the*corr=*guard at line 2459 - but it exceeds the intent's named absorb set. Confirm whether unmarkedresolved:should absorb, or narrow the arm to working+paused only. The remedy is a scope decision, not a mechanical fix.🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
FM_TEST_ONLY=test_secondmate_status_routine_absorbed_routed_surfaced_classifier bash tests/fm-watch-triage.test.shFM_TEST_ONLY=test_secondmate_routine_progress_absorbed_then_note_surfaced bash tests/fm-watch-triage.test.sh(drives a real fm-watch.sh subprocess)FM_TEST_ONLY=test_secondmate_status_note_surfaced_despite_busy_agent bash tests/fm-watch-triage.test.shFM_TEST_ONLY=test_secondmate_buried_block_wakes_despite_busy_agent bash tests/fm-watch-triage.test.shFM_TEST_ONLY=test_self_announced_close_after_fold_still_surfaces_folded_secondmate_lines bash tests/fm-watch-triage.test.shFM_TEST_ONLY=test_signal_crew_provably_working_classifier bash tests/fm-watch-triage.test.shDirect drive of signal_crew_provably_working() over 12 status-line cases against real bin/fm-classify-lib.sh✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.