@log0u7/opencode-mesh 0.25.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,33 +5,46 @@ All notable changes to this project are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [0.25.0] - 2026-11-24
8
+ ## [0.26.0] - 2026-11-25
9
9
 
10
- ### Changed
10
+ ### Added
11
+
12
+ - Three spawn modes for mesh_spawn — where the child runs is now a choice,
13
+ and the default stops being the worktree:
14
+ - **session** (default): the child runs in the host's natural context — the
15
+ cwd of the peer's serve — with no directory imposed and zero
16
+ dependencies. Nothing touches the worktree table or discovery.
17
+ - **project** (`project=<dir>`): the child runs in that existing directory
18
+ — a real project, git or not (a non-git project is still a project; the
19
+ core opencode conflates the two, the mesh does not inherit that). The
20
+ directory is checked on the target host: locally with a direct existence
21
+ check, remotely inside the signed request, where the peer answers an
22
+ explicit refusal "spawn refused: project directory <dir> does not exist
23
+ on peer".
24
+ - **worktree** (`worktree: true` + `project=<dir>`): the git isolation,
25
+ opt-in by choice — the unchanged 0.24.x machinery (worktree create, the
26
+ 0.24.7 discovery refresh retry, the 0.24.8 signed projectID retarget,
27
+ which lives on this path only). `worktree: true` without `project=` is
28
+ refused ("worktree requires project").
29
+ - The spawn mode is recorded on the worker row (workers.spawn_mode, schema
30
+ v14; every pre-0.25.0 row is a worktree spawn) so mesh_worker_remove only
31
+ ever removes what the mesh created — a project or session spawn keeps its
32
+ directory, and the worktree API is never called for it.
33
+ - Local back-compat: a nameless headless spawn keeps the legacy worktree
34
+ behavior; an enrolled spawn (name=) defaults to session mode. The spawn
35
+ mode travels in the signed distant-spawn spec (project/worktree ride inside
36
+ the signature, the receiver rebuilds them canonically) and the 0.24.5
37
+ one-log-line-per-spawn and 0.24.7 SourceDirectoryNotFoundError paths stay
38
+ dead on the default and project modes (no worktree machinery runs there).
39
+
40
+ ### Removed
11
41
 
12
- - The enrolled spawn births a workspace COLLEAGUE by default: an opencode
13
- session in the fleet workspace (`spawnWorkspace` option, default
14
- `~/projets/fleet`, per host), with no project dependency. The child keeps
15
- the enrolled behavior (mesh tools, self-enroll header, logs, session
16
- capture, exit tracking, `spawnMax` quota), but no worktree is created and
17
- no project machinery runs — the structural
18
- `Worktree.SourceDirectoryNotFoundError` is dead by construction. A missing
19
- workspace directory refuses the spawn with the remedy: "spawn workspace
20
- <path> does not exist — create it or set spawnWorkspace".
21
- - The project worktree machinery (the 0.23.0/0.24.x path, including the
22
- 0.24.7 refresh-and-retry and the 0.24.8 retarget) is now OPT-IN: pass
23
- `project=<repo path>` to birth the child in a project worktree, for code
24
- tasks in a repo. The plain headless worker (no `name`) is unchanged and
25
- keeps its worktree.
26
- - Distant spawn (`node=<paired peer>`) follows the same split: without
27
- `project=` the signed payload is the spec alone (the exact legacy
28
- signature — old parents verify on new peers) and the peer births the
29
- colleague in ITS OWN fleet workspace; with `project=` the parent's
30
- projectID is signed along (0.24.8 semantics) and the peer keeps the
31
- worktree machinery. A workspace colleague's registry row carries the
32
- `workspace` branch sentinel: `mesh_worker_remove` deletes the row and reaps
33
- the pools but never hands the shared workspace directory to the worktree
34
- API. New option: `spawnWorkspace` (default `~/projets/fleet`).
42
+ - The 0.25.0 fleet-workspace spawn design (`spawnWorkspace` option, the
43
+ `~/projets/fleet` workspace colleague default, `resolveSpawnWorkspace`,
44
+ `WORKSPACE_BRANCH`): superseded by the three spawn modes above — a spawned
45
+ child is now born in the host's natural context by default (session mode),
46
+ not in a shared workspace directory. The 0.25.0 release shipped that
47
+ design; this one replaces it one day later, per the validated redesign.
35
48
 
36
49
  ## [0.24.8] - 2026-11-24
37
50
 
package/README.md CHANGED
@@ -16,7 +16,7 @@ One OpenCode instance is one brain. When a task outgrows a single session, or yo
16
16
 
17
17
  - **Same machine:** sessions coordinate through a local registry - messages (`mesh_send` / `mesh_inbox`) and exclusive file claims (`mesh_lock`).
