Skip to content

fix(bin): stop labeling Herdr as experimental - #4972

Merged
kunchenguid merged 2 commits into
mainfrom
fm/fm-herdr-not-experimental-r1
Sep 19, 2026
Merged

kunchenguid merged 2 commits into
mainfrom
fm/fm-herdr-not-experimental-r1

Conversation

@kunchenguid

Copy link
Copy Markdown
Owner

Intent

Herdr is NOT an experimental backend anymore. Fix Firstmate's shared tracked material so nothing steers mates to opt out of Herdr.

Concrete incident: mini-default spawned a task with an explicit --backend tmux after the auto-detect notice said "NOTICE: auto-detected herdr runtime (HERDR_ENV=1) - spawning into the EXPERIMENTAL herdr backend. Set config/backend or pass --backend tmux to opt out." SSHHIP left auto-detect alone and correctly landed in Herdr. That notice is harmful because it pushes operators off Herdr.

This is a labeling, messaging, and test-truth correction, not a behavior redesign. Concrete scope:

  1. bin/fm-backend.sh auto-detect NOTICE for herdr: remove the EXPERIMENTAL framing and stop advertising tmux as the preferred opt-out. Prefer a silent herdr auto-detect like tmux, or a calm non-alarming notice with no "experimental" and no "opt out to tmux" steer. Do not push operators away from Herdr.
  2. Headers and comments in bin/fm-backend.sh, bin/backends/herdr.sh, and any other bin/ copy that still calls herdr EXPERIMENTAL: reclassify to match reality - Herdr has a required CI lane and is verified alongside tmux for fleet use. Keep zellij, orca, and cmux experimental.
  3. AGENTS.md, CONTRIBUTING.md, README.md, docs/configuration.md, docs/architecture.md, docs/scripts.md, and docs/herdr-backend.md as needed so herdr is not lumped in with the experimental backends. Preserve the accurate distinctions: tmux is the verified reference; herdr has its own CI lane; zellij, orca, and cmux remain experimental.
  4. Update tests that assert the old EXPERIMENTAL herdr notice text (tests/fm-backend-autodetect-smoke.test.sh, tests/fm-backend.test.sh, and any others) to match the new messaging.
  5. Do not change backend selection order, the remote-secondmate herdr requirement, or make herdr the default when it is not auto-detected. This is labeling, messaging, and test truth, not a behavior redesign.

Out of scope: forcing live crews off tmux, the mini FTUE respawn, and the zellij/orca/cmux status.

What Changed

  • Keep Herdr runtime auto-detection silent while preserving backend precedence and the experimental cmux warning.
  • Reclassify Herdr as a verified, required-CI backend across scripts and documentation while retaining tmux as the reference backend and Zellij, Orca, and cmux as experimental.
  • Update backend, session-start, and smoke tests to reject the obsolete experimental label and tmux opt-out steer.

Risk Assessment

✅ Low: The change is narrowly limited to Herdr labeling, messaging, documentation, and corresponding observable-output assertions while preserving backend selection behavior and experimental status for the other backends.

Testing

Drove a real isolated Herdr spawn, command execution, metadata verification, and teardown. Backend precedence, session startup, remote-secondmate boundaries, and documentation were checked only through targeted test suites or manual review, so those scenarios remain untested under the live-validation contract.

  • Live validation: ⚠️ inconclusive - 2 of 6 scenarios driven live against the product
Scenario Result Live Evidence
A native Herdr operator spawns without explicit backend configuration and receives no experimental warning or tmux opt-out steer ✅ pass live Real Herdr auto-detection spawn and teardown
An auto-detected Herdr task runs in a real pane, records Herdr endpoint metadata, and tears down cleanly ✅ pass live Real Herdr auto-detection spawn and teardown
Explicit tmux selection and nested runtime markers retain the existing precedence instead of making Herdr an unconditional default ⏸️ untested no The prior payload records only targeted test-suite evidence, not a real running-product interaction. Drive explicit tmux selection and nested runtime-marker cases in the live product to establish this…
Session startup under configured or auto-detected Herdr remains silent and does not require tmux ⏸️ untested no The prior payload records only targeted session-start test evidence, not a live product session. Start configured and auto-detected Herdr sessions in the real product and capture their observable outp…
Remote secondmates still require Herdr and reject non-Herdr endpoints without altering their route ⏸️ untested no The prior payload records only targeted lifecycle-suite evidence, not a live remote-secondmate interaction. Exercise Herdr and non-Herdr endpoints through the real product to establish this result.
Readers see Herdr described as having a required CI lane while Zellij, Orca, and cmux remain experimental, with no backend-level Herdr opt-out steer ⏸️ untested no The prior payload records manual file review rather than a live product interaction. Present the documentation through its user-facing product surface and capture what readers observe to establish a l…
Evidence: Real Herdr auto-detection spawn and teardown

