@sjawhar/pi-legion-envoy 5.26.0 → 5.27.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/envoy.js +12 -2
- package/dist/legion.js +1 -1
- package/dist/skills/envoy/SKILL.md +1 -1
- package/dist/skills/legion-worker/SKILL.md +1 -1
- package/dist/skills/legion-worker/references/merge-gate.md +11 -8
- package/dist/skills/legion-worker/references/pr-body.md +30 -2
- package/package.json +1 -1
package/dist/envoy.js
CHANGED
|
@@ -31769,6 +31769,16 @@ function dispatchPayload(event) {
|
|
|
31769
31769
|
const parsed = schema.safeParse(event.payload);
|
|
31770
31770
|
return parsed.success ? parsed.data : event.payload;
|
|
31771
31771
|
}
|
|
31772
|
+
function hasTarget(value) {
|
|
31773
|
+
return isObject2(value) && "target" in value;
|
|
31774
|
+
}
|
|
31775
|
+
function dispatchPayloadForReader(event, sessionID) {
|
|
31776
|
+
const payload = dispatchPayload(event);
|
|
31777
|
+
if (!hasTarget(payload))
|
|
31778
|
+
return payload;
|
|
31779
|
+
const target = payload.target;
|
|
31780
|
+
return target === `session:${sessionID}` ? { ...payload, target: `you (${target})` } : payload;
|
|
31781
|
+
}
|
|
31772
31782
|
function dispatchAskQuestion(comment) {
|
|
31773
31783
|
return comment?.ask_question !== undefined && comment.ask_question !== "" ? textHead(comment.ask_question) : undefined;
|
|
31774
31784
|
}
|
|
@@ -31994,7 +32004,7 @@ function renderInbound(raw, sessionID, subject2) {
|
|
|
31994
32004
|
owner: dispatchOwner(frame.event, topic),
|
|
31995
32005
|
type: frame.event.type,
|
|
31996
32006
|
actor: frame.event.actor,
|
|
31997
|
-
...compactRecord ?? { payload:
|
|
32007
|
+
...compactRecord ?? { payload: dispatchPayloadForReader(frame.event, sessionID) }
|
|
31998
32008
|
};
|
|
31999
32009
|
dispatchActor = frame.event.actor;
|
|
32000
32010
|
} else {
|
|
@@ -32035,7 +32045,7 @@ function renderInbound(raw, sessionID, subject2) {
|
|
|
32035
32045
|
...dispatchIssue === undefined ? [] : [dispatchIssue]
|
|
32036
32046
|
].join(", ") || undefined;
|
|
32037
32047
|
const rendered = {
|
|
32038
|
-
...envelope2.topic === agentSubject(sessionID) ? { to: `you (${sessionID
|
|
32048
|
+
...envelope2.topic === agentSubject(sessionID) ? { to: `you (${sessionID})` } : {},
|
|
32039
32049
|
from: senderLabel(envelope2),
|
|
32040
32050
|
at: inboundTimestamp(envelope2.issued_at),
|
|
32041
32051
|
id: envelope2.event_id ?? "unknown",
|
package/dist/legion.js
CHANGED
|
@@ -33611,7 +33611,7 @@ import { logger } from "@oh-my-pi/pi-utils";
|
|
|
33611
33611
|
// package.json
|
|
33612
33612
|
var package_default = {
|
|
33613
33613
|
name: "@sjawhar/pi-legion-envoy",
|
|
33614
|
-
version: "5.
|
|
33614
|
+
version: "5.27.1",
|
|
33615
33615
|
type: "module",
|
|
33616
33616
|
omp: {
|
|
33617
33617
|
extensions: [
|
|
@@ -45,7 +45,7 @@ Envoy renders an annotated delivery before its source summary and complete paylo
|
|
|
45
45
|
|
|
46
46
|
```text
|
|
47
47
|
envoy:
|
|
48
|
-
to: you (
|
|
48
|
+
to: you (ses_example_recipient)
|
|
49
49
|
from: 01a0bbbb-cccc-7ddd-eeee-0123456789ab (Reviewer)
|
|
50
50
|
at: "2026-09-07T04:41:12Z"
|
|
51
51
|
id: agent-message-2
|
|
@@ -287,7 +287,7 @@ rather than creating a replacement bookmark or PR.
|
|
|
287
287
|
|
|
288
288
|
## PR body, review, and the merge gate
|
|
289
289
|
|
|
290
|
-
The implementer writes the pull request body
|
|
290
|
+
The implementer writes the pull request body from the template when it opens the pull request,
|
|
291
291
|
and every later phase edits its own lines of the live body rather than replacing it. Each proof
|
|
292
292
|
(the implementer's `E2E (implementer)` line and `proof` array, the tester's `E2E (tester)` line
|
|
293
293
|
and `proof` array) is the changed behaviour exercised on a production-like surface, recorded as
|
|
@@ -71,14 +71,17 @@ completion leaves the issue in reviewing until you finish.
|
|
|
71
71
|
First `cd -- "$LEGION_WORKSPACE" && jj -R "$LEGION_WORKSPACE" git fetch && jj -R
|
|
72
72
|
"$LEGION_WORKSPACE" diff --from <approved-sha> --to <tip-sha> --summary`, whose output is quoted
|
|
73
73
|
in READY (an empty output is quoted as `no file changes above the approved head`); then the same
|
|
74
|
-
with `'~docs/solutions'` appended, which must print nothing. The
|
|
75
|
-
`READY #<n> at <current sha> (approved at <approved sha>) for <KEY> (<pr url>)`
|
|
76
|
-
`packages/pi-envoy/roles/merger.md` defines),
|
|
77
|
-
`
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
74
|
+
with `'~docs/solutions'` appended, which must print nothing. *The READY packet*: the merger
|
|
75
|
+
always posts `READY #<n> at <current sha> (approved at <approved sha>) for <KEY> (<pr url>)`
|
|
76
|
+
(the shape `packages/pi-envoy/roles/merger.md` defines), then the PR body's `Outcome:` line and
|
|
77
|
+
its `Not proven / risk:` value — every bullet under that label joined with `; ` on the one
|
|
78
|
+
READY line, or `none` — quoted from the `## For the reviewer` block at that same head (or one
|
|
79
|
+
line saying the body carries no brief — the packet still publishes), then the `--summary`
|
|
80
|
+
output and the PR body's gate facts, as a `dispatch_message` on the issue. When the `Legion
|
|
81
|
+
addressing` line names a merge queue, it also publishes the same packet there with
|
|
82
|
+
`envoy_publish`; a 404 means the Dispatch message remains the durable notice and the merger
|
|
83
|
+
stays idle. The READY packet names both the implementer's and tester's `E2E` lines; a missing
|
|
84
|
+
one is reported to the architect instead of published. Legion never merges.
|
|
82
85
|
|
|
83
86
|
## After the human merge
|
|
84
87
|
|
|
@@ -4,12 +4,24 @@ Part of `skill://legion-worker`. Read it before you write or edit any line of th
|
|
|
4
4
|
body, put a `proof` array in a handoff, verify another phase's proof, or run the simplify pass.
|
|
5
5
|
Every path it cites is in sjawhar/legion.
|
|
6
6
|
|
|
7
|
-
## The
|
|
7
|
+
## The pull request body template
|
|
8
8
|
|
|
9
|
-
The implementer writes the PR body
|
|
9
|
+
The implementer writes the PR body from this template from the moment the PR opens, and every
|
|
10
10
|
later phase keeps it current rather than replacing it:
|
|
11
11
|
|
|
12
12
|
```
|
|
13
|
+
## For the reviewer
|
|
14
|
+
|
|
15
|
+
**Outcome:** <one sentence a user of this repository would recognise: what someone can now do, or what stops going wrong>
|
|
16
|
+
**Why:** <the problem, one or two sentences, ending with the Dispatch key in parentheses — the key only, never a URL>
|
|
17
|
+
**Change:**
|
|
18
|
+
- <two to five bullets, each one behaviour a user or operator meets, never a file name>
|
|
19
|
+
**Look at first:** <one to three `path:line` places where a wrong decision would hurt> (the reviewer writes this line)
|
|
20
|
+
**Proven by:** <the `E2E (implementer)` line's surface and run, one line>
|
|
21
|
+
**Not proven / risk:**
|
|
22
|
+
- <one line per claim recorded as unproven before READY>, or the single word `none` (the reviewer writes this line; `none` is invalid while such a claim stands)
|
|
23
|
+
**Size:** <files changed, +added/−removed>
|
|
24
|
+
|
|
13
25
|
## Verification
|
|
14
26
|
|
|
15
27
|
**CI:** `Tests` run <run-id> — jobs lint, typecheck, test all success at <head-sha>; `PR Title` run <run-id> — job pr-title success at <head-sha>.
|
|
@@ -42,6 +54,22 @@ Verified the implementer's proof by <re-running its command | driving the same s
|
|
|
42
54
|
**Chain:** stacked on <base bookmark> frozen at <sha> / not stacked.
|
|
43
55
|
```
|
|
44
56
|
|
|
57
|
+
## The brief for the human
|
|
58
|
+
|
|
59
|
+
`## For the reviewer` is written for the person who merges; `## Verification` below it stays the
|
|
60
|
+
ledger the reviewer and merger check against GitHub. The implementer writes `Outcome`, `Why`,
|
|
61
|
+
`Change`, `Proven by`, and `Size` when the pull request opens, and keeps them true after every
|
|
62
|
+
push; `Outcome` is a sentence a user of the repository would recognise, never "fix bug" or a file
|
|
63
|
+
name, and `Why` ends with the Dispatch key, never a URL. The reviewer writes `Look at first` and
|
|
64
|
+
`Not proven / risk` at each round, into the live body (`legion gh -- api
|
|
65
|
+
repos/{owner}/{repo}/pulls/{number} --jq .body`, edit, then `--method PATCH ... -F body=@body.md`);
|
|
66
|
+
`Not proven / risk` copies every claim recorded as unproven before READY — the tester's
|
|
67
|
+
`failures`, the reviewer's own review, any proof-check comment already on the pull request —
|
|
68
|
+
word for word, and `none` is a finding while one stands. The merger quotes `Outcome` and
|
|
69
|
+
`Not proven / risk` from the body at the published head in the READY packet
|
|
70
|
+
(*The READY packet* in `skill://legion-worker/references/merge-gate.md`); a stale `Outcome` that no
|
|
71
|
+
longer describes the diff is a finding against the implementer, not a line the merger rewrites.
|
|
72
|
+
|
|
45
73
|
## What a proof is
|
|
46
74
|
|
|
47
75
|
**A proof** is the changed behaviour exercised on the surface a user reaches it through, recorded
|