Repository navigation
Conversation
7e68dd6 to
4780dc8
Compare
…creen reads - Secondmate spawns on Orca: the home is created as an Orca-managed worktree outside the repo (project worktree-base-path), seeded, given a terminal via 'terminal create --worktree path:', and released with 'orca worktree rm' at teardown. Home-isolation and unlanded-work safety invariants preserved. - Full key parity: Escape and Ctrl-U delivered as raw --text control bytes (--interrupt is Ctrl-C and is not a substitute); Enter/C-c unchanged. - Captures/composer reads use 'terminal read --screen' (rendered), replacing the default stream mode that garbled TUI reads. - Fix: teardown validation now accepts real Orca worktree ids (<repo-id>::<abs-path>), which the strict atom validator rejected. - Fix: setup base-path idempotency check (illegal top-level return in node -e). - Docs + fake-CLI tests for every new path.
- busy_state: correlate the task terminal to Orca's agent status (worktree ps agents[].state = working|done|blocked, the vocabulary from Orca's own hook source); working->busy, done/blocked->idle, unattributed ->unknown (falls back to the harness lifecycle). Trusted for BUSY in fm-busy-lib alongside herdr. - agent_state: recovery-grade classifier from terminal orphaned/connected/ agentIdentity + worktree ps state -> alive/dead/missing/ambiguous. Only dead/missing license recovery; a connected terminal with no attributable agent stays ambiguous. Wires Orca into fm_backend_agent_state and marks it state-verified, so secondmate auto-recovery and fm-control exit/relaunch now work on Orca. - Fake-CLI unit tests for both classifiers; control/state-verified tests updated. Verified live against the running fleet (alive/idle for a live agent, missing for a bogus handle).
4780dc8 to
2a8cfdb
Compare
|
Speaking as Kun's firstmate: this is a draft — waiting on the author to mark ready when you want full triage-for-merge. Reviewed body + file list + shared backend/busy/control/send hunks vs main Security: clean. No Contract-class: opt-in. Changes deepen the experimental Orca backend (secondmate home-as-Orca-worktree, Escape/Ctrl-U via VISION:
Workflow approval this pass (tip action_required after diff review):
Attestation: MISSING on tip No auto-merge from draft. Not a captain hold — waiting on you. |
… delivery (#1) * feat(orca): add agent-state classifier, secondmate spawns, and Escape delivery Give backend=orca a recovery-grade agent-state classifier built on `orca terminal show`'s connected and agentIdentity fields, as upstream kunchenguid#4830 does, and lift the Orca secondmate-spawn refusal that the missing classifier caused. Deliver Escape and Ctrl-U to an Orca terminal as raw control bytes through `orca terminal send --text`, the send_key hunk of upstream kunchenguid#3579, so `fm-control.sh <id> interrupt` works for Escape harnesses on Orca. `fm-control.sh exit` and `relaunch` stay refused on Orca. Live readings against Orca 1.4.218 show connected is the terminal's liveness, and that agentIdentity is absent both for a bare shell and for a running agent, so neither field can prove an agent stopped inside an open terminal. The evidence is recorded in docs/verification/runtime-backends.md. * no-mistakes(review): Orca classifier: unproven reads are unreadable, not missing * no-mistakes(document): Fix stale Orca classifier and cmux docs
Summary
Brings the experimental Orca runtime backend substantially closer to parity with the tmux/herdr reference backends. Every underlying Orca CLI behavior was verified live against a real runtime (Orca 1.4.x); every code path is covered by fake-CLI unit/integration tests.
What's now covered
Secondmate spawns on Orca (the headline gap). Orca can only open a terminal inside an Orca-managed worktree, so a secondmate home is created as an Orca worktree of the firstmate repo, placed outside the repo via the project's
worktree-base-pathso the existing "a secondmate home may not live inside the firstmate repo" safety invariant is preserved (not relaxed).bin/fm-home-seed.sh: on the Orca backend the leased (-) home is created withorca worktree createinstead of a treehouse lease; rollback releases it withorca worktree rm. An explicit home path is refused (Orca cannot adopt an arbitrary checkout).bin/fm-spawn.sh: thebackend=orca && --secondmaterefusal is removed; the secondmate reuses the seeded home worktree (resolves its id from the path, creates the terminal viaterminal create --worktree path:) and never creates a second worktree.bin/fm-teardown.sh: an Orca secondmate home is released viaorca worktree rm --worktree path:under all the existing landed-work/in-flight guards.Full key parity — real Escape.
--interruptis Ctrl-C, which for 8 of 9 harnesses is not the interrupt key (they cancel a turn with Escape). Orca now delivers Escape and Ctrl-U as their raw control bytes throughterminal send --text(verified live: an ESC byte reachescat -vas^[, a Ctrl-U performs the tty line-kill).fm-controlandfm-sendkey tables updated accordingly.Rendered-screen captures. Captures/composer reads switched to
terminal read --screen. Orca's default stream mode stacks TUI repaints into fragments (its own docs call it "unsuitable for verifying rendered output"), which was garbling every composer classification and steer confirmation.Bug fixes surfaced by real-Orca verification
<repo-id>::<absolute-path>, which the strict endpoint-atom validator rejects (://). This meant all real Orca teardown (ship/scout/secondmate) would have been refused; only simplified test ids ever passed. Added an Orca-specific worktree-id validator.returnin anode -esnippet made the "is the base path already set?" check always fail, so it rewrote config on every home creation. Fixed.What is NOT covered (honest limits)
fm-spawn.sh <id> --secondmate(documented).Verification
--screen, path→id resolution,worktree rm, raw ESC + Ctrl-U byte delivery, and the full new adapter functions end to end (with cleanup).fm-backend-orca(57),fm-backend(28),fm-control(35),fm-control-relaunch(46),fm-teardown(58),fm-teardown-endpoint-safety(7),fm-secondmate-safety(77),fm-secondmate-lifecycle-e2e(6),fm-secondmate-sync(21),fm-secondmate-liveness(15),fm-bootstrap(28),fm-send-secondmate-marker(8). shellcheck-clean.Remaining (manual, out of CI scope)
A full end-to-end smoke of a live secondmate agent running a supervision loop inside an Orca home (same manual-smoke posture as herdr's, recorded in
docs/verification/runtime-backends.md). All plumbing is unit/integration tested with the fake-CLI harness and every Orca primitive is verified live.