@sjawhar/claude-envoy 5.12.5 → 5.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/.omp-plugin/plugin.json +1 -1
- package/dist/codex-hook.js +8 -8
- package/dist/dispatch.js +8 -8
- package/dist/envoy-channel.js +52 -18
- package/dist/session-hook.js +8 -8
- package/legion/skills/legion-architect/SKILL.md +76 -84
- package/legion/skills/legion-architect/references/acceptance.md +83 -79
- package/legion/skills/legion-architect/references/decomposition.md +73 -77
- package/legion/skills/legion-architect/references/design-gate.md +1 -1
- package/legion/skills/legion-architect/references/plan-changes.md +30 -0
- package/legion/skills/legion-architect/references/plan.md +66 -0
- package/legion/skills/legion-architect/references/wake-routing.md +28 -27
- package/legion/skills/legion-controller/references/admission.md +34 -10
- package/legion/skills/legion-controller/references/daily-report.md +57 -17
- package/legion/skills/legion-retro/SKILL.md +65 -60
- package/legion/skills/legion-retro/references/pr-body-content.md +22 -23
- package/legion/skills/legion-worker/SKILL.md +89 -21
- package/legion/skills/legion-worker/references/ci-checks.md +28 -7
- package/legion/skills/legion-worker/references/conflicts-and-rewrites.md +1 -1
- package/legion/skills/legion-worker/references/merge-gate.md +64 -25
- package/legion/skills/legion-worker/references/pr-body.md +22 -29
- package/legion/skills/legion-worker/references/results.md +50 -0
- package/legion/skills/legion-worker/references/review-threads.md +19 -4
- package/package.json +2 -2
|
@@ -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
|
-
`
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
24
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
proposed child's title and whole spec, with this mandate: "You did not write this list.
|
|
34
|
-
that each child should not exist.
|
|
35
|
-
proof of the acceptance of the issue it is filed under, or a part of the architect's own work,
|
|
36
|
-
|
|
37
|
-
tests a large pull request whole again, and each small one costs a workspace, an admission
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
3. Post the verdict and your folds as one `dispatch comment` on your own issue whose first line is
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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`).
|
|
55
|
-
never a child of yours: that child's own architect files its children.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
child's own part and the join
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
-
|
|
64
|
-
|
|
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
|
-
|
|
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
|
-
|
|
79
|
-
|
|
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
|
-
|
|
89
|
-
|
|
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
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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
|
-
|
|
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
|
-
|
|
123
|
-
|
|
124
|
-
repository that holds it, with an id no other source uses.
|
|
125
|
-
merges (an earlier attach answers `400 COMPONENTS_INPUT`), then run
|
|
126
|
-
|
|
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
|
|
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.
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
# Wake routing
|
|
2
2
|
|
|
3
|
-
Read this when a wake reaches you.
|
|
4
|
-
architect holds its role, else the nearest one above that does.
|
|
5
|
-
and a `worker-died` or `worker-stalled` about a child's own architect, reach the architect above the
|
|
6
|
-
|
|
7
|
-
section of `skill://legion-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` |
|
|
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).
|
|
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
|
|
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
|
|
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
|
-
|
|
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.
|
|
45
|
-
reviewer which checks the next round answers, dropping no requirement.
|
|
46
|
-
a clear fix in a touched file stays in this pull request.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
otherwise.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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.
|
|
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.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- `
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
- `
|
|
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.
|
|
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>`).
|
|
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.
|
|
23
|
-
|
|
24
|
-
|
|
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:
|
|
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
|
-
|
|
44
|
-
- **
|
|
45
|
-
|
|
46
|
-
|
|
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.
|