@sjawhar/opencode-legion-envoy 1.53.2 → 1.53.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/opencode-legion-envoy",
3
- "version": "1.53.2",
3
+ "version": "1.53.3",
4
4
  "type": "module",
5
5
  "main": "dist/src/server.js",
6
6
  "exports": {
@@ -21,7 +21,7 @@ separate coordinator to finish necessary work.
21
21
  instead of starting a fresh one. Phases on one issue are strictly sequential -- one role
22
22
  is the issue's active phase at a time, and calling `spawn_worker` for a different role
23
23
  while a phase is active supersedes that phase: the superseded worker's
24
- `legion handoff complete` is then refused, so finish (or deliberately abandon) one role
24
+ `handoff_complete` is then refused, so finish (or deliberately abandon) one role
25
25
  before assigning the next. Phase workers escalate lifecycle, scope, and
26
26
  cross-phase matters the same way: `envoy_publish` to your own encoded token. Any role
27
27
  may use `dispatch_ask` directly for a standalone human question; replies return to the
@@ -108,8 +108,8 @@ dispatch_message({
108
108
 
109
109
  The Dispatch message and the `docs/solutions/` commit are the only retro outputs. Never write a
110
110
  handoff, phase artifact, local feedback log, or completion label; `.legion/` was deleted before
111
- retro and nothing recreates it. Report completion with `legion handoff complete` alone (its
112
- summary: two sentences for the architect) — no `legion handoff write`.
111
+ retro and nothing recreates it. Report completion with the `legion` tool's `handoff_complete` alone (its
112
+ summary: two sentences for the architect) — no `handoff_write`.
113
113
 
114
114
  ## Completion check
115
115
 
@@ -105,7 +105,7 @@ Read only files that precede the assigned phase. Every handoff is validated when
105
105
  `validatePhaseHandoff` (`packages/contracts/src/handoff-schema.ts`) checks the file, and the
106
106
  ledger (`packages/daemon/src/handoff/ledger.ts`) treats a file that fails validation as missing.
107
107
  Undeclared fields pass validation untouched and reach the next worker; a declared field of the
108
- wrong type fails the whole file, so `legion handoff read` returns null for that phase.
108
+ wrong type fails the whole file, so the `legion` tool's `handoff_read` returns null for that phase.
109
109
  Write the phase-specific fields the next phase and the architect need, consistent with what
110
110
  predecessor phases already wrote. The durable copy lives in
111
111
  `$LEGION_WORKSPACE/.legion/<phase>.json`. If a committed handoff conflicts with memory or a prior
@@ -190,8 +190,9 @@ comments live on that path too, so edit them with `gh pr comment`) — printing
190
190
  Legion never reads or writes a GitHub issue (LEGION-78). `pr comment`, `pr review`,
191
191
  `api …/pulls/…`, `api graphql`, and issue reads are unaffected. The credential reaches `legion`
192
192
  through the file `$LEGION_GRANT_FILE` names, written before each of your bash commands by the
193
- extension; never `cat`, `echo`, copy, or `export` it — `legion credential`, `legion gh`,
194
- `jj git push`, and `legion handoff complete` read it themselves. The file is the pane's, not the
193
+ extension (and by the `legion` tool before its `handoff_complete`); never `cat`, `echo`, copy, or
194
+ `export` it — `legion credential`, `legion gh`, `jj git push`, and `handoff_complete` read it
195
+ themselves. The file is the pane's, not the
195
196
  command's: a `task` subagent, an `eval` subprocess, or a background job in your pane reads the
196
197
  grant your last bash command minted, so its `legion gh` or `jj git push` succeeds only within 60
197
198
  seconds of that call and 403s afterwards — a timing artifact, not a broken credential; run
@@ -343,7 +344,7 @@ this proof.
343
344
  hides an error, or breaks a gate lands in this PR.
344
345
  - **The implementer proves the change before its phase completes, and writes the `E2E (implementer)` line when the pull request opens.**
345
346
  The proof is the one defined above. It goes into `.legion/implement.json` as the required `proof`
346
- array (`legion handoff write --phase implement` refuses a payload without one, or with a blank or
347
+ array (`handoff_write` for phase `implement` refuses a payload without one, or with a blank or
347
348
  whitespace-only field, and names the field), and into the PR body, because the reviewer and the
348
349
  merger verify facts on GitHub and never from a handoff.
349
350
  - **The tester verifies the implementer's proof and adds its own `E2E (tester)` line.** It re-runs
@@ -352,10 +353,10 @@ this proof.
352
353
  A test handoff whose predecessor carried no proof is a test failure, not a gap for the tester to fill:
353
354
  record it in `failures` with `implementerProof.verdict: "rejected"`, complete the phase, and let
354
355
  the architect return the issue to the implementer — the agent that developed the change owns
355
- proving it (`legion handoff write --phase test` refuses a rejected verdict, or `failed > 0`,
356
+ proving it (`handoff_write` for phase `test` refuses a rejected verdict, or `failed > 0`,
356
357
  with no recorded failure). Otherwise, add your own proof before completing — a proof as defined
357
- above — as the `E2E (tester)` line and the `proof` array `legion handoff write --phase test`
358
- requires whenever you report no failure. A code path whose first execution is after merge — a
358
+ above — as the `E2E (tester)` line and the `proof` array `handoff_write` for
359
+ phase `test` requires whenever you report no failure. A code path whose first execution is after merge — a
359
360
  deploy workflow's inline step, a post-merge helper, a production-only resource — is untested
360
361
  until the implementer has executed it against a devN stack; if no surface can reach it, the
361
362
  tester names that missing surface as the blocker instead of passing the phase. Environment or
@@ -502,14 +503,11 @@ above.
502
503
 
503
504
  ## Completion gate: handoff write, verification, and persistence
504
505
 
505
- Write the phase-specific handoff:
506
+ Write the phase-specific handoff: call the `legion` tool with `op: "handoff_write"`, `phase: "<p>"`,
507
+ and `data`: a JSON object of the phase-specific fields only. It runs `legion handoff write` in
508
+ `$LEGION_WORKSPACE` and returns its output.
506
509
 
507
- ```bash
508
- cd -- "$LEGION_WORKSPACE" && \
509
- legion handoff write --phase <p> --data '<JSON object of phase-specific fields only>'
510
- ```
511
-
512
- `legion handoff write` validates the payload against the phase's schema before writing: an
510
+ `handoff_write` validates the payload against the phase's schema before writing: an
513
511
  implement handoff without a well-formed `proof`, or a test handoff that reports no failure and
514
512
  carries no `proof` of its own, exits 1 naming the field and writes nothing.
515
513
 
@@ -554,17 +552,15 @@ that deletion at the reviewer's direction. No other phase removes it — and onc
554
552
  (`jj -R "$LEGION_WORKSPACE" file list -r @- .legion` prints nothing on stdout; jj warns on
555
553
  stderr), this gate no longer applies: a later rebase, bare-gate re-check, confirmation, retro, or
556
554
  the post-merge production check writes no `.legion/<phase>.json`, commits no handoff, and reports
557
- with `legion handoff complete` alone (below). Recreating `.legion/` after its deletion changes the
555
+ with `handoff_complete` alone (below). Recreating `.legion/` after its deletion changes the
558
556
  approved head and restarts the review loop this rule exists to end.
559
557
 
560
558
  ## Completion: report to the architect, then stay
561
559
 
562
- Report completion to the architect with:
563
-
564
- ```bash
565
- cd -- "$LEGION_WORKSPACE" && \
566
- legion handoff complete --summary '<two sentences for the architect>'
567
- ```
560
+ 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.
568
564
 
569
565
  This publishes your phase's completion to the architect's role and clears the daemon's
570
566
  record of this issue's active phase. Do not add pipeline labels, run a controller loop, or