@sjawhar/pi-legion 9.2.1 → 9.3.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/dist/legion.js CHANGED
@@ -15703,7 +15703,7 @@ function onEnvoyRoleRegained(listener) {
15703
15703
  // package.json
15704
15704
  var package_default = {
15705
15705
  name: "@sjawhar/pi-legion",
15706
- version: "9.2.1",
15706
+ version: "9.3.0",
15707
15707
  license: "Apache-2.0",
15708
15708
  type: "module",
15709
15709
  omp: {
@@ -16719,7 +16719,7 @@ function createLegionTool(deps) {
16719
16719
  return {
16720
16720
  name: "legion",
16721
16721
  label: "legion",
16722
- description: "Perform the workflow operation the Legion daemon assigned this role. The daemon advances phases; this tool cannot spawn workers. " + "handoff_complete (phase workers and sub-architects; the daemon accepts a completion only from the role working the issue's current phase) " + "reports this phase complete: `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. A handoff is a committed file, `.legion/<issue>/<phase>.json`: the pushed commit " + "carrying it is found here, with the pane's jj, and reported, so write it, commit it and push the branch (`jj git push`) before calling; this call " + "refuses, posting nothing, a handoff still in the working copy, missing, not committed on this branch, carried by another pane's commit, or not yet " + "on `legion/<issue>@origin`, each naming the remedy. The daemon refuses HANDOFF_NOT_NEW (the commit is the one you reported for your previous " + "phase: write and commit this phase's handoff), and for READY READY_HEAD_CARRIES_HANDOFFS, READY_HEAD_CONFLICTS or READY_CHECKS_NOT_GREEN; a refused completion changed " + "nothing, so fix what it names and complete again. " + "The controller's read_state returns the daemon's whole state and set_status moves an issue to todo, backlog or icebox. " + "What a later phase needs goes in your handoff; a question for another live role goes to its role topic with envoy_publish.",
16722
+ description: "Perform the workflow operation the Legion daemon assigned this role. The daemon advances phases; this tool cannot spawn workers. " + "handoff_complete (phase workers and sub-architects; the daemon accepts a completion only from the role working the issue's current phase) " + "reports this phase complete: `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. A handoff is a committed file, `.legion/<issue>/<phase>.json`: the pushed commit " + "carrying it is found here, with the pane's jj, and reported, so write it, commit it and push the branch (`jj git push`) before calling; this call " + "refuses, posting nothing, a handoff still in the working copy, missing, not committed on this branch, carried by another pane's commit, or not yet " + "on `legion/<issue>@origin`, each naming the remedy. The daemon refuses HANDOFF_NOT_NEW (the commit is the one you reported for your previous " + "phase: write and commit this phase's handoff) and, for READY, each refusal the merger's role names; a refused completion changed " + "nothing, so fix what it names and complete again. An accepted READY whose `note` begins MANUAL_MERGE_REQUIRED: is one a person merges: arm nothing. " + "The controller's read_state returns the daemon's whole state and set_status moves an issue to todo, backlog or icebox. " + "What a later phase needs goes in your handoff; a question for another live role goes to its role topic with envoy_publish.",
16723
16723
  defaultInactive: true,
16724
16724
  parameters: toolSchema(pi),
16725
16725
  execute: async (_id, parameters, _signal, _onUpdate, context) => {
@@ -305,11 +305,11 @@ line), the full definition of a proof, what the tester verifies, and the simplif
305
305
  - **The merge gate**, in order: the tester's evidence green → the reviewer's approval of the head
306
306
  → retro → the merger's READY → the merge → the implementer's production check. On READY's
307
307
  acceptance the merger submits the pull request with
308
- `gh pr merge <n> -R <owner>/<repo> --auto --squash --match-head-commit <head>`, and the
309
- repository's required reviews and checks decide when it lands
308
+ `gh pr merge <n> -R <owner>/<repo> --auto --squash --match-head-commit <head>`, unless the
309
+ answer's note begins `MANUAL_MERGE_REQUIRED:`, where a person merges it; the repository's
310
+ required reviews and checks decide when it lands
310
311
  (`skill://legion-worker/references/merge-gate.md`). The reviewer's submissions, retro's commit,
311
- the merger's READY and its submission, the implementer's disarming of a withdrawn READY, and the
312
- production check follow the same reference.
312
+ the merger's READY and its submission, and the production check follow the same reference.
313
313
  - **No surface reaches the changed path** is a report to the architect, never a reason to
314
314
  complete the phase: `skill://legion-worker/references/pr-body.md`.
315
315
 
@@ -360,13 +360,13 @@ The daemon reads no handoff file and no branch head; it refuses, before recordin
360
360
 
361
361
  - `HANDOFF_NOT_NEW` — the commit is the one you reported for your previous phase: write and
362
362
  commit this phase's handoff before completing.
363
- - `READY_HEAD_CARRIES_HANDOFFS`, `READY_HEAD_CONFLICTS` and `READY_CHECKS_NOT_GREEN` — the
364
- merger's READY, in `skill://legion-worker/references/merge-gate.md`.
363
+ - each `READY_…` refusal of the merger's READY — named, with its remedy, in the merger's role
364
+ prompt (`skill://legion-worker/references/merge-gate.md` says how READY is checked).
365
365
  - `GITHUB_READ_FAILED` — GitHub's failure, not the head's, reading READY's checks: complete again.
366
366
 
367
367
  Such a refusal records nothing, so the corrected call at the same commit is applied. The answer
368
368
  may carry a `note` (READY published on an already-merged pull request, or a base requiring no
369
- check).
369
+ check, or the `MANUAL_MERGE_REQUIRED:` note of a pull request a person merges).
370
370
 
371
371
  Retro's last commit removes `.legion/<issue>/` from the head that merges (`skill://legion-retro`);
372
372
  a round after it, such as one a withdrawn READY sends back, writes and commits its own handoff
@@ -1,8 +1,8 @@
1
1
  # The merge gate: review, retro, READY, and the production check
2
2
 
3
3
  Part of `skill://legion-worker`. Read it when you are the reviewer submitting a review or an
4
- approval, the implementer disarming a withdrawn READY or recording the production check, or the
5
- merger building READY and submitting the merge. Every path it cites is in sjawhar/legion.
4
+ approval, the implementer recording the production check, or the merger building READY and
5
+ submitting the merge. Every 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
8
  retro → the merger's READY → the merge → the implementer's production check. The approved
@@ -97,45 +97,46 @@ review posted without a completion leaves the issue in reviewing until you finis
97
97
  - READY is `handoff_complete` with `ready: true` and the packet as its `summary`; the merger runs
98
98
  no pre-flight of its own, and its completion reports the commit the workspace stands on. READY's
99
99
  checks run in the daemon, which reads the pull request's head on GitHub and refuses, before
100
- recording anything: `READY_HEAD_CARRIES_HANDOFFS` while the head still carries `.legion/<issue>/`
101
- (tell the architect, which has you move the issue back to `retro` with `request_backward_move`,
102
- so the implementer's retro removes it; a refusal saying GitHub's read of the directory failed is
103
- GitHub's failure, not the head's: complete again); `READY_HEAD_CONFLICTS` while the pull
104
- request conflicts with its base, named — GitHub can neither merge it nor start pull_request CI
105
- for it, so the implementer brings the base into the branch with a forward merge; and
106
- `READY_CHECKS_NOT_GREEN` unless every check the base branch requires has succeeded at that head
107
- and every workflow its rulesets require has a passing run there — no result for a check, or no
108
- run of a workflow, means that head's push skipped CI when it should not have; a check still
109
- running means wait; a failed one is a finding. Report the refusal to the architect; never
110
- push a commit to make CI run. On success the daemon posts the packet as a `dispatch message` on
111
- the issue, publishes it to the project's merge queue role when one is set, and says on the issue
112
- when that role has no live holder; the answer's `note` says when READY was published on a pull
113
- request a person already merged, whose head can no longer change, or on a base that requires no
114
- check, which the packet itself also says.
115
- - **The merger submits the merge the moment READY is accepted.** In the same turn, before anything
116
- else, it runs `gh pr merge <n> -R <owner>/<repo> --auto --squash --match-head-commit <head>` with
117
- its pane's plain `gh`: `<n>` the pull request number, `<head>` the full sha of the current head
118
- READY named. A repository with a merge queue enqueues the pull request; one without arms
119
- auto-merge; one whose rules are already satisfied merges at once. `--match-head-commit` has
120
- GitHub refuse the request when the head has moved since READY read it. The repository's required
121
- reviews and checks decide when it lands: the merger makes no merge by hand and bypasses no
122
- rule. It then tells the architect with `envoy_publish` to its encoded role token what the
123
- command answered — enqueued, auto-merge enabled, or merged — and the head. On any READY refusal
124
- it submits nothing, since an armed request would merge through the gate the refusal names; a
125
- READY the design gate refused is submitted later, on the architect's word, once the gate opens,
126
- and that turn runs only `gh`. A `gh pr merge` GitHub refuses is reported to the architect with
127
- its message; a person can still merge after READY. The packet's second line records the step,
128
- `Merge: submitted on acceptance with gh pr merge <n> -R <owner>/<repo> --auto --squash --match-head-commit <head>`.
129
- - **A withdrawn READY is disarmed by the implementer.** When READY is withdrawn (the head's CI
130
- turned red, or it conflicts with its base, after READY, which sends the issue back to
131
- `implementing`), a merge queue drops the pull request on the red check, but auto-merge stays
132
- enabled across pushes, and `--match-head-commit` was checked only when it was enabled. So the
133
- implementer, at the start of that implementing round, runs
134
- `gh pr merge <n> -R <owner>/<repo> --disable-auto` before any push. A pull request still in a
135
- merge queue is removed with `gh api graphql -f query='mutation($id:ID!){dequeuePullRequest(input:{id:$id}){mergeQueueEntry{id}}}' -F id=<pull request node id>`
136
- (`--disable-auto` dequeues nothing). When nothing is armed — the merger's submission was refused,
137
- or a queue already dropped it — the command exits 1 with "Can't disable auto-merge for this pull
138
- request.": run it anyway and take that answer as nothing to disarm.
100
+ recording anything, on each ground the merger's role prompt names in its `Go daemon workflow`
101
+ part, by its code and with its remedy. That part is the one complete list of READY's refusals.
102
+ A refusal records nothing; the merger reports it to the architect unless it says to complete
103
+ again, and never pushes a commit to make CI run. On success the daemon posts the packet as a
104
+ `dispatch message` on the issue, publishes it to the project's merge queue role when one is set,
105
+ and says on the issue when that role has no live holder; the answer's `note` says when READY was
106
+ published on a pull request a person already merged, whose head can no longer change, or on a
107
+ base that requires no check, which the packet itself also says, or carries the by-hand note of a
108
+ pull request a person merges.
109
+ - **The merger submits the merge the moment READY is accepted, unless the answer says a person
110
+ merges it.** In the same turn, before anything else, it runs
111
+ `gh pr merge <n> -R <owner>/<repo> --auto --squash --match-head-commit <head>` with its pane's
112
+ plain `gh`: `<n>` the pull request number, `<head>` the full sha of the current head READY named.
113
+ A repository with a merge queue enqueues the pull request; one without arms auto-merge; one whose
114
+ rules are already satisfied merges at once. `--match-head-commit` has GitHub refuse the request
115
+ when the head has moved since READY read it. The repository's required reviews and checks decide
116
+ when it lands: the merger makes no merge by hand and bypasses no rule. It then tells the
117
+ architect with `envoy_publish` to its encoded role token what the command answered — enqueued,
118
+ auto-merge enabled, or merged — and the head. When the answer's `note` begins
119
+ `MANUAL_MERGE_REQUIRED:` (the pull request touches a path the project's `merge.by_hand` names),
120
+ READY stands but the merger submits nothing: it tells the architect the note and the head, and a
121
+ person merges under the repository's rules. The daemon tells that READY with the note at its head
122
+ and the packet's `Merge:` line replaced, so the issue and the merge queue role are never asked to
123
+ arm it. On any READY refusal it submits nothing, since an armed request would merge through the
124
+ gate the refusal names; a READY the design gate refused is submitted later, on the architect's
125
+ word, once the gate opens, and that turn runs only `gh` and a read of the READY the daemon posted
126
+ then: a refusal or a posted READY carrying the by-hand note is submitted by nobody. A push that
127
+ moves the head past a READY the gate holds voids it before then: the architect is told
128
+ `READY_HEAD_MOVED` and has the merger build a new READY at the new head. A
129
+ `gh pr merge` GitHub refuses is reported to the architect with its message; a person can still
130
+ merge after READY. The packet's second line records the step,
131
+ `Merge: submit on normal acceptance with gh pr merge <n> -R <owner>/<repo> --auto --squash --match-head-commit <head>`.
132
+ - **The daemon disarms a merge no READY covers.** Auto-merge stays enabled across pushes, and
133
+ `--match-head-commit` is checked only when it is enabled, so the daemon itself disables the pull
134
+ request's auto-merge and takes it out of a merge queue, as the implement App, on any push or
135
+ reopen but one landing on an awaiting READY's head, when READY is withdrawn (a push or reopen
136
+ moved the head past it, its CI turned red, or it conflicts with its base, each of which sends the
137
+ issue back to `implementing`), when a child is set back to `todo`, and when the issue leaves the
138
+ workflow. A by-hand READY covers no arm, so whoever arms it is undone. READY waits
139
+ (`READY_DISARM_PENDING`) until that disarm has finished. No role runs a disarm.
139
140
 
140
141
  ## After the merge
141
142
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/pi-legion",
3
- "version": "9.2.1",
3
+ "version": "9.3.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "omp": {