@sjawhar/opencode-legion-envoy 9.0.0 → 9.2.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 +162 -41
- package/dist/src/server.js +20 -17
- 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 +11 -8
- package/skills/legion-architect/references/acceptance.md +18 -5
- package/skills/legion-architect/references/decomposition.md +3 -2
- package/skills/legion-architect/references/design-gate.md +42 -19
- package/skills/legion-architect/references/wake-routing.md +4 -4
- package/skills/legion-controller/SKILL.md +31 -17
- package/skills/legion-controller/references/admission.md +5 -3
- package/skills/legion-controller/references/backlog-stewardship.md +17 -2
- package/skills/legion-controller/references/daily-report.md +4 -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 +22 -8
- package/skills/legion-worker/SKILL.md +7 -6
- 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 +57 -25
- package/skills/legion-worker/references/pr-body.md +9 -5
- package/skills/legion-worker/references/skip-checks-trailer.md +1 -1
- 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.
|
|
@@ -13,9 +13,10 @@ You own one issue tree from its first decision to the merge that closes it. The
|
|
|
13
13
|
|
|
14
14
|
- Act on delivered wakes and the live artifacts they name; build no wait loop, since every wake reaches you.
|
|
15
15
|
- Check each claim against the code as fetched now (the default branch your addressing line names, or the head under review), never the workspace as it was at admission, and tell every fresh reader you dispatch to do the same: the branch may have moved since.
|
|
16
|
-
- Before you end a turn that waits on a human, open what they must answer: a decision block, a `dispatch ask` or `dispatch request-approval`. A turn that ends with nothing open asks nobody, and the tree stops.
|
|
16
|
+
- Before you end a turn that waits on a human, open what they must answer: a decision block, a `dispatch ask` or `dispatch request-approval`. A turn that ends with nothing open asks nobody, and the tree stops. Open an ordinary ask on the root issue itself, never a child: only a question a session of this tree opens on the root starts a wait on a person, so an ask on a child leaves the root holding its slot while nothing runs. Once you have handed a root question to the human, end your turn: when nothing else holds the slot — no other issue of the tree in a phase, the `legion` label still on, and no person or outside session holding the root's Dispatch claim — the root returns its admission slot (`awaiting_person`), the daemon suspends this session at the end of the turn, and the human's answer resumes it with a task naming what answered and what is still with them. The same holds once you request approval and `register_gate` that version: the registration hands the spec to the human, so end your turn there too, and the human's review, or a newer version once Dispatch shows the request back on your turn, resumes you.
|
|
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).
|
|
@@ -28,22 +29,23 @@ You own one issue tree from its first decision to the merge that closes it. The
|
|
|
28
29
|
- Every child names the running system its criteria are proven on (the command, service or page the tester drives) and the repository skill that drives it. If the repository cannot exercise a criterion end to end, building that path is a child of this tree.
|
|
29
30
|
- The issue's primary document is the root spec: extend it in place, because a second "spec" artifact replaces the human's document. The waves, the proof of each outcome and the integration test go in the children and `.legion/<issue>/plan.json`, not the root spec.
|
|
30
31
|
- Read `skill://legion-architect/references/design-gate.md` before you write the root spec and before any edit to it after approval, because any new version closes the gate. It also says which gate runs, and that a sub-architect runs none.
|
|
31
|
-
- A root architect then ends its turn and releases no wave until a delivered wake shows `design-approved`: the daemon starts no phase in the tree before it. A sub-architect waits for none and releases its children with `release_children`.
|
|
32
|
+
- A root architect then ends its turn and releases no wave until a delivered wake shows `design-approved`: the daemon starts no phase in the tree before it. A root that waited on a person's answer gets no `design-approved` notice: a resume task saying "this resume is your design-approved wake" is that wake. A sub-architect waits for none and releases its children with `release_children`.
|
|
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
|
+
- Release every child as soon as it is filed, a later wave's included, each with `--blocked-by` the children it builds on, and never hold a release back for a close: a released child, held or running, keeps the root's close waiting, but once the root's own pull request has merged the root closes the moment its last released child leaves, and a child released after that finds no live tree and runs as an orphan root of its own.
|
|
38
|
+
- On each `child-closed`, read the child's handoff. Edit the spec of each open child the result changes, and take out each child it makes unneeded with `park_child` and say why with `dispatch comment`.
|
|
37
39
|
- 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.
|
|
38
40
|
- A released child runs in your tree's admission slot, never its own, and never becomes a root while your tree is live.
|
|
39
41
|
|
|
40
42
|
## 3. Children complete
|
|
41
43
|
|
|
42
|
-
No notice marks the last child's close. The root can reach `accepting` before any child merges
|
|
44
|
+
No notice marks the last child's close. The root can reach `accepting` before any child merges; accept its own pull request then (section 6), and its close waits for the rest of the tree.
|
|
43
45
|
|
|
44
46
|
## 4. Integration verification
|
|
45
47
|
|
|
46
|
-
- File a final integration child whose acceptance is every parent criterion proven on the default branch your addressing line names (never a hard-coded `main`), in each repository a criterion spans. Release it
|
|
48
|
+
- File a final integration child whose acceptance is every parent criterion proven on the default branch your addressing line names (never a hard-coded `main`), in each repository a criterion spans. Release it at once with `--blocked-by` naming every other child: Legion holds it until the last of them closes and starts it then, so it tests a branch that carries their merges. The root's close waits for it, so the root is done only once it closes. Each child you add later joins its `--blocked-by` list in the same turn it is filed (section 2).
|
|
47
49
|
- Read its tester evidence, not a child pull request's check status. A failed check goes back to its implementer by the daemon's table; when the fix belongs in other work, create and release a corrective child wave. Never downgrade a parent criterion or carry the failure forward.
|
|
48
50
|
|
|
49
51
|
## 5. Retro
|
|
@@ -59,9 +61,9 @@ The reviewer's `phase-finished` with an `APPROVED` review puts the issue in `acc
|
|
|
59
61
|
- the reviewer's approval of that head by SHA (`gh api --paginate repos/<o>/<r>/pulls/<n>/reviews`);
|
|
60
62
|
- 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.
|
|
61
63
|
|
|
62
|
-
Accept only when each acceptance line has passing evidence at the approved head
|
|
64
|
+
Accept only when each acceptance line of the issue's own pull request has passing evidence at the approved head and no criterion left the tree; a criterion only the tree as a whole meets is the integration child's (section 4), not a reason to hold the root's own pull request. 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>" })`.
|
|
63
65
|
|
|
64
|
-
- `sign_off` works only in `accepting` (`SIGNOFF_OUTSIDE_ACCEPTING`)
|
|
66
|
+
- `sign_off` works only in `accepting` (`SIGNOFF_OUTSIDE_ACCEPTING`). Children still in the workflow do not hold it: a root whose pull request merges waits at its close for the rest of its tree.
|
|
65
67
|
- 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.
|
|
66
68
|
- On every end-game wake (`phase-finished`, `catch-up`, `checks-red`, `review-stuck`), read `gh pr view <n> --json mergeable,mergeStateStatus`, because a `CONFLICTING` pull request gets no CI and no wake. Then, and after acceptance, follow `skill://legion-architect/references/acceptance.md`.
|
|
67
69
|
|
|
@@ -77,4 +79,5 @@ Handle each delivered wake by its row in `skill://legion-architect/references/wa
|
|
|
77
79
|
|
|
78
80
|
- `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.
|
|
79
81
|
- 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.
|
|
82
|
+
- 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.
|
|
80
83
|
- A tool a worker cannot get is yours: a pull request changing `sjawhar/legion`'s worker image (`skill://legion-worker/references/tools.md`).
|
|
@@ -26,13 +26,25 @@ legion({ op: "sign_off", issue: "LEGION-40" })
|
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
- The issue's Dispatch status stays `needs_review` in `accepting`; `sign_off` moves it to `retro`.
|
|
29
|
-
-
|
|
30
|
-
|
|
29
|
+
- A `catch-up` whose `reason` names an issue as waiting for your acceptance is the wake for it: it
|
|
30
|
+
is in `accepting`, and the `phase-finished` notice that moved it there may never have reached you
|
|
31
|
+
(the daemon drops a notice to a failed architect, so a retried one learns of the wait from its
|
|
32
|
+
catch-up alone). Accept it as above.
|
|
33
|
+
- Nothing beneath the issue holds the acceptance: accept a parent's own reviewed head while its
|
|
34
|
+
children still run. A root's close waits for them instead (*The close*, below); a parent that is
|
|
35
|
+
not the root closes at its own merge, and its children carry on under the root.
|
|
31
36
|
- `request_backward_move` names the issue, because your grant serves the tree; the daemon starts
|
|
32
37
|
that phase's role with your reason in its task.
|
|
33
38
|
- `handoff_complete` from you in `accepting` is refused `ACCEPTANCE_IS_SIGN_OFF`. CI red at the head
|
|
34
39
|
in `accepting` returns the issue to `implementing` by the daemon's table.
|
|
35
40
|
- No `Production:` line is asked here: the production check is the implementer's, after the close.
|
|
41
|
+
- A finding ask on the issue holds the acceptance: one a worker sent you, or one `dispatch read`
|
|
42
|
+
lists under `Open asks:` whose question opens `Finding from ` or `Clear defect from `
|
|
43
|
+
(`skill://legion-worker/references/findings.md`, "When no controller takes it"). Follow each
|
|
44
|
+
(`dispatch follow --ask <id> --action follow`) and, once it is answered, publish its reference
|
|
45
|
+
to the controller topic. Accept only once each is resolved, or carries the controller's
|
|
46
|
+
`Filed dispatch://`, `Handed dispatch://` or `Not filed:` reply, because a closed issue hides its
|
|
47
|
+
asks from the controller.
|
|
36
48
|
|
|
37
49
|
## The order after your acceptance
|
|
38
50
|
|
|
@@ -128,9 +140,10 @@ The merge closes the issue: when GitHub reports the pull request merged while th
|
|
|
128
140
|
every member's open production check has closed.
|
|
129
141
|
|
|
130
142
|
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
|
-
|
|
143
|
+
Dispatch refuses a write on a closed issue. A defect it finds is never an issue the implementer
|
|
144
|
+
files: a clear defect goes to the controller, and any other is a `dispatch ask`. `read_record`
|
|
145
|
+
shows a closed issue's open check (`check`: the pull request, the merge commit, the looks, what
|
|
146
|
+
woke the last one and when the next is due).
|
|
134
147
|
|
|
135
148
|
## Hand-over at a root's linger
|
|
136
149
|
|
|
@@ -34,8 +34,9 @@ EOF
|
|
|
34
34
|
- `--project` is the issue key's prefix before `-<n>` (`LEGSMOKE-3` → `LEGSMOKE`).
|
|
35
35
|
- In a root session `$LEGION_ISSUE` is the root (it equals `$LEGION_TREE`): pass it as `--parent`.
|
|
36
36
|
The daemon makes the sub-issue link from `--parent`.
|
|
37
|
-
-
|
|
38
|
-
|
|
37
|
+
- Order the returned keys into waves with `--blocked-by` links (a later wave's child blocked by the
|
|
38
|
+
children it builds on), then release every child at once with `release_children`: Legion holds a
|
|
39
|
+
released child until its last blocker closes, and a child is inert only until it is released.
|
|
39
40
|
- Do not pass `--assignee`, because the default keeps the tree's questions in one Inbox: under the
|
|
40
41
|
shared token a child inherits its parent's assignee (the human who answers the tree's asks), else
|
|
41
42
|
the project's default assignee, which a person sets on the Settings page; under a personal token
|
|
@@ -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,30 @@ 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
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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.
|
|
97
|
+
|
|
98
|
+
Then end your turn. The registration hands the spec to the human: when nothing else holds the
|
|
99
|
+
slot, the root returns its admission slot and waits on its design gate (`awaiting_person`), as a
|
|
100
|
+
root question handed to the human does ("Every turn" in `skill://legion-architect/SKILL.md`). The
|
|
101
|
+
human's approval or changes request resumes you, and so does a newer spec version once Dispatch
|
|
102
|
+
shows the request back on your turn. While the root waits on a question instead, the human's
|
|
103
|
+
approval or changes request of the spec answers that wait too, and the resume task says how the
|
|
104
|
+
spec stands. Release no wave until a delivered wake shows `design-approved` on the root, or a
|
|
105
|
+
resume task says its design gate is open: the daemon sends a root waiting on a person no
|
|
106
|
+
`design-approved` notice, and "this resume is your design-approved wake" is that wake. On
|
|
107
|
+
`design-changes-requested`: revise the spec as the human's reason asks, run step 3's two reviews on
|
|
108
|
+
the new version, resolve every finding, request approval again and end your turn. A
|
|
109
|
+
`design-changes-requested` may name a version below the latest, or arrive after another for the
|
|
110
|
+
same version: it is a request the human made that reached the daemon late, and no approval came
|
|
111
|
+
after it. Each request arrives once. The gate is as the newest review left it; still read the
|
|
112
|
+
reason, and answer it in the spec if the latest version does not already.
|
|
91
113
|
|
|
92
114
|
## After approval
|
|
93
115
|
|
|
@@ -110,8 +132,9 @@ to the version it writes. Once they have answered:
|
|
|
110
132
|
daemon sent opens nothing new. Carry on, and release no wave because of it.
|
|
111
133
|
- When the answer changes the Summary, the Acceptance or the tree's scope, rewrite that text and
|
|
112
134
|
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
|
|
135
|
+
the earlier approval, then the reviews' sentence (the card shows that approval, `Approved at
|
|
136
|
+
version N on <date> by <who>.`, and its `Show diff` control carries the detail). The rewrite
|
|
137
|
+
closes the gate until they approve;
|
|
115
138
|
work the daemon started at the answer keeps running. Release no new wave until the `design-approved`
|
|
116
139
|
after the rewrite; work already in flight continues. Every merger's `READY` in the tree is
|
|
117
140
|
refused until a human approves the latest version.
|
|
@@ -20,13 +20,13 @@ and 7 (a conflict, the hand-over, the close) is in
|
|
|
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
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
|
|
23
|
+
| `child-closed` | Read the child completion and remaining open children. Re-scope open work, park obsolete work for good with `park_child` (first take its link off each sibling that waits on it, or park that sibling too, as section 2 says), and file any new child the result calls for and release it at once with `release_children`, blocked by what it builds on (section 2). When a worker waits on this child for a missing surface (see `phase-finished`), tell it to continue with `envoy_publish` to its role topic. The last child's close is not the end-game (section 3). |
|
|
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
|
-
| `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. |
|
|
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. A root that was waiting on a question in `awaiting_person` gets no such notice: the task that resumes it says "Your spec is approved at version N and the design gate is open: this resume is your design-approved wake", and that resume is this wake — proceed to section 2 on it. |
|
|
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. On a root that was waiting on a question in `awaiting_person`, a review the human gave after the wait began comes in the resume task, not in this notice, whether it answered the wait or came after something else did: the task names the review with its version and reason, unless a later approval superseded it. A `version` below the latest, or a second request for one version, is a request that reached the daemon late: read it as the same section's last paragraph says. Each request arrives once. |
|
|
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
|
|
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/<issue>/` — handoff-only pushes (`.legion/<issue>/` 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/<issue>/`, 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 (this issue closes at its own merge, 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, awaiting-person, 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
|
|
|
@@ -42,7 +43,9 @@ because Envoy keeps no copy of a wake sent while no controller ran.
|
|
|
42
43
|
1. Read `read_state`. Handle each issue whose `phase` is `held` with `holdReason: escalated`, and
|
|
43
44
|
each root whose `architect.state` is `failed` and whose `phase` is not `done`, as its wake says.
|
|
44
45
|
Name in your summary each root at `phase: done` whose `status` is `in_progress`, `testing`,
|
|
45
|
-
`needs_review` or `retro`:
|
|
46
|
+
`needs_review` or `retro`: Legion runs it no longer, as the `unslotted` wake reports: someone
|
|
47
|
+
else moved it there while it waited for a slot, or it waited on a person (`awaiting_person`) and
|
|
48
|
+
lost its label or its Dispatch claim, which leaves the `in_progress` it ran with.
|
|
46
49
|
2. Triage the roots handed to Legion while you were away, as
|
|
47
50
|
`skill://legion-controller/references/triage.md` "At every start" says.
|
|
48
51
|
3. Catch up on the report issue
|
|
@@ -58,10 +61,12 @@ Wake details: `skill://legion-controller/references/wakes.md`.
|
|
|
58
61
|
| `slot-free on <KEY>`, `todo on <KEY>` | Name the free slots; take nothing |
|
|
59
62
|
| `tick on <PROJECT>` | The every-turn steps |
|
|
60
63
|
| `unslotted on <KEY>` | Re-admit nothing; name it in your summary |
|
|
64
|
+
| `awaiting-person on <KEY>` | Nothing: do not park or re-admit it, and take nothing for the slot it returned |
|
|
61
65
|
| `held on <KEY>` | Nothing, unless `reason: "escalated"`: then an escalation |
|
|
62
66
|
| `worker-died on <KEY>` (`role: "architect"`) | Re-admit once its cause is gone, else park it |
|
|
63
67
|
| An architect's escalation | `skill://legion-controller/references/escalation.md` |
|
|
64
68
|
| A finding ask's reference, or its answer | `skill://legion-controller/references/finding-asks.md` |
|
|
69
|
+
| A clear defect a role sends | `skill://legion-controller/references/finding-asks.md#hand-over-a-clear-defect` |
|
|
65
70
|
| A finding sent as text | Open an ask ([Findings](#findings-and-the-issues-you-file)) |
|
|
66
71
|
| READY, a scope question, a routing request | `skill://legion-controller/references/backlog-stewardship.md` |
|
|
67
72
|
| A GitHub mention | Answer it, or route it to the owning architect |
|
|
@@ -77,13 +82,18 @@ claim is free; claim it again.` to `notifications.role.<issues.<KEY>.architect.l
|
|
|
77
82
|
## Issues handed to Legion
|
|
78
83
|
|
|
79
84
|
The daemon works only issues carrying the Dispatch label `legion` (any case). Work reaches Legion
|
|
80
|
-
|
|
85
|
+
by a person's decision: they set the label from the issue header, or ask you to (a direct
|
|
81
86
|
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
|
|
87
|
+
ruling the weekly plan records with its link). The one exception is a clear defect a role hands
|
|
88
|
+
you whose code no running tree owns: you file it with the label, because its fix is how to do work
|
|
89
|
+
a person already wants, and humans decide what, agents decide how (the operator's answer on one
|
|
90
|
+
such case: a clear defect is fixed, not asked about). A defect whose code a running
|
|
91
|
+
tree owns is that tree's, and you file nothing for it. Label an issue only then, because
|
|
92
|
+
a labelled root in `todo` is admitted, so an unasked label starts unasked work. Never take a
|
|
93
|
+
person's label off, because it is their decision. Label an issue before you `set_status` it to
|
|
94
|
+
`todo`, because `todo` admits only a labelled root. How:
|
|
95
|
+
`skill://legion-controller/references/triage.md` "Label an issue for a person". Admission states:
|
|
96
|
+
`skill://legion-controller/references/admission.md`.
|
|
87
97
|
|
|
88
98
|
## Free slots
|
|
89
99
|
|
|
@@ -95,7 +105,7 @@ it, and cite that request. The free slots are `admission.cap` minus the roots in
|
|
|
95
105
|
a blocked root takes no slot until its blockers are done. Every move to `todo` you make is one of
|
|
96
106
|
these:
|
|
97
107
|
|
|
98
|
-
- a root a person handed over, at triage;
|
|
108
|
+
- a root a person handed over, or a root you filed for a clear defect no tree owns, at triage;
|
|
99
109
|
- an issue a person asks you to start;
|
|
100
110
|
- a tree you re-admit after its architect failed or after a hold, once you checked its cause is
|
|
101
111
|
gone, or because a person asks;
|
|
@@ -104,11 +114,14 @@ these:
|
|
|
104
114
|
## Findings, and the issues you file
|
|
105
115
|
|
|
106
116
|
File an issue only when a person asks you to (a direct message, a Slack request, or their answer
|
|
107
|
-
to a finding ask),
|
|
108
|
-
a role
|
|
109
|
-
`skill://legion-
|
|
110
|
-
|
|
111
|
-
`
|
|
117
|
+
to a finding ask), for a clear defect no running tree owns, and the report issue. A clear defect,
|
|
118
|
+
yours or a role's, goes first to the tree that owns its code, and becomes a Legion root only when
|
|
119
|
+
no tree does: `skill://legion-controller/references/finding-asks.md#hand-over-a-clear-defect`.
|
|
120
|
+
Every other problem is a finding: one you find, or one a role sends you as text. Open a
|
|
121
|
+
`dispatch ask` for it on the report issue, as `skill://legion-worker/references/findings.md` says,
|
|
122
|
+
and file nothing until a person answers, because a person decides whether it needs an issue and
|
|
123
|
+
where. Each issue you file carries a `Filed for` line:
|
|
124
|
+
`skill://legion-controller/references/finding-asks.md`.
|
|
112
125
|
|
|
113
126
|
## Daily report
|
|
114
127
|
|
|
@@ -119,4 +132,5 @@ and why, and what runs: `skill://legion-controller/references/daily-report.md`.
|
|
|
119
132
|
|
|
120
133
|
The operator's deployment instructions in your system prompt (required checks, deploy commands,
|
|
121
134
|
code owners, roles you may consult) override this skill where the two conflict, and may narrow
|
|
122
|
-
what you label for Legion. They never hand Legion work,
|
|
135
|
+
what you label for Legion. They never hand Legion work: a person does, or a role reports a clear
|
|
136
|
+
defect.
|
|
@@ -7,14 +7,16 @@ 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` and not in `admission.blocked` | A root handed to Legion in `todo`, queued
|
|
10
|
+
| The key is in `admission.waiting` and not in `admission.blocked` | A root handed to Legion in `todo`, queued for the next free slot: a root a person answered while it waited in `awaiting_person` comes first, oldest answer first, then every root that never ran, in Dispatch rank order | Nothing: it takes the next free slot by itself |
|
|
11
|
+
| `phase: awaiting_person`, `waitingOn` | A root that already ran and now waits only on a person: an answer to its architect's question (`waitingOn.kind` `ask`) or a review of its spec (`gate`). It holds no slot, its architect session is suspended, and its tree stays live. Unanswered, it is in neither list; `waitingOn.answeredAt` means the daemon has promoted it to the front of `admission.waiting` | Nothing: it is not something to admit, label or park, and the slot it returned is no reason to take an issue ([Free slots](skill://legion-controller/SKILL.md#free-slots)). The daemon resumes it in its own architect session at the next free slot. If its label goes or a person or outside session claims it on Dispatch, the daemon sends `unslotted` and does not resume it |
|
|
11
12
|
| 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 |
|
|
12
13
|
| `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 |
|
|
13
14
|
| `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 |
|
|
14
|
-
| `phase: done` while `status` is `in_progress`, `testing`, `needs_review` or `retro` |
|
|
15
|
+
| `phase: done` while `status` is `in_progress`, `testing`, `needs_review` or `retro` | Legion is not running it under that status, and it sent the `unslotted` wake. Either someone other than Legion moved a root that waited for a slot there, and the daemon took it out of the workflow at that move since no slot would ever reach it; or a root waiting on a person could not be resumed — its `legion` label is gone, or a person or an outside session took its Dispatch claim — and the daemon took it out the same way, leaving the `in_progress` it ran with. A parked child stays parked. Legion starts nothing for any of them | Re-admit nothing yourself: `dispatch read` shows who works it now. Name it in your summary; `todo` with the `legion` label queues it again |
|
|
15
16
|
|
|
16
17
|
A root in the workflow with no slot that is in neither `admission.waiting` nor the label-removed
|
|
17
18
|
row above does not stay that way: every pass of admission (a Dispatch event, the daemon's boot
|
|
18
|
-
read, its tick) takes it out of the workflow and sends the `unslotted` wake
|
|
19
|
+
read, its tick) takes it out of the workflow and sends the `unslotted` wake — an unanswered
|
|
20
|
+
`awaiting_person` root only when its label or its Dispatch claim makes a resume unsafe. The wake is live
|
|
19
21
|
only, so a controller that starts later finds such a root by the last row, as its start procedure
|
|
20
22
|
does.
|
|
@@ -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
|