@sjawhar/claude-envoy 1.26.3 → 1.27.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.
@@ -2,5 +2,5 @@
2
2
  "name": "claude-envoy",
3
3
  "description": "Put Envoy events into the Claude Code session's own conversation and expose Envoy MCP tools.",
4
4
  "mcpServers": "./.mcp.json",
5
- "version": "1.26.3"
5
+ "version": "1.27.1"
6
6
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-envoy",
3
- "version": "1.26.3",
3
+ "version": "1.27.1",
4
4
  "description": "Put Envoy events into the Claude Code session's own conversation and expose Envoy MCP tools.",
5
5
  "mcpServers": {}
6
6
  }
@@ -55348,7 +55348,7 @@ var import_nats2 = __toESM(require_mod4(), 1);
55348
55348
 
55349
55349
  // package.json
55350
55350
  var name = "@sjawhar/claude-envoy";
55351
- var version2 = "1.26.3";
55351
+ var version2 = "1.27.1";
55352
55352
  var legion = {
55353
55353
  daemonApiVersion: 59
55354
55354
  };
@@ -13,10 +13,8 @@ You own one issue tree from its first decision to the merge that closes it. The
13
13
 
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
- - 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.
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 moves to `awaiting_person`, keeping its admission slot, 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
+ An answered root stands in the admission line until the pass that resumes it, and nothing is sent to you about that wait: your record's `waitingLine` gives the live place in the line and the line's length, your resume task says what answered the wait, and you act on neither, because that resume takes no further slot and the daemon starts you again by itself.
20
18
  - 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.
21
19
  - 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.
22
20
  - 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.
@@ -45,7 +43,7 @@ Your record's `waitingLine` gives the live place and the line's length, and you
45
43
  - Release every child as soon as it is filed, each with `--blocked-by` the issues it waits on, and never hold a release back for a close: a released child, held or running, keeps the root's close waiting, but once the root's own pull request has merged the root closes the moment its last released child leaves, and a child released after that finds no live tree and runs as an orphan root of its own.
46
44
  - On each `child-closed`, read the child's handoff. Edit the spec of each open child the result changes, and take out each child it makes unneeded with `park_child` and say why with `dispatch comment`.
47
45
  - Before you park a child for good (one made unneeded, or parked so its tree can finish), set the `--blocked-by` list of each sibling that waits on it again without it (one call with the rest of its list, or `--clear-blocked-by` when it was the only one), or park that sibling too: a parked child is stopped, not done, and its dependents stay held with no notice. A park followed by `rerun_child` keeps its dependents' links: they wait through the rerun and start when the rerun's merge closes the child.
48
- - A released child holds an admission slot of its own while a worker of it has work, and waits in the admission line for one, so a tree of four working issues holds four of the cap's issues. It never becomes a root while your tree is live.
46
+ - A released child takes an admission slot of its own when the daemon starts its first phase and keeps it until it is done, leaves the workflow or waits only for its merge, and it waits in the admission line until the daemon starts it, so a tree of four started issues holds four of the cap's issues. It never becomes a root while your tree is live.
49
47
 
50
48
  ## 3. Children complete
51
49
 
@@ -225,8 +225,8 @@ If you are that child's architect:
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
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.
228
+ That registration's approval request waits with the person like any other, but it starts no wait of the root's own: 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 section below is for a root of your own at `admitted`, not for this one.
230
230
  When that `design-approved` arrives, release and start
231
231
  nothing: the workers are already running. A child carried in `accepting` is yours to accept. In
232
232
  `awaiting_merge` the READY is through, so register none; a red or conflicting head that returns
@@ -236,9 +236,11 @@ If you are that child's architect:
236
236
  ## Your slot while a person has your spec
237
237
 
