Skip to content

fix(bin): surface buried wake status lines once - #2331

Merged
kunchenguid merged 12 commits into
mainfrom
fm/fm-drain-surface-unanswered-questions-r1
Aug 13, 2026
Merged

kunchenguid merged 12 commits into
mainfrom
fm/fm-drain-surface-unanswered-questions-r1

Conversation

@kunchenguid

Copy link
Copy Markdown
Owner

Intent

Fix a wake-surfacing gap where an answer to a question Firstmate itself asked can be silently buried. This is firstmate shared tracked material: the wake drain and status-classification machinery (bin/fm-wake-drain.sh, bin/fm-wake-lib.sh, bin/fm-classify-lib.sh).

The incident to reproduce and fix: a status file received a note: answer line, then immediately a routine note: line (an unrelated re-read acknowledgement). A subsequent wake drain annotated ONLY the newest line (the routine re-read note); the substantive answer note directly above it was never surfaced. Two enablers: (1) the drain annotation surfaces only the newest line of a status file, not all new lines since the last acknowledgement; (2) note: lines never fold into OPEN DECISIONS, so an answer to a question Firstmate asked has no other surfacing path.

Requirements:

  1. A drain must surface ALL new status lines since the last acknowledgement, never just the newest. If a full change to that is too broad, at MINIMUM surface every unanswered pending-reply resolution and every note: line since the last ack (do not drop the substantive lines behind a routine newest one).
  2. It must NEVER re-surface an already-handled line as new. Bias fail-toward-showing-MORE (never silently drop a new line) but also never re-present already-handled work as if new. Use the durable last-ack cursor/handled markers the machinery already keeps; do not content-guess.
  3. Keep every existing surfacing behavior intact (the wake-queue records, signal/stale/check wakes, the OPEN DECISIONS fold for needs-decision/blocked). This is additive, not a rewrite.

Regression tests are required and must exercise the real drain/classify functions (source the libs, no harness) with the exact incident shape and assert observable output: (a) a note: answer followed by a routine note:, last-ack cursor set before both, drain surfaces BOTH (or at minimum the answer note), not only the newest routine line; (b) already-acknowledged lines are NOT re-surfaced on the next drain; (c) a brand-new note after an ack IS surfaced; (d) the existing OPEN DECISIONS fold for needs-decision/blocked still works. A portable tests/ regression is sufficient because this is harness-agnostic shell: the drain logic decides WHICH status lines to surface. Run bin/fm-lint.sh and shellcheck before done.

Delivery: mode=no-mistakes, yolo OFF, captain merges. Escalate any ask-user finding; do not answer them. Note in the PR that this changes running wake-surfacing machinery, so homes pick it up after merge plus a firstmate self-update. Also note in the PR that a portable tests/ regression is sufficient. Stop at CI green. Cursor commit attribution is off globally, so no co-author trailer is expected.

Implementation choice made while doing the work: dumping every new working:/done: line fleet-wide on every drain, including empty-queue, would break the existing silent empty-queue contract. The accepted minimum is therefore: queued-signal annotations now emit every unread line since the open-decisions presentation cursor (not only the newest), and a fleet-wide UNREAD STATUS section (including empty-queue) surfaces still-unread note: lines and reserved-key pending-reply resolutions once, then the existing cursor advances so they are not replayed. OPEN DECISIONS for needs-decision/blocked is unchanged.

What Changed

  • Surface every unread status line in queued-signal annotations and add a fleet-wide UNREAD STATUS section for unread note: