@sjawhar/claude-envoy 5.12.5 → 5.13.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.
@@ -1,28 +1,29 @@
1
1
  # Wake routing
2
2
 
3
- Read this when a wake reaches you. A wake about an issue reaches its own architect while that
4
- architect holds its role, else the nearest one above that does. A `child-status` or `child-closed`,
5
- and a `worker-died` or `worker-stalled` about a child's own architect, reach the architect above the
6
- child. Your role prompt describes most notices; this table says what to do. "Section N" is that
7
- section of `skill://legion-architect`. Where a row says to ask a person, a child's own architect
8
- sends the question to the architect above it.
3
+ Read this when a wake reaches you.
4
+ A wake about an issue reaches its own architect while that architect holds its role, else the nearest one above that does.
5
+ A `child-status` or `child-closed`, and a `worker-died` or `worker-stalled` about a child's own architect, reach the architect above the child.
6
+ Your role prompt describes most notices; this table says what to do.
7
+ "Section N" is that section of `skill://legion-architect`.
8
+ Where a row says to ask a person, a child's own architect sends the question to the architect above it.
9
9
 
10
10
  | Wake | What to do |
11
11
  | --- | --- |
12
12
  | `catch-up` | Start or resume from it as your role prompt says. Accept each issue its `reason` names as waiting for you (section 6), a parent only after its last round. |
13
13
  | `design-approved` | One gated step opened; `gatedSteps` in `read_record` says which. Once every step is `approved`, release the children (section 2). A task saying "this resume is your design-approved wake" is this wake. On a `handed_over` root, or a version a person's answer to a decision block wrote, start nothing. |
14
14
  | `design-changes-requested` | Revise the document of the step whose `status` is `changes_requested` as the reason asks, then request approval again ("The armed gate" in `skill://legion-architect/references/design-gate.md`) and end your turn. One for an older version came late: answer its reason if the latest version does not. |
15
- | `carried-gate-opened` | The gate this root carried opened. Start nothing and release nothing for it. |
16
- | `phase-finished` | The next phase already started. Read the finished handoff (`dispatch handoff-read --issue <issue> --phase <word>`) and tell the working role of any gap. A planner's departure from the design: keep the plan while the Summary, requirements, checks, scope and settled decisions hold, else change the spec ("After approval" in design-gate.md). A reviewer's `APPROVED`: section 6. A worker reporting that no surface reaches the changed path: build the surface in this tree, then tell it to continue. |
15
+ | `carried-gate-opened` | Start nothing and release nothing for it. |
16
+ | `phase-finished` | The next phase already started. Read the finished handoff (`dispatch handoff-read --issue <issue> --phase <word>`) and tell the working role of any gap. A planner's departure from the design: keep the plan while the Summary, requirements, checks, scope and settled decisions hold, else change the spec ("After approval" in design-gate.md). When the step before `acceptance:owner` finishes, section 6 applies. A worker reporting that no surface reaches the changed path: build the surface in this tree, then tell it to continue. |
17
+ | `retro-held`, `task-stopped`, `plan-not-taken` | Act as "The notices" in `skill://legion-architect/references/plan-changes.md` says. |
17
18
  | `pr-blocked` | The review round cap is reached: decide in this turn, as "A capped pull request" below says. |
18
19
  | `checks-red` | The daemon asked the implementer, or in `merging` the merger, to merge the base forward; the issue stays in the phase the notice names. Start nothing ("A conflicting head" in `skill://legion-architect/references/acceptance.md`). |
19
- | `review-stuck` | No review decides the round, or the approval is of other code: tell the reviewer on the notice's `topic` to approve the head or request changes; ask a person when it answers again with no review. GitHub will not merge the head: no `topic`, and its `reason` names the merge state, each check run with its conclusion and each commit status with its state; sort it as your role prompt says. |
20
+ | `review-stuck` | No review decides the round, or the approval is of other code: tell the reviewer on the notice's `topic` to approve the head or request changes; ask a person when it answers again with no review. GitHub will not merge the head (no `topic`): sort it as your role prompt says. |
20
21
  | `pr-merged` | Merged, not closed: it waits to reach `merging`, or for the issues beneath it. Start nothing. |
21
22
  | `pr-closed-unmerged` | Decide whether the work reopens, restarts or ends, and give the reason. A phase worker makes the repository change. |
22
23
  | `pull-request-missing` | Tell the implementer to open the pull request from the branch the reason names. |
23
24
  | `child-status` | A child left, re-entered, joined the tree or started. The daemon starts what runs. |
24
25
  | `child-closed` | Section 2. File any new child it calls for after the red-team check, and release it at once. When it was the last child an issue in `accepting` waits on, run that issue's last round. |
25
- | `children-first` | Release every child that should run. Move one that should not run now under another issue you own that has started and is not yet `accepting`, never under one it waits on, then ask the person on the root when it should run; sign off neither issue until they answer. A `blocked_by` link up the parent chain: ask a person to remove it. |
26
+ | `children-first` | Release every child that should run. Move one that should not run now where your role prompt's `children-first` paragraph says, then ask the person on the root when it should run; sign off neither issue until they answer. A `blocked_by` link up the parent chain: ask a person to remove it. |
26
27
  | `child-release-stalled` | Read the parent's record (`read_record`), release the parent first when the reason says so, then release the child again. Tell the controller if the parent never records. |
27
28
  | `child-not-recorded` | Set the child's repository (`dispatch issue-update --repo owner/name`) or get the named App installed, then release it again; else tell the controller. |
28
29
  | `worker-died` | A phase worker: the issue is held; `retry_or_escalate` with `retry` for an agent or transient failure (its `reason` says what changed), `escalate` for an environmental one or a prompt too large for its pod. A child's own architect: the child is yours until it runs again; read its record and handoffs, and tell the role working its phase to send questions to you. A finished role: nothing is held; read its handoff. |
@@ -37,20 +38,20 @@ sends the question to the architect above it.
37
38
 
38
39
  ## A capped pull request
39
40
 
40
- A `pr-blocked` reason reads `<n> rounds counted, <m> conflict rounds not counted`: judge the cap by
41
- `<n>`. Requests for changes are what it counts. Read what every counted round found, choose one, act
42
- on it, and post the rounds you read and the choice as a `dispatch comment`:
43
-
44
- - **Narrow**: the change is sound but each round finds more around it. Tell the implementer and the
45
- reviewer which checks the next round answers, dropping no requirement. A correctness finding or
46
- a clear fix in a touched file stays in this pull request.
47
- - **Split**: part of the work cannot settle here. On a child, it becomes a child of this issue's
48
- parent (a child's own architect sends it up with `envoy_publish`); that parent's architect files
49
- it after the red-team check with `--blocked-by <this issue>` and releases it at once. On the
50
- root, open a `dispatch ask`; the part stays a requirement until the person's answer says
51
- otherwise.
52
- - **Accept the rounds**: each round found less than the one before, and the last found no defect
53
- in the change itself. A later notice accepts again only when its round found less.
54
-
55
- A finding that changes what the spec requires or a check proves is also a spec change ("After
56
- approval" in `skill://legion-architect/references/design-gate.md`), never instead of the choice.
41
+ A `pr-blocked` reason reads `<n> rounds counted, <m> conflict rounds not counted`: judge the cap by `<n>`.
42
+ Requests for changes are what it counts.
43
+ Read what every counted round found, choose one, act on it, and post the rounds you read and the choice as a `dispatch comment`:
44
+
45
+ - **Narrow**: the change is sound but each round finds more around it.
46
+ Tell the implementer, and a reviewer step where there is one, which checks the next round answers, dropping no requirement.
47
+ A correctness finding or a clear fix in a touched file stays in this pull request.
48
+
49
+ - **Split**: part of the work cannot settle here.
50
+ On a child, it becomes a child of this issue's parent (a child's own architect sends it up with `envoy_publish`);
51
+ that parent's architect files it after the red-team check with `--blocked-by <this issue>` and releases it at once.
52
+ On the root, open a `dispatch ask`; the part stays a requirement until the person's answer says otherwise.
53
+
54
+ - **Accept the rounds**: each round found less than the one before, and the last found no defect in the change itself.
55
+ A later notice accepts again only when its round found less.
56
+
57
+ A finding that changes what the spec requires or a check proves is also a spec change ("After approval" in `skill://legion-architect/references/design-gate.md`), never instead of the choice.
@@ -1,23 +1,45 @@
1
1
  # Reading admission
2
2
 
3
- Read this when you need to know where an issue stands in admission, or what an `admission.held` word means. An issue's `phase` alone does not say it: read its key against the `admission` lists and the root its `tree` names. The rules behind them: [Admission and the `legion` label](https://cybermonklabs.github.io/legion/legion/concepts/#admission-and-the-legion-label).
3
+ Read this when you need to know where an issue stands in admission, or what an `admission.held` word means.
4
+ An issue's `phase` alone does not say it: read its key against the `admission` lists and the root its `tree` names.
5
+ The rules behind them: [Admission and the `legion` label](https://cybermonklabs.github.io/legion/legion/concepts/#admission-and-the-legion-label).
4
6
 
5
7
  ## The lists
6
8
 
7
- - `admission.active`: every issue holding a slot, a root or a child, at work, `held` or waiting on a person. An issue past its review (`accepting`, `retro`, `merging`) holds none, and neither does a started issue that waits on another issue, except three roots that keep theirs: one in `awaiting_person`, one at `admitted` whose gate has never opened, and one carried from another tree.
8
- - `admission.trees`: the roots of the live trees, whether or not any issue of them holds a slot. Use it, not `admission.active`, for which trees run.
9
- - `admission.waiting`: the line, in order. First the issues whose work came back, oldest first; then the issues whose first phase can start, by their root's Dispatch rank and then their own. `issues.<KEY>.waitingLine` says where one stands (`part`, `kind`, `holdsSlot`, `reason`): quote its `reason` before you call an order wrong.
10
- - `admission.blocked`: issues waiting on an unfinished `blocked_by` issue, or a parent waiting for its open children. A started issue here gave its slot back and takes one again by itself; nothing of its work stops.
11
- - `phase: awaiting_person` with `waitingOn`: a root waiting on a person's answer or review keeps its slot and is in no line. `waitingOn.answeredAt` means the daemon has put it in `admission.waiting` as well, among the issues whose work came back, oldest first, where it stands until the pass that resumes it.
12
- - `phase: admitted`, in no list, with a `child_of` parent: a child that has not started. Leave it to its tree.
13
- - `phase: admitted`, `status: todo`, in no list, no parent: a person took its label off. Nothing to do.
14
- - `phase: done` while `status` is `in_progress`, `testing`, `needs_review` or `retro`: someone else moved a waiting root, or a root waiting on a person lost its label or claim, and the daemon sent `unslotted`. Re-admit nothing.
9
+ - `admission.active`: every issue holding a slot, a root or a child, at work, `held` or waiting on a person.
10
+ An issue past its review (`accepting`, `retro`, `merging`) holds none, and neither does a started issue that waits on another issue, except three roots that keep theirs:
11
+ one in `awaiting_person`, one at `admitted` whose gate has never opened, and one carried from another tree.
12
+
13
+ - `admission.trees`: the roots of the live trees, whether or not any issue of them holds a slot.
14
+ Use it, not `admission.active`, for which trees run.
15
+
16
+ - `admission.waiting`: the line, in order.
17
+ First the issues whose work came back, oldest first; then the issues whose first phase can start, by their root's Dispatch rank and then their own.
18
+ `issues.<KEY>.waitingLine` says where one stands (`part`, `kind`, `holdsSlot`, `reason`): quote its `reason` before you call an order wrong.
19
+
20
+ - `admission.blocked`: issues waiting on an unfinished `blocked_by` issue, or a parent waiting for its open children.
21
+ A started issue here gave its slot back and takes one again by itself; nothing of its work stops.
22
+
23
+ - `phase: awaiting_person` with `waitingOn`: a root waiting on a person's answer or review keeps its slot and is in no line.
24
+ `waitingOn.answeredAt` means the daemon has put it in `admission.waiting` as well, among the issues whose work came back, oldest first, where it stands until the pass that resumes it.
25
+
26
+ - `phase: admitted`, in no list, with a `child_of` parent: a child that has not started.
27
+ Leave it to its tree.
28
+
29
+ - `phase: admitted`, `status: todo`, in no list, no parent: a person took its label off.
30
+ Nothing to do.
31
+
32
+ - `phase: done` while `status` is `in_progress`, `testing`, `needs_review` or `retro`:
33
+ someone else moved a waiting root, or a root waiting on a person lost its label or claim, and the daemon sent `unslotted`.
34
+ Re-admit nothing.
15
35
 
16
36
  Holding no slot is no fault by itself.
17
37
 
18
38
  ## `admission.held`: what nothing starts
19
39
 
20
- Every issue the record holds in the workflow that is in neither `admission.active` nor `admission.waiting`, with one word for why nothing of it runs and `heldBy`, the issues that hold it. Name them in the day's report and take nothing for them.
40
+ Every issue the record holds in the workflow that is in neither `admission.active` nor `admission.waiting`, with one word for why nothing of it runs and `heldBy`, the issues that hold it.
41
+ Each waits for what ends it, in the table's last column.
42
+ Name them in the day's report and take nothing for them.
21
43
 
22
44
  | Word | Meaning | What ends it |
23
45
  |---|---|---|
@@ -30,5 +52,7 @@ Every issue the record holds in the workflow that is in neither `admission.activ
30
52
  | `dispatch_blocker` | A `blocked_by` issue is not `done` | Each blocker `done`, or the link taken off |
31
53
  | `children_first` | An open child under it | The last open child leaving the workflow |
32
54
  | `accepted_ancestor` | An ancestor's reviewed head is accepted | That ancestor standing in neither `retro` nor `merging` (a `held` ancestor stands in the phase it was held from) |
55
+ | `children_before_retro` | A parent without `acceptance:owner` is held before retro while its children run | The last `heldBy` issue leaves the workflow, then Legion starts retro |
56
+ | `task_stopped` | A task is stopped and no step of it runs | A later `register_plan` version that changes the task, or a root's `todo`, starts its first step |
33
57
  | `at_work` | Past its review, not `held`, on no slot | Its own sign-off, retro and merge |
34
58
  | `unclassified` | None of the above | Nothing of yours: name it with its `phase` and `status` |
@@ -4,7 +4,10 @@ Read this on your first turn of each UTC day, and when you open, follow or answe
4
4
 
5
5
  ## Find the report issue
6
6
 
7
- Use 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>`). When none exists, create it once, the one issue you file unasked, and park it in `icebox`: it holds no work and never carries the `legion` label. Assign it to the person who answers for the project (the deployment instructions name them, else the owner `dispatch whoami` names), because its asks reach that person's Inbox; with nobody known, leave out `--assignee`.
7
+ Use 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>`).
8
+ When none exists, create it once, the one issue you file unasked, and park it in `icebox`: it holds no work and never carries the `legion` label.
9
+ Assign it to the person who answers for the project (the deployment instructions name them, else the owner `dispatch whoami` names), because its asks reach that person's Inbox;
10
+ with nobody known, leave out `--assignee`.
8
11
 
9
12
  ```text
10
13
  dispatch issue --project <PROJECT> --title 'Legion daily report' --assignee '<email>' --spec-file - <<'EOF'
@@ -19,9 +22,14 @@ legion({ op: "set_status", issue: "<report KEY>", status: "icebox" })
19
22
 
20
23
  Each time you read it:
21
24
 
22
- - `Status: done`: the close withdrew its open asks, and Dispatch refuses new ones. Reopen it with `set_status` to `icebox` and say so in the day's report.
23
- - `Assignee: unassigned` with a person known: `dispatch issue-update --issue <REPORT KEY> --assignee <email>`. A refusal (`400 ASSIGNEE_NOT_ALLOWED` names an email nobody has signed in to Dispatch with) leaves it as it was: name it in your summary.
24
- - While it is unassigned, open each report with one sentence asking a person to take the issue from its header: until someone does, its asks go to the project's default assignee.
25
+ - `Status: done`: the close withdrew its open asks, and Dispatch refuses new ones.
26
+ Reopen it with `set_status` to `icebox` and say so in the day's report.
27
+
28
+ - `Assignee: unassigned` with a person known: `dispatch issue-update --issue <REPORT KEY> --assignee <email>`.
29
+ A refusal (`400 ASSIGNEE_NOT_ALLOWED` names an email nobody has signed in to Dispatch with) leaves it as it was: name it in your summary.
30
+
31
+ - While it is unassigned, open each report with one sentence asking a person to take the issue from its header:
32
+ until someone does, its asks go to the project's default assignee.
25
33
 
26
34
  ## When
27
35
 
@@ -29,18 +37,50 @@ After the turn's own work, read the report issue, keep it answerable, and post w
29
37
 
30
38
  ## What
31
39
 
32
- One `dispatch message --issue <report KEY> --body-file -` of at most 2,000 characters, written as `skill://dispatch-writing-specs`'s "Rules for the text" say: every issue by its `dispatch://` link and what it does for the reader, every pull request by its URL. A day with nothing finished says so in one sentence; when the lists do not fit, give each list's count and name its priority 0 and 1 issues in board rank order.
40
+ One `dispatch message --issue <report KEY> --body-file -` of at most 2,000 characters, written as `skill://dispatch-writing-specs`'s "Rules for the text" say:
41
+ every issue by its `dispatch://` link and what it does for the reader, every pull request by its URL.
42
+ A day with nothing finished says so in one sentence; when the lists do not fit, give each list's count and name its priority 0 and 1 issues in board rank order.
43
+
44
+ - **Finished.**
45
+ `dispatch issues --project <PROJECT> --status done --updated-since <the previous report's time, or 24 hours ago> --all`, keeping the issues `read_state` records whose `issue.closed` is after the previous report, each with the pull request under its `External links:`.
46
+
47
+ - **Closed without a change.**
48
+ Those with no pull request, each with the reason its closing message gave (the `message.created` before `issue.closed`, with only the close's own settlement and withdrawal lines between them).
49
+
50
+ - **Running.**
51
+ Each root in `admission.trees` with its phase, and under it each of its issues in `admission.active` with its own;
52
+ then `admission.waiting`; then each root the every-turn check found waiting on a claim, with its holder.
53
+
54
+ - **Waiting on Dispatch links.**
55
+ Each issue in `admission.blocked` with what it waits on;
56
+ say of each whose `waitingLine.kind` is `waiting_on_issue` that it holds no slot while it waits, nothing of its work stopped, and it takes one again by itself.
57
+
58
+ - **What nothing starts.**
59
+ `admission.held` grouped by `reason`, each group's count, issues and `heldBy`, and what ends it (`skill://legion-controller/references/admission.md`);
60
+ an `unclassified` issue with its `phase` and `status`;
61
+ each `task_stopped` issue with its `heldFrom`.
62
+
63
+ - **Phase workers nothing will prompt.**
64
+ The most recent tick's `silent` list, with each role and how long it has been quiet, or how long its background work has stood (`backgroundSince`).
65
+ The list comes on the tick alone.
66
+
67
+ - **Waiting on a person.**
68
+ Each tree whose next step waits on a person's answer (a park, deferral, finding or any other ask), with that ask's `dispatch://` reference, while the ask is open.
69
+
70
+ - **Asks resolved with no answer.**
71
+ For each root in `admission.active` or `admission.waiting`, the newest `Asked whether to park:` and `Asked whether to defer:` comment of each key (step 1 of `skill://legion-controller/references/park-asks.md`, once with each prefix) whose ask was resolved with no answer, unless its wait has ended.
33
72
 
34
- - **Finished.** `dispatch issues --project <PROJECT> --status done --updated-since <the previous report's time, or 24 hours ago> --all`, keeping the issues `read_state` records whose `issue.closed` is after the previous report, each with the pull request under its `External links:`.
35
- - **Closed without a change.** Those with no pull request, each with the reason its closing message gave (the `message.created` before `issue.closed`, with only the close's own settlement and withdrawal lines between them).
36
- - **Running.** Each root in `admission.trees` with its phase, and under it each of its issues in `admission.active` with its own; then `admission.waiting`; then each root the every-turn check found waiting on a claim, with its holder.
37
- - **Waiting on Dispatch links.** Each issue in `admission.blocked` with what it waits on; say of each whose `waitingLine.kind` is `waiting_on_issue` that it holds no slot while it waits, nothing of its work stopped, and it takes one again by itself.
38
- - **What nothing starts.** `admission.held` grouped by `reason`, each group's count, issues and `heldBy`, and what ends it (`skill://legion-controller/references/admission.md`); an `unclassified` issue with its `phase` and `status`.
39
- - **Phase workers nothing will prompt.** The most recent tick's `silent` list, with each role and how long it has been quiet, or how long its background work has stood (`backgroundSince`). The list comes on the tick alone.
40
- - **Waiting on a person.** Each tree whose next step waits on a person's answer (a park, deferral, finding or any other ask), with that ask's `dispatch://` reference, while the ask is open.
41
- - **Asks resolved with no answer.** For each root in `admission.active` or `admission.waiting`, the newest `Asked whether to park:` and `Asked whether to defer:` comment of each key (step 1 of `skill://legion-controller/references/park-asks.md`, once with each prefix) whose ask was resolved with no answer, unless its wait has ended.
42
73
  - **Free slots**, counted in issues, as the skill's "Free slots" says.
43
- - **The priorities.** Each plan line the reconciliation before this report moved for the deployment's priorities, and this project's count of work in flight under no priority, both from step 2 of `skill://legion-controller/references/backlog-stewardship.md#reconcile-the-weekly-plan`.
44
- - **Open capabilities.** Each `capabilities` row with `status: open`: its name, `detail`, a deployment row's `configLine`, and who acts on it. Nothing when none is open.
45
- - **Stalled work.** Each `provider-errors` run with its model, and each root an `architect-stalled` or `tree-stalled` wake left for the report (`skill://legion-controller/references/wakes.md`).
46
- - **The week** (first report of each UTC week only): the numbers of `skill://legion-controller/references/weekly-audit.md`, each beside the command that recounts it.
74
+
75
+ - **The priorities.**
76
+ Each plan line the reconciliation before this report moved for the deployment's priorities, and this project's count of work in flight under no priority, both from step 2 of `skill://legion-controller/references/backlog-stewardship.md#reconcile-the-weekly-plan`.
77
+
78
+ - **Open capabilities.**
79
+ Each `capabilities` row with `status: open`: its name, `detail`, a deployment row's `configLine`, and who acts on it.
80
+ Nothing when none is open.
81
+
82
+ - **Stalled work.**
83
+ Each `provider-errors` run with its model, and each root an `architect-stalled` or `tree-stalled` wake left for the report (`skill://legion-controller/references/wakes.md`).
84
+
85
+ - **The week** (first report of each UTC week only):
86
+ the numbers of `skill://legion-controller/references/weekly-audit.md`, each beside the command that recounts it.
@@ -1,63 +1,66 @@
1
1
  ---
2
2
  name: legion-retro
3
- description: "Use when the Legion daemon starts you, the implementer, on `Phase: retro` after the architect accepted the reviewed head."
3
+ description: "Use when the Legion daemon starts you, the implementer, on `Phase: retro` after the task's last step passed."
4
4
  ---
5
5
 
6
6
  # Legion retro
7
7
 
8
- Retro runs on the reviewed head, between the architect's acceptance and the merger's merge.
9
- `<issue>` is your `LEGION_ISSUE`. Run every step, even on a mechanical change.
8
+ Retro runs after the task's last step, between that step and the merger's merge.
9
+ The architect's acceptance precedes it only where the task names `acceptance:owner`.
10
+ `<issue>` is your `LEGION_ISSUE`.
11
+ Run every step, even on a mechanical change.
10
12
 
11
- Retro commits nothing and pushes nothing: the merger merges the branch's head, and a push would put
12
- a commit above the head the reviewer approved. Outside a forward merge of the base, no Legion check
13
- compares the head that merges with the one the review approved. Never rebase the branch or make
14
- another branch or bookmark.
15
- Retro writes no handoff. In the workspace it changes nothing; outside it, it writes only step 4's
16
- `mktemp -d` directory, the PR body and the Dispatch comment and message. It sets no GitHub or
17
- Dispatch label: Legion keeps phase state in the daemon.
18
- What the work taught is a `dispatch comment` for the skill librarian; no role writes to
19
- `docs/solutions/`.
13
+ Retro commits nothing and pushes nothing: the merger merges the branch's head, and a push would put a commit above the head the last worker step passed.
14
+ Outside a forward merge of the base, no Legion check compares the head that merges with a review's head.
15
+ Never rebase the branch or make another branch or bookmark.
16
+ Retro writes no handoff.
17
+ In the workspace it changes nothing; outside it, it writes only step 4's `mktemp -d` directory, the PR body, the Dispatch comment and message, and, with no reviewer step, the review-thread replies and resolutions of step 1.
18
+ It sets no GitHub or Dispatch label: Legion keeps phase state in the daemon.
19
+ What the work taught is a `dispatch comment` for the skill librarian; no role writes to `docs/solutions/`.
20
20
 
21
21
  ## When retro stops
22
22
 
23
- When a step fails (the body cannot be computed, read or written, or Dispatch refuses a write), do
24
- not call `handoff_complete`: send the command and its output to the architect's topic on your
25
- `Legion addressing` line. A defect you find in the work goes to the architect with its evidence,
26
- and you hold your completion until it answers: while retro holds the phase,
27
- `request_backward_move` is yours, and `handoff_complete` takes it away. End each turn of that hold
28
- with a WAITING line naming the defect and the answer you wait on.
23
+ When a step fails (the body cannot be computed, read or written, or Dispatch refuses a write), do not call `handoff_complete`:
24
+ send the command and its output to the architect's topic on your `Legion addressing` line.
25
+ A defect you find in the work, other than a bot thread that step 1 sends back, goes to the architect with its evidence, and you hold your completion until it answers:
26
+ while retro holds the phase, `request_backward_move` is yours, and `handoff_complete` takes it away.
27
+ End each turn of that hold with a WAITING line naming the defect and the answer you wait on.
29
28
 
30
29
  ## Steps
31
30
 
32
- 1. **Read the evidence**: the issue, `dispatch results --issue <issue>`, the pull request, the
33
- tester's handoff (`dispatch handoff-read --issue <issue> --phase test`) and the review at the
34
- version your task's `Handoff:` line names (`--phase review --version <n>`). A pass must stand at
35
- the approved head for every `before_merge` check, and the body's `Checks` block carries each.
36
- - A check carrying `ci_check` is CI's: its derived result is the pass it needs
37
- (`skill://legion-worker/references/ci-checks.md`). A `ci_check` check has no pass standing at
38
- that head when its derived result is a fail, or its run concluded `skipped`, `neutral` or
39
- `cancelled`. Wait for a run that has not concluded, and read again where GitHub could not be
40
- read. Send a name that no run answers (`absent`) to the architect as a finding, since the
41
- check's words are wrong, and the same for a check whose `run` is a whole test suite. Neither
42
- wait nor that finding moves the issue back.
43
- - A `ci_check` check whose derived result is a fail is the merger's: the change is accepted,
44
- and the merger decides at the merge whether the base or the change broke it. Name it in your
45
- retro message and complete.
46
- - Any other check with no pass standing, or a check with no `ci_check` whose only evidence is a
47
- unit suite: `request_backward_move` with `to: implementing` for the implementer's result, or
48
- `to: testing` for the tester's, its `reason` naming the check's block id.
49
- 2. **Get a second reading.** First list in your session the constraints the issue did not state,
50
- choices between two working options, abandoned approaches and reusable code. Then run
51
- `task(agent="oracle")` with the issue, the pull request body and the diff, asking for reusable
52
- learnings, and `wait` for its answer. Drop a point that cites no file, symbol, quoted text or
53
- commit of this pull request.
54
- 3. **Record the learnings** as one `dispatch comment` on the issue, per
55
- `skill://legion-retro/references/learnings.md`. When no point qualifies, write no comment and
56
- say so in step 5's message.
57
- 4. **Update the PR body**, per `skill://legion-retro/references/pr-body-content.md`, when the
58
- repository derives body lines from changed paths.
59
- 5. **Post one Dispatch message on the issue**, at most 32,000 characters (never a `gh issue`
60
- write):
31
+ 1. **Read the evidence**: the issue, `dispatch results --issue <issue>`, the pull request, and the implementer's handoff.
32
+ Also read the tester's handoff (`dispatch handoff-read --issue <issue> --phase test`) where it has a tester step, and the review at the version your task's `Handoff:` line names (`--phase review --version <n>`) where it has a reviewer step.
33
+ A pass must stand at the last worker step's head for every `before_merge` check, and the body's `Checks` block carries each.
34
+
35
+ - A check carrying `ci_check` is CI's: its derived result is the pass it needs (`skill://legion-worker/references/ci-checks.md`).
36
+ A `ci_check` check has no pass standing at that head when its derived result is a fail, or its run concluded `skipped`, `neutral` or `cancelled`.
37
+ A run that has not concluded, or one GitHub could not be read for, is neither a pass nor a fail yet: never wait for, watch or poll it, as your role prompt says of CI.
38
+ Name each run that has not concluded, with the time you read it, in step 5's `Runs still going` line, and go on; when CI settles, the daemon tells the architect and the worker of the phase the issue then stands in.
39
+ Send a name that no run answers (`absent`) to the architect as a finding, since the check's words are wrong, and the same for a check whose `run` is a whole test suite.
40
+ Neither that run nor that finding moves the issue back.
41
+
42
+ - A `ci_check` check whose derived result is a fail is the merger's: the change is accepted, and the merger decides at the merge whether the base or the change broke it.
43
+ Name it in your retro message and complete.
44
+
45
+ - Any other check with no pass standing, or a check with no `ci_check` whose only evidence is a unit suite:
46
+ `request_backward_move` with `to: implementing` for the implementer's result, or, where the task has a tester step, `to: testing` for the tester's result;
47
+ name the check's block id in the reason.
48
+
49
+ - With no reviewer step, list the unresolved bot threads and answer the ones you find, as `skill://legion-worker/references/review-threads.md` says.
50
+ For a thread that needs a fix, `request_backward_move` with `to: implementing`, the thread's URL in its `reason`.
51
+
52
+ 2. **Get a second reading.**
53
+ First list in your session the constraints the issue did not state, choices between two working options, abandoned approaches and reusable code.
54
+ Then run `task(agent="oracle")` with the issue, the pull request body and the diff, asking for reusable learnings, and `wait` for its answer.
55
+ Drop a point that cites no file, symbol, quoted text or commit of this pull request.
56
+
57
+ 3. **Record the learnings** as one `dispatch comment` on the issue, per `skill://legion-retro/references/learnings.md`.
58
+ When no point qualifies, write no comment and say so in step 5's message.
59
+
60
+ 4. **Update the PR body** per `skill://legion-retro/references/pr-body-content.md`: the lines the repository derives from changed paths, where it derives any.
61
+ With no reviewer step, also record step 1's bot threads in `Threads` at the head you found, and bring `Not proven / risk` up to date from the tester's handoff where the task has one, naming each check whose run has not concluded (`skill://legion-worker/references/pr-body.md`, "The brief for the human").
62
+
63
+ 5. **Post one Dispatch message on the issue**, at most 32,000 characters (never a `gh issue` write):
61
64
 
62
65
  ```bash
63
66
  dispatch message --issue '<KEY>' --body-file - <<'EOF'
@@ -68,7 +71,11 @@ with a WAITING line naming the defect and the answer you wait on.
68
71
  **Key takeaways:**
69
72
  - <one to three reusable lessons>
70
73
 
71
- **Results read:** implementer <check and result>, tester <check and result>.
74
+ **Results read:** implementer <check and result>, tester <check and result, where the task has a tester step>.
75
+
76
+ **Declined threads:** <with no reviewer step, each bot thread step 1 declined, by node id with its reason, or none>
77
+
78
+ **Runs still going:** <each run whose check had not concluded when you read `dispatch results`, by its name with the time you read it, and that it may open more bot threads; or none>
72
79
 
73
80
  **Production check:** <the command or user action that will show the change working in production>
74
81
  **Carried by:** <the deploy or restart that carries the merge there>
@@ -78,20 +85,18 @@ with a WAITING line naming the defect and the answer you wait on.
78
85
 
79
86
  A Dispatch comment or message never carries the `<!-- legion: … -->` footer. Dispatch records the session that wrote it, and only a pull-request comment or review needs the footer.
80
87
 
81
- 6. **Complete** with the `legion` tool's `handoff_complete`, its summary two sentences for the
82
- architect. In the same call, rate the plan the issue ran (its steps and the role that worked
83
- each, not the planner's `plan.md`): send both `plan_rating`, a whole number from 1 (the plan
84
- cost the work) to 5 (the plan fit the work), and `plan_reason`, one sentence of why from step
85
- 1's evidence, or neither where your `legion` tool's `handoff_complete` takes neither field. The
86
- daemon refuses a completion without them (`PLAN_RATING_REQUIRED`), with one alone, a rating off
87
- that scale or a reason blank or over 2,000 characters (`PLAN_RATING_INPUT`), and with both on
88
- any other completion (`PLAN_RATING_UNEXPECTED`). A refusal records nothing: complete again.
88
+ 6. **Complete** with the `legion` tool's `handoff_complete`, its summary two sentences for the architect.
89
+ In the same call, rate the plan the issue ran (its steps and the role that worked each, not the planner's `plan.md`):
90
+ send both `plan_rating`, a whole number from 1 (the plan cost the work) to 5 (the plan fit the work), and `plan_reason`, one sentence of why from step 1's evidence, or neither where your `legion` tool's `handoff_complete` takes neither field.
91
+ The daemon refuses a completion without them (`PLAN_RATING_REQUIRED`), with one alone, a rating off that scale or a reason blank or over 2,000 characters (`PLAN_RATING_INPUT`), and with both on any other completion (`PLAN_RATING_UNEXPECTED`).
92
+ A refusal records nothing: complete again.
89
93
 
90
94
  ## Before you complete
91
95
 
92
- - `jj -R "$LEGION_WORKSPACE" diff --from "legion/${LEGION_ISSUE:?}@origin" --to @ --name-only`
93
- lists nothing.
96
+ - `jj -R "$LEGION_WORKSPACE" diff --from "legion/${LEGION_ISSUE:?}@origin" --to @ --name-only` lists nothing.
97
+
94
98
  - Each body line you added or changed that says work was done names work this pull request did.
99
+
95
100
  - The comment and the message are posted, and the pull request's head is the head you found.
96
- - Your `handoff_complete` carries `plan_rating` and `plan_reason`, or neither where your `legion`
97
- tool's `handoff_complete` takes neither.
101
+
102
+ - Your `handoff_complete` carries `plan_rating` and `plan_reason`, or neither where your `legion` tool's `handoff_complete` takes neither.
@@ -1,40 +1,39 @@
1
1
  # The PR body lines the changed paths require
2
2
 
3
- Read this at step 4 of `skill://legion-retro`. A failure here stops retro as its "When retro
4
- stops" says. A repository can require body lines derived from the changed paths, read by a required
5
- check; the body approved earlier may not cover every path the pull request now changes, and the
6
- merger reports a stale body rather than rewriting it. `<owner>/<repo>` and `<n>` are the pull
7
- request's repository and number.
8
-
9
- 1. Read your deployment instructions, the repository's agent guide (`AGENTS.md`, `CLAUDE.md`), its
10
- pull request template (`.github/pull_request_template.md` or `.github/PULL_REQUEST_TEMPLATE/`)
11
- and the workflow under `.github/workflows/` that reads the body, for lines they require per
12
- changed path. When they require none, stop here.
13
- 2. List the paths the pull request changes at `<head>`, the approved head your task names:
3
+ Read this at step 4 of `skill://legion-retro`.
4
+ A failure here stops retro as its "When retro stops" says.
5
+ A repository can require body lines derived from the changed paths, read by a required check;
6
+ the body written earlier may not cover every path the pull request now changes, and the merger reports a stale body rather than rewriting it.
7
+ `<owner>/<repo>` and `<n>` are the pull request's repository and number.
8
+
9
+ 1. Read your deployment instructions, the repository's agent guide (`AGENTS.md`, `CLAUDE.md`), its pull request template where it has one (`.github/pull_request_template.md` or `.github/PULL_REQUEST_TEMPLATE/`) and the workflow under `.github/workflows/` that reads the body, for lines they require per changed path.
10
+ When they require none, skip step 2, and stop here unless the task has no reviewer step (step 4 of `skill://legion-retro`).
11
+
12
+ 2. List the paths the pull request changes at `<head>`, the head the task's last step passed (step 1 of `skill://legion-retro`):
14
13
 
15
14
  ```bash
16
15
  base=$(gh pr view <n> -R <owner>/<repo> --json baseRefName -q '.baseRefName | @json') && cd -- "$LEGION_WORKSPACE" && jj -R "$LEGION_WORKSPACE" git fetch && jj -R "$LEGION_WORKSPACE" diff --from "fork_point(${base}@origin | <head>)" --to <head> --name-only
17
16
  ```
18
17
 
19
- `@json` quotes `base` as a jj string; never quote a branch name by hand. Write the line each
20
- matching path pattern requires. A line that says work was done names work this pull request
21
- did: a line whose work is undone is a finding for the architect.
22
- 3. Make a directory outside the workspace with `dir=$(mktemp -d)` (jj would commit a file inside
23
- it), save the live body as `$dir/before.md` and `$dir/body.md`, and stop unless the read
24
- succeeded and is not empty:
18
+ `@json` quotes `base` as a jj string; never quote a branch name by hand.
19
+ Write the line each matching path pattern requires.
20
+ A line that says work was done names work this pull request did: a line whose work is undone is a finding for the architect.
21
+
22
+ 3. Make a directory outside the workspace with `dir=$(mktemp -d)` (jj would commit a file inside it), save the live body as `$dir/before.md` and `$dir/body.md`, and stop unless the read succeeded and is not empty:
25
23
 
26
24
  ```bash
27
25
  cd -- "$LEGION_WORKSPACE" && ( set -o pipefail && gh api repos/<owner>/<repo>/pulls/<n> --jq .body | tee "$dir/before.md" "$dir/body.md" ) && test -s "$dir/before.md"
28
26
  ```
29
27
 
30
- The parentheses keep `pipefail` to this line. In `$dir/body.md`, change only the path-derived
31
- lines, adding a missing one where the sources place it; leave every other line byte for byte,
32
- the `Checks` block included.
33
- 4. Write it back. A body edit changes no commit, so the approval stands:
28
+ The parentheses keep `pipefail` to this line.
29
+ In `$dir/body.md`, change only the path-derived lines, adding a missing one where the sources place it, and with no reviewer step the `Not proven / risk` and `Threads` lines (step 4 of `skill://legion-retro`);
30
+ leave every other line byte for byte, the `Checks` block included, except a no-result line, which you replace as `skill://legion-worker/references/ci-checks.md` says.
31
+
32
+ 4. Write it back.
33
+ A body edit changes no commit, so no result or approval at the head moves:
34
34
 
35
35
  ```bash
36
36
  cd -- "$LEGION_WORKSPACE" && gh api --method PATCH repos/<owner>/<repo>/pulls/<n> -F body=@"$dir/body.md"
37
37
  ```
38
38
 
39
- When the write is refused, or the check it feeds fails, report it to the architect with the
40
- command and its output.
39
+ When the write is refused, or the check it feeds fails, report it to the architect with the command and its output.