Skip to content

fix: avoid false stalls for supervising secondmates - #3036

Open
bingb0t5 wants to merge 11 commits into
kunchenguid:mainfrom
bingb0t5:fm/fm-idle-manager-false-alarm-fork
Open

fix: avoid false stalls for supervising secondmates#3036
bingb0t5 wants to merge 11 commits into
kunchenguid:mainfrom
bingb0t5:fm/fm-idle-manager-false-alarm-fork

Conversation

@bingb0t5

@bingb0t5 bingb0t5 commented Aug 25, 2026

Copy link
Copy Markdown

Intent

Stop Firstmate from treating an idle manager pane as stalled when that manager has busy workers. Close the hole at classification time. A manager with at least one busy or working child must not be classified as a stalled/wedge pane solely because the manager's own pane is idle. An idle secondmate with no unread instruction and with live child work must not emit stale:/possible-wedge escalation or secondmate wake-loop stalled checks. Keep true wedges: looping, unresponsive, or unacknowledged instruction. Do not absorb blocked push-transitions or mask failed/blocked/needs-decision/captain-held because a child is busy. Captain-held must survive masking status lines. Push to bingb0t5/firstmate fork only.

What Changed

  • Treat quiet local secondmate managers as working when their registered home contains active child work, preventing false stale and possible-wedge wakes.
  • Suppress aged secondmate wake-loop checks while child work remains active, with bounded caching and immediate rechecks for unread instructions.
  • Preserve real escalations for blocked or failed states, open decisions, captain-held transfers, declared waits, and actionable push transitions.

Risk Assessment

🚨 High: The central child-work inheritance path contradicts the explicit requirement that failed manager state survive masking status lines, so the durable fix remains incomplete.

Testing

Exercised the real watcher, stale-pane classification, and secondmate wake-loop paths. Idle managers with active children stayed quiet, while unread instructions, failed/blocked states, open decisions, and captain-held states still escalated. All targeted commands passed. CLI transcript evidence was captured; no screenshot was applicable because this change has no rendered UI surface.

Evidence: Idle manager with busy child E2E evidence

Source: Idle manager with busy child E2E evidence

Firstmate idle-manager classification - end-to-end evidence
Target: 587e85e1765e2116ff59f2aafe6ab4546a3f6c0f

Executed public watcher/supervision test interfaces:
  bash tests/fm-watch-triage.test.sh
  bash tests/fm-wake-queue.test.sh
  bash tests/fm-secondmate-safety.test.sh

Observed product behavior:
  PASS: idle kind=secondmate manager with busy child crew is not stale
  PASS: idle manager whose own log says working is absorbed while its child crew runs
  PASS: secondmate wake-loop stall stays quiet when manager supervises active child work

Retained true escalation behavior:
  PASS: unanswered captain hold still re-surfaces while the manager's children run
  PASS: secondmate wake-loop stall still fires when the manager has unread instructions
  PASS: secondmate wake-loop stall still fires when the manager holds an unanswered decision
  PASS: secondmate wake-loop stall still fires when a later line masks a captain hold
  PASS: classifier does not let active child work mask manager failed, parked, blocked, paused, open-decision, or captain-held state

All three commands exited 0.

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 error
  • 🚨 bin/fm-classify-lib.sh:1352 - Intent requires that a busy child must not mask failed, but the durable quietness guard only folds open decisions and captain-held transfers. Concrete path: failed [key=deploy]: rollout broke followed by working: dispatched recovery, with an idle manager and a working child. fm-crew-state returns working · status-log from the last line, status_open_decisions ignores failed, and this function reports quiet, so the child changes the classification to working and suppresses escalation. Track unresolved failures at this shared status-fold boundary, or otherwise prove they were explicitly cleared before allowing inheritance.
✅ **Test** - passed

✅ No issues found.

  • bash tests/fm-watch-triage.test.sh
  • bash tests/fm-wake-queue.test.sh
  • bash tests/fm-secondmate-safety.test.sh
  • git status --short confirmed testing left no worktree changes
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

An idle kind=secondmate pane is healthy while its home still has dispatched
workers under way. Classify that at absorb time so stale and push-transition
triage do not wedge the manager, including when a declared pause was recorded
only to silence a false alarm.
…dren

A secondmate with live child work and an empty instruction inbox is healthy
even when its foreign wake queue still holds an aged row. Unread manager
instructions still surface the stall check.
@greptile-apps

greptile-apps Bot commented Aug 25, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (4): Last reviewed commit: "no-mistakes: apply CI fixes" | Re-trigger Greptile

Comment thread bin/fm-classify-lib.sh
@bingb0t5 bingb0t5 changed the title fix(watch): avoid false stalls for supervising managers fix: avoid false stalls for supervising secondmates Aug 25, 2026
Comment thread bin/fm-captain-hold.sh
Comment thread bin/fm-classify-lib.sh
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: first look on current main 6a2cd6cd2c64 (#3024). Never messaged the captain.

class=corrective. Stops false stall/wedge on an idle kind=secondmate manager whose registered home still has working children. Inheritance applies only after the manager's own verdict is unknown or working · status-log, and only when manager_owes_captain_nothing (durable folds for unresolved failed, open decisions, captain-held, plus last-line captain-relevant). Failed/blocked/paused/parked/done and unread instructions still escalate. Wake-loop skip is a bounded per-row supervising cache, not a permanent mute. Not a new default product.

VISION.md (inspected bin/fm-classify-lib.sh crew_absorb_class / status_unresolved_failures / status_held_decisions / manager_inherits_child_work, bin/fm-watch.sh secondmate_wake_stall_tick supervising cache, bin/fm-wake-lib.sh marker write, bin/fm-captain-hold.sh settle_answered_status_holds, tests/fm-watch-triage.test.sh / tests/fm-wake-queue.test.sh / tests/fm-secondmate-safety.test.sh):

  • One captain, one interface: aligns (false stall is noise; true holds and failures still surface).
  • Authority is explicit: aligns (no new grant; captain-held cannot rot behind a busy child).
  • Scripts own the mechanics: aligns (status-fold + child working class are exact).
  • A restart is a non-event: aligns (markers/receipts/cache on disk, bounded by stall cadence).
  • Delegation with a spine: aligns (supervision stays honest; workers are not trusted as a mask).
  • The fleet outlives any vendor: aligns (local secondmate home only; remote mates excluded).
  • Scope: aligns.

This HEAD: 3f166d68043f742b5285f0d92238e71d658f2f3d. MERGEABLE / UNSTABLE, ahead 11 / behind 0.
Attestation 587e85e1… THIS HEAD. The published review error (busy child masking failed) is addressed on THIS DIFF by status_unresolved_failures inside manager_owes_captain_nothing; the body attestation is still the older SHA.
CI: fork Actions on THIS HEAD are action_required (CI 32831861454, Require no-mistakes 32831861596) — not green. Greptile 5/5 is not a merge gate. Author body does not use a GitHub closing link.

Not first-time. No workflow approval this pass.

Security: none. Local status folds and home ownership file; supervising marker is a regular state file with the same path guard as the stall marker.

Overlap: classify-lib / watch / wake-lib with open #2801 and wedge #3001; same-author sibling #3031. docs/architecture.md / docs/configuration.md shared with other opens. Not lock / spawn-freshen / herdr / #2804.

Land-eligible rec: NO (attestation mismatch; CI not green). Captain-flag NOW: no.

This is waiting-on-author for a HEAD-matching no-mistakes-pipeline-attestation:v1 (and green Actions). Not a captain-decision. Not a merge I will recommend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants