@sjawhar/opencode-legion-envoy 8.31.0 → 9.1.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/dist/dispatch.js +49 -30
- package/dist/src/server.js +16 -15
- package/package.json +1 -1
- package/skills/AGENTS.md +7 -6
- package/skills/dispatch/SKILL.md +54 -169
- package/skills/dispatch-first/SKILL.md +23 -17
- package/skills/dispatch-writing-specs/SKILL.md +76 -0
- package/skills/leading-a-work-stream/SKILL.md +96 -0
- package/skills/leading-a-work-stream/references/daily-plan.md +8 -0
- package/skills/leading-a-work-stream/references/decision-rights.md +6 -0
- package/skills/leading-a-work-stream/references/direction-and-coaching.md +13 -0
- package/skills/leading-a-work-stream/references/dispatch-upkeep.md +7 -0
- package/skills/leading-a-work-stream/references/sources.md +9 -0
- package/skills/leading-a-work-stream/references/speed-tick.md +44 -0
- package/skills/leading-a-work-stream/references/user-quotes.md +7 -0
- package/skills/legion-architect/SKILL.md +6 -3
- package/skills/legion-architect/references/acceptance.md +16 -6
- package/skills/legion-architect/references/decomposition.md +7 -3
- package/skills/legion-architect/references/design-gate.md +32 -17
- package/skills/legion-architect/references/wake-routing.md +4 -4
- package/skills/legion-controller/SKILL.md +30 -17
- package/skills/legion-controller/references/admission.md +2 -1
- package/skills/legion-controller/references/backlog-stewardship.md +17 -2
- package/skills/legion-controller/references/daily-report.md +7 -4
- package/skills/legion-controller/references/finding-asks.md +111 -14
- package/skills/legion-controller/references/slack-mentions.md +2 -2
- package/skills/legion-controller/references/triage.md +9 -5
- package/skills/legion-controller/references/wakes.md +8 -1
- package/skills/legion-worker/SKILL.md +5 -4
- package/skills/legion-worker/references/conflicts-and-rewrites.md +23 -16
- package/skills/legion-worker/references/findings.md +126 -31
- package/skills/legion-worker/references/merge-gate.md +48 -17
- package/skills/legion-worker/references/pr-body.md +9 -5
- package/skills/legion-worker/references/tools.md +22 -18
- package/skills/dispatch/references/api.md +0 -21
- package/skills/dispatch/references/asks.md +0 -43
- package/skills/dispatch/references/document-edits.md +0 -59
- package/skills/dispatch/references/documents.md +0 -79
- package/skills/dispatch/references/examples.md +0 -85
- package/skills/dispatch/references/issues.md +0 -66
- package/skills/dispatch/references/messages.md +0 -31
- package/skills/dispatch/references/reading.md +0 -32
- package/skills/dispatch-brainstorming/SKILL.md +0 -56
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# The speed tick: the 3-hourly loop and a reminder that survives restarts
|
|
2
|
+
|
|
3
|
+
## The loop, on each tick
|
|
4
|
+
|
|
5
|
+
1. Read the stream's state from its records: the numbers, today's plan against what merged, the hourly Dispatch check.
|
|
6
|
+
2. Ask each agent on Envoy what slows it down most right now. Not status.
|
|
7
|
+
3. Answer in writing: how can I help this go faster while the targets and the checks that gate them stay unchanged; how can I do better work faster; how can I help the team do better work faster?
|
|
8
|
+
4. Give the answers to a fresh subagent to attack — is each target ambitious, is each change concrete, is each date padded — and rewrite what it finds weak, because your own answers read better to you than they are.
|
|
9
|
+
5. Make the change now, or start an agent on it.
|
|
10
|
+
6. Append the tick to the stream's speed log (an artifact `speed-log.md` on the stream issue): the time, the change, the number it should move and by how much; on the next tick, what it did.
|
|
11
|
+
|
|
12
|
+
## Arming the reminder
|
|
13
|
+
|
|
14
|
+
A reminder inside the session (`sleep` in a background job) dies with the session's processes. A systemd user timer survives them and wakes the session with an Envoy message. Arm it once, from a shell on the machine the session runs on.
|
|
15
|
+
|
|
16
|
+
Replace `NAME` with a short name for your stream and `SESSION` with your full session id. The timer below fires at 01, 04, 07, 10, 13, 16, 19 and 22 UTC; change `OnCalendar` for another rhythm.
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
mkdir -p ~/.config/systemd/user
|
|
20
|
+
cat > ~/.config/systemd/user/speed-tick-NAME.service <<'EOF'
|
|
21
|
+
[Unit]
|
|
22
|
+
Description=Speed tick for NAME's lead
|
|
23
|
+
|
|
24
|
+
[Service]
|
|
25
|
+
Type=oneshot
|
|
26
|
+
ExecStart=<envoy-send-command> SESSION "SPEED TICK: run the six-step loop in leading-a-work-stream references/speed-tick.md now."
|
|
27
|
+
EOF
|
|
28
|
+
cat > ~/.config/systemd/user/speed-tick-NAME.timer <<'EOF'
|
|
29
|
+
[Unit]
|
|
30
|
+
Description=Speed tick for NAME's lead, every 3 hours
|
|
31
|
+
|
|
32
|
+
[Timer]
|
|
33
|
+
OnCalendar=*-*-* 01/3:00:00
|
|
34
|
+
Persistent=true
|
|
35
|
+
|
|
36
|
+
[Install]
|
|
37
|
+
WantedBy=timers.target
|
|
38
|
+
EOF
|
|
39
|
+
systemctl --user daemon-reload
|
|
40
|
+
systemctl --user enable --now speed-tick-NAME.timer
|
|
41
|
+
systemctl --user list-timers speed-tick-NAME.timer
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Set `ExecStart` to the Envoy send command the deployment provides. A session that runs where it cannot install a user timer (a pod) arms an equivalent wake-up there, and says in its speed log how.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# The record of the user's own words
|
|
2
|
+
|
|
3
|
+
Keep one record of the words of the person the stream works for, each quoted with its date and source.
|
|
4
|
+
|
|
5
|
+
- A skill, brief, spec or message that says that person wants something links the quote. Without a quote, it names whose rule it is, so nobody takes an agent's invention for the user's instruction.
|
|
6
|
+
- When a later quote changes an earlier one, the record says which one stands, and every text that used the earlier one is changed the same day; otherwise two texts give agents opposite rules.
|
|
7
|
+
- Never shorten a quote into a stronger rule ("don't regrade his finished versions without asking him" is not "never regrade"), and never turn a direction into a number the person did not give.
|
|
@@ -15,7 +15,8 @@ You own one issue tree from its first decision to the merge that closes it. The
|
|
|
15
15
|
- Check each claim against the code as fetched now (the default branch your addressing line names, or the head under review), never the workspace as it was at admission, and tell every fresh reader you dispatch to do the same: the branch may have moved since.
|
|
16
16
|
- Before you end a turn that waits on a human, open what they must answer: a decision block, a `dispatch ask` or `dispatch request-approval`. A turn that ends with nothing open asks nobody, and the tree stops.
|
|
17
17
|
- Deliver every criterion of the root spec in this tree. The only way to move work out is a child issue you create and own, or, when a root splits, a `dispatch ask` for the rest: work outside has no owner.
|
|
18
|
-
- A problem outside the tree is a `dispatch ask`, never an issue you file, because a person decides whether it needs one (`skill://legion-worker/references/findings.md`).
|
|
18
|
+
- A problem outside the tree is a `dispatch ask`, never an issue you file, because a person decides whether it needs one (`skill://legion-worker/references/findings.md`). A clear defect is the exception. Fix one in code this tree touches or depends on in this tree's pull request. Send any other to the controller, which gives it to the tree that owns that code.
|
|
19
|
+
- Before you write a spec or ask a person anything, read the repository's `STRATEGY.md` when it has one, then use a standard best-practice solution; ask only what neither settles, with one recommendation. A design that crosses a Boundary in that file goes to its owner before it is built. Find the standard with a web search and with how two or three well-regarded projects solve the problem. Cite them in a few lines of the spec's `Design`. A design far from the standard is a sign to fix the underlying problem, not to add a workaround.
|
|
19
20
|
- Write lifecycle changes with the `legion` tool, which takes Dispatch issue keys (`LEGION-41`). Never apply a label: Legion has none.
|
|
20
21
|
- Message a phase worker with `envoy_publish` to `notifications.role.<token>`, with a token you hold (yours or your addressing line's) or one `roleToken` from `@legion/contracts` computes: a hand-made token may reach nobody.
|
|
21
22
|
- Deployment instructions override this skill where they conflict: they are the operator's rules (required checks, deploy commands, code owners, standing roles you may consult, the merge credential).
|
|
@@ -32,8 +33,9 @@ You own one issue tree from its first decision to the merge that closes it. The
|
|
|
32
33
|
|
|
33
34
|
## 2. Children in flight
|
|
34
35
|
|
|
35
|
-
-
|
|
36
|
+
- Set a child's dependencies in one call naming every issue it waits on: `dispatch issue-update --issue <child> --blocked-by <a> --blocked-by <b>`, or `--blocked-by` on `dispatch issue` at creation. The call replaces the child's whole list, so read its existing links first (`dispatch read`). Release it with the rest: `legion({ op: "release_children", issues: ["LEGION-41", "LEGION-42"] })`. Legion holds a released child that waits on an issue not `done` and starts it itself at its last blocker's close. A child that builds on another repository's merged change is not held this way: release it as `skill://legion-architect/references/decomposition.md` "Across repositories" says.
|
|
36
37
|
- On each `child-closed`, read the child's handoff. Edit the spec of each open child the result changes, take out each child it makes unneeded with `park_child` and say why with `dispatch comment`, and release each child that can now start.
|
|
38
|
+
- Before you park a child for good (one made unneeded, or parked so its tree can finish), set the `--blocked-by` list of each sibling that waits on it again without it (one call with the rest of its list, or `--clear-blocked-by` when it was the only one), or park that sibling too: a parked child is stopped, not done, and its dependents stay held with no notice. A park followed by `rerun_child` keeps its dependents' links: they wait through the rerun and start when the rerun's merge closes the child.
|
|
37
39
|
- A released child runs in your tree's admission slot, never its own, and never becomes a root while your tree is live.
|
|
38
40
|
|
|
39
41
|
## 3. Children complete
|
|
@@ -58,7 +60,7 @@ The reviewer's `phase-finished` with an `APPROVED` review puts the issue in `acc
|
|
|
58
60
|
- the reviewer's approval of that head by SHA (`gh api --paginate repos/<o>/<r>/pulls/<n>/reviews`);
|
|
59
61
|
- each of the reviewer's prose findings, checked against the code at that head and command output, not against the reviewer's own verdict: no other agent has read that prose.
|
|
60
62
|
|
|
61
|
-
Accept only when each acceptance line has passing evidence at the approved head, every corrective child and (for a root) the integration child has closed, and no criterion left the tree. Post that evidence as a `dispatch comment`, then `legion({ op: "sign_off", issue: "<KEY>" })`.
|
|
63
|
+
Accept only when each acceptance line has passing evidence at the approved head, every corrective child and (for a root) the integration child has closed, and no criterion left the tree. A finding ask on the issue holds the acceptance until it is resolved or carries the controller's reply (`skill://legion-architect/references/acceptance.md`). Post that evidence as a `dispatch comment`, then `legion({ op: "sign_off", issue: "<KEY>" })`.
|
|
62
64
|
|
|
63
65
|
- `sign_off` works only in `accepting` (`SIGNOFF_OUTSIDE_ACCEPTING`) and is refused 409 `SIGNOFF_CHILD_IN_WORKFLOW` while any issue beneath this one is in the workflow, naming each: wait for the last, or take one out with `park_child`.
|
|
64
66
|
- When an acceptance check fails: `request_backward_move` with `issue`, `to` (`implementing` or `testing`) and a `reason` naming the failure. It counts a review round.
|
|
@@ -76,4 +78,5 @@ Handle each delivered wake by its row in `skill://legion-architect/references/wa
|
|
|
76
78
|
|
|
77
79
|
- `envoy_publish` to the controller (its topic is on your addressing line) a child that serves no criterion of the root, a need for admission slots, and two trees changing the same code, because only it sees other trees. Handle everything else.
|
|
78
80
|
- A decision that needs the human, yours or a worker's, is a decision block you write, never the worker, because a new version of an approved root spec closes the gate.
|
|
81
|
+
- A clear defect the controller hands you is in code your tree owns, so it is work inside the tree. Add it to an open child whose pull request touches that code. File a child (`dispatch issue --parent`) only when none does. Reply under its evidence comment with the issue that carries it. Change no root spec for it: a child's spec is never gated, and a new root-spec version closes the gate (`skill://legion-architect/references/design-gate.md`, "After approval"). Only a fix that would change the root's Summary, Acceptance or scope is a decision block instead.
|
|
79
82
|
- A tool a worker cannot get is yours: a pull request changing `sjawhar/legion`'s worker image (`skill://legion-worker/references/tools.md`).
|
|
@@ -33,6 +33,13 @@ legion({ op: "sign_off", issue: "LEGION-40" })
|
|
|
33
33
|
- `handoff_complete` from you in `accepting` is refused `ACCEPTANCE_IS_SIGN_OFF`. CI red at the head
|
|
34
34
|
in `accepting` returns the issue to `implementing` by the daemon's table.
|
|
35
35
|
- No `Production:` line is asked here: the production check is the implementer's, after the close.
|
|
36
|
+
- A finding ask on the issue holds the acceptance: one a worker sent you, or one `dispatch read`
|
|
37
|
+
lists under `Open asks:` whose question opens `Finding from ` or `Clear defect from `
|
|
38
|
+
(`skill://legion-worker/references/findings.md`, "When no controller takes it"). Follow each
|
|
39
|
+
(`dispatch follow --ask <id> --action follow`) and, once it is answered, publish its reference
|
|
40
|
+
to the controller topic. Accept only once each is resolved, or carries the controller's
|
|
41
|
+
`Filed dispatch://`, `Handed dispatch://` or `Not filed:` reply, because a closed issue hides its
|
|
42
|
+
asks from the controller.
|
|
36
43
|
|
|
37
44
|
## The order after your acceptance
|
|
38
45
|
|
|
@@ -128,17 +135,20 @@ The merge closes the issue: when GitHub reports the pull request merged while th
|
|
|
128
135
|
every member's open production check has closed.
|
|
129
136
|
|
|
130
137
|
Nothing of the production check is yours. Its record lives on the pull request alone, since
|
|
131
|
-
Dispatch refuses a write on a closed issue
|
|
132
|
-
|
|
133
|
-
|
|
138
|
+
Dispatch refuses a write on a closed issue. A defect it finds is never an issue the implementer
|
|
139
|
+
files: a clear defect goes to the controller, and any other is a `dispatch ask`. `read_record`
|
|
140
|
+
shows a closed issue's open check (`check`: the pull request, the merge commit, the looks, what
|
|
141
|
+
woke the last one and when the next is due).
|
|
134
142
|
|
|
135
143
|
## Hand-over at a root's linger
|
|
136
144
|
|
|
137
145
|
When a person closes a root and it stays `done` through its linger, each child still in the
|
|
138
146
|
workflow is handed to Legion as a root of its own: `todo` with the `legion` label, its phase, gate,
|
|
139
|
-
phase records and pull request carried into a new generation, and that phase's role started.
|
|
140
|
-
child
|
|
141
|
-
|
|
147
|
+
phase records and pull request carried into a new generation, and that phase's role started. A
|
|
148
|
+
child that never started but still waits on an unfinished issue is handed over too, carrying no
|
|
149
|
+
run: it waits in the line until its blockers are done, and its architect starts as a fresh root
|
|
150
|
+
and registers its own spec. The child stays its own tree; reopening the old root does not take it
|
|
151
|
+
back. Park a child with `park_child` before then when its work should stop with the root.
|
|
142
152
|
|
|
143
153
|
If you are that child's architect:
|
|
144
154
|
|
|
@@ -19,7 +19,9 @@ Put every adopted child into the first wave and release it with
|
|
|
19
19
|
`legion({ op: "release_children", issues: ["LEGION-41", "LEGION-42"] })`. The daemon runs nothing on
|
|
20
20
|
a child until it is released. Once it is released, the daemon moves it to `todo` and, while the
|
|
21
21
|
root's design gate is open, starts its phases itself. It starts no sub-architect, and you start no
|
|
22
|
-
worker.
|
|
22
|
+
worker. A release is accepted whole whatever the `--blocked-by` links say: its answer names
|
|
23
|
+
`started` and `held` (each held child with the issues it waits on) beside `released`, and a held
|
|
24
|
+
child waits in your tree until Legion starts it.
|
|
23
25
|
|
|
24
26
|
## Creating children
|
|
25
27
|
|
|
@@ -56,8 +58,10 @@ creation, because the daemon fixes it when it records the child.
|
|
|
56
58
|
Release a child that depends on another repository's change only after that change's pull request
|
|
57
59
|
merges, because the child's work must build on the merged change. Name the merged commit in its
|
|
58
60
|
task (`gh api repos/<owner>/<repo>/pulls/<n> --jq .merge_commit_sha`); for a repository that pins the
|
|
59
|
-
other one by commit (a lock file or dependency pin), the pin is that commit.
|
|
60
|
-
|
|
61
|
+
other one by commit (a lock file or dependency pin), the pin is that commit. Do not hold such a
|
|
62
|
+
child with `--blocked-by` instead, because Legion would start it at the blocker's close, before you
|
|
63
|
+
name the merged commit. Read the other repositories with your gh's read-only access
|
|
64
|
+
(`-R owner/repo`).
|
|
61
65
|
|
|
62
66
|
## Architecture components
|
|
63
67
|
|
|
@@ -6,13 +6,13 @@ edit to an approved root spec, and on `design-approved`, `design-changes-request
|
|
|
6
6
|
|
|
7
7
|
## Writing the root spec
|
|
8
8
|
|
|
9
|
-
Specifications written into Dispatch follow
|
|
10
|
-
[
|
|
9
|
+
Specifications written into Dispatch follow
|
|
10
|
+
[`dispatch-writing-specs`](skill://dispatch-writing-specs/SKILL.md#the-outline). Wave releases, child closures and your
|
|
11
11
|
own status are visible from the issue tree and the handoffs; do not narrate them into the spec or a
|
|
12
12
|
`dispatch message`.
|
|
13
13
|
|
|
14
14
|
Extend the primary document in place: a new version adds only the evidence each decision needs and
|
|
15
|
-
what the human decides, each as a [decision block](skill://dispatch/SKILL.md#
|
|
15
|
+
what the human decides, each as a [decision block](skill://dispatch/SKILL.md#asks-and-ask-blocks).
|
|
16
16
|
Never post a second "spec" artifact beside it: `dispatch artifact` with the primary document's name
|
|
17
17
|
replaces the human's document.
|
|
18
18
|
|
|
@@ -37,22 +37,27 @@ When the gate is armed, run this exact sequence before the tree's work starts:
|
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
2. Settle every decision block as
|
|
40
|
-
[Approval
|
|
40
|
+
[Approval](skill://dispatch-writing-specs/SKILL.md#approval) says;
|
|
41
41
|
`dispatch request-approval` refuses while one is open. Each answer reaches you, since you follow
|
|
42
42
|
every ask you open.
|
|
43
|
-
3.
|
|
44
|
-
relies on, and the human's words
|
|
43
|
+
3. Before every approval request, give two fresh reviewers the current root spec, the code and
|
|
44
|
+
command output it relies on, and the human's words: `task(agent="plan-gap-analyst")` finds its
|
|
45
|
+
gaps, and `task(agent="plan-reviewer")`, told the document is a spec, checks each factual claim
|
|
46
|
+
against the code, the docs or a read-only command it runs. Resolve every finding in the root
|
|
47
|
+
spec. Check with a command each claim either reviewer marks unverified: fix it when it is
|
|
48
|
+
false, or take it out.
|
|
45
49
|
4. Request approval only once the human has agreed to every point in the spec, because the human
|
|
46
50
|
approves what they already agreed to and a point new in the request has no decision block for
|
|
47
51
|
them to answer: give such a point its own decision block first, or take it out of the spec.
|
|
48
52
|
|
|
49
53
|
```bash
|
|
50
|
-
dispatch request-approval --issue <root issue> --summary '<what the human is approving>'
|
|
54
|
+
dispatch request-approval --issue <root issue> --summary '<what the human is approving> Reviews: <gap result>, <claim result>.'
|
|
51
55
|
```
|
|
52
56
|
|
|
53
|
-
`--summary` says in one to three sentences what the human is approving and nothing else
|
|
54
|
-
commentary and no open question
|
|
55
|
-
`
|
|
57
|
+
`--summary` says in one to three sentences what the human is approving and nothing else (no
|
|
58
|
+
commentary and no open question), then one sentence with both reviews' results, for example
|
|
59
|
+
`Reviews: no open gap, 14 of 14 claims verified.` The primary document is the default; the
|
|
60
|
+
command prints `Approval requested for spec.md (document id <UUID>) at version <N> (ask <id>)`.
|
|
56
61
|
5. Register that document version with the daemon:
|
|
57
62
|
|
|
58
63
|
```ts
|
|
@@ -81,13 +86,22 @@ Facts about the request:
|
|
|
81
86
|
again to hand the same request back at the latest version.
|
|
82
87
|
- If the output reads `spec.md (document id <UUID>) is already approved at version <N>`, still call
|
|
83
88
|
`register_gate` with that id and version: the daemon reads the approval from Dispatch as it
|
|
84
|
-
registers, opens the gate and delivers `design-approved` at once
|
|
85
|
-
|
|
89
|
+
registers, opens the gate and delivers `design-approved` at once, and only once even when the
|
|
90
|
+
approval's own event opened the gate first. The same read covers a human who answers between
|
|
91
|
+
your two calls: a changes request on that version arrives as `design-changes-requested`, once.
|
|
92
|
+
You never approve anything yourself.
|
|
93
|
+
- `register_gate` refused 409 `VERSION_NOT_IN_DISPATCH` means the version you named is above the
|
|
94
|
+
latest version Dispatch holds for that document (the message names both), and a version Dispatch
|
|
95
|
+
never wrote is no registration: the gate is as it was. Read the document's latest version, check
|
|
96
|
+
it is the spec the human is asked to approve, and `register_gate` that version.
|
|
86
97
|
|
|
87
98
|
Then end your turn. Release no wave until a delivered wake shows `design-approved` on the root. On
|
|
88
|
-
`design-changes-requested`: revise the spec as the human's reason asks, run
|
|
89
|
-
|
|
90
|
-
|
|
99
|
+
`design-changes-requested`: revise the spec as the human's reason asks, run step 3's two reviews on
|
|
100
|
+
the new version, resolve every finding, request approval again and end your turn. A
|
|
101
|
+
`design-changes-requested` may name a version below the latest, or arrive after another for the
|
|
102
|
+
same version: it is a request the human made that reached the daemon late, and no approval came
|
|
103
|
+
after it. Each request arrives once. The gate is as the newest review left it; still read the
|
|
104
|
+
reason, and answer it in the spec if the latest version does not already.
|
|
91
105
|
|
|
92
106
|
## After approval
|
|
93
107
|
|
|
@@ -110,8 +124,9 @@ to the version it writes. Once they have answered:
|
|
|
110
124
|
daemon sent opens nothing new. Carry on, and release no wave because of it.
|
|
111
125
|
- When the answer changes the Summary, the Acceptance or the tree's scope, rewrite that text and
|
|
112
126
|
repeat steps 3 to 5 on the new version, with a one-sentence `--summary` naming what changed since
|
|
113
|
-
the earlier approval (the card shows that approval, `Approved at
|
|
114
|
-
and its `Show diff` control carries the detail). The rewrite
|
|
127
|
+
the earlier approval, then the reviews' sentence (the card shows that approval, `Approved at
|
|
128
|
+
version N on <date> by <who>.`, and its `Show diff` control carries the detail). The rewrite
|
|
129
|
+
closes the gate until they approve;
|
|
115
130
|
work the daemon started at the answer keeps running. Release no new wave until the `design-approved`
|
|
116
131
|
after the rewrite; work already in flight continues. Every merger's `READY` in the tree is
|
|
117
132
|
refused until a human approves the latest version.
|
|
@@ -19,14 +19,14 @@ and 7 (a conflict, the hand-over, the close) is in
|
|
|
19
19
|
| Wake | Procedure |
|
|
20
20
|
| --- | --- |
|
|
21
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 released any READY it refused and started any child waiting on it. It is not `design-approved`: do not proceed to section 2 or release a wave because of it, and start nothing. |
|
|
22
|
-
| `child-status` | A child of your tree left the workflow or re-entered it; the
|
|
23
|
-
| `child-closed` | Read the child completion and remaining open children. Re-scope open work, park obsolete work with `park_child
|
|
22
|
+
| `child-status` | A child of your tree left the workflow or re-entered it; the reason names the child and its new status. `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 daemon has suspended its workers, and it advances no further until it is set back to `todo`. What the rest of the tree does is your decision. |
|
|
23
|
+
| `child-closed` | Read the child completion and remaining open children. Re-scope open work, park obsolete work for good with `park_child` (first take its link off each sibling that waits on it, or park that sibling too, as section 2 says), and release an appropriate next wave with `release_children`. 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). |
|
|
24
24
|
| `child-release-stalled` | Its `reason` names a child your `release_children` released while Dispatch already showed it `todo`, and that child's parent, whose release has not reached the daemon after three tries. Read the parent's record with the `legion` tool's `read_record` (`issue` the parent); run `release_children` for the child again once the parent is recorded in your tree, and tell the controller if it never is. |
|
|
25
25
|
| `child-not-recorded` | Its `reason` names a child your tree did not record and why: its repository resolves to none (neither it nor an ancestor names one, and the project has no default), or to one not mapped to the project, or to one the daemon leaves out for a missing GitHub App. The daemon said why on the child too. Set the child's repository to one of the project's (`dispatch issue-update --repo owner/name`), then release it again with `release_children`; tell the controller when the repository it needs is not served. |
|
|
26
26
|
| `design-approved` | Its `version` is the approved one. A human approved the root spec document at its current version; the gate is open. Proceed to section 2 — except on a root whose catch-up said `handed_over`: its workers already run their phases, so start nothing; the approval releases any READY the gate refused. One whose `version` is the version a human's own answer to a decision block wrote, after an earlier approval (Dispatch carried that approval to it, "After approval" in `skill://legion-architect/references/design-gate.md`), opens nothing new: carry on, and release no wave because of it. |
|
|
27
|
-
| `design-changes-requested` | Its `version` and `reason`. A human asked for changes to the root spec at `version`, for `reason`. Revise the spec as the reason asks and request approval again as "The armed gate" in `skill://legion-architect/references/design-gate.md` says; end your turn; the gate is closed. |
|
|
27
|
+
| `design-changes-requested` | Its `version` and `reason`. A human asked for changes to the root spec at `version`, for `reason`. Revise the spec as the reason asks and request approval again as "The armed gate" in `skill://legion-architect/references/design-gate.md` says; end your turn; the gate is closed. 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. |
|
|
28
28
|
| `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 committed handoff for the finishing phase; 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, Acceptance, scope and 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` or send it back with `request_backward_move`. A `tester` notice with `verdict: "fail"` — its handoff carries `implementerProof.verdict: "rejected"`, or a failure naming the production-like proof — has gone back to the **implementer** by the daemon's table; never supply the proof 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: file a child issue in this tree to build the surface (infrastructure, tooling, or a skill), and when that child's `child-closed` arrives, tell the waiting worker to continue with `envoy_publish` to its role topic. That report is never a reason to advance the phase. |
|
|
29
|
-
| `pr-blocked` | Its `reason` names the pull request and the `max_fix_attempts` it reached, or reads `Issue reached review_round_cap=<N>.` (the end of this row). The count is of heads pushed onto a red verdict that changed something outside `.legion/` — handoff-only pushes (`.legion/` paths only) never count, a push by the review App (a planner's, tester's, reviewer's or architect's) never counts, and the head after a red the tester's red tests earned (a review-App push that changed a path outside `.legion/`, however many handoff-only pushes follow it) does not count either — so after the tester's handoff-only push onto the implementer's red, the implementer's next push does count; a push the daemon cannot classify (a listener without `changed_paths`, a list the listener stopped at 100 paths or 32,768 runes of text, a push listing no commits) does. Published once per exhausted count, not on every later red verdict for that count. Read the failed CI evidence and recovery attempts. The notice moves nothing, and no later CI red within the attempt that ran the count out (the counted head, and every head pushed on top of it until a push lands on a head CI judged green or on a settled head whose base branch requires no check and no workflow, the tester's red tests and handoff onto the held red included) sends the work back from `testing`, `reviewing`, `accepting`, `retro` or `merging` either: the issue stays in its phase until you move it, or a worker's own decision does (a tester's `fail`, a reviewer's request for changes). A head pushed onto green CI, or onto a settled head whose base branch requires no check and no workflow, leaves that attempt, so its red still comes as a `checks-red`. In `implementing`, give the implementer the failing checks (`envoy_publish` to its role topic). In any later phase a worker holds, tell that worker (`envoy_publish` to its role topic) to move the issue back to `implementing` with `request_backward_move`, naming the failing checks, and the daemon starts the implementer; or file a corrective child. In `accepting`, where no worker holds a phase, the move is yours: `request_backward_move` with `issue`, naming the failing checks. In `awaiting_merge`, where no worker holds a phase and a backward move is refused, open a `dispatch ask` naming the failing checks for the human who merges. Do not treat the blocked PR as final. A `review_round_cap` reason is the implementer's round count instead: every move back to an earlier phase counts one, and the notice comes again with each round past the cap. It moves nothing either, 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 a conflict (`the head conflicts with <base>`), the required checks that failed (`CI is red at <head>`), or the merge queue's failed merge and its failing run (`the merge queue took pull request #<n> out at READY's head …`); 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. Judge the cap by the rounds that are not conflicts. Conflict returns need nothing from you beyond the next round. Tester fails, requests for changes and CI-red returns (a `checks-red` notice is raised for CI only when a required check fails on code the branch pushed, or when the merge queue fails the merge) are the rounds the cap is for. 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 acceptance lines the next round answers; a correctness finding is still fixed in this pull request, and
|
|
29
|
+
| `pr-blocked` | Its `reason` names the pull request and the `max_fix_attempts` it reached, or reads `Issue reached review_round_cap=<N>.` (the end of this row). The count is of heads pushed onto a red verdict that changed something outside `.legion/` — handoff-only pushes (`.legion/` paths only) never count, a push by the review App (a planner's, tester's, reviewer's or architect's) never counts, and the head after a red the tester's red tests earned (a review-App push that changed a path outside `.legion/`, however many handoff-only pushes follow it) does not count either — so after the tester's handoff-only push onto the implementer's red, the implementer's next push does count; a push the daemon cannot classify (a listener without `changed_paths`, a list the listener stopped at 100 paths or 32,768 runes of text, a push listing no commits) does. Published once per exhausted count, not on every later red verdict for that count. Read the failed CI evidence and recovery attempts. The notice moves nothing, and no later CI red within the attempt that ran the count out (the counted head, and every head pushed on top of it until a push lands on a head CI judged green or on a settled head whose base branch requires no check and no workflow, the tester's red tests and handoff onto the held red included) sends the work back from `testing`, `reviewing`, `accepting`, `retro` or `merging` either: the issue stays in its phase until you move it, or a worker's own decision does (a tester's `fail`, a reviewer's request for changes). A head pushed onto green CI, or onto a settled head whose base branch requires no check and no workflow, leaves that attempt, so its red still comes as a `checks-red`. In `implementing`, give the implementer the failing checks (`envoy_publish` to its role topic). In any later phase a worker holds, tell that worker (`envoy_publish` to its role topic) to move the issue back to `implementing` with `request_backward_move`, naming the failing checks, and the daemon starts the implementer; or file a corrective child. In `accepting`, where no worker holds a phase, the move is yours: `request_backward_move` with `issue`, naming the failing checks. In `awaiting_merge`, where no worker holds a phase and a backward move is refused, open a `dispatch ask` naming the failing checks for the human who merges. Do not treat the blocked PR as final. A `review_round_cap` reason is the implementer's round count instead: every move back to an earlier phase counts one, and the notice comes again with each round past the cap. It moves nothing either, 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 a conflict (`the head conflicts with <base>`), the required checks that failed (`CI is red at <head>`), or the merge queue's failed merge and its failing run (`the merge queue took pull request #<n> out at READY's head …`); 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. Judge the cap by the rounds that are not conflicts. Conflict returns need nothing from you beyond the next round. Tester fails, requests for changes and CI-red returns (a `checks-red` notice is raised for CI only when a required check fails on code the branch pushed, or when the merge queue fails the merge) are the rounds the cap is for. 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 acceptance lines the next round answers; 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 this pull request does not touch. **Split**: part of the work cannot settle in this pull request. On a child, file that part as a child of this issue's parent, never of this one (a parent waits in `accepting` for every child, and the split part usually builds on this pull request's unmerged code): `dispatch issue --project <project> --parent <parent> --title '<outcome>' --blocked-by <this issue> --spec-file -`. Release it now with `release_children`: Legion holds it on that `--blocked-by` link until this issue closes, and starts it then. On the root, narrow it to what settles here and open a `dispatch ask` for the rest (`skill://legion-worker/references/findings.md`): a person decides whether that becomes an issue. Tell the implementer and the reviewer that this pull request no longer carries 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. A finding that changes what the spec accepts is a decision block in the root spec ("After approval" in `skill://legion-architect/references/design-gate.md`), and `dispatch ask` is only for a decision that needs a human's authority; neither replaces the choice. Judge a worker's backward move by the reason that worker gives. A move you ordered for a conflict found before `awaiting_merge` ("A conflicting head" in `skill://legion-architect/references/acceptance.md`) is a conflict return. The merger's move back to `reviewing` for a READY refusal (`READY_UNREVIEWED_CHANGE`, or `READY_NOT_APPROVED` when its task names no approved head), and the reviewer's no-fix request for changes that follows it so the tester runs the head, are not the work going in circles either. A move that sends back code found wrong counts with the tester fails. |
|
|
30
30
|
| `pr-merged` | The pull request merged and the issue did not close; its `reason` says why. Merged before the issue reached `awaiting_merge`: the workflow runs on, and the merge closes the issue the moment it gets there, your acceptance and retro first. Merged while the rest of the tree still runs: the reason names the pull request and every issue the close waits for, and the root waits in `awaiting_merge`, slot and 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. |
|
|
31
31
|
| `pr-closed-unmerged` | Decide from current scope whether the work is reopened, started over (`park_child` then `rerun_child`, for a child), or ended with a reason. Delegate the repository action to the responsible phase worker and keep ownership. |
|
|
32
32
|
| `merge-refused` | GitHub refused the daemon's submission of READY's merge in a way a retry would meet again, so it submits that merge no further: ask a person with `dispatch ask` to fix the repository setting or App permission and merge at READY's head (`skill://legion-architect/references/merge-notices.md#merge-refused`). |
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: legion-controller
|
|
3
|
-
description: Use when you are a Legion project's controller session, on any controller wake (triage, slot-free, todo, tick, unslotted, held, worker-died), weekly-plan ranking, backlog stewardship, a finding ask, an issue a person asks you to file, the daily report, an architect's escalation, or a person's message or mention.
|
|
3
|
+
description: Use when you are a Legion project's controller session, on any controller wake (triage, slot-free, todo, tick, unslotted, held, worker-died), weekly-plan ranking, backlog stewardship, a clear defect or finding ask a role sends, an issue a person asks you to file, the daily report, an architect's escalation, or a person's message or mention.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Legion Controller
|
|
7
7
|
|
|
8
8
|
If this skill disagrees with the code, a command's output or its `--help`, follow those and say which line of this skill is wrong.
|
|
9
9
|
|
|
10
|
-
You are the one persistent, wake-driven session of a Legion project. You start no work yourself
|
|
10
|
+
You are the one persistent, wake-driven session of a Legion project. You start no work yourself,
|
|
11
|
+
except a clear defect a role reports ([Issues handed to Legion](#issues-handed-to-legion)).
|
|
11
12
|
|
|
12
13
|
## Rules
|
|
13
14
|
|
|
@@ -21,7 +22,7 @@ You are the one persistent, wake-driven session of a Legion project. You start n
|
|
|
21
22
|
- Never edit a repository, push a commit or call `handoff_complete`, and never forward a raw event to an architect, because the daemon runs the phases and raw events only fill the architect's context.
|
|
22
23
|
- Never open a design gate, because only a person's approval of the root's spec in Dispatch opens it.
|
|
23
24
|
- When a `dispatch` command fails, or a `curl` read fails or prints no JSON array, act on nothing it would decide and name its first line in your summary (the turn's last message), because an empty read is no evidence.
|
|
24
|
-
- Write every Dispatch comment, message and ask as `skill://dispatch`'s "
|
|
25
|
+
- Write every Dispatch comment, message and ask as `skill://dispatch-writing-specs`'s "Rules for the text" say.
|
|
25
26
|
|
|
26
27
|
Launch, `gh`, pull requests, takeover: `skill://legion-controller/references/session.md`.
|
|
27
28
|
|
|
@@ -62,6 +63,7 @@ Wake details: `skill://legion-controller/references/wakes.md`.
|
|
|
62
63
|
| `worker-died on <KEY>` (`role: "architect"`) | Re-admit once its cause is gone, else park it |
|
|
63
64
|
| An architect's escalation | `skill://legion-controller/references/escalation.md` |
|
|
64
65
|
| A finding ask's reference, or its answer | `skill://legion-controller/references/finding-asks.md` |
|
|
66
|
+
| A clear defect a role sends | `skill://legion-controller/references/finding-asks.md#hand-over-a-clear-defect` |
|
|
65
67
|
| A finding sent as text | Open an ask ([Findings](#findings-and-the-issues-you-file)) |
|
|
66
68
|
| READY, a scope question, a routing request | `skill://legion-controller/references/backlog-stewardship.md` |
|
|
67
69
|
| A GitHub mention | Answer it, or route it to the owning architect |
|
|
@@ -77,13 +79,18 @@ claim is free; claim it again.` to `notifications.role.<issues.<KEY>.architect.l
|
|
|
77
79
|
## Issues handed to Legion
|
|
78
80
|
|
|
79
81
|
The daemon works only issues carrying the Dispatch label `legion` (any case). Work reaches Legion
|
|
80
|
-
|
|
82
|
+
by a person's decision: they set the label from the issue header, or ask you to (a direct
|
|
81
83
|
message, a Slack request that asks Legion to do the work, their answer to a finding ask, or a
|
|
82
|
-
ruling the weekly plan records with its link).
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
for
|
|
84
|
+
ruling the weekly plan records with its link). The one exception is a clear defect a role hands
|
|
85
|
+
you whose code no running tree owns: you file it with the label, because its fix is how to do work
|
|
86
|
+
a person already wants, and humans decide what, agents decide how (the operator's answer on one
|
|
87
|
+
such case: a clear defect is fixed, not asked about). A defect whose code a running
|
|
88
|
+
tree owns is that tree's, and you file nothing for it. Label an issue only then, because
|
|
89
|
+
a labelled root in `todo` is admitted, so an unasked label starts unasked work. Never take a
|
|
90
|
+
person's label off, because it is their decision. Label an issue before you `set_status` it to
|
|
91
|
+
`todo`, because `todo` admits only a labelled root. How:
|
|
92
|
+
`skill://legion-controller/references/triage.md` "Label an issue for a person". Admission states:
|
|
93
|
+
`skill://legion-controller/references/admission.md`.
|
|
87
94
|
|
|
88
95
|
## Free slots
|
|
89
96
|
|
|
@@ -91,9 +98,11 @@ A free slot is no reason to take an issue: a labelled root in `todo` takes the n
|
|
|
91
98
|
`admission.waiting` without you, and a parked issue (status `backlog` or `icebox`) means "do not
|
|
92
99
|
run now". Move an issue out of `backlog` or `icebox` only on a request or a plan ruling that names
|
|
93
100
|
it, and cite that request. The free slots are `admission.cap` minus the roots in
|
|
94
|
-
`admission.active` and `admission.waiting
|
|
101
|
+
`admission.active` and the roots in `admission.waiting` that are not in `admission.blocked`, since
|
|
102
|
+
a blocked root takes no slot until its blockers are done. Every move to `todo` you make is one of
|
|
103
|
+
these:
|
|
95
104
|
|
|
96
|
-
- a root a person handed over, at triage;
|
|
105
|
+
- a root a person handed over, or a root you filed for a clear defect no tree owns, at triage;
|
|
97
106
|
- an issue a person asks you to start;
|
|
98
107
|
- a tree you re-admit after its architect failed or after a hold, once you checked its cause is
|
|
99
108
|
gone, or because a person asks;
|
|
@@ -102,11 +111,14 @@ it, and cite that request. The free slots are `admission.cap` minus the roots in
|
|
|
102
111
|
## Findings, and the issues you file
|
|
103
112
|
|
|
104
113
|
File an issue only when a person asks you to (a direct message, a Slack request, or their answer
|
|
105
|
-
to a finding ask),
|
|
106
|
-
a role
|
|
107
|
-
`skill://legion-
|
|
108
|
-
|
|
109
|
-
`
|
|
114
|
+
to a finding ask), for a clear defect no running tree owns, and the report issue. A clear defect,
|
|
115
|
+
yours or a role's, goes first to the tree that owns its code, and becomes a Legion root only when
|
|
116
|
+
no tree does: `skill://legion-controller/references/finding-asks.md#hand-over-a-clear-defect`.
|
|
117
|
+
Every other problem is a finding: one you find, or one a role sends you as text. Open a
|
|
118
|
+
`dispatch ask` for it on the report issue, as `skill://legion-worker/references/findings.md` says,
|
|
119
|
+
and file nothing until a person answers, because a person decides whether it needs an issue and
|
|
120
|
+
where. Each issue you file carries a `Filed for` line:
|
|
121
|
+
`skill://legion-controller/references/finding-asks.md`.
|
|
110
122
|
|
|
111
123
|
## Daily report
|
|
112
124
|
|
|
@@ -117,4 +129,5 @@ and why, and what runs: `skill://legion-controller/references/daily-report.md`.
|
|
|
117
129
|
|
|
118
130
|
The operator's deployment instructions in your system prompt (required checks, deploy commands,
|
|
119
131
|
code owners, roles you may consult) override this skill where the two conflict, and may narrow
|
|
120
|
-
what you label for Legion. They never hand Legion work,
|
|
132
|
+
what you label for Legion. They never hand Legion work: a person does, or a role reports a clear
|
|
133
|
+
defect.
|
|
@@ -7,7 +7,8 @@ waits, or neither. Read its key against `admission` and its tree's root.
|
|
|
7
7
|
| What `read_state` shows | What it means | What you do |
|
|
8
8
|
|---|---|---|
|
|
9
9
|
| The key is in `admission.active` | A root holding a slot: its tree runs, `admitted` until its architect starts the first phase | Nothing, beyond [trees waiting on a root claim](skill://legion-controller/SKILL.md#trees-waiting-on-a-root-claim) |
|
|
10
|
-
| The key is in `admission.waiting` | A root handed to Legion in `todo`, queued in Dispatch rank order for the next free slot | Nothing: it takes the next free slot by itself |
|
|
10
|
+
| The key is in `admission.waiting` and not in `admission.blocked` | A root handed to Legion in `todo`, queued in Dispatch rank order for the next free slot | Nothing: it takes the next free slot by itself |
|
|
11
|
+
| The key is in `admission.waiting` and in `admission.blocked` | A root in the line that waits on the Dispatch issues `admission.blocked` names: admission passes it over, and it takes no slot, until every one of them is `done` | Nothing: the wait ends when each blocker reaches `done` (a person's close, or the blocker's own merge) or its link is taken off (by a person or the tree's architect). Name the wait in the day's report |
|
|
11
12
|
| `phase: admitted`, in neither list, and Dispatch shows a `child_of` parent | A child: 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 | 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 |
|
|
12
13
|
| `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 |
|
|
13
14
|
| `phase: done` while `status` is `in_progress`, `testing`, `needs_review` or `retro` | Someone other than Legion moved it to a running tree's status while Legion was not running it. A root that waited for a slot is taken out of the workflow at that move, since no slot would ever reach it, and the daemon sends the `unslotted` wake; a parked child stays parked. Legion starts nothing for either | Re-admit nothing yourself: `dispatch read` shows who works it now. Name it in your summary; `todo` with the `legion` label queues it again |
|
|
@@ -53,11 +53,26 @@ For a READY packet, confirm the Dispatch record and leave the merge to the daemo
|
|
|
53
53
|
use a GitHub credential to merge from the controller, because the daemon submits the merge itself
|
|
54
54
|
at READY's head.
|
|
55
55
|
|
|
56
|
+
## The owner audit
|
|
57
|
+
|
|
58
|
+
At each pass, read `dispatch issues --project <KEY> --priority 0 --priority 1 --all`:
|
|
59
|
+
|
|
60
|
+
- An unclaimed row in `triage`, `icebox`, `backlog` or `todo` is a decision: someone builds it, or
|
|
61
|
+
it closes. A claimed or in-flight row already has an owner.
|
|
62
|
+
- A close that says a defect cannot happen cites the code that prevents it; without that, the issue
|
|
63
|
+
is unread, not foreclosed.
|
|
64
|
+
- A plan or measurement nobody builds needs an owner.
|
|
65
|
+
- A merged pull request names an issue not yet in `testing` or `done`: check it live, then move it.
|
|
66
|
+
- Someone repeats the issue's work by hand: fix its status.
|
|
67
|
+
- A route nobody holds (`--route-status no_holder`, any priority), after the two reads that
|
|
68
|
+
"Recovering stopped-session work" names: staff the role, route the issue to a live holder, or
|
|
69
|
+
clear the route and assign it.
|
|
70
|
+
|
|
56
71
|
## Recovering stopped-session work
|
|
57
72
|
|
|
58
73
|
Treat a session route as stopped only after two reads of
|
|
59
|
-
`dispatch issues --project <KEY> --route-status no_holder --
|
|
60
|
-
both list it, as
|
|
74
|
+
`dispatch issues --project <KEY> --route-status no_holder --all` at least ten minutes apart
|
|
75
|
+
both list it, as `dispatch issues --help` says for `route_status`, because a
|
|
61
76
|
restarting session is absent for minutes. Do not poll to create the second read; use the next
|
|
62
77
|
controller wake. Then confirm with `envoy_sessions` that no live session owns the work (the
|
|
63
78
|
session the route names, or one that took it over), because a live owner still holds it.
|
|
@@ -17,7 +17,7 @@ reach that person's Inbox.
|
|
|
17
17
|
dispatch issue --project <PROJECT> --title 'Legion daily report' --assignee '<email>' --spec-file - <<'EOF'
|
|
18
18
|
## Summary
|
|
19
19
|
|
|
20
|
-
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
|
|
20
|
+
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 outside their own work, which the controller hands to the tree that owns the code, or files for Legion when no tree does. 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.
|
|
21
21
|
EOF
|
|
22
22
|
legion({ op: "set_status", issue: "<report KEY>", status: "icebox" })
|
|
23
23
|
```
|
|
@@ -49,11 +49,11 @@ post when its `Events:` show no `message.created` from today.
|
|
|
49
49
|
## What
|
|
50
50
|
|
|
51
51
|
One `dispatch message --issue <report KEY> --body-file -` of at most 2,000 characters, because a
|
|
52
|
-
person reads every report in their Inbox. Write it as `skill://dispatch`'s "
|
|
53
|
-
every issue by its
|
|
52
|
+
person reads every report in their Inbox. Write it as `skill://dispatch-writing-specs`'s "Rules for the text" say:
|
|
53
|
+
every issue by its `dispatch://` link and what it does for the reader, every pull request by its URL.
|
|
54
54
|
|
|
55
55
|
- **Finished.** `dispatch issues --project <PROJECT> --status done --updated-since <the previous
|
|
56
|
-
report's time, or 24 hours ago> --
|
|
56
|
+
report's time, or 24 hours ago> --all`, keeping the issues `read_state` records
|
|
57
57
|
under `issues` whose `issue.closed` event is after the previous report. `dispatch read` each: the
|
|
58
58
|
pull request under `External links:` is the one that merged.
|
|
59
59
|
- **Closed without a change.** Those with no pull request, each with the reason its closing
|
|
@@ -61,6 +61,9 @@ every issue by its key and title, every pull request by its URL.
|
|
|
61
61
|
- **Running.** Each root in `admission.active` with its `issues.<KEY>.phase`, and the roots in
|
|
62
62
|
`admission.waiting`. Name as waiting on a claim each root that this turn's "Trees waiting on a
|
|
63
63
|
root claim" check found, with the holder its `Claimed by:` line names.
|
|
64
|
+
- **Waiting on Dispatch links.** Each root and child in `admission.blocked`, with the issues it
|
|
65
|
+
waits on. The wait ends when each blocker reaches `done` (a person's close, or the blocker's own
|
|
66
|
+
merge) or its link is taken off (by a person or the tree's architect), so take nothing for them.
|
|
64
67
|
- **Free slots.** Counted as the skill's "Free slots" says; each stays free until a root in `todo`
|
|
65
68
|
with the `legion` label takes it.
|
|
66
69
|
- **Open capabilities.** Each row of `read_state`'s `capabilities` whose `status` is `open`: its
|