@sjawhar/claude-envoy 1.3.0 → 1.4.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/.claude-plugin/plugin.json +1 -1
- package/.omp-plugin/plugin.json +1 -1
- package/dist/dispatch.js +750 -4
- package/dist/envoy-channel.js +751 -5
- package/dist/session-hook.js +750 -4
- package/legion/skills/legion-architect/references/acceptance.md +3 -2
- package/legion/skills/legion-controller/references/parked-decisions.md +4 -5
- package/legion/skills/legion-retro/SKILL.md +4 -3
- package/legion/skills/legion-worker/SKILL.md +1 -2
- package/legion/skills/legion-worker/references/conflicts-and-rewrites.md +4 -11
- package/legion/skills/legion-worker/references/merge-gate.md +7 -6
- package/package.json +1 -1
- package/skills/dispatch/SKILL.md +1 -1
|
@@ -102,7 +102,8 @@ The daemon keeps this order from its fixed table; you start none of its steps:
|
|
|
102
102
|
4. The merger quotes what sits above the approved head
|
|
103
103
|
(`jj diff --from <approved-sha> --to <tip-sha> --summary`) in READY and sends the READY packet
|
|
104
104
|
with its completion. The daemon refuses a head carrying anything above the approved head but a
|
|
105
|
-
commit that changes only `docs/solutions/` and
|
|
105
|
+
commit that changes only `docs/solutions/` and a change whose every path is under `.legion/`,
|
|
106
|
+
which nothing writes or reads now, so nobody reviews one
|
|
106
107
|
(`READY_UNREVIEWED_CHANGE`). It
|
|
107
108
|
posts `READY #<n> at <current sha> (approved at <approved sha>) for <KEY> (<pr url>)` on the
|
|
108
109
|
Dispatch issue, publishes it to the project's merge queue role when one is set, and submits the
|
|
@@ -127,7 +128,7 @@ from `accepting` you send an issue back only to `implementing` or `testing`.
|
|
|
127
128
|
## A conflicting head
|
|
128
129
|
|
|
129
130
|
What returns the tree to review is a changed diff: a commit above the approved head that touches
|
|
130
|
-
anything outside `docs/solutions/`, other than
|
|
131
|
+
anything outside `docs/solutions/`, other than a change whose every path is under `.legion/`, or
|
|
131
132
|
a conflict-resolution merge whose fingerprint (the unchanged-diff check,
|
|
132
133
|
`skill://legion-worker/references/conflicts-and-rewrites.md`) differs from the approved head's.
|
|
133
134
|
A merge forced by a GitHub-reported conflict whose fingerprint is unchanged does
|
|
@@ -125,11 +125,10 @@ an approval of a document that is not the root's primary one.
|
|
|
125
125
|
- It only questions the work: a question, a doubt about the premise, a request for changes that
|
|
126
126
|
only asks why. Leave it parked and answer the question in one reply:
|
|
127
127
|
- Answer from the record when it holds the answer: the issue and its spec (`dispatch read`,
|
|
128
|
-
`dispatch doc-read`), its handoffs (
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
<root> to todo to run it.`
|
|
128
|
+
`dispatch doc-read`), its handoffs (`dispatch handoff-read --issue <KEY> --phase <word>`)
|
|
129
|
+
and its pull request. Write `Parked decision read: <ref> by <login> asks <the question in
|
|
130
|
+
a few words>.`, then the answer and where in the record it is, then `The tree stays parked.
|
|
131
|
+
Set <root> to todo to run it.`
|
|
133
132
|
- When the record does not answer it, write `Parked decision read: <ref> by <login> asks
|
|
134
133
|
<the question in a few words>. The record does not answer it, and <root> is parked, so
|
|
135
134
|
its architect cannot answer either. Set <root> to todo to bring its architect back to
|
|
@@ -22,9 +22,10 @@ The head the merger names is the head the reviewer approved.
|
|
|
22
22
|
- **A change after the approved head** (`READY_UNREVIEWED_CHANGE`): the
|
|
23
23
|
daemon diffs the reviewer's approved head against the head on GitHub, and the issue goes back to
|
|
24
24
|
the reviewer for another review. READY still lets through a commit that changes only
|
|
25
|
-
`docs/solutions/`, which no role writes any more, and a
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
`docs/solutions/`, which no role writes any more, and a change whose every path is under
|
|
26
|
+
`.legion/`, where handoffs lived before they moved to the Dispatch issue and which nothing
|
|
27
|
+
writes or reads now, so nobody reviews a path there. Since retro commits nothing, an ordinary
|
|
28
|
+
head carries neither.
|
|
28
29
|
- `READY_UNREVIEWED_CHANGE` has more causes than a path outside retro's own. Every one of them
|
|
29
30
|
sends the head back to review and none is an error to retry; the complete list, with each
|
|
30
31
|
remedy, is the merger's own role prompt part.
|
|
@@ -38,7 +38,7 @@ Read each by its `skill://` link: a read by path stops at 300 lines.
|
|
|
38
38
|
| You write or edit the PR body, record a result against a check, read another phase's results, or run the simplify pass | `skill://legion-worker/references/pr-body.md` |
|
|
39
39
|
| Before a push, to check your commits' App identity | `skill://legion-worker/references/default-branch-check.md` |
|
|
40
40
|
| You reply on, list or resolve review threads, or judge a bot's finding | `skill://legion-worker/references/review-threads.md` |
|
|
41
|
-
| A conflict, a need only the base meets, a retarget, a parent's last round, comparing heads after a forward merge,
|
|
41
|
+
| A conflict, a need only the base meets, a retarget, a parent's last round, comparing heads after a forward merge, or rewriting a pushed commit | `skill://legion-worker/references/conflicts-and-rewrites.md` |
|
|
42
42
|
| You review or approve, build READY, or run the production check | `skill://legion-worker/references/merge-gate.md` |
|
|
43
43
|
| The issue renames a repository, package, or URL across the codebase | `skill://legion-worker/references/systematic-rename.md` |
|
|
44
44
|
| The issue deletes code, a command, or documentation | `skill://legion-worker/references/cleanup-deletion.md` |
|
|
@@ -51,7 +51,6 @@ Read each by its `skill://` link: a read by path stops at 300 lines.
|
|
|
51
51
|
- Before a push, read `jj -R "$LEGION_WORKSPACE" log -r 'ancestors(@, 5)'` (earlier phases' commits in it are expected) and run the identity check (`skill://legion-worker/references/default-branch-check.md`). Add no attribution trailer: the pane's jj adds `Omp-Session:`.
|
|
52
52
|
- Only work is pushed: code, red tests, a forward merge, a rewrite, and the empty commit that carries the pull request onto the commit you pushed (the bullet below). No commit message carries a line or bracket keyword that stops GitHub's workflows (`[skip ci]` and its kin), since every head needs its own checks and a base that requires a check will not merge a head whose checks never ran. Retro pushes nothing: it records what the work taught with `dispatch comment` on the issue.
|
|
53
53
|
- **After a push, read the pull request's head and check that it is your commit.** A branch and a pull request are two objects on GitHub: the push moves the branch, and GitHub then moves the pull request onto the new commit, which is what starts its checks. Twice on 2026-11-05 it did not, and the newer commit got no checks while Legion read, tested and would have merged the older one. The step applies once the branch has an open pull request, whose number your task's `Pull request:` line names (`gh pr list --repo <the issue's repository> --head legion/<KEY> --state open --json number --jq '.[0].number'` when it names none): run `gh pr view <n> --repo <the issue's repository> --json headRefOid --jq .headRefOid` about ten seconds after your push, again about ten seconds later, and a last time about thirty seconds after that, with a read that gives the pushed commit ending the step there and only the last read deciding a mismatch, and compare each answer with the commit you pushed, which `jj -R "$LEGION_WORKSPACE" log -r legion/<KEY>@origin --no-graph -T commit_id` prints in the 40 characters `headRefOid` answers in. This read is of the pull request's own head and of no check, so the wait it makes is not a wait on CI (`skill://legion-worker/references/pr-body.md#never-waiting-on-ci`). When the last read still is not your commit, carry the pull request with a commit of its own, an empty one when your work is complete and an empty one just as much when `@` holds work of yours, since a push of a commit the branch already holds moves no ref; the push section of your role prompt gives the one `jj` recipe, which leaves `@` and everything in it where it is. A new head makes every result recorded at the old head older, so record each `before_merge` check again at the new head. When that second push does not carry the pull request either, tell your architect the commit you pushed, the head each read gave and the time of each, and end the turn with a WAITING line naming that answer rather than completing: a phase completed here hands the next role a commit the pull request does not name. The push you make to answer an update task is the exception: that task has you answer the daemon and end the turn at once, so make this read in your next turn, before your phase completes. The merger pushes nothing, so this step never falls to it; it reports a mismatch it sees to the architect.
|
|
54
|
-
- A push refused because `legion handoffs import` moved `legion/<KEY>@origin` (its commit's message is `chore(legion): <KEY>'s handoffs are on its Dispatch issue now`) is cured by `jj -R "$LEGION_WORKSPACE" git fetch`, a forward merge with `legion/<KEY>@origin`, and the push (`skill://legion-worker/references/conflicts-and-rewrites.md`, *After the handoff import moved the branch*): never a rewrite.
|
|
55
54
|
- A planner whose issue moved back from implementing starts on the remote tip, `jj -R "$LEGION_WORKSPACE" new legion/<KEY>@origin`, so a commit it makes never sits on the implementer's unpushed commits.
|
|
56
55
|
|
|
57
56
|
## PR body, review, and the merge gate
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Part of `skill://legion-worker`. Read it when GitHub reports the pull request `CONFLICTING`, the
|
|
4
4
|
controller asks you to resolve a conflict, the change needs something only the base has, the pull
|
|
5
|
-
request is retargeted to a new base, you compare two heads after such a merge,
|
|
6
|
-
|
|
7
|
-
pushed.
|
|
5
|
+
request is retargeted to a new base, you compare two heads after such a merge, or you are about to
|
|
6
|
+
rewrite a commit you already pushed.
|
|
8
7
|
Every path it cites is in cybermonklabs/legion.
|
|
9
8
|
|
|
10
9
|
## Reintegrating the base
|
|
@@ -65,13 +64,6 @@ Every path it cites is in cybermonklabs/legion.
|
|
|
65
64
|
pushes its own commits* in `skill://legion-worker`; a merge is a code push like any other): the
|
|
66
65
|
merge descends from both the bookmark's old position and the destination, so it is a genuine
|
|
67
66
|
fast-forward and *Rewriting pushed commits* never applies.
|
|
68
|
-
- **After the handoff import moved the branch.** `legion handoffs import` moves `legion/<KEY>`
|
|
69
|
-
once, with a commit whose message is `chore(legion): <KEY>'s handoffs are on its Dispatch issue
|
|
70
|
-
now`, which removes the `.legion/` directory where handoffs lived before they moved to Dispatch.
|
|
71
|
-
A push it refuses as a moved branch is cured forward: `jj -R "$LEGION_WORKSPACE" git fetch`,
|
|
72
|
-
then `jj -R "$LEGION_WORKSPACE" new @- legion/<KEY>@origin -m "merge: legion/<KEY>@origin after
|
|
73
|
-
the handoff import"` (from `@-`, your own described tip, since your local bookmark may now
|
|
74
|
-
disagree with the remote one), `jj -R "$LEGION_WORKSPACE" new`, and the push — never a rewrite.
|
|
75
67
|
- **After a retarget.** Retargeting a pull request to a new base does not re-run Tests. Read
|
|
76
68
|
`base` again and merge the bookmark onto it in one command
|
|
77
69
|
(`base=$(gh pr view <n> -R <owner>/<repo> --json baseRefName -q '.baseRefName | @json') && jj -R "$LEGION_WORKSPACE" new legion/<KEY> "${base}@origin" -m "<message>"`) and push it the
|
|
@@ -105,7 +97,8 @@ fingerprint=$(set -o pipefail; jj -R "$LEGION_WORKSPACE" diff --from "fork_point
|
|
|
105
97
|
on a merge) and `index` lines (blob ids move when the base's copy of a file changed). What
|
|
106
98
|
is left is exactly the added and removed lines per file.
|
|
107
99
|
- The single fileset `'~(.legion | docs/solutions)'` leaves out `.legion/`, where handoffs lived
|
|
108
|
-
before they moved to Dispatch
|
|
100
|
+
before they moved to Dispatch and which nothing writes or reads now, so nobody reviews a path
|
|
101
|
+
there, and retro's learnings:
|
|
109
102
|
paths the merge gate lets through above an approval
|
|
110
103
|
(`skill://legion-worker/references/merge-gate.md`), which change
|
|
111
104
|
between one role's verified head and the next without changing the product. This is what lets
|
|
@@ -9,9 +9,10 @@ architect's acceptance, in `accepting` → retro → the merger's READY → the
|
|
|
9
9
|
issue → the implementer's production check, after the close. Every handoff is a record on the
|
|
10
10
|
Dispatch issue, never a commit, so the head that merges carries none. Retro commits nothing
|
|
11
11
|
(*Retro*, below), so the approved head is the head that merges. READY still lets a commit that
|
|
12
|
-
changes only `docs/solutions/` stand, and a
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
changes only `docs/solutions/` stand, and a change whose every path is under `.legion/`, where
|
|
13
|
+
handoffs lived before they moved to the Dispatch issue and which nothing writes or reads now, so
|
|
14
|
+
nobody reviews a path there, whatever GitHub's compare says the change did to it.
|
|
15
|
+
A conflict-forced merge goes back to the reviewer for a
|
|
15
16
|
confirmation or a new round, as the fingerprint decides (*The reviewer*, below, and
|
|
16
17
|
`skill://legion-worker/references/conflicts-and-rewrites.md`), unless READY refused it, and any
|
|
17
18
|
other change to the head voids it.
|
|
@@ -110,8 +111,8 @@ other change to the head voids it.
|
|
|
110
111
|
`REQUEST_CHANGES` when the code is at fault, and your own commit to fix when your prose broke
|
|
111
112
|
it. The architect reads your prose commits at its acceptance (*The architect's acceptance*,
|
|
112
113
|
below), and that read is no new round. A round after a READY refusal is the one exception. Its
|
|
113
|
-
approval needs the tester's results to be current at the head, or at an ancestor with only
|
|
114
|
-
under `.legion/`
|
|
114
|
+
approval needs the tester's results to be current at the head, or at an ancestor with only paths
|
|
115
|
+
under `.legion/` changed since. So there you fix no prose yourself, and you name each prose
|
|
115
116
|
finding in a `REQUEST_CHANGES`.
|
|
116
117
|
|
|
117
118
|
A reviewer's phase ends with its completion, not with its review. Every round records a handoff
|
|
@@ -162,7 +163,7 @@ reviewing until you finish.
|
|
|
162
163
|
`dispatch comment` on the issue for the skill librarian, brings the PR body up to date and
|
|
163
164
|
completes (`skill://legion-retro` gives the steps), so the approved head is the head READY
|
|
164
165
|
names. Anything above the approved
|
|
165
|
-
head voids the approval, except
|
|
166
|
+
head voids the approval, except a change whose every path is under `.legion/` and a commit
|
|
166
167
|
that changes only `docs/solutions/`, which READY still lets through: READY is refused
|
|
167
168
|
`READY_UNREVIEWED_CHANGE`, naming the paths, and the merger tells the architect, who has it send
|
|
168
169
|
the head back to review instead of completing, the move's reason naming the refusal's code and
|
package/package.json
CHANGED
package/skills/dispatch/SKILL.md
CHANGED
|
@@ -81,7 +81,7 @@ dispatch://PROJECT/artifact/<slug>/ask/<id>
|
|
|
81
81
|
dispatch://PROJECT/artifact/<slug>/comment/<id>#b-<block>[@vN]
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
A bare id, filename or path is
|
|
84
|
+
A bare id, filename or path is no reference, nor `dispatch://` outside Dispatch: give `dispatch`'s `https://` link. Write ids whole; a unique short id resolves.
|
|
85
85
|
|
|
86
86
|
## Setup and the HTTP API
|
|
87
87
|
|