@sjawhar/opencode-legion-envoy 1.54.0 → 1.55.1

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.
@@ -14404,12 +14404,6 @@ var phaseHandoffSchema = exports_external.discriminatedUnion("phase", [
14404
14404
  testSchema,
14405
14405
  reviewSchema
14406
14406
  ]);
14407
- var handoffMessageSchema = exports_external.object({
14408
- from: handoffPhase,
14409
- to: handoffPhase,
14410
- body: exports_external.string(),
14411
- timestamp: isoTimestamp
14412
- });
14413
14407
  // ../contracts/src/subject.ts
14414
14408
  var AGENT_TOPIC_PREFIX = "notifications.agent.";
14415
14409
  var DISPATCH_TOPIC_PREFIX = "notifications.dispatch.";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/opencode-legion-envoy",
3
- "version": "1.54.0",
3
+ "version": "1.55.1",
4
4
  "type": "module",
5
5
  "main": "dist/src/server.js",
6
6
  "exports": {
@@ -59,23 +59,26 @@ command run `/legion-claim-controller` again.
59
59
  This handshake lets the daemon redeliver held controller work. It does not turn the controller
60
60
  into a state holder: daemon state and the Dispatch project remain authoritative.
61
61
 
62
- ### Started by the operator (runtime: kubernetes)
63
-
64
- When the daemon runs inside a Kubernetes cluster it cannot open a terminal anywhere, so nobody
65
- launched your pane: the operator ran `legion controller start --config controller.yaml
66
- [--daemon-url <port-forward>]` on their own machine, and you are that foreground OMP session.
67
- The command fetched a fresh controller secret from the daemon with the operator's token, wrote it
68
- to a 0600 file under `LEGION_STATE_DIR` (`~/.local/state/legion/<project>-controller` by default)
69
- beside the `gh` shim and the `legion` launcher, and started you with `LEGION_CONTROLLER=1` and
70
- the same environment a tmux controller pane carries — so the extension claims the role and calls
71
- `/controller/ready` exactly as under tmux, and nothing changes in how you handle wakes. The
72
- daemon records you as `controllerLocator: {runtime: "kubernetes", external: true, sessionId,
73
- registeredAt}` and reads your liveness from the Envoy role registry (the holder of
62
+ ### Started by the operator
63
+
64
+ When the daemon cannot open a terminal for you — the TypeScript daemon under `runtime: kubernetes`,
65
+ and the Go daemon under either runtime, since it launches no controller — nobody launched your
66
+ pane: the operator ran `legion controller start --config controller.yaml [--daemon-url <url>]` on
67
+ their own machine, and you are that foreground OMP session. The command fetched a fresh controller
68
+ secret from the daemon with the operator's token, wrote it to a 0600 file under `LEGION_STATE_DIR`
69
+ (`~/.local/state/legion/<project>-controller` by default) beside the `gh` shim and the `legion`
70
+ launcher, and started you with `LEGION_CONTROLLER=1` and the same environment a tmux controller pane
71
+ carries, so nothing changes in how you handle wakes. Under the TypeScript daemon the extension
72
+ claims the role and calls `/controller/ready` exactly as under tmux; under the Go daemon
73
+ (`LEGION_DAEMON_API=go` in your environment) it registers on `/legion/v1/claims/register` with the
74
+ secret, then claims the role. The daemon records you as `controllerLocator: {runtime, external:
75
+ true, sessionId, registeredAt}`, `runtime` being the daemon's own (`kubernetes`, or `tmux` under the
76
+ Go daemon). The TypeScript daemon reads your liveness from the Envoy role registry (the holder of
74
77
  `legion-<project>-controller` and its `last_seen`), not from a pane: keep the session running.
75
78
  Exiting it leaves the project without a controller until the operator runs the command again —
76
- the daemon logs `controller not registered; run legion controller start` once per boot-timeout
77
- interval and launches nothing itself. `legion state` and `legion status <KEY> <status>` work here
78
- over `LEGION_DAEMON_URL` (the port-forward). A second `legion controller start` replaces you: it
79
+ the TypeScript daemon logs `controller not registered; run legion controller start` once per
80
+ boot-timeout interval and launches nothing itself. `legion state` and `legion status <KEY>
81
+ <status>` work here over `LEGION_DAEMON_URL`. A second `legion controller start` replaces you: it
79
82
  mints a new secret, so your grants stop working and the role moves to the new session.
80
83
 
81
84
  ## Deployment instructions
@@ -507,6 +507,14 @@ Write the phase-specific handoff: call the `legion` tool with `op: "handoff_writ
507
507
  and `data`: a JSON object of the phase-specific fields only. It runs `legion handoff write` in
508
508
  `$LEGION_WORKSPACE` and returns its output.
509
509
 
510
+ A handoff built from the one already on disk (a test handoff that accumulates review rounds can
511
+ pass 128 KiB) can instead be piped from bash, so you never re-emit the whole payload:
512
+ `cd -- "$LEGION_WORKSPACE" && bun -e 'const h = await Bun.file(".legion/<phase>.json").json(); delete h.schemaVersion; delete h.phase; delete h.completed; <your edit to h>; console.log(JSON.stringify(h))' | legion handoff write --phase <phase>`.
513
+ The program is single-quoted, so strings in your edit take double quotes. It is `bun` because the
514
+ worker image a pod runs ships `bun` and not `jq`, and a devbox pane has the `bun` Legion builds
515
+ with. With `--data` omitted, `legion handoff write` reads the JSON object from stdin. The CLI adds
516
+ `schemaVersion`, `phase` and `completed` itself and refuses them in the data, hence the `delete`s.
517
+
510
518
  `handoff_write` validates the payload against the phase's schema before writing: an
511
519
  implement handoff without a well-formed `proof`, or a test handoff that reports no failure and
512
520
  carries no `proof` of its own, exits 1 naming the field and writes nothing.
@@ -558,9 +566,9 @@ approved head and restarts the review loop this rule exists to end.
558
566
  ## Completion: report to the architect, then stay
559
567
 
560
568
  Report completion to the architect: call the `legion` tool with `op: "handoff_complete"` and
561
- `summary`: two sentences for the architect. A worker never runs `legion handoff` from bash: the
562
- tool call is what the extension records, and a turn that ends with the phase still open gets one
563
- reminder.
569
+ `summary`: two sentences for the architect. A worker never runs `legion handoff complete` from
570
+ bash, where the extension refuses it: the tool call is what the extension records, and a turn that
571
+ ends with the phase still open gets one reminder.
564
572
 
565
573
  This publishes your phase's completion to the architect's role and clears the daemon's
566
574
  record of this issue's active phase. Do not add pipeline labels, run a controller loop, or