Source: Real Herdr auto-detection spawn and teardown

FM_TEST_BEGIN 2026-09-19T20:34:27Z tests/fm-backend-autodetect-smoke.test.sh family=real-herdr-gated expected_gate_skip=herdr
ok - real herdr: fm-spawn.sh auto-detects verified herdr from HERDR_ENV=1 (no explicit config) without an opt-out steer
ok - real herdr: auto-detected spawn records backend=herdr and herdr_session/workspace/tab/pane fields in meta
ok - real herdr: the auto-detected spawn's launch command actually ran in the herdr pane
ok - real herdr: teardown completes the auto-detected spawn/teardown cycle (meta cleared, pane closed)
ok - real herdr: isolated lab session removed and default fleet session unchanged
FM_TEST_END 2026-09-19T20:34:41Z tests/fm-backend-autodetect-smoke.test.sh exit=0 duration_ms=13452 gate_skip=false
FM_TEST_SUMMARY total=1 failed=0 skipped_gate=0 duration_ms=13523
FM_TEST_SUMMARY_FAMILY family=real-herdr-gated count=1 duration_ms=13452 failed=0
FM_TEST_SLOWEST rank=1 script=tests/fm-backend-autodetect-smoke.test.sh duration_ms=13452
Evidence: Backend selection and precedence validation

Source: Backend selection and precedence validation

FM_TEST_BEGIN 2026-09-19T20:34:44Z tests/fm-backend.test.sh family=backend-dispatch expected_gate_skip=none
ok - fm_backend_name: FM_BACKEND env > config/backend > default tmux
ok - fm_backend_detect: no markers -> undetected, HERDR_ENV=1 -> herdr, $TMUX -> tmux, CMUX_WORKSPACE_ID -> cmux, nested combinations resolve innermost-first
ok - fm_backend_detect: falls back to __CFBundleIdentifier=com.cmuxterm.app when CMUX_WORKSPACE_ID is absent (signal bundle-id; foreign bundle ids rejected)
ok - fm_backend_detect: the cmux fallback signals are macOS-only (inert on a non-Darwin uname)
ok - fm_backend_detect: an inherited cmux bundle id never outranks $TMUX or HERDR_ENV (tmux/herdr-inside-cmux false positive absorbed)
ok - fm_backend_detect: ancestry fallback matches the lsappinfo-resolved (bundle-id) cmux app pid in the parent chain
ok - fm_backend_detect: ancestry fallback matches a bundle-shaped cmux comm path at any install location when lsappinfo cannot resolve a pid
ok - fm_backend_detect: ancestry fallback stops undetected at launchd (a reparented tmux server never reaches cmux)
ok - fm_backend_name: a fallback-detected cmux prints a NOTICE naming the fallback signal; the primary-marker notice is unchanged
ok - fm_backend_name: verified Herdr and tmux stay silent while experimental cmux remains loud
ok - fm_backend_name: an explicit FM_BACKEND or config/backend setting always wins over runtime auto-detection, including an ambient cmux marker
ok - fm_backend_validate: implemented adapters accepted, unknown and blocked codex-app backends refused loudly
ok - zsh: fm_backend_source recognizes known backends and rejects unknown ones
ok - bash: fm_backend_source recognizes known backends and rejects unknown ones
ok - fm_backend_validate_spawn: all implemented lifecycle backends are spawn-supported
ok - fm_meta_get / fm_backend_of_meta: read last key=value and default backend to tmux
ok - fm_backend_resolve_selector: session:window literal, exact task id first, legacy fm-<id> label fallback, ad hoc bare name via tmux list-windows
ok - fm_backend_of_selector: exact task ids, legacy fm-<id> labels, and matching explicit targets inherit metadata backend
ok - fm-send.sh: explicit tmux targets are verified; text types once and submits with Enter
ok - fm-peek.sh: capture-pane invocation and output are byte-identical old vs new
ok - fm-spawn.sh: a project reached through a symlinked prefix (e.g. macOS /tmp -> /private/tmp) does not trip the isolation guard's false refusal
ok - fm-teardown.sh: treehouse return remains compatible while tmux cleanup uses exact selectors
ok - fm-spawn.sh --backend bogus is refused loudly
ok - fm-spawn.sh --backend codex-app is refused
ok - fm-spawn.sh honors FM_BACKEND and refuses an unimplemented value loudly
ok - fm-spawn.sh: an explicit --backend tmux resolves silently and writes no backend= (missing means tmux)
ok - fm-spawn.sh: explicit --backend tmux wins over an ambient HERDR_ENV=1 auto-detect marker
ok - fm-spawn.sh: auto-detect resolves nested tmux-in-herdr to tmux and stays silent end to end
FM_TEST_END 2026-09-19T20:35:20Z tests/fm-backend.test.sh exit=0 duration_ms=36461 gate_skip=false
FM_TEST_SUMMARY total=1 failed=0 skipped_gate=0 duration_ms=36533
FM_TEST_SUMMARY_FAMILY family=backend-dispatch count=1 duration_ms=36461 failed=0
FM_TEST_SLOWEST rank=1 script=tests/fm-backend.test.sh duration_ms=36461
Evidence: Herdr session-start validation

