@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,109 +1,113 @@
1
1
  # Acceptance, the merge and the close
2
2
 
3
- Read the section for your step of `skill://legion-architect`, sections 4 to 7. Where it says to
4
- ask a person, a child's own architect sends the question to the architect above it.
3
+ Read the section for your step of `skill://legion-architect`, sections 4 to 7.
4
+ Where it says to ask a person, a child's own architect sends the question to the architect above it.
5
5
 
6
6
  ## Retro's result
7
7
 
8
- Retro posts one `dispatch comment` of learnings and one `dispatch message`, brings the pull
9
- request body up to date, and commits nothing. When it reports that it cannot compute, read or
10
- write that body, it is still in its phase: answer it on its role topic from the deployment
11
- instructions, or open a `dispatch ask` naming the missing instruction.
8
+ Retro's output is in `skill://legion-retro`, steps 3 to 5.
9
+ When it reports that it cannot compute, read or write the pull request body, it is still in its phase:
10
+ answer it on its role topic from the deployment instructions, or open a `dispatch ask` naming the missing instruction.
12
11
 
13
12
  ## Accepting
14
13
 
14
+ Only a task whose `Steps:` line names `acceptance:owner` enters `accepting`.
15
15
  Read, against the goal, every check and every requirement:
16
16
 
17
- 1. the tester's handoff: `dispatch handoff-read --issue <issue> --phase test`;
18
- 2. `dispatch results --issue <issue>`: whether a pass stands for each check at the approved head;
19
- 3. the reviewer's approval of the head its Legion footer names, never its `commit_id`
20
- (`skill://legion-worker/references/merge-gate.md`);
21
- 4. each claim of the reviewer's prose, against the code at that head;
22
- 5. `gh pr view <n> --json mergeable,mergeStateStatus`: a `CONFLICTING` head whose checks passed
23
- is accepted as any other, and the merger merges the base forward (*A conflicting head*, below).
24
-
25
- - `sign_off` works only in `accepting`, where the Dispatch status reads `needs_review`; your
26
- `handoff_complete` there is refused (`ACCEPTANCE_IS_SIGN_OFF`).
27
- - A `catch-up` whose `reason` names an issue waiting for your acceptance is its wake: the
28
- `phase-finished` may never have reached you.
29
- - `SIGNOFF_CHILD_IN_WORKFLOW` names each issue beneath still in the workflow: run each to done,
30
- and sign off again.
31
- - A finding ask holds the acceptance: one a worker sent you, or one `dispatch read` lists under
32
- `Open asks:` whose question opens `Finding from ` or `Clear defect from `. Follow it
33
- (`dispatch follow --ask <id> --action follow`) and publish its reference to the controller topic.
34
- Accept only once it is resolved, or carries the controller's reply
35
- (`Filed dispatch://`, `Handed dispatch://` or `Not filed:`): a closed issue hides its open
36
- questions from the controller.
17
+ 1. where the task has a tester step, the tester's handoff: `dispatch handoff-read --issue <issue> --phase test`;
18
+
19
+ 2. `dispatch results --issue <issue>`: whether a pass stands for each check at the last step's head;
20
+
21
+ 3. where the task has a reviewer step, the reviewer's approval of the head its Legion footer names, never its `commit_id` (`skill://legion-worker/references/merge-gate.md`);
22
+
23
+ 4. where the task has a reviewer step, each claim of the reviewer's prose, against the code at that head;
24
+
25
+ 5. `gh pr view <n> --json mergeable,mergeStateStatus`: a `CONFLICTING` head whose checks passed is accepted as any other, and the merger merges the base forward (*A conflicting head*, below).
26
+
27
+ - `sign_off` works only in `accepting`, where the Dispatch status reads `needs_review`; your `handoff_complete` there is refused (`ACCEPTANCE_IS_SIGN_OFF`).
28
+
29
+ - A `catch-up` whose `reason` names an issue waiting for your acceptance is its wake: the `phase-finished` may never have reached you.
30
+
31
+ - `SIGNOFF_CHILD_IN_WORKFLOW` names each issue beneath still in the workflow: run each to done, and sign off again.
32
+
33
+ - A finding ask holds the acceptance: one a worker sent you, or one `dispatch read` lists under `Open asks:` whose question opens `Finding from ` or `Clear defect from `.
34
+ Follow it (`dispatch follow --ask <id> --action follow`) and publish its reference to the controller topic.
35
+ Accept only once it is resolved, or carries the controller's reply (`Filed dispatch://`, `Handed dispatch://` or `Not filed:`):
36
+ a closed issue hides its open questions from the controller.
37
+
37
38
  - No `after_merge` result is asked here; the production check records it after the close.
38
39
 
39
40
  ## The last round
40
41
 
41
- Sign off a parent only on an approved head that carries the merges of every child its checks
42
- need. Each check needs a pass at that head; one in another repository, a pass standing since the
43
- close of each child it needs, at a commit on the branch that issue's pull request merged into or
44
- on its default branch; a `default_branch` check, on the default branch. A criterion proven on a
45
- deployed system is proven after that child's deploy, as the repository's deploy skill says. A
46
- child's result proves no check of the parent: a child carrying part of a parent's requirement
47
- proves it with a check of its own whose `serves` names it. Nothing builds on the parent's merge,
48
- which comes last. Until those children close, leave the issue in `accepting`. Then, in one turn:
49
-
50
- 1. `envoy_publish` to the tester's role topic: "The next round of <KEY> is its last round: a full
51
- test round of every check of the issue with no `ci_check`."
52
- 2. `request_backward_move` to `implementing`, with the reason "Last round: merge the default
53
- branch your addressing line names into the branch, push, end your forward-merge comment with
54
- `parent's last round: full test round`, and complete." Never hard-code `main`.
55
-
56
- A child's merge while the parent waits needs no move of its own: the last round's forward merge
57
- takes them all, and the daemon answers a conflict on its head (*A conflicting head*, below). If
58
- the pull request merged before its last round, move nothing back: once the children close, have
59
- a fresh `task` subagent run each check with no `ci_check` on the default branch and record each
60
- result, read each `ci_check` result in `dispatch results`, post them in the acceptance comment,
61
- then `sign_off`.
42
+ A parent has a last round only where its task names `acceptance:owner`.
43
+ Sign it off only on a head that carries the merges of every child its checks need.
44
+ Each check needs a pass at that head; one in another repository needs a pass standing since the close of each child it needs, at a commit on the branch that issue's pull request merged into or on its default branch;
45
+ a `default_branch` check needs the default branch.
46
+ A criterion proven on a deployed system is proven after that child's deploy, as the repository's deploy skill says.
47
+ A child's result proves no check of the parent: a child carrying part of a parent's requirement proves it with a check of its own whose `serves` names it.
48
+ Nothing builds on the parent's merge, which comes last.
49
+ Until those children close, leave the issue in `accepting`.
50
+ Then, in one turn:
51
+
52
+ 1. Where the task has a tester step, `envoy_publish` to its tester's role topic:
53
+ "The next round of <KEY> is its last round: a full test round of every check of the issue with no `ci_check`."
54
+ With no tester step, the implementer's evidence for those checks at the merge head is the full round.
55
+
56
+ 2. `request_backward_move` to `implementing`, with the reason "Last round:
57
+ merge the default branch your addressing line names into the branch, push, end your forward-merge comment with `parent's last round: full test round`, and complete."
58
+ Never hard-code `main`.
59
+
60
+ A child's merge while the parent waits needs no move of its own:
61
+ the last round's forward merge takes them all, and the daemon answers a conflict on its head (*A conflicting head*, below).
62
+ If the pull request merged before its last round, move nothing back. Once the children close:
63
+
64
+ 1. Have a fresh `task` subagent run each check with no `ci_check` on the default branch and record each result, and `wait` for its report.
65
+ 2. Read each `ci_check` result in `dispatch results`.
66
+ 3. Post the results in the acceptance comment, then `sign_off`.
62
67
 
63
68
  ## After your sign-off
64
69
 
65
- Retro runs, then the merger merges the approved head under the repository's own rules; you start
66
- none of it. A person's request after your sign-off is a requirement of this issue: the role that
67
- holds the phase makes the `request_backward_move`. When the merger reports:
70
+ Retro runs, then the merger merges the last step's head under the repository's own rules; you start none of it.
71
+ A person's request after your sign-off is a requirement of this issue: the role that holds the phase makes the `request_backward_move`.
72
+ When the merger reports:
68
73
 
