Skip to content

fix(bin): require a TypeScript-capable Node for the supervision host - #6597

Closed
mitcsutt wants to merge 2 commits into
kunchenguid:mainfrom
mitcsutt:fm/supervision-host-node-floor
Closed

mitcsutt wants to merge 2 commits into
kunchenguid:mainfrom
mitcsutt:fm/supervision-host-node-floor

Conversation

@mitcsutt

@mitcsutt mitcsutt commented Oct 5, 2026

Copy link
Copy Markdown

Intent

Authorize the upstream firstmate fix from the supervision-host investigation.

The investigation found that the Claude supervision host (on by default for Claude primaries since #6124) shells out to node bin/fm-branch-dispatch.mjs, which dynamically imports .pi/extensions/lib/fm-branch-dispatch.ts. That import only works on Node builds with native TypeScript type stripping (22.18.0+ / 23.6.0+). On older Node (18, 20, 22 before 22.18) every attended and away close fails with the generic "branch eligibility could not be computed": attended closes silently pass through, away closes are all handed back to main, and the return brief shows nothing. Firstmate declares no Node floor, its bootstrap and host readiness checks only test that node exists, and the three dispatch calls discard stderr.

The fix scope recommended and approved:

  1. Declare the floor once in docs/configuration.md "Toolchain" (Node with native TypeScript type stripping: 22.18.0+ or 23.6.0+), and have bin/fm-bootstrap.sh report a too-old node with upgrade guidance, as it does for other floors.
  2. Make the host's readiness checks test the capability rather than presence (fm_supervision_host_attended_ready in bin/fm-supervision-engine-lib.sh and the away pre-check in bin/fm-supervision-host.sh), e.g. node -e 'process.exit(process.features.typescript ? 0 : 1)', with a specific reason such as "node vX cannot load TypeScript; the supervision session needs Node 22.18+".
  3. Stop hiding the cause: keep the first stderr line of the three fm-branch-dispatch.mjs calls in the ledger row instead of 2>/dev/null.
  4. Regression: a portable test in tests/fm-supervision-host.test.sh that puts a node lacking type stripping first on PATH and asserts the specific readiness reason, plus a bootstrap case for the floor.
    Also fix the latent bash 3.2 defect found on the same path: bin/fm-timeout-lib.sh:224 uses bare $BASHPID under set -u, which is unbound on bash 3.2 (the engine turn dies with "BASHPID: unbound variable"); use the repo's 3.2-safe idiom while keeping the owner logic correct, with a bash 3.2 regression.

What Changed

  • Added fm_node_loads_typescript to bin/fm-supervision-engine-lib.sh. It checks process.features.typescript to confirm Node can strip TypeScript types natively (floor: 22.18.0+ or 23.6.0+). Three callers now use it:

    • fm_supervision_host_attended_ready and the away pre-check in bin/fm-supervision-host.sh, which used to check only that node exists. They now give a specific reason, such as "node vX cannot load TypeScript; the supervision session needs Node 22.18.0+ or 23.6.0+".
    • bin/fm-bootstrap.sh, which now reports MISSING: node (... cannot load TypeScript; requires <floor>; install: ...).

    The floor is declared in the docs/configuration.md Toolchain section. docs/supervision-host.md and the bootstrap-diagnostics skill are updated to match.

  • The three fm-branch-dispatch.mjs calls (scope, wake-prompt, offer) no longer send stderr to /dev/null. They write it to .supervision-host-dispatch-errors, and a new dispatch_cause helper adds the first error line to the ledger reason. For example, "branch eligibility could not be computed: " replaces the generic message.

  • fm_exec_timed in bin/fm-timeout-lib.sh used bare $BASHPID, which is unbound under set -u on bash 3.2. It now falls back to a 3.2-safe way of getting its own pid. New regression tests cover the old-Node readiness reason, the bootstrap floor report, and the bash 3.2 timeout path.

🤖 Generated with Claude Code

Risk Assessment

✅ Low: The change follows the approved four-part scope plus the BASHPID fix, and every new path traced correctly: the capability probe, the bootstrap MISSING line, stderr capture and cleanup on the success and failure paths of all three dispatch calls, and the bash 3.2 fallback, which uses /bin/sh's $PPID to get the current shell's pid. Each fix has a behavioral regression test.

Testing

I ran bootstrap and the readiness function against real old Node builds on this machine (v18.16.0 and v22.2.0). Both report the specific "cannot load TypeScript; requires 22.18.0+ or 23.6.0+" reason; v22.22.2 and v24 pass silently. I reproduced the bash 3.2 "BASHPID: unbound variable" crash on the base commit, and the same call runs the command on this branch. The three targeted test files all pass (exit 0). The new supervision-host tests start the real host and check attended pass-through, the away hand-back and the ledger rows with dispatch error causes. I did not drive a full Claude primary in a lab for the old-node attended or away close. Those paths were covered by the host test harness, which runs the real host script with a node shim (the real node with type stripping turned off); the real Node 18 and 22.2 checks reached only bootstrap and the readiness function. I removed the lab home afterwards and the worktree is clean.

  • Live validation: ✅ go - 7 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Bootstrap on a node too old to load TypeScript (real v18.16.0, v22.2.0) prints MISSING: node with the version, the 22.18.0+/23.6.0+ floor and an install command ✅ pass live bootstrap-node-floor.txt
Bootstrap on a node at or above the floor (real v22.22.2, v24.16.0) reports nothing for node ✅ pass live bootstrap-node-floor.txt
Attended readiness on real old node returns 1 with 'node vX cannot load TypeScript; the supervision session needs Node 22.18.0+ or 23.6.0+' instead of passing because node is present ✅ pass live readiness-real-nodes.txt
Running host: an attended close on a node without type stripping passes through to main, the engine never runs, and the ledger row names the floor ✅ pass live fm-supervision-host.test.txt: test_attended_close_on_a_node_that_cannot_load_typescript_names_the_floor (real host script; node shim is the real node with type stripping off)
Running host: an away wake on a node without type stripping is handed to main with 'supervision-host: ... needs Node 22.18.0+ ... this wake is yours' and the matching ledger row ✅ pass live fm-supervision-host.test.txt: test_away_wake_on_a_node_that_cannot_load_typescript_names_the_floor
Adversarial: readiness passes but the dispatch call fails; the ledger and the hand-back carry node's 'TypeError [ERR_...]' line and no stderr file is left behind ✅ pass live fm-supervision-host.test.txt: test_failed_branch_eligibility_names_its_cause; readiness-real-nodes.txt shows the real old-node stderr format the cause regex matches
bash 3.2 under set -u: fm_exec_timed in a subshell runs the bounded command instead of dying with 'BASHPID: unbound variable', and the owner still dies correctly during startup ✅ pass live bash32-bashpid.txt (base commit rc=127 unbound, branch rc=0); fm-timeout-lib.test.txt bash-3.2 and no-bashpid cases
Evidence: Bootstrap with real node versions first on PATH

Source: Bootstrap with real node versions first on PATH

=== node v18.16.0 first on PATH: v18.16.0 ===
MISSING: node (v18.16.0 cannot load TypeScript; requires 22.18.0+ or 23.6.0+; install: brew install node  # or the platform's package manager)
=== node v22.2.0 first on PATH: v22.2.0 ===
MISSING: node (v22.2.0 cannot load TypeScript; requires 22.18.0+ or 23.6.0+; install: brew install node  # or the platform's package manager)
=== node v22.22.2 first on PATH: v22.22.2 ===
(no node line reported)
=== node v24.16.0 first on PATH: v24.16.0 ===
(no node line reported)
Evidence: Readiness reason and raw dispatch stderr on real old/new node

Source: Readiness reason and raw dispatch stderr on real old/new node

=== node v18.16.0: readiness ===
rc=1 reason=node v18.16.0 cannot load TypeScript; the supervision session needs Node 22.18.0+ or 23.6.0+
=== node v18.16.0: direct dispatch call (stderr first lines) ===
node:internal/errors:490
    ErrorCaptureStackTrace(err);
    ^

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for ~/.no-mistakes/worktrees/7b931e7a3684/01M44XZ8VEVPPRC5NHP4JR38A7/.pi/extensions/lib/fm-branch-dispatch.ts

=== node v22.2.0: readiness ===
rc=1 reason=node v22.2.0 cannot load TypeScript; the supervision session needs Node 22.18.0+ or 23.6.0+
=== node v22.2.0: direct dispatch call (stderr first lines) ===
node:internal/modules/esm/get_format:176
  throw new ERR_UNKNOWN_FILE_EXTENSION(ext, filepath);
        ^

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for ~/.no-mistakes/worktrees/7b931e7a3684/01M44XZ8VEVPPRC5NHP4JR38A7/.pi/extensions/lib/fm-branch-dispatch.ts

=== node v22.22.2: readiness ===
rc=0 reason=
=== node v22.22.2: direct dispatch call (stderr first lines) ===
eligible=0
status=unsafe
corrupted=1
rows=
tasks=
Evidence: bash 3.2 BASHPID before/after

Source: bash 3.2 BASHPID before/after

base: line 224: BASHPID: unbound variable rc=127 branch: bounded-command-ran rc=0

=== /bin/bash 3.2.57(1)-release set -u, subshell fm_exec_timed 5 1 echo ok, lib=/tmp/fm-timeout-lib.base.sh ===
/tmp/fm-timeout-lib.base.sh: line 224: BASHPID: unbound variable
rc=127
=== /bin/bash 3.2.57(1)-release set -u, subshell fm_exec_timed 5 1 echo ok, lib=bin/fm-timeout-lib.sh ===
bounded-command-ran
rc=0
Evidence: Supervision host test output

Source: Supervision host test output

ok - host+hook: a successor closed before exit_to_main does not suppress the branch-outcome rewake
ok - host+hook: a successor that closes during a held engine turn does not suppress the branch-outcome rewake
ok - host+hook: a refused hand-back becomes a delivered failure notice
ok - host+hook: a refused hand-back on an announced handling marker becomes a delivered failure notice
ok - host: parked child-exit sampling uses ordinary half-second sleeps
ok - report surface: only the branch actor's current turn may report, and only on the tasks its wake names
ok - report surface: visible late outcomes queue a relay, while silent outcomes remain stored without a wake or note
ok - dispatch entry: the host reads branch eligibility, the offer rule, and the wake prompt from the Pi branch's own owner
ok - drain: BRANCH OUTCOMES runs on a Claude home by default and on another primary with the file, never with off, and never on Pi
ok - drain: captain outcomes come first, and routine overflow collapses into a count one drain clears
ok - drain: repeated captain outcomes collapse per task, and the byte cap presents only the run its acknowledgement covers
ok - drain: a long away window costs one short drain, captain outcomes collapsed per task and routine overflow counted, and nothing from it is shown again
ok - drain: the BRANCH OUTCOMES budgets count bytes, cutting multibyte summaries by whole characters in any locale
ok - drain: branch outcomes stay unread when a projection of the store fails
ok - drain: branch outcomes stay unread and the drain fails when jq is missing
ok - drain: branch outcomes stay unread when the drain cannot print them
ok - drain: a legacy backlog is presented with each outcome's age and a check-first instruction, never adopted
ok - drain: a keyed decision survives acknowledgement through a newer outcome for its task
ok - drain: an outcome carried across a switch off Pi comes back with its age, never adopted
ok - drain: an outcome nothing has shown is presented until acknowledged, and a repeated acknowledgement changes nothing
ok - drain: an outcome the host drain presented but main never acknowledged stays unprocessed across a switch to Pi
ok - drain: an outcome the host drain presented but main never acknowledged survives an outcome index repair
ok - host: an attended wake the branch may take is handled on the engine, and its routine outcome never wakes main
ok - host: an attended captain outcome wakes main once and stays in its drain until main acknowledges it
ok - host: a captain outcome recorded after the captain left waits for the return, then reaches main's drain
ok - host: a quiet record without its daemon is a present captain, so outcomes and decisions reach main
ok - host: an attended decision close stays main's exactly as the plain arm delivers it
ok - host: an off written while the host is parked sends the next attended close to main, naming the opt-out
ok - host: a main-only pass-through leaves the successor watcher running and the close undelivered for main
ok - host: an attended close whose main session cannot be identified reaches main and runs no engine turn
ok - host: a decision close accepted away whose turn starts attended still reaches main unchanged
ok - host: an attended close whose task turns main-only before its turn still reaches main unchanged
ok - host+hook: an attended main-only pass-through rewakes main and keeps its successor watcher
ok - host+hook: a captain outcome beside a quiet record rewakes the present captain with no away note
ok - host+hook: a Claude home without config/supervision-host runs the host at the default engine, and an off file restores the plain arm
ok - host+hook: a close that turns main-only at its turn rewakes main and keeps its successor watcher
ok - host+hook: failed at-turn downtime write notifies main despite a healthy successor
ok - host+hook: a successor close that lands during main's turn is delivered at the next turn end
ok - host+hook: the next park takes over the cycle a main-only pass-through left, so one arm owns it
ok - host+hook: a park stopped mid take-over leaves the take-over to the next park
ok - host+hook: a successor that cannot be recorded is stopped, and main's next turn end arms a fresh cycle
ok - host: a primary with no verified dialog mirror keeps every attended close on main, and its away posture still runs
ok - host: each wake carries the captain's dialog since the last wake, without operational input
ok - host: the dialog mirror, its feed, and the wake file are owner-only
ok - host: dialog a turn never completed with its report (a park boundary, a stopped turn, no report) reaches the next turn
ok - host: an attended wake whose mirror is missing, cannot be read (at the feed or at the prompt), or holds a malformed entry reaches main before any engine turn, and the cursor stays put
ok - host: an attended close on a node that cannot load TypeScript passes to main with the Node floor in the ledger
ok - host: an away wake on a node that cannot load TypeScript reaches main naming the Node floor
ok - host: a failed branch-eligibility call names node's error in the ledger and the hand-back
ok - host: an away wake is handled on the engine through the branch contract and never reaches main
ok - host: an engine turn that records no outcome hands its durable wake to main
ok - host: a captain return during an engine turn hands that turn's outcomes to main
ok - host: silent outcomes are excluded from both captain-return handoff paths
ok - host: an early visible outcome survives more than 1,000 same-turn receipts
ok - host: an outcome lookup failure forces a visible main handoff
ok - host: an outcome recorded after the return reaches main even when its host dies at the turn's end
ok - host: a killed predecessor's engine is reaped and the next host removes its turn files
ok - host: a turn that reports but leaves its granted rows queued hands the wake to main
ok - host: a captain return during a failed engine turn still hands that turn's outcomes to main
ok - host: an engine turn whose result is incomplete hands its wake to main
ok - host: two engine errors latch the session, main keeps every away wake in the cooldown, a failed probe doubles it up to its cap, and a report recovers it silently
ok - host: an attended close in a latched session reaches main as the arm printed it and leaves the latch as it was, and a home that opted out with off never reads it
ok - host: attended, two engine errors latch the session, main keeps every close unchanged in the cooldown, a failed probe doubles it up to its cap, and a routine probe's recovery stays in the ledger, off main
ok - host: an engine turn is bounded, and tool processes outside its process group are reaped
ok - host: a restarted host stops, by recorded identity, the cycle a killed predecessor left running
ok - host: the park ends itself with a boundary wake and a stopped watcher
ok - host: waiting closes cannot carry the park past its boundary
ok - host: a close whose margin runs out while the successor starts reaches main at the boundary without a turn
ok - host: the park's test clock is inert without the test marker
ok - host: a park at or beyond the Stop-hook registration falls back to the default boundary
ok - host: an owner's later park limit lets a turn outlive the boundary, and no other limit does
ok - host: the first cycle's status streams once, --restart replaces a stale watcher, and an owner predecessor makes a handling successor
ok - host: an unchanged held outcome reaches the captain once across cadences, and a later decision on the task still does
ok - host: a home naming an unverified engine hands every away wake to main with the reason
ok - host: a host outside the session-lock owner stands down without arming
ok - host: a host under a superseded auto-arm generation stands down without touching the owner
rc=0
Evidence: Timeout lib test output

Source: Timeout lib test output

ok - fm_exec_timed passes a command's status and output through unchanged
Terminated: 15             "$@"
ok - fm_run_timed reports 124 when the bound TERMs a read whose wrapper recorded 143
ok - fm_run_timed passes a natural exit through when the bound fired after completion
ok - fm_exec_timed sends TERM at the bound and a cooperative command ends there
ok - fm_exec_timed kills a TERM-ignoring command once the grace has passed
ok - fm_exec_timed replaces the calling shell instead of wrapping it
ok - fm_exec_timed reaps a descendant that would otherwise hold the output past the bound
ok - fm_exec_timed forwards a TERM it receives to the bounded command
ok - fm_exec_timed ends the command when its named owner is already gone
ok - fm_exec_timed ends the command when its owner dies during watchdog startup (bash)
ok - fm_exec_timed ends the command when its owner dies during watchdog startup (no-bashpid)
ok - fm_exec_timed ends the command when its owner dies during watchdog startup (bash-3.2)
ok - fm_exec_timed prefers its perl watchdog over timeout
ok - fm_exec_timed refuses instead of running unbounded when no mechanism exists
ok - fm_exec_timed rejects a zero, padded, non-numeric, or missing bound and a missing command
tests/fm-timeout-lib.test.sh: line 28:  6343 Killed: 9                  ( . "$ROOT/bin/fm-timeout-lib.sh"; PATH=$path fm_exec_timed "$@" )
ok - fm_exec_timed's GNU timeout fallback kills a TERM-ignoring command once the grace has passed
ok - fm_timed_out accepts 124 and 137 and nothing else
Evidence: Bootstrap test output

Source: Bootstrap test output

fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
ok - bootstrap reports treehouse lease + tasks-axi/quota-axi bootstrap contracts
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
ok - bootstrap enforces no-mistakes minimum version
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
ok - bootstrap reports a node that cannot load TypeScript with its upgrade
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
ok - bootstrap enforces gh-axi minimum version
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
ok - bootstrap preserves legacy Lavish boards while recommending synchronous reply support
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
ok - bootstrap enforces tasks-axi minimum version
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
ok - bootstrap enforces quota-axi minimum version
ok - bootstrap requires git with an install instruction
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
ok - bootstrap: backend=orca gates the Orca CLI without requiring it on the default backend
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: n

... [4746 bytes truncated] ...

 (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
ok - bootstrap gates resolver fields and additive harnesses on the typed key

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 info
  • ℹ️ bin/fm-supervision-host.sh:1030 - The intent asks to keep "the first stderr line" of the dispatch calls. dispatch_cause (bin/fm-supervision-host.sh:1030) instead prefers node's &lt;Name&gt;Error[ [CODE]]: line and falls back to the first nonblank line. This is a deliberate refinement: when an ESM import fails uncaught, node's first stderr lines are only a source location (node:internal/...:NNN, a throw excerpt and a caret), so the literal first line would still hide the cause. The fallback covers the controlled exits 2 and 3, which print a single line. No action needed.
✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 7 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Bootstrap on a node too old to load TypeScript (real v18.16.0, v22.2.0) prints MISSING: node with the version, the 22.18.0+/23.6.0+ floor and an install command ✅ pass live bootstrap-node-floor.txt
Bootstrap on a node at or above the floor (real v22.22.2, v24.16.0) reports nothing for node ✅ pass live bootstrap-node-floor.txt
Attended readiness on real old node returns 1 with 'node vX cannot load TypeScript; the supervision session needs Node 22.18.0+ or 23.6.0+' instead of passing because node is present ✅ pass live readiness-real-nodes.txt
Running host: an attended close on a node without type stripping passes through to main, the engine never runs, and the ledger row names the floor ✅ pass live fm-supervision-host.test.txt: test_attended_close_on_a_node_that_cannot_load_typescript_names_the_floor (real host script; node shim is the real node with type stripping off)
Running host: an away wake on a node without type stripping is handed to main with 'supervision-host: ... needs Node 22.18.0+ ... this wake is yours' and the matching ledger row ✅ pass live fm-supervision-host.test.txt: test_away_wake_on_a_node_that_cannot_load_typescript_names_the_floor
Adversarial: readiness passes but the dispatch call fails; the ledger and the hand-back carry node's 'TypeError [ERR_...]' line and no stderr file is left behind ✅ pass live fm-supervision-host.test.txt: test_failed_branch_eligibility_names_its_cause; readiness-real-nodes.txt shows the real old-node stderr format the cause regex matches
bash 3.2 under set -u: fm_exec_timed in a subshell runs the bounded command instead of dying with 'BASHPID: unbound variable', and the owner still dies correctly during startup ✅ pass live bash32-bashpid.txt (base commit rc=127 unbound, branch rc=0); fm-timeout-lib.test.txt bash-3.2 and no-bashpid cases
  • bin/fm-bootstrap.sh in a throwaway lab home (bin/fm-lab-home.sh create), once each with real node v18.16.0, v22.2.0, v22.22.2 and v24.16.0 first on PATH
  • Sourced bin/fm-supervision-engine-lib.sh and called fm_supervision_host_attended_ready with real node v18.16.0, v22.2.0 and v22.22.2
  • Ran node bin/fm-branch-dispatch.mjs offer directly on real node v18/v22.2/v22.22 to see the stderr that dispatch_cause keeps
  • /bin/bash 3.2.57 with set -u: called fm_exec_timed in a subshell, using the base-commit lib and then the changed lib
  • bash tests/fm-timeout-lib.test.sh (includes the new bash-3.2 and no-BASHPID cases)
  • bash tests/fm-bootstrap.test.sh (includes test_node_typescript_floor)
  • bash tests/fm-supervision-host.test.sh, which runs the real host process (includes the 3 new node-floor and dispatch-cause tests)
✅ **Document** - passed

✅ No issues found.

⚠️ **Lint** - 1 warning
  • ⚠️ linter found issues (exit code 1)
✅ **Push** - passed

✅ No issues found.

The Claude supervision host runs bin/fm-branch-dispatch.mjs, which imports a
TypeScript module and so needs a node that strips types natively (22.18.0+ or
23.6.0+). On older Node every attended and away close failed with the generic
"branch eligibility could not be computed" because nothing checked the
capability and the dispatch calls discarded stderr.

- docs/configuration.md "Toolchain" declares the floor, and bootstrap reports
  a node that cannot load TypeScript as MISSING with the floor and install.
- fm_node_loads_typescript (bin/fm-supervision-engine-lib.sh) probes
  process.features.typescript; the attended readiness check and the away
  pre-check use it and name the node version and floor.
- The three dispatch calls keep node's error line in the ledger row and
  hand-back instead of discarding stderr.
- fm_exec_timed no longer reads bare $BASHPID under set -u, which is unbound
  on bash 3.2; it asks a child for its parent pid there, keeping the
  subshell owner logic correct.
@greptile-apps

greptile-apps Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[High risk] Adds Node TypeScript capability check to bootstrap and supervision host.

The PR appears safe to merge, with non-blocking hardening needed for the dispatch-error file.

Reviews (1) · Last reviewed commit: "no-mistakes(document): Document dispatch..."

case "$first" in heartbeat*) set -- --heartbeat ;; esac
if ! scope=$(node "$SCRIPT_DIR/fm-branch-dispatch.mjs" scope "$@" --afk 2>/dev/null); then
HANDLE_WHY="branch eligibility could not be computed"
if ! scope=$(node "$SCRIPT_DIR/fm-branch-dispatch.mjs" scope "$@" --afk 2>"$DISPATCH_ERRORS"); then

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Dispatch errors may be readable If the host runs with a 022 umask and its state directory is traversable, the new scope stderr file can be read by another local user while the call runs. The offer redirect has the same issue; wake-prompt already uses umask 077. Create the error file owner-only on all three paths.

RECEIPTS="$STATE/.supervision-host-receipts"
PROMPT_FILE="$STATE/.supervision-host-prompt"
WAKE_FILE="$STATE/.supervision-host-wake"
DISPATCH_ERRORS="$STATE/.supervision-host-dispatch-errors"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Interrupted dispatch errors remain If the host stops while a dispatch is writing stderr, neither exit cleanup nor the next host’s activation removes .supervision-host-dispatch-errors. That can leave diagnostic output in state indefinitely. Include this file in the interrupted-host cleanup.

@mitcsutt mitcsutt closed this Oct 5, 2026
@mitcsutt
mitcsutt deleted the fm/supervision-host-node-floor branch October 5, 2026 03:08
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.

1 participant