Skip to content

fix(bearings): repair board listening and decision reconciliation - #3872

Merged
kunchenguid merged 9 commits into
mainfrom
fm/fm-bearings-board-repair-r2
Sep 7, 2026
Merged

kunchenguid merged 9 commits into
mainfrom
fm/fm-bearings-board-repair-r2

Conversation

@kunchenguid

@kunchenguid kunchenguid commented Sep 6, 2026 •

Copy link
Copy Markdown
Owner

Intent

Repair the Bearings board across three fronts (captain's evidence-backed package, 2026-09-06). Ship all three as one change.

(1) NOT-LISTENING. A rebuilt board reused an already-ended Lavish session (same session id, prior results weeks old, the session's latest state "ended by user"); the build printed "already-armed" and no poller ever attached, so the board read "not listening." Worse, the source ownership claim named a dead PID (41009) whose whole process group was also gone, yet reconcile twice refused to start a replacement and retire refused with "cannot release source ownership." Main-home verified there were zero live pollers three independent ways, deleted only the stale ownership claim plus its runner record, and reconcile then immediately started a live runner. Two fixes are required:

  • The board build must verify the Lavish session is actually open/live after establishing it, and reopen-or-start-fresh when it finds the session ended - it must never arm a poll on an ended session.
  • Reconcile and retire must perform a safe stale-generation reclamation when the owning source's PID and its whole process group are both gone. The docs already promise that ownership moves once a whole generation is gone; make that actually true. Both fixes get regression tests that pin the behavior.

(2) CARD HYGIENE. When composing the Captain's Call section of the board, omit any held decision whose subject has already landed. Cross-check candidate holds against recently-landed artifacts and closed tasks at build time. Tonight's board wrongly carded the already-merged timeout/reattach work and an already-published quota-axi version (0.1.38 published while 0.1.37 was carded). Include a one-time cleanup of the current stale cards as part of landing this.

(3) RECONCILE OPTION. Every decision card gets a standard "reconcile" choice meaning: verify the latest state, and either close the call with evidence if it is now moot, or leave it open with a note if it is genuinely still active. The handler semantics must be designed first, because a reconcile value must NEVER reach the keyed-answer intake as a blind close - reconcile is "go re-check reality," not "the captain answered." Implement the composer side (offer the choice on every decision card), the handler side (the correct verify-then-close-or-annotate semantics), and tests.

What Changed

  • Verify and reopen ended Lavish sessions before arming the board, restore missing listeners, and safely reclaim source ownership once the prior PID and process group are gone.
  • Remove landed or closed Captain’s Call decisions during board builds using task, PR, and versioned artifact state.
  • Add a standard Reconcile choice that creates a durable verification request and only closes calls with evidence, otherwise recording a note while leaving them open.

Risk Assessment

✅ Low: The changes are well-bounded, satisfy the stated board, reconciliation, hygiene, and ownership invariants, and include behavior-focused regression coverage without a substantiated remaining defect.

Testing

Completed 1 recorded test check.

  • Outcome: ⚠️ 1 error across 1 run (13m52s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

⚠️ **Test** - 1 error
  • 🚨 tests failed with exit code 1
  • bin/fm-test-run.sh --changed --exclude-family real-herdr-gated
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

…ile path

Three defects made the fleet board go quiet and then lie about what still
needs the captain.

Never arm a poll on a session that is not live. `lavish-axi <file>` exits 0
even when it refuses to reopen a session the captain ended from the browser,
reporting `status: user-ended` with the same session id, so the build's
exit-status check accepted a dead session, printed `already-armed`, and left
the board reading "not listening". The build now proves the session is live
from a fresh authoritative listing immediately before arming - not from the
establish call's status alone, which is already stale by then - reopens once
when it finds the session ended, and refuses rather than arming when it stays
ended. A reopen also replaces the pre-reopen source generation before
reporting success, so a runner on its way out cannot be mistaken for a
listener, and a board whose source is registered but unowned gets a
replacement started before the build returns.

Let a dead generation's ownership actually move. Reclaiming a claim ran its
capture-reservation cleanup first, and that cleanup re-verifies the recorded
state-root identity, so a claim naming a pid and a process group that were
both provably gone could not be cleared: reconcile reported a start while
nothing attached, and retire refused with "cannot release source ownership".
Reservation records are keyed by claim token and every replacement claims a
fresh one, so they are hygiene, not an ownership invariant. Reclamation now
additionally requires the owning process group to be absent independently,
which keeps a reused pid whose poll child still runs from ever reading as a
gone generation. A live owner and a crashed leader whose owned group survives
are still never reclaimed.

Stop carding decisions whose subject already landed. The build drops a
decision card whose work item or PR appears in the payload's own landed rows,
and one whose task is no longer an open captain call, naming each drop on
stderr. A task whose state cannot be established is kept, because a call
wrongly hidden is worse than a card wrongly shown.

Add the reconcile choice, and make it structurally incapable of closing a
call. Every decision card carries a standard `reconcile` option, injected by
the build rather than left to the composer. The board now emits the picked
option and any freeform note as separate structured fields instead of fusing
them, so a reconcile selection is not expressible as an answer value at all -
the defect that let `reconcile - <note>` reach the intake as an ordinary
answer. The adapter routes selections from that structured field, creation of
a reconcile request is bound to a verified board source rather than the shared
keyed-answer intake, and the intake still refuses the reserved value on every
channel. Each authorization is bound to the captain-hold generation that
produced the card, so an obsolete card cannot close a later call, and both
terminal outcomes require a pending request: `reconcile close` records the
evidence under its own `reconciled` mode so it never reads as the captain's
words, and `reconcile note` leaves the call open. Anything unprovable -
an unversioned row, a missing generation, an unreadable state - refuses
rather than acting.

Regression coverage fails without each fix, and pins every leak path: a bare
reconcile, a standalone close or note with no pending request, an any-channel
reconcile, an annotated selection from a freeform card, and a
generation-skewed authorization. An opt-in guard re-proves the lavish-axi
shapes and the reopen against the installed tool.
shellcheck SC1010 reads the bare word as the loop keyword. The failed run
never reached its lint step, so this shipped in the recovered content.
@greptile-apps

greptile-apps Bot commented Sep 6, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains within the eligible follow-up-review scope.

No blocking failure remains.

Reviews (2): Last reviewed commit: "no-mistakes(ci): Stabilized the failing ..." | Re-trigger Greptile

…ializing test-harness Treehouse allocator calls, preventing concurrent recovery spawns from claiming the same pool slot while preserving Herdr concurrency coverage. Verified with the full E2E suite on Herdr 0.8.2, bash syntax checks, ShellCheck, and git diff checks
@kunchenguid
kunchenguid merged commit cf7e2fa into main Sep 7, 2026
15 of 16 checks passed
@kunchenguid
kunchenguid deleted the fm/fm-bearings-board-repair-r2 branch September 7, 2026 01:11