@sjawhar/pi-legion 10.1.0 → 10.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/legion.js
CHANGED
|
@@ -14699,12 +14699,12 @@ var dispatchToolSpecs = [
|
|
|
14699
14699
|
{
|
|
14700
14700
|
name: "dispatch_request_approval",
|
|
14701
14701
|
example: { issue: "DSP-1", summary: "A live sync replaces the nightly export." },
|
|
14702
|
-
description: "Ask a human to approve a document at its current version. Before calling, have a fresh read-only reader check the spec against the code and the human's words, then resolve every finding; a Legion architect uses `plan-gap-analyst`. Opens an approval ask (Approve / " + "Request changes) in the human's Inbox whose question names the document and version, " + "followed by the summary; the answer pins a review to that version and arrives as " + "artifact.approved or artifact.changes_requested. An open request follows the document: a " + "later version moves it to that version and leaves it waiting on you, as a human's reply in " + "its thread does. Only the first move since the request was opened or handed back sends an " + "event, and never to the session whose version made it; dispatch doc-read shows whom it " + "waits on. Once the revision is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", call this again to hand that same Inbox row back. The request carries nothing new. A " + "call while it already waits on the human hands nothing back: the same summary changes " + "nothing, and a different one is refused, since it would rewrite the card the human is " + "reading. Approve and Request changes each close the request, so the next call opens a new " + "one. Call it once per revision, when the revision is complete, never after each edit. An " + "approval goes stale when the document changes after it: request approval again once that " + "
|
|
14702
|
+
description: "Ask a human to approve a document at its current version. Before calling, have a fresh read-only reader check the spec against the code and the human's words, then resolve every finding; a Legion architect uses `plan-gap-analyst`. Opens an approval ask (Approve / " + "Request changes) in the human's Inbox whose question names the document and version, " + "followed by the summary; the answer pins a review to that version and arrives as " + "artifact.approved or artifact.changes_requested. An open request follows the document: a " + "later version moves it to that version and leaves it waiting on you, as a human's reply in " + "its thread does. Only the first move since the request was opened or handed back sends an " + "event, and never to the session whose version made it; dispatch doc-read shows whom it " + "waits on. Once the revision is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", call this again to hand that same Inbox row back. The request carries nothing new. A " + "call while it already waits on the human hands nothing back: the same summary changes " + "nothing, and a different one is refused, since it would rewrite the card the human is " + "reading. Approve and Request changes each close the request, so the next call opens a new " + "one. Call it once per revision, when the revision is complete, never after each edit. An " + "approval goes stale when the document changes outside its decision blocks after it: " + "request approval again once that revision is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", with a one-sentence summary naming what changed since the earlier approval: the card " + "names that approval (version, date, reviewer) and its Show diff control carries the detail. " + "A human's own answer to a decision block carries the approval to the version it writes when " + "that answer is the whole change since the approved version, so nothing is requested for " + "it. A new version of a Legion root spec closes its armed design gate until a human " + "approves it; the carried approval reopens it too. " + "Refused, with nothing sent, while the document holds an open decision block, even when a " + "human asked for approval: the refusal names each block; ask the human to answer or waive " + "it first. " + OWNER_REFERENCE,
|
|
14703
14703
|
arguments: (z2) => ({
|
|
14704
14704
|
issue: z2.string().describe(ISSUE_REFERENCE).optional(),
|
|
14705
14705
|
project: z2.string().describe("Project key owning the document.").optional(),
|
|
14706
14706
|
artifact: z2.string().describe("Project document artifact id, slug, or filename; primary document by default for an issue.").optional(),
|
|
14707
|
-
summary: z2.string({ min: 1 }).describe(`What the human is approving, in one to three sentences, and nothing else: no commentary on itself or the conversation, and no question. Request approval only once ${HUMAN_AGREED_TO_DOCUMENT}.`)
|
|
14707
|
+
summary: z2.string({ min: 1 }).describe(`What the human is approving, in one to three sentences, and nothing else: no commentary on itself or the conversation, and no question; after an earlier approval, one sentence naming what changed since it, since the card shows that approval and a diff. Request approval only once ${HUMAN_AGREED_TO_DOCUMENT}.`)
|
|
14708
14708
|
}),
|
|
14709
14709
|
validation: documentOwnerValidation(true)
|
|
14710
14710
|
},
|
|
@@ -16148,7 +16148,7 @@ function onEnvoyRoleRegained(listener) {
|
|
|
16148
16148
|
// package.json
|
|
16149
16149
|
var package_default = {
|
|
16150
16150
|
name: "@sjawhar/pi-legion",
|
|
16151
|
-
version: "10.1
|
|
16151
|
+
version: "10.2.1",
|
|
16152
16152
|
license: "Apache-2.0",
|
|
16153
16153
|
type: "module",
|
|
16154
16154
|
omp: {
|
|
@@ -166,13 +166,27 @@ the code and command output it relies on, and the human's words, then resolve ev
|
|
|
166
166
|
**After approval, the root spec changes only when what the tree delivers, or a decision a human
|
|
167
167
|
settled, changes.** Approval is pinned to the spec version: any new version of the root spec closes
|
|
168
168
|
the gate again with no wake (you made the edit, or the `artifact.version` event on your issue tells
|
|
169
|
-
you)
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
169
|
+
you), except the version a human's own answer to a decision block writes when that answer is the
|
|
170
|
+
whole change since the version they approved: Dispatch then records an `approved` review in their
|
|
171
|
+
name pinned to the new version and emits `artifact.approved`, and the daemon reopens the gate and
|
|
172
|
+
sends `design-approved`. So edit an approved root spec only when its Summary, its Acceptance, the
|
|
173
|
+
tree's scope, or a decision a human settled in one of its decision blocks changes. Such a change is
|
|
174
|
+
a point the human has not agreed to: put the problem behind it to them as its own decision block,
|
|
175
|
+
with its evidence, at the end of the section it changes, and add nothing else to the spec, since
|
|
176
|
+
the question and its evidence go inside the block. An edit inside the block before the answer
|
|
177
|
+
closes the gate like any version and does not stop the answer carrying the approval. Once they have
|
|
178
|
+
answered, one of two follows. When the answer is the whole change, request nothing: the document's
|
|
179
|
+
chip reads Approved at the new version, its reviews dialog shows the review in their name, and the
|
|
180
|
+
`design-approved` the daemon sent opens nothing new — carry on, and release no wave because of it.
|
|
181
|
+
When the answer changes the Summary, the Acceptance or the tree's scope, rewrite that text and
|
|
182
|
+
repeat steps 3 through 5 on the new version, with a one-sentence `--summary` naming what changed
|
|
183
|
+
since the earlier approval (the card shows that approval, `Approved at version N on <date> by
|
|
184
|
+
<who>.`, and its `Show diff` control carries the detail); the rewrite closes the gate until they
|
|
185
|
+
approve, and what the daemon released at the answer stands. Release no new wave on the
|
|
186
|
+
`design-approved` the answer brought when a rewrite follows, and none until the next
|
|
187
|
+
`design-approved` after the rewrite — work already in flight continues. Every merger's `READY` in
|
|
188
|
+
the tree is refused until a human approves the latest version. A settled decision is the human's.
|
|
189
|
+
A plan that would overturn one goes back to
|
|
176
190
|
the planner with the decision kept, which asks the human nothing, unless the planner brings
|
|
177
191
|
evidence the human did not weigh that would change the decision, such as a measurement showing the
|
|
178
192
|
settled choice cannot meet the Acceptance; then that decision block names the decision and that
|
|
@@ -384,7 +398,7 @@ active phase worker.
|
|
|
384
398
|
| `child-status` | A child of your tree left the workflow or re-entered it; the notice's reason names the child and its new status. `todo` (a human's move, your `release_children`, or your `rerun_child`) means the child runs again under your tree from planning, and the daemon starts it; you start nothing. `backlog`, `icebox` or `triage` (a human's move, or your `park_child`) means the daemon has suspended the child's workers, and it advances no further until it is set back to `todo`. What the rest of the tree does is your decision. |
|
|
385
399
|
| `child-closed` | Read the child completion and remaining open children. Re-scope open work, park obsolete work with `park_child`, and release an appropriate next wave with `release_children`. When a worker waits on this child for a missing surface (see `phase-finished`), tell it to continue with `envoy_publish` to its role topic. The last child's close is not the end-game (section 3). |
|
|
386
400
|
| `child-release-stalled` | Its `reason` names a child your `release_children` released while Dispatch already showed it `todo`, and that child's parent, whose release has not reached the daemon after three tries. Check the parent's record in `legion state`; run `release_children` for the child again once the parent is recorded in your tree, and tell the controller if it never is. |
|
|
387
|
-
| `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 — except on a root whose catch-up said `handed_over`: its workers already run their phases, so start nothing; the approval releases any READY the gate refused. |
|
|
401
|
+
| `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 — except on a root whose catch-up said `handed_over`: its workers already run their phases, so start nothing; the approval releases any READY the gate refused. One whose `version` is the version a human's own answer to a decision block wrote, after an earlier approval (Dispatch carried that approval to it, section 1), opens nothing new: carry on, and release no wave because of it. |
|
|
388
402
|
| `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. |
|
|
389
403
|
| `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. |
|
|
390
404
|
| `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, and no later CI red within the attempt that ran the count out (the counted head, and every head pushed on top of it until a push lands on a head CI judged green, the tester's red tests and handoff onto the held red included) sends the work back from `testing`, `reviewing`, `retro` or `merging` either: the issue stays in its phase until you move it, or a worker's own decision does (a tester's `fail`, a reviewer's request for changes). A head pushed onto green CI leaves that attempt, so its red still comes as a `checks-red`. 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. |
|
|
@@ -69,6 +69,12 @@ Do not start retro before step 2 or skip it because the change seems mechanical;
|
|
|
69
69
|
|
|
70
70
|
## Durable outputs
|
|
71
71
|
|
|
72
|
+
Before your turn's first commit, run `jj -R "$LEGION_WORKSPACE" log -r @ --no-graph -T 'empty'`.
|
|
73
|
+
When it prints `true`, run `jj -R "$LEGION_WORKSPACE" new @-`; otherwise `@` holds only your own
|
|
74
|
+
resumed edits, so run `jj -R "$LEGION_WORKSPACE" new`. Never `jj describe` or `jj split` the
|
|
75
|
+
working-copy commit you found at the turn's start; `skill://legion-worker` explains the
|
|
76
|
+
shared-workspace authorship rule.
|
|
77
|
+
|
|
72
78
|
Write the integrated learning as one or more discoverable documents under `docs/solutions/`.
|
|
73
79
|
Organize by reusable topic rather than by pull request, but never edit a document you did not
|
|
74
80
|
write this retro — not its frontmatter, not its body. Two trees' retros can land within the same
|
|
@@ -158,25 +158,25 @@ An issue that renames a repository, package, or URL across the codebase also fol
|
|
|
158
158
|
`skill://legion-worker/references/systematic-rename.md`; one that deletes code, a command, or
|
|
159
159
|
documentation follows `skill://legion-worker/references/cleanup-deletion.md`.
|
|
160
160
|
|
|
161
|
-
Create
|
|
162
|
-
`jj -R "$LEGION_WORKSPACE" split -m "<message>" <paths…>`, each holding only your phase's paths.
|
|
161
|
+
Create reviewable commits with `jj -R "$LEGION_WORKSPACE" split -m "<message>" <paths…>`, each holding only your phase's paths.
|
|
163
162
|
|
|
164
163
|
Commit attribution is automatic: the extension exports a `JJ_CONFIG` overlay when your
|
|
165
164
|
session starts, so every jj commit you make carries an `Omp-Session: <this-session-id>`
|
|
166
165
|
trailer with no action from you. Do not add attribution trailers by hand.
|
|
167
166
|
|
|
168
|
-
Your pane's environment already supplies your phase's author and committer identity
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
167
|
+
Your pane's environment already supplies your phase's author and committer identity (`JJ_USER`/`JJ_EMAIL` and the Git author/committer variables, set by the daemon when it opened the pane).
|
|
168
|
+
Before your turn's first commit, run `jj -R "$LEGION_WORKSPACE" log -r @ --no-graph -T 'empty'`.
|
|
169
|
+
If it prints `true`, run `jj -R "$LEGION_WORKSPACE" new @-`; if it prints `false`, `@` holds only
|
|
170
|
+
your own resumed edits, so run `jj -R "$LEGION_WORKSPACE" new`. Never `jj describe` or `jj split`
|
|
171
|
+
the working-copy commit you found at the start of your turn: it can carry the previous role's
|
|
172
|
+
author, and those commands keep it. Never set or override `user.name`/`user.email`
|
|
173
|
+
in any jj or Git scope — not `jj config set`, not `--config`, not `git config`: `--config` outranks
|
|
174
|
+
the pane environment and would put the wrong App back on your commits, and the repository-scoped jj
|
|
175
|
+
config is one file shared by every issue workspace of the clone. Legion has two GitHub Apps, not
|
|
176
|
+
one per role: your role's App is the **implement** App if you are the implementer or the merger,
|
|
177
|
+
and the **review** App if you are the planner, tester, reviewer, or an architect (in Legion's own
|
|
178
|
+
deployment, `legion-implementer[bot]` and `legion-reviewer[bot]`). A planner's commits authored
|
|
179
|
+
by the review App are right. Before a push, check
|
|
180
180
|
`jj -R "$LEGION_WORKSPACE" log -r 'main@origin..@' -T 'author.email() ++ " | " ++ committer.email() ++ " " ++ description.first_line() ++ "\n"'`
|
|
181
181
|
shows your role's App in both columns **on every commit you made** — not on the whole list:
|
|
182
182
|
earlier phases' commits are legitimately authored by their own role's App. Their *committer* is
|