Source: Herdr session-start validation

FM_TEST_BEGIN 2026-09-19T20:35:23Z tests/fm-session-start.test.sh family=session-bootstrap expected_gate_skip=none
ok - context digest distinguishes ABSENT, empty-but-present, and populated files
ok - a lock refusal prints a loud read-only banner, skips every mutating step, and still completes the digest
ok - session start stays read-only when lock ownership cannot be published
ok - locked session start freezes trace context and lock refusal leaves it unchanged
ok - concurrent session-lock acquisition admits exactly one live harness
ok - digest sections are ordered safety-preamble first, live fleet state before curated memory
ok - the read-once contract is stated once, ahead of the sources it governs
ok - session start: configured and auto-detected Herdr homes never require tmux
ok - session start: an absent recorded tmux window relaunches its Pi secondmate exactly once, off the blocking path
ok - session start: a deferred relaunch is always reported, so the digest's stale endpoint record cannot stand
ok - session start: inactive reconciliation runs after the digest and retains its durable wake
ok - session start: an unreachable host delays a reported check, not the digest
ok - session start: a deferred result the digest outran still reaches the agent as a wake
ok - session start: a read-only session declares its skipped network checks rather than dropping them
ok - session start: the tasks-axi compatibility verdict is computed once and reused
ok - session start: an existing ambiguous Pi process prevents duplicate recovery
ok - session start: transient tmux unreadability never licenses a relaunch
ok - session start: the proven bare-shell recovery path remains intact
ok - session start: a confirmed Herdr husk is closed and relaunched
ok - status tail is bounded to the configured line count, with the full log path always printed
ok - status tail lines are capped with a truncation marker while the full log stays reachable
ok - orphan status logs are printed once with bounded tails
ok - tmux endpoint liveness is reported per task: alive for a live window, dead for a gone one
ok - herdr endpoint liveness is reported per task: alive for a live pane, dead for a gone one
ok - fm-session-start.sh composes the real fm-lock.sh, fm-bootstrap.sh, and fm-wake-drain.sh output verbatim
ok - locked Pi session start replays leading routine outcomes, preserves the captain barrier, and sweeps only dead leases
ok - non-Pi session start neither sweeps nor replays Pi branch state
ok - compatible tasks-axi backlog rendering drops done rows and keeps every in-flight, held, and blocked row
ok - the startup backlog bound cuts only dispatchable queued rows and discloses the remainder exactly
ok - manual backlog rendering drops done rows, keeps every held or blocked title line, and bounds the rest
ok - unavailable or incompatible tasks-axi falls back to compact manual backlog rendering
ok - an empty fleet reports (none) for in-flight tasks and an absent AFK flag
ok - session start emits X-mode cadence guidance in the harness supervision block
ok - next step delegates watcher ownership to the AFK daemon
ok - next step delegates watcher ownership to the daemon in quiet mode, distinctly from away mode
ok - a legacy empty .afk flag (written before mode existed) still reads as away mode
ok - session start emits exactly one detected harness block and reports Pi extension load state
ok - session start preserves pi-signed primary identity while applying Pi extension guarantees
ok - session start rejects stale Pi loaded markers
ok - session start accepts current Pi markers written before lock acquisition
ok - session start emits the omp block and reports omp extension load state
ok - session start accepts current omp markers written before lock acquisition
ok - session start rejects Pi sessions missing the turn-end guard marker
ok - session start rejects Pi loaded markers from previous sessions
ok - the pure-Bash watchdog bounds session start, kills its hung grandchild, and emits the truncation contract
ok - the portable timeout path force-kills a command that ignores TERM
ok - a session start inside its budget prints no truncation banner
ok - the runtime bound leaves enough ancestry headroom for a deeply nested session to take the lock
ok - --reemit reprints the digest without repeating startup's mutating sweeps and still drains queued wakes
ok - true-start AGENTS baselines stay immutable while every drifted Pi compact re-emits the current contract
ok - read-only Pi compact refreshes against the rebuilding session identity without mutation
ok - Codex reset sources do not claim an unavailable instruction-refresh channel
ok - instruction baselines require SHA-256 and successful startup completion
ok - --reemit re-verifies lock ownership and keeps repair ownership with whoever holds it
# fm-session-start.test.sh: all assertions passed
FM_TEST_END 2026-09-19T20:40:56Z tests/fm-session-start.test.sh exit=0 duration_ms=332643 gate_skip=false
FM_TEST_SUMMARY total=1 failed=0 skipped_gate=0 duration_ms=332716
FM_TEST_SUMMARY_FAMILY family=session-bootstrap count=1 duration_ms=332643 failed=0
FM_TEST_SLOWEST rank=1 script=tests/fm-session-start.test.sh duration_ms=332643
Evidence: Remote-secondmate Herdr requirement validation

