@sjawhar/claude-envoy 1.24.0 → 1.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/.claude-plugin/plugin.json +1 -1
- package/.omp-plugin/plugin.json +1 -1
- package/dist/dispatch.js +136 -84
- package/dist/envoy-channel.js +143 -86
- package/dist/session-hook.js +136 -84
- package/legion/skills/legion-architect/SKILL.md +3 -0
- package/legion/skills/legion-architect/references/acceptance.md +14 -1
- package/legion/skills/legion-architect/references/design-gate.md +9 -1
- package/legion/skills/legion-architect/references/wake-routing.md +1 -0
- package/legion/skills/legion-controller/references/admission.md +1 -1
- package/package.json +2 -2
|
@@ -14,6 +14,9 @@ You own one issue tree from its first decision to the merge that closes it. The
|
|
|
14
14
|
- Act on delivered wakes and the live artifacts they name; build no wait loop, since every wake reaches you.
|
|
15
15
|
- Check each claim against the code as fetched now (the default branch your addressing line names, or the head under review), never the workspace as it was at admission, and tell every fresh reader you dispatch to do the same: the branch may have moved since.
|
|
16
16
|
- Before you end a turn that waits on a human, open what they must answer: a decision block, a `dispatch ask` or `dispatch request-approval`. A turn that ends with nothing open asks nobody, and the tree stops. Open an ordinary ask on the root issue itself, never a child: only a question a session of this tree opens on the root starts a wait on a person, so an ask on a child starts no wait and leaves the tree standing still. Once you have handed a root question to the human, end your turn: when nothing else of the tree is at work — no other issue of the tree in a phase, the `legion` label still on, and no person or outside session holding the root's Dispatch claim — the root returns its admission slot (`awaiting_person`) while this session stays live. Read the human's comments and replies as they arrive. Their answer gives this live claim a task naming what answered and what is still with them. The same holds once you request approval and `register_gate` that version: the registration hands the spec to the human, so end your turn there too, and the human's review, or a newer version once Dispatch shows the request back on your turn, gives you that task.
|
|
17
|
+
While a resume of that root waits for an admission slot, you get one `waiting-for-slot` notice saying what answered the wait, where your root stands in the admission line then, and that the daemon starts you again by itself at the next free slot.
|
|
18
|
+
You get it only while this session holds its Envoy role: a session whose pod the daemon released while the root waited is told nothing, and its resume task says what answered the wait.
|
|
19
|
+
Your record's `waitingLine` gives the live place and the line's length, and you act on neither: the daemon starts you.
|
|
17
20
|
- Deliver every criterion of the root spec in this tree. Work leaves it only when a root splits, as a `dispatch ask` for the rest: work outside has no owner.
|
|
18
21
|
- A problem outside the tree is a `dispatch ask`, never an issue you file, because a person decides whether it needs one (`skill://legion-worker/references/findings.md`). A clear defect is the exception. Fix one in code this tree touches or depends on in this tree's pull request. Send any other to the controller, which gives it to the tree that owns that code.
|
|
19
22
|
- Before you write a spec or ask a person anything, read the repository's `STRATEGY.md` when it has one and the design principles where it states them (`AGENTS.md`, in this repository), then use a standard best-practice solution; ask only what neither settles, with one recommendation. A design that crosses a Boundary in `STRATEGY.md` goes to its owner before it is built. Find the standard with a web search and with how two or three well-regarded projects solve the problem. Cite them in a few lines of the spec's `Design`. A design far from the standard is a sign to fix the underlying problem, not to add a workaround.
|
|
@@ -224,8 +224,21 @@ If you are that child's architect:
|
|
|
224
224
|
- It says `handed_over` alone (no gate to carry): your workers already run their phases, so
|
|
225
225
|
decompose nothing, and read the root's phase from the catch-up (for a root `held`, the phase its
|
|
226
226
|
`held` notice names). Before `awaiting_merge`, register your spec with `register_gate`: your
|
|
227
|
-
merger's READY waits for its approval.
|
|
227
|
+
merger's READY waits for its approval.
|
|
228
|
+
That registration's approval request waits with the person like any other, but it returns no admission slot: a root your catch-up calls `handed_over` stands at a phase it carried, never `admitted`, and only a root at `admitted` waits on a person.
|
|
229
|
+
The slot rule below is for a root of your own at `admitted`, not for this one.
|
|
230
|
+
When that `design-approved` arrives, release and start
|
|
228
231
|
nothing: the workers are already running. A child carried in `accepting` is yours to accept. In
|
|
229
232
|
`awaiting_merge` the READY is through, so register none; a red or conflicting head that returns
|
|
230
233
|
the root to `implementing` makes its next READY read the gate again, so a later `ready-refused`
|
|
231
234
|
is when you register.
|
|
235
|
+
|
|
236
|
+
## Your slot while a person has your spec
|
|
237
|
+
|
|
238
|
+
This is for a root of your own standing at `admitted`, the only phase from which a root waits on a person.
|
|
239
|
+
A registration that leaves the approval request with the person returns your root's admission slot, and what brings the root back is the answer, not the registration.
|
|
240
|
+
What decides whether your resume waits for a slot is whether the gate has ever opened in this generation, never whether it stands open now: an approval opens your gate, and a root whose gate has ever opened needs no slot to resume, so it resumes however full the cap is.
|
|
241
|
+
The first phase that resume starts takes a slot of its own: it waits in the line among the issues whose work came back, oldest first, placed by the moment your gate opened, so it stands behind every issue of that part whose work came back before it.
|
|
242
|
+
A changes request, or a newer version of the document that hands the request back to you, leaves the gate closed, so your merger's READY waits for a new approval; it brings back no need for a slot to resume, and only a root whose gate has never opened has one: then, while every slot is taken, you get one `waiting-for-slot` notice, and your record carries `waitingLine`, your place in the line and its length.
|
|
243
|
+
You get the notice only while this session holds its Envoy role: a session whose pod the daemon released while the root waited is told nothing, and its resume task says what answered the wait.
|
|
244
|
+
Act on neither: the daemon starts you again at the next free slot.
|
|
@@ -174,7 +174,15 @@ tree is at work, the root returns its admission slot and waits on its design gat
|
|
|
174
174
|
approval or changes request delivers your next task, and so does a newer spec version once
|
|
175
175
|
Dispatch shows the request back on your turn. While the root waits on a question instead, the
|
|
176
176
|
human's approval or changes request of the spec answers that wait too, and the task says how the
|
|
177
|
-
spec stands.
|
|
177
|
+
spec stands. An approval that opens the last gated step leaves your resume waiting for no slot at
|
|
178
|
+
all: it comes back however full the cap is. Where your root's gate has never opened, the resume
|
|
179
|
+
needs a slot, and while it waits for one you get one `waiting-for-slot` notice saying what
|
|
180
|
+
answered the wait, where your root stands in the admission line then and that the daemon starts
|
|
181
|
+
you again by itself, and your record's `waitingLine` gives the live place and the line's length;
|
|
182
|
+
act on neither.
|
|
183
|
+
You get the notice only while this session holds its Envoy role: a session whose pod the daemon
|
|
184
|
+
released while the root waited is told nothing, and its resume task says what answered the wait.
|
|
185
|
+
Release no child until every gated step is open: a delivered wake shows
|
|
178
186
|
`design-approved` on the root, or a task says its design gate is open, and under more than one
|
|
179
187
|
step `gatedSteps` in your record shows each one `approved`. The daemon sends a root waiting on a
|
|
180
188
|
person no `design-approved` notice, and "this resume is your design-approved wake" is that wake.
|
|
@@ -36,6 +36,7 @@ and 7 (a conflict, the hand-over, the close) is in
|
|
|
36
36
|
| `merge-stalled` | GitHub shows the pull request closed, or at another head, while the record still awaits READY's head, and that change's webhook never reached the daemon: read the pull request on GitHub and act on what it shows (`skill://legion-architect/references/merge-notices.md#merge-stalled`). |
|
|
37
37
|
| `merge-removed` | A person, or GitHub on its own, took the pull request out of the merge queue or turned its auto-merge off at READY's head after the daemon submitted the merge: read the pull request on GitHub and act on the removal's reason (`skill://legion-architect/references/merge-notices.md#merge-removed`). |
|
|
38
38
|
| `merge-waiting` | GitHub has not completed the merge the daemon submitted within an hour of READY's acceptance, and nothing has been withdrawn: read the pull request on GitHub for what GitHub waits on and ask a person for what no worker can do (`skill://legion-architect/references/merge-notices.md#merge-waiting`). |
|
|
39
|
+
| `waiting-for-slot` | Its `reason` says what answered your root's wait on a person, that your issue needs an admission slot and the cap has none free now, and where your issue stands in the admission line at that moment, the live place and length being `waitingLine` in your own record (the `legion` tool's `read_record`): do nothing, because the daemon starts you again by itself at the next free slot. |
|
|
39
40
|
| A reply on an ask you follow | Interpret the reply in the issue's design context. Answer in its thread (`dispatch comment --reply-to <comment id>`; under an open ask whose next move is yours, such as the approval request you must revise or hand back, `--reply-to-ask <ask id> --turn agent`, since a default-turn reply hands that request back to the human and a corrected `--summary` is then refused) where the reply carries a question, a disagreement, a correction or a fact you do not have, and whenever you are unsure; an approval, or an answer that settles the question with nothing left to say, draws no comment and no message back to the person who answered. Then adjust the plan or relay the reply via `envoy_publish` to the responsible worker's role token, which an answer needing nothing from you still needs; scope and product decisions remain with you. |
|
|
40
41
|
| `worker-died` | Its `role` and `phase`. That role's claim failed: its launches or prompts ran out. For a phase worker the daemon holds the issue (phase `held`) and starts nothing more on it. Reassess the work, then decide with `retry_or_escalate`: `retry` when the failure looks agent-specific or transient, `escalate` to hand the held issue to the controller when it looks environmental. |
|
|
41
42
|
| `worker-stalled` | Its `role` and `reason`. The daemon's stall backstop acted on that worker's stalled turn: its agent had not stepped for longer than the `worker_stall_backstop_hours` this deployment gives the role, and most often the daemon ended the turn and brought the same session back on a new process. The `reason` is the record the daemon read — when the agent last stepped and how long ago that was, the bound it passed, when the turn began, and the last call the daemon saw, with its tool, its call id, when it started and whether it ended — and never a call's arguments, whose text the daemon keeps in no column. It says what the daemon did as well, which is not always a relaunch: where the daemon's wake pacing parked the replacement, the task was taken back and the launch that replaces the stalled process is queued, due at the moment the notice names, and that process runs on until the launch's turn, which may start nothing — a suspension waiting for the claim, a refused lifecycle recheck or the tree's close can end the claim there instead; where a suspension was already waiting for that turn, that suspension ran instead of a replacement and the claim is suspended with nothing queued for it, waiting on a resume; where the launch that replaces the process could not be written, the daemon is still retrying that launch; and where every try at that launch was refused, the claim has failed, and the `worker-died` that comes with it is yours to answer as that row says. It says what became of the stalled process too, for every end but the parked one: that it was stopped, or that the runtime did not confirm the stop, in which case that process may be running still and holding what it runs on — tell the controller of that one, because the daemon stops it again only at its next launch of that claim or at its next restart. No second notice follows any of these unless the daemon restarts while a relaunch is parked, which decides the claim again. The task that worker was serving is still owed to it, and what its return waits on is the one the notice names — the parked launch's turn, the retried launch, or a resume; the stall itself charged the claim nothing, and no phase moved: on every end but the failed one the phase goes on by itself and you start nothing. Your part is to read what the record says the agent was doing and to judge whether that work needs a decision of yours — a call that hung on something the plan did not foresee is one, a turn that comes back and finishes is not. A stall of your own session reaches you the same way, on your own issue; when the stalled claim is a tree's architect, the controller is told of it too. |
|
|
@@ -11,7 +11,7 @@ which trees run: `admission.trees` does.
|
|
|
11
11
|
| The key is in `admission.active` | An issue holding a slot, a root or a child: a worker of it has work now. A root is here while its architect writes the spec (`admitted`, before its design gate first opens) and in each of its own phases; a child in each of its phases | Nothing, beyond [trees waiting on a root claim](skill://legion-controller/SKILL.md#trees-waiting-on-a-root-claim) |
|
|
12
12
|
| The key is in `admission.trees` | The root of a live tree: its lifecycle stands open and it does not linger, or it waits in the line or on a person. A tree is live whether or not any issue of it holds a slot, so this is the list that says which trees run, and `issues.<KEY>.tree` says which tree an issue stands in | Nothing: read it wherever you need the running trees |
|
|
13
13
|
| The key is in `admission.waiting` and not in `admission.blocked` | An issue waiting for a slot, in the line's own order: first the issues that held a slot and have work again, and the roots a person answered while they waited in `awaiting_person`, oldest first by when the work came back; then the issues whose first phase can start, by the Dispatch rank of their tree's root, and within one root's rank that tree's own issues before the root itself. A root that left another tree (handed over by its finished tree, or admitted as an orphan) waits here as its own root even under a live tree, the old root's return included: no tree adopts it | Nothing: it takes the next free slot by itself |
|
|
14
|
-
| `phase: awaiting_person`, `waitingOn` | A root that already ran and now waits only on a person: an answer to its architect's question (`waitingOn.kind` `ask`) or a review of its spec (`gate`). It holds no slot, its architect stays live to read the person's comments and replies, and its tree stays live. Unanswered, it is in neither `admission.active` nor `admission.waiting`, and only `admission.trees` names its tree; `waitingOn.answeredAt` means the daemon has
|
|
14
|
+
| `phase: awaiting_person`, `waitingOn` | A root that already ran and now waits only on a person: an answer to its architect's question (`waitingOn.kind` `ask`) or a review of its spec (`gate`). It holds no slot, its architect stays live to read the person's comments and replies, and its tree stays live. Unanswered, it is in neither `admission.active` nor `admission.waiting`, and only `admission.trees` names its tree; `waitingOn.answeredAt` means the daemon has put it in `admission.waiting`, among the issues whose work came back, oldest first | Nothing: it is not something to admit, label or park, and the slot it returned is no reason to take an issue ([Free slots](skill://legion-controller/SKILL.md#free-slots)). The daemon delivers the answer task to its architect at that promotion: at once, taking no slot, when the root's design gate has already opened, and at the next free slot while its architect is still writing the first spec. If its label goes or a person or outside session claims it on Dispatch, the daemon sends `unslotted` and does not resume work under another owner |
|
|
15
15
|
| The key is in `admission.blocked` | An issue Legion is waiting to start, with what it waits on: the Dispatch issues of its `blocked_by` links that nobody has finished, or, for a parent, the open children beneath it that children-first holds it for. It takes no slot until they are done, and one that is in the line stands in `admission.waiting` too | Nothing: a link's wait ends when each blocker reaches `done` (a person's close, or the blocker's own merge) or its link is taken off (by a person or the tree's architect), and a children-first wait ends when the last open child leaves the workflow, which is its tree's architect's work. Name the wait in the day's report |
|
|
16
16
|
| `phase: admitted`, in neither `admission.active` nor `admission.waiting`, and Dispatch shows a `child_of` parent | A child that has not started: it runs or waits with its tree, the root its `child_of` chain reaches. Under a root whose `phase` is `done` it waits with it. A labelled `todo` issue here is not in the line either: one whose recorded parent is in a live tree runs in that tree (the daemon adopted it there), or is held with that parent while the parent itself is held under an unreleased child, and one whose parent is not recorded but sits under a live tree is held under an unreleased child of that tree until its architect releases it or its parent. One a person moved to `todo` beneath an ancestor whose reviewed head the daemon has already accepted is held here until that ancestor closes. The unreleased-child hold is not `admission.blocked`, which names blocked-by links and children-first waits | Leave it to its tree. It runs again when its root does, or as a root of its own once it is `todo` with the `legion` label and no live tree is above it |
|
|
17
17
|
| `phase: admitted`, `status: todo`, in neither list, no parent | A root a person took out of the line by taking its label off | Nothing: the label puts it back in the line, and a person's label is their decision |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sjawhar/claude-envoy",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.26.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Claude Code plugin for Legion's Envoy bus",
|
|
6
6
|
"type": "module",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"AGENTS.md"
|
|
20
20
|
],
|
|
21
21
|
"legion": {
|
|
22
|
-
"daemonApiVersion":
|
|
22
|
+
"daemonApiVersion": 58
|
|
23
23
|
},
|
|
24
24
|
"repository": {
|
|
25
25
|
"type": "git",
|