Repository navigation
Conversation
[Medium impact] The PR appears safe to merge; the previous test finding is fixed and no new blocking issue remains. Reviews (4) · Last reviewed commit: "no-mistakes(document): Align away-superv..." · Reviewed by Greptile |
|
Speaking as Kun's firstmate: thank you @kesslerio for closing both #7168 gaps in one careful change, and for keeping the refusal story in a single owner. What I checked on
Contract-class (my own read): new-default. The Orca half is a restore, because the docs already promised that refusal. But VISION.md, rule by rule: One captain, one interface: aligns (an away window that looks armed while delivering nothing is the hidden failure the honesty rule forbids). Authority is explicit: aligns (it refuses instead of guessing a target). Scripts own the mechanics: aligns (deterministic discovery with one owner for the backend list). A restart is a non-event: aligns ( Nothing is needed from you right now. The red |
|
Speaking as Kun's firstmate: thanks @kesslerio. Head |
|
Heads-up on |
|
Speaking as Kun's firstmate: thanks @kesslerio for the heads-up. You were right that it isn't your code, though the lanes were different ones. On run I've re-run the failed jobs once on head |
|
Speaking as Kun's firstmate: thanks @kesslerio. The rerun came back fully green on This is now with Kun. Refusing away mode without a verifiable operator session, and probing the endpoint before arming, change what an unconfigured |
…on (kunchenguid#7168) Two ways of arming away supervision that looks live while delivering nothing are still open after kunchenguid#5591. Both now refuse at the point where the flag would be written. Gap 1 (new default): `fm_afk_launch_start_native` wrote `state/.afk` and recorded `none - native` without ever calling `discover_supervisor_target`, so `/afk` reported armed before any refusal was possible and no daemon ran. `start` and `start-native` now share one pre-flag capture (`fm_afk_launch_capture_captain`): discovery must name an operator session the away daemon can inject into, or the entry refuses and writes nothing. A refused refresh leaves the existing flag and stale escalation artifacts byte-for-byte. Gap 2 (restore): the documented Orca refusal never ran, because `discover_supervisor_backend`/`discover_supervisor_target` had no Orca arm and an Orca primary fell through to the `firstmate:0` tmux fallback. Discovery now recognizes `ORCA_TERMINAL_HANDLE`, which Orca puts into every terminal it spawns, checked after every innermost signal so nested tmux, Herdr, Rex, and an explicit T3 thread keep their own transport. The daemon refuses it by name (`source=ORCA_TERMINAL_HANDLE`) and the launcher refuses it before arming. Recognition is for the refusal only; Orca stays explicit-only for task endpoints. `FM_SUPERVISOR_SUPPORTED_BACKENDS` and its predicate move into `bin/fm-supervisor-target-lib.sh`, the single owner of supervisor resolution, so the daemon and the launcher cannot disagree about a backend. Tests cover both directions: no session refuses without arming, a refused refresh preserves prior state, a supported session still records the existing `none - native` shape, and Orca is recognized-but-refused on both entry paths and at daemon startup. Closes kunchenguid#7168
The daemon's usage header listed every auto-discovered supervisor signal except the Orca terminal handle, and the runtime verification record named a host its own commands contradicted. Both now say what the code does: the header carries $ORCA_TERMINAL_HANDLE in the discovery order, and the record states the Orca version it inspected and leaves the app path to the machine being checked.
…/fm-afk-launch.test.sh: the suite-level FM_AFK_LAUNCH_TARGET_PROBE pin now only serves backend-free lifecycle units. e2e_herdr and e2e_rex each declare `local FM_AFK_LAUNCH_TARGET_PROBE=` exactly like e2e_tmux, so both provision real captain endpoints and exercise the real fm_backend_target_exists probe instead of the seam, catching a probe that wrongly refuses a valid endpoint (the sleeper daemon replacement means no later daemon check covers this). E2E assertions are unchanged, and each of the three e2e functions now carries a one-line comment naming that reason. (2) docs/architecture.md: split the refusal sentence so unsupported supervisor backends are stated to refuse at daemon startup and in bin/fm-afk-launch.sh before it writes state/.afk, while a discovery naming no injectable operator session refuses only in bin/fm-afk-launch.sh (start and start-native) before that flag; direct daemon startup warns and keeps the legacy firstmate:0 fallback. The existing configuration.md cross-reference (which owns the refusal contract and the launcher endpoint check) is retained. Verification: `bash bin/fm-test-run.sh tests/fm-afk-launch.test.sh` passed (exit=0) with herdr present, so e2e_herdr ran through the real probe and all seven herdr assertions and five tmux e2e assertions passed; rex e2e skipped because the Rex CLI is unavailable here. The real rex probe path uses fm_backend_rex_target_ready, which parses the target and reads with --autostart=false, independent of REX_SESSION. `bash bin/fm-doc-audience-check.sh` passed (surfaces=137, local_links=1107) and shellcheck on the test file is clean. The Greptile check log itself could not be retrieved (check run no longer present), but its two P2 findings are fixed as described. code_change_needed=true because the test-seam skip was a real defect in the change's own coverage and the doc overclaimed a safeguard
80fce12 to
a20e6ab
Compare
…dence and launcher refusals
|
Speaking as Kun's firstmate: thanks @kesslerio for carrying this through the rebase onto hc auto-select. On the new head |
What Changed
bin/fm-afk-launch.shnow resolves the operator session (target, backend, supported-backend check, and endpoint existence) before it writesstate/.afk, on bothstartandstart-native, so a refusal leaves existing lifecycle files untouched instead of reporting an armed window that can deliver nothing.bin/fm-supervisor-target-lib.sh, and taught supervisor discovery to recognizeORCA_TERMINAL_HANDLEafter every innermost signal, so an Orca-hosted captain gets the named unsupported-backend refusal (daemon startup and launcher) rather than falling through to thefirstmate:0tmux fallback.architecture.md,configuration.md,orca-backend.md,t3code-backend.md,tern-backend.md,verification/runtime-backends.md) to point at the single refusal/discovery owner, and extendedtests/fm-daemon.test.sh,tests/fm-afk-launch.test.sh,tests/fm-backend-t3code.test.sh, andtests/lib.shwith discovery-precedence, pre-arm refusal, and Orca-marker isolation cases.Risk Assessment
✅ Low: The changes preserve the required discovery precedence and enforce launcher refusal before arming, with no material defects found in the source review.
Testing
Both behaviour owners ran green (tests/fm-afk-launch.test.sh exit=0 with the real herdr e2e and tmux e2e plus the new refusal units; tests/fm-daemon.test.sh exit=0 including the hc and Orca discovery units), and tests/fm-afk-return.test.sh stayed green. The touched t3code restart unit also passed; that suite's single failure is the Codex configuration guard the intent already records as environmental on this host. I then drove the real product in a disposable marked lab home on its own tmux socket: away entry refused a session-less host, an Orca-hosted captain, an hc-hosted captain, and mistyped/unresolvable endpoints before writing state/.afk, with the daemon giving the same named refusals at startup, while a real live tmux pane passed the endpoint probe, armed, launched the daemon (log target=%0, backend=tmux), and stopped cleanly; a tmux pane nested in Orca kept its own transport. Only the T3-thread-inside-Orca precedence could not be driven live because no T3 Code instance or config/t3code-token credential exists here; it is asserted by the passing daemon discovery units. The lab was torn down in this same turn.
could not resolve a verifiable operator session ... refusing to arm away mode, rc=1, state afk=ABSENT terminal=ABSENT, posture record unchangedaway supervision does not support supervisor backend 'orca' yet ...; refusing to arm away mode, rc=1, no .afk/.afk-daemon-terminaldoes not support supervisor backend 'hc') and drive3 (error: away-mode daemon does not support supervisor backend 'hc', log `startup failed: unsupport…supervisor target 'no-such-session:0' does not resolve to a tmux endpoint) and D2 (%99999), both rc=1 with no .afkafk=away terminal=none - native, then stop archived the record and cleared statedaemon launched in detached tmux session 'fm-afk-daemon-...', supervising %0, recordtmux fm-afk-daemon-..., daemon log `target=%0; target_source=FM_…ok - herdr e2e: ...(7 assertions, probe seam cleared inside e2e_herdr), full log in fm-afk-launch-test.log, exit=0ORCA_TERMINAL_HANDLE=term_live123 bin/fm-afk-launch.sh start-nativeinside the tmux pane armed (rc=0, afk=away, terminal=none - native); discovery probe `…error: away-mode daemon does not support supervisor backend 'orca' yet, log `startup failed: unsupported supervisor backend 'orca' (source=ORCA_TERMINA…Evidence: tests/fm-afk-launch.test.sh full run (exit=0, herdr + tmux e2e live)
Source: tests/fm-afk-launch.test.sh full run (exit=0, herdr + tmux e2e live)
Evidence: tests/fm-daemon.test.sh full run (exit=0, hc + Orca discovery units)
Source: tests/fm-daemon.test.sh full run (exit=0, hc + Orca discovery units)
Evidence: tests/fm-afk-return.test.sh full run (exit=0)
Source: tests/fm-afk-return.test.sh full run (exit=0)
Evidence: Live away-mode refusal, discovery-precedence, and real-pane arming transcripts from the disposable lab home
Source: Live away-mode refusal, discovery-precedence, and real-pane arming transcripts from the disposable lab home
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
🔧 **Rebase** - 10 issues found → auto-fixed ✅
bin/fm-afk-launch.sh- merge conflict rebasing onto refs/remotes/no-mistakes-push/fix/7168-afk-verifiable-operator-sessionbin/fm-supervisor-target-lib.sh- merge conflict rebasing onto refs/remotes/no-mistakes-push/fix/7168-afk-verifiable-operator-sessiondocs/configuration.md- merge conflict rebasing onto refs/remotes/no-mistakes-push/fix/7168-afk-verifiable-operator-sessiondocs/orca-backend.md- merge conflict rebasing onto refs/remotes/no-mistakes-push/fix/7168-afk-verifiable-operator-sessiondocs/verification/runtime-backends.md- merge conflict rebasing onto refs/remotes/no-mistakes-push/fix/7168-afk-verifiable-operator-sessiontests/fm-afk-launch.test.sh- merge conflict rebasing onto refs/remotes/no-mistakes-push/fix/7168-afk-verifiable-operator-sessiontests/fm-backend-t3code.test.sh- merge conflict rebasing onto refs/remotes/no-mistakes-push/fix/7168-afk-verifiable-operator-sessiontests/fm-daemon.test.sh- merge conflict rebasing onto refs/remotes/no-mistakes-push/fix/7168-afk-verifiable-operator-sessiondocs/configuration.md- merge conflict rebasing onto origin/maintests/fm-daemon.test.sh- merge conflict rebasing onto origin/main🔧 Fix applied.
✅ Re-checked - no issues remain.
🔧 **Review** - 1 issue found → auto-fixed ✅
tests/fm-afk-launch.test.sh:76- The new no_operator_session helper leaves HC_TERMINAL_ID and HC_TERMINAL_SOCKET inherited. Running this suite inside an hc terminal therefore discovers hc instead of no session or Orca: the no-session assertion at tests/fm-afk-launch.test.sh:248 and Orca assertions at :315 and :325 fail, while the preservation case at :298 passes for the wrong refusal reason. Clear the hc identity markers in this shared helper so these fixtures exercise their intended paths.🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
could not resolve a verifiable operator session ... refusing to arm away mode, rc=1, state afk=ABSENT terminal=ABSENT, posture record unchangedaway supervision does not support supervisor backend 'orca' yet ...; refusing to arm away mode, rc=1, no .afk/.afk-daemon-terminaldoes not support supervisor backend 'hc') and drive3 (error: away-mode daemon does not support supervisor backend 'hc', log `startup failed: unsupport…supervisor target 'no-such-session:0' does not resolve to a tmux endpoint) and D2 (%99999), both rc=1 with no .afkafk=away terminal=none - native, then stop archived the record and cleared statedaemon launched in detached tmux session 'fm-afk-daemon-...', supervising %0, recordtmux fm-afk-daemon-..., daemon log `target=%0; target_source=FM_…ok - herdr e2e: ...(7 assertions, probe seam cleared inside e2e_herdr), full log in fm-afk-launch-test.log, exit=0ORCA_TERMINAL_HANDLE=term_live123 bin/fm-afk-launch.sh start-nativeinside the tmux pane armed (rc=0, afk=away, terminal=none - native); discovery probe `…error: away-mode daemon does not support supervisor backend 'orca' yet, log `startup failed: unsupported supervisor backend 'orca' (source=ORCA_TERMINA…bash bin/fm-test-run.sh tests/fm-afk-launch.test.sh(exit=0; real herdr e2e 7 assertions, tmux e2e 5 assertions, rex e2e skipped: Rex CLI unavailable)bash bin/fm-test-run.sh tests/fm-daemon.test.sh(exit=0, including discover_supervisor_hc and discover_supervisor_orca_after_inner_signals units and test_afk_start_refuses_orca_supervisor_backend)bash bin/fm-test-run.sh tests/fm-afk-return.test.sh(exit=0)bash bin/fm-test-run.sh tests/fm-backend-t3code.test.sh(touched unitnative restart re-arms discarded T3 stale warnings exactly once and preserves delivered suppressionpassed; the only failure is the environment-boundinstalled Codex failed the tracked configuration guardthat the intent records as reproducing on unmodified main on this host)Live lab drive: marked lab home viabin/fm-lab-home.sh create, private sockettmux -L fm-labwithTMUX_TMPDIR=$LAB/tmux, realbin/fm-afk-launch.shdriven from inside the lab pane:enter, thenstart-native/startwith cleared markers (refusal, no state/.afk), withORCA_TERMINAL_HANDLE(refusal naming orca), withHC_TERMINAL_ID/HC_TERMINAL_SOCKET(refusal naming hc), withFM_SUPERVISOR_TARGET=no-such-session:0and%99999(endpoint-probe refusal)Live lab drive:start-nativeagainst the real pane (FM_SUPERVISOR_TARGET=$TMUX_PANE FM_SUPERVISOR_BACKEND=tmux) arms state/.afk +none - native;stopclears itLive lab drive:startagainst the real pane launches detachedfm-afk-daemon-*session with daemon logtarget=%0; target_source=FM_SUPERVISOR_TARGET; backend=tmux;stoptears the session down and archives the recordLive lab drive:ORCA_TERMINAL_HANDLEset inside the tmux pane still arms against tmux transport (Orca checked last)Live lab drive:bin/fm-afk-start.shwithORCA_TERMINAL_HANDLEand with hc markers refuses at startup (startup failed: unsupported supervisor backend 'orca' (source=ORCA_TERMINAL_HANDLE),'hc'), touching no firstmate:0 sessionLive lab drive: realdiscover_supervisor_{target,backend}precedence probe (nothing/hc/hc+Orca/Orca/tmux+Orca/explicit override) andfm_supervisor_backend_supportedfor tmux herdr rex t3code hc orca zellij cmux ternTeardown:tmux -L fm-lab kill-server,rm -rf $LAB; no lab processes or temp dirs left, worktree clean (git status --porcelainempty)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.