@sjawhar/pi-legion-envoy 5.5.1 → 5.5.3
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/envoy.js
CHANGED
|
@@ -30103,7 +30103,7 @@ var dispatchToolSpecs = [
|
|
|
30103
30103
|
{
|
|
30104
30104
|
name: "dispatch_ask",
|
|
30105
30105
|
example: { issue: "DSP-1", question: "Ship this?" },
|
|
30106
|
-
description: "Open a durable, answerable decision on an issue or project document. Do not use it for a status update or discussion; " + "use dispatch_message instead. A to-do a human must complete is a question phrased as that to-do, with the options you want (for example Done / Can't). " + "Anchor a document question, thread reply_to/reply_to_ask, or cite a dispatch:// " + `reference \u2014 it must be answerable from its own text and anchor alone, never "see above". A quote anchor is pinned to its block. Question is at most ${ASK_QUESTION_MAX} ` + `characters and has at most 8 options. ${OWNER_REFERENCE}`,
|
|
30106
|
+
description: "Open a durable, answerable decision on an issue or project document. Do not use it for a status update or discussion; " + "use dispatch_message instead. A to-do a human must complete is a question phrased as that to-do, with the options you want (for example Done / Can't). " + "Anything you are blocked on a human for, including a credential or grant to renew, an approval, or a decision, is an ask, never a message. " + "Anchor a document question, thread reply_to/reply_to_ask, or cite a dispatch:// " + `reference \u2014 it must be answerable from its own text and anchor alone, never "see above". A quote anchor is pinned to its block. Question is at most ${ASK_QUESTION_MAX} ` + `characters and has at most 8 options. ${OWNER_REFERENCE}`,
|
|
30107
30107
|
arguments: (z2) => ({
|
|
30108
30108
|
issue: z2.string().describe(ISSUE_REFERENCE).optional(),
|
|
30109
30109
|
project: z2.string().describe("Project key owning the document.").optional(),
|
|
@@ -30224,7 +30224,7 @@ var dispatchToolSpecs = [
|
|
|
30224
30224
|
{
|
|
30225
30225
|
name: "dispatch_message",
|
|
30226
30226
|
example: { issue: "DSP-1", body: "Implementation started." },
|
|
30227
|
-
description: "Post a note humans must read now: a reply to a human's message
|
|
30227
|
+
description: "Post a note humans must read now: a reply to a human's message or a deliverable that landed. A blocker only a human can " + "clear is an ask (dispatch_ask), so it lands in their inbox. Never progress or status updates - Dispatch is a high-signal " + "record, not a log. Not a decision (dispatch_ask) or document feedback (dispatch_comment). To answer a human's direct message to this session - " + "one sent from the Agents page, which names no issue - pass that message's bare id as in_reply_to and no issue; " + "the reply lands in that conversation, and a second call with the same in_reply_to posts nothing because " + "Dispatch keeps the one reply per message. Every other message names its issue. " + `Body is at most 2,000 characters. ${ISSUE_REFERENCE}`,
|
|
30228
30228
|
arguments: (z2) => ({
|
|
30229
30229
|
issue: z2.string().describe(`${ISSUE_REFERENCE} Omit it only when in_reply_to answers a human's direct message to this session.`).optional(),
|
|
30230
30230
|
body: z2.string({ max: 2000 }).describe("Update text, at most 2,000 characters."),
|
package/dist/legion.js
CHANGED
|
@@ -16142,7 +16142,7 @@ import { logger } from "@oh-my-pi/pi-utils";
|
|
|
16142
16142
|
// package.json
|
|
16143
16143
|
var package_default = {
|
|
16144
16144
|
name: "@sjawhar/pi-legion-envoy",
|
|
16145
|
-
version: "5.5.
|
|
16145
|
+
version: "5.5.3",
|
|
16146
16146
|
type: "module",
|
|
16147
16147
|
omp: {
|
|
16148
16148
|
extensions: [
|
|
@@ -30176,7 +30176,7 @@ var dispatchToolSpecs = [
|
|
|
30176
30176
|
{
|
|
30177
30177
|
name: "dispatch_ask",
|
|
30178
30178
|
example: { issue: "DSP-1", question: "Ship this?" },
|
|
30179
|
-
description: "Open a durable, answerable decision on an issue or project document. Do not use it for a status update or discussion; " + "use dispatch_message instead. A to-do a human must complete is a question phrased as that to-do, with the options you want (for example Done / Can't). " + "Anchor a document question, thread reply_to/reply_to_ask, or cite a dispatch:// " + `reference \u2014 it must be answerable from its own text and anchor alone, never "see above". A quote anchor is pinned to its block. Question is at most ${ASK_QUESTION_MAX} ` + `characters and has at most 8 options. ${OWNER_REFERENCE}`,
|
|
30179
|
+
description: "Open a durable, answerable decision on an issue or project document. Do not use it for a status update or discussion; " + "use dispatch_message instead. A to-do a human must complete is a question phrased as that to-do, with the options you want (for example Done / Can't). " + "Anything you are blocked on a human for, including a credential or grant to renew, an approval, or a decision, is an ask, never a message. " + "Anchor a document question, thread reply_to/reply_to_ask, or cite a dispatch:// " + `reference \u2014 it must be answerable from its own text and anchor alone, never "see above". A quote anchor is pinned to its block. Question is at most ${ASK_QUESTION_MAX} ` + `characters and has at most 8 options. ${OWNER_REFERENCE}`,
|
|
30180
30180
|
arguments: (z2) => ({
|
|
30181
30181
|
issue: z2.string().describe(ISSUE_REFERENCE).optional(),
|
|
30182
30182
|
project: z2.string().describe("Project key owning the document.").optional(),
|
|
@@ -30297,7 +30297,7 @@ var dispatchToolSpecs = [
|
|
|
30297
30297
|
{
|
|
30298
30298
|
name: "dispatch_message",
|
|
30299
30299
|
example: { issue: "DSP-1", body: "Implementation started." },
|
|
30300
|
-
description: "Post a note humans must read now: a reply to a human's message
|
|
30300
|
+
description: "Post a note humans must read now: a reply to a human's message or a deliverable that landed. A blocker only a human can " + "clear is an ask (dispatch_ask), so it lands in their inbox. Never progress or status updates - Dispatch is a high-signal " + "record, not a log. Not a decision (dispatch_ask) or document feedback (dispatch_comment). To answer a human's direct message to this session - " + "one sent from the Agents page, which names no issue - pass that message's bare id as in_reply_to and no issue; " + "the reply lands in that conversation, and a second call with the same in_reply_to posts nothing because " + "Dispatch keeps the one reply per message. Every other message names its issue. " + `Body is at most 2,000 characters. ${ISSUE_REFERENCE}`,
|
|
30301
30301
|
arguments: (z2) => ({
|
|
30302
30302
|
issue: z2.string().describe(`${ISSUE_REFERENCE} Omit it only when in_reply_to answers a human's direct message to this session.`).optional(),
|
|
30303
30303
|
body: z2.string({ max: 2000 }).describe("Update text, at most 2,000 characters."),
|
|
@@ -189,8 +189,8 @@ dashboard's **Unclaimed** filter is how you find work nobody is on.
|
|
|
189
189
|
that session (its id is in the message; `envoy_send` reaches it) or pick up something else,
|
|
190
190
|
and tell the human if you believe the work should be yours. When a **human** holds it, the
|
|
191
191
|
refusal names the person and says nothing about a session running, because there is none to
|
|
192
|
-
message: ask them
|
|
193
|
-
lapsed — only a human releases or forces a human's claim.
|
|
192
|
+
message: ask them with `dispatch_ask` instead, so the open ask appears in their Inbox, and
|
|
193
|
+
never assume their claim has lapsed — only a human releases or forces a human's claim.
|
|
194
194
|
- **`409 CLAIM_CONTENDED` means the issue changed hands twice while your call ran**, so nothing
|
|
195
195
|
was applied and nobody's liveness was checked. Read the issue and decide again; it is not a
|
|
196
196
|
refusal by a live holder.
|
|
@@ -421,17 +421,16 @@ Before saying you are waiting for human input, call `dispatch_open_asks`. With n
|
|
|
421
421
|
|
|
422
422
|
**Unsettled product shape needs a decision before implementation.** When a page, navigation entry, table key, customer-scoping rule, or persisted sidecar would set product shape that Sami has not already settled, send a one-line ask before the first implementation commit. A lane's schema decision or a platform-PO contract ruling does not settle product shape. This does not turn a user-specified decision or routine implementation into an approval request; it is inferred from AGENTC-186's 2026-09-16 retro (platform PO, 2026-09-17). A control or behaviour the human asked for in words is settled by those words, together with every choice inside it that his words do not make (where it sits, its defaults, its options): build it without an ask, as gate 4 of [Before you ask](#before-you-ask) says. This rule covers only product shape outside what he asked for, and its ask comes before the commit that sets that shape.
|
|
423
423
|
|
|
424
|
-
**Anything
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
exception is a halt condition from [Before you
|
|
428
|
-
platform PO over Envoy instead.
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
working on everything that is not.
|
|
424
|
+
**Anything you are blocked on a human for is an open ask.** An agent waits on a human only through
|
|
425
|
+
an open ask. An approval, a credential or grant to renew, a setting only they can change, a review
|
|
426
|
+
click, a decision, or a conflict between two of their own rules: open a `dispatch_ask` the moment
|
|
427
|
+
you know, the action as the question. The exception is a halt condition from [Before you
|
|
428
|
+
ask](#before-you-ask) gate 1, which goes to the platform PO over Envoy instead. Never write it
|
|
429
|
+
into a spec, a comment reply, a message, or a pull-request body: nothing in those paths reaches
|
|
430
|
+
the human's Inbox, and a human who is not reading your document does not know they are the
|
|
431
|
+
blocker. Before asking, try to remove the step: a value already on the machine, a permission you
|
|
432
|
+
already hold, an API that replaces the click. One ask per item, `urgency: "high"` when work is
|
|
433
|
+
stopped on it; while it is open, keep working on everything that is not.
|
|
435
434
|
|
|
436
435
|
A to-do handed to a human is an ordinary question: phrase the to-do as the question and give it
|
|
437
436
|
the options that name its outcomes, in the human's words - there is no fixed vocabulary and the
|
|
@@ -724,7 +723,7 @@ once.
|
|
|
724
723
|
## Messages
|
|
725
724
|
|
|
726
725
|
Dispatch is a high-signal record for humans, not a log of what you are doing. A message is a reply to a human's message, or a
|
|
727
|
-
change a human must know about now: a deliverable landed
|
|
726
|
+
change a human must know about now: a deliverable landed. Nothing else — no progress updates, no
|
|
728
727
|
"starting X", no "still working", no restating the spec, no status on a timer. Your transcript is where work is narrated; the
|
|
729
728
|
pull request is where it is summarised. One message that a human reads beats ten that train them to skip you.
|
|
730
729
|
|
|
@@ -72,8 +72,8 @@ carries, so nothing changes in how you handle wakes. Under the TypeScript daemon
|
|
|
72
72
|
claims the role and calls `/controller/ready` exactly as under tmux; under the Go daemon
|
|
73
73
|
(`LEGION_DAEMON_API=go` in your environment) it registers on `/legion/v1/claims/register` with the
|
|
74
74
|
secret, claims the role, then subscribes to `notifications.legion.<project>.controller`, where the
|
|
75
|
-
Go daemon publishes the
|
|
76
|
-
`controllerLocator: {runtime, external: true, sessionId, registeredAt}`, `runtime` being the
|
|
75
|
+
Go daemon publishes the rows marked from the Go daemon in the wake routing table. The daemon records
|
|
76
|
+
you as `controllerLocator: {runtime, external: true, sessionId, registeredAt}`, `runtime` being the
|
|
77
77
|
daemon's own (`kubernetes`, or `tmux` under the Go daemon). The TypeScript daemon reads your
|
|
78
78
|
liveness from the Envoy role registry (the holder of
|
|
79
79
|
`legion-<project>-controller` and its `last_seen`), not from a pane: keep the session running.
|
|
@@ -87,15 +87,29 @@ mints a new secret, so your grants stop working and the role moves to the new se
|
|
|
87
87
|
|
|
88
88
|
The Go daemon's controller topic is a wake for a session that is running when it is published.
|
|
89
89
|
Envoy hands an Oh My Pi session no retained copy of a notice published before it subscribed, so a
|
|
90
|
-
hold
|
|
91
|
-
every start, before anything else
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
90
|
+
hold, a tree architect's failed claim, or a new triage root from while no controller ran never
|
|
91
|
+
arrives as a wake. At every start, before anything else:
|
|
92
|
+
|
|
93
|
+
1. Read `legion state --json` and handle each issue whose `issues.<KEY>.phase` is `held` (its
|
|
94
|
+
`issues.<KEY>.holdReason` is `escalated` when its architect sent it to you, and absent while the
|
|
95
|
+
architect is still deciding or while its tree lingers or is closed, where the hold waits for the
|
|
96
|
+
tree's re-admission and needs nothing from you), and each tree root whose
|
|
97
|
+
`issues.<KEY>.architect.state` is `failed` and whose `issues.<KEY>.phase` is not `done`, exactly
|
|
98
|
+
as the matching wake below. A parked tree (root phase `done`: it lingers or is closed) needs
|
|
99
|
+
nothing from you: a failed architect ignores the park and reads `failed` until the tree closes.
|
|
100
|
+
2. List the project's triage issues with `dispatch_issues({project, status: "triage", limit: 250})`.
|
|
101
|
+
When its first line ends `(showing N of M)`, it is one page: say in your summary how many rows
|
|
102
|
+
it left unread. The rows show no parent, so open each row with `dispatch_read`: one whose
|
|
103
|
+
`Links:` name a `child_of` issue is a child, which its parent's architect owns, so leave it,
|
|
104
|
+
whether or not `legion state --json` records it (a `child_of` under `Referenced by:` is a child
|
|
105
|
+
of this issue, not its parent). Of the rest, triage each that `legion state --json` does not
|
|
106
|
+
record under `issues` as a new issue. A root recorded there and now in `triage` is work the
|
|
107
|
+
daemon holds that a human pulled back: never re-admit it yourself; name it in your summary to
|
|
108
|
+
the human ("<KEY> was pulled back to triage; what do you want?"). This listing is also the only
|
|
109
|
+
way you learn of an unrecorded root moved back into triage, or of a child detached to a root
|
|
110
|
+
while it is in triage, since the daemon wakes you only on a root's creation.
|
|
111
|
+
|
|
112
|
+
The issue record and Dispatch are the truth; the topic is the wake.
|
|
99
113
|
|
|
100
114
|
## Deployment instructions
|
|
101
115
|
|
|
@@ -123,7 +137,7 @@ quoted here.
|
|
|
123
137
|
|
|
124
138
|
| Wake | Content | Controller action |
|
|
125
139
|
|---|---|---|
|
|
126
|
-
| New issue created in the Dispatch project (`issue.created`, status `triage`; resync heals misses) | issue key + triage context (incl. pre-existing children) | Triage: `legion status <KEY> todo` to admit, or set `backlog`/`icebox` to park |
|
|
140
|
+
| New issue created in the Dispatch project (`issue.created`, status `triage`; under the TypeScript daemon resync heals misses, under the Go daemon the boot step above does). From the Go daemon: `triage on <KEY>` (payload `{kind: "triage"}`) on the controller topic, for a root only | issue key + triage context (incl. pre-existing children) | Triage: `legion status <KEY> todo` to admit, or set `backlog`/`icebox` to park |
|
|
127
141
|
| Backlog eligibility | slot freed / priority change | Reconsider parked items and move the eligible root to `todo` |
|
|
128
142
|
| Architect escalation (controller-actionable only: re-file a child as a root issue, capacity, cross-tree conflicts) | request + context | Judge and act; issue-scoped human Q&A goes through `dispatch_ask` from the owning architect, not here |
|
|
129
143
|
| Resync report | artifact-driven anomaly list (zero-owner trees, untriaged-open, launch-failed, admission-drift) | Verify against fresh state, then heal |
|
|
@@ -603,6 +603,11 @@ This publishes your phase's completion to the architect's role and clears the da
|
|
|
603
603
|
record of this issue's active phase. Do not add pipeline labels, run a controller loop, or
|
|
604
604
|
invent a different completion protocol — this is the whole contract.
|
|
605
605
|
|
|
606
|
+
A reviewer's phase ends with its completion, not with its review: submit the review on GitHub
|
|
607
|
+
first, then commit the handoff and complete. The daemon moves the issue once both are in — the
|
|
608
|
+
decision GitHub reports and your completion, in either order — so a review posted without a
|
|
609
|
+
completion leaves the issue in reviewing until you finish.
|
|
610
|
+
|
|
606
611
|
**A refused completion is information, not a retry loop.** The daemon attributes your report to
|
|
607
612
|
the run whose task you took, and answers with what it found. What each answer carries, and what to
|
|
608
613
|
do:
|
|
@@ -620,7 +625,10 @@ do:
|
|
|
620
625
|
has left your phase; report to the architect rather than completing again.
|
|
621
626
|
- `HANDOFF_NO_RUN` — names neither: it says this claim has taken no task, so the daemon cannot
|
|
622
627
|
tell which run you are reporting. Your pane is completing outside any assignment. Say so to the
|
|
623
|
-
architect; do not re-run the phase.
|
|
628
|
+
architect; do not re-run the phase. The same answer comes when your turn started before your task
|
|
629
|
+
reached you: a notice or a message started it, and the task, refused while that turn ran, is sent
|
|
630
|
+
when the turn ends. When a task arrives, do what it asks; if the work it asks for is already
|
|
631
|
+
committed, call `handoff_complete` again, and never redo the work or write a second handoff.
|
|
624
632
|
- `HANDOFF_ALREADY_RECORDED` — names your role, the phase, the review round and the commit. This
|
|
625
633
|
exact call was received before, and its first answer stands: accepted, or a refusal the daemon
|
|
626
634
|
records with the call — `HANDOFF_STALE_GENERATION`, `HANDOFF_NOT_CURRENT_PHASE`,
|