docs: make the auto-spawn contract per verb, not per carrier #161

Merged
natsukium merged 2 commits from fix/remote-autospawn-contract-141 into main 2026-09-06 12:55:21 +09:00
Owner

Fixes #141.

The remote auto-spawn contract was stated per carrier, which contradicted
what the code does per verb: only sessions spawn and window launches ask
for a daemon to be started, while daemon status, sessions list/info/…,
notifications subscribe, version, doctor, and bridge refuse to
auto-spawn on a cold socket and report unreachable instead. Each verb now
pins its own policy at the call site (RemoteSpawn threaded through
dial_launch / connect_carrier), so local and SSH landings agree, and the
docs describe the matrix per verb rather than per carrier.

Doc cascade: docs/reference/cli.md ("Auto-spawning"), docs/reference/ipc.md,
docs/explanation/architecture/control-surfaces.md, and skills/felis/SKILL.md.

Verified: just check green (fmt, clippy, nextest, deny, proto-compat); reviewed
by pi luna + pi sol; docs proofread by Gemini gemini-3.8-flash-high

Follow-ups

  • #160 docs: update-felis.md's restart guidance overstates which commands auto-spawn

Deferred

  • Making a retarget landing on a cold local socket spawn a daemon (today it fails, unlike the SSH landing). Reason: behavior change, not a doc fix; the plan excludes it from #141 and it is documented as the contract in cli.md and control-surfaces.md.
  • just skill-check cannot run in this dev shell (yq: command not found). Reason: environment gap affecting every SKILL.md, unrelated to this issue.
Fixes #141. The remote auto-spawn contract was stated per carrier, which contradicted what the code does per verb: only `sessions spawn` and window launches ask for a daemon to be started, while `daemon status`, `sessions list/info/…`, `notifications subscribe`, `version`, `doctor`, and `bridge` refuse to auto-spawn on a cold socket and report unreachable instead. Each verb now pins its own policy at the call site (`RemoteSpawn` threaded through `dial_launch` / `connect_carrier`), so local and SSH landings agree, and the docs describe the matrix per verb rather than per carrier. Doc cascade: `docs/reference/cli.md` ("Auto-spawning"), `docs/reference/ipc.md`, `docs/explanation/architecture/control-surfaces.md`, and `skills/felis/SKILL.md`. Verified: just check green (fmt, clippy, nextest, deny, proto-compat); reviewed by pi luna + pi sol; docs proofread by Gemini gemini-3.8-flash-high ## Follow-ups - #160 docs: update-felis.md's restart guidance overstates which commands auto-spawn ## Deferred - Making a retarget landing on a cold local socket spawn a daemon (today it fails, unlike the SSH landing). Reason: behavior change, not a doc fix; the plan excludes it from #141 and it is documented as the contract in cli.md and control-surfaces.md. - `just skill-check` cannot run in this dev shell (yq: command not found). Reason: environment gap affecting every SKILL.md, unrelated to this issue.
Whether a CLI verb may leave a daemon running is a side effect scripts
depend on, and it was decided in four places at once: `Dial`, three
bare `conn::dial` calls, and `dial_and_land`. Nothing tied them
together, so nothing would notice a verb drifting from the contract.

Each dial site now names its `RemoteSpawn` where it dials, and one
test walks the whole verb list over both carriers to assert what the
reference promises: intent decides, the carrier does not. The retarget
landing is the asymmetry the test pins deliberately: it spawns over
SSH and fails on a cold local socket, because `dial_and_land` opens
that socket directly. `--host` and `sessions spawn --help` state the
remote side effect, which a script author could not otherwise predict.

Refs #141
docs: make the auto-spawn contract per verb, not per carrier
Some checks failed
darwin / build felis (aarch64-darwin) (pull_request) Successful in 49s
bench / Criterion full-suite snapshot (pull_request) Has been skipped
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
bench / Criterion regression gate (pull_request) Failing after 2m7s
fuzz / cargo fuzz smoke (per target) (pull_request) Successful in 1m28s
pr / nix flake check (pull_request) Successful in 47s
pr / cargo build / clippy / test / deny (pull_request) Successful in 2m8s
windows / cargo nextest (Windows) (pull_request) Successful in 6m41s
pr / wire schema is compatible with the base (pull_request) Successful in 14s
pr / frontend smoke (x86_64-linux) (pull_request) Successful in 1m5s
pr / publish felis (x86_64-linux) (pull_request) Has been skipped
windows / cargo clippy (Windows cross) (pull_request) Successful in 18s
fuzz / cargo fuzz nightly long-run (push) Has been skipped
darwin / build felis (aarch64-darwin) (push) Successful in 13s
pr / cargo build / clippy / test / deny (push) Successful in 2m30s
pr / wire schema is compatible with the base (push) Successful in 9s
pr / frontend smoke (x86_64-linux) (push) Successful in 7s
windows / cargo clippy (Windows cross) (push) Successful in 25s
windows / frontend smoke (Windows) (pull_request) Successful in 2m20s
windows / package felis (x86_64-pc-windows-msvc) (pull_request) Has been skipped
fuzz / cargo fuzz smoke (per target) (push) Successful in 1m35s
pr / nix flake check (push) Successful in 12s
pr / publish felis (x86_64-linux) (push) Successful in 14s
windows / frontend smoke (Windows) (push) Successful in 1m37s
windows / cargo nextest (Windows) (push) Successful in 7m33s
windows / package felis (x86_64-pc-windows-msvc) (push) Successful in 2m0s
efbef9281e
The scripting contract promised that `--host` never spawns a remote
daemon, while the code, ipc.md and control-surfaces.md all say the
verb's intent decides and the carrier does not. Scripts read the
reference, so the promise was the bug: `--host … sessions spawn` has
always left a daemon on the remote host.

cli.md now carries the per-form matrix both carriers share, including
the two rows a retarget needs (its source dial drives, its landing on
the target host launches), and the twins point at it instead of
restating a partial list.

Refs #141
natsukium deleted branch fix/remote-autospawn-contract-141 2026-09-06 12:55:21 +09:00
Sign in to join this conversation.
No description provided.