69
- - the issue moved back with `request_backward_move`: its reason says why the fix is a change to
70
- the change's own logic that no merge of the base resolves; you start nothing;
71
- - a merge GitHub refuses for a repository setting or an App permission: open a `dispatch ask`
72
- naming the pull request, the head and GitHub's refusal, and never bypass a rule;
73
- - a squash into a base other than the default branch: tell the implementer of each open pull
74
- request of the tree built on that branch whose issue is yours and still in `implementing` to
75
- merge that base forward in its implementing round. Past `implementing`, the daemon asks for that
76
- merge itself, and past the review the merger makes it (*A conflicting head*, below).
74
+ - the issue moved back with `request_backward_move`: its reason says why the fix is a change to the change's own logic that no merge of the base resolves; you start nothing;
75
+
76
+ - a merge GitHub refuses for a repository setting or an App permission:
77
+ open a `dispatch ask` naming the pull request, the head and GitHub's refusal, and never bypass a rule;
78
+
79
+ - a required approving review that no reviewer step gave: open a `dispatch ask` naming the base rule.
80
+ Do not wait for a reviewer phase the task does not have;
81
+
82
+ - a squash into a base other than the default branch:
83
+ tell the implementer of each open pull request of the tree built on that branch whose issue is yours and still in `implementing` to merge that base forward in its implementing round.
84
+ Past `implementing`, the daemon asks for that merge itself, and past the review the merger makes it (*A conflicting head*, below).
77
85
 
78
86
  ## A conflicting head
79
87
 
