@sjawhar/claude-envoy 2.42.1 → 2.43.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 +1 -1
- package/dist/envoy-channel.js +4 -4
- package/dist/session-hook.js +1 -1
- package/legion/skills/legion-architect/SKILL.md +18 -13
- package/legion/skills/legion-architect/references/acceptance.md +40 -28
- package/legion/skills/legion-architect/references/decomposition.md +85 -21
- package/legion/skills/legion-architect/references/design-gate.md +8 -5
- package/legion/skills/legion-architect/references/wake-routing.md +21 -15
- package/legion/skills/legion-controller/SKILL.md +7 -6
- package/legion/skills/legion-controller/references/admission.md +6 -6
- package/legion/skills/legion-controller/references/daily-report.md +2 -2
- package/legion/skills/legion-controller/references/escalation.md +13 -8
- package/legion/skills/legion-controller/references/slack-mentions.md +10 -7
- package/legion/skills/legion-controller/references/triage.md +3 -2
- package/legion/skills/legion-controller/references/wakes.md +56 -41
- package/legion/skills/legion-controller/references/weekly-audit.md +9 -5
- package/legion/skills/legion-worker/SKILL.md +1 -1
- package/legion/skills/legion-worker/references/findings.md +16 -11
- package/legion/skills/legion-worker/references/merge-gate.md +20 -11
- package/legion/skills/legion-worker/references/pr-body.md +3 -2
- package/package.json +1 -1
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
## Wake routing
|
|
2
2
|
|
|
3
3
|
Handle one delivered wake by verifying the relevant live artifact and then performing the
|
|
4
|
-
corresponding lifecycle procedure.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
corresponding lifecycle procedure. An architect-addressed wake reaches the architect that owns its
|
|
5
|
+
issue: the issue's own architect while it holds its role (the daemon starts a child's with the
|
|
6
|
+
child's first phase), else the nearest architect above that holds its role, then the root's. A
|
|
7
|
+
`catch-up` reaches only the architect of its own issue. A `child-status` or `child-closed` of a
|
|
8
|
+
child, and a `worker-died` or `worker-stalled` about a child's own architect, reach the architect
|
|
9
|
+
above the child. `phase-finished`, worker lifecycle, child lifecycle, and design-gate wakes are
|
|
10
|
+
architect-only and never go to an active phase worker. Where a row below tells you to ask a
|
|
11
|
+
person, a child's own architect sends the question to the architect above it instead
|
|
12
|
+
(`skill://legion-architect`, "Every turn").
|
|
9
13
|
|
|
10
14
|
A "section N" below is that section of `skill://legion-architect`. The spec and gate steps of
|
|
11
15
|
section 1 are in `skill://legion-architect/references/design-gate.md`; the detail of sections 3, 6
|
|
@@ -15,23 +19,24 @@ and 7 (a conflict, the hand-over, the close) is in
|
|
|
15
19
|
| Wake | Procedure |
|
|
16
20
|
| --- | --- |
|
|
17
21
|
| `carried-gate-opened` | Only a root whose catch-up said `carried` gets it. Its `version` and `reason`: a human approved the old root's spec document at `version`, which opened the gate this root carried; the daemon has started any child waiting on it. It names no step: the carry brings the old root's gate records, and the catch-up reports every gated step the carry did not bring as unregistered, so register each of those on this issue's own document for that step (`skill://legion-architect/references/design-gate.md`). It is not `design-approved`: do not proceed to section 2 or release a wave because of it, and start nothing. |
|
|
18
|
-
| `
|
|
22
|
+
| `catch-up` | The daemon sends it at each launch of your session, once that session is ready, to the architect of its own issue alone. A root's catch-up names its tree: the generation, each design-gate step (`gates`), and every issue of the tree with its phase and status. A child architect's catch-up names its own issue and every issue under it, with phase and status, and no gate: a child registers none. Either one names in its `reason`, as waiting for your acceptance, only the issues in `accepting` whose acceptance is yours. Accept each one as section 6 says, a parent only after its last round ("The last round" in `skill://legion-architect/references/acceptance.md`). Otherwise, start or resume your work from it as your role prompt says. |
|
|
23
|
+
| `child-status` | A child of your tree left the workflow or re-entered it, or joined your tree from the admission queue or from a closed tree; the reason names the child and its new status, or reads `<KEY> joined the tree of <ROOT> from the admission queue`, or, for a member of a closed tree your release took, `<KEY> joined the tree of <ROOT> from the closed tree of <OLD ROOT>`. A reason that says a child starts planning comes at the child's first phase, and it also says that the child's own architect starts with it. From then on that architect owns the child while it holds its role: its decomposition, its children and its acceptance. While that architect holds its role, you hear only the child's `child-status` and `child-closed`, and its architect's `worker-died` and `worker-stalled`. The child's other notices come to you too while that architect does not hold its role, which the daemon's `holdsRole` decides. `todo` (a human's move, your `release_children`, or your `rerun_child`) means it runs again under your tree from planning, and the daemon starts it; you start nothing. A child held for a blocker starts the same way once nothing holds it, and the reason, naming it and its root, says what cleared the hold: its last blocker's close, naming the issues it waited on, now done, or a person or you taking its blocked-by links off; you start nothing for it either. `backlog`, `icebox` or `triage` (a human's move, or your `park_child`) means the child stopped as workflow's `leave` decides, and it advances no further until it is set back to `todo`. The child's next start resumes its architect's session, and that architect starts in a new session only once supervise's `forgetSession` has dropped that one. A `park_child` and then a `rerun_child` is that child's restart and not a park, because the daemon refuses `rerun_child` on a child whose phase is not `done` (`CHILD_RUNNING`, `packages/daemon/internal/api/architect.go`). Joined from the admission queue means a root that waited for a slot and never ran, which a person made a child of your tree or your `release_children` adopted, now runs in your tree as a child, from planning when it is `todo` and parked otherwise. It takes an admission slot of its own when its work starts, and its own architect starts with its first phase. One that waits on an unfinished blocked-by issue is held for that blocker like any other child, and starts when nothing holds it. You start nothing. A reason saying an issue is beneath an ancestor whose reviewed head the daemon has already accepted is a person's `todo` the daemon recorded and holds at `admitted`: nothing starts it until that ancestor closes, and a `request_backward_move` of the ancestor is what runs it under the ancestor now. What the other issues you own do is your decision. When a park leaves no child that an issue in `accepting` waits on, run that issue's last round (`skill://legion-architect/references/acceptance.md`). |
|
|
19
24
|
| `child-closed` | Read the child completion and remaining open children. Re-scope open work, and take out with `park_child` each child the result makes unneeded (first take its link off each sibling that waits on it, or park that sibling too when its work ends with the parked child, under the same rule, as section 2 says) and say why with `dispatch comment`. Park a child only when a person asked for that move, or when the work is done, folded into another issue or no longer needed. Then 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`). |
|
|
20
|
-
| `child-release-stalled` | Its `reason` names a child
|
|
25
|
+
| `child-release-stalled` | Its `reason` names a child that a `release_children` released and 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, or the default-branch read past GitHub's rate limit, 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. The first two come to the architect whose `release_children` it was. The recovery's notice goes, whoever ran the release, to the architect that owns each child's parent where your tree records that parent, and to the tree root's architect for the rest: a notice on each recorded parent lists that parent's children, and one on the tree root lists the rest, 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. |
|
|
21
26
|
| `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. |
|
|
22
|
-
| `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. Park a child only when a person asked for that move, or when the work is done, folded into another issue or no longer needed, and cite that reason in a comment on the child. A released child, a held one included, stays under the parent, because the parent's wait ends when that child leaves the workflow. Move out from under the parent only a child you have not released and that should not run now. Move it under another issue
|
|
27
|
+
| `children-first` | An issue of your tree at `admitted` 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. Park a child only when a person asked for that move, or when the work is done, folded into another issue or no longer needed, and cite that reason in a comment on the child. A released child, a held one included, stays under the parent, because the parent's wait ends when that child leaves the workflow. Move out from under the parent only a child you have not released and that should not run now. Move it under another issue you own (section 3 says which) that has started a phase and has not reached `accepting`, and never under an issue it waits on: that move ends this wait and leaves the child in the tree (section 3). After the move, ask the person on the root (`dispatch ask`) when that child's work should run or stop: release it when they say to run it; when they say to stop it, close it, or move it to `icebox` under the rule when they say its work should wait, citing their answer. Until they answer, sign off neither the issue you moved it under nor any issue above it that you accept. Never give such a child the `legion` label, and never clear its parent while the tree is live, because such a child would then run nowhere (section 3). Where you own no issue to move the child under, ask the person. A child's architect sends each of these questions to the architect above it, as "Every turn" in `skill://legion-architect` says. The parent's first phase can start once the last open child has left the workflow; a parent the daemon has already started gives its admission slot back while it waits for its children, and takes one again by itself; nothing of its work stops meanwhile, and you do nothing for it (https://cybermonklabs.github.io/legion/legion/concepts/#admission-and-the-legion-label, which also names the three roots that keep their slot through a wait); a parent the daemon has not started waits in the line for a slot. You start nothing. |
|
|
23
28
|
| `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. 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 wave 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. |
|
|
24
29
|
| `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. |
|
|
25
|
-
| `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 pass standing at the head — 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. |
|
|
26
|
-
| `pr-blocked` | Its `reason` reads `Issue reached review_round_cap=<N>: <n> rounds counted, <m> conflict rounds not counted.`, the implementer's round count: every move back to an earlier phase counts one, and a move made while the head conflicts with its base counts as a conflict round the cap leaves out; the notice comes once for each value the cap holds, so the rounds past the cap tell you nothing again, a cap raised in `legion.yaml` tells again at its new number, a lowered one tells once on the next counted round, and a new generation tells again from its own first crossing. It moves nothing, since the round that reached the cap has already started its worker. Tell the rounds apart by what announced each: a tester's fail by its `phase-finished` with `verdict: "fail"`; a request for changes by the reviewer's `phase-finished` over a `CHANGES_REQUESTED` review; the daemon's own move by a `checks-red` notice, whose reason names the conflict it was raised for (`the head conflicts with <base>: GitHub runs no checks on it; merge <base> forward`); a worker's `request_backward_move` by a `phase-finished` from the role that asked, whose reason reaches only the task of the worker the move started, so ask that worker; your own send-back from `accepting` by the reason you gave. The message's `<n> rounds counted` has already left the conflict rounds out, so judge the cap by it. Conflict returns need nothing from you beyond the next round. Tester fails and requests for changes are the rounds the cap is for; a red check moves nothing and is told to nobody as a notice, so it is no round at all. Each `review_round_cap` notice is a decision you make in the turn it wakes, never one left for the next round to make: read what every counted round found, choose one of the three below, act on it in the same turn, and post it as a `dispatch comment` on the issue naming the rounds you read and the choice. **Narrow**: the change itself is sound but each round finds more around it; tell the implementer and the reviewer (`envoy_publish` to each one's role topic) which checks the next round answers, dropping no requirement; a correctness finding is still fixed in this pull request, and so is a wording nit or any clear fix in a file it touches, so the `Fast-follow:` line carries only cleanup in files it does not touch. **Split**: part of the work cannot settle in this pull request and is a separately deliverable change (`skill://legion-architect`, section 1). On a child,
|
|
27
|
-
| `pr-merged` | The pull request merged and the issue did not close; its `reason` says why. Merged before the issue reached `merging`: the workflow runs on, and the merge closes the issue the moment it gets there, your acceptance and retro first. Merged while
|
|
28
|
-
| `pr-closed-unmerged` | Decide from current scope whether the work is reopened, started over (for a child, `park_child` and then `rerun_child`, which is that child's restart and not a park, because the daemon refuses `rerun_child` on a child whose phase is not `done`: `CHILD_RUNNING`, `packages/daemon/internal/api/architect.go`), or ended with a reason. Delegate the repository action to the responsible phase worker and keep ownership. |
|
|
30
|
+
| `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. On a child, read the same condition against the child's spec at the version its parent's review approved. When it does not hold, write a new version of the child's spec and have the architect above review it (`skill://legion-architect/references/decomposition.md`, "Reviewing a child's spec"). 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 pass standing at the head — 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. |
|
|
31
|
+
| `pr-blocked` | Its `reason` reads `Issue reached review_round_cap=<N>: <n> rounds counted, <m> conflict rounds not counted.`, the implementer's round count: every move back to an earlier phase counts one, and a move made while the head conflicts with its base counts as a conflict round the cap leaves out; the notice comes once for each value the cap holds, so the rounds past the cap tell you nothing again, a cap raised in `legion.yaml` tells again at its new number, a lowered one tells once on the next counted round, and a new generation tells again from its own first crossing. It moves nothing, since the round that reached the cap has already started its worker. Tell the rounds apart by what announced each: a tester's fail by its `phase-finished` with `verdict: "fail"`; a request for changes by the reviewer's `phase-finished` over a `CHANGES_REQUESTED` review; the daemon's own move by a `checks-red` notice, whose reason names the conflict it was raised for (`the head conflicts with <base>: GitHub runs no checks on it; merge <base> forward`); a worker's `request_backward_move` by a `phase-finished` from the role that asked, whose reason reaches only the task of the worker the move started, so ask that worker; your own send-back from `accepting` by the reason you gave. The message's `<n> rounds counted` has already left the conflict rounds out, so judge the cap by it. Conflict returns need nothing from you beyond the next round. Tester fails and requests for changes are the rounds the cap is for; a red check moves nothing and is told to nobody as a notice, so it is no round at all. Each `review_round_cap` notice is a decision you make in the turn it wakes, never one left for the next round to make: read what every counted round found, choose one of the three below, act on it in the same turn, and post it as a `dispatch comment` on the issue naming the rounds you read and the choice. **Narrow**: the change itself is sound but each round finds more around it; tell the implementer and the reviewer (`envoy_publish` to each one's role topic) which checks the next round answers, dropping no requirement; a correctness finding is still fixed in this pull request, and so is a wording nit or any clear fix in a file it touches, so the `Fast-follow:` line carries only cleanup in files it does not touch. **Split**: part of the work cannot settle in this pull request and is a separately deliverable change (`skill://legion-architect`, section 1). On a child, that part becomes a child of this issue's parent, never of this one (this issue closes at its own merge, and the split part usually builds on this pull request's unmerged code). The architect that owns the parent files it. When you are this child's own architect, send the part to the architect above you with `envoy_publish`, since `release_children` refuses an issue outside your own (`ISSUE_NOT_OWNED`). The parent's architect runs the red-team check in `skill://legion-architect/references/decomposition.md`, then files the part: `dispatch issue --project <project> --parent <parent> --title '<outcome>' --blocked-by <this issue> --spec-file -`. It releases the part now with `release_children`: Legion holds it on that `--blocked-by` link until this issue closes, and starts it then. A requirement moves only to that released child. On the root, open a `dispatch ask` for the part that cannot settle here (`skill://legion-worker/references/findings.md`): it stays this issue's requirement, and this pull request carries it, until the person who answers that ask records that the issue will not deliver it. **Accept the rounds**: each round found less than the one before it, and the last found no defect in the change itself (a stale line, a comment that states an old default); let the loop run and say why in the comment. A later notice is a new decision: accept again only when its round found less than the round you last accepted, and otherwise narrow or split. On the root, a finding that changes what the spec requires or what a check proves is a decision block in the root spec ("After approval" in `skill://legion-architect/references/design-gate.md`). On a child, it is a new version of the child's spec, which the architect above the child reviews, and a decision only a person can make goes to the architect above. Neither that spec change nor a `dispatch ask`, which is only for a decision that needs a human's authority, replaces the choice. Judge a worker's backward move by the reason that worker gives. A move that sends back code found wrong counts with the tester fails. |
|
|
32
|
+
| `pr-merged` | The pull request merged and the issue did not close; its `reason` says why. Merged before the issue reached `merging`: the workflow runs on, and the merge closes the issue the moment it gets there, your acceptance and retro first. Merged while issues beneath it still run: the reason names the pull request and every issue the close waits for (those beneath it still in the workflow: on a root, every other issue of its tree), and the issue stays in `merging` with its workers kept, until the last of them is done or parked ("The close" in `skill://legion-architect/references/acceptance.md`). Either way you start nothing and no further notice follows. |
|
|
33
|
+
| `pr-closed-unmerged` | Decide from current scope whether the work is reopened, started over (for a child, `park_child` and then `rerun_child`, which is that child's restart and not a park, because the daemon refuses `rerun_child` on a child whose phase is not `done`: `CHILD_RUNNING`, `packages/daemon/internal/api/architect.go`), or ended with a reason. A child's own architect cannot park or rerun its own issue (`ISSUE_NOT_OWNED`), so it sends a restart of its issue to the architect above it. Delegate the repository action to the responsible phase worker and keep ownership. |
|
|
29
34
|
| `pull-request-missing` | Its `reason` names the issue, the repository, the branch and the handoff commit: the issue's implementer completed at that commit and GitHub lists no open pull request on the branch, so the issue stays in `implementing`. Tell the implementer (`envoy_publish` to its role topic) to open the pull request from that branch; the daemon records it and moves the issue to `testing` once it is open. When the work should not go on, decide as the `pr-closed-unmerged` row says. It comes once per handoff commit. |
|
|
30
35
|
| `review-stuck` | A review round the daemon cannot end on its own, in one of three ways: no review decides the round, the approval is of code the current head may not carry, or GitHub will not merge the head. The `review-stuck` paragraphs of your own role prompt give each one, its `topic` and what answers it. The third carries no `topic`. Its remedy, the close and the reopen at the same head, is for one named case only, and your role prompt gives the sort and the remedy's test in full; this row is their summary. Read what the base requires as `skill://legion-worker/references/merge-gate.md` reads it, rulesets and branch protection both, where a `code_scanning` rule requires an analysis no status-check list names. Read what the head carries in two lists, every page: its check runs (counted by `gh api repos/<owner>/<repo>/commits/<head>/check-runs --jq .total_count` and listed by `gh api --paginate 'repos/<owner>/<repo>/commits/<head>/check-runs?per_page=100' --jq '.check_runs[] | [.name, .status, .conclusion] | @tsv'`) and its commit statuses (`gh api --paginate 'repos/<owner>/<repo>/commits/<head>/status?per_page=100' --jq '.statuses[] | [.context, .state] | @tsv'`), since a commit status is no check run. A required item in either list is reported, and a check run whose status is `queued`, `requested`, `waiting`, `pending` or `in_progress`, or a commit status whose state is `pending`, is running, not missing, and a check run concluded `failure`, `timed_out`, `cancelled` or `startup_failure`, or a status in state `failure` or `error`, is red; never read the status endpoint's top-level `state`, which reads `pending` with no status at all. A required item in neither list falls in a named case: a fork pull request whose runs wait for a maintainer's approval (`action_required`), a check only a commit status would report, and a workflow another repository defines each take a person through a `dispatch ask`; a required workflow whose own path filter skips every file of the change gets no run, and a reopen sends the same event, so while the base still carries that filter the head takes a change to the workflow or to the head, and once the base has dropped it the head is the remedy's own case. The remedy's own case is a required workflow no event started on a pull request already open, and its test is the role prompt's: not a fork and no run `action_required`; a workflow file, as the merge commit holds it, has a job reporting the required item whose `on:` runs it for `pull_request` with no `types`, `branches` or path filter that excludes this change; and neither list holds a run of it. Such a head takes the reopen. A head that matches none of the named cases takes a person through a `dispatch ask`, never the reopen, since GitHub has more cases than these; so does a head whose required item still has no run once every run the reopen started has concluded. Close the pull request, wait a minute, and reopen it at the same head, since in cybermonklabs/legion a quicker reopen can have its CI run cancelled by the close's own run and leave `ci-ok` failing (`tests-closed.yaml`); tell the reviewer on its role topic to do it, since a repository action is the phase worker's. It costs two things: the close writes a `pr-closed-unmerged` notice, which is this close and ends no work, and the reopen starts the head's other checks again. It is for no other state: not a check that is running, not a check that is red, and not a head GitHub holds for a review the repository requires. A round whose head has no settled run gets no `review-stuck` notice of any kind, so read it in your own record with the `legion` tool's `read_record`, where the issue's `mergeWait` names the head: its `checkRuns` counts only the runs a CI settlement applied, so 0 there is no evidence of what GitHub holds, and you read the head's two lists before you act. A run still running there is waited for; for a GitHub Actions job GitHub ends the wait itself (24 hours queued on a self-hosted runner, `timeout-minutes` or 6 hours hosted and 5 days self-hosted running, 35 days for a whole workflow run), whose settlement moves the round, a `waiting` run waits on a person's approval of an environment, up to 30 days, and another App's check run, one a workflow created through the API and a `pending` commit status have no such bound and go to a person once they stand longer than their CI usually takes. Every run concluded while `checkRuns` stays 0 is a settlement not yet arrived, which Dispatch's CI reconcile pass repairs where it runs, a pass every 5 minutes reaching each head within a cycle of passes, so read the record again after a few passes; a head still at 0 then is sorted as above: a red required check is `request_backward_move` to `implementing`, a required item with no run takes the reopen only when the test matches, and every other head takes a person. A conflicting head never waits in `mergeWait` once a read has answered for it, because the daemon sends it back itself with a `checks-red` notice. |
|
|
31
36
|
| `message-refused` | Dispatch refused a write the daemon was making on an issue of your tree, the way it would refuse every attempt, so the daemon makes it no more. A close reason is held to Dispatch's bound at the call that carries it (`close_root` answers `CLOSE_REASON_TOO_LONG`, naming the bound and how far over the text is), so this is a refusal that check did not predict. Read its `reason`: on a status write the daemon writes the status all the same, so the status is set unless Dispatch refused the status itself, which the reason says — with the status set, only the reason beside it is on no issue, and you post what a person still needs yourself; with the status refused, the issue keeps the status it had while the daemon's own record reads the one the write carried, a disagreement no retry of the daemon's closes, so ask a person with `dispatch ask` to set it. On a message write nothing of what it carried reached the issue, and the `reason` gives its length and its first line, so post what a person needs yourself. |
|
|
32
37
|
| 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. |
|
|
33
|
-
| `worker-died` | Its `role` and `phase`. That role's claim failed: its launches or prompts ran out, or its provider refused every turn of its session (its `failure.detail` reads `the provider refused <n> turns in a row: <message>`), or its system prompt is too large for its pod's start frame (a `launch_refused` with no count at its limit, whose `detail` names the role, the size and the limit: only a shorter prompt starts it, so a `retry` before the prompt is cut fails again at once; `escalate` it). For a phase worker the daemon holds the issue (phase `held`) and starts nothing more on it. It carries `failure` as well (the notice of a held phase, and that of a role which does not work the issue's phase; the one that ends a closed issue's production-check look carries neither `failure` nor `phase`, its `reason` naming the cause already): `cause`, one cause word of the seven the daemon chooses from (`launch_refused`, `died`, `never_registered`, `stale_plugin`, `prompt_retires_exhausted`, `provider_error`, and `unrecorded` for a failure recorded before the daemon kept a cause), `detail`, the sentence written beside that word, `death` and `startFailure`, what the runtime and the launcher last said of this claim where it recorded either, and `launchFailures`, `deaths`, `promptFailures` and `promptRetires`, each a `count` beside the `limit` it ran out at. The claim's record in `read_record` carries the same `failure`, and the issue's `heldFrom` names the phase the hold took it out of. 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. `reason` is optional on either decision: a `retry`'s reaches the restarted worker's task, so say in it what you changed or what you want done differently, and an `escalate`'s reaches the controller as the `escalation` key of the `held` notice that records it, so say in it why the tree cannot go on without a decision of the controller's. A `retry` of a claim that failed on refusals starts a **new session**, since resuming the one the provider refused would be refused again: that worker has read none of its own earlier work, and is told so in its first task, which names its branch and the handoffs to read. Expect it to re-read before it continues, and tell it anything only you know. |
|
|
34
|
-
| `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
|
|
38
|
+
| `worker-died` | Its `role` and `phase`. That role's claim failed: its launches or prompts ran out, or its provider refused every turn of its session (its `failure.detail` reads `the provider refused <n> turns in a row: <message>`), or its system prompt is too large for its pod's start frame (a `launch_refused` with no count at its limit, whose `detail` names the role, the size and the limit: only a shorter prompt starts it, so a `retry` before the prompt is cut fails again at once; `escalate` it). For a phase worker the daemon holds the issue (phase `held`) and starts nothing more on it. A `worker-died` whose `role` is `architect` on a child is about that child's own architect, and it reaches you as the architect above it. Nothing is held, so there is nothing to `retry_or_escalate`. Its `reason` says that the child's notices come to you until that architect runs again, and that the daemon starts it again, with fresh budgets, at the child's next phase start. A re-admission of your tree while the child stands in a phase, or an operator's retry, starts it again too. Meanwhile, act as section 2 says, and accept the child yourself if it reaches `accepting` (section 6). It carries `failure` as well (the notice of a held phase, and that of a role which does not work the issue's phase; the one that ends a closed issue's production-check look carries neither `failure` nor `phase`, its `reason` naming the cause already): `cause`, one cause word of the seven the daemon chooses from (`launch_refused`, `died`, `never_registered`, `stale_plugin`, `prompt_retires_exhausted`, `provider_error`, and `unrecorded` for a failure recorded before the daemon kept a cause), `detail`, the sentence written beside that word, `death` and `startFailure`, what the runtime and the launcher last said of this claim where it recorded either, and `launchFailures`, `deaths`, `promptFailures` and `promptRetires`, each a `count` beside the `limit` it ran out at. The claim's record in `read_record` carries the same `failure`, and the issue's `heldFrom` names the phase the hold took it out of. 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. `reason` is optional on either decision: a `retry`'s reaches the restarted worker's task, so say in it what you changed or what you want done differently, and an `escalate`'s reaches the controller as the `escalation` key of the `held` notice that records it, so say in it why the tree cannot go on without a decision of the controller's. A `retry` of a claim that failed on refusals starts a **new session**, since resuming the one the provider refused would be refused again: that worker has read none of its own earlier work, and is told so in its first task, which names its branch and the handoffs to read. Expect it to re-read before it continues, and tell it anything only you know. |
|
|
39
|
+
| `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 a root architect's own session reaches that architect the same way, on its own issue, and the controller is told of it too. A stall of a child's own architect reaches the architect above it. |
|
|
35
40
|
| `worker-silent` | Its `role` and `reason`. That worker stopped between turns rather than inside one: its process is up, it holds no task, and its agent has not stepped for longer than the `worker_silence_minutes` this deployment sets, so nothing in the daemon and nothing in that process was going to prompt it again. The `reason` is the record the daemon read — the issue, the role, the phase, when the agent last stepped and how long ago that was — and it ends with what the daemon wrote about it, read from the phase entry the role's phase row names: the start row that sends the work of that entry, where the worker's claim was never given it, or the start row that sends the phase's task again, where the claim is on that entry already, naming the entry where the row holds one. That row is written and the worker is coming back with that work: read the issue's record with the `legion` tool's `read_record` to see where the phase stands, and start nothing yourself. The one thing that still refuses the start is a suspension an operator holds over the claim, which the outbox reads when it runs the row and which the `reason` names: ask the operator to resume that claim, and message the role on its topic (`envoy_publish`) where its phase cannot wait. It comes once for each silence, and a worker that takes a step and then goes quiet again is told again. |
|
|
36
41
|
| `worker-background-stalled` | Its `role` and `reason`. That worker's own session reports background work of its own — an async job, a subagent, a background task — still running, and it has reported the same thing without change for longer than the `worker_background_hours` this deployment sets. The `reason` is the record the daemon read: the issue, the role, the phase, the kinds the session named, when it last reported them and how long ago that was. Nothing was sent to that worker and nothing will be sent for this: the daemon cannot tell a job that hung from a long one, so it names the worker to you and decides nothing. Your part is to read what the session says it is waiting on and to judge whether that work needs a decision of its own — a job waiting on a surface that does not exist, or on a person, is one; a long build or a long test run is not. Read the issue's record with the `legion` tool's `read_record` for where the phase stands, then either leave the work to finish or message the role on its topic (`envoy_publish`) with what you decide. The worker is not prompted by the silence repair while it reports such work, so nothing else is coming for it either. It comes once for each standing report: a worker whose reported work changes — a job that ends and another that starts — is told of again under the new report. |
|
|
37
42
|
| `held` | Its `role` and `phase` (the phase the issue left), or `phase` with `reason: "escalated"`. Without `reason`, that phase's worker ran out of launches or prompts: the issue is held (phase `held`), the notice carries the same `failure` record as the `worker-died` that comes with it, which is yours to answer with `retry_or_escalate` as that row says, and the controller hears of the hold too. With `reason: "escalated"`, it records your own `escalate`: the controller has the issue now, it carries no `failure`, and you start nothing for it. It carries `escalation` instead, your own `reason` from that `escalate`, and carries none where you named none: the controller reads it as your account of why the issue is its, beside the cause word in the claim's own `failure` record, so say in it what the tree cannot go on without. Your `retry` is not the only release: a `todo` written on a held root releases the hold the same way and at the same price of nothing, whoever writes it, so an issue you left held may be working that phase again when you next read it. |
|
|
@@ -39,4 +44,5 @@ and 7 (a conflict, the hand-over, the close) is in
|
|
|
39
44
|
## A root that joins your tree, and a refused release
|
|
40
45
|
|
|
41
46
|
- A root that waited in the admission queue, never ran and never left another tree joins your tree once a person makes it your child, if it is `todo`, and otherwise at your release of it (the `child-status` row of [wake routing](skill://legion-architect/references/wake-routing.md)); once in, it is held for its blockers like any child you release. A root that left another tree, handed over by its finished tree or admitted as an orphan, stays its own tree and never joins yours, even one that was your root's child before your root was admitted again. A labelled `todo` issue under a child you have not released, unless it ran as a tree of its own or left another tree, is held under that unreleased child (not a blocked-by hold): it waits for no slot until your release of it or of that child brings it in, with any `todo` child of its own.
|
|
42
|
-
- A release that cannot take a child in is refused 409 and writes nothing, its message naming the child and why: release the rest again without it. `CHILD_NOT_ADOPTABLE` is an issue that runs or ran as a tree of its own, carries a run handed over to it, or was handed over (or admitted as an orphan) as a root of its own, and a member of a closed tree that holds an admission slot when you release it, which the daemon leaves where it stands: leave it there, or ask the controller. `CHILD_IN_OTHER_TREE` is another tree's child. One kind of other tree's child does join yours: a member of a tree whose root the daemon's record says is `done` and whose linger has run out, standing at `admitted` with no slot of its own, which your release records in your tree with its repository kept and its generation raised by one — at `admitted` when it is `todo`, and in any other status as a parked child at `done`, which a `todo` runs again. `admission.held` reads `tree_closed` for more issues than a release takes: a member whose tree's linger still runs, and a member past `admitted`, read that word too and stay refused (the `tree_closed` row of `skill://legion-controller/references/admission.md`). When the tree it names is a root held under an unreleased child of yours (a root that queued and never ran, so
|
|
47
|
+
- A release that cannot take a child in is refused 409 and writes nothing, its message naming the child and why: release the rest again without it. `CHILD_NOT_ADOPTABLE` is an issue that runs or ran as a tree of its own, carries a run handed over to it, or was handed over (or admitted as an orphan) as a root of its own, and a member of a closed tree that holds an admission slot when you release it, which the daemon leaves where it stands: leave it there, or ask the controller. `CHILD_IN_OTHER_TREE` is another tree's child. One kind of other tree's child does join yours: a member of a tree whose root the daemon's record says is `done` and whose linger has run out, standing at `admitted` with no slot of its own, which your release records in your tree with its repository kept and its generation raised by one — at `admitted` when it is `todo`, and in any other status as a parked child at `done`, which a `todo` runs again. `admission.held` reads `tree_closed` for more issues than a release takes: a member whose tree's linger still runs, and a member past `admitted`, read that word too and stay refused (the `tree_closed` row of `skill://legion-controller/references/admission.md`). When the tree it names is a root held under an unreleased child of yours (a root that queued and never ran, so no architect has started on it), release that root, or the unreleased child it sits under, instead: its children come with it. Otherwise re-parent the child back in Dispatch, or ask that tree's architect or the controller.
|
|
48
|
+
- A child's own architect releases, parks and reruns only the issues under its own issue. `release_children`, `park_child` and `rerun_child` refuse any other issue of the tree with 403 `ISSUE_NOT_OWNED` and change nothing: the tree root, the architect's own issue, a sibling of it and an issue under a sibling are another architect's. Send such a move to the architect above you.
|
|
@@ -80,7 +80,7 @@ Wake details: `skill://legion-controller/references/wakes.md`.
|
|
|
80
80
|
| `worker-died on <KEY>` (`role: "architect"`) | Nothing when the root's `phase` is `done`: the tree is parked already. Otherwise restart the tree when you find no cause or its cause is gone, and ask whether to park it when the cause stays (`skill://legion-controller/references/wakes.md#ask-whether-to-park-a-tree`) |
|
|
81
81
|
| `worker-stalled on <KEY>` (`role: "architect"`) | Nothing, unless the notice says the claim failed: its turn was ended, its task is still owed, and the notice says what became of its process |
|
|
82
82
|
| `update-stalled on <KEY>` | `skill://legion-controller/references/escalation.md#an-update-round-that-is-not-finishing-update-stalled` |
|
|
83
|
-
| `provider-errors on <KEY>` | Name the run and its model in the day's report; send it to the issue's architect; for one claim that stays stuck, `compact` first, and `fresh_session` only when it is still refused after that |
|
|
83
|
+
| `provider-errors on <KEY>` | Name the run and its model in the day's report; send it to the architect that owns the issue, or, for a stuck child's own architect, to the architect above that child; for one claim that stays stuck, `compact` first, and `fresh_session` only when it is still refused after that |
|
|
84
84
|
| An architect's escalation | `skill://legion-controller/references/escalation.md` |
|
|
85
85
|
| A finding ask's reference, or its answer | `skill://legion-controller/references/finding-asks.md` |
|
|
86
86
|
| An answer to a park ask (`Park it`, `Leave it admitted`) or a deferral ask (`Defer it`, `Let it run`) | The procedure that opened it: `skill://legion-controller/references/wakes.md#ask-whether-to-park-a-tree` step 4, or `skill://legion-controller/references/backlog-stewardship.md#a-root-the-plan-defers` step 4 |
|
|
@@ -124,11 +124,12 @@ An issue whose work must start at a commit other than its base branch's head nee
|
|
|
124
124
|
`legion/<KEY>` created at that commit before Legion starts the issue. One command creates it:
|
|
125
125
|
`gh api -X POST repos/<owner>/<name>/git/refs -f ref=refs/heads/legion/<KEY> -f sha=<commit>`. You
|
|
126
126
|
ask for that command rather than run it, because you edit no repository and push no commit: for a
|
|
127
|
-
root, whoever hands the work over runs it; for a child of a tree, the
|
|
128
|
-
daemon sets the deadline: its own `issue_branch` row creates
|
|
129
|
-
branch and leaves a branch GitHub already has where it is, so
|
|
130
|
-
the issue is admitted, and a child's before the child starts its
|
|
131
|
-
soon as its tree's design gate opens and nothing holds it. Read
|
|
127
|
+
root, whoever hands the work over runs it; for a child of a tree, the architect that owns the
|
|
128
|
+
child's parent runs it. The daemon sets the deadline: its own `issue_branch` row creates
|
|
129
|
+
`legion/<KEY>` at the issue's base branch and leaves a branch GitHub already has where it is, so
|
|
130
|
+
a root's branch must exist before the issue is admitted, and a child's before the child starts its
|
|
131
|
+
first phase, which it can do as soon as its tree's design gate opens and nothing holds it. Read
|
|
132
|
+
the branch back before you
|
|
132
133
|
`set_status` the root to `todo`:
|
|
133
134
|
`gh api repos/<owner>/<name>/git/ref/heads/legion/<KEY>`. The issue's own spec tells its worker
|
|
134
135
|
which branch to open the pull request against; nothing else carries that.
|
|
@@ -12,8 +12,8 @@ no longer says which trees run: `admission.trees` does.
|
|
|
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 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; one `waiting_on_issue`, a started issue that gave its slot back for a wait, 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. `issues.<KEY>.waitingLine` says where that issue stands, in its own fields: `part`, `returned` for an issue whose work came back or `starting` for one that has not started; `kind`, `returning` (a worker is owed a start), `answered` (a person answered the root), `queued_root`, `first_phase` or `waiting_on_issue` (a started issue that gave its slot back to wait on another issue: https://cybermonklabs.github.io/legion/legion/concepts/#admission-and-the-legion-label); `partPlace` and `partLength`, its place among the issues of its own part and how many they are; `holdsSlot`, true where it already holds its admission slot and so takes no free one; `since`, the moment a `returned` issue's work came back; `rootRank`, `ownRank` and `rootKey`, the two Dispatch ranks that placed a `starting` issue and the key of its tree root; and `reason`, the daemon's own sentence for where it stands, which you quote in a report rather than write one of your own. Beside it, every issue that is not working now carries `why`, one answer with a `state` and a `reason` sentence: `claim_stopped`, a claim nothing will wake; `waiting`, this line; `blocked`, a Dispatch link or an open child below it; `unlisted`, the record holds it in the workflow and none of the three lists places it. An issue holding an admission slot carries no `why` unless it also stands in `admission.waiting` or `admission.blocked`, or a stranded claim names it: an answered root reads `waiting`, and an issue at work whose worker runs, one `held` and a root whose ask a person has not answered yet, which `waitingOn` answers for, read nothing. Neither does an issue the record does not hold in the workflow (`done`, `backlog`, `icebox`, `triage`). The daemon narrows its answer to the contract the reading pod records: you read `partPlace` and every member above, and `why` with them, once your own pod runs a plugin at contract 85, and you read the `place` and `length` of today until then | 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 a slot and takes one by itself. Read `reason` before you report an order as wrong: an issue of the second part stands behind every issue whose work came back, however it ranks ([Free slots](skill://legion-controller/SKILL.md#free-slots)) |
|
|
14
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
|
-
| The key is in `admission.blocked` | An issue waiting on a Dispatch issue nobody has finished, 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. An issue the daemon has not started yet takes no slot until they are done, and one that is in the line stands in `admission.waiting` too; an issue the daemon has started holds no admission slot while it waits either: it gives the slot it had back, stands here and in `admission.waiting`, and takes one again by itself (https://cybermonklabs.github.io/legion/legion/concepts/#admission-and-the-legion-label), with nothing of its work stopped meanwhile — no worker is suspended, no phase moves, no Dispatch status is written, and only the start of its next phase waits until it holds a slot again — and being in both lists and in neither `admission.active` is what tells it from an issue a person parked, which is in none of the three; three started roots keep their slot although a wait names them (https://cybermonklabs.github.io/legion/legion/concepts/#admission-and-the-legion-label): a root in `awaiting_person`, a root at `admitted` whose design gate has never opened, and a root that arrived from another tree carrying the row it held there | 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
|
|
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
|
|
15
|
+
| The key is in `admission.blocked` | An issue waiting on a Dispatch issue nobody has finished, 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. An issue the daemon has not started yet takes no slot until they are done, and one that is in the line stands in `admission.waiting` too; an issue the daemon has started holds no admission slot while it waits either: it gives the slot it had back, stands here and in `admission.waiting`, and takes one again by itself (https://cybermonklabs.github.io/legion/legion/concepts/#admission-and-the-legion-label), with nothing of its work stopped meanwhile — no worker is suspended, no phase moves, no Dispatch status is written, and only the start of its next phase waits until it holds a slot again — and being in both lists and in neither `admission.active` is what tells it from an issue a person parked, which is in none of the three; three started roots keep their slot although a wait names them (https://cybermonklabs.github.io/legion/legion/concepts/#admission-and-the-legion-label): a root in `awaiting_person`, a root at `admitted` whose design gate has never opened, and a root that arrived from another tree carrying the row it held there | 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 an architect of the tree), and a children-first wait ends when the last open child leaves the workflow, which is the work of the architect that owns the parent. Name the wait in the day's report |
|
|
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 an architect of that tree above it 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 |
|
|
18
18
|
| `phase: done` while `status` is `in_progress`, `testing`, `needs_review` or `retro` | Legion is not running it under that status, and it sent the `unslotted` wake. Either someone other than Legion moved a root that waited for a slot there, and the daemon took it out of the workflow at that move since no slot would ever reach it; or a root waiting on a person could not be resumed — its `legion` label is gone, or a person or an outside session took its Dispatch claim — and the daemon took it out the same way, leaving the `in_progress` it ran with. A parked child stays parked. Legion starts nothing for any of them | Re-admit nothing yourself: `dispatch read` shows who works it now. Name it in your summary; `todo` with the `legion` label queues it again |
|
|
19
19
|
|
|
@@ -25,7 +25,7 @@ wake — an unanswered `awaiting_person` root only when its label or its Dispatc
|
|
|
25
25
|
resume unsafe. Holding no slot is by itself no fault: an issue past its review — in `accepting`,
|
|
26
26
|
`retro` or `merging` — a root waiting in the line, a started issue that waits on another issue
|
|
27
27
|
(but for the roots [the rule](https://cybermonklabs.github.io/legion/legion/concepts/#admission-and-the-legion-label) names, which keep theirs)
|
|
28
|
-
and a child
|
|
28
|
+
and a child that no architect has released yet hold none while their tree runs. The wake is live
|
|
29
29
|
only, so a controller that starts later finds such a root by the last row, as its start procedure
|
|
30
30
|
does.
|
|
31
31
|
|
|
@@ -53,11 +53,11 @@ for them, except where the row's last column names an act of yours.
|
|
|
53
53
|
| `tree_closed` | The daemon's record of the issue's tree root says `done`, or that root's linger is still running after it left the workflow. `heldBy` names that root | An architect's `release_children` of the live tree whose Dispatch parent the issue reaches: the daemon records it in that tree with its repository kept and its generation raised by one, at `admitted` when it is `todo` and in any other status as a parked child at `done`, which a `todo` runs again. The row alone does not say whether that release would be accepted, and three kinds of issue read this word that no release takes: a member of a tree still in its linger, and a member of a parked tree, whose park starts a linger of its own, both refused while that linger runs; and a member past `admitted`, refused `CHILD_IN_OTHER_TREE`. A member of a closed tree that holds an admission slot stands in `admission.active` and has no held row: a release of one past `admitted`, the usual member at work, is refused `CHILD_IN_OTHER_TREE`, and of one at `admitted`, `CHILD_IN_OTHER_TREE` while its root's linger runs and `CHILD_NOT_ADOPTABLE` once that linger has ended |
|
|
54
54
|
| `tree_parked` | The issue's tree root left the workflow to `backlog` or `icebox`, because that tree was parked (by a person, or by your own hold), and that root's linger has run out. While it still runs the member reads `tree_closed` instead. `heldBy` names that root | A `todo` on the root, which re-admits the tree, and nothing else: no release takes such a member. Where the park is your own hold, the parked-root walk decides it (`skill://legion-controller/references/parked-decisions.md`) |
|
|
55
55
|
| `label_off` | The issue is a root the admission queue does not carry, because the record says the `legion` label is off. A person took it out of Legion | A person's label. Take no issue back yourself: the intake rule in your deployment instructions keeps such a root out |
|
|
56
|
-
| `ancestry` | The root's Dispatch chain reaches another live root, so the issue is that tree's unreleased work. `heldBy` names the live roots on that chain |
|
|
56
|
+
| `ancestry` | The root's Dispatch chain reaches another live root, so the issue is that tree's unreleased work. `heldBy` names the live roots on that chain | An architect of that tree releasing the issue, or releasing the parent above it; or every live root leaving that chain, after which it queues as a root of its own |
|
|
57
57
|
| `root_awaiting_person` | The issue's tree root has handed work to a person, a question or its spec, and has not resumed yet, whether or not the person has answered, so the daemon starts no issue of the tree. `heldBy` names that root | The root's resume, which the person's answer or review brings: the daemon then resumes the root's architect |
|
|
58
58
|
| `design_gate` | The design gate of the issue's tree root is not open at every step the deployment gates. `heldBy` names that root | A person's approval of each gated step's document at its current version |
|
|
59
|
-
| `dispatch_blocker` | A Dispatch `blocked_by` link of the issue names an issue that is not `done`, and holds the issue where it stands. `heldBy` names the unfinished blockers | Each blocker reaching `done` (a person's close, or the blocker's own merge), or the link taken off by a person or by the tree
|
|
60
|
-
| `children_first` | Dispatch shows an open child under the issue, so its own first phase waits for the children. `heldBy` names the open children | The last open child leaving the workflow, which is the
|
|
59
|
+
| `dispatch_blocker` | A Dispatch `blocked_by` link of the issue names an issue that is not `done`, and holds the issue where it stands. `heldBy` names the unfinished blockers | Each blocker reaching `done` (a person's close, or the blocker's own merge), or the link taken off by a person or by an architect of the tree. The issue is in `admission.blocked` as well |
|
|
60
|
+
| `children_first` | Dispatch shows an open child under the issue, so its own first phase waits for the children. `heldBy` names the open children | The last open child leaving the workflow, which is the work of the architect that owns the issue. The issue is in `admission.blocked` as well |
|
|
61
61
|
| `accepted_ancestor` | The daemon has accepted the reviewed head of an issue above this one, so nothing of its own work starts before that ancestor closes. `heldBy` names that ancestor | The ancestor's close, which the merge of its pull request writes |
|
|
62
62
|
| `at_work` | An issue past its review — in `accepting`, `retro` or `merging`, and not `held` — which keeps no admission slot, and of which no word above is true (`record.HeldAtWork`). Where its tree runs, its workers run on no slot. An issue held from one of those phases reads `unclassified` instead, since its hold stopped its work | Its own work: its sign-off, retro and merge end it, and work its architect sends back to `implementing` takes a slot again. No `heldBy`: no other issue holds it |
|
|
63
63
|
| `unclassified` | No word above is true of the issue. The daemon logs it once for that issue and run | Nothing of yours. Name it in the day's report with its `phase` and `status`, so a person can read what the daemon could not say |
|
|
@@ -69,8 +69,8 @@ every issue by its `dispatch://` link and what it does for the reader, every pul
|
|
|
69
69
|
- **Waiting on Dispatch links.** Each root and child in `admission.blocked`, with what it waits
|
|
70
70
|
on: the issues of its `blocked_by` links, or the open children children-first holds it for. A
|
|
71
71
|
link's wait ends when each blocker reaches `done` (a person's close, or the blocker's own
|
|
72
|
-
merge) or its link is taken off (by a person or the tree
|
|
73
|
-
ends when the last open child leaves the workflow, so take nothing for them.
|
|
72
|
+
merge) or its link is taken off (by a person or an architect of the tree), and a children-first
|
|
73
|
+
wait ends when the last open child leaves the workflow, so take nothing for them.
|
|
74
74
|
Of the issues here, say of each whose `issues.<KEY>.waitingLine.kind` is `waiting_on_issue`
|
|
75
75
|
that it holds no admission slot while it waits,
|
|
76
76
|
that nothing of its work has stopped,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# Architect escalation
|
|
2
2
|
|
|
3
|
-
Read this when a tree
|
|
3
|
+
Read this when an architect of a tree sends you a matter, when a `held` wake carries
|
|
4
4
|
`reason: "escalated"`, or when an `update-stalled` wake says the daemon cannot replace an issue's
|
|
5
5
|
pod. Three matters come to you from an architect: a child that looks independent of its tree,
|
|
6
6
|
capacity (an architect says its tree cannot run what it needs under the slots it has), and a
|
|
7
|
-
conflict between trees. An issue-design decision is not one of them:
|
|
8
|
-
it as a decision block and opens its own finding asks
|
|
9
|
-
architect
|
|
7
|
+
conflict between trees. An issue-design decision is not one of them: a root's architect writes
|
|
8
|
+
it as a decision block and opens its own finding asks, and a child's own architect sends it to
|
|
9
|
+
the architect above it, so that the root's architect asks it on the root. Send a design decision
|
|
10
|
+
back to the architect that sent it with `envoy_publish` to its role, because it is not yours to
|
|
11
|
+
make.
|
|
10
12
|
|
|
11
13
|
For capacity, the only lever is order. You cannot change `admission.cap`: it is the operator's
|
|
12
14
|
`legion.yaml` setting, and `set_status` is your only admission move. The cap counts the issues the
|
|
@@ -17,7 +19,8 @@ where its tree's issues stand in the line with `envoy_publish`, and
|
|
|
17
19
|
open a finding ask when the deployment needs a larger cap.
|
|
18
20
|
|
|
19
21
|
For a conflict between trees, read both roots in `read_state` and Dispatch, publish what you read
|
|
20
|
-
to
|
|
22
|
+
to the architect that sent the matter and to the architect that owns the other tree's issue, and
|
|
23
|
+
open a finding ask when the two need a person's decision.
|
|
21
24
|
|
|
22
25
|
## An escalated hold
|
|
23
26
|
|
|
@@ -100,9 +103,11 @@ round's message states (`reasons`), the one line that says what holds the round
|
|
|
100
103
|
every claim the round asked (`waiting`, each with its `claim` token, `role`, `state` and
|
|
101
104
|
`answered`). Past the bound no answer holds the round, so `answered` tells you what each role
|
|
102
105
|
said, not whom to prompt. A `failed` claim is never in a pod round's `waiting`: it runs no turn
|
|
103
|
-
on the pod, so the round does not wait for it.
|
|
104
|
-
|
|
105
|
-
([An escalated hold](#an-escalated-hold)). A
|
|
106
|
+
on the pod, so the round does not wait for it. A failed phase worker's retry is its architect's
|
|
107
|
+
or the operator's, and yours once the architect escalates the hold
|
|
108
|
+
([An escalated hold](#an-escalated-hold)). A failed root architect's retry is the operator's, or
|
|
109
|
+
your restart of its tree after its `worker-died`. A failed child's own architect starts again at
|
|
110
|
+
its child's next phase start, or on the operator's retry. A retried claim is asked like any other.
|
|
106
111
|
|
|
107
112
|
Before it replaces the pod, the daemon reads nothing of the pod's disk. A role's own push is
|
|
108
113
|
what keeps its work: work a role did not push before the pod goes, a failed claim's included,
|
|
@@ -149,13 +149,16 @@ architect for it, whatever it asks. For a person's mention, take the first of th
|
|
|
149
149
|
person's request says to wait or puts it out of scope. That request is the request itself, the
|
|
150
150
|
deployment instructions, or a line of the weekly plan that names the person's request behind it.
|
|
151
151
|
- **Something an issue's architect owns.** A question about a tree's design, a change of direction,
|
|
152
|
-
a decision only
|
|
153
|
-
`Links:` up through each `child_of` parent with `dispatch read` until you reach
|
|
154
|
-
`read_state` records
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
152
|
+
a decision only an architect of its tree can make about an issue Legion runs. Find the issue:
|
|
153
|
+
follow `Links:` up through each `child_of` parent with `dispatch read` until you reach an issue
|
|
154
|
+
`read_state` records, `<KEY>`. Its `issues.<KEY>.tree` is `<ROOT>`, the tree's root. Send it to
|
|
155
|
+
the nearest architect that runs on the chain from `<KEY>` up to `<ROOT>`: the first issue of
|
|
156
|
+
that chain, from `<KEY>` up, whose `issues.<ISSUE>.architect.locator.claim` is there.
|
|
157
|
+
`envoy_publish` the person's words to `notifications.role.` followed by that claim, with the
|
|
158
|
+
channel id and `thread_ts` you reply on, and reply in the thread that you passed it to that
|
|
159
|
+
architect, which answers on the issue. When no issue of that chain has a locator, no architect
|
|
160
|
+
of it is running: say that in the thread instead and what `read_state` shows for the tree. Never
|
|
161
|
+
invent a role token.
|
|
159
162
|
- **Anything else** (a greeting, a question about Legion itself): answer it briefly in the thread.
|
|
160
163
|
|
|
161
164
|
A request to approve a design is answered as `skill://legion-controller/references/wakes.md`
|
|
@@ -102,5 +102,6 @@ Filing or admitting an issue, name each priority it advances (`--advance <id>` o
|
|
|
102
102
|
`dispatch priorities` lists the ids, and names each issue in flight that advances no priority.
|
|
103
103
|
|
|
104
104
|
Taking the label off a waiting root drops it from the waiting line; taking it off an admitted tree
|
|
105
|
-
does not stop it. A child needs no label: it runs
|
|
106
|
-
|
|
105
|
+
does not stop it. A child needs no label: it runs in its tree once its root is admitted, and under
|
|
106
|
+
its own architect once its first phase starts. A child outside a live tree is admitted as a root
|
|
107
|
+
of its own and needs the label.
|
|
@@ -55,8 +55,8 @@ slot back for that wait, each with what it waits on — the unfinished Dispatch
|
|
|
55
55
|
for a parent, the open children beneath it that children-first holds it for. `read_state` shows the
|
|
56
56
|
same list under `admission.blocked`, and `legion state` prints it as `blocked on Dispatch links:`.
|
|
57
57
|
A link's wait ends when each blocker reaches `done` (a person's close, or the blocker's own merge) or its
|
|
58
|
-
link is taken off (by a person or the tree
|
|
59
|
-
last open child leaves the workflow: name the waits in the day's report and
|
|
58
|
+
link is taken off (by a person or an architect of the tree), and a children-first wait ends when
|
|
59
|
+
the last open child leaves the workflow: name the waits in the day's report and
|
|
60
60
|
take nothing for them.
|
|
61
61
|
|
|
62
62
|
`held`, when present, is `[{issue, reason, heldBy?}, …]`: every issue the daemon's record holds
|
|
@@ -92,13 +92,16 @@ handler refuses a fact of another generation.
|
|
|
92
92
|
So read the issue's record for every entry rather than taking its architect as told:
|
|
93
93
|
`read_state`'s `issues.<KEY>` gives its phase and each role's claim, and says whether the worker
|
|
94
94
|
has moved since the tick was queued.
|
|
95
|
-
Where the architect
|
|
96
|
-
reaches nobody and the work stands still.
|
|
95
|
+
Where the architect that owns that issue is itself a claim that is not answering, a notice sent to
|
|
96
|
+
it reaches nobody and the work stands still. That architect is the issue's own while its claim
|
|
97
|
+
holds its role, else the nearest one above it whose claim holds its role, else the root's. A
|
|
98
|
+
failed claim holds no role, so a notice passes over a failed architect of a child and goes on up
|
|
99
|
+
the tree. When the tree's architect claim reads `failed`
|
|
97
100
|
(`issues.<ROOT>.architect.state`, `<ROOT>` being the silent issue's `tree`), act as the
|
|
98
101
|
`worker-died` section below says, with `<ROOT>` as its `<KEY>`: restart the tree when you find no
|
|
99
102
|
cause or its cause is gone, and otherwise ask the person whether to park it, with no relaunch
|
|
100
|
-
while the cause stays. When
|
|
101
|
-
session gone, `fresh_session` on that architect.
|
|
103
|
+
while the cause stays. When the claim of the architect that owns the issue does not read `failed`
|
|
104
|
+
and the Envoy registry shows its session gone, `fresh_session` on that architect.
|
|
102
105
|
Name each silent issue in the day's report, with its role and the length of its silence.
|
|
103
106
|
|
|
104
107
|
## `unslotted on <KEY>` (`{kind: "unslotted", reason}`)
|
|
@@ -183,7 +186,7 @@ A root whose own architect is not taking the work the daemon states it is owed.
|
|
|
183
186
|
|
|
184
187
|
- "the architect's claim cannot be reached": the claim is failed or retired and no start of the root's run is the daemon's next move for it, or the root has no architect claim at all, no start of one was queued in the last ten minutes, and the work of its entry has stood that same bound.
|
|
185
188
|
A start the outbox is running is that next move, and so is a start queued in the last ten minutes unless it has already run against the claim and left it failed or retired.
|
|
186
|
-
While such a start will relaunch a failed or retired claim, the daemon raises no such wake, because that start
|
|
189
|
+
While such a start will relaunch a failed or retired claim, the daemon raises no such wake, because that start brings the claim back, in the session it kept, or in a new one once supervise's `forgetSession` has dropped that.
|
|
187
190
|
The claim reads failed or retired while the outbox runs that start, until the run relaunches it.
|
|
188
191
|
A start that has run against the claim and left it failed or retired, which the daemon retries on its backoff, does not hold the wake back, and neither does one that has stood owed for longer than ten minutes.
|
|
189
192
|
A root waiting on a person raises it as any root does, and its reason then says that the root waits: the daemon queues the next start of its architect only when that wait is answered.
|
|
@@ -223,7 +226,7 @@ For the second arm, read the root's architect claim in `read_state` too.
|
|
|
223
226
|
A `failed` or `retired` claim this wake names has no start that will relaunch it: no start of its run was queued in the last ten minutes, or the one the queue holds has run against it and left it as it is, which the daemon retries on its backoff.
|
|
224
227
|
It takes nothing the daemon sends.
|
|
225
228
|
`fresh_session` on it, with the root's key as the issue and `architect` as the role, starts it again.
|
|
226
|
-
When the reason says the root waits on a person, take no `fresh_session` while it waits, since the start the answer queues relaunches the session the claim kept, and `fresh_session` would discard
|
|
229
|
+
When the reason says the root waits on a person, take no `fresh_session` while it waits, since the start the answer queues relaunches the session the claim kept, or a new one once supervise's `forgetSession` has dropped that, and `fresh_session` would discard the kept one.
|
|
227
230
|
Name that root in the day's report with what it waits on (`issues.<KEY>.waitingOn`: the ask, or the version of its gate), so a person knows the tree has no architect that can run until they answer.
|
|
228
231
|
That wake is the arm's one wake of the root's run: the daemon marks the arm told for the run, and the answer starts no new run, so it does not tell you again when the wait is answered or when the start the answer queues fails against the claim.
|
|
229
232
|
So at each `tick` after `issues.<KEY>.waitingOn` is gone, read `issues.<KEY>.architectStalls`, which lists an arm whether or not you were told of it, and when it lists `claim-unreachable`, take `fresh_session` on that claim as for any other claim of this arm.
|
|
@@ -235,16 +238,18 @@ For the third, decide what the time means — a tree whose spec is long is worki
|
|
|
235
238
|
|
|
236
239
|
## `parked-decision on <KEY>` (`{kind: "parked-decision", decision, root, ref, actor, version?, reason?}`)
|
|
237
240
|
|
|
238
|
-
A person's
|
|
239
|
-
running,
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
A person's decision that nobody inside its tree heard: a spec decision on a tree Legion is not
|
|
242
|
+
running, or on a tree whose root architect's claim has failed, retired or is not supervised, or an
|
|
243
|
+
answer, resolution or reply on an ask of a tree Legion is not running. The payload names the
|
|
244
|
+
decision, the tree's `root`, the decision's Dispatch `ref`, the person (`actor`), and a spec
|
|
245
|
+
decision's `version` and a changes request's `reason`. Decide it as
|
|
246
|
+
`skill://legion-controller/references/parked-decisions.md#deciding` says.
|
|
243
247
|
|
|
244
248
|
## `held on <KEY>` (`{kind: "held", phase, role?, reason?, failure?, escalation?}`)
|
|
245
249
|
|
|
246
250
|
Check that the issue's `phase` is `held`. Without `reason`, a phase worker's launches or prompts
|
|
247
|
-
ran out, and the
|
|
251
|
+
ran out, and the architect that owns the issue (a child's own architect while it holds its role)
|
|
252
|
+
decides whether to retry or escalate: do nothing. With
|
|
248
253
|
`reason: "escalated"` (`issues.<KEY>.holdReason` is `escalated`), the architect handed it to you:
|
|
249
254
|
handle it as an escalation (`skill://legion-controller/references/escalation.md`). A held issue
|
|
250
255
|
whose tree lingers (the time after its root closes when a reopen resumes it) or is closed waits
|
|
@@ -412,16 +417,21 @@ escalated hold above says.
|
|
|
412
417
|
|
|
413
418
|
## `worker-died on <KEY>` (`role: "architect"`)
|
|
414
419
|
|
|
415
|
-
The
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
the
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
420
|
+
The root's architect ran out of launches or prompts, and the daemon relaunches nothing. This wake
|
|
421
|
+
comes for a root's architect alone: when a child's own architect fails, the daemon tells the
|
|
422
|
+
architect above that child, and the child's next phase start starts it again. A child's own
|
|
423
|
+
architect that holds its role still takes the notices of its child and of the issues under it,
|
|
424
|
+
but for the child's own `child-status` and `child-closed` and a `worker-died` or `worker-stalled`
|
|
425
|
+
of that architect. Every other notice of the tree goes to the failed architect, so nobody inside
|
|
426
|
+
the tree can act on those. Check that `issues.<KEY>.architect.state` is `failed`. When the root's
|
|
427
|
+
`phase` is `done`, the tree is already parked: do nothing (a failed architect reads `failed` until
|
|
428
|
+
the tree closes). Otherwise look for the cause. `issues.<KEY>.architect.failure` holds the record
|
|
429
|
+
the `held` wake above describes. Read after it an open `capabilities` row whose `detail` names the
|
|
430
|
+
architect's session, or the architect's last message on the root issue. When you find none, or it
|
|
431
|
+
is gone, restart the tree (`set_status` the root to `backlog`, then, in the same turn, to `todo`:
|
|
432
|
+
a new generation whose architect starts with fresh budgets). That pair is a restart and not a park:
|
|
433
|
+
the daemon re-admits only a root whose tree lingers or is done, so the `backlog` write is how a
|
|
434
|
+
restart reaches `todo`.
|
|
425
435
|
When the cause stays, the tree stays admitted and keeps working ([Admission and the `legion` label](https://cybermonklabs.github.io/legion/legion/concepts/#admission-and-the-legion-label)), because a relaunch would fail
|
|
426
436
|
the same way. Ask the person whether to park it, as
|
|
427
437
|
[Ask whether to park a tree](#ask-whether-to-park-a-tree) says, with the architect's cause as
|
|
@@ -448,8 +458,9 @@ before it.
|
|
|
448
458
|
The daemon's stall backstop acted on a stalled turn of the tree's architect: its agent had not
|
|
449
459
|
stepped for longer than the `worker_stall_backstop_hours` the deployment gives that role, and most
|
|
450
460
|
often the daemon ended the turn and brought the same session back on a new process. You get a copy
|
|
451
|
-
only for a tree's own architect, because
|
|
452
|
-
|
|
461
|
+
only for a tree's own architect, because no architect stands above it to read this one, and that
|
|
462
|
+
architect is told on its issue as well. A stall of a child's own architect goes to the architect
|
|
463
|
+
above that child. The
|
|
453
464
|
`reason` is the record the daemon read: when the agent last stepped and how long ago that was, the
|
|
454
465
|
bound it passed, when the turn began, and the last call the daemon saw, with its tool, its call
|
|
455
466
|
id, when it started and whether it ended — never a call's arguments, whose text the daemon keeps
|
|
@@ -513,8 +524,9 @@ Read the role's claim in `read_state`. Name the run and its model in the day's r
|
|
|
513
524
|
reason names no status, the turns ended on nothing but a message, which is what a content filter
|
|
514
525
|
leaves: the session has already stepped down its model chain, so a run that long says the whole
|
|
515
526
|
chain refuses the same work. Either way, `envoy_publish` the key, the role and the reason to the
|
|
516
|
-
issue
|
|
517
|
-
the
|
|
527
|
+
architect that owns the issue, which is who can narrow the work. When the stuck role is a child's
|
|
528
|
+
own architect, send them to the architect above that child. Re-admit nothing and park nothing,
|
|
529
|
+
because the task is not lost and the session still runs.
|
|
518
530
|
|
|
519
531
|
One claim that stays stuck after that is yours to act on, and which door you use depends on what
|
|
520
532
|
the claim is doing. `compact` is the first thing for a claim whose session the provider keeps
|
|
@@ -527,19 +539,22 @@ one held — what the worker learned of its issue, and what it had not yet pushe
|
|
|
527
539
|
and cures nothing in a provider outage, where the next session's turns are refused as the last
|
|
528
540
|
one's were.
|
|
529
541
|
|
|
530
|
-
`compact` is the wrong door for a claim no process stands behind, which is a role that died:
|
|
531
|
-
refuses such a claim `CLAIM_NOT_RUNNING` and names `fresh_session`, because it has no agent
|
|
532
|
-
ask. Ask for `fresh_session` there.
|
|
533
|
-
your project included: it suspends the claim where your request arrives,
|
|
534
|
-
claim recorded behind, and starts the claim again with the task its dead
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
542
|
+
`compact` is the wrong door for a claim no process stands behind, which is a role that died:
|
|
543
|
+
it refuses such a claim `CLAIM_NOT_RUNNING` and names `fresh_session`, because it has no agent
|
|
544
|
+
to ask. Ask for `fresh_session` there. Of your two doors, it is the one that brings back a dead
|
|
545
|
+
role, a dead architect of your project included: it suspends the claim where your request arrives,
|
|
546
|
+
leaves the session that claim recorded behind, and starts the claim again with the task its dead
|
|
547
|
+
turn held. When a child's own architect's claim has failed, the daemon also starts it again at
|
|
548
|
+
its child's next phase start. That start relaunches the session the claim recorded, or a new one
|
|
549
|
+
once supervise's `forgetSession` has dropped it. Both doors read
|
|
550
|
+
the claim's process at the moment you ask, not the daemon's memory of an older report, which a
|
|
551
|
+
daemon restart forgets. A refusal of `CLAIM_IN_A_TURN`
|
|
552
|
+
is a claim whose process that read found running, or one whose session is being compacted. A
|
|
553
|
+
claim whose process the runtime would not answer for, one that records no process to read, and
|
|
554
|
+
one that moved under your request and that a second read finds no longer working or gone once more
|
|
555
|
+
are refused `CLAIM_UNSETTLED`, each left exactly as your request found it, so ask again once the
|
|
556
|
+
runtime answers; a claim that moved is otherwise answered as that second read finds it. A claim
|
|
557
|
+
under a relaunch the wake pacing parks is refused `CLAIM_UNSETTLED` too.
|
|
543
558
|
|
|
544
559
|
## GitHub mentions
|
|
545
560
|
|