238
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.
239
+ A registration that leaves the approval request with the person moves your root to `awaiting_person`, and what brings the root back is the answer, not the registration.
240
+ Your root keeps its admission slot throughout: it holds the slot the daemon gave it at its start until it is done, leaves the workflow or waits only for its merge.
241
+ So your resume takes no slot and comes however full the cap is, whether or not the gate has ever opened in this generation.
242
+ The first phase that resume starts needs no slot of its own either, since the root holds one: 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.
243
+ 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.
244
+ While your answered root stands in the line, your record carries `waitingLine`, your place in the line and its length.
245
+ Nothing is sent to you about that wait, and your resume task says what answered it.
246
+ Act on neither: the daemon starts you again on the pass that reads the answer.
@@ -168,20 +168,19 @@ review was of: `gatedSteps` carries one entry for each gated step, with its `art
168
168
  list, and not the notice, says which steps are open and which still hold the tree's work.
169
169
 
170
170
  Then end your turn. The registrations hand those documents to the human: when nothing else of the
171
- tree is at work, the root returns its admission slot and waits on its design gate
172
- (`awaiting_person`), as a root question handed to the human does ("Every turn" in
171
+ tree is at work, the root moves to `awaiting_person` and waits on its design gate, keeping the
172
+ admission slot it took at its admission, as a root question handed to the human does ("Every turn" in
173
173
  `skill://legion-architect/SKILL.md`). Stay live to read the human's comments and replies. Their
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. 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.
177
+ spec stands. Your resume takes no slot, whether or not the gate opened, because the root holds
178
+ one all along: an issue keeps its admission slot from the moment the daemon starts it
179
+ until it is done, leaves the workflow or waits only for its merge. The answered root stands in
180
+ the admission line until the pass that resumes it, and nothing is sent to you about that wait:
181
+ your record's `waitingLine` gives the live place in the line and the line's length, your resume
182
+ task says what answered the wait, and you act on neither, because the daemon starts you again by
183
+ itself on that pass.
185
184
  Release no child until every gated step is open: a delivered wake shows
186
185
  `design-approved` on the root, or a task says its design gate is open, and under more than one
187
186
  step `gatedSteps` in your record shows each one `approved`. The daemon sends a root waiting on a
@@ -23,7 +23,7 @@ and 7 (a conflict, the hand-over, the close) is in
23
23
  | `child-closed` | Read the child completion and remaining open children. Re-scope open work, park obsolete work for good with `park_child` (first take its link off each sibling that waits on it, or park that sibling too, as section 2 says), and file any new child the result calls for, after the red-team check in `skill://legion-architect/references/decomposition.md`, and release it at once with `release_children`, blocked by what it builds on (section 2). When a worker waits on this child for a missing surface (see `phase-finished`), tell it to continue with `envoy_publish` to its role topic. The last child's close is not the end-game (section 3). When it was the last child an issue in `accepting` waits on, run that issue's last round (`skill://legion-architect/references/acceptance.md`). |
24
24
  | `child-release-stalled` | Its `reason` names a child your `release_children` released that your tree has not recorded, its parent, and why, one of three: the parent's release has not reached the daemon after three tries; or GitHub did not answer the App installation read of a repository on the child's parent chain, and the release left the child unrecorded because a parent on that chain is not `todo`, or did not write the child `todo` because its parent is not recorded; or the daemon's recovery of such a repository, once GitHub answered, still left children unrecorded (one notice per tree lists them all, each with its parent). Read the parent's record with the `legion` tool's `read_record` (`issue` the parent); release the parent first when the `reason` says to, then run `release_children` for the child again once the parent is recorded in your tree, and tell the controller if it never is. |
25
25
  | `child-not-recorded` | Its `reason` names a child your tree did not record and why: its repository resolves to none (neither it nor an ancestor names one, and the project has no default), or to one not mapped to the project, or to one the daemon leaves out for a missing GitHub App. The daemon said why on the child too. Set the child's repository to one of the project's (`dispatch issue-update --repo owner/name`), then release it again with `release_children`; tell the controller when the repository it needs is not served. |