Source: Remote-secondmate Herdr requirement validation

FM_TEST_BEGIN 2026-09-19T20:46:40Z tests/fm-remote-secondmate-lifecycle-e2e.test.sh family=secondmate expected_gate_skip=none
ok - overlapping remote home provisioning serializes through publication and rollback
ok - remote seed rollback preserves serialized competing routes
ok - unknown readiness preserves its route and brief for reconciliation
ok - remote seeding checks, repairs, and re-checks readiness, then stops on a remaining gap
ok - remote seeding proceeds once the repair closes every gap
ok - remote seeding provisions a supplied origin without touching the primary project tree
ok - remote provisioning re-validates a supplied origin at the receiving host
ok - seeding carries bitbucket, self-hosted, and scp-like origins through to the remote clone
ok - remote seed registers the route and provisions the whole home and project clone on that host
ok - remote inheritance rejects incomplete and superseded payload generations
ok - mixed local and remote routes validate without migration
ok - remote spawn launches on the remote-local backend and records a host-qualified route
ok - legacy and mismatched remote endpoints fail closed before backend access
ok - non-herdr remote endpoints are refused without changing either route
ok - remote spawn serializes inheritance through launch publication
cannot retire terminal source; it remains registered: remote-reply-ios
ok - marked send and routed reply complete through the existing parent correlation owner
cannot retire terminal source; it remains registered: remote-reply-ios
ok - partial remote inheritance retains reread intent through bootstrap convergence
ok - config push and bootstrap serialize remote inheritance convergence
WARNING: watcher still down (same stale episode; last beat: 70s ago, grace 300s) - full banner already printed this episode.
cannot retire terminal source; it remains registered: remote-reply-ios
ok - remote inherited config retains and retries a failed live reread nudge
cannot retire terminal source; it remains registered: remote-reply-ios
cannot retire terminal source; it remains registered: remote-reply-ios
cannot retire terminal source; it remains registered: remote-reply-ios
ok - fleet snapshot projects mixed local and remote structured state
ok - remote update imports and fast-forwards the persistent home on its configured host
ok - the remote restart verb delegates to the host-local control plane and refuses before stopping anything
ok - startup repairs remote readiness before probing without relaunching
ok - the host-local state read steps around a stale shadowing herdr client
ok - startup reports alive legacy backends without changing their routes
ok - unreachable no-ledger remote state remains explicit with no local respawn or failover
cannot retire terminal source; it remains registered: remote-reply-ios
ok - remote retirement refuses child work, then removes only its own endpoint while a shared-session sibling survives
ALL TESTS PASSED
FM_TEST_END 2026-09-19T20:52:03Z tests/fm-remote-secondmate-lifecycle-e2e.test.sh exit=0 duration_ms=323124 gate_skip=false
FM_TEST_SUMMARY total=1 failed=0 skipped_gate=0 duration_ms=323197
FM_TEST_SUMMARY_FAMILY family=secondmate count=1 duration_ms=323124 failed=0
FM_TEST_SLOWEST rank=1 script=tests/fm-remote-secondmate-lifecycle-e2e.test.sh duration_ms=323124
- Outcome: ⚠️ 1 warning across 1 run (23m58s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 1 issue found → auto-fixed ✅
  • 🚨 docs/tmux-backend.md:13 - Intent requires that shared tracked material contain nothing steering mates to opt out of Herdr, but this unchanged setup text still advertises explicit tmux selection as “the opt-out from Herdr.” The change updates the notice and other documentation but omits this contradictory path. Replace it with neutral override wording, such as stating that explicit tmux selection overrides runtime auto-detection.

🔧 Fix applied.
✅ Re-checked - no issues remain.

⚠️ **Test** - 1 warning
  • ⚠️ live validation verdict: inconclusive (2 of 6 scenarios were driven live against the product); untested: Explicit tmux selection and nested runtime markers retain the existing precedence instead of making Herdr an unconditional default, Session startup under configured or auto-detected Herdr remains silent and does not require tmux, Remote secondmates still require Herdr and reject non-Herdr endpoints without altering their route, Readers see Herdr described as having a required CI lane while Zellij, Orca, and cmux remain experimental, with no backend-level Herdr opt-out steer
  • Live validation: ⚠️ inconclusive - 2 of 6 scenarios driven live against the product
Scenario Result Live Evidence
A native Herdr operator spawns without explicit backend configuration and receives no experimental warning or tmux opt-out steer ✅ pass live Real Herdr auto-detection spawn and teardown
An auto-detected Herdr task runs in a real pane, records Herdr endpoint metadata, and tears down cleanly ✅ pass live Real Herdr auto-detection spawn and teardown
Explicit tmux selection and nested runtime markers retain the existing precedence instead of making Herdr an unconditional default ⏸️ untested no The prior payload records only targeted test-suite evidence, not a real running-product interaction. Drive explicit tmux selection and nested runtime-marker cases in the live product to establish this…
Session startup under configured or auto-detected Herdr remains silent and does not require tmux ⏸️ untested no The prior payload records only targeted session-start test evidence, not a live product session. Start configured and auto-detected Herdr sessions in the real product and capture their observable outp…
Remote secondmates still require Herdr and reject non-Herdr endpoints without altering their route ⏸️ untested no The prior payload records only targeted lifecycle-suite evidence, not a live remote-secondmate interaction. Exercise Herdr and non-Herdr endpoints through the real product to establish this result.
Readers see Herdr described as having a required CI lane while Zellij, Orca, and cmux remain experimental, with no backend-level Herdr opt-out steer ⏸️ untested no The prior payload records manual file review rather than a live product interaction. Present the documentation through its user-facing product surface and capture what readers observe to establish a l…
  • mkdir -p state && bin/fm-test-run.sh tests/fm-backend-autodetect-smoke.test.sh; rmdir state
  • mkdir -p state && bin/fm-test-run.sh tests/fm-backend.test.sh; rmdir state
  • mkdir -p state && bin/fm-test-run.sh tests/fm-session-start.test.sh; rmdir state
  • bin/fm-test-run.sh tests/fm-remote-secondmate-lifecycle-e2e.test.sh
  • Reviewed the tracked user-facing documentation for obsolete experimental-Herdr or backend opt-out guidance and confirmed Zellij, Orca, and cmux remain labeled experimental.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@kunchenguid
kunchenguid merged commit 1b1b6e0 into main Sep 19, 2026
19 checks passed
@kunchenguid
kunchenguid deleted the fm/fm-herdr-not-experimental-r1 branch September 19, 2026 21:22
Ye1806431561 pushed a commit to Ye1806431561/firstmate that referenced this pull request Sep 20, 2026
* Stop steering operators away from Herdr

* no-mistakes(review): Neutralize remaining Herdr opt-out documentation wording
Ivory2024 pushed a commit to Ivory2024/firstmate that referenced this pull request Sep 20, 2026
* Stop steering operators away from Herdr

* no-mistakes(review): Neutralize remaining Herdr opt-out documentation wording
Ivory2024 added a commit to Ivory2024/firstmate that referenced this pull request Sep 20, 2026