@sjawhar/claude-envoy 6.7.0 → 6.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/.omp-plugin/plugin.json +1 -1
- package/dist/codex-hook.js +42 -16
- package/dist/dispatch.js +42 -16
- package/dist/envoy-channel.js +81 -20
- package/dist/session-hook.js +42 -16
- package/legion/skills/legion-architect/SKILL.md +10 -6
- package/legion/skills/legion-architect/references/acceptance-steps.md +13 -0
- package/legion/skills/legion-architect/references/acceptance.md +7 -2
- package/legion/skills/legion-architect/references/decomposition.md +3 -3
- package/legion/skills/legion-architect/references/operations.md +57 -0
- package/legion/skills/legion-architect/references/wake-routing-steps.md +18 -0
- package/legion/skills/legion-architect/references/wake-routing.md +23 -20
- package/legion/skills/legion-controller/SKILL.md +23 -28
- package/legion/skills/legion-controller/references/admission.md +25 -6
- package/legion/skills/legion-controller/references/backlog-stewardship.md +17 -4
- package/legion/skills/legion-controller/references/consolidation.md +3 -3
- package/legion/skills/legion-controller/references/daily-report.md +12 -7
- package/legion/skills/legion-controller/references/escalation.md +10 -6
- package/legion/skills/legion-controller/references/finding-asks-steps.md +19 -0
- package/legion/skills/legion-controller/references/finding-asks.md +13 -19
- package/legion/skills/legion-controller/references/merge-holds.md +49 -0
- package/legion/skills/legion-controller/references/operations-steps.md +46 -0
- package/legion/skills/legion-controller/references/operations.md +75 -0
- package/legion/skills/legion-controller/references/parked-decisions.md +1 -1
- package/legion/skills/legion-controller/references/session.md +11 -6
- package/legion/skills/legion-controller/references/slack-mentions.md +4 -4
- package/legion/skills/legion-controller/references/triage.md +1 -1
- package/legion/skills/legion-controller/references/wakes.md +24 -14
- package/legion/skills/legion-controller/references/weekly-audit.md +1 -1
- package/legion/skills/legion-oracle/SKILL.md +6 -0
- package/legion/skills/legion-worker/SKILL.md +17 -22
- package/legion/skills/legion-worker/references/conflicts-and-rewrites.md +2 -2
- package/legion/skills/legion-worker/references/findings-steps.md +31 -0
- package/legion/skills/legion-worker/references/findings.md +21 -22
- package/legion/skills/legion-worker/references/stop-rules.md +15 -0
- package/legion/skills/legion-worker/references/tools-steps.md +11 -0
- package/legion/skills/legion-worker/references/tools.md +3 -3
- package/package.json +2 -2
- package/skills/dispatch/SKILL.md +1 -1
- package/src/legion-phase-hook.ts +13 -12
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# The operations of your tree's work
|
|
2
|
+
|
|
3
|
+
Read this on a `provider-errors` wake, when an agent of your tree needs an action or another role writes you a clear defect, and before you re-run a CI run of your tree, enqueue a pull request of your tree that no merger merges, or make a GitHub write your `gh` cannot make. The re-run, the enqueue and the write are yours: ask no other session, the controller included, to make them. An action on an agent is the controller's alone.
|
|
4
|
+
|
|
5
|
+
## An agent of your tree that needs an action
|
|
6
|
+
|
|
7
|
+
The actions on an agent (stop, retry, suspend, resume the agent, compact, and start it in a fresh session) are the project's controller's alone: your `legion` tool refuses each in an architect session, and the daemon refuses any grant but the controller's with `403 CONTROLLER_REQUIRED`. Your `retry_or_escalate` of a held phase stays yours (the `worker-died` row of `skill://legion-architect/references/wake-routing.md`), and so does `stop_task`: a tree operation that stops a task of an issue's plan, whose step the daemon suspends, and never a way to stop a named agent.
|
|
8
|
+
|
|
9
|
+
When an agent of your tree needs an action, ask the controller with a `dispatch comment` on that agent's issue, `<KEY>`, that mentions the controller's role. `<project>` is the word after `legion-` in your role token. Name the agent by its issue and role, the action in plain words, and why, with what you observed:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
dispatch comment --issue '<KEY>' --mention 'role:legion-<project>-controller' --body-file - <<'EOF'
|
|
13
|
+
Action on an agent
|
|
14
|
+
<KEY> <role>: <the action: stop, retry, suspend, resume the agent, compact, or start it in a fresh session>, because <what you observed, with the numbers and when>
|
|
15
|
+
EOF
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
- Take no action on the agent yourself, and send the controller no `envoy_publish` for it: Dispatch delivers the mention and retries it.
|
|
19
|
+
- The controller replies under your comment with what it ran and the daemon's answer, or why it ran nothing. Wait for nothing: the rest of your tree's work goes on.
|
|
20
|
+
- `provider-errors`: six turns of the agent in a row ended in a provider error, and the daemon keeps the task. The daemon tells the controller too, which compacts the agent or starts it in a fresh session: ask it for nothing. For a rate limit or an overload, do nothing. For a refusal of the content, ask the worker which step its turns end on and narrow that step, or move the issue back with `request_backward_move`.
|
|
21
|
+
- An agent that the operator or the controller suspended starts again only when one of them resumes the agent: the operator's resume lifts either suspension, and the controller's resume of the agent only its own. Ask the operator with a `dispatch ask` on the root, and the controller with a comment as above.
|
|
22
|
+
- While the project is paused, the daemon refuses every action that would start a turn of an agent: a retry, a resume of the agent, a compaction and a fresh session. Ask for none of them until the project's resume, which alone lifts the pause, and ask nobody to resume the project.
|
|
23
|
+
|
|
24
|
+
## A clear defect another role writes to you
|
|
25
|
+
|
|
26
|
+
A clear defect another role writes to you comes as a Dispatch comment that mentions your role, its first line `Clear defect from <role>` (`skill://legion-architect/SKILL.md`, "Escalation judgment").
|
|
27
|
+
Carry it in this tree: in an open pull request, or in a child.
|
|
28
|
+
Reply under its evidence comment with the issue that carries it.
|
|
29
|
+
It changes the root spec only where it changes the Summary, a requirement, a check or the scope (`skill://legion-architect/references/design-gate.md`, "After approval").
|
|
30
|
+
|
|
31
|
+
## The token the secrets broker lends
|
|
32
|
+
|
|
33
|
+
The implement App token the secrets broker lends (`skill://agent-secrets`) takes three GitHub writes of your tree's work: a re-run of your tree's CI run, the enqueue, arming, dequeue or disarming of a pull request no merger merges, and a comment on a pull request your `gh` does not reach. Any other write your `gh` cannot make is a finding (`skill://legion-worker/references/findings.md`). Take it narrowed to the one repository, and call `curl`, never `gh`:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
agent-secrets LEGION_IMPLEMENT_APP --reason '<KEY>: <the write, and why>' --github-owner <owner> --github-repo <repo> --github-token -- sh -c 'printf "Authorization: Bearer %s\n" "$LEGION_IMPLEMENT_APP" | curl -fsS -X POST -H @- --data-binary "$1" <url>' sh '<the JSON body>'
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
- Keep the call in single quotes and give `curl` the header on standard input, so the token is in no command's arguments. Never print the token.
|
|
40
|
+
- Name in `--reason` the write, why you make it, and your issue's key.
|
|
41
|
+
- Exit 77 with no `agent-secrets:` grant line is a denial, and exit 22 is GitHub's refusal, whose status curl prints. A denial and a 4xx are final: ask no other session to make the write. After a 5xx, make it once more at a later wake. Name a denial, a 4xx or a second failure in your summary.
|
|
42
|
+
|
|
43
|
+
## A pull request no merger merges
|
|
44
|
+
|
|
45
|
+
An issue's merger merges the pull request its issue records, and no other. Enqueue a pull request of your tree only when its head branch is your tree's (`<root key, lower case>/…`, or `legion/<KEY>` of an issue of your tree), no issue's `read_record` names it as `pullRequest`, and a review approves its head. The controller holds no enqueue: it writes its own request, or a person's in the person's words, to you by a mention.
|
|
46
|
+
|
|
47
|
+
1. `gh pr view <n> -R <owner>/<repo> --json id,title,state,headRefName,headRefOid,autoMergeRequest`. `headRefOid` is `<head sha>`. A `state` other than `OPEN` ends the procedure. A non-null `autoMergeRequest` was armed at a head you did not read: turn it off (step 7), then begin again.
|
|
48
|
+
2. `gh api --paginate repos/<owner>/<repo>/pulls/<n>/reviews`: the head is approved when an `APPROVED` review's Legion footer names `<head sha>`, or, with no footer, its `commit_id` does (`skill://legion-worker/references/merge-gate.md`). Else enqueue nothing.
|
|
49
|
+
3. Read the merge holds as `skill://legion-architect/references/acceptance.md#a-merge-hold` says. A line that holds `<owner>/<repo>`, or a failed read, means enqueue nothing: name it in your summary, and read the document again on each wake before you enqueue.
|
|
50
|
+
4. Read the base's rules (`gh api --paginate repos/<owner>/<repo>/rules/branches/<base>`) and `squash_merge_commit_message` (`gh api repos/<owner>/<repo>`). On a `merge_queue` base whose setting is `COMMIT_MESSAGES`, enqueue nothing and open a `dispatch ask` on your root: only a person changes the setting.
|
|
51
|
+
5. On a merge-queue base, post `enqueuePullRequest(input:{pullRequestId, expectedHeadOid: <head sha>})` to `https://api.github.com/graphql` with the token. On any other base, post `enablePullRequestAutoMerge` at that head with `mergeMethod: SQUASH`, `commitHeadline: "<title> (#<n>)"` and an empty `commitBody`. `curl` exits 0 on a refusal too: an `errors` array is GitHub's refusal. A refusal for a repository setting or an App permission is a `dispatch ask` on your root.
|
|
52
|
+
6. Read the pull request again (`headRefOid`, `mergeQueueEntry`, `autoMergeRequest`), and again on each later wake while it is open.
|
|
53
|
+
7. When the head moved after step 5, no review approved it: post `dequeuePullRequest` or `disablePullRequestAutoMerge` at once, then begin again at step 1.
|
|
54
|
+
|
|
55
|
+
## A re-run of your tree's CI run
|
|
56
|
+
|
|
57
|
+
A run on the head of a pull request of your tree is yours to re-run. Use the rules and reads of `skill://legion-controller/references/operations.md#a-re-run-of-a-ci-run`, with the token as above, for your own tree's runs alone. The re-run call's exit 22 is GitHub's refusal, whose status curl prints. A 4xx, such as a run that cannot be re-run, is final. After a 5xx, re-run once more at a later wake, and never otherwise. Name a denial, a 4xx or a second failure in your summary.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# The steps of a wake's routing
|
|
2
|
+
|
|
3
|
+
Read this when `skill://legion-architect/references/wake-routing.md` sends you here; its table names the wake each section here answers.
|
|
4
|
+
|
|
5
|
+
## A lost session
|
|
6
|
+
|
|
7
|
+
On `session-lost` or `session-forgotten`, check the fresh agent's account of the work against the record, then send it with `envoy_publish` each decision it can no longer read.
|
|
8
|
+
Your own lost session: read your record and your tree's issues first.
|
|
9
|
+
|
|
10
|
+
## A full issue volume
|
|
11
|
+
|
|
12
|
+
On `volume-near-full`, sort the bytes by where they are:
|
|
13
|
+
|
|
14
|
+
- Mostly cold bytes in `scratch/tmp` or a workspace: ask the pod's roles on their topics to delete by exact path what they made and no longer need.
|
|
15
|
+
|
|
16
|
+
- Bytes warm across the clone, workspaces and caches: open a finding ask with the sizes, since `issue_volume` is the operator's.
|
|
17
|
+
|
|
18
|
+
- Carry a trimmer that switched itself off as `skill://legion-worker/references/findings.md` says.
|
|
@@ -1,39 +1,42 @@
|
|
|
1
1
|
# Wake routing
|
|
2
2
|
|
|
3
3
|
Read this when a wake reaches you.
|
|
4
|
-
A wake about an issue reaches its own architect while
|
|
5
|
-
A `child-status` or `child-closed`, and a `worker-died` or `worker-stalled` about a child's own architect, reach the architect above the child.
|
|
6
|
-
Your
|
|
4
|
+
A wake about an issue reaches its own architect while it holds its role, else the nearest one above that does.
|
|
5
|
+
A `child-status` or `child-closed`, and a `worker-died` or `worker-stalled` about a child's own architect, reach the architect above the child. A root architect's own stall takes the same two finding asks as a child's own architect's (`worker-stalled`).
|
|
6
|
+
Your prompt or its row describes each notice. When a wake leaves an issue in `accepting` waiting on no child, run its last round.
|
|
7
7
|
"Section N" is that section of `skill://legion-architect`.
|
|
8
|
-
Where a row says to ask a person, a child's own architect
|
|
8
|
+
Where a row says to ask a person, a child's own architect asks the architect above it.
|
|
9
9
|
|
|
10
10
|
| Wake | What to do |
|
|
11
11
|
| --- | --- |
|
|
12
12
|
| `catch-up` | Start or resume from it as your role prompt says. Accept each issue its `reason` names as waiting for you (section 6), a parent only after its last round. |
|
|
13
13
|
| `design-approved` | One gated step opened; `gatedSteps` in `read_record` says which. Once every step is `approved`, release the children (section 2). A task saying "this resume is your design-approved wake" is this wake. On a `handed_over` root, or a version a person's answer to a decision block wrote, start nothing. |
|
|
14
|
-
| `design-changes-requested` | Revise the document of the step whose `status` is `changes_requested` as the reason asks, then request approval again ("The armed gate" in `skill://legion-architect/references/design-gate.md`) and end your turn.
|
|
15
|
-
| `carried-gate-opened` | Start
|
|
16
|
-
| `phase-finished` | The next phase started, or `retro-held` came too. Read `dispatch results`, the pull request and its review
|
|
14
|
+
| `design-changes-requested` | Revise the document of the step whose `status` is `changes_requested` as the reason asks, then request approval again ("The armed gate" in `skill://legion-architect/references/design-gate.md`) and end your turn. A late one for an older version: answer its reason if the latest does not. |
|
|
15
|
+
| `carried-gate-opened` | Start and release nothing. |
|
|
16
|
+
| `phase-finished` | The next phase started, or `retro-held` came too. Read `dispatch results`, the pull request and its review; tell the working role of any gap. A departure in `plan.md` under `## Departures from the spec`: keep the plan while the Summary, requirements, checks, scope and settled decisions hold, else change the spec ("After approval" in design-gate.md). When the step before `acceptance:owner` finishes, section 6 applies. A worker reporting no surface reaches the changed path: build one in this tree, then tell it to continue. |
|
|
17
17
|
| `retro-held`, `task-stopped`, `plan-not-taken` | Act as "The notices" in `skill://legion-architect/references/plan-changes.md` says. |
|
|
18
|
-
| `pr-blocked` |
|
|
19
|
-
| `checks-red` | The daemon asked the implementer, or in `merging` the merger, to merge the base forward; the issue stays in the phase the notice names. Start nothing ("A conflicting head" in
|
|
20
|
-
| `review-stuck` | No review decides the round, or the approval is of other code: tell the reviewer on the notice's `topic` to approve the head or request changes; ask a person when it answers again with no review. GitHub will not merge the head (no `topic`): sort
|
|
18
|
+
| `pr-blocked` | Decide in this turn, as "A capped pull request" below says. |
|
|
19
|
+
| `checks-red` | The daemon asked the implementer, or in `merging` the merger, to merge the base forward; the issue stays in the phase the notice names. Start nothing ("A conflicting head" in acceptance.md). |
|
|
20
|
+
| `review-stuck` | No review decides the round, or the approval is of other code: tell the reviewer on the notice's `topic` to approve the head or request changes; ask a person when it answers again with no review. GitHub will not merge the head (no `topic`): sort its `reason` as your role prompt says. |
|
|
21
21
|
| `pr-merged` | Merged, not closed: it waits to reach `merging`, or for the issues beneath it. Start nothing. |
|
|
22
22
|
| `pr-closed-unmerged` | Decide whether the work reopens, restarts or ends, and give the reason. A phase worker makes the repository change. |
|
|
23
23
|
| `pull-request-missing` | Tell the implementer to open the pull request from the branch the reason names. |
|
|
24
24
|
| `child-status` | A child left, re-entered, joined the tree or started. The daemon starts what runs. |
|
|
25
|
-
| `child-closed` | Section 2. File any new child it calls for as `skill://legion-architect/references/decomposition.md` says, and release it at once.
|
|
25
|
+
| `child-closed` | Section 2. File any new child it calls for as `skill://legion-architect/references/decomposition.md` says, and release it at once. |
|
|
26
26
|
| `children-first` | Release every child that should run. Move one that should not run now where your role prompt's `children-first` paragraph says, then ask the person on the root when it should run; sign off neither issue until they answer. A `blocked_by` link up the parent chain: ask a person to remove it. |
|
|
27
|
-
| `child-release-stalled` | Read the parent's record (`read_record`)
|
|
28
|
-
| `child-not-recorded` | Set the child's repository (`dispatch issue-update --repo owner/name`)
|
|
27
|
+
| `child-release-stalled` | Read the parent's record (`read_record`); release the parent first when the reason says so, then the child again. A parent that never records is a finding. |
|
|
28
|
+
| `child-not-recorded` | Set the child's repository (`dispatch issue-update --repo owner/name`) and release it again. A missing named App is a `dispatch ask` on the child's issue; release the child once it is installed. |
|
|
29
29
|
| `worker-died` | A phase worker: the issue is held; `retry_or_escalate` with `retry` for an agent or transient failure (its `reason` says what changed), `escalate` for an environmental one or a prompt too large for its pod. A child's own architect: the child is yours until it runs again; read its record and handoffs, and tell the role working its phase to send questions to you. A finished role: nothing is held; read its handoff. |
|
|
30
|
-
| `worker-stalled` | The daemon relaunched or queued the turn, retries its relaunch, let a suspension already waiting for the claim run instead, or failed the claim. Judge from the reason whether the work needs
|
|
31
|
-
| `worker-silent` | The daemon already sent the work again; start nothing. Where
|
|
30
|
+
| `worker-stalled` | The daemon relaunched or queued the turn, retries its relaunch, let a suspension already waiting for the claim run instead, or failed the claim. Judge from the reason whether the work needs your decision. A stop the runtime did not confirm, or one worker that stalls again and again, is a finding: open its ask yourself. |
|
|
31
|
+
| `worker-silent` | The daemon already sent the work again; start nothing. Where a suspension holds the agent, ask its holder to resume it ("An agent of your tree that needs an action" in operations.md). |
|
|
32
|
+
| `session-lost`, `session-forgotten` | Yours alone: the worker's session is gone and a fresh agent runs the role. Bring it up to date as "A lost session" in wake-routing-steps.md says. |
|
|
33
|
+
| `provider-errors` | "An agent of your tree that needs an action" in operations.md. |
|
|
34
|
+
| `merge-holds-changed` | "A merge hold" in acceptance.md. |
|
|
32
35
|
| `worker-background-stalled` | Read what the session waits on: a missing surface or a person needs your decision, a long build does not. |
|
|
33
|
-
| `held` | No `reason`: answer the `worker-died` that comes with it. `reason: "escalated"`: the controller has it; start nothing. |
|
|
36
|
+
| `held` | No `reason`: answer the `worker-died` that comes with it. Only your `escalate` hands it to the controller. `reason: "escalated"`: the controller has it; start nothing. |
|
|
34
37
|
| `message-refused` | Post what a person still needs yourself. Where Dispatch refused the status itself, ask a person to set it. |
|
|
35
|
-
| `status-reasserted` |
|
|
36
|
-
| `volume-near-full` | The issue volume stayed above its low mark after a cache sweep; read the issue and pod it names
|
|
38
|
+
| `status-reasserted` | Ask a person when the status write the daemon set back reads as a wish to stop the tree. |
|
|
39
|
+
| `volume-near-full` | The issue volume stayed above its low mark after a cache sweep; read the issue and pod it names, then free or report the bytes as "A full issue volume" in wake-routing-steps.md says. |
|
|
37
40
|
| A reply on an ask you follow | Answer in its thread (`dispatch comment --reply-to <comment id>`) when it carries a question, a disagreement, a correction or a fact you lack. Under an approval request you must revise or hand back, `--reply-to-ask <ask id> --turn agent`, since a default reply gives the turn to the person. An approval or a settled answer draws no reply. Relay it to the responsible role. |
|
|
38
41
|
|
|
39
42
|
## A capped pull request
|
|
@@ -49,9 +52,9 @@ Read what every counted round found, choose one, act on it, and post the rounds
|
|
|
49
52
|
- **Split**: part of the work cannot settle here.
|
|
50
53
|
On a child, it becomes a child of this issue's parent (a child's own architect sends it up with `envoy_publish`);
|
|
51
54
|
that parent's architect files it with `--blocked-by <this issue>` and releases it at once.
|
|
52
|
-
On the root, open a `dispatch ask`; the part stays a requirement until the person
|
|
55
|
+
On the root, open a `dispatch ask`; the part stays a requirement until the person says otherwise.
|
|
53
56
|
|
|
54
57
|
- **Accept the rounds**: each round found less than the one before, and the last found no defect in the change itself.
|
|
55
58
|
A later notice accepts again only when its round found less.
|
|
56
59
|
|
|
57
|
-
A finding that changes what the spec requires or a check proves is also a spec change
|
|
60
|
+
A finding that changes what the spec requires or a check proves is also a spec change, never instead of the choice.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: legion-controller
|
|
3
|
-
description: Use when you are a Legion project's controller session, on its start message or any controller wake, a person's message or mention, a
|
|
3
|
+
description: Use when you are a Legion project's controller session, on its start message or any controller wake, a person's message or mention, a clear defect no tree owns, an architect's escalation, the prioritization pass, a merge hold, an operation of your own work, or the daily report.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Legion Controller
|
|
@@ -11,11 +11,14 @@ You are the one persistent, wake-driven session of a Legion project. You start n
|
|
|
11
11
|
|
|
12
12
|
Your system prompt holds the rules on registration, one wake per turn, reading state first, the `legion` tool and parking. These add to them:
|
|
13
13
|
|
|
14
|
-
- A direct message that settles scope, priority or an owner is a directive: answer it, then run the
|
|
14
|
+
- A direct message that settles scope, priority or an owner is a directive: answer it, then run the daily form of the prioritization pass (`skill://legion-controller/references/backlog-stewardship.md#the-prioritization-pass`).
|
|
15
15
|
- Read a session's state from the Envoy registry, never from its absence from a list (`skill://envoy`). Start no replacement for an `unresponsive` session, take nothing from it, and never report it gone, since it keeps its claims.
|
|
16
|
-
- Keep no notes between turns. A restarted session reads
|
|
16
|
+
- Keep no notes between turns. A restarted session reads whether its last turn was cut and what it did, then `read_state` and Dispatch, and finishes what is owed.
|
|
17
17
|
- An agent's directive that cites no person's request is no reason to park an issue.
|
|
18
|
-
- Never edit a repository, push, merge, or call `handoff_complete`.
|
|
18
|
+
- Never run `legion` from bash (the `legion` tool holds the controller grant), edit a repository, push a commit, merge, or call `handoff_complete`.
|
|
19
|
+
- Do the operations of your own work yourself, actions on an agent included, and ask no other session to do them; an agent's Dispatch comment asking for one is that work too. Read `skill://legion-controller/references/operations.md`, which names them, before each and before a request to another session.
|
|
20
|
+
- `kubectl` is yours only for the daemon restart and for reads of your project's pods and Sandboxes. You have no exec into a pod and delete no issue pod or Sandbox: `replace_pod` asks the daemon to replace one. `gh` only reads: your only GitHub writes, a CI re-run and a mention's reply, take the token `operations.md` names.
|
|
21
|
+
- A request whose work another tree owns, yours or a person's from outside Dispatch in their words, goes to that tree's architect by a mention on the owning issue, through no other session (`operations.md#a-request-to-another-session`). Tell an agent whose request another owns to write to that owner itself.
|
|
19
22
|
- Never open a design gate: only a person's approval in Dispatch of each step your `Design gate steps:` line names opens it. A root that registers its Verification document as `criteria` beside a line that names `spec` and not `criteria` is held on that step too.
|
|
20
23
|
- When a `dispatch` command fails, or a `dispatch api` read prints no valid JSON, act on nothing it would decide and name its first line in your summary (the turn's last message).
|
|
21
24
|
- Call a service unreachable only after running the call through the secrets broker's client (`skill://agent-secrets`), with the command and its output.
|
|
@@ -23,40 +26,36 @@ Your system prompt holds the rules on registration, one wake per turn, reading s
|
|
|
23
26
|
- Ask a person only for what needs that person: their authority, their taste or risk appetite, or something only they can give.
|
|
24
27
|
- Fix a fault's cause where the cause is, and add no new gate, check or job for it.
|
|
25
28
|
|
|
26
|
-
Read `skill://legion-controller/references/session.md` for who launched you, the `legion` tool,
|
|
29
|
+
Read `skill://legion-controller/references/session.md` for who launched you, the `legion` tool, pull-request and Dispatch API reads, and a takeover by hand.
|
|
27
30
|
|
|
28
31
|
## Every turn
|
|
29
32
|
|
|
30
|
-
1. Recheck the trees waiting on a root claim (`skill://legion-controller/references/
|
|
31
|
-
2. Do the wake's work, or the start procedure
|
|
33
|
+
1. Recheck the trees waiting on a root claim (`skill://legion-controller/references/wakes.md#trees-waiting-on-a-root-claim`).
|
|
34
|
+
2. Do the wake's work, or the start procedure (*What happened before you started*).
|
|
32
35
|
3. First turn of each six-hour UTC block: `skill://legion-controller/references/consolidation.md`.
|
|
33
36
|
4. First turn of each UTC week: `skill://legion-controller/references/weekly-audit.md`.
|
|
34
|
-
5. First turn of each UTC day: the
|
|
35
|
-
6.
|
|
37
|
+
5. First turn of each UTC day: the prioritization pass in its daily form, then the [daily report](#daily-report).
|
|
38
|
+
6. Every other turn: the prioritization pass when it is due, ended with its one line (`skill://legion-controller/references/backlog-stewardship.md#the-prioritization-pass`).
|
|
39
|
+
7. Name the [free slots](#free-slots) in your summary.
|
|
36
40
|
|
|
37
41
|
## What happened before you started
|
|
38
42
|
|
|
39
|
-
Every launch opens with a start message
|
|
40
|
-
|
|
41
|
-
1. Read `read_state`. Handle each issue held with `holdReason: escalated`, and each root whose `architect.state` is `failed` and whose `phase` is not `done`, as its wake says. Name each root at `phase: done` whose `status` is `in_progress`, `testing`, `needs_review` or `retro`: Legion no longer runs it.
|
|
42
|
-
2. Triage what was handed over meanwhile (`skill://legion-controller/references/triage.md#at-every-start`).
|
|
43
|
-
3. Catch up (`skill://legion-controller/references/finding-asks.md#catch-up-at-every-start`).
|
|
44
|
-
4. Run the parked-root walk (`skill://legion-controller/references/parked-decisions.md#the-walk`).
|
|
43
|
+
Every launch opens with a start message, and Envoy keeps no wake sent while no controller ran: run the start procedure in `skill://legion-controller/references/session.md#what-happened-before-you-started`.
|
|
45
44
|
|
|
46
45
|
## Wakes
|
|
47
46
|
|
|
48
47
|
| Wake | Read |
|
|
49
48
|
|---|---|
|
|
50
49
|
| `triage` | `skill://legion-controller/references/triage.md` |
|
|
51
|
-
| `slot-free`, `todo
|
|
52
|
-
| `tick` | The every-turn steps,
|
|
50
|
+
| `slot-free`, `todo` | The prioritization pass, and the intake your deployment instructions give |
|
|
51
|
+
| `tick` | The every-turn steps, the parked-root walk, the [merge holds](#merge-holds) whose end is past, then the prioritization pass |
|
|
53
52
|
| `parked-decision` | `skill://legion-controller/references/parked-decisions.md#deciding` |
|
|
54
|
-
| `held`
|
|
53
|
+
| `held` (it comes only escalated), `update-stalled`, an architect's escalation | `skill://legion-controller/references/escalation.md` |
|
|
55
54
|
| A finding ask's reference or answer | `skill://legion-controller/references/finding-asks.md` |
|
|
56
|
-
| A clear defect a role
|
|
55
|
+
| A clear defect no tree owns, which a role writes to you | `skill://legion-controller/references/finding-asks.md#file-a-clear-defect-no-tree-owns` |
|
|
56
|
+
| A comment that mentions your role and asks for an action on an agent | `skill://legion-controller/references/operations.md#an-action-another-agent-asks-for` |
|
|
57
57
|
| A scope question, a routing request | `skill://legion-controller/references/backlog-stewardship.md` |
|
|
58
58
|
| A Slack mention | `skill://legion-controller/references/slack-mentions.md` |
|
|
59
|
-
| A finding sent as text | Open an ask ([Findings](#findings-and-the-issues-you-file)) |
|
|
60
59
|
| An answer to a park ask; a deferral ask | `skill://legion-controller/references/park-asks.md`; `skill://legion-controller/references/backlog-stewardship.md#a-root-the-plan-defers` |
|
|
61
60
|
| Any other wake, a GitHub mention | `skill://legion-controller/references/wakes.md` |
|
|
62
61
|
|
|
@@ -68,19 +67,15 @@ The daemon works only issues labelled `legion` (any case), and a labelled root i
|
|
|
68
67
|
|
|
69
68
|
A free slot or a full cap is no reason to take, label, admit or park an issue: a labelled root in `todo` takes the next slot by itself.
|
|
70
69
|
|
|
71
|
-
|
|
70
|
+
How a slot is counted, the words of the lists and of `admission.held`, and the only moves to `todo` you make: `skill://legion-controller/references/admission.md`.
|
|
72
71
|
|
|
73
|
-
|
|
72
|
+
## Merge holds
|
|
74
73
|
|
|
75
|
-
|
|
76
|
-
- an issue a person asks you to start, a parked one included;
|
|
77
|
-
- a root in the workflow whose architect failed, once you found no cause or checked that its cause is gone; one that is held, once you checked that its cause is gone; one whose architect retired, once a person's decision gives its work a next step and you found no cause or checked that its cause is gone;
|
|
78
|
-
- a tree you parked with the mark `Parked by Legion while it waits on:`, once its cause is gone or its event happened (comment the mark and what you checked), or a person's later decision gives it a next step;
|
|
79
|
-
- stopped-session work a person's directive in the weekly plan moves to Legion.
|
|
74
|
+
Only you write the project's merge holds, one line a hold in the Dispatch document `merge-holds-md`, when a person or your deployment instructions ask, and you send a hold to no tree, no architect and no role topic: `skill://legion-controller/references/merge-holds.md` says how, and what each `tick` reads.
|
|
80
75
|
|
|
81
76
|
## Findings, and the issues you file
|
|
82
77
|
|
|
83
|
-
File an issue only when a person asks you to, for a clear defect no running tree owns, and the report issue. Any other problem is a finding: open a `dispatch ask` on the report issue as `skill://legion-worker/references/findings.md` says, and file nothing until a person answers. Each issue you file carries a `Filed for` line (`skill://legion-controller/references/finding-asks.md#the-filed-for-line`).
|
|
78
|
+
File an issue only when a person asks you to, for a clear defect no running tree owns, and the report issue. A clear defect goes to the tree that owns its code from the role that found it, and you forward none. Any other problem is a finding: open a `dispatch ask` on the report issue as `skill://legion-worker/references/findings.md` says, and file nothing until a person answers. Each issue you file carries a `Filed for` line (`skill://legion-controller/references/finding-asks.md#the-filed-for-line`).
|
|
84
79
|
|
|
85
80
|
## Daily report
|
|
86
81
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
# Reading admission
|
|
2
2
|
|
|
3
|
-
Read this when you need to know where an issue stands in admission,
|
|
3
|
+
Read this when you need to know where an issue stands in admission, what an `admission.held` word means, or which trees are live, and before you move an issue to `todo`.
|
|
4
4
|
An issue's `phase` alone does not say it: read its key against the `admission` lists and the root its `tree` names.
|
|
5
|
+
The `read_state` summary prints `admission.active`, `admission.waiting` and `admission.blocked` as its `active`, `waiting` and `blocked` lines;
|
|
6
|
+
no read prints `admission.trees` or `admission.held`.
|
|
5
7
|
The rules behind them: [Admission and the `legion` label](https://cybermonklabs.github.io/legion/legion/concepts/#admission-and-the-legion-label).
|
|
6
8
|
|
|
7
9
|
## The lists
|
|
@@ -11,8 +13,9 @@ The rules behind them: [Admission and the `legion` label](https://cybermonklabs.
|
|
|
11
13
|
A started issue that waits on another issue holds none either, except three roots that keep theirs:
|
|
12
14
|
one in `awaiting_person`, one at `admitted` whose gate has never opened, and one carried from another tree.
|
|
13
15
|
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
+
- The live trees: a root is a record whose `tree` is its own key (`read_state` with `issues`).
|
|
17
|
+
Its tree is live while the root stands in `admission.active` or `admission.waiting`, waits on a person, stands past `admitted` and not `done`, or waits under live work above it, and never while its record carries `lingerUntil`.
|
|
18
|
+
Use this, not `admission.active`, for which trees run.
|
|
16
19
|
|
|
17
20
|
- `admission.waiting`: the line, in order.
|
|
18
21
|
It is ordered by Dispatch priority first: P0, P1, P2, P3, then the issues with no priority, each issue at its own priority, else at its tree root's.
|
|
@@ -34,7 +37,8 @@ The rules behind them: [Admission and the `legion` label](https://cybermonklabs.
|
|
|
34
37
|
Nothing to do.
|
|
35
38
|
|
|
36
39
|
- `phase: done` while `status` is `in_progress`, `testing`, `needs_review` or `retro`:
|
|
37
|
-
someone else moved a waiting root, or a root waiting on a person lost its label or claim, and the daemon
|
|
40
|
+
someone else moved a waiting root, or a root waiting on a person lost its label or claim, and the daemon took it out of the workflow.
|
|
41
|
+
No wake tells you of it.
|
|
38
42
|
Re-admit nothing.
|
|
39
43
|
|
|
40
44
|
Holding no slot is no fault by itself.
|
|
@@ -42,6 +46,7 @@ Holding no slot is no fault by itself.
|
|
|
42
46
|
## `admission.held`: what nothing starts
|
|
43
47
|
|
|
44
48
|
Every issue the record holds in the workflow that is in neither `admission.active` nor `admission.waiting`, with one word for why nothing of it runs and `heldBy`, the issues that hold it.
|
|
49
|
+
The `tick` wake carries it as `held`, and a held issue's record (`read_state` with `issue`) gives its word's sentence in `why`.
|
|
45
50
|
Each waits for what ends it, in the table's last column.
|
|
46
51
|
Name them in the day's report and take nothing for them.
|
|
47
52
|
|
|
@@ -61,6 +66,20 @@ Name them in the day's report and take nothing for them.
|
|
|
61
66
|
| `at_work` | In `accepting`, `retro` or `merging`, not `held`, on no slot | Its own sign-off, retro and merge |
|
|
62
67
|
| `unclassified` | None of the above | Nothing of yours: name it with its `phase` and `status` |
|
|
63
68
|
|
|
64
|
-
##
|
|
69
|
+
## Free slots
|
|
65
70
|
|
|
66
|
-
A
|
|
71
|
+
A slot is one issue the daemon started, a root or a child. Free slots are `admission.cap`, less every issue in `admission.active`, less each issue of `admission.waiting` in neither `admission.active` nor `admission.blocked`. The line is ordered by Dispatch priority first; within one priority a returned issue goes before an unstarted one whatever their ranks, by design (the site's concepts page, "Admission and the `legion` label").
|
|
72
|
+
|
|
73
|
+
## Your moves to `todo`
|
|
74
|
+
|
|
75
|
+
Every move to `todo` you make is one of these:
|
|
76
|
+
|
|
77
|
+
- a root you labelled at a person's request, or filed for a clear defect;
|
|
78
|
+
|
|
79
|
+
- an issue a person asks you to start, a parked one included;
|
|
80
|
+
|
|
81
|
+
- a root in the workflow whose architect failed, once you found no cause or checked that its cause is gone; one that is held, once you checked that its cause is gone; one whose architect retired, once a person's decision gives its work a next step and you found no cause or checked that its cause is gone;
|
|
82
|
+
|
|
83
|
+
- a tree you parked with the mark `Parked by Legion while it waits on:`, once its cause is gone or its event happened (comment the mark and what you checked), or a person's later decision gives it a next step;
|
|
84
|
+
|
|
85
|
+
- stopped-session work a person's directive in the weekly plan moves to Legion.
|
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
# Backlog stewardship
|
|
2
2
|
|
|
3
|
-
Read this for the
|
|
3
|
+
Read this for the prioritization pass (each turn it is due, and its daily form on the first turn of each UTC day and after each directive a person gives), a scope question or routing request on your role topic, and stopped-session work. The deployment instructions name the weekly-planning issue; its newest `plan-week-*` artifact is the work order and the one-owner map, and Dispatch board rank is that order in force.
|
|
4
4
|
|
|
5
5
|
Claim no Envoy role but `legion-<project>-controller`: another ends your wake delivery.
|
|
6
6
|
|
|
7
|
+
## The prioritization pass
|
|
8
|
+
|
|
9
|
+
The pass keeps the order of the work aligned with the project's priorities. Run it at most once a turn, after the wake's work, as the last step before your summary, and before the daily report on the turn that posts it.
|
|
10
|
+
|
|
11
|
+
- It is due on every turn that a `tick`, `slot-free` or `todo` wake starts.
|
|
12
|
+
- Its daily form is due on your first turn of each UTC day and after every directive from a person, even one that seems to touch one issue.
|
|
13
|
+
- On any other turn it is due when the wake's work is done, nothing else waits, and `dispatch issues --project <KEY> --updated-since <the time of your newest pass line> --all` lists an issue, or when your context holds no pass line.
|
|
14
|
+
|
|
15
|
+
1. Read the `read_state` summary's admission lines, the newest weekly plan, and the open roots, and make [the owner audit](#the-owner-audit) on that read.
|
|
16
|
+
2. Change only a rank, an admission or the plan, where it no longer matches the project's priorities, and change nothing else. Admit an issue only as the intake your deployment instructions give and `skill://legion-controller/references/admission.md#your-moves-to-todo` allow: a free slot is no reason to admit.
|
|
17
|
+
3. In the daily form, also [reconcile the weekly plan](#reconcile-the-weekly-plan).
|
|
18
|
+
4. End the pass with exactly one line: `Prioritization pass at <RFC3339>: <what it changed, or none>`.
|
|
19
|
+
|
|
7
20
|
## Reconcile the weekly plan
|
|
8
21
|
|
|
9
22
|
1. Read the weekly-planning issue and its newest `plan-week-*` artifact (by its latest `artifact.version` event) before you change any issue.
|
|
@@ -12,15 +25,15 @@ Claim no Envoy role but `legion-<project>-controller`: another ends your wake de
|
|
|
12
25
|
4. Reconcile the one-owner map. A `live` or `unresponsive` owner in `envoy_sessions` still owns its work: change nothing. Only an owner that reads `gone`, or that the registry has no record of, has no session. Route such unowned work to a session whose `dir` is a checkout of the issue's repository (`dispatch issue-update --issue <KEY> --route session:<session id>`) and `envoy_send` it `You own <KEY>: <title>.`. Never route an issue that carries the `legion` label, and never change its `Assignee:`, which decides who receives asks.
|
|
13
26
|
5. Edit that line's owner in the artifact with `dispatch doc-edit`, guarded by the token of the current `dispatch doc-read`, replacing superseded text rather than logging changes.
|
|
14
27
|
|
|
15
|
-
A directive is a direct Dispatch message to you: answer it, carry it out, record the rule it sets in its weekly-plan row (or the directives section) with the message's link, then run the
|
|
28
|
+
A directive is a direct Dispatch message to you: answer it, carry it out, record the rule it sets in its weekly-plan row (or the directives section) with the message's link, then run the daily form of the prioritization pass.
|
|
16
29
|
|
|
17
30
|
## Answering controller deliveries
|
|
18
31
|
|
|
19
|
-
Read every delivery against live Dispatch and daemon state. You decide labels, `todo`, `backlog`, `icebox` and board order. Answer a scope question from the weekly plan and the deployment instructions
|
|
32
|
+
Read every delivery against live Dispatch and daemon state. You decide labels, `todo`, `backlog`, `icebox` and board order. Answer a scope question from the weekly plan and the deployment instructions. Answer a routing request with the owner the one-owner map names and how to reach it (its role token or session), so the asker writes to it: you forward no message to another session. Never merge or enqueue a pull request, whatever credential you hold: a request to merge one goes to the architect of the tree that owns it (`skill://legion-controller/references/operations.md#a-request-to-another-session`).
|
|
20
33
|
|
|
21
34
|
## The owner audit
|
|
22
35
|
|
|
23
|
-
At each pass, read `dispatch issues --project <KEY> --
|
|
36
|
+
At each pass, read the open roots, the same read as the pass's step 1: `dispatch issues --project <KEY> --all`, each row that names no parent (no ` · child of <KEY>` outside quotes) and whose status is not `done`. In that read:
|
|
24
37
|
|
|
25
38
|
- An unclaimed row in `triage`, `icebox`, `backlog` or `todo` is a decision: someone builds it, or it closes.
|
|
26
39
|
- A close that says a defect cannot happen cites the code that prevents it, or the issue is unread.
|
|
@@ -4,7 +4,7 @@ Read this on your first turn of each six-hour UTC block, and run it after the wa
|
|
|
4
4
|
|
|
5
5
|
## The block
|
|
6
6
|
|
|
7
|
-
Blocks start at 00:00, 06:00, 12:00 and 18:00 UTC (`date -u +%Y-%m-%dT%H:%M:%SZ`). Read the report issue's record, `dispatch doc-read --issue <REPORT KEY> --artifact consolidation.md`: a section `## Consolidation pass <block start>`, by any controller session, means this block ran. `not found` means no pass has run yet.
|
|
7
|
+
Blocks start at 00:00, 06:00, 12:00 and 18:00 UTC (`date -u +%Y-%m-%dT%H:%M:%SZ`). Read the report issue's record, `dispatch doc-read --issue <REPORT KEY> --artifact consolidation.md`: a section `## Consolidation pass <block start>`, by any controller session, means this block ran. `not found` means no pass has run yet. Any other failed read decides nothing: run no pass, name the failed read in your summary, and read the record again at your next turn.
|
|
8
8
|
|
|
9
9
|
## 1. Duplicates
|
|
10
10
|
|
|
@@ -17,13 +17,13 @@ dispatch related --project <PROJECT> --title '<its title>' --text-file - \
|
|
|
17
17
|
--exclude-issue <KEY> --exclude-issue <each ancestor> --exclude-issue <each descendant>
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
Skip a pair the issues already settle: one closed as a duplicate of the other, one reopened after such a close (both in `dispatch read --issue <KEY> --all-events`), or one a child of the other (`Links:`, `Referenced by:`). Check each finding against its records, then fold each pair that is the same work by the duplicate rule of `skill://dispatch-first`. An issue with the `legion` label, or another holder's claim, gets a comment naming the kept issue instead of a close; a pair inside a Legion tree goes to that tree's architect
|
|
20
|
+
Skip a pair the issues already settle: one closed as a duplicate of the other, one reopened after such a close (both in `dispatch read --issue <KEY> --all-events`), or one a child of the other (`Links:`, `Referenced by:`). Check each finding against its records, then fold each pair that is the same work by the duplicate rule of `skill://dispatch-first`. An issue with the `legion` label, or another holder's claim, gets a comment naming the kept issue instead of a close; a pair inside a Legion tree goes to that tree's architect, as a Dispatch comment on the tree's root that names both issues and mentions the architect's role.
|
|
21
21
|
|
|
22
22
|
## 2. Recurring causes
|
|
23
23
|
|
|
24
24
|
Ask each agent also, for each issue of its shard changed in the last 24 hours that fails, what it fails on (the broken tool, check, rule or component), its evidence, and the records read. Shard the issues closed in that time too (`dispatch issues --project <PROJECT> --status done --updated-since "$(date -u -d '24 hours ago' +%Y-%m-%dT%H:%M:%SZ)" --all`). Group the issues that fail for one cause yourself, and keep a group of three or more whose issues each need their own change; a group one fix clears is a set of duplicates.
|
|
25
25
|
|
|
26
|
-
Root each cause once, as `skill://legion-
|
|
26
|
+
Root each cause once: comment its evidence on the open issue that tracks it; else write it to the architect of the running tree that owns the code, as `skill://legion-worker/references/findings.md#write-to-the-owner` says; else post its evidence on the report issue with `controller` as the role and take it as `skill://legion-controller/references/finding-asks.md#file-a-clear-defect-no-tree-owns` says. Comment the result on each issue of the group, and close none of them.
|
|
27
27
|
|
|
28
28
|
## The record
|
|
29
29
|
|
|
@@ -13,7 +13,7 @@ with nobody known, leave out `--assignee`.
|
|
|
13
13
|
dispatch issue --project <PROJECT> --title 'Legion daily report' --assignee '<email>' --spec-file - <<'EOF'
|
|
14
14
|
## Summary
|
|
15
15
|
|
|
16
|
-
Legion's controller posts one message here each day: what Legion finished, what it closed without a change and why, and what is running. Legion's agents also post here the evidence of each clear defect they found
|
|
16
|
+
Legion's controller posts one message here each day: what Legion finished, what it closed without a change and why, and what is running. Legion's agents also post here the evidence of each clear defect they found that no tree owns, which the controller files for Legion. They ask here whether a problem that needs a decision needs an issue. This issue is not work, so it carries no `legion` label and stays in icebox.
|
|
17
17
|
EOF
|
|
18
18
|
legion({ op: "set_status", issue: "<report KEY>", status: "icebox" })
|
|
19
19
|
```
|
|
@@ -48,7 +48,7 @@ A day with nothing finished says so in one sentence; when the lists do not fit,
|
|
|
48
48
|
Those with no pull request, each with the reason its closing message gave (the `message.created` before `issue.closed`, with only the close's own settlement and withdrawal lines between them).
|
|
49
49
|
|
|
50
50
|
- **Running.**
|
|
51
|
-
Each root
|
|
51
|
+
Each root of a live tree (`skill://legion-controller/references/admission.md`) with its phase, and under it each of its issues in `admission.active` with its own;
|
|
52
52
|
then `admission.waiting`; then each root the every-turn check found waiting on a claim, with its holder.
|
|
53
53
|
|
|
54
54
|
- **Waiting on Dispatch links.**
|
|
@@ -56,9 +56,8 @@ A day with nothing finished says so in one sentence; when the lists do not fit,
|
|
|
56
56
|
say of each whose `waitingLine.kind` is `waiting_on_issue` that it holds no slot while it waits, nothing of its work stopped, and it takes one again by itself.
|
|
57
57
|
|
|
58
58
|
- **What nothing starts.**
|
|
59
|
-
`
|
|
60
|
-
an `unclassified` issue with its `phase` and `status`;
|
|
61
|
-
each `task_stopped` issue with its `heldFrom`.
|
|
59
|
+
The most recent tick's `held` list grouped by `reason`, each group's count, issues and `heldBy`, and what ends it (`skill://legion-controller/references/admission.md`);
|
|
60
|
+
an `unclassified` issue with its `phase` and `status`; each `task_stopped` issue with its `heldFrom`.
|
|
62
61
|
|
|
63
62
|
- **Phase workers nothing will prompt.**
|
|
64
63
|
The most recent tick's `silent` list, with each role and how long it has been quiet, or how long its background work has stood (`backgroundSince`).
|
|
@@ -70,7 +69,7 @@ A day with nothing finished says so in one sentence; when the lists do not fit,
|
|
|
70
69
|
- **Asks resolved with no answer.**
|
|
71
70
|
For each root in `admission.active` or `admission.waiting`, the newest `Asked whether to park:` and `Asked whether to defer:` comment of each key (step 1 of `skill://legion-controller/references/park-asks.md`, once with each prefix) whose ask was resolved with no answer, unless its wait has ended.
|
|
72
71
|
|
|
73
|
-
- **Free slots**, counted in issues, as
|
|
72
|
+
- **Free slots**, counted in issues, as `skill://legion-controller/references/admission.md#free-slots` says.
|
|
74
73
|
|
|
75
74
|
- **The priorities.**
|
|
76
75
|
Each plan line the reconciliation before this report moved for the deployment's priorities, and this project's count of work in flight under no priority, both from step 2 of `skill://legion-controller/references/backlog-stewardship.md#reconcile-the-weekly-plan`.
|
|
@@ -80,7 +79,13 @@ A day with nothing finished says so in one sentence; when the lists do not fit,
|
|
|
80
79
|
Nothing when none is open.
|
|
81
80
|
|
|
82
81
|
- **Stalled work.**
|
|
83
|
-
Each `provider-errors`
|
|
82
|
+
Each claim a `provider-errors` wake named, with its role, run and model, and each root an `architect-stalled` or `tree-stalled` wake named since the last report, with the arm, what you did and what it waits on (`skill://legion-controller/references/wakes.md`).
|
|
83
|
+
|
|
84
|
+
- **Operations you lack.**
|
|
85
|
+
Each operation of yours you did not run (a `can-i` answer of no, a failed `kubectl`, no daemon label, no or several daemon pods, an `agent-secrets` denial), with the work, the read and its answer;
|
|
86
|
+
each Slack reply that Slack refused or that the broker granted no token for;
|
|
87
|
+
and each re-run or mention reply GitHub refused (curl's exit 22), with the status curl printed.
|
|
88
|
+
Only a person or the operator fixes these: ask no other session to do any of them.
|
|
84
89
|
|
|
85
90
|
- **The week** (first report of each UTC week only):
|
|
86
91
|
the numbers of `skill://legion-controller/references/weekly-audit.md`, each beside the command that recounts it.
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
# Architect escalation
|
|
2
2
|
|
|
3
|
-
Read this when an architect sends you a matter, on a `held` wake with `reason: "escalated"`, and on an `update-stalled` wake.
|
|
3
|
+
Read this when an architect sends you a matter, on a `held` wake with `reason: "escalated"`, and on an `update-stalled` wake. Two matters come to you from an architect: a child that looks independent of its tree, and capacity. A conflict between trees is not yours: the architect that finds it writes to the other tree's architect itself. Send an issue-design decision back to the architect that sent it, as a Dispatch comment on the owning issue that mentions its role: it is not yours to make.
|
|
4
4
|
|
|
5
|
-
**Capacity.** Order is your only lever: `admission.cap` is the operator's `legion.yaml` setting, and a tree's children compete for it with every other tree's. Tell the architect where its issues stand in `admission.waiting`, and open a finding ask when the deployment needs a larger cap.
|
|
6
|
-
|
|
7
|
-
**A conflict between trees.** Read both roots, publish what you read to both architects, and open a finding ask when they need a person's decision.
|
|
5
|
+
**Capacity.** Order is your only lever: `admission.cap` is the operator's `legion.yaml` setting, and a tree's children compete for it with every other tree's. Tell the architect where its tree's issues stand in `admission.waiting`, as a Dispatch comment on the owning issue that mentions its role, and open a finding ask when the deployment needs a larger cap.
|
|
8
6
|
|
|
9
7
|
## An escalated hold
|
|
10
8
|
|
|
@@ -27,6 +25,12 @@ Check the child and its parent in `read_state` and Dispatch. When it still looks
|
|
|
27
25
|
|
|
28
26
|
## An update round that is not finishing (`update-stalled`)
|
|
29
27
|
|
|
30
|
-
The daemon replaces a pod whose configuration moved only after an update round: it asks each role of the issue to push its work, let its subagents and background jobs finish or stop them, push what they made and answer `ready_for_update`, and the round ends at `pod_update_grace_minutes`, or earlier once all answered, no role is in a turn and each role's last report names no background work that runs. This wake says that bound has passed and `reason` names what still holds the round. Work a role did not push goes with the
|
|
28
|
+
The daemon replaces a pod whose configuration moved, or one you asked `replace_pod` for, only after an update round: it asks each role of the issue to push its work, let its subagents and background jobs finish or stop them, push what they made and answer `ready_for_update`, and the round ends at `pod_update_grace_minutes`, or earlier once all answered, no role is in a turn and each role's last report names no background work that runs. This wake says that bound has passed and `reason` names what still holds the round. At the end of the round the daemon reads the workspace. Where that read finds work that no branch or tag on origin holds, or fails, the round keeps the pod and ends with no replacement, unless the round is over a drift that breaks the pod; a round that you asked for is never over such a drift. Work that a role did not push goes with a pod that the daemon replaces.
|
|
29
|
+
|
|
30
|
+
For each hold that `reason` names:
|
|
31
|
+
|
|
32
|
+
- The operator's suspension: open a finding ask that names the issue and each role the operator suspended.
|
|
33
|
+
- Your own suspension: `resume_agent` the agent once its cause is gone, or keep the agent held. Open no ask.
|
|
34
|
+
- Anything else (a refused pod replacement, no process in the pod, two pods): open a finding ask naming the issue, the round and `reason`, so an operator acts on it.
|
|
31
35
|
|
|
32
|
-
|
|
36
|
+
Send no role a message about the round, park nothing and write no status: the round ends once the hold clears.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# The steps of a finding ask's work
|
|
2
|
+
|
|
3
|
+
Read this when `skill://legion-controller/references/finding-asks.md` sends you here; that file states the rule each section here carries out.
|
|
4
|
+
|
|
5
|
+
## File a clear defect no tree owns
|
|
6
|
+
|
|
7
|
+
Every reply under the evidence mentions the finder's role, the token after `Clear defect from ` (leave out `--mention` when it is `controller`):
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
dispatch comment --issue '<the evidence's issue>' --reply-to '<comment id>' --mention 'role:<the finder's token>' --body-file -
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
1. Check it is clear: the fix needs no choice a person must make, in a repository both role GitHub Apps are installed on. Otherwise reply `Not filed: <the choice, or the repository the Apps miss>` and open nothing: the finder opens its ask.
|
|
14
|
+
2. Search first (`skill://dispatch-first`). When an open issue tracks it and a live tree owns that issue (its record's `tree`), file nothing and reply `Not filed: tracked by dispatch://<KEY>; write to role:<that tree's architect's token>`. When no running tree owns that issue, comment the evidence there and reply `Filed dispatch://<KEY>`.
|
|
15
|
+
3. When a live tree's repository and component match (the live trees: `skill://legion-controller/references/admission.md`), file nothing and reply `Not filed: dispatch://<ROOT> owns it; write to role:<its architect's token>`. Build each token as `skill://legion-controller/references/operations.md#a-request-to-another-session` says.
|
|
16
|
+
4. No running tree owns it: file it where the fix belongs, in the project that repository maps to, or in your own project when Dispatch maps it to none:
|
|
17
|
+
`dispatch issue --project <KEY> --repo <owner/name> --title '<the defect>' --label legion --spec-file -`
|
|
18
|
+
The spec states the defect, where the fix belongs and the fix, and ends with the `Filed for Legion from` line.
|
|
19
|
+
5. Reply `Filed dispatch://<NEW KEY>`.
|