18
18
  - **Across the room:** nodes advertise over mDNS and pair with explicit operator approval (per-peer bearer tokens, deny by default). VPN overlay IPs are picked up automatically (Tailscale/Headscale, NetBird, ZeroTier) or declared statically for any tunnel (WireGuard, IPsec, SSL VPN).
19
- - **Headless workers:** `mesh_spawn` starts an isolated OpenCode worktree per worker, tracks its lifecycle, captures its logs, and cleans up on dispose. With a `name`, the spawn is an enrolled fleet agent: it keeps the mesh tools and joins the fleet at its first turn (0.23.0). Since 0.25.0 that agent is by default a workspace COLLEAGUE — an OpenCode session born in the fleet workspace (`spawnWorkspace`, default `~/projets/fleet`), with no project dependency; the project worktree machinery is opt-in via `project=<repo>`. With `node=<paired peer>`, that agent is born on the peer (signed request, deny-by-default `acceptSpawn`, per-peer quota, ack DM — 0.24.0).
19
+ - **Headless workers:** `mesh_spawn` starts a worker where the spawn mode says (0.26.0): session (default — the host's natural context, no directory imposed), project (`project=<dir>` — an existing directory, git or not), worktree (`worktree: true` + `project=<dir>` — the git isolation, opt-in). It tracks the lifecycle, captures the logs, and cleans up on dispose. With a `name`, the spawn is an enrolled fleet agent: it keeps the mesh tools and joins the fleet at its first turn (0.23.0). With `node=<paired peer>`, that agent is born on the peer (signed request, deny-by-default `acceptSpawn`, per-peer quota, ack DM — 0.24.0).
20
20
 
21
21
  ```mermaid
22
22
  flowchart LR
@@ -38,7 +38,7 @@ flowchart LR
38
38
  - **Wake idle agents.** A host-side loop watches mailboxes (5 s poll, 60 s per-mailbox cooldown) and injects a prompt into idle sessions, so an agent reacts to incoming work without a human relaying the message.
39
39
  - **Multi-host federation.** Pair hosts with a 6-digit code; `team:*` broadcasts fan out to paired peers with anti-loop `via[]` and `origin_id` dedup, and each host keeps master of its own boxes and wake.
40
40
  - **Anchored shared memory.** The fleet ledger lives in [opencode-memory](https://www.npmjs.com/package/@log0u7/opencode-memory) 0.11+: epics and tasks anchored to the code they touch self-stale when the code moves, and `supersedes` (0.12+) keeps one truth per decision instead of stacking duplicates.
41
- - **Spawn headless workers in one call.** `mesh_spawn(task, name)` starts an isolated OpenCode worktree per worker; `mesh_workers`, `mesh_worker_logs`, `mesh_worker_stop` and `mesh_worker_remove` track and reap them. A pool of N workers costs N worktrees, not N mesh nodes. With `name`, `role` and `pools`, the spawn is born a fleet agent (enrolled spawn, 0.23.0) — in the fleet workspace by default (0.25.0), in a project worktree on a `project=` opt-in.
41
+ - **Spawn headless workers in one call.** `mesh_spawn(task, name)` starts a worker in the spawn mode's place (session by default, `project=<dir>` for an existing directory, `worktree: true` for the git isolation); `mesh_workers`, `mesh_worker_logs`, `mesh_worker_stop` and `mesh_worker_remove` track and reap them. A pool of N workers costs N directories, not N mesh nodes. With `name`, `role` and `pools`, the spawn is born a fleet agent (enrolled spawn, 0.23.0).
42
42
  - **Deny by default.** Every endpoint requires a per-peer bearer token except the rate-limited pairing bootstrap; pairing codes and offers expire after 30 minutes; every mail carries an Ed25519 proof, so a leaked offer or code alone cannot install or rotate a live credential.
43
43
  - **File claims between sessions.** `mesh_lock` gives exclusive claims on paths, enforced between sessions on the same machine (not part of the wire protocol), so two agents never edit the same file.
44
44
  - **Deliberately simple wire protocol.** mDNS for discovery, bearer tokens for auth, five HTTP routes (`/mail`, `/status`, `/metrics`, `/pools`, `/pair-code`), plain HTTP over loopback and trusted networks.
@@ -97,7 +97,7 @@ On 2.x hosts the key is `plugins` and each entry is an object:
97
97
 
98
98
  Node identity and mailbox live under `~/.local/share/opencode-mesh/` (honors `XDG_DATA_HOME`), created with restrictive permissions.
99
99
 
100
- Workers spawned with `mesh_spawn` run with `OPENCODE_MESH_CHILD=1`: they skip the mesh server, mDNS and all mesh tools, so a pool of N workers costs N worktrees, not N mesh nodes. Spawned WITH a `name`, a worker is instead an enrolled fleet agent (`OPENCODE_MESH_CHILD=enrolled`): it keeps the mesh tools, self-enrolls from its prompt header at its first turn and joins its pools; `spawnMax` (default 4) caps the running enrolled workers. Since 0.25.0 the enrolled agent is born in the fleet workspace — the `spawnWorkspace` directory (default `~/projets/fleet`, per host), NOT a project worktree: it is a colleague, a session with a mailbox, like any other agent, and a missing workspace directory refuses the spawn with the remedy (`create it or set spawnWorkspace`). For a code task in a repo, `project=<repo path>` opts back into the project worktree machinery. Spawned with `node=<paired peer>` (0.24.0), the enrolled agent is born ON THAT PEER: the request is signed with this node's key (the project id rides along ONLY on a `project=` opt-in — without one the payload is the spec alone and the peer applies ITS OWN default, its workspace) and the peer — after the operator enabled `acceptSpawn` there — runs its own enrolled-spawn path, stamps the worker with the requesting peer (`spawnQuotaPeer`, default 2, per peer) and DMs back `spawned <name> on <hostname> (worker <id>)`. A distant worker lives on the peer's registry: the parent does not manage it remotely (v1) — the agent posts its own `status:` to the pools like any member, and reaping is the peer's job (`mesh_worker_stop` there).
100
+ Workers spawned with `mesh_spawn` run with `OPENCODE_MESH_CHILD=1`: they skip the mesh server, mDNS and all mesh tools, so a pool of N workers costs N directories, not N mesh nodes. Spawned WITH a `name`, a worker is instead an enrolled fleet agent (`OPENCODE_MESH_CHILD=enrolled`): it keeps the mesh tools, self-enrolls from its prompt header at its first turn and joins its pools; `spawnMax` (default 4) caps the running enrolled workers. The spawn mode (0.26.0) decides WHERE the child runs: session (default, the host's natural context — the serve peer's cwd, nothing imposed and nothing created), project (`project=<dir>`, the directory must exist — locally checked, and on a distant spawn the peer answers `spawn refused: project directory <dir> does not exist on peer`; git or not — the core opencode conflates projects and worktrees, the mesh does not inherit that), worktree (`worktree: true` + `project=<dir>`, the 0.24.x git isolation machinery with its discovery refresh and signed projectID retarget — opt-in; `worktree: true` without `project=` is refused). The mode is recorded on the worker row, so `mesh_worker_remove` only ever removes what the mesh created: a session or project spawn keeps its directory. Spawned with `node=<paired peer>` (0.24.0), the enrolled agent is born ON THAT PEER: the request is signed with this node's key (the spawn mode rides in the signed spec) and the peer — after the operator enabled `acceptSpawn` there — runs its own enrolled-spawn path in the requested mode, stamps the worker with the requesting peer (`spawnQuotaPeer`, default 2, per peer) and DMs back `spawned <name> on <hostname> (worker <id>)`. A distant worker lives on the peer's registry: the parent does not manage it remotely (v1) — the agent posts its own `status:` to the pools like any member, and reaping is the peer's job (`mesh_worker_stop` there).
101
101
 
102
102
  Note (npm 12): the package ships no lifecycle install scripts and needs no `allowScripts` / allowlist on install (its runtime dependency `bonjour-service` has none either).
103
103
 
@@ -238,16 +238,19 @@ flowchart TB
238
238
  ```
239
239
 
240
240
  ```
241
- mesh_spawn(task="implement the parser", name="parser", project="/repo/parser") # -> worker_id, worktree, branch (project opt-in)
241
+ mesh_spawn(task="implement the parser", name="parser", worktree=true, project="/repo/parser")
242
+ # -> worktree mode (opt-in): worker_id, worktree, branch
243
+ mesh_spawn(task="work in the api repo", name="coder", project="/home/me/projets/api")
244
+ # -> project mode: the child runs in that directory (git or not)
242
245
  mesh_spawn(task="review the diff", name="reviewer", role="reviewer", pools=["team:x"])
243
- # -> enrolled fleet agent, born in the fleet
244
- # workspace by default (0.25.0, no worktree):
245
- # keeps the mesh tools, self-enrolls at first turn
246
+ # -> session mode (default): the child runs in the host's natural
247
+ # context; enrolled fleet agent: keeps the mesh tools,
248
+ # self-enrolls at first turn
246
249
  mesh_spawn(task="triage the queue", name="triage", pools=["team:x"], node="ricinus-communis")
247
250
  # -> distant spawn (0.24.0): the enrolled agent is
248
- # born on that paired peer — in ITS workspace by
249
- # default (signed request; the peer must run
250
- # acceptSpawn=true); it DMs back
251
+ # born on that paired peer, in the requested mode
252
+ # (signed request; the peer must run acceptSpawn=true);
253
+ # it DMs back
251
254
  # "spawned <name> on <hostname> (worker <id>)"
252
255
  mesh_workers() # lifecycle states, session ids
253
256
  mesh_worker_logs(worker_id="...", tail=50) # captured output
@@ -1 +1 @@
1
- {"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../src/lib/db.ts"],"names":[],"mappings":"AAGA,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAE1D,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,IAAI,IAAI,CAAC;CACf,CAAC;AA8LF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAW/C"}
1
+ {"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../src/lib/db.ts"],"names":[],"mappings":"AAGA,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAE1D,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,IAAI,IAAI,CAAC;CACf,CAAC;AAuMF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAW/C"}
package/dist/lib/db.js CHANGED
@@ -3,7 +3,7 @@ import { dirname } from "node:path";
3
3
  import { openSqlite } from "./sqlite.js";
4
4
  // Bump when a schema change needs a migration step; the version anchors future
5
5
  // migrations that cannot be expressed as idempotent `CREATE ... IF NOT EXISTS`.
6
- const SCHEMA_VERSION = 13;
6
+ const SCHEMA_VERSION = 14;
7
7
  const SCHEMA = `
8
8
  CREATE TABLE IF NOT EXISTS peers (
9
9
  node_id TEXT PRIMARY KEY,
@@ -74,7 +74,8 @@ CREATE TABLE IF NOT EXISTS workers (
74
74
  started_at INTEGER NOT NULL,
75
75
  finished_at INTEGER,
76
76
  mailbox TEXT,
77
- spawned_by TEXT
77
+ spawned_by TEXT,
78
+ spawn_mode TEXT NOT NULL DEFAULT 'worktree'
78
79
  );
79
80
  -- v13: distant-spawn nonces are persisted (0.24.1): a receiver restart no
80
81
  -- longer re-opens the 5 min replay window.
@@ -174,6 +175,14 @@ function migrate(conn) {
174
175
  if (!workerColumns.includes("spawned_by")) {
175
176
  conn.exec("ALTER TABLE workers ADD COLUMN spawned_by TEXT");
176
177
  }
178
+ // v14: workers.spawn_mode (0.25.0) — which of the three spawn modes the
179
+ // child runs in (session: no cwd override, project: an existing directory,
180
+ // worktree: the git isolation). Every 0.24.x row was a worktree spawn, so
181
+ // the default back-fills them correctly; mesh_worker_remove uses it to
182
+ // NEVER touch a directory the mesh did not create.
183
+ if (!workerColumns.includes("spawn_mode")) {
184
+ conn.exec("ALTER TABLE workers ADD COLUMN spawn_mode TEXT NOT NULL DEFAULT 'worktree'");
185
+ }
177
186
  conn.exec(INDEXES_V3);
178
187
  conn.exec("CREATE INDEX IF NOT EXISTS idx_messages_origin ON messages(origin_id);");
179
188
  conn.run(`PRAGMA user_version = ${SCHEMA_VERSION}`);
@@ -1 +1 @@
1
- {"version":3,"file":"db.js","sourceRoot":"","sources":["../../src/lib/db.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAmB,MAAM,aAAa,CAAC;AAO1D,+EAA+E;AAC/E,gFAAgF;AAChF,MAAM,cAAc,GAAG,EAAE,CAAC;AAE1B,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmFd,CAAC;AAEF,MAAM,UAAU,GAAG;;;;CAIlB,CAAC;AAEF,SAAS,OAAO,CAAC,IAAgB;IAC/B,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAA2B,qBAAqB,CAAC,EAAE,YAAY,IAAI,CAAC,CAAC;IAC7F,IAAI,OAAO,IAAI,cAAc,EAAE,CAAC;QAC9B,OAAO;IACT,CAAC;IACD,6EAA6E;IAC7E,0DAA0D;IAC1D,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAClB,6EAA6E;IAC7E,0EAA0E;IAC1E,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAmB,0BAA0B,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAClG,IAAI,CAAC,WAAW,CAAC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IACtC,IAAI,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;IACvC,OAAO,CAAC,IAAI,CAAC,CAAC;IAEd,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;AAC7C,CAAC"}
@@ -8,6 +8,14 @@ export type SpawnSpec = {
8
8
  name: string;
9
9
  role: string;
10
10
  pools: string[];
11
+ /** Spawn mode project (0.25.0): the child runs in this directory on the
12
+ * peer (it must exist there — the peer checks and refuses otherwise). The
13
+ * directory rides INSIDE the signed spec, so a MITM cannot swap it. */
14
+ project?: string;
15
+ /** Spawn mode worktree (0.25.0): the peer runs its worktree machinery (the
16
+ * git isolation, opt-in). Requires project. Absent with no project =
17
+ * session mode, the peer's natural context. */
18
+ worktree?: boolean;
11
19
  };
12
20
  export type SpawnRequestBody = {
13
21
  spec: SpawnSpec;
@@ -23,11 +31,11 @@ export type SpawnRequestBody = {
23
31
  sig: string;
24
32
  /** Standard pairing proof, for the token-bind path (same as /mail). */
25
33
  proof?: string;
26
- /** The parent's opencode project id, signed ONLY on a project opt-in
27
- * (0.25.0; before that 0.24.8 signed it on every request). The peer births
28
- * the child's worktree under THIS project instead of its workspace default.
29
- * A git project id derives from the git remote, so it names the same repo on
30
- * every host that has it cloned. Absent = the workspace colleague default. */
34
+ /** The parent's opencode project id (0.24.8): the peer creates the child's
35
+ * worktree under THIS project instead of its own mesh instance's. A git
36
+ * project id derives from the git remote, so it names the same repo on
37
+ * every host that has it cloned. Absent on pre-0.24.8 parents (legacy
38
+ * signature, the peer keeps its own project). */
31
39
  projectID?: string;
32
40
  };
33
41
  export declare const SPAWN_REQUEST_TTL_MS: number;
@@ -47,7 +55,7 @@ export type SpawnReplayStore = {
47
55
  claim(from: string, nonce: string, now: number): boolean;
48
56
  };
49
57
  export declare function createDbSpawnReplayStore(db: MeshDb): SpawnReplayStore;
50
- export declare function validateSpawnSpec(spec: Pick<SpawnSpec, "name" | "role" | "pools">): string | null;
58
+ export declare function validateSpawnSpec(spec: Pick<SpawnSpec, "name" | "role" | "pools" | "project" | "worktree">): string | null;
51
59
  export declare function spawnCause(error: unknown): string;
52
60
  export type DistantSpawnDeps = {
53
61
  db: MeshDb;
@@ -63,9 +71,6 @@ export type DistantSpawnDeps = {
63
71
  * signed request retarget the create to the parent's project. Absent on
64
72
  * 1.x REST hosts, whose client cannot address another project. */
65
73
  worktreeDomain?: WorktreeDomain;
66
- /** The fleet workspace of THIS host (0.25.0): where a request without a
67
- * projectID births its colleague. Default: ~/projets/fleet. */
68
- spawnWorkspace?: string;
69
74
  };
70
75
  export type DistantSpawnResult = {
71
76
  ok: true;
@@ -1 +1 @@
1
- {"version":3,"file":"distant-spawn.d.ts","sourceRoot":"","sources":["../../src/lib/distant-spawn.ts"],"names":[],"mappings":"AAGA,OAAO,EAA4C,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAC5F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAML,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAsD,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAC9F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAU3C,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,SAAS,CAAC;IAChB,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,EAAE,EAAE,MAAM,CAAC;IACX,i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IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAc7F,wBAAsB,eAAe,CACnC,IAAI,EAAE,gBAAgB,EACtB,IAAI,EAAE,gBAAgB,GACrB,OAAO,CAAC,kBAAkB,CAAC,CAsH7B;AASD,wBAAsB,UAAU,CAC9B,IAAI,EAAE,gBAAgB,EACtB,IAAI,EAAE,gBAAgB,EACtB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,CAAC,CA6BlB"}
@@ -1,8 +1,9 @@
1
1
  import { randomUUID } from "node:crypto";
2
+ import { existsSync } from "node:fs";
2
3
  import { basename } from "node:path";
3
4
  import { pairingProof, signPayload, verifyPayload } from "./identity.js";
4
5
  import { createWorkerWorktree, isProjectNotFoundError, isSourceDirectoryError, removeWorkerWorktree, v2WorktreeDomainClient, } from "./worktree.js";
5
- import { runWorker, resolveSpawnWorkspace, WORKSPACE_BRANCH } from "./spawn.js";
6
+ import { runWorker, removeWorkerLog } from "./spawn.js";
6
7
  import { findPeerById, resolvePeerTarget } from "./peers.js";
7
8
  import { sendMail } from "./client.js";
8
9
  // Anti-replay window: a request older than 5 minutes is refused even with a
@@ -75,12 +76,25 @@ export function parseSpawnRequest(raw) {
75
76
  (typeof body.projectID !== "string" || !/^[A-Za-z0-9._-]{1,128}$/.test(body.projectID))) {
76
77
  return null;
77
78
  }
79
+ // Same for the 0.25.0 spawn-mode fields: a malformed project (it decides
80
+ // WHERE the child runs) kills the request instead of being dropped.
81
+ if (spec.project !== undefined && (typeof spec.project !== "string" || spec.project === "")) {
82
+ return null;
83
+ }
84
+ if (spec.worktree !== undefined && typeof spec.worktree !== "boolean") {
85
+ return null;
86
+ }
78
87
  return {
88
+ // The receiver rebuilds the spec in ITS OWN canonical key order (task,
89
+ // name, role, pools, project, worktree) so the signed payload it verifies
90
+ // byte-matches the parent's JSON.stringify of the same fields.
79
91
  spec: {
80
92
  task: spec.task,
81
93
  name: spec.name,
82
94
  role: spec.role,
83
95
  pools: spec.pools.filter((p) => p.length > 0),
96
+ ...(typeof spec.project === "string" ? { project: spec.project } : {}),
97
+ ...(spec.worktree === true ? { worktree: true } : {}),
84
98
  },
85
99
  from: body.from,
86
100
  ...(typeof body.from_box === "string" && body.from_box.length > 0
@@ -126,10 +140,11 @@ export function createDbSpawnReplayStore(db) {
126
140
  };
127
141
  }
128
142
  // The enrolled-spawn spec is re-validated on the receiver: it feeds the enroll
129
- // header (mesh_register/mesh_join lines) and names a worktree, so it must
130
- // satisfy the same rules the parent's mesh_spawn applies. Both sides run this
131
- // before any worktree work. Control characters are refused outright: the role
132
- // and the pools are interpolated line-by-line into the enroll header.
143
+ // header (mesh_register/mesh_join lines), names the worktree in worktree mode
144
+ // and now (0.25.0) may carry the project directory, so it must satisfy the
145
+ // same rules the parent's mesh_spawn applies. Both sides run this before any
146
+ // worktree work. Control characters are refused outright: the role and the
147
+ // pools are interpolated line-by-line into the enroll header.
133
148
  const hasControlChar = (s) => [...s].some((c) => c.charCodeAt(0) < 0x20 || c.charCodeAt(0) === 0x7f);
134
149
  export function validateSpawnSpec(spec) {
135
150
  if (!/^[A-Za-z0-9._-]{1,64}$/.test(spec.name)) {
@@ -146,6 +161,22 @@ export function validateSpawnSpec(spec) {
146
161
  !spec.pools.every((p) => typeof p === "string" && p.length > 0 && p.length <= 64 && !hasControlChar(p))) {
147
162
  return "spawn refused: invalid pools (max 8, each non-empty, max 64 chars, no control characters)";
148
163
  }
164
+ // Spawn mode fields (0.25.0): the project path feeds a cwd on the receiving
165
+ // host, so it gets the same no-control-characters rule as the role/pools.
166
+ if (spec.worktree !== undefined && spec.worktree !== true) {
167
+ return "spawn refused: invalid worktree flag (true, or omit it)";
168
+ }
169
+ if (spec.project !== undefined) {
170
+ if (typeof spec.project !== "string" ||
171
+ spec.project.length === 0 ||
172
+ spec.project.length > 512 ||
173
+ hasControlChar(spec.project)) {
174
+ return "spawn refused: invalid project (non-empty directory, max 512 chars, no control characters)";
175
+ }
176
+ }
177
+ if (spec.worktree === true && spec.project === undefined) {
178
+ return "spawn refused: worktree requires project (pass project=<directory>)";
179
+ }
149
180
  return null;
150
181
  }
151
182
  // A failure cause that is NEVER empty: an Error with an empty message (a bare
@@ -166,115 +197,131 @@ export function spawnCause(error) {
166
197
  const text = String(error).trim();
167
198
  return text.length > 0 ? text : empty;
168
199
  }
169
- // The peer executes ITS OWN local enrolled-spawn path (runWorker: the enrolled
170
- // child env, the self-enroll header, logs, session capture, exit tracking) in
171
- // the fleet workspace (0.25.0 default) or, on a project opt-in (projectID
172
- // signed), in a worktree named after the mailbox — the 0.23.0/0.24.x machinery
173
- // untouched. The worker row is stamped with the requesting peer so the
174
- // per-peer quota can count it. A worktree failure cleans the worktree like
175
- // mesh_spawn does.
200
+ // The peer executes ITS OWN enrolled-spawn path (the 0.23.0 machinery,
201
+ // runWorker) in the spawn mode the signed spec names (0.25.0):
202
+ // - worktree (explicit opt-in): the 0.24.x machinery unchanged — a worktree
203
+ // named after the mailbox, the 0.24.8 projectID retarget, the 0.24.7
204
+ // discovery refresh retry;
205
+ // - project: the child runs in an existing directory on this peer (git or
206
+ // not), no worktree machinery runs;
207
+ // - session (default): the child runs in this peer's natural context, no cwd
208
+ // override — nothing touches the worktree table or discovery.
209
+ // The worker row is stamped with the requesting peer so the per-peer quota
210
+ // can count it. Failure cleans the worktree like mesh_spawn does (worktree
211
+ // mode) or just the row and log (the other modes never created one).
176
212
  export async function runDistantSpawn(deps, body) {
177
213
  const specError = validateSpawnSpec(body.spec);
178
214
  if (specError !== null) {
179
215
  return { ok: false, error: specError };
180
216
  }
181
217
  const enroll = { name: body.spec.name, role: body.spec.role, pools: body.spec.pools };
182
- // The 0.25.0 default: a request that names no project births a workspace
183
- // COLLEAGUE on this peer — an opencode session in the fleet workspace, no
184
- // project dependency, no worktree machinery, the SourceDirectoryNotFoundError
185
- // dead by construction. The peer resolves its OWN spawnWorkspace.
186
- if (body.projectID === undefined) {
187
- return runWorkspaceSpawn(deps, body, enroll);
218
+ if (body.spec.worktree === true) {
219
+ let directory;
220
+ // Project retarget (0.24.8): a signed request may name the parent's project
221
+ // (a git remote hash, stable across hosts). The peer's own mesh instance
222
+ // can be bound to a project with no usable source — a headless
223
+ // `opencode serve --service` often hosts $HOME (not even a git repo), where
224
+ // NO discovery can ever register a source — so the create must address the
225
+ // project the parent actually spawned from. The 0.24.7 discovery refresh
226
+ // then runs against THAT project and finally registers its source.
227
+ const worktreeClient = body.projectID !== undefined && deps.worktreeDomain !== undefined
228
+ ? v2WorktreeDomainClient(deps.worktreeDomain, body.projectID)
229
+ : deps.worktreeClient;
230
+ try {
231
+ const info = await createWorkerWorktree(worktreeClient, {
232
+ name: enroll.name,
233
+ ...(deps.spawnWorktreeBase !== undefined ? { directory: deps.spawnWorktreeBase } : {}),
234
+ });
235
+ directory = info.directory;
236
+ const worker = runWorker(deps.db, deps.dataDir, {
237
+ task: body.spec.task,
238
+ worktree_path: info.directory,
239
+ branch: info.branch ?? info.name ?? basename(info.directory),
240
+ spawn_mode: "worktree",
241
+ enroll,
242
+ spawnFn: deps.spawnFn,
243
+ spawned_by: body.from,
244
+ });
245
+ if (worker.status === "failed") {
246
+ // The child never ran: clean up exactly like mesh_spawn (worktree, row,
247
+ // log) so the peer is not left with a stranded directory.
248
+ const cleaned = await removeWorkerWorktree(worktreeClient, {
249
+ directory: info.directory,
250
+ }).catch(() => false);
251
+ deps.db.conn.run("DELETE FROM workers WHERE id = ?", [worker.id]);
252
+ if (!cleaned) {
253
+ return {
254
+ ok: false,
255
+ error: `spawn failed: the worker did not start; worktree ${info.directory} may be stranded`,
256
+ };
257
+ }
258
+ return { ok: false, error: "spawn failed: the worker process did not start" };
259
+ }
260
+ return { ok: true, worker };
261
+ }
262
+ catch (error) {
263
+ if (directory !== undefined) {
264
+ await removeWorkerWorktree(worktreeClient, { directory }).catch(() => false);
265
+ }
266
+ if (isProjectNotFoundError(error)) {
267
+ // The retargeted project has no row on this peer: the peer's opencode
268
+ // never resolved it, so no source can be registered either (the project
269
+ // resolution is what inserts both). An explicit refusal with the remedy.
270
+ return {
271
+ ok: false,
272
+ error: "spawn refused: the spawned project is not registered on this peer — open the peer's opencode in that project once, then retry",
273
+ };
274
+ }
275
+ if (isSourceDirectoryError(error)) {
276
+ // No usable source on the peer even after discovery: an explicit
277
+ // refusal the parent can act on, never the bare tagged error (the
278
+ // 0.24.7 live bug). "spawn refused" routes the HTTP answer to 403.
279
+ return {
280
+ ok: false,
281
+ error: "spawn refused: no source directory on peer — open the peer's opencode in its project once (worktree discovery registers the source)",
282
+ };
283
+ }
284
+ return { ok: false, error: `spawn failed: ${spawnCause(error)}` };
285
+ }
188
286
  }
189
- let directory;
190
- // Project retarget (0.24.8): a signed request may name the parent's project
191
- // (a git remote hash, stable across hosts). The peer's own mesh instance
192
- // can be bound to a project with no usable source — a headless
193
- // `opencode serve --service` often hosts $HOME (not even a git repo), where
194
- // NO discovery can ever register a source — so the create must address the
195
- // project the parent actually spawned from. The 0.24.7 discovery refresh
196
- // then runs against THAT project and finally registers its source.
197
- const worktreeClient = body.projectID !== undefined && deps.worktreeDomain !== undefined
198
- ? v2WorktreeDomainClient(deps.worktreeDomain, body.projectID)
199
- : deps.worktreeClient;
200
- try {
201
- const info = await createWorkerWorktree(worktreeClient, {
202
- name: enroll.name,
203
- ...(deps.spawnWorktreeBase !== undefined ? { directory: deps.spawnWorktreeBase } : {}),
204
- });
205
- directory = info.directory;
287
+ // Project mode: the directory must exist ON THE PEER (it is checked here,
288
+ // inside the signed request's execution — the parent cannot know the peer's
289
+ // filesystem). A relative path resolves against the peer's own cwd.
290
+ if (body.spec.project !== undefined) {
291
+ const directory = body.spec.project;
292
+ if (!existsSync(directory)) {
293
+ return {
294
+ ok: false,
295
+ error: `spawn refused: project directory ${directory} does not exist on peer`,
296
+ };
297
+ }
206
298
  const worker = runWorker(deps.db, deps.dataDir, {
207
299
  task: body.spec.task,
208
- worktree_path: info.directory,
209
- branch: info.branch ?? info.name ?? basename(info.directory),
300
+ worktree_path: directory,
301
+ spawn_mode: "project",
210
302
  enroll,
211
303
  spawnFn: deps.spawnFn,
212
304
  spawned_by: body.from,
213
305
  });
214
306
  if (worker.status === "failed") {
215
- // The child never ran: clean up exactly like mesh_spawn (worktree, row,
216
- // log) so the peer is not left with a stranded directory.
217
- const cleaned = await removeWorkerWorktree(worktreeClient, {
218
- directory: info.directory,
219
- }).catch(() => false);
307
+ // No worktree was created: only the row and the log need cleaning.
220
308
  deps.db.conn.run("DELETE FROM workers WHERE id = ?", [worker.id]);
221
- if (!cleaned) {
222
- return {
223
- ok: false,
224
- error: `spawn failed: the worker did not start; worktree ${info.directory} may be stranded`,
225
- };
226
- }
309
+ removeWorkerLog(deps.dataDir, worker.id);
227
310
  return { ok: false, error: "spawn failed: the worker process did not start" };
228
311
  }
229
312
  return { ok: true, worker };
230
313
  }
231
- catch (error) {
232
- if (directory !== undefined) {
233
- await removeWorkerWorktree(worktreeClient, { directory }).catch(() => false);
234
- }
235
- if (isProjectNotFoundError(error)) {
236
- // The retargeted project has no row on this peer: the peer's opencode
237
- // never resolved it, so no source can be registered either (the project
238
- // resolution is what inserts both). An explicit refusal with the remedy.
239
- return {
240
- ok: false,
241
- error: "spawn refused: the spawned project is not registered on this peer — open the peer's opencode in that project once, then retry",
242
- };
243
- }
244
- if (isSourceDirectoryError(error)) {
245
- // No usable source on the peer even after discovery: an explicit
246
- // refusal the parent can act on, never the bare tagged error (the
247
- // 0.24.7 live bug). "spawn refused" routes the HTTP answer to 403.
248
- return {
249
- ok: false,
250
- error: "spawn refused: no source directory on peer — open the peer's opencode in its project once (worktree discovery registers the source)",
251
- };
252
- }
253
- return { ok: false, error: `spawn failed: ${spawnCause(error)}` };
254
- }
255
- }
256
- // The workspace colleague (0.25.0): the peer's own fleet workspace, the same
257
- // enrolled-spawn runWorker otherwise (env, header, logs, session capture,
258
- // exit tracking), stamped with the requesting peer for the per-peer quota.
259
- // No worktree is created, so a failed spawn only deletes the row.
260
- async function runWorkspaceSpawn(deps, body, enroll) {
261
- let workspace;
262
- try {
263
- workspace = resolveSpawnWorkspace(deps.spawnWorkspace);
264
- }
265
- catch (error) {
266
- return { ok: false, error: spawnCause(error) };
267
- }
314
+ // Session mode (default): the child keeps the peer's natural cwd.
268
315
  const worker = runWorker(deps.db, deps.dataDir, {
269
316
  task: body.spec.task,
270
- worktree_path: workspace,
271
- branch: WORKSPACE_BRANCH,
317
+ spawn_mode: "session",
272
318
  enroll,
273
319
  spawnFn: deps.spawnFn,
274
320
  spawned_by: body.from,
275
321
  });
276
322
  if (worker.status === "failed") {
277
323
  deps.db.conn.run("DELETE FROM workers WHERE id = ?", [worker.id]);
324
+ removeWorkerLog(deps.dataDir, worker.id);
278
325
  return { ok: false, error: "spawn failed: the worker process did not start" };
279
326
  }
280
327
  return { ok: true, worker };
@@ -1 +1 @@
1
- {"version":3,"file":"distant-spawn.js","sourceRoot":"","sources":["../../src/lib/distant-spawn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAqB,MAAM,eAAe,CAAC;AAE5F,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,GAGvB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,gBAAgB,EAAgB,MAAM,YAAY,CAAC;AAE9F,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAqCvC,4EAA4E;AAC5E,kEAAkE;AAClE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,GAAG,MA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