80
- A head that conflicts with its base keeps the issue in its phase. Before the review the daemon asks
81
- the implementer to merge the base forward only when the next step needs a mergeable head (*The
82
- daemon's ask* in `skill://legion-worker/references/conflicts-and-rewrites.md`). A conflict it does
83
- not act on yet is recorded: the tester and the reviewer go on at that head, and an approval of it
84
- ends the review round. Past the review the merge is the merger's: in `accepting` and `retro` the
85
- conflict waits, so accept the head as any other, and once the issue enters `merging` the daemon
86
- asks the merger to merge the base forward; a check the base's newer code breaks is the merger's to
87
- fix in that merge too. When it asks, the daemon tells you once by `checks-red`, naming the phase the
88
- issue stays in, the role asked, the head, the base and why; in `implementing` no notice comes. You
89
- start nothing for the merge.
90
-
91
- Past review, the daemon also asks the reviewer to read the merge and approve the new head by its
92
- SHA, or request changes; the merger merges the new head only once that approval is on the pull
93
- request.
88
+ A head that conflicts with its base keeps the issue in its phase.
89
+ Before the review the daemon asks the implementer to merge the base forward only when the next step needs a mergeable head (*The daemon's ask* in `skill://legion-worker/references/conflicts-and-rewrites.md`).
90
+ A conflict it does not act on yet is recorded: the task's steps go on at that head, and a reviewer step's approval of it ends its review round.
91
+ Past the review the merge is the merger's: in `accepting` and `retro` the conflict waits, so accept the head as any other, and once the issue enters `merging` the daemon asks the merger to merge the base forward;
92
+ a check the base's newer code breaks is the merger's to fix in that merge too.
93
+ When it asks, the daemon tells you once by `checks-red`, naming the phase the issue stays in, the role asked, the head, the base and why; in `implementing` no notice comes.
94
+ You start nothing for the merge.
95
+
96
+ Past review, where the task has a reviewer step, the daemon also asks the reviewer to read the merge and approve the new head by its SHA, or request changes; the merger merges the new head only once that approval is on the pull request.
97
+ A task with no reviewer step has no review to await.
94
98
 
95
99
  ## A review thread GitHub will not resolve
96
100
 
97
- Only the pull request author's App resolves a thread, so the implementer resolves them all. When
98
- GitHub refuses its `resolveReviewThread`, open a `dispatch ask` with the thread's URL and GitHub's
99
- message, for a person to resolve it, with the options resolved and could not.
101
+ Only the pull request author's App resolves a thread, so the implementer resolves them all.
102
+ When GitHub refuses its `resolveReviewThread`, open a `dispatch ask` with the thread's URL and GitHub's message, for a person to resolve it, with the options resolved and could not.
100
103
 
101
104
  ## The close
102
105
 
103
- The merge closes the issue (`done`). The production check after the close is not yours. A root's
104
- close lingers the tree for `linger_hours`.
106
+ The merge closes the issue (`done`).
107
+ The production check after the close is not yours.
108
+ A root's close lingers the tree for `linger_hours`.
105
109
 
106
110
  ## Hand-over at a root's linger
107
111
 
108
- Ask the person whether a child's work must end with the root. Your role prompt
109
- says what a `handed_over` catch-up asks of you.
112
+ Ask the person whether a child's work must end with the root.
113
+ Your role prompt says what a `handed_over` catch-up asks of you.
@@ -1,46 +1,46 @@
1
1
  # Decomposing a tree
2
2
 
3
- Read this before you read a child's handoff, create or adopt children, review a child's spec,
4
- split work across repositories, record a wait on outside work, or attach architecture components.
3
+ Read this before you read a child's handoff, create or adopt children, review a child's spec, split work across repositories, record a wait on outside work, or attach architecture components.
5
4
 
6
5
  ## Reading the tree
7
6
 
8
7
  Read your own issue (`read_record`), its criteria, its children and their handoffs:
9
- `dispatch handoff-read --issue <child> --phase <plan|implement|test|review>`, with `--version <n>`
10
- for an earlier one.
8
+ `dispatch handoff-read --issue <child> --phase <plan|implement|test|review>`, with `--version <n>` for an earlier one.
11
9
 
12
10
  ## Adopting children
13
11
 
14
- Release a child a person created at once and as it is:
15
- `legion({ op: "release_children", issues: ["LEGION-41", "LEGION-42"] })`. The answer names
16
- `released`, `started` and `held`, each held child with what it waits on. A release refused with
17
- one of the codes below writes nothing: release the rest again without the child it names.
12
+ Release a child a person created at once and as it is: `legion({ op: "release_children", issues: ["LEGION-41", "LEGION-42"] })`.
13
+ The answer names `released`, `started` and `held`, each held child with what it waits on.
14
+ A release refused with one of the codes below writes nothing: release the rest again without the child it names.
15
+
16
+ - `CHILD_NOT_ADOPTABLE`: it runs or ran as a tree of its own.
17
+ Leave it, or ask the controller.
18
+
19
+ - `CHILD_IN_OTHER_TREE`: re-parent it back in Dispatch, or ask that tree's architect or the controller.
18
20
 
19
- - `CHILD_NOT_ADOPTABLE`: it runs or ran as a tree of its own. Leave it, or ask the controller.
20
- - `CHILD_IN_OTHER_TREE`: re-parent it back in Dispatch, or ask that tree's architect or the
21
- controller.
22
21
  - `ISSUE_NOT_OWNED`: the issue is another architect's; send the move to the architect above you.
23
- - `CHILD_UNDER_ACCEPTED_PARENT`: an ancestor is already accepted. Release again once it has closed,
24
- where it is not the tree's root.
22
+
23
+ - `CHILD_UNDER_ACCEPTED_PARENT`: an ancestor is already accepted.
24
+ Release again once it has closed, where it is not the tree's root.
25
25
 
26
26
  ## Creating children
27
27
 
28
- 1. Write each child's spec as `skill://dispatch-writing-specs` says, scaled to the child, each
29
- requirement a `requirement` block, with its `verification.md`: its workers read only these.
28
+ 1. Write each child's spec as `skill://dispatch-writing-specs` says, scaled to the child, each requirement a `requirement` block, with its `verification.md`: its workers read only these.
30
29
  Cite no item number of another document and copy no text that does not apply to the child.
31
- 2. Red-team the list with a fresh `task(agent="oracle")`, and `wait` for its verdict. Give it your
32
- issue's spec, the tree's open children with their repositories and pull requests, and each
33
- proposed child's title and whole spec, with this mandate: "You did not write this list. Argue
34
- that each child should not exist. Name every child that is a to-do, a fix found in review, a
35
- proof of the acceptance of the issue it is filed under, or a part of the architect's own work,
36
- and say where it folds. Weigh each separate pull request against combining its work: each round
37
- tests a large pull request whole again, and each small one costs a workspace, an admission
38
- wait, review, CI, a queue wait and a deploy." A repeated change is one child, and deleting what
39
- this tree replaced is this tree's work.
40
- 3. Post the verdict and your folds as one `dispatch comment` on your own issue whose first line is
41
- exactly `Red-team verdict for <your issue key>:`. The controller's weekly audit reads that line.
42
- 4. Check each survivor's spec with a fresh `task(agent="plan-gap-analyst")` against
43
- `skill://dispatch-writing-specs`, `wait` for it, and fix what it flags.
30
+
31
+ 2. Red-team the list with a fresh `task(agent="oracle")`, and `wait` for its verdict.
32
+ Give it your issue's spec, the tree's open children with their repositories and pull requests, and each proposed child's title and whole spec, with this mandate: "You did not write this list.
33
+ Argue that each child should not exist.
34
+ Name every child that is a to-do, a fix found in review, a proof of the acceptance of the issue it is filed under, or a part of the architect's own work, and say where it folds.
35
+ Weigh each separate pull request against combining its work:
36
+ each round tests a large pull request whole again, and each small one costs a workspace, an admission wait, review, CI, a queue wait and a deploy."
37
+ A repeated change is one child, and deleting what this tree replaced is this tree's work.
38
+
39
+ 3. Post the verdict and your folds as one `dispatch comment` on your own issue whose first line is exactly `Red-team verdict for <your issue key>:`.
40
+ The controller's weekly audit reads that line.
41
+
42
+ 4. Check each survivor's spec with a fresh `task(agent="plan-gap-analyst")` against `skill://dispatch-writing-specs`, `wait` for it, and fix what it flags.
43
+
44
44
  5. File only the survivors, and reply under the verdict with their keys:
45
45
 
46
46
  ```bash
@@ -51,78 +51,74 @@ one of the codes below writes nothing: release the rest again without the child
51
51
 
52
52
  6. Review the version you filed ("Reviewing a child's spec") before `release_children`.
53
53
 
54
- - `--project` is the key's prefix (`LEGSMOKE-3` → `LEGSMOKE`). `--parent` is `$LEGION_ISSUE`,
55
- never a child of yours: that child's own architect files its children.
56
- - Pass no `--assignee` unless a person names one: the default keeps the tree's questions in one
57
- Inbox.
58
- - A child's own architect starts beside its child's planner: decide first whether the child needs
59
- children. If it does, file and release them, then tell the planner its plan covers only the
60
- child's own part and the join of their work.
61
- - Where the project has architecture components, give each child a `check` for the update of
62
- `.dispatch/architecture/<id>.md` of each component its pull request changes.
63
- - A role token is `legion-<project>-<key>-<role>` with the daemon's project and the key
64
- lower-cased: `legion-acme-legion-41-architect`.
54
+ - `--project` is the key's prefix (`LEGSMOKE-3` → `LEGSMOKE`).
55
+ `--parent` is `$LEGION_ISSUE`, never a child of yours: that child's own architect files its children.
56
+
57
+ - Pass no `--assignee` unless a person names one: the default keeps the tree's questions in one Inbox.
58
+
59
+ - As a child's own architect, in the turn you file its children, send one `envoy_publish` to the agent that holds its plan: its planner where its task names one, else its implementer, at `notifications.role.<token>` (the token is below).
60
+ The message names each child you filed, with its key and repository, and says that the plan now covers only this issue's own part and the join with those children's work.
61
+ Send it even when you also stop the task or give a later plan: that agent keeps its session and what it read of the whole issue.
62
+
63
+ - Every child names the running system its criteria are proven on (the command, service or page its implementer proves them on and a tester step drives) and the repository skill that drives it;
64
+ building a missing path is this tree's work.
65
+
66
+ - Where the project has architecture components, give each child a `check` for the update of `.dispatch/architecture/<id>.md` of each component its pull request changes.
67
+
68
+ - A role token is `legion-<project>-<key>-<role>` with the daemon's project and the key lower-cased: `legion-acme-legion-41-architect`.
65
69
 
66
70
  ## Reviewing a child's spec
67
71
 
68
- No person reads a child's spec: review every version of it and of its Verification document,
69
- whoever wrote it, before the child's work goes on with that version.
72
+ No person reads a child's spec: review every version of it and of its Verification document, whoever wrote it, before the child's work goes on with that version.
73
+
74
+ 1. Have a fresh `task(agent="plan-reviewer")`, told the documents are a child's spec and its Verification document, read them against your own spec (a root's at its approved version, a child's at the version its parent approved) with this mandate:
75
+ "Does this version serve each requirement of the parent spec that it names?
76
+ Does it narrow or contradict any?
77
+ Does it add scope the parent spec does not ask for?
78
+ Check each fact it states against the code, the docs or a read-only command."
79
+ `wait` for its result.
70
80
 
71
- 1. Have a fresh `task(agent="plan-reviewer")`, told the documents are a child's spec and its
72
- Verification document, read them against your own spec (a root's at its approved version, a
73
- child's at the version its parent approved) with this mandate: "Does this version serve each
74
- requirement of the parent spec that it names? Does it narrow or contradict any? Does it add
75
- scope the parent spec does not ask for? Check each fact it states against the code, the docs or
76
- a read-only command." `wait` for its result.
77
81
  2. Approve or request changes, with a reason either way.
78
- 3. Post one `dispatch comment` on the child whose first line is exactly one of these, and whose
79
- second line is `Verification document v<m>`; then tell the child's architect with
80
- `envoy_publish`:
82
+
83
+ 3. Post one `dispatch comment` on the child whose first line is exactly one of these, and whose second line is `Verification document v<m>`;
84
+ then tell the child's architect with `envoy_publish`:
81
85
 
82
86
  ```text
83
87
  Spec review of <child key> v<n> by <parent key>: approved
84
88
  Spec review of <child key> v<n> by <parent key>: changes requested
85
89
  ```
86
90
 
87
- As the child's architect: tell the architect above you of each new version, naming each document
88
- and its version; tell your workers of it only after its approving comment; answer
89
- `changes requested` with a new version. A decision only a person can make goes to the architect
90
- above you, never into your spec.
91
+ As the child's architect: tell the architect above you of each new version, naming each document and its version;
92
+ tell your workers of it only after its approving comment; answer `changes requested` with a new version.
93
+ A decision only a person can make goes to the architect above you, never into your spec.
91
94
 
92
95
  ## Across repositories
93
96
 
94
- Split a change across repositories into children of one repository each, choosing it at creation
95
- (`dispatch issue … --repo <owner/name>`). Release a child that builds on another repository's
96
- change only after that pull request merges, never by `--blocked-by`, which starts it at the
97
- blocker's close, and name the merged commit in its task
98
- (`gh api repos/<owner>/<repo>/pulls/<n> --jq .merge_commit_sha`); for a repository that pins the
99
- other one by commit (a lock file or dependency pin), the pin is that merged commit. Your `gh` reads
100
- every repository your App is installed on (`-R owner/repo`).
97
+ Split a change across repositories into children of one repository each, choosing it at creation (`dispatch issue … --repo <owner/name>`).
98
+ Release a child that builds on another repository's change only after that pull request merges, never by `--blocked-by`, which starts it at the blocker's close, and name the merged commit in its task (`gh api repos/<owner>/<repo>/pulls/<n> --jq .merge_commit_sha`);
99
+ for a repository that pins the other one by commit (a lock file or dependency pin), the pin is that merged commit.
100
+ Your `gh` reads every repository your App is installed on (`-R owner/repo`).
101
101
 
102
102
  ## Recording a wait on other work
103
103
 
104
- Set an issue's `blocked_by` list when it must wait on an issue outside this tree
105
- (`dispatch issue-update --issue <key> --blocked-by <a> --blocked-by <b>`, which replaces the whole
106
- list; a credential scoped to one project cannot link another project's issue: `PROJECT_SCOPE`). A
107
- blocker's close is its Dispatch issue reaching `done`, not a merge or a deploy: pick a blocker
108
- whose close is the fact the issue needs. Legion starts the issue once its blockers close.
104
+ When an issue must wait on a sibling or on an issue outside this tree, set its `blocked_by` list as `skill://dispatch`, "Choosing what to work on", says.
105
+ A blocker's close is its Dispatch issue reaching `done`, not a merge or a deploy: pick a blocker whose close is the fact the issue needs.
106
+ Legion starts the issue once its blockers close.
109
107
 
110
108
  ## A root with no code of its own
111
109
 
112
- When every change lands through children, the root's implementer opens its pull request on an empty
113
- commit. Plan no code for the root, and create no child only to give it a commit.
110
+ When every change lands through children, the root's implementer opens its pull request on an empty commit.
111
+ Plan no code for the root, and create no child only to give it a commit.
114
112
 
115
113
  ## Architecture components
116
114
 
117
- A project's components are the `.dispatch/architecture/` files Dispatch imports from its source
118
- repositories (`skill://dispatch`).
115
+ A project's components are the `.dispatch/architecture/` files Dispatch imports from its source repositories (`skill://dispatch`).
119
116
 
120
117
  - They exist: attach the root before you decompose, so every child inherits them:
121
118
  `dispatch issue-update --issue <root> --components-json '{"mode":"explicit","ids":[…]}'`.
122
- - They do not: the root's first pull request writes `.dispatch/architecture/<id>.md` for each
123
- planned component (front matter `title`, `parent`, `depends_on`, `external`; no `paths`) in the
124
- repository that holds it, with an id no other source uses. Leave the root on `inherit` until it
125
- merges (an earlier attach answers `400 COMPONENTS_INPUT`), then run
126
- `dispatch architecture-sync --project <KEY>` and attach.
127
- - Give a child its own `--components-json` only for a narrower set, and
128
- `{"mode":"none","reason":"…"}` when it changes no code a component describes.
119
+
120
+ - They do not: the root's first pull request writes `.dispatch/architecture/<id>.md` for each planned component (front matter `title`, `parent`, `depends_on`, `external`;
121
+ no `paths`) in the repository that holds it, with an id no other source uses.
122
+ Leave the root on `inherit` until it merges (an earlier attach answers `400 COMPONENTS_INPUT`), then run `dispatch architecture-sync --project <KEY>` and attach.
123
+
124
+ - Give a child its own `--components-json` only for a narrower set, and `{"mode":"none","reason":"…"}` when it changes no code a component describes.
@@ -113,7 +113,7 @@ For each gated step, once every child is filed:
113
113
  ## After approval
114
114
 
115
115
  An approval is pinned to its version: any new version closes that step, with no wake. Three keep it:
116
- a version whose only change is the approver's own answer to a decision block, given after the
116
+ a version whose only change is the approver's answer to a decision block, given after the
117
117
  approval at a browser or under a credential with the approve scope; one equal to the approved text
118
118
  (an accidental edit undone exactly) with no decision block in it decided since; and, after a close
119
119
  and a reopen, the approved text with only the questions the close withdrew open again.
@@ -0,0 +1,30 @@
1
+ # Stopped tasks, later plans and their notices
2
+
3
+ Part of `skill://legion-architect`, section 1.
4
+ Read it before you stop a task or give a later version of a plan Legion runs, and on a `task-stopped`, `retro-held` or `plan-not-taken` notice.
5
+ A plan's text, its steps and when to give it first: `skill://legion-architect/references/plan.md`.
6
+
7
+ ## Stopping and changing a task
8
+
9
+ Your role prompt says what `stop_task` does, what holds a stopped task and what starts it again, and what each refusal of `stop_task` or of a plan's version means.
10
+
11
+ - After `VERSION_NOT_IN_DISPATCH`, upload that version to Dispatch first.
12
+
13
+ ## The notices
14
+
15
+ - **`task-stopped`:** Legion stopped the task and holds the issue.
16
+ Either a step failed and no earlier step of the type implementation can take the work back, and the reason names the task and the step: read the failed step's report.
17
+ Or another architect of your tree stopped it with `stop_task`, and the reason names that architect and the notice carries `stoppedBy`: no step failed.
18
+ A stop you make yourself sends you no notice: the 200 answer of `stop_task` is the record.
19
+ Then give a later version that changes the task, or end the work: for a child under your own issue, your own status write in Dispatch, by the rules for ending a child in your role prompt; `dispatch ask` on the root for a root.
20
+ When the stopped task is your own issue's, as a child's architect, send the end of that work to the architect above you with `envoy_publish`: the daemon sets back your status write on your own issue.
21
+
22
+ - **`retro-held`:** a parent's task passed its last step with no `acceptance:owner` step to wait in, while issues beneath it are still in the workflow.
23
+ Legion holds it before its retro, so that it merges after them, and starts the retro when the last one leaves.
24
+ Run each issue it names to done, or end it by your own status write in Dispatch, by the same rules.
25
+ `retry_or_escalate` refuses that hold, a retry and an escalation alike: while issues beneath it are in the workflow, `409 HELD_FOR_CHILDREN` names each of them; with none left, the answer says that its tree lingers or that its root waits in the admission line.
26
+ A `todo` on the root leaves it held.
27
+
28
+ - **`plan-not-taken`:** an earlier owner of the issue gave it a plan, and Legion did not take it at the issue's first step.
29
+ Its reason names the version, who gave it, and the plan the first step runs: yours, or the default steps.
30
+ To run the earlier plan, `stop_task` the task that runs now, then give the earlier plan again with `register_plan` as your own.
@@ -0,0 +1,66 @@
1
+ # An issue's plan
2
+
3
+ Part of `skill://legion-architect`, sections 1 and 2.
4
+ Read it before you write or give an issue's plan.
5
+ Stopping a task, a later version of a plan Legion runs, and the `task-stopped`, `retro-held` and `plan-not-taken` notices:
6
+ `skill://legion-architect/references/plan-changes.md`.
7
+
8
+ ## The task block
9
+
10
+ You choose which of Legion's steps each issue of your tree runs.
11
+ The plan is the issue's `plan.md` document (`dispatch artifact` on the issue).
12
+ In this release it holds one `plan_task` block, the issue's one task:
13
+
14
+ ```markdown
15
+ :::plan_task{#a steps="implementer reviewer"}
16
+ What the task must deliver. What the steps after the first need to know, since no planner step
17
+ writes it for them. For each step, a fresh agent or the agent of an earlier step, and why.
18
+ :::
19
+ ```
20
+
21
+ - Give the block `serves` naming the spec's `requirement` blocks, as a planner's task does, so the issue's coverage counts it.
22
+ A change of `serves` alone changes no task.
23
+
24
+ - This release gives each role one agent for each issue, the session that role keeps until the issue leaves the workflow.
25
+ It cannot carry out your choice of a fresh or an earlier agent yet; write the choice all the same, because retro rates the plan's steps and the agent that worked each against it.
26
+
27
+ ## The roles and their order
28
+
29
+ | Step | Type | Phase | What leaving it out means |
30
+ | --- | --- | --- | --- |
31
+ | `planner` | planning | `planning` | No implementation plan and no plan review: the steps work from your task's text and the spec. |
32
+ | `implementer` | implementation | `implementing` | Required. It also works the retro, and a failed step returns to it unless the failed step names an earlier one. |
33
+ | `tester` | testing | `testing` | Only the implementer records results against the checks, and nobody runs them again. |
34
+ | `reviewer` | review | `reviewing` | No review: on a base whose rules require an approving review, the merger waits and tells you. |
35
+ | `acceptance:owner` | review | `accepting` | Your step. Without it the last step's pass starts the retro, and nothing waits for you to read the evidence. |
36
+
37
+ Without `acceptance:owner`, two steps still hold the checks:
38
+ a reviewer step approves only once a pass stands for every `before_merge` check at the head, and retro's first step sends back a check with no pass standing there, except a `ci_check` whose run has not concluded or cannot be read, which moves nothing back (`skill://legion-retro`).
39
+ So on a task with no reviewer step and no `acceptance:owner`, such a check holds the merge only where it is among the checks the base branch requires.
40
+
41
+ ## What Legion refuses
42
+
43
+ `register_plan` answers `409 PLAN_REFUSED` with `reasons: [{task, reason}]`, one reason for each cause, its `task` empty for a cause of the whole plan.
44
+ Fix each reason and give a new version.
45
+ A reason that ends `This release of Legion does not carry it out yet.` names a plan a later release takes: write it again within the table above.
46
+
47
+ The reasons a version gets for where its task stands are in `skill://legion-architect/references/plan-changes.md`.
48
+
49
+ ## When to give it
50
+
51
+ - **A root:** before `register_gate`, because the gate's opening starts the root's first step.
52
+
53
+ - **A child:** before `release_children` releases it.
54
+ The daemon has not recorded the child yet, so Legion keeps the plan until the release;
55
+ the answer, as for any plan it takes, is the plan's `version` and each task with its `steps`.
56
+ A child the daemon has not recorded is refused once its Dispatch status is none of `triage`, `backlog`, `icebox` and `todo` (`ISSUE_ALREADY_RELEASED`).
57
+ The child's first step can start in the same admission pass as its release, so a plan given after it comes too late.
58
+
59
+ A `plan.md` that a planner of the default steps wrote holds that planner's task blocks.
60
+ The version you give replaces them with your own one block: delete theirs, and put what the next steps still need from the planner's plan into your task's text.
61
+
62
+ ## Reading how plans went
63
+
64
+ `dispatch steps --issue <KEY>` lists each run of each step of an issue and how it ended.
65
+ Each finished issue of a project, with its plan's source and steps, its retro's ratings, its time and its count of failed steps, is `dispatch plans --project <KEY>`.
66
+ Read it before you choose the steps of an issue like one that finished.