26
- | `children-first` | An issue of your tree starts no phase of its own while Dispatch shows an open child under it, a child you filed and have not released included. The reason names the parent and each open child with the Dispatch status that holds it, and each cycle it found (a child `blocked_by` an issue above it on its own parent chain, which only a person taking that link off ends: open a `dispatch ask`). It comes once per issue and run of its tree. Release every child that should run, and close, `park_child` or re-parent the rest; the daemon starts the parent's first phase at its next admission slot once the last open child has left the workflow. You start nothing. |
26
+ | `children-first` | An issue of your tree starts no phase of its own while Dispatch shows an open child under it, a child you filed and have not released included. The reason names the parent and each open child with the Dispatch status that holds it, and each cycle it found (a child `blocked_by` an issue above it on its own parent chain, which only a person taking that link off ends: open a `dispatch ask`). It comes once per issue and run of its tree. Release every child that should run, and close, `park_child` or re-parent the rest; the daemon starts the parent's first phase once the last open child has left the workflow — at once for a parent that already holds an admission slot, since an issue keeps the slot the daemon gave it until it is done, leaves the workflow or waits only for its merge, and at the next free slot for one that holds none. You start nothing. |
27
27
  | `design-approved` | Its `version` is the approved one, and it names no step: under more than one gated step, read `gatedSteps` in your own record (the `legion` tool's `read_record`) to see which step that version opened and whether another still holds the tree. A human approved the document of one gated step at its current version; that step is open. Proceed to section 2 once every gated step is `approved` — except on a root whose catch-up said `handed_over`: its workers already run their phases, so start nothing; the approval releases any READY the gate refused. One whose `version` is the version a human's own answer to a decision block wrote, after an earlier approval (Dispatch carried that approval to it, "After approval" in `skill://legion-architect/references/design-gate.md`), opens nothing new: carry on, and release no child because of it. A root that was waiting on a question in `awaiting_person` gets no such notice: the task that resumes it says "Your spec is approved at version N and the design gate is open: this resume is your design-approved wake", and that resume is this wake — proceed to section 2 on it. |
28
28
  | `design-changes-requested` | Its `version` and `reason`, and no step: under more than one gated step, read `gatedSteps` in your own record (the `legion` tool's `read_record`) and take the step whose `status` is `changes_requested`. A human asked for changes to that step's document at `version`, for `reason`. Revise that document as the reason asks and request approval again as "The armed gate" in `skill://legion-architect/references/design-gate.md` says; end your turn; that step is closed. On a root that was waiting on a question in `awaiting_person`, a review the human gave after the wait began comes in the resume task, not in this notice, whether it answered the wait or came after something else did: the task names the review with its version and reason, unless a later approval superseded it. A `version` below the latest, or a second request for one version, is a request that reached the daemon late: read it as the same section's last paragraph says. Each request arrives once. |
29
29
  | `phase-finished` | The daemon has already moved the issue to its next phase by its fixed table and started that phase's role; you start nothing. Read the finishing phase's handoff on the Dispatch issue (`dispatch handoff-read --issue <issue> --phase <word>`); if it shows unresolved gaps, tell the role now working the issue (`envoy_publish` to its role topic). A `planner` notice that names a departure from the spec's design defers to the full condition in "After approval" of `skill://legion-architect/references/design-gate.md`: when the approved Summary, the requirements, the checks, the scope and the settled decisions still hold, the plan is the record; otherwise change the root spec and request approval again as that section says. A `reviewer` notice whose GitHub review is `CHANGES_REQUESTED` needs nothing from you: the daemon has returned the issue to `implementing` (Dispatch `in_progress`) and started the **implementer**, whose correction goes through the tester and the reviewer again, never straight to retro. A `reviewer` notice with an `APPROVED` review means the issue is in `accepting` and the acceptance is yours (section 6): read the evidence, then `sign_off` (a parent only after its last round, "The last round" in `skill://legion-architect/references/acceptance.md`) or send it back with `request_backward_move`. A `tester` notice with `verdict: "fail"` — its handoff carries `implementerProof.verdict: "rejected"`, or a failure naming a check with no current passing result — has gone back to the **implementer** by the daemon's table; never record that check's result from another role. A worker that reports no surface reaches the changed path sends that report instead of completing its phase, so the daemon starts nothing more on that issue and the worker stays idle in its session, not suspended: build the surface in this tree: a child issue (infrastructure, tooling, or a skill) after the red-team check in `skill://legion-architect/references/decomposition.md`, or, when the red team folds it, tell the waiting worker to move the issue back to `implementing` with `request_backward_move`, naming the surface. When it is a child, tell the waiting worker to continue with `envoy_publish` to its role topic once that child's `child-closed` arrives. That report is never a reason to advance the phase. |
@@ -36,7 +36,6 @@ 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. |
40
39
  | 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. |
41
40
  | `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. |
42
41
  | `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. |
@@ -69,7 +69,7 @@ Wake details: `skill://legion-controller/references/wakes.md`.
69
69
  | `slot-free on <KEY>`, `todo on <KEY>` | Name the free slots; take nothing |
70
70
  | `tick on <PROJECT>` | The every-turn steps, then the parked-root walk (`skill://legion-controller/references/parked-decisions.md#the-walk`) |
71
71
  | `unslotted on <KEY>` | Re-admit nothing; name it in your summary |
72
- | `awaiting-person on <KEY>` | Nothing: do not park or re-admit it, and take nothing for the slot it returned |
72
+ | `awaiting-person on <KEY>` | Nothing: do not park or re-admit it, and take nothing for its slot, which it keeps while it waits |
73
73
  | `parked-decision on <KEY>` | `skill://legion-controller/references/parked-decisions.md#deciding` |
74
74
  | `held on <KEY>` | Nothing, unless `reason: "escalated"`: then an escalation |
75
75
  | `worker-died on <KEY>` (`role: "architect"`) | Re-admit once its cause is gone, else park it |
@@ -120,13 +120,21 @@ you label at a person's request or file yourself.
120
120
  A free slot is no reason to take an issue: a labelled root in `todo` takes the next slot through
121
121
  `admission.waiting` without you, and a parked issue (status `backlog` or `icebox`) means "do not
122
122
  run now". Move an issue out of `backlog` or `icebox` only on a request or a plan ruling that names
123
- it, and cite that request. A slot is one issue with work, a root or a child, not one tree: a tree
124
- of four working issues holds four slots, and a tree whose root only waits holds none of its own,
125
- so `admission.trees` is what names the roots of the live trees. The free slots are
126
- `admission.cap` minus the issues in `admission.active` and the issues in `admission.waiting` that
127
- are not in `admission.blocked`, since an issue its blockers or its own open children hold takes no
128
- slot until they are done. Every move to `todo` you make is one of
129
- these:
123
+ it, and cite that request. A slot is one issue the daemon has started, a root or a child, not one
124
+ tree: a tree of four started issues holds four slots. An issue takes its slot when the daemon
125
+ starts it and keeps it
126
+ until it is done, leaves the workflow or waits only for its merge,
127
+ so a root waiting on a person keeps the slot it took, and `admission.trees` is what names the
128
+ roots of the live trees. The free slots are `admission.cap`, less every issue in
129
+ `admission.active`, which is every issue holding a slot, and less again each issue of
130
+ `admission.waiting` that stands in neither `admission.active` nor `admission.blocked`: the
131
+ daemon counts a slot a waiting issue will take as taken already, and an issue in
132
+ `admission.blocked` waits on a blocker rather than on a slot. Count no issue twice. An issue
133
+ that holds a slot and waits for a promotion stands in both lists — a root a person answered,
134
+ a tree's own root at `admitted` under a design gate a person has opened, a root another tree
135
+ handed over with the slot it held there, and a child the daemon started that a person set back
136
+ to `todo` — and subtracting such an issue a second time would hide a slot that is free. Every
137
+ move to `todo` you make is one of these:
130
138
 
131
139
  - a root you labelled at a person's request or filed for a clear defect no tree owns, at triage (a
132
140
  root a person labelled is queued by the daemon);
@@ -3,15 +3,15 @@
3
3
  `read_state` says where each issue Legion records stands, and its `phase` alone does not: an issue
4
4
  is `admitted` from the moment the daemon records it until its first phase starts, whether it runs,
5
5
  waits, or neither. Read its key against `admission` and the root its own `tree` field names. A
6
- slot is one issue with work, a root or a child, not one tree, so `admission.active` no longer says
7
- which trees run: `admission.trees` does.
6
+ slot is one issue the daemon has started, a root or a child, not one tree, so `admission.active`
7
+ no longer says which trees run: `admission.trees` does.
8
8
 
9
9
  | What `read_state` shows | What it means | What you do |
10
10
  |---|---|---|
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) |
11
+ | The key is in `admission.active` | An issue holding a slot, a root or a child: the daemon has started it and has not finished with it. An issue takes its slot when the daemon starts it and keeps it until it is done, leaves the workflow or waits only for its merge, so this list holds an issue at work, one in `accepting`, one `held`, one `merging` and one waiting on a person alike | 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
- | 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 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 |
13
+ | The key is in `admission.waiting` and not in `admission.blocked` | An issue standing in the line, in its own order: first the issues whose work came back, oldest first by when it came back — one owed its worker a start, which holds no slot and waits here for one, and two that hold the slot they were started with: a root a person answered in `awaiting_person`, and a tree's own root at `admitted` whose design gate has opened; then the issues whose first phase can start, by the Dispatch rank of their tree's root and then by their own. 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. Two kinds of that second part may hold a slot already: such a root, with the one it held in the tree it left, and a child the daemon started that a person set back to `todo`, with the one its run took | Nothing: an issue holding a slot is promoted on the next pass whatever the cap says, and one holding none — an issue owed a start among them — waits here for the next free slot and takes it 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 keeps the slot it took when the daemon started it, its architect stays live to read the person's comments and replies, and its tree stays live. Unanswered, it is in `admission.active` and in no line; `waitingOn.answeredAt` means the daemon has put it in `admission.waiting` as well, among the issues whose work came back, oldest first, where it stands until the pass that resumes it | Nothing: it is not something to admit, label or park, and its wait frees no slot to take ([Free slots](skill://legion-controller/SKILL.md#free-slots)). The daemon delivers the answer task to its architect at that promotion, which takes no further slot, so it happens however full the cap is. 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 |
@@ -22,7 +22,7 @@ A root left in the workflow at a status only a running tree has (`in_progress`,
22
22
  wait explains, does not stay that way: every pass of admission (a Dispatch
23
23
  event, the daemon's boot read, its tick) takes it out of the workflow and sends the `unslotted`
24
24
  wake — an unanswered `awaiting_person` root only when its label or its Dispatch claim makes a
25
- resume unsafe. Holding no slot is by itself no fault: a root in `accepting`, in `awaiting_merge`,
26
- waiting on a person, waiting in the line, waiting on a blocker or waiting for its children holds
27
- none while its tree runs. The wake is live only, so a controller that starts later finds such a
28
- root by the last row, as its start procedure does.
25
+ resume unsafe. Holding no slot is by itself no fault: a root in `awaiting_merge`, a root waiting
26
+ in the line and a child its architect has not released yet hold none while their tree runs. The
27
+ wake is live only, so a controller that starts later finds such a root by the last row, as its
28
+ start procedure does.
@@ -9,8 +9,10 @@ it as a decision block and opens its own finding asks. Send a design decision ba
9
9
  architect with `envoy_publish` to its role, because it is not yours to make.
10
10
 
11
11
  For capacity, the only lever is order. You cannot change `admission.cap`: it is the operator's
12
- `legion.yaml` setting, and `set_status` is your only admission move. The cap counts issues at
13
- work, a root or a child, not trees, so a tree's own children compete for it with every other
12
+ `legion.yaml` setting, and `set_status` is your only admission move. The cap counts the issues the
13
+ daemon has started, a root or a child, not trees, and an issue keeps its slot from the moment the
14
+ daemon starts it until it is done, leaves the workflow or waits only for its merge, so a tree's
15
+ own children compete for it with every other
14
16
  tree's. Read `admission.active`, `admission.waiting` and `admission.trees`, tell the architect
15
17
  where its tree's issues stand in the line with `envoy_publish`, and
16
18
  open a finding ask when the deployment needs a larger cap.
@@ -46,8 +46,10 @@ The work goes to whoever already owns that code. You file an issue only when nob
46
46
  there, reply `Filed dispatch://<that KEY>` under the evidence, and file nothing.
47
47
  3. Find the running tree whose code it is: a root in `admission.trees`, the live trees, whose
48
48
  repository and component match, read from `read_state` and `dispatch read`. Read it there
49
- rather than in `admission.active`, which holds the issues at work: a tree runs whether or not
50
- any issue of it holds a slot. When one matches, hand it over.
49
+ rather than in `admission.active`, which holds the issues the daemon has started: an issue
50
+ takes its slot when the daemon starts it and keeps it
51
+ until it is done, leaves the workflow or waits only for its merge, and a tree runs whether or
52
+ not any issue of it holds one. When one matches, hand it over.
51
53
  `envoy_publish` the defect, its evidence reference and the fix to that tree's architect topic,
52
54
  `notifications.role.<issues.<KEY>.architect.locator.claim>`. The architect decides whether it
53
55
  is a child of the tree or part of an open issue's work. Reply `Handed dispatch://<that KEY>`
@@ -114,8 +114,10 @@ architect for it, whatever it asks. For a person's mention, take the first of th
114
114
  - **A question about state.** "What is Legion working on?", "Where is ACME-12?", "Why is it held?"
115
115
  Answer from `read_state` and Dispatch as they stand now, never from memory: each issue's
116
116
  `issues.<KEY>.phase` and `issues.<KEY>.tree`, its pull request, `admission.trees` for the trees
117
- that run, and `admission.active` and `admission.waiting` for the issues at work and the issues
118
- in the line. Say what you
117
+ that run, and `admission.active` and `admission.waiting` for the issues holding a slot and the
118
+ issues in the line: an issue holds its slot from the moment the daemon starts it
119
+ until it is done, leaves the workflow or waits only for its merge, so `admission.active` names
120
+ a tree's waits as well as its work. Say what you
119
121
  read, citing for each fact the `read_state` field or the `dispatch read` line it came from.
120
122
  - **A request for work.** Someone wants a change made, a bug fixed, something investigated. Search
121
123
  first (`skill://dispatch-first`): when an open issue already tracks it, reply with that issue and
@@ -12,7 +12,7 @@ Read this on a `triage` wake, at every start, and when a person hands you an iss
12
12
  `child_of` parent. A `child_of` under `Referenced by:` is a child of this issue, not its parent.
13
13
  3. Leave a child whose `issues.<KEY>.tree` is a root in `admission.trees`, or that has an ancestor
14
14
  that is, because that tree's architect owns it. `admission.trees` is the live trees: a slot is
15
- one issue with work, so a running tree holds none of its own while its children work.
15
+ one issue the daemon has started, held until it is done, leaves the workflow or waits only for its merge, so a tree is live whether or not its root holds one.
16
16
  4. Every other row with no `issues.<KEY>` entry in `read_state` is a root to you, a child whose
17
17
  tree is not in `admission.trees` included. Read who set its label
18
18
  ("Triage a root", step 2). A root a person labelled is queued by the daemon and needs nothing
@@ -19,11 +19,12 @@ the same way and wakes nobody.
19
19
 
20
20
  ## `slot-free on <KEY>` (`{kind: "slot-free"}`)
21
21
 
22
- The daemon released the slot of `<KEY>` and no waiting issue took it: the work of that issue ended
23
- or left the workflow — its merge, `accepting`, a blocker, its own children, a person
24
- (`awaiting_person`, which also sends its own `awaiting-person` wake), or its tree finishing. A
25
- slot is one issue with work, a root or a child, so the issue it names may be either. Name the free
26
- slots; take nothing.
22
+ The daemon deleted the slot row of `<KEY>` and no waiting issue took it: that issue is done, it
23
+ left the workflow, it reached `awaiting_merge`, or its tree closed or stopped running. An issue
24
+ takes its slot when the daemon starts it and keeps it
25
+ until it is done, leaves the workflow or waits only for its merge,
26
+ so none of its own waits sends this wake. A slot is one issue the daemon has started, a root or a
27
+ child, so the issue it names may be either. Name the free slots; take nothing.
27
28
 
28
29
  ## `todo on <KEY>` (`{kind: "todo"}`)
29
30
 
@@ -70,14 +71,14 @@ wake gives it>; `todo` with the `legion` label queues it again". Other admission
70
71
  ## `awaiting-person on <KEY>` (`{kind: "awaiting-person", reason}`)
71
72
 
72
73
  A root whose architect asked a person a question, or handed its spec to a person for approval, and
73
- now waits only on them: the daemon returned its slot while the architect stays live to read the
74
- person's comments and replies. Read `issues.<KEY>.waitingOn`. Do not park it or start anything, and
75
- take nothing for the slot it returned: it is no reason to label or admit an issue ([Free
76
- slots](skill://legion-controller/SKILL.md#free-slots)). The person's answer puts it among the
77
- issues at the front of `admission.waiting` by itself, and its promotion gives its architect the
78
- answer task: at once, holding no slot, when its design gate has already opened, and at the next
79
- free slot while its architect is still writing the first spec. A lost label or a foreign
80
- Dispatch claim sends the separate `unslotted` wake.
74
+ now waits only on them: it keeps the slot it took when the daemon started it, and its architect
75
+ stays live to read the person's comments and replies. Read `issues.<KEY>.waitingOn`. Do not park
76
+ it or start anything, and take nothing for its wait: the wait frees no slot and is no reason to
77
+ label or admit an issue ([Free slots](skill://legion-controller/SKILL.md#free-slots)). The
78
+ person's answer puts it in `admission.waiting` by itself, among the issues whose work came back,
79
+ oldest first, and its promotion gives its architect the answer task, taking no further slot, so
80
+ it happens however full the cap is. A lost label or a foreign Dispatch claim sends the separate
81
+ `unslotted` wake.
81
82
 
82
83
  ## `parked-decision on <KEY>` (`{kind: "parked-decision", decision, root, ref, actor, version?, reason?}`)
83
84
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/claude-envoy",
3
- "version": "1.26.3",
3
+ "version": "1.27.1",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Claude Code plugin for Legion's Envoy bus",
6
6
  "type": "module",
@@ -21,8 +21,8 @@ agent-secrets NAME... [--reason TEXT] [--wait DURATION] [--ttl DURATION] -- <com
21
21
  with some of its secrets missing (`cmdExec`, `packages/envoy/cmd/agent-secrets/main.go`).
22
22
  - `--reason` is necessary wherever a person approves: a request that names a secret someone must
23
23
  decide, and carries none, is denied whole. Say what the credential is for, in a sentence the
24
- approver can decide on. A request every name of which is granted at once reaches nobody and
25
- needs none.
24
+ approver can decide on, and name in it the issue you work on, by its key (below). A request
25
+ every name of which is granted at once reaches nobody and needs none.
26
26
  - `agent-secrets --help` holds the rest: the flags that narrow a GitHub App token
27
27
  (`--github-owner`, `--github-repo`, `--github-read-only`), and how long a grant lasts.
28
28
  - A narrowing and the airlock do not go together. Ask for a narrowing in a run whose grant holds
@@ -151,6 +151,24 @@ refusal that is permanent; 126 and 127 from `agent-secrets register --exec`, who
151
151
  run or was not found; and 129, 130, 131 and 143 from a signal at the value prompt of
152
152
  `agent-secrets secret create` or `secret set`. `agent-secrets --help` lists them all.
153
153
 
154
+ ## Asking so a model judge can decide it
155
+
156
+ Your deployment may run a model judge over a narrow class of the requests that would otherwise
157
+ wait for a person. Three things in your own command decide whether a request can fall in that
158
+ class:
159
+
160
+ - One secret. A request that names two is outside it.
161
+ - `--ttl 15m`, or less. A longer one is outside it. With no `--ttl`, the judge reads the lifetime
162
+ the broker gives instead: 15 minutes for a human-tier secret, which is inside it, and the whole
163
+ session for a secret tagged `default-grant=session`, which is outside it. Pass `--ttl 15m`.
164
+ - The key of the issue you work on in `--reason`, for an issue that is not done.
165
+
166
+ The rules of your deployment decide which secrets the judge may take, and you are told none of
167
+ them, so ask this way and wait as you would anyway. One class is never judged, whatever those
168
+ rules say: a secret tagged as an administrator's, of which a person approves every release. The
169
+ judge approves a request in its class or leaves it for the person who approves it today, and it
170
+ never denies. Every other request waits for that person, as it does now.
171
+
154
172
  ## Waiting, and a grant you already hold
155
173
 
156
174
  - `--wait` waits 30 minutes by default. A session that must not block passes `--wait 0s`, reads the
@@ -169,7 +187,8 @@ The broker tells a session no names. A name comes from your deployment instructi
169
187
  prompt, a skill, or the issue you work on. There is no list to browse and nothing to guess.
170
188
 
171
189
  - Request a secret only to use it for the work in front of you. A request made to learn whether a
172
- secret exists reaches a person's Inbox.
190
+ secret exists is recorded against your session with the reason you signed, and it reaches a
191
+ person's Inbox unless the model judge decides it first.
173
192
  - `UNKNOWN_SECRET` and a denial are final. Do not ask again, and do not try a name of your own.
174
193
  - A secret that a service owns, such as `LEGION_SLACK_BOT_TOKEN`, goes to that service's own pods
175
194
  and VMs and to nothing else: `Evaluate` in `packages/envoy/internal/broker/policy/policy.go`