@sjawhar/claude-envoy 6.11.1 → 6.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/.omp-plugin/plugin.json +1 -1
- package/dist/codex-hook.js +201 -21
- package/dist/dispatch.js +201 -21
- package/dist/envoy-channel.js +203 -23
- package/dist/session-hook.js +201 -21
- package/legion/skills/legion-architect/SKILL.md +2 -2
- package/legion/skills/legion-architect/references/acceptance.md +1 -1
- package/legion/skills/legion-architect/references/decomposition.md +2 -2
- package/legion/skills/legion-architect/references/operations.md +1 -1
- package/legion/skills/legion-controller/SKILL.md +5 -5
- package/legion/skills/legion-controller/references/backlog-stewardship.md +3 -3
- package/legion/skills/legion-controller/references/consolidation.md +1 -1
- package/legion/skills/legion-controller/references/daily-report.md +6 -17
- package/legion/skills/legion-controller/references/escalation.md +1 -1
- package/legion/skills/legion-controller/references/finding-asks-steps.md +4 -4
- package/legion/skills/legion-controller/references/finding-asks.md +16 -15
- package/legion/skills/legion-controller/references/operations-steps.md +2 -2
- package/legion/skills/legion-controller/references/operations.md +5 -5
- package/legion/skills/legion-controller/references/park-asks.md +2 -2
- package/legion/skills/legion-controller/references/triage.md +1 -1
- package/legion/skills/legion-oracle/SKILL.md +1 -1
- package/legion/skills/legion-worker/references/conflicts-and-rewrites.md +0 -2
- package/legion/skills/legion-worker/references/findings-steps.md +5 -5
- package/legion/skills/legion-worker/references/findings.md +13 -22
- package/legion/skills/legion-worker/references/results.md +15 -2
- package/package.json +1 -1
- package/skills/dispatch/SKILL.md +7 -3
- package/skills/dispatch-first/SKILL.md +1 -1
- package/skills/dispatch-writing-specs/SKILL.md +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Read this when `skill://legion-controller/references/finding-asks.md` sends you here; that file states the rule each section here carries out.
|
|
4
4
|
|
|
5
|
-
## File a clear defect
|
|
5
|
+
## File a clear defect
|
|
6
6
|
|
|
7
7
|
Every reply under the evidence mentions the finder's role, the token after `Clear defect from ` (leave out `--mention` when it is `controller`):
|
|
8
8
|
|
|
@@ -11,9 +11,9 @@ dispatch comment --issue '<the evidence's issue>' --reply-to '<comment id>' --me
|
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
1. Check it is clear: the fix needs no choice a person must make, in a repository both role GitHub Apps are installed on. Otherwise reply `Not filed: <the choice, or the repository the Apps miss>` and open nothing: the finder opens its ask.
|
|
14
|
-
2. Search first (`skill://dispatch-first`). When an open issue tracks it and a live tree owns that issue (its record's `tree`), file nothing and reply `Not filed:
|
|
15
|
-
3. When a live tree's
|
|
16
|
-
4.
|
|
14
|
+
2. Search first (`skill://dispatch-first`). When an open issue tracks it and a live tree owns that issue (its record's `tree`), file nothing and reply `Not filed: dispatch://<KEY>; role:<token> is mentioned here`, adding `--mention 'role:<that tree's architect's token>'`: it reads the evidence here. When that issue is in no running tree, comment the evidence there and reply `Filed dispatch://<KEY>`.
|
|
15
|
+
3. When a live tree's open pull request changes the files the fix touches (the live trees: `skill://legion-controller/references/admission.md`), file nothing and reply the same way, with its root for `<KEY>`. Build each token as `skill://legion-controller/references/operations.md#a-request-to-another-session` says.
|
|
16
|
+
4. Otherwise file it where the fix belongs, in the project that repository maps to, or in your own project when Dispatch maps it to none:
|
|
17
17
|
`dispatch issue --project <KEY> --repo <owner/name> --title '<the defect>' --label legion --spec-file -`
|
|
18
18
|
The spec states the defect, where the fix belongs and the fix, and ends with the `Filed for Legion from` line.
|
|
19
19
|
5. Reply `Filed dispatch://<NEW KEY>`.
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
# Finding asks
|
|
2
2
|
|
|
3
|
-
Read this for a clear defect
|
|
3
|
+
Read this for a clear defect, a finding ask's reference, an answer on an ask you follow, an issue a person asks you to file, and at every start.
|
|
4
4
|
|
|
5
5
|
## The `Filed for` line
|
|
6
6
|
|
|
7
7
|
Every issue you file carries one line in its spec, which triage reads to tell your filing from another's label:
|
|
8
8
|
|
|
9
|
-
- for a person: `Filed for <person> at their request: <request>`. The request is `dispatch://<
|
|
10
|
-
- for a clear defect
|
|
9
|
+
- for a person: `Filed for <person> at their request: <request>`. The request is `dispatch://<ASK KEY>/ask/<id>` for who answered it; `Slack <channel_id> message <ts>` for the mention's `<@user_id>` (`…, adopting message <earlier ts>` when the mention asks for an earlier message's request); or `direct message <id>`, the id its frame's `reply_with` names after `--in-reply-to` (for a message that came as your own user turn, `direct message to session <your session id>`).
|
|
10
|
+
- for a clear defect: `Filed for Legion from <role> on <issue>: <evidence reference>`.
|
|
11
11
|
|
|
12
|
-
## File a clear defect
|
|
12
|
+
## File a clear defect
|
|
13
13
|
|
|
14
|
-
A role writes a clear defect to you
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
A role writes a clear defect to you: a comment that mentions your role, on the report issue or on its own issue, first line `Clear defect from <role>`. For a clear defect you find yourself, post its evidence on the report issue with `controller` as the role.
|
|
15
|
+
A defect that stops its sender's work, in a repository the sender's token reaches, is the sender's to fix, unless an issue that tracks it is claimed, `in_progress` and its holder said on Envoy that it works on it now: reply `Not filed: it stops your work, so it is yours to fix`, and take none of the steps.
|
|
16
|
+
File any other only when it is clear, in a repository both role GitHub Apps are installed on, no open issue tracks it (an open issue that no live tree owns gets the evidence as a comment, and the reply `Filed dispatch://<KEY>`), and no live tree's open pull request changes the files the fix touches. Otherwise file nothing and reply under its evidence, mentioning the finder: `Not filed:` with a mention of the live tree's architect, or with the reason the finder opens its ask.
|
|
17
|
+
The reply's form and the five steps are in `skill://legion-controller/references/finding-asks-steps.md#file-a-clear-defect`: read them before every such defect.
|
|
17
18
|
|
|
18
19
|
## Follow it
|
|
19
20
|
|
|
@@ -24,7 +25,7 @@ A finding ask another role opened reaches you as `dispatch://<KEY>/ask/<id>`. Fo
|
|
|
24
25
|
A park ask's answer goes to `skill://legion-controller/references/park-asks.md` step 4, a deferral ask's to `skill://legion-controller/references/backlog-stewardship.md#a-root-the-plan-defers` step 4. For any other, `dispatch read --ref` it and act on the newest answer; when its typed text asks for another of these three than the option selected, do what the text asks, and when it asks for none of them, reply with your question and file nothing:
|
|
25
26
|
|
|
26
27
|
- `Do not file`: file nothing.
|
|
27
|
-
- `File an issue`: `dispatch issue --project <PROJECT> --title '<the problem>' --spec-file -` in the project where the fix belongs (this one when the answer names none). The spec states the problem and where the fix belongs, cites the ask and its evidence, and carries `Filed for <the answer's By:> at their request: dispatch://<
|
|
28
|
+
- `File an issue`: `dispatch issue --project <PROJECT> --title '<the problem>' --spec-file -` in the project where the fix belongs (this one when the answer names none). The spec states the problem and where the fix belongs, cites the ask and its evidence, and carries `Filed for <the answer's By:> at their request: dispatch://<ASK KEY>/ask/<id>`.
|
|
28
29
|
- `File it for Legion`: the same, with `--label legion`; its triage wake brings it back.
|
|
29
30
|
|
|
30
31
|
An ask that re-files an escalated child also takes the steps of `skill://legion-controller/references/escalation.md#a-child-that-looks-independent`.
|
|
@@ -35,22 +36,22 @@ Then reply under the ask, first line exactly `Filed dispatch://<NEW KEY>` or `No
|
|
|
35
36
|
|
|
36
37
|
Nothing wakes on or follows an ask while no controller runs, so at every start:
|
|
37
38
|
|
|
38
|
-
1. `dispatch read` the report issue (none yet:
|
|
39
|
-
2. `dispatch open-asks --project <PROJECT>` lists every open ask; it lists no ask on a closed issue. Follow
|
|
40
|
-
3. List the answered asks still waiting on you,
|
|
39
|
+
1. `dispatch read` the report issue (none yet: skip step 4), and reopen it as `skill://legion-controller/references/daily-report.md` "When" says.
|
|
40
|
+
2. `dispatch open-asks --project <PROJECT>` lists every open ask; it lists no ask on a closed issue. Follow each whose question opens `Finding from `, and each whose options hold a label step 3's filter names.
|
|
41
|
+
3. List the answered asks still waiting on you, on the report issue, each issue `read_state` records, and each issue of one snapshot of `dispatch issues --project <PROJECT> --status triage --all` and of `dispatch issues --project <PROJECT> --status needs_review --all` (never paged):
|
|
41
42
|
|
|
42
43
|
```text
|
|
43
44
|
asks=$(dispatch api --path '/api/v1/issues/<ISSUE KEY>/asks?state=answered&thread=1') || { printf 'Dispatch read failed: %s\n' "$asks" >&2; exit 1; }
|
|
44
45
|
printf '%s' "$asks" | jq -cn 'input | if type == "array" then [.[] | select(any(.options[]; .label == "Do not file" or .label == "Admit it" or .label == "Park it" or .label == "Leave it admitted" or .label == "Defer it" or .label == "Let it run")) | .answer.at as $t | select([.thread.replies[]? | select(.author.kind == "session" and .created_at > $t and (.body | test("^(Filed dispatch://|Handed dispatch://|Admitted dispatch://|Not filed:|Not admitted:|Parked dispatch://|Not parked dispatch://|Left admitted dispatch://|Deferred dispatch://|Not deferred dispatch://|Let run dispatch://)")))] | length == 0) | {id, question, answer}] else error("Dispatch did not answer the list") end'
|
|
45
46
|
```
|
|
46
47
|
|
|
47
|
-
Exit 0 with `[]` is nothing waiting; anything else is a failed read. Act on each as above, a triage ask as `skill://legion-controller/references/triage.md` says, and
|
|
48
|
+
Exit 0 with `[]` is nothing waiting; anything else is a failed read. Act on each as above, a triage ask as `skill://legion-controller/references/triage.md` says, and an answer whose label starts `Hand it` as step 5 says.
|
|
48
49
|
4. List the clear defects nobody took yet:
|
|
49
50
|
|
|
50
51
|
```text
|
|
51
52
|
notes=$(dispatch api --path '/api/v1/issues/<REPORT KEY>/comments') || { printf 'Dispatch read failed: %s\n' "$notes" >&2; exit 1; }
|
|
52
|
-
printf '%s' "$notes" | jq -cn 'input | if type == "array" then (. as $all | [.[] | select(.reply_to == null and (.body | startswith("Clear defect from "))) | .id as $id | select([$all[] | select(.reply_to == $id and .author.kind == "session" and (.body | test("^(Handed dispatch://|Filed dispatch://|Not filed:|Asked dispatch://)")))] | length == 0) | {id, body}]) else error("Dispatch did not answer the list") end'
|
|
53
|
+
printf '%s' "$notes" | jq -cn 'input | if type == "array" then (. as $all | [.[] | select(.reply_to == null and (.body | startswith("Clear defect from "))) | .id as $id | select([$all[] | select(.reply_to == $id and .author.kind == "session" and (.body | test("^(Handed dispatch://|Filed dispatch://|Not filed:|Asked dispatch://|Moved dispatch://)")))] | length == 0) | {id, body}]) else error("Dispatch did not answer the list") end'
|
|
53
54
|
```
|
|
54
55
|
|
|
55
|
-
Take each as [File a clear defect
|
|
56
|
-
5. Take each ask earlier rules opened whose question opens `Clear defect from ` the same way, with `--reply-to-ask '<ask id>'` for `--reply-to`: an open one (step 2 lists it), resolved once it has your reply, and one answered
|
|
56
|
+
Take each as [File a clear defect](#file-a-clear-defect) says.
|
|
57
|
+
5. Take each ask earlier rules opened whose question opens `Clear defect from ` the same way, with `--reply-to-ask '<ask id>'` for `--reply-to`: an open one (step 2 lists it), resolved once it has your reply, and one answered with a label that starts `Hand it`, a person's request: where step 2 or 3 of *File a clear defect* finds a live tree, reply `Not filed: dispatch://<KEY>; role:<token> is mentioned here` (`<KEY>` the issue or root), adding `--mention 'role:<its architect's token>'`: it reads the answer and evidence here; copy neither. If step 2's issue is in no tree, reply `Not filed: dispatch://<KEY> tracks it` to its person, mentioning no finder.
|
|
@@ -11,7 +11,7 @@ Read this when `skill://legion-controller/references/operations.md` sends you he
|
|
|
11
11
|
## A re-run of a CI run
|
|
12
12
|
|
|
13
13
|
1. Read the failed job's log: `gh run view <id> --log-failed --repo <owner>/<repo>`. Re-run only the failed jobs, and only for an infrastructure failure the log shows, such as a lost runner. Never re-run to test a theory, or on a head a run already tested with the same inputs.
|
|
14
|
-
2. A test that failed and passed on the same code is flaky: write it to the tree whose
|
|
14
|
+
2. A test that failed and passed on the same code is flaky: write it to the tree whose run it failed by a mention (`skill://legion-worker/references/findings.md#write-by-a-mention`), to be fixed at its cause.
|
|
15
15
|
3. Re-run with that token, and name in `--reason` the run, the failure and the issue key:
|
|
16
16
|
|
|
17
17
|
```sh
|
|
@@ -22,7 +22,7 @@ Read this when `skill://legion-controller/references/operations.md` sends you he
|
|
|
22
22
|
|
|
23
23
|
## An agent the operator holds
|
|
24
24
|
|
|
25
|
-
1. Open a `dispatch ask`
|
|
25
|
+
1. Open a `dispatch ask` that names the claim, quotes the refusal and says why its agent needs `<op>`, with the options `Resume it: the operator resumes the agent with legion claims resume, and I then run <op> on it` and `Keep it held: <what stays as it is>`.
|
|
26
26
|
2. Send no Envoy message to the session that holds the operator's token, and ask no other session to lift the hold.
|
|
27
27
|
3. Name the ask in your summary, and in the day's report while it is open.
|
|
28
28
|
4. On `Resume it`, run `<op>` again; on a second 409, reply under the ask with the refusal, and run it again at the next reply. On `Keep it held`, run nothing.
|
|
@@ -37,7 +37,7 @@ Restart it only when a person asks, your deployment instructions name the case,
|
|
|
37
37
|
1. `kubectl -n <namespace> get pods -l '<daemon label>' -o wide` lists one pod: note its name. With no pod or several, delete nothing and name it in the day's report.
|
|
38
38
|
2. `kubectl -n <namespace> delete pod -l '<daemon label>'`. The daemon's Deployment makes a new pod.
|
|
39
39
|
3. Read again each minute until a new pod reads `Running` with every container ready, or five minutes pass.
|
|
40
|
-
4. When no new pod is `Running` five minutes after the delete, open a finding ask
|
|
40
|
+
4. When no new pod is `Running` five minutes after the delete, open a finding ask that names the pod and its status.
|
|
41
41
|
|
|
42
42
|
Publish to no role topic while the restart runs: a message starts a turn that the wake pacing does not count.
|
|
43
43
|
|
|
@@ -50,7 +50,7 @@ The three steps, the pod uid before the request, the refusals and the pod uid af
|
|
|
50
50
|
## A re-run of a CI run
|
|
51
51
|
|
|
52
52
|
Your `gh` only reads: it holds the review App's read-only lease. This re-run and the reply to a GitHub mention take the implement App token the secrets broker lends, narrowed to the repository.
|
|
53
|
-
Re-run only the failed jobs of an infrastructure failure the log shows, and write a test that failed and passed on the same code to the tree whose
|
|
53
|
+
Re-run only the failed jobs of an infrastructure failure the log shows, and write a test that failed and passed on the same code to the tree whose run it failed, by a mention.
|
|
54
54
|
The four steps, the log read, the flaky test, the re-run and the read after it, are in `skill://legion-controller/references/operations-steps.md#a-re-run-of-a-ci-run`: read them before every re-run.
|
|
55
55
|
|
|
56
56
|
## An agent the operator holds
|
|
@@ -66,10 +66,10 @@ Before you act on one, read its five steps in `skill://legion-controller/referen
|
|
|
66
66
|
|
|
67
67
|
A decision only a person may make is a `dispatch ask`. Every other request goes to the session whose work it is, as a Dispatch comment on the owning issue that mentions its role, and to no other session, such as a person's chief of staff. A tree architect's token is `issues.<ROOT>.architect.locator.claim`, else `legion-<project>-<root key, lower case>-architect`.
|
|
68
68
|
|
|
69
|
-
- Merge or queue a pull request: not yours. Write to the architect of
|
|
70
|
-
- Cluster, cloud or CI: the restart, the re-run, the pod replacement and the reads above. Any other act (a quota, a pin, a Pulumi value) is a change of code:
|
|
69
|
+
- Merge or queue a pull request: not yours. Write to the architect of its tree, which enqueues one that no merger merges.
|
|
70
|
+
- Cluster, cloud or CI: the restart, the re-run, the pod replacement and the reads above. Any other act (a quota, a pin, a Pulumi value) is a change of code: file it as a clear defect. An apply window is a `dispatch ask`.
|
|
71
71
|
- Work, an investigation, a review, a decision or a status: read what you can reach yourself, and write the rest to its owner.
|
|
72
72
|
- What another agent sent you: send no relay; that agent writes to the owner itself.
|
|
73
|
-
- A person's request from outside Dispatch: write it to the
|
|
73
|
+
- A person's request from outside Dispatch: write it to the architect of the tree it concerns, in their words.
|
|
74
74
|
- A person's answer on an ask: mention the owner where the answer is, as `finding-asks.md`'s catch-up step 5 says, copying nothing.
|
|
75
75
|
- A copy only so another session knows: send none.
|
|
@@ -22,9 +22,9 @@ With no `failure.at`, end the key `generation <n>` (`issues.<ISSUE>.generation`)
|
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
Take the newest whose second line is exactly `<key>`, and `dispatch read --ref` the ask its first line names. Open, resolved with no answer, or your reply under it starts `Left admitted`: do nothing. Answered with no reply of yours: step 4. Your reply starts `Parked` or `Not parked`: the ask is spent; go on to step 2. No such comment: step 2.
|
|
25
|
-
2. Open a `dispatch ask`
|
|
25
|
+
2. Open a `dispatch ask` naming the root and `<cause>`, options `Park it` and `Leave it admitted`, saying that after a park Legion sets the root back to `todo` when the wait ends. Follow it (`dispatch follow --ask '<ref>' --action follow`). Comment on the root (`dispatch comment --issue <root> --body-file -`): first line `Asked whether to park: dispatch://<ASK KEY>/ask/<id>`, second line `<key>`, then `<cause>`.
|
|
26
26
|
3. Name the tree and the ask in the day's report while it is open.
|
|
27
|
-
4. On `Park it`, while the root's `phase` is not `done` and `read_state` still builds the same `<key>`: park the tree, with a comment citing the answer whose first line is `Parked by Legion while it waits on: <cause>`, the mark that makes the park your own hold. Otherwise, or on `Leave it admitted`, move nothing. Then reply under the ask, first line exactly `Parked dispatch://<root>`, `Not parked dispatch://<root>` or `Left admitted dispatch://<root>` (`dispatch comment --issue <
|
|
27
|
+
4. On `Park it`, while the root's `phase` is not `done` and `read_state` still builds the same `<key>`: park the tree, with a comment citing the answer whose first line is `Parked by Legion while it waits on: <cause>`, the mark that makes the park your own hold. Otherwise, or on `Leave it admitted`, move nothing. Then reply under the ask, first line exactly `Parked dispatch://<root>`, `Not parked dispatch://<root>` or `Left admitted dispatch://<root>` (`dispatch comment --issue <the ask's issue> --reply-to-ask '<ask id>' --body-file -`). Dispatch cannot resolve an answered ask, so that reply is its record.
|
|
28
28
|
|
|
29
29
|
Set a root parked with that mark back to `todo` once its cause is gone or its event has happened, with a comment on the root citing the mark and what you checked; or when a person asks, or a person's decision after the park gives it a next step (`skill://legion-controller/references/parked-decisions.md`).
|
|
30
30
|
|
|
@@ -16,7 +16,7 @@ Read this on a `triage` wake, at every start, and when a person hands you an iss
|
|
|
16
16
|
2. Find who set the label: read `/api/v1/issues/<issue>/events?limit=200` with the `dispatch api` of `skill://legion-controller/references/session.md` ("Reading Dispatch's API"), oldest first; while a page holds 200 events, read the next with `&after=<the last event's seq>`. The setter is the `actor` of the newest `issue.created` or `issue.updated` event whose `payload.labels` holds `legion` (any case) where the previous such event held none.
|
|
17
17
|
- `actor.kind` is `user`: the daemon queues the root itself. Do nothing more.
|
|
18
18
|
- Your own filing hands it over: its spec as filed (`dispatch doc-read --issue <issue> --version 1`) holds a `Filed for` line, and the actor is this session (`dispatch whoami`) or an earlier one of yours, which is one whose reply `Filed dispatch://<this KEY>` stands under the ask or evidence that line names. Where that line names an ask, the reply counts only when it follows a newest answer of `File it for Legion` on that ask.
|
|
19
|
-
- Any other actor hands over nothing. Leave the issue in `triage` and open an ask
|
|
19
|
+
- Any other actor hands over nothing. Leave the issue in `triage` and open an ask naming it and who labelled it, options `Admit it` and `Leave it`. Reply under it `Admitted dispatch://<KEY>` or `Not admitted: <reason>`.
|
|
20
20
|
3. Admit it (`set_status` to `todo`) only when you labelled it at a person's request, filed it yourself, or a person answered `Admit it`, unless a person's request says to wait or puts it out of scope. The deployment instructions are such a request; a line of your weekly plan is one only when it names the person's request behind it.
|
|
21
21
|
4. When a person's request says to wait, park it (`backlog`, or `icebox` for a longer wait); its label stays. Never park a root for lack of a free slot: in `todo` the waiting line holds it.
|
|
22
22
|
5. Comment on each root you admitted or parked what you decided and why, citing the request or reason behind a park. For one you admitted, say who gets its questions: `Assigned to <login>, who will get this tree's questions and its design approval`, or, with `Assignee: unassigned`, `Unassigned — this tree's questions and its design approval go to the project's default assignee until someone takes it from the issue header (Assignee, beside Priority)`. Leave out "and its design approval" when your system prompt reads `Design gate steps: none.`
|
|
@@ -36,7 +36,7 @@ path under its front-matter `supersedes:` key, use that file instead; if one has
|
|
|
36
36
|
A `docs/solutions/` page that sends the controller a defect, a flake, a notice, a pull request to
|
|
37
37
|
queue or a READY is older than the skills: `skill://legion-worker/references/findings.md` replaces
|
|
38
38
|
its routing of a finding, and `skill://legion-architect/references/operations.md` its merge-queue
|
|
39
|
-
steps. A finder fixes a defect
|
|
39
|
+
steps. A finder fixes a defect, and the controller queues no pull
|
|
40
40
|
request: the architect of its tree enqueues one that no merger merges.
|
|
41
41
|
|
|
42
42
|
## Output
|
|
@@ -6,8 +6,6 @@ Read it when GitHub reports the pull request `CONFLICTING`, the daemon's merge-f
|
|
|
6
6
|
|
|
7
7
|
The implementer merges the base into the issue branch only when GitHub reports it `CONFLICTING`, the daemon's merge-forward message asks it (*The daemon's ask*, below), its own architect asks because of a conflict another tree reported, the change needs something only the base has, or the pull request was retargeted. Past the review the merger merges the base forward when it merges, for a conflict or for a check the base's newer code breaks (its role prompt, "A head that conflicts with its base"), so the implementer merges then only when the daemon's merge-forward message or the merger asks it. Never to refresh CI or pick up the default branch: each merge is a new head that reruns CI and can void a review. Never with `jj rebase`, which rewrites pushed commits (*A wrong pushed commit*, below).
|
|
8
8
|
|
|
9
|
-
Before you race another tree's pull request on shared files, `envoy_publish` to its implementer's role topic, ask when its next push lands, and merge once, after it.
|
|
10
|
-
|
|
11
9
|
1. Merge the bookmark, never `@`, with the base, in one new commit. `base` is the pull request's base branch, JSON-quoted so jj reads it as a string literal:
|
|
12
10
|
|
|
13
11
|
```bash
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
Read this when `skill://legion-worker/references/findings.md` sends you here for a route's steps; that file states the rule each section here carries out.
|
|
4
4
|
|
|
5
|
-
## Write
|
|
5
|
+
## Write by a mention
|
|
6
6
|
|
|
7
|
-
1. Find the
|
|
7
|
+
1. Find the issue: the issue of an open pull request on a `legion/<KEY>` branch that changes that code, or the open issue `dispatch search` finds for it.
|
|
8
8
|
2. Walk its `child_of` links up to the tree's root: `dispatch read --issue <KEY>` names each parent under `Links:`.
|
|
9
|
-
3. Post the evidence on
|
|
9
|
+
3. Post the evidence on that issue, and mention the root's architect. `<project>` is the Legion project that runs the tree; for your own project it is the word after `legion-` in your role token.
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
dispatch comment --issue '<
|
|
12
|
+
dispatch comment --issue '<THAT KEY>' --mention 'role:legion-<project>-<root key, lower case>-architect' --body-file - <<'EOF'
|
|
13
13
|
Clear defect from <your role token>
|
|
14
14
|
<what went wrong, where and to whom, with the numbers; dispatch://<KEY> it came from; the repository and component; the fix; why you do not make it yourself>
|
|
15
15
|
EOF
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
For the controller, post the same comment on that project's report issue (the issue the deployment instructions name for Legion's reports, else the project's `Legion daily report`; a closed one takes a comment too, and with none, your own issue), with `--mention 'role:legion-<project>-controller'`. The controller replies under it and mentions your role. `Filed dispatch://<KEY>` names the issue it filed. On `Not filed: dispatch://<KEY>; role:<token> is mentioned here`, write nothing. On `Not filed: it stops your work, so it is yours to fix`, fix it. On any other `Not filed:` reply, open the ask yourself (`skill://legion-worker/references/findings.md`, step 3 of its first section).
|
|
19
19
|
|
|
20
20
|
Apart from that reply, file nothing and wait for nothing. A production check's result names your comment, `dispatch://<KEY>/comment/<id>`.
|
|
21
21
|
|
|
@@ -2,40 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
Read it when you find a problem your issue does not cover (a defect in another component, repository or tool, a gap in Legion itself), when another agent needs an action, or when a production check look fails. It holds for every Legion role and its subagents, and replaces the filing step of `skill://dispatch-first`. A child's own architect opens no ask itself: it sends the finding to the architect above it, and the root's architect opens the ask.
|
|
4
4
|
|
|
5
|
-
## Fix it yourself, else write to
|
|
5
|
+
## Fix it yourself, else write to the controller, and ask only for a decision
|
|
6
6
|
|
|
7
7
|
A finding outside your issue never becomes a `dispatch issue` you file. Take the first step that fits:
|
|
8
8
|
|
|
9
|
-
1. **Fix it yourself.** A defect with a clear fix
|
|
10
|
-
2. **Write to
|
|
11
|
-
3. **Ask.** A defect goes to a person only when it needs a person's decision, a deploy window or work much larger than your own. So does a finding that needs a person's authority, taste or risk appetite (whether it is wanted, which design,
|
|
9
|
+
1. **Fix it yourself.** A defect that stops your work, and a defect with a clear fix, are your tree's to fix, in any repository your credentials reach, with judgment: in your own pull request, or in a separate pull request of your tree. The implementer makes the fix, and a tester or a reviewer sends it to the implementer with its evidence (a tester with its red test, the reviewer in its review). Say so in the PR body. A phase worker whose own pull request cannot carry the fix sends it to the architect that owns its issue with `envoy_publish`; that architect adds it to an open pull request or files a child. If your fix touches files that another tree's open pull request changes, tell that tree's architect in a comment on the issue of that pull request, which mentions its role (`--mention 'role:legion-<its project>-<its root's key, lower case>-architect'`), names your pull request and says that you make the fix, and go on: do not wait for an answer.
|
|
10
|
+
2. **Write to the controller.** A defect in a repository your token does not reach goes to the controller of the project that repository maps to, or of your own project when Dispatch maps it to none, which files it. After the merge, the tester writes each clear defect a production check finds to that controller. How: [Write by a mention](#write-by-a-mention).
|
|
11
|
+
3. **Ask.** A defect goes to a person only when it needs a person's decision, a deploy window or work much larger than your own. So does a finding that needs a person's authority, taste or risk appetite (whether it is wanted, which design, a change of scope, cost or risk). It is a `dispatch ask`, with one recommendation where its options are real choices (*What the ask says*).
|
|
12
12
|
|
|
13
13
|
A human-only to-do, such as a deploy that only a person may make, is a `dispatch ask` too.
|
|
14
14
|
|
|
15
|
-
A
|
|
15
|
+
A problem inside your issue is fixed in your change. A phase worker's problem inside its tree but outside its issue goes to the architect its `Legion addressing` line names. A fault of Legion's own machinery that holds your phase is a finding too, never a request to another session to act on your agent or your session; tell the owning architect too where a stop rule says so.
|
|
16
16
|
|
|
17
|
-
Search first (`skill://dispatch-first`). An open issue that tracks the problem gets your evidence as a comment.
|
|
17
|
+
Search first (`skill://dispatch-first`). An open issue that tracks the problem gets your evidence, or what you fixed, as a comment. It is no reason to wait: wait only when it is claimed, it is `in_progress`, and its holder said on Envoy that it works on it now. Then tell that holder what you need and by when, and fix it yourself once that time has passed. An open ask about it (`dispatch open-asks --project <PROJECT>`) gets your evidence as a reply (`dispatch comment --issue <the ask's issue> --reply-to-ask '<ask id>' --body-file -`); open no second one.
|
|
18
18
|
|
|
19
|
-
## Write
|
|
19
|
+
## Write by a mention
|
|
20
20
|
|
|
21
|
-
Write
|
|
21
|
+
Write on Dispatch: a comment that mentions a role. Dispatch delivers the mention and retries it, so check no liveness first. The controller forwards no message from one agent to another. Mention the controller of the project the repository maps to on that project's report issue, or, where a rule sends the defect to another tree, that tree's root architect on its issue. The steps, the comment's form and what to do with each reply the controller writes are in `skill://legion-worker/references/findings-steps.md#write-by-a-mention`: read them before you write.
|
|
22
22
|
|
|
23
23
|
## Another agent that needs an action
|
|
24
24
|
|
|
25
25
|
The actions on an agent (stop, retry, suspend, resume the agent, compact, and start it in a fresh session) are the project's controller's alone: neither you nor your architect can take one. When another agent needs one, ask the controller with a `dispatch comment` on that agent's issue, `<KEY>`, that mentions the controller's role. Read its form in `skill://legion-worker/references/findings-steps.md#another-agent-that-needs-an-action` before you write the comment. Send the controller no `envoy_publish` for it: Dispatch delivers the mention and retries it. The controller replies under your comment with what it ran, or why it ran nothing; wait for nothing.
|
|
26
26
|
|
|
27
|
-
## Where it goes
|
|
28
|
-
|
|
29
|
-
An ask goes on the controller's report issue while it is open: the issue the deployment instructions name for Legion's reports, else the project's `Legion daily report` (`dispatch search --query '"Legion daily report"' --project <PROJECT>`). It stays open in `icebox`, so its asks stay answerable; a closed issue withdraws its open asks and refuses answers. With no open report issue, open the ask on the first of these that holds:
|
|
30
|
-
|
|
31
|
-
1. **Your own issue is open:** post the evidence and ask there, then publish the ask's reference to the architect that owns your issue. Where your task has an `acceptance:owner` step, it holds your issue's acceptance until a controller takes the ask. That hold keeps your issue open: an open ask on a closed issue drops out of the controller's listing.
|
|
32
|
-
2. **Your own issue is closed too** (`409 ISSUE_CLOSED`): put the report issue back in reach, then post and ask there, and say in your summary that you did. This is the one lifecycle status you write, and never through the `legion` tool's `set_status`.
|
|
33
|
-
- It exists and is closed: `dispatch issue-update --issue <REPORT KEY> --status icebox`, the status alone (a closed issue refuses a reopening status beside any other field).
|
|
34
|
-
- None exists: `dispatch issue --project <PROJECT> --title 'Legion daily report' --spec-file -`, with the Summary `skill://legion-controller/references/daily-report.md` gives, then `dispatch issue-update --issue <NEW KEY> --status icebox`. It carries no `legion` label.
|
|
35
|
-
|
|
36
27
|
## What the ask says
|
|
37
28
|
|
|
38
|
-
The question stands alone in at most 2,000 characters, the `Ref:` line `--ref` appends included. Its first line is `Finding from <your role token>`. Then the concrete case: what went wrong, where and to whom (`dispatch://<KEY>`, the machine, file, command or session, the numbers); where the fix belongs, saying plainly when it is not Legion's; the decision a person must make, each option's effect and your recommendation. Evidence the decision does not need goes in a comment posted first and cited by `--ref`:
|
|
29
|
+
The question stands alone in at most 2,000 characters, the `Ref:` line `--ref` appends included. Its first line is `Finding from <your role token>`. Then the concrete case: what went wrong, where and to whom (`dispatch://<KEY>`, the machine, file, command or session, the numbers); where the fix belongs, saying plainly when it is not Legion's; the decision a person must make, each option's effect, and your recommendation with its reason where the options are real choices (`skill://dispatch/SKILL.md#asks-and-ask-blocks`). Offer only the real choices. Evidence the decision does not need goes in a comment posted first and cited by `--ref`:
|
|
39
30
|
|
|
40
31
|
```bash
|
|
41
32
|
dispatch comment --issue '<ASK KEY>' --body-file - <<'EOF'
|
|
@@ -43,14 +34,14 @@ dispatch comment --issue '<ASK KEY>' --body-file - <<'EOF'
|
|
|
43
34
|
EOF
|
|
44
35
|
# Keep `File it for Legion` only when both role GitHub Apps are installed on the repository where the fix belongs.
|
|
45
36
|
dispatch ask --issue '<ASK KEY>' --ref 'dispatch://<ASK KEY>/comment/<id>' --question-file - \
|
|
46
|
-
--option 'File an issue: <what it would track, and who would
|
|
37
|
+
--option 'File an issue: <what it would track, and who would work it>' \
|
|
47
38
|
--option 'File it for Legion: Legion works it once it is filed' \
|
|
48
|
-
--option 'Do not file: <what stays as it is>' <<'EOF'
|
|
39
|
+
--option 'Do not file: <what stays as it is, and what that costs>' <<'EOF'
|
|
49
40
|
Finding from <your role token>
|
|
50
|
-
<what went wrong, where and to whom, with dispatch://<KEY> and the numbers; where the fix belongs; what each option does to whom; your recommendation and why>
|
|
41
|
+
<what went wrong, where and to whom, with dispatch://<KEY> and the numbers; where the fix belongs; what each option does to whom; where the options are real choices, your recommendation and why>
|
|
51
42
|
EOF
|
|
52
43
|
```
|
|
53
44
|
|
|
54
45
|
## Tell the controller about the ask
|
|
55
46
|
|
|
56
|
-
The answer reaches only the ask's followers. Once the ask is open, `envoy_publish` `dispatch://<
|
|
47
|
+
The answer reaches only the ask's followers. Once the ask is open, `envoy_publish` `dispatch://<ASK KEY>/ask/<id>` to the controller topic with `expects_reply: false`; the controller files what the answer asks for, and you file nothing. When the listener only kept that publish, do nothing more: the controller's catch-up finds it. An ask on your own issue holds its acceptance. A production check look names the comment or the ask in its result and summary.
|
|
@@ -23,10 +23,23 @@ The pull request body's `Checks` lines are in `skill://legion-worker/references/
|
|
|
23
23
|
The negative control shows it failing on a deliberately wrong input.
|
|
24
24
|
A documented procedure counts only when it ran: reading it is not a run.
|
|
25
25
|
|
|
26
|
-
- A `before_merge` result stands
|
|
27
|
-
|
|
26
|
+
- A `before_merge` result stands at a compared open or merged head in that result's repository.
|
|
27
|
+
The check needs a standing pass at every open head, across all its repositories.
|
|
28
|
+
When none is open, only the final head of the last pull request to merge is required.
|
|
29
|
+
An unordered merged set leaves the check not known.
|
|
30
|
+
A result stands while no part of the check's block has changed.
|
|
31
|
+
A pass and a fail at one required head read not known until one of them is retracted.
|
|
32
|
+
Results at a head that is not required do not decide the check.
|
|
33
|
+
After a push, record each `before_merge` check with no `ci_check` again at the new head.
|
|
28
34
|
Run it again only when the change since its pass can affect what it drives; otherwise record its earlier pass at the new head with `--observed 'carried from <old sha>: <why the change cannot affect it>'`.
|
|
29
35
|
|
|
36
|
+
- An `after_merge` result counts only at a commit on the branch the issue's pull request merged into, or on the default branch.
|
|
37
|
+
That commit must also be the merge of the work on that branch, or have it in its history.
|
|
38
|
+
The merge of the work is the commit that brought the issue's pull request that merged last into that branch.
|
|
39
|
+
Where work merged into an integration branch, the default branch uses that branch's newest recorded landing whose final head holds the work's merge.
|
|
40
|
+
The newest counting result chooses the commit whose verdicts decide the check.
|
|
41
|
+
A pass and a fail at that commit leave the check not known until one is retracted.
|
|
42
|
+
|
|
30
43
|
## The rules every phase's evidence follows
|
|
31
44
|
|
|
32
45
|
- The tester tries to break the changed surface (wrong and boundary inputs, the second and the concurrent run, the party it must refuse) and writes a failing test for each way it breaks that no existing test catches.
|
package/package.json
CHANGED
package/skills/dispatch/SKILL.md
CHANGED
|
@@ -10,23 +10,26 @@ Dispatch is a record for the people who decide, never a log of your work.
|
|
|
10
10
|
- Use the `dispatch` command; the HTTP API only for what no command does. `dispatch <command> --help` gives its rules and an example.
|
|
11
11
|
- Put long text on stdin, one flag per call: `--<field>-file -` with `<<'EOF'`; objects and lists take JSON.
|
|
12
12
|
- Exit 2 is a usage error: fix every problem it names before you call again. Exit 1 is any other failure: Dispatch's refusal, a Dispatch the command cannot reach, or `ANSWER_NOT_KEPT` for a call that wrote nothing, which you run again. `dispatch login` exits 1 when the broker cannot be reached or refuses, the person denies the login, or its code expires; its usage error names only the first bad argument.
|
|
13
|
-
- Never work around a hard-to-use command, or one storing or losing something wrongly:
|
|
13
|
+
- Never work around a hard-to-use command, or one storing or losing something wrongly: fix it in your own pull request, coordinating only with an open one that changes the same file. A Legion role's tree fixes it, through its implementer, as `skill://legion-worker/references/findings.md` says.
|
|
14
14
|
|
|
15
15
|
## Asks and ask blocks
|
|
16
16
|
|
|
17
17
|
- An ask is a question for a person, never a request to another agent. Ask an agent by envoy_send or a comment on the issue.
|
|
18
18
|
- An ask waits on its asked-of person, else the issue's assignee, else the project's default assignee; no agent hands one on.
|
|
19
|
-
-
|
|
19
|
+
- Ask a question only between two or more real choices: each within your rules, and one a person could choose. With one real choice, make it and say what you did and why.
|
|
20
|
+
- Give each choice's cost and one recommendation with its reason. A design question's ask block ends its section:
|
|
20
21
|
|
|
21
22
|
```md
|
|
22
23
|
:::ask{urgency="med"}
|
|
23
|
-
The question and
|
|
24
|
+
The question and one recommendation (`skill://dispatch-writing-specs`).
|
|
24
25
|
|
|
25
26
|
- Option one: what it costs.
|
|
26
27
|
- Option two: what it costs.
|
|
27
28
|
:::
|
|
28
29
|
```
|
|
29
30
|
|
|
31
|
+
- Ask for one act only the person can do (an approval, a credential, a grant, their own account's setting) as that act: what it is, what it changes and how to do it, with no recommendation and the options `Done` and `Can't` (`dispatch request-approval` keeps its own answers). A safer alternative is a fact, not an option.
|
|
32
|
+
- Add no option that breaks your rules or that no one would choose. Add an option not to act (`Hold`, `Leave it`) only where not acting is a real choice whose cost the question names.
|
|
30
33
|
- A decision block in a comment, message or close reason is refused: ask in the issue's document, or `dispatch ask`.
|
|
31
34
|
- Never repeat an open ask in a message.
|
|
32
35
|
- Change an open ask's block with `dispatch edit-ask` (ask id) or `doc-edit`'s `replace` or `move` (block id). An answered ask is fixed: ask anew. `dispatch read --ref` takes either id.
|
|
@@ -58,6 +61,7 @@ A claim (or `dispatch issue-update --route session:<your id>`, `--route ''` to r
|
|
|
58
61
|
|
|
59
62
|
- One issue per deliverable, its content the issue's document.
|
|
60
63
|
- A message replies to a person or tells them what they must know now.
|
|
64
|
+
- Begin no Dispatch comment, ask, reply or message with who you are or which role you hold: Dispatch shows the sender. A first line that a program reads stays.
|
|
61
65
|
- Text a person must read to decide belongs in the spec. An artifact is a real file; markdown uploads as `.md` whatever its local name, never `.txt`.
|
|
62
66
|
|
|
63
67
|
## Architecture components
|
|
@@ -22,7 +22,7 @@ dispatch search --query 'reviewer threads OR review comments'
|
|
|
22
22
|
|
|
23
23
|
`dispatch issue` and `dispatch ask` also search. Open each `advice.suggestions` hit too.
|
|
24
24
|
|
|
25
|
-
- **Work already tracked:** put the finding on that issue. File a new issue only when no hit covers the work, and cite the nearest one you ruled out (`dispatch://KEY`).
|
|
25
|
+
- **Work already tracked:** put the finding on that issue. It is no reason to wait: fix what stops you, in any repository your credentials reach, and say there what you did. Wait only on a claimed, `in_progress` issue whose holder said on Envoy it works on it now: tell them what you need by when, and fix it yourself after that time. If your fix touches files of another tree's open pull request, tell its architect in a comment and go on, waiting for no answer. File a new issue only when no hit covers the work, and cite the nearest one you ruled out (`dispatch://KEY`).
|
|
26
26
|
- **Question already decided:** cite the answered ask (`dispatch://KEY/ask/<id>`) and never ask again.
|
|
27
27
|
- **Duplicate found, or a likely duplicate a create names:** fold it only when it is the same work. Keep the issue with the spec, copy to it what only the duplicate has, and close the duplicate (`--status done --reason 'Duplicate of dispatch://KEY.'`). When it has the `legion` label or another holder's claim, comment the kept issue's name on it instead.
|
|
28
28
|
|
|
@@ -46,7 +46,7 @@ For each spec, ask, comment and message:
|
|
|
46
46
|
|
|
47
47
|
- Name the concrete case and its numbers, then the choice in those terms, never "Which option?".
|
|
48
48
|
- A choice inside what the person asked for, one their messages favour, routine cleanup, sequencing, naming, a choice between equivalent options, and a fix you can make are yours.
|
|
49
|
-
- Ask with an [ask block](skill://dispatch/SKILL.md#asks-and-ask-blocks)
|
|
49
|
+
- Ask with an [ask block](skill://dispatch/SKILL.md#asks-and-ask-blocks), by that section's rules, short and self-contained: a person answers it with no other reading.
|
|
50
50
|
- Measure each claim the ask rests on, its premise and each option's precondition. A claim you cannot measure stays out of the ask until it is measured. Call an option unavailable only where a precondition demonstrably fails. No unmeasured number goes in a premise.
|
|
51
51
|
- Before you pass a question on as one only an attended or privileged act answers, try the source that answers it, then the other records holding it. Keep a privileged read for what only the live system knows.
|
|
52
52
|
|