Repository navigation
fix(bin): keep a stated default-key retraction from cancelling a keyless wait - #5587
Conversation
…wait A resolved line that names the shared default decision bucket was closing the keyless live wait that only prints as that same key. Keyless self-retraction still closes the keyless wait.
ff61481 to
46faffa
Compare
|
Speaking as Kun's firstmate: this is merged. Thank you @tiago-peixoto — really appreciate you taking the time on this. contract-class: VISION: Interface honesty — aligns (wait not falsely cleared). Authority — aligns (keyed close still works; no inferred widen). Scripts — aligns. Restart — aligns. Spine/vendor/scope — align. Attestation: MATCH. CI/NM: SUCCESS. Firstmate flag: no. |
|
Speaking as Kun's firstmate: Correction: squash merge landed at |
…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.
…ess wait (kunchenguid#5587) * fix(bin): keep a stated default retraction from cancelling a keyless wait A resolved line that names the shared default decision bucket was closing the keyless live wait that only prints as that same key. Keyless self-retraction still closes the keyless wait. * no-mistakes(review): Keep declared waits standing past foreign-key resolved lines * no-mistakes(review): Bound declared-wait read and share one decision-key parser * no-mistakes(document): Document supervisors' key-aware declared-wait read
…ess wait (kunchenguid#5587) * fix(bin): keep a stated default retraction from cancelling a keyless wait A resolved line that names the shared default decision bucket was closing the keyless live wait that only prints as that same key. Keyless self-retraction still closes the keyless wait. * no-mistakes(review): Keep declared waits standing past foreign-key resolved lines * no-mistakes(review): Bound declared-wait read and share one decision-key parser * no-mistakes(document): Document supervisors' key-aware declared-wait read
…ess wait (kunchenguid#5587) * fix(bin): keep a stated default retraction from cancelling a keyless wait A resolved line that names the shared default decision bucket was closing the keyless live wait that only prints as that same key. Keyless self-retraction still closes the keyless wait. * no-mistakes(review): Keep declared waits standing past foreign-key resolved lines * no-mistakes(review): Bound declared-wait read and share one decision-key parser * no-mistakes(document): Document supervisors' key-aware declared-wait read
Intent
Fixes #4762.
Implement ready-for-pr issue #4762: a keyless retraction into the shared default decision bucket can cancel an unrelated live wait.
Decision keys fall back to default when no token is present. Closed issue 2109 stopped rewriting a malformed stated key to default; keyless lines still use that bucket. The generated brief's keyless forms (paused: {why}, needs-decision: {summary}) therefore share default. A resolved [key=default] from a foreign producer retracts any standing keyless wait. One sequence: unkeyed needs-decision then unkeyed paused; answering with --resolve-key default cancels the wait that is still live. A retraction from a foreign producer must not cancel a live declaration by landing in the shared default bucket. A worker's own documented keyless self-retraction should still work. A correctly waiting worker re-enters the wedge ladder because an unrelated default-key resolution cleared its wait.
What Changed
bin/fm-classify-lib.shnow treats a keyless line as its own phase, separate from an explicit[key=default]line. A foreignresolved: [key=default]no longer closes a standing keylesspaused:wait. A worker's own keyless retraction still closes it. The phase is still printed asdefaulton output.status_declared_wait_line, returns the line holding a crew in a declared wait. If the latest event is a resolved line, it walks back past resolved lines to the nearest other event. It keeps that event as the wait when it is a pause and none of those resolved lines share its phase key. The read is bounded to the tail window and widens to the whole file only when that window holds nothing but resolved events.status_current_linefalls back to it before the latest event.fm-supervise-daemon.sh,fm-watch.sh, andfm-push-transition-lib.shnow use this helper instead oflast_status_linewhen they decide pause or captain-held state. An unrelated default-key resolution therefore no longer puts a correctly waiting crew back on the wedge ladder.docs/architecture.mdis updated to match, and regression tests cover the fold, the daemon, and watcher triage.Risk Assessment
✅ Low: Supervisor pause classification only changes when the latest event is a
resolvedline. In that case the bounded backward scan keeps a pause standing unless the resolved line shares the pause's phase key. Every converted call site reads the returned line only for pause or captain-held checks. The behaviour tests cover the reported sequence and the worker's own retraction at the snapshot fold, the daemon and the watcher.Testing
I sent a realfm-send --resolve-key defaultanswer into a real tmux pane on a private socket, in a throwaway home. On base, the resolved line it appends made the supervisors' declared-wait read return "no wait". On the fix, the keyless pause still stands. A 13-case matrix of status logs confirmed the guard in both directions: - Foreign-key, default-key and stacked answers, and pauses buried past the event window, keep the wait (about 0.5s for the worst 1500-line case, 40ms for the common one). - Keyless self-retraction, same-key retraction, working/done lines, captain-held followed by a resolved line, and a stated[key=default]pause still retract it. The targeted classify and daemon suites passed. The new fm-watch wedge-ladder test and its two neighbours passed. I also ran the new fm-watch test against base: it fails there with exactly the reported wedge escalation. The full fm-watch-triage suite ran past my 15-minute cap, with no failures before it stopped, so I ran the relevant tests by name. fm-crew-state could only report "unknown" from the bare shell pane, so crew-state's status-log fallback was checked throughstatus_current_lineinstead. I did not use a Herdr lab: the change is backend-agnostic status classification, and the tmux backend exercised the real answer path. The fm-watch wedge-ladder and daemon stale-classifier scenarios were covered only by tests over stubbed or sourced components, so they are recorded as untested live.Evidence: Real fm-send --resolve-key default into a tmux pane: base loses the wait, fix keeps it
Source: Real fm-send --resolve-key default into a tmux pane: base loses the wait, fix keeps it
Evidence: Declared-wait matrix, base vs fix, including adversarial and long-log cases
Source: Declared-wait matrix, base vs fix, including adversarial and long-log cases
Evidence: Targeted test transcripts, including the new watcher test failing on base
Source: Targeted test transcripts, including the new watcher test failing on base
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.
Ran the realbin/fm-send.sh t1 --resolve-key default "blue"against a real tmux pane on a private TMUX_TMPDIR socket, in a throwaway FM_HOME with FM_GATE_REFUSE_BYPASS=1 (the repo test harness's bypass). Then readstatus_declared_wait_line/last_status_lineandfm-crew-state.sh, on base b42d4fa and on the fix 46faffa.Ran a matrix of status logs (A-M) throughbin/fm-classify-lib.sh, reading the supervisors' declared-wait line andstatus_current_line, on base and on the fix. It covers foreign-key and default-key answers, stacked foreign answers, keyless self-retraction, same-key keyed retraction, working/done retraction, captain-held retraction, stated[key=default]pause retraction, and 1500-line logs past the 200-line event window, with timing.bash tests/fm-classify-decision-key.test.sh(passed)bash tests/fm-daemon.test.sh(passed, includes the new test_stale_pause_survives_a_foreign_resolved_line)FM_TEST_ONLY=test_wedge_threshold_keeps_a_wait_past_a_default_key_answer bash tests/fm-watch-triage.test.shplus the two neighbouring wedge-threshold tests (all passed; they drive the real fm-watch.sh over a fake backend)Ran the new watcher test against the base b42d4fa tree: it fails with 'possible wedge, escalation 1', which is the reported bug✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.