@sjawhar/pi-legion 10.8.0 → 10.8.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
@@ -16171,7 +16171,7 @@ function ompCapabilityHost() {
16171
16171
  // package.json
16172
16172
  var package_default = {
16173
16173
  name: "@sjawhar/pi-legion",
16174
- version: "10.8.0",
16174
+ version: "10.8.2",
16175
16175
  license: "Apache-2.0",
16176
16176
  type: "module",
16177
16177
  omp: {
@@ -17128,16 +17128,18 @@ function stepPhaseStall(state, input) {
17128
17128
  case "handoff-complete":
17129
17129
  return { state: "closed" };
17130
17130
  case "inbound-event":
17131
- return { state: state === "quiet" ? "open" : state };
17132
- case "settle":
17133
- if (state !== "open")
17131
+ return { state: state === "quiet" || state === "text-call" ? "open" : state };
17132
+ case "settle": {
17133
+ if (state !== "open" && state !== "text-call")
17134
17134
  return { state };
17135
17135
  if (WAITING_REPLY.test(input.lastAssistantText))
17136
17136
  return { state: "quiet" };
17137
- return {
17138
- state: "quiet",
17139
- followUp: TOOL_CALL_SHAPED.test(input.lastAssistantText) ? TEXT_TOOL_CALL + FOLLOW_UP : FOLLOW_UP
17140
- };
17137
+ const textCall = TOOL_CALL_SHAPED.test(input.lastAssistantText);
17138
+ if (state === "text-call") {
17139
+ return textCall ? { state: "quiet", followUp: TEXT_TOOL_CALL + FOLLOW_UP } : { state: "quiet" };
17140
+ }
17141
+ return textCall ? { state: "text-call", followUp: TEXT_TOOL_CALL + FOLLOW_UP } : { state: "quiet", followUp: FOLLOW_UP };
17142
+ }
17141
17143
  }
17142
17144
  }
17143
17145
  function inboundKind(message) {
@@ -17160,7 +17162,7 @@ function assistantText(message) {
17160
17162
  `);
17161
17163
  }
17162
17164
  function isPhaseStall(value) {
17163
- return value === "closed" || value === "open" || value === "quiet";
17165
+ return value === "closed" || value === "open" || value === "text-call" || value === "quiet";
17164
17166
  }
17165
17167
  function restorePhaseStall(branch) {
17166
17168
  for (let index = branch.length - 1;index >= 0; index -= 1) {
@@ -17298,7 +17300,7 @@ function createLegionTool(deps) {
17298
17300
  return {
17299
17301
  name: "legion",
17300
17302
  label: "legion",
17301
- 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.",
17303
+ 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 from the tester alone " + "(the daemon refuses a verdict from any other role), `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.",
17302
17304
  defaultInactive: true,
17303
17305
  parameters: toolSchema(pi),
17304
17306
  execute: async (_id, parameters, _signal, _onUpdate, context) => {
@@ -403,7 +403,7 @@ active phase worker.
403
403
  | `carried-gate-opened` | Only a root whose catch-up said `carried` gets it. Its `version` and `reason`: a human approved the old root's spec document at `version`, which opened the gate this root carried; the daemon has released any READY it refused and started any child waiting on it. It is not `design-approved`: do not proceed to section 2 or release a wave because of it, and start nothing. |
404
404
  | `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. |
405
405
  | `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). |
406
- | `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. |
406
+ | `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. Read the parent's record with the `legion` tool's `read_record` (`issue` the parent); run `release_children` for the child again once the parent is recorded in your tree, and tell the controller if it never is. |
407
407
  | `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. |
408
408
  | `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. |
409
409
  | `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. |
@@ -55,6 +55,6 @@ minutes apart. Do not poll to create the second read; use the next normal contro
55
55
  that no live owner is available with `envoy_sessions` before changing the issue.
56
56
 
57
57
  For work that the plan or its handoff says moves to Legion when its session stops, preserve its
58
- existing labels, add `legion`, then use `legion status <KEY> todo`. The label comes first: it is what
58
+ existing labels, add `legion`, then set it `todo` with the `legion` tool's `set_status`. The label comes first: it is what
59
59
  lets the daemon admit the root. Do not apply that recovery to an issue already in an active Legion
60
60
  tree; its architect and daemon own its lifecycle. Update the weekly-plan owner row after the move.
@@ -328,7 +328,7 @@ or `review`), with the ordinary `write` tool: a JSON object with `schemaVersion:
328
328
  phase's own fields exactly as your role prompt spells them — the planner's `requiredSkills`,
329
329
  `gapAnalysis`, `planReview` and `specDepartures` records; the implementer's `proof` array; the
330
330
  tester's `implementerProof`, `failures` and, whenever it reports no failure, its own `proof`; the
331
- reviewer's `verdict`, counts and `keyFindings`. Nothing stamps the first four for you. Each `proof`
331
+ reviewer's `decision`, counts and `keyFindings`. Nothing stamps the first four for you. Each `proof`
332
332
  entry, in either phase, is an object of six non-empty strings: `criterion` (the acceptance line it
333
333
  proves), `surface`, `command`, `observed`, `headSha` (the commit it ran at) and `negativeControl`.
334
334
  A handoff built from the one already on disk (a test handoff that accumulates review rounds) is
@@ -342,10 +342,10 @@ cd -- "$LEGION_WORKSPACE" && \
342
342
  ```
343
343
 
344
344
  Then push (below) and report completion: call the `legion` tool with `op: "handoff_complete"` and
345
- `summary` (two sentences for the architect; the tester adds `verdict: "pass"` or `"fail"`, the
346
- merger `ready: true`). **Push before you complete is a hard rule.** `handoff_complete` finds, with
347
- your pane's jj, the newest commit on the issue branch that carries `.legion/<KEY>/<phase>.json`
348
- and reports it to the daemon, and refuses — posting nothing — while:
345
+ `summary` (two sentences for the architect; the tester, and no other role, adds `verdict: "pass"`
346
+ or `"fail"`; the merger `ready: true`). **Push before you complete is a hard rule.**
347
+ `handoff_complete` finds, with your pane's jj, the newest commit on the issue branch that carries
348
+ `.legion/<KEY>/<phase>.json` and reports it to the daemon, and refuses — posting nothing — while:
349
349
 
350
350
  - the file has a change still in the working copy: commit it, then complete again;
351
351
  - the file is missing from the workspace: write it, then commit and push it;
@@ -429,8 +429,9 @@ Report completion to the architect: call the `legion` tool with `op: "handoff_co
429
429
  (`handoff_complete`; `read_record`, your issue's record, which is what "re-read your issue
430
430
  record" means; and `request_backward_move`), and nothing of yours runs `legion` from bash. The
431
431
  tool call is what the extension's phase stall records, and a turn that ends with the phase still
432
- open gets one reminder; do not complete again on that reminder when your first completion was
433
- accepted — it stands, and a second is refused because the issue has already left your phase.
432
+ open gets one reminder (two when the first is answered with the tool call written as text again);
433
+ do not complete again on a reminder when your first completion was accepted — it stands, and a
434
+ second is refused because the issue has already left your phase.
434
435
 
435
436
  This publishes your phase's completion to the architect's role and clears the daemon's
436
437
  record of this issue's active phase. Do not add pipeline labels, run a controller loop, or
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/pi-legion",
3
- "version": "10.8.0",
3
+ "version": "10.8.2",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "omp": {