@sjawhar/pi-legion 8.4.0 → 8.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/legion.js
CHANGED
|
@@ -15193,7 +15193,7 @@ function onEnvoyRoleRegained(listener) {
|
|
|
15193
15193
|
// package.json
|
|
15194
15194
|
var package_default = {
|
|
15195
15195
|
name: "@sjawhar/pi-legion",
|
|
15196
|
-
version: "8.4.
|
|
15196
|
+
version: "8.4.2",
|
|
15197
15197
|
license: "Apache-2.0",
|
|
15198
15198
|
type: "module",
|
|
15199
15199
|
omp: {
|
|
@@ -16074,7 +16074,7 @@ function handoffSchemaFields(z2) {
|
|
|
16074
16074
|
ready: z2.boolean().optional()
|
|
16075
16075
|
};
|
|
16076
16076
|
}
|
|
16077
|
-
var HANDOFF_DESCRIPTION = "Handoff actions (phase workers; the daemon accepts a completion only from the role working " + "the issue's current phase, never from an architect): handoff_write writes this phase's handoff " + "(`phase`, and `data`: the phase-specific fields as a JSON object, never the schemaVersion, " + "phase, completed and issue the command writes itself) to `.legion/<issue>/<phase>.json` in " + "the issue workspace; handoff_read returns the handoffs (every phase, or `phase`); " + "handoff_complete reports this phase complete to the daemon (`summary`: two sentences for the " + "architect, or the merger's READY packet; `verdict` pass|fail when your role's instructions " + "require one; `ready: true` for the merger's READY; no `phase` is needed, and one other than " + "your own is refused). Each " + "returns the command's output; a failed action changed nothing. What a later phase needs goes " + "in your handoff; a question for another live role goes to its role topic with envoy_publish.";
|
|
16077
|
+
var HANDOFF_DESCRIPTION = "Handoff actions (phase workers; the daemon accepts a completion only from the role working " + "the issue's current phase, never from an architect): handoff_write writes this phase's handoff " + "(`phase`, and `data`: the phase-specific fields as a JSON object, never the schemaVersion, " + "phase, completed and issue the command writes itself) to `.legion/<issue>/<phase>.json` in " + "the issue workspace; handoff_read returns the handoffs (every phase, or `phase`), a handoff " + "retro's removal of `.legion/<issue>/` took off the head read from the commit before it; " + "handoff_complete reports this phase complete to the daemon (`summary`: two sentences for the " + "architect, or the merger's READY packet; `verdict` pass|fail when your role's instructions " + "require one; `ready: true` for the merger's READY; no `phase` is needed, and one other than " + "your own is refused). Each " + "returns the command's output; a failed action changed nothing. What a later phase needs goes " + "in your handoff; a question for another live role goes to its role topic with envoy_publish.";
|
|
16078
16078
|
function rootArchitectHandoffRefusal(operation) {
|
|
16079
16079
|
return `${operation} is not available to a root architect session; a root architect reads handoffs with \`legion handoff read [--phase <phase>]\` from bash`;
|
|
16080
16080
|
}
|
|
@@ -236,9 +236,10 @@ the implementer's role topic to start retro: the daemon's start is what records
|
|
|
236
236
|
the task.
|
|
237
237
|
|
|
238
238
|
Wait for the implementer to report its durable retro result. Retro output is
|
|
239
|
-
`docs/solutions/`,
|
|
240
|
-
|
|
241
|
-
|
|
239
|
+
`docs/solutions/`, its last commit removing the issue's `.legion/<issue>/` from the head a human
|
|
240
|
+
merges, the PR body content the repository's instructions derive from the pull request's changed
|
|
241
|
+
paths at that head, and one `dispatch_message` on the issue; it must write no handoff or
|
|
242
|
+
rewrite the reviewer-approved head. When the implementer reports that it cannot
|
|
242
243
|
compute that body content or do the work a line of it affirms, that its read of the body failed or
|
|
243
244
|
came back empty, or that GitHub refused the body, it has pushed nothing and is still in its phase.
|
|
244
245
|
Answer it with `envoy_publish` to its role topic, saying how from the deployment instructions;
|
|
@@ -256,20 +257,21 @@ The daemon keeps this order from its fixed table; you start none of its steps:
|
|
|
256
257
|
|
|
257
258
|
1. tester green and review cycles complete;
|
|
258
259
|
2. on a clean review, the reviewer approves the head by SHA, and the daemon moves the issue to
|
|
259
|
-
`retro`.
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
260
|
+
`retro`. The approved head still carries the issue's handoffs, `.legion/<issue>/`;
|
|
261
|
+
3. retro commits its learnings under `docs/solutions/` on top of the approved head, then, as the
|
|
262
|
+
one final commit, the removal of `.legion/<issue>/`, so no merge carries a handoff onto the
|
|
263
|
+
default branch (dispatch://LEGION-605); those commits do not void the approval and never return
|
|
264
|
+
the tree to the tester or reviewer;
|
|
265
|
+
4. the merger verifies the current head is the reviewer-approved head plus only retro's commits,
|
|
266
|
+
those that change `docs/solutions/` and that removal (`jj diff --from <approved-sha> --to
|
|
267
|
+
<tip-sha> --summary`, quoted in READY) and sends the READY packet with its completion, which
|
|
268
|
+
refuses a head that still carries `.legion/<issue>/`; the daemon posts
|
|
268
269
|
`READY #<n> at <current sha> (approved at <approved sha>) for <KEY> (<pr url>)` on the Dispatch
|
|
269
270
|
issue and publishes it to the project's merge queue role when one is set. Legion never merges; a human merges under the repository's
|
|
270
271
|
GitHub branch-protection and CODEOWNERS rules. If the merger reports a failed verification,
|
|
271
272
|
treat it like `pr-blocked`: the merger holds the phase, so tell it to move the issue back with
|
|
272
|
-
`request_backward_move`, naming what failed; never bypass.
|
|
273
|
+
`request_backward_move`, naming what failed; never bypass. A READY refused because the head
|
|
274
|
+
still carries `.legion/<issue>/` goes back to `retro`, so the implementer's retro removes it.
|
|
273
275
|
5. a human merges; the daemon then starts the **implementer** once more, on the production check.
|
|
274
276
|
It drives the changed path in production through the user's own access path and records
|
|
275
277
|
what it saw on the pull request and on this issue. Sign off only after the implementer's production
|
|
@@ -279,9 +281,10 @@ The daemon keeps this order from its fixed table; you start none of its steps:
|
|
|
279
281
|
outcome-named options. The issue waits for that answer.
|
|
280
282
|
|
|
281
283
|
What returns the tree to review: a changed diff — a commit above the approved head that
|
|
282
|
-
touches anything outside `docs/solutions
|
|
284
|
+
touches anything outside `docs/solutions/` and the issue's `.legion/<issue>/`, or a
|
|
285
|
+
conflict-resolution merge whose fingerprint
|
|
283
286
|
(the unchanged-diff check, `skill://legion-worker/references/conflicts-and-rewrites.md`) differs from the approved head's. What does not: retro's
|
|
284
|
-
`docs/solutions/` commit
|
|
287
|
+
`docs/solutions/` commit and its removal of `.legion/<issue>/`, and a merge forced by a GitHub-reported conflict whose fingerprint
|
|
285
288
|
is unchanged. For that merge, the worker holding the issue's phase moves it back to `implementing`
|
|
286
289
|
with `request_backward_move`, and the daemon runs the phases from there: the implementer merges
|
|
287
290
|
the bookmark forward with the
|
|
@@ -343,7 +346,7 @@ active phase worker.
|
|
|
343
346
|
| `design-approved` | Its `version` is the approved one. A human approved the root spec document at its current version; the gate is open. Proceed to section 2. |
|
|
344
347
|
| `design-changes-requested` | Its `version` and `reason`. A human asked for changes to the root spec at `version`, for `reason`. Revise the spec as the reason asks and request approval again as section 1 says; stay parked; the gate is closed. |
|
|
345
348
|
| `phase-finished` | The daemon has already moved the issue to its next phase by its fixed table and started that phase's role; you start nothing. Read the committed handoff for the finishing phase; if it shows unresolved gaps, tell the role now working the issue (`envoy_publish` to its role topic). A `planner` notice that names a departure from the spec's design defers to section 1's full condition: when the approved Summary, Acceptance, scope and settled decisions still hold, the plan is the record; otherwise change the root spec and request approval again as section 1 says. A `reviewer` notice whose GitHub review is `CHANGES_REQUESTED` needs nothing from you: the daemon has returned the issue to `implementing` (Dispatch `in_progress`) and started the **implementer**, whose correction goes through the tester and the reviewer again, never straight to retro. A `reviewer` notice with an `APPROVED` review means the daemon has started retro (step 5). An `implementer` notice for `production_check` is its production report: read the record on the pull request and the issue, then run step 7. A `tester` notice with `verdict: "fail"` — its handoff carries `implementerProof.verdict: "rejected"`, or a failure naming the production-like proof — has gone back to the **implementer** by the daemon's table; never supply the proof from another role. A worker that reports no surface reaches the changed path sends that report instead of completing its phase, so the daemon starts nothing more on that issue and the worker stays idle in its session, not suspended: file a child issue in this tree to build the surface (infrastructure, tooling, or a skill), and when that child's `child-closed` arrives, tell the waiting worker to continue with `envoy_publish` to its role topic. That report is never a reason to advance the phase. |
|
|
346
|
-
| `pr-blocked` | Its `reason` names the pull request and the `max_fix_attempts` it reached. The count is of heads pushed onto a red verdict that changed something outside `.legion/` — handoff-only pushes (`.legion/` paths only) never count, a push by the review App (a planner's, tester's, reviewer's or architect's) never counts, and the head after a red the tester's red tests earned (a review-App push that changed a path outside `.legion/`, however many handoff-only pushes follow it) does not count either — so after the tester's handoff-only push onto the implementer's red, the implementer's next push does count; a push the daemon cannot classify (a listener without `changed_paths`, a list the listener stopped at 100 paths or 32,768 runes of text, a push listing no commits) does. Published once per exhausted count, not on every later red verdict for that count. Read the failed CI evidence and recovery attempts. The notice moves nothing: the issue stays in its phase
|
|
349
|
+
| `pr-blocked` | Its `reason` names the pull request and the `max_fix_attempts` it reached, or reads `Issue reached review_round_cap=<N>.` (the end of this row). The count is of heads pushed onto a red verdict that changed something outside `.legion/` — handoff-only pushes (`.legion/` paths only) never count, a push by the review App (a planner's, tester's, reviewer's or architect's) never counts, and the head after a red the tester's red tests earned (a review-App push that changed a path outside `.legion/`, however many handoff-only pushes follow it) does not count either — so after the tester's handoff-only push onto the implementer's red, the implementer's next push does count; a push the daemon cannot classify (a listener without `changed_paths`, a list the listener stopped at 100 paths or 32,768 runes of text, a push listing no commits) does. Published once per exhausted count, not on every later red verdict for that count. Read the failed CI evidence and recovery attempts. The notice moves nothing: the issue stays in its phase. In `implementing`, give the implementer the failing checks (`envoy_publish` to its role topic). In any later phase a worker holds, tell that worker (`envoy_publish` to its role topic) to move the issue back to `implementing` with `request_backward_move`, naming the failing checks, and the daemon starts the implementer; or file a corrective child. In `awaiting_merge`, where no worker holds a phase and a backward move is refused, open a `dispatch_ask` naming the failing checks for the human who merges, as section 6 does for a conflict there. Do not treat the blocked PR as final. A `review_round_cap` reason is the implementer's round count instead: every move back to an earlier phase counts one, and the notice comes again with each round past the cap. It moves nothing either, since the round that reached the cap has already started its worker. Tell the rounds apart by what announced each: a tester's fail by its `phase-finished` with `verdict: "fail"`; a request for changes by the reviewer's `phase-finished` over a `CHANGES_REQUESTED` review; the daemon's own move by a `checks-red` notice, whose reason names either a conflict (`the head conflicts with <base>`) or the required checks that failed (`CI is red at <head>`); a worker's `request_backward_move` by a `phase-finished` from the role that asked, whose reason reaches only the task of the worker the move started, so ask that worker. Judge the cap by the rounds that are not conflicts. Conflict returns need nothing from you beyond the next round. Tester fails, requests for changes and CI-red returns (a `checks-red` notice is raised for CI only when a required check fails on code the branch pushed) are the work going in circles: narrow it, re-plan it with the responsible worker, or ask a human with `dispatch_ask`. Judge a worker's backward move by the reason that worker gives. A move you ordered for a conflict found before `awaiting_merge` (section 6) is a conflict return. The merger's move back to `reviewing` because its task names no approved head is not the work going in circles either. A move that sends back code found wrong counts with the tester fails. |
|
|
347
350
|
| `pr-merged` | Its `reason` names the pull request. The PR merged, under the repository's rules, before the issue reached `awaiting_merge`. The workflow runs on and asks no one to merge it: the daemon starts the **implementer** on the production check once the issue gets there, and you start nothing. Its `phase-finished` for `production_check` is what brings you to step 7: verify the record on the pull request and this issue first, then sign off naming it with `sign_off`. A merge is not the close. |
|
|
348
351
|
| `pr-closed-unmerged` | Decide from current scope whether the work is reopened, started over (`park_child` then `rerun_child`, for a child), or ended with a reason. Delegate the repository action to the responsible phase worker and keep ownership. |
|
|
349
352
|
| A reply on an ask you follow | Interpret the reply in the issue's design context. Answer in its thread (`dispatch_comment` with `reply_to`; under an open ask whose next move is yours, such as the approval request you must revise or hand back, `reply_to_ask` with `turn: "agent"`, since a default-turn reply hands that request back to the human and a corrected `summary` is then refused), then adjust the plan or relay it via `envoy_publish` to the responsible worker's role token; scope and product decisions remain with you. |
|
|
@@ -19,20 +19,19 @@ Follow this ordering exactly. It keeps the reviewed branch clean while preservin
|
|
|
19
19
|
retrospective's durable output.
|
|
20
20
|
|
|
21
21
|
1. Tester green and all code-review cycles finish.
|
|
22
|
-
2. The reviewer approves the head. It still carries
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
participates only when the repository enables it.
|
|
22
|
+
2. The reviewer approves the head. It still carries the issue's handoffs, `.legion/<issue>/`
|
|
23
|
+
(`<issue>` is your `LEGION_ISSUE`), which every tester and reviewer round writes again.
|
|
24
|
+
3. Run this retro (*Durable outputs*, below): its learnings under `docs/solutions/`, then one final
|
|
25
|
+
commit removing `.legion/<issue>/`, pushed together, and the retro message on the Dispatch
|
|
26
|
+
issue. Retro writes **no handoff**. The removal exists because a squash merge commits the head
|
|
27
|
+
merged into the base, and nothing on the base reads a handoff; the handoffs stay on the issue
|
|
28
|
+
branch below that commit.
|
|
29
|
+
4. The merger verifies the tip is the approved head plus retro's commits, quotes their
|
|
30
|
+
`jj diff --from <approved-sha> --to <tip-sha> --summary` in READY, and sends the READY packet
|
|
31
|
+
with its completion, which refuses a head that still carries `.legion/<issue>/`; the daemon
|
|
32
|
+
posts it on the Dispatch issue and publishes it to the project's merge-queue role when one is
|
|
33
|
+
configured. A human merges under the repository's GitHub branch-protection and CODEOWNERS
|
|
34
|
+
requirements; GitHub's merge queue participates only when the repository enables it.
|
|
36
35
|
5. After that merge, the implementer — not the reviewer or merger — verifies the change in production
|
|
37
36
|
and records it on the PR and the issue: the agent that developed it is responsible for testing
|
|
38
37
|
in production. The architect's sign-off waits for that record.
|
|
@@ -41,10 +40,12 @@ retrospective's durable output.
|
|
|
41
40
|
merge commit. A defect the production check finds becomes a corrective child issue of the same tree,
|
|
42
41
|
owned by the architect and implemented by the same implementer; the parent stays open until it lands.
|
|
43
42
|
|
|
44
|
-
Retro's
|
|
45
|
-
|
|
46
|
-
never back to the tester or reviewer. A conflict-forced
|
|
47
|
-
with the branch
|
|
43
|
+
Retro's commits sit above the reviewer's approved head and the approval stands: commits that
|
|
44
|
+
change only `docs/solutions/`, and the one that removes `.legion/<issue>/`, do not void it, and the
|
|
45
|
+
tree goes from retro to the merger — never back to the tester or reviewer. A conflict-forced
|
|
46
|
+
rebase after retro moves these commits with the branch. Any round after retro (a conflict round, a
|
|
47
|
+
round a red CI sends back, a re-review) writes `.legion/<issue>/` again, and every approval moves
|
|
48
|
+
the issue to retro once more: each retro ends with the removal again, or READY is refused.
|
|
48
49
|
|
|
49
50
|
Do not start retro before step 2 or skip it because the change seems mechanical; the merger's
|
|
50
51
|
`READY` comes only after step 3. The design gate is not a substitute for review and retro.
|
|
@@ -106,24 +107,30 @@ related_issues:
|
|
|
106
107
|
```
|
|
107
108
|
|
|
108
109
|
Commit the documentation on the existing issue branch. Do not create a replacement branch or
|
|
109
|
-
bookmark.
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
bookmark. Then commit the removal of the issue's handoffs as the one final commit, touching
|
|
111
|
+
nothing else, when the head still holds them:
|
|
112
|
+
`cd -- "$LEGION_WORKSPACE" && if [ -e ".legion/${LEGION_ISSUE:?}" ]; then rm -r -- ".legion/${LEGION_ISSUE:?}" && jj -R "$LEGION_WORKSPACE" split -m "retro: remove .legion/${LEGION_ISSUE:?}/ before READY" ".legion/${LEGION_ISSUE:?}"; fi`.
|
|
113
|
+
A retro that commits no learning makes that commit alone; a retro after an earlier removal with no
|
|
114
|
+
handoff written since has nothing to remove and makes none (without the guard, `rm -r` would fail
|
|
115
|
+
on the missing directory and that retro would stop there).
|
|
116
|
+
|
|
117
|
+
Before you push those commits, bring up to date the body content the repository derives from the
|
|
112
118
|
pull request's changed paths. A repository can require such content, a line naming a checklist
|
|
113
119
|
for each class of changed path for instance, and have a required check read it from the PR body.
|
|
114
|
-
When your
|
|
115
|
-
fails at your head; the merger reports a stale body rather
|
|
116
|
-
head whose required check failed, so the tree stops at the
|
|
120
|
+
When your commits add a `docs/solutions/` path the approved body never accounted for, or take away
|
|
121
|
+
the `.legion/` paths it did, that check fails at your head; the merger reports a stale body rather
|
|
122
|
+
than rewriting it, and READY refuses a head whose required check failed, so the tree stops at the
|
|
123
|
+
merger.
|
|
117
124
|
|
|
118
125
|
1. Read what the deployment instructions in your system prompt, and the agent guide and pull
|
|
119
126
|
request template of the repository you are working in, derive from the changed paths. When
|
|
120
127
|
they derive nothing, skip steps 2 to 4 and go on to the push.
|
|
121
|
-
2. Compute it the way they say, for the paths the pull request changes at your
|
|
128
|
+
2. Compute it the way they say, for the paths the pull request changes at your head, the files
|
|
122
129
|
GitHub lists on it:
|
|
123
|
-
`cd -- "$LEGION_WORKSPACE" && jj -R "$LEGION_WORKSPACE" git fetch && jj -R "$LEGION_WORKSPACE" diff --from 'fork_point(<base>@origin | <
|
|
124
|
-
lists them, `<base>` the pull request's base branch and `<
|
|
130
|
+
`cd -- "$LEGION_WORKSPACE" && jj -R "$LEGION_WORKSPACE" git fetch && jj -R "$LEGION_WORKSPACE" diff --from 'fork_point(<base>@origin | <head>)' --to <head> --name-only`
|
|
131
|
+
lists them, `<base>` the pull request's base branch and `<head>` your removal commit. Where a
|
|
125
132
|
line affirms work, such as a checklist completed for a class of path, do that work for the
|
|
126
|
-
paths your
|
|
133
|
+
paths your commits add before you write the line: the line is a claim. That work may change
|
|
127
134
|
files under `docs/solutions/` only, folded into your docs commit before the push, since
|
|
128
135
|
anything else above the approved head voids the approval.
|
|
129
136
|
3. In a fresh `mktemp -d` directory outside `$LEGION_WORKSPACE` (the one place you write outside
|
|
@@ -139,16 +146,17 @@ head whose required check failed, so the tree stops at the merger.
|
|
|
139
146
|
`cd -- "$LEGION_WORKSPACE" && legion gh -- api --method PATCH repos/{owner}/{repo}/pulls/{number} -F body=@<dir>/body.md`.
|
|
140
147
|
The checks the push starts read the body as it stands then; an edit after the push re-runs
|
|
141
148
|
only a check that also starts on an edited body. Such a check re-runs now at the approved
|
|
142
|
-
head, on a diff without your
|
|
149
|
+
head, on a diff without your commits, and may fail there; READY reads the head your push makes.
|
|
143
150
|
|
|
144
151
|
When you cannot compute that content, cannot do the work a line affirms within
|
|
145
152
|
`docs/solutions/`, the body read fails or comes back empty, or GitHub refuses the body, push
|
|
146
153
|
nothing and do not complete: tell the architect with `envoy_publish` to its role topic, naming
|
|
147
154
|
what failed.
|
|
148
155
|
|
|
149
|
-
Then push
|
|
150
|
-
write `<dir>/before.md` back the same way before you report
|
|
151
|
-
body matches the head GitHub has. After the push, post one
|
|
156
|
+
Then push both commits with one `legion push`, so one CI run covers them. When the push is
|
|
157
|
+
refused after step 4 wrote the body, write `<dir>/before.md` back the same way before you report
|
|
158
|
+
the refusal to the architect, so the body matches the head GitHub has. After the push, post one
|
|
159
|
+
Dispatch message on
|
|
152
160
|
the issue — `issue` is your `LEGION_ISSUE`; Legion issues live on Dispatch, never on a GitHub
|
|
153
161
|
issue, and the `gh` shim refuses every GitHub-issue write — naming the documents, the
|
|
154
162
|
one-to-three most useful takeaways, the two proofs you read, and the production check that
|
|
@@ -174,23 +182,27 @@ dispatch_message({
|
|
|
174
182
|
})
|
|
175
183
|
```
|
|
176
184
|
|
|
177
|
-
The `docs/solutions/` commit, the
|
|
178
|
-
are the only retro outputs. Never write a handoff, phase
|
|
179
|
-
completion label, and
|
|
180
|
-
tool's `handoff_complete` alone (its summary: two
|
|
181
|
-
`handoff_write`.
|
|
185
|
+
The `docs/solutions/` commit, the removal of `.legion/<issue>/`, the PR body lines those commits
|
|
186
|
+
make stale, and the Dispatch message are the only retro outputs. Never write a handoff, phase
|
|
187
|
+
artifact, local feedback log, or completion label, and change nothing under `.legion/` but that
|
|
188
|
+
removal. Report completion with the `legion` tool's `handoff_complete` alone (its summary: two
|
|
189
|
+
sentences for the architect) — no `handoff_write`.
|
|
182
190
|
|
|
183
191
|
## Completion check
|
|
184
192
|
|
|
185
193
|
Before returning, verify all of the following:
|
|
186
194
|
|
|
187
|
-
- The reviewer-approved head remains below the retro
|
|
188
|
-
|
|
195
|
+
- The reviewer-approved head remains below the retro commits, and the reviewer's approval of that
|
|
196
|
+
head stands: the merger accepts the approved head plus the documentation commit and the removal.
|
|
189
197
|
- The learning documents and the Dispatch message both exist (never a GitHub issue comment).
|
|
190
198
|
- The PR body carries what the repository's instructions derive from the pull request's changed
|
|
191
199
|
paths at the retro head, written back before that head's push, and each line that affirms work
|
|
192
200
|
affirms work you did; or the instructions derive nothing.
|
|
193
201
|
- Both proofs were read, and any gap in either is recorded as a learning.
|
|
194
|
-
-
|
|
202
|
+
- Retro wrote no handoff, and when the head held `.legion/<issue>/`, its last commit, pushed,
|
|
203
|
+
removed it and nothing else:
|
|
204
|
+
`cd -- "$LEGION_WORKSPACE" && jj -R "$LEGION_WORKSPACE" file list -r <head> "root:.legion/${LEGION_ISSUE:?}"`
|
|
205
|
+
prints nothing (`root:` names the path from the repository root, so a run from another directory
|
|
206
|
+
cannot print nothing by failing).
|
|
195
207
|
- The fresh-eyes analysis was considered alongside the implementer's context.
|
|
196
208
|
- The merger remains a subsequent step, not work performed by retro.
|
|
@@ -121,8 +121,7 @@ moves the issue to `implementing` and interrupts your turn, and the implementer
|
|
|
121
121
|
that turn has ended. Do not resume the interrupted work afterward.
|
|
122
122
|
|
|
123
123
|
On every start, and especially after revival or re-creation, read the issue and then the
|
|
124
|
-
committed predecessor handoffs in lifecycle order
|
|
125
|
-
`$LEGION_WORKSPACE/.legion/<issue>/`:
|
|
124
|
+
committed predecessor handoffs in lifecycle order, with the `legion` tool's `handoff_read`:
|
|
126
125
|
|
|
127
126
|
1. `architect.json`
|
|
128
127
|
2. `plan.json`
|
|
@@ -132,8 +131,8 @@ committed predecessor handoffs in lifecycle order from
|
|
|
132
131
|
|
|
133
132
|
Read only files that precede the assigned phase. Each was held to its phase's rules when it was
|
|
134
133
|
written (`handoff_write`, in the completion gate below): fields the phase does not declare passed
|
|
135
|
-
untouched and reach the next worker. The `legion` tool's `handoff_read` returns
|
|
136
|
-
|
|
134
|
+
untouched and reach the next worker. The `legion` tool's `handoff_read` returns them; its
|
|
135
|
+
description says where it reads each one from.
|
|
137
136
|
Write the phase-specific fields the next phase and the architect need, consistent with what
|
|
138
137
|
predecessor phases already wrote. The durable copy lives in
|
|
139
138
|
`$LEGION_WORKSPACE/.legion/<issue>/<phase>.json`. If a committed handoff conflicts with memory or a prior
|
|
@@ -414,12 +413,12 @@ report to the architect with the output, never a force-push. The merger makes no
|
|
|
414
413
|
pushes nothing.
|
|
415
414
|
|
|
416
415
|
Do not report phase completion until the write, existence check, handoff commit, and push
|
|
417
|
-
succeed. This is the committed copy the next phase reads after revival.
|
|
418
|
-
`.legion
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
416
|
+
succeed. This is the committed copy the next phase reads after revival. Retro's last commit
|
|
417
|
+
removes `.legion/<issue>/` from the head a human merges (`skill://legion-retro`); a round after
|
|
418
|
+
it, such as one a withdrawn READY sends back, writes and commits its own handoff again, since
|
|
419
|
+
`handoff_complete` refuses a handoff that commit removed. Retro and the post-merge production
|
|
420
|
+
check write no `.legion/<issue>/<phase>.json`, commit no handoff, and report with
|
|
421
|
+
`handoff_complete` alone (below).
|
|
423
422
|
|
|
424
423
|
## Completion: report to the architect, then stay
|
|
425
424
|
|
|
@@ -5,15 +5,15 @@ approval, the implementer recording the production check, or the merger building
|
|
|
5
5
|
path it cites is in sjawhar/legion.
|
|
6
6
|
|
|
7
7
|
The order, in full: the tester's evidence green → the reviewer's approval of the head →
|
|
8
|
-
retro → the merger's READY → the human merge → the implementer's production check.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
confirmation or a new round, as the fingerprint decides (*The reviewer*,
|
|
15
|
-
`skill://legion-worker/references/conflicts-and-rewrites.md`), and any other change to
|
|
16
|
-
voids it.
|
|
8
|
+
retro → the merger's READY → the human merge → the implementer's production check. The approved
|
|
9
|
+
head carries the issue's handoffs, `.legion/<issue>/`; retro's last commit removes them from the
|
|
10
|
+
head a human merges (dispatch://LEGION-605), since a squash merge commits that head merged into
|
|
11
|
+
the default branch and nothing there reads a handoff, and READY refuses a head that still
|
|
12
|
+
carries them. After the approval, only retro's commits leave it standing on their own: those that
|
|
13
|
+
change only `docs/solutions/`, and that removal (*Retro*, below). A conflict-forced merge goes back
|
|
14
|
+
to the reviewer for a confirmation or a new round, as the fingerprint decides (*The reviewer*,
|
|
15
|
+
below, and `skill://legion-worker/references/conflicts-and-rewrites.md`), and any other change to
|
|
16
|
+
the head voids it.
|
|
17
17
|
|
|
18
18
|
## The reviewer
|
|
19
19
|
|
|
@@ -63,15 +63,16 @@ review posted without a completion leaves the issue in reviewing until you finis
|
|
|
63
63
|
|
|
64
64
|
## Retro
|
|
65
65
|
|
|
66
|
-
- **Retro's
|
|
67
|
-
head,
|
|
68
|
-
|
|
69
|
-
reviewer. Anything else above the approved head does void
|
|
70
|
-
architect the head must return to review instead of completing. A
|
|
71
|
-
after retro moves those
|
|
66
|
+
- **Retro's commits do not void the reviewer's approval.** Retro's commits above the approved
|
|
67
|
+
head, its `docs/solutions/` learnings and its last commit removing `.legion/<issue>/`
|
|
68
|
+
(`skill://legion-retro` gives the steps), leave the approval standing, and the tree goes to the
|
|
69
|
+
merger — never back to the tester or reviewer. Anything else above the approved head does void
|
|
70
|
+
it, and the merger tells the architect the head must return to review instead of completing. A
|
|
71
|
+
conflict-forced rebase after retro moves those commits with the branch. Every approval moves the
|
|
72
|
+
issue to retro again, so each retro ends with the removal again.
|
|
72
73
|
- **Retro brings the PR body's path-derived content up to date before its push.** Whatever the
|
|
73
74
|
repository's instructions derive from the pull request's changed paths (a checklist named for
|
|
74
|
-
each class of path, read by a required check), retro recomputes for the whole diff at its
|
|
75
|
+
each class of path, read by a required check), retro recomputes for the whole diff at its head
|
|
75
76
|
and writes into the live body before `legion push` (`skill://legion-retro`), since the merger
|
|
76
77
|
reports a stale body rather than rewriting it. A body edit changes no commit, so the approval
|
|
77
78
|
stands.
|
|
@@ -84,8 +85,11 @@ review posted without a completion leaves the issue in reviewing until you finis
|
|
|
84
85
|
exits 1 (report the thread to the architect instead), then proves that rule with two commands.
|
|
85
86
|
First `cd -- "$LEGION_WORKSPACE" && jj -R "$LEGION_WORKSPACE" git fetch && jj -R
|
|
86
87
|
"$LEGION_WORKSPACE" diff --from <approved-sha> --to <tip-sha> --summary`, whose output is quoted
|
|
87
|
-
in READY
|
|
88
|
-
|
|
88
|
+
in READY; then the same with the one fileset `'~(docs/solutions | .legion/<issue>)'` appended,
|
|
89
|
+
which must print nothing (jj unions separate path arguments, so two of them leave nothing out).
|
|
90
|
+
READY itself refuses a head that still carries `.legion/<issue>/` (the merger tells the
|
|
91
|
+
architect, which has it move the issue back to `retro`), and publishes a pull request a person
|
|
92
|
+
already merged unread (`packages/daemon/internal/prompts/go/merger.md`). *The READY packet* is
|
|
89
93
|
`READY #<n> at <current sha> (approved at <approved sha>) for <KEY> (<pr url>)`
|
|
90
94
|
(the shape `packages/daemon/internal/prompts/roles/merger.md` defines), then the PR body's
|
|
91
95
|
`Outcome:` line and its `Not proven / risk:` value — every bullet under that label joined with
|