Repository navigation
fix(watch): stop repeated stale wakes for held decisions, merge-ready tasks, and active pipeline steps - #4336
Open
tim-akihiro wants to merge 2 commits into
Open
tim-akihiro wants to merge 2 commits into
tim-akihiro wants to merge 2 commits into
Conversation
… tasks, and active pipeline steps fm-watch.sh only absorbed a quiet endpoint when the crew's last status line carried paused or captain-held, so a ship task parked with needs-decision: under a clean captain-hold, or a done: task only waiting on merge approval, kept re-triggering stale wakes every poll. - fm-captain-hold.sh hold now appends the captain-held transfer itself when the held task id matches an open keyed decision in its status stream, so the status log agrees with the backlog without needing the investigation complete gate. - wedge_timer_check absorbs a completed task with an open captain call (merge approval) instead of escalating it as a possible wedge. - wedge_timer_check rechecks fm-crew-state's authoritative run step at the wedge boundary and resets the timer while a pipeline step is actively running, instead of alarming on an unchanged pane whose work is happening in a background shell. - A declared-pause window already wedge-tracked because it was overridden by an active run step now keeps tracking (via a dedicated override marker) once that step stops, instead of silently falling back to the low-urgency paused recheck cadence and hiding a real wedge. Each case has a test pinning the absorb/report boundary so a genuinely stalled task still surfaces.
…ption in architecture/config
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
Firstmate weckt unnoetig, wenn eine Aufgabe auf den Auftraggeber wartet. Gemessen 04.09.2026 an i8-historie-verursacher-lesbar: ein Ship-Arbeiter, der mit "needs-decision:" parkt und dessen Backlog-Aufgabe per bin/fm-captain-hold.sh hold sauber gehalten wird, loest weiter alle paar Minuten eine stale-Weckung aus. Drei Mal hintereinander beobachtet, jedes Mal ohne Handlungsbedarf.
Ursache, bereits eingegrenzt: fm-watch.sh absorbiert eine ruhige Endstelle nur, wenn die LETZTE Statuszeile das Verb "paused" oder "captain-held" traegt (bin/fm-classify-lib.sh:169 status_is_captain_held, bin/fm-watch.sh:866). Hier ist die letzte Zeile aber "needs-decision:". Die Zeile "captain-held [key=...]" schreibt nach heutigem Stand nur bin/fm-captain-hold.sh complete, und complete ist das Abschluss-Gate einer Untersuchung, nicht der richtige Aufruf fuer eine laufende Ship-Aufgabe mitten in der Arbeit. "paused:" waere fachlich falsch, das meint laut Vertrag eine begrenzte aeussere Wartezeit, die sich von selbst aufloest.
ZWEITER FALL desselben Lochs, gemessen 04.09.2026 an i8-prove-spot-buchungspfad: eine fertige Ship-Aufgabe, deren letzte Statuszeile "done:" traegt und die nur noch auf die Merge-Freigabe wartet, weckt aus demselben Grund weiter mit stale.
DRITTER, VERWANDTER FALL, gemessen 04.09.2026 an i8-historie-verursacher-lesbar: ein Arbeiter, der seine Arbeit in Hintergrund-Shells laufen laesst, zeigt eine unveraenderte Endstelle, waehrend bin/fm-crew-state.sh korrekt "working, run-step validating (running)" meldet. Der Keil-Melder feuert trotzdem im 240-Sekunden-Takt, drei Mal hintereinander beobachtet.
What Changed
fm-watch.sh's wedge timer now rechecks the authoritative crew state at the escalation boundary instead of trusting only the classification-time snapshot: an actively running pipeline step resets the quiet timer, and adone:task with a still-open captain call also absorbs instead of escalating.fm-classify-lib.shsplits crew-state classification intocrew_current_class(rawrun-step/pane/paused/none) plus a newcrew_has_active_run_steppredicate, so callers can distinguish "provably working via an active run-step" from "provably working via a pane" where before both collapsed into a singleworkingverdict.fm-captain-hold.shaddstransfer_matching_status_decision, called fromcommand_hold: when a held backlog task's id exactly matches an open keyed decision in its origin's status stream,holdappends a verifiedcaptain-held [key=...]transfer line to that stream, closing the live copy while the backlog task remains the durable record.fm-watch.shtracks a new.paused-override-<key>marker so a pane that was provably working under a declared pause, but later becomes inconclusive, still runs the wedge-timer recheck instead of falling back to the low-urgency declared-pause cadence.docs/architecture.md,docs/configuration.md, anddocs/captain-hold-lifecycle.mdto describe the new absorption paths; added coverage intests/fm-watch-triage.test.shandtests/fm-captain-hold-lifecycle.test.sh.🤖 Generated with Claude Code
Risk Assessment
✅ Low: Change is well-scoped, addresses exactly the three measured cases in the intent (captain-held transfer on hold, done+open-captain-call wedge suppression, active run-step wedge suppression), reuses existing predicates/helpers correctly, and is backed by behavioral (not source-grep) tests for all three scenarios plus a mismatch/negative case.
Testing
Targeted
bash tests/fm-captain-hold-lifecycle.test.shandbash tests/fm-watch-triage.test.sh(the two suites the diff modified) both exit 0 with every ok assertion, directly covering all three cases in the user intent (needs-decision parked-on-decision absorption via captain-held tagging, done+merge-pending no longer stale-waking, and wedge-melder deferring to an active pipeline step) while retaining coverage that real wedges still surface — no findings, worktree left clean.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-captain-hold-lifecycle.test.sh (exit 0, 33/33 assertions ok — covers fm-captain-hold.sh hold now appending captain-held [key=...] for open status decisions)bash tests/fm-watch-triage.test.sh (exit 0, all assertions ok — covers needs-decision/captain-held absorption, done+merge-approval-pending absorption, and wedge-escalation held back by an active fm-crew-state.sh pipeline step, plus regression coverage that genuinely stuck/stale panes still surface)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.