@sjawhar/opencode-legion-envoy 3.11.0 → 3.11.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/opencode-legion-envoy",
3
- "version": "3.11.0",
3
+ "version": "3.11.1",
4
4
  "type": "module",
5
5
  "main": "dist/src/server.js",
6
6
  "exports": {
@@ -312,6 +312,12 @@ and is not re-staffed. A todo with a finished spec reads as queued work that nob
312
312
  (LEGION-173 sat in todo for two weeks with a complete spec; AGENTC-1010's v4 plan sat in backlog
313
313
  with nobody building it).
314
314
 
315
+ A close that says the defect cannot happen cites the code that makes it impossible. An issue
316
+ closed because a rewrite forecloses it names the file and line in the rewrite that does so; a
317
+ close that cannot name one is not foreclosed, it is unread. The cheapest way for a rewrite to reach
318
+ parity is to port the code, defect included: LEGION-211's bare `git worktree prune`, filed against
319
+ the TypeScript daemon, had been ported into the Go coordinator and was live in production.
320
+
315
321
  The audit finds four shapes:
316
322
 
317
323
  - **Unstaffed work.** A plan or measurement exists, and no one is building it.
@@ -9,6 +9,9 @@ Retro is mandatory for every issue that passed review. The architect revives the
9
9
  implementer so the person with implementation context performs the retrospective, and the
10
10
  skill obtains a separate fresh-eyes perspective. Retro runs before merge.
11
11
 
12
+ Every path this skill cites (`packages/...`, `docs/...`) is in sjawhar/legion, the Legion
13
+ repository, which need not be the repository you are working in.
14
+
12
15
  ## Merge-gate ordering
13
16
 
14
17
  Follow this ordering exactly. It keeps the reviewed branch clean while preserving the
@@ -11,6 +11,9 @@ phase gets its own long-lived process against the same jj workspace, run in turn
11
11
  the phase assigned to you, report its completion to the architect, and leave the durable
12
12
  copy the next phase can trust.
13
13
 
14
+ Every path this skill cites (`packages/...`, `docs/...`, `AGENTS.md`) is in sjawhar/legion, the
15
+ Legion repository, which need not be the repository you are working in.
16
+
14
17
  ## Identity, scope, and role
15
18
 
16
19
  The daemon spawns you as a separate `omp --mode rpc` process (behind `legion worker-shim`,
@@ -102,8 +105,9 @@ committed predecessor handoffs in lifecycle order from `$LEGION_WORKSPACE/.legio
102
105
  5. `review.json`
103
106
 
104
107
  Read only files that precede the assigned phase. Every handoff is validated when it is read:
105
- `validatePhaseHandoff` (`packages/contracts/src/handoff-schema.ts`) checks the file, and the
106
- ledger (`packages/daemon/src/handoff/ledger.ts`) treats a file that fails validation as missing.
108
+ `validatePhaseHandoff` (`packages/contracts/src/handoff-schema.ts`) checks the
109
+ file, and the ledger (`packages/daemon/src/handoff/ledger.ts`) treats a file that
110
+ fails validation as missing.
107
111
  Undeclared fields pass validation untouched and reach the next worker; a declared field of the
108
112
  wrong type fails the whole file, so the `legion` tool's `handoff_read` returns null for that phase.
109
113
  Write the phase-specific fields the next phase and the architect need, consistent with what
@@ -161,14 +165,19 @@ assignment, since `jj split`/`jj describe` keep its author). Never set or overri
161
165
  `user.name`/`user.email` in any jj or Git scope — not `jj config set`, not `--config`, not
162
166
  `git config`: `--config` outranks the pane environment and would put the wrong App back on your
163
167
  commits, and the repository-scoped jj config is one file shared by every issue workspace of the
164
- clone. Before a push, check
168
+ clone. Legion has two GitHub Apps, not one per role: your role's App is the **implement** App
169
+ if you are the implementer or the merger, and the **review** App if you are the planner, tester,
170
+ reviewer, or an architect (in Legion's own deployment, `legion-implementer[bot]` and
171
+ `legion-reviewer[bot]`). A planner's commits authored by the review App are right. Before a push,
172
+ check
165
173
  `jj -R "$LEGION_WORKSPACE" log -r 'main@origin..@' -T 'author.email() ++ " | " ++ committer.email() ++ " " ++ description.first_line() ++ "\n"'`
166
174
  shows your role's App in both columns **on every commit you made** — not on the whole list:
167
175
  earlier phases' commits are legitimately authored by their own role's App, and a conflict-forced
168
176
  rebase legitimately sets the committer of every rebased commit, other roles' included, to the
169
- rebaser. A wrong identity on your own commit is a pane-environment problem to report to the
170
- architect, not something to pin (`docs/solutions/legion/shared-main-repo-hazards-for-concurrent-issue-workspaces.md`,
171
- Hazard 1). Your session receives the credential capability it needs; invoke GitHub through the
177
+ rebaser. A wrong identity on your own commit, the other App or none, is a pane-environment
178
+ problem to report to the architect, not something to pin
179
+ (`docs/solutions/legion/shared-main-repo-hazards-for-concurrent-issue-workspaces.md`, Hazard 1).
180
+ Your session receives the credential capability it needs; invoke GitHub through the
172
181
  credential helper:
173
182
 
174
183
  ```bash
@@ -225,8 +234,8 @@ legion gh -- pr comment <pr-number> \
225
234
 
226
235
  The plan lives in `.legion/plan.json` and the Dispatch issue document; never commit a plan or spec file to the repository.
227
236
  No `docs/plans/*`, `docs/superpowers/plans/*`, or spec markdown goes into the pull request: plan
228
- and spec content goes into the issue, never into a PR (the root `AGENTS.md`'s `docs/plans/` row
229
- is human-authored design history, not a Legion artifact). A skill step that says "save the plan
237
+ and spec content goes into the issue, never into a PR (the root `AGENTS.md`
238
+ calls its own `docs/plans/` human-authored design history, not a Legion artifact). A skill step that says "save the plan
230
239
  to a file" is satisfied by the handoff write in the completion gate below; the planner's only
231
240
  commit is `plan: record handoff`.
232
241
 
@@ -652,9 +661,16 @@ This publishes your phase's completion to the architect's role and clears the da
652
661
  record of this issue's active phase. Do not add pipeline labels, run a controller loop, or
653
662
  invent a different completion protocol — this is the whole contract.
654
663
 
655
- A reviewer's phase ends with its completion, not with its review: submit the review on GitHub
656
- first, then commit the handoff and complete. The daemon moves the issue once both are in — the
657
- decision GitHub reports and your completion, in either order — so a review posted without a
664
+ A reviewer's phase ends with its completion, not with its review. A round that writes a handoff
665
+ takes this order: write, commit and push the handoff; submit the review of the head that push
666
+ made, by its SHA; then complete. An approval waits for the CI verdict to settle green at that head
667
+ before you submit it, since an approval stands only on green checks and GitHub can dismiss one
668
+ once the head moves, and a verdict that settles red there makes the round's decision a request for
669
+ changes naming the failing checks; a request for changes does not wait, since it stands whatever CI says and the
670
+ issue leaves reviewing with it. A review of a head the handoff push then replaces names a head
671
+ the pull request no longer has. A round that writes none (the final approval of the `.legion/`
672
+ deletion head) reviews the head as it is. The daemon moves the issue once both are in —
673
+ the decision GitHub reports and your completion, in either order — so a review posted without a
658
674
  completion leaves the issue in reviewing until you finish.
659
675
 
660
676
  **A refused completion is information, not a retry loop.** The daemon attributes your report to