@sjawhar/pi-legion-envoy 5.16.7 → 5.16.8
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 +6 -1
- package/dist/legion.js +11 -4
- package/dist/skills/legion-worker/SKILL.md +23 -10
- package/package.json +2 -2
package/dist/envoy.js
CHANGED
|
@@ -30600,6 +30600,7 @@ function controllerToken(project) {
|
|
|
30600
30600
|
|
|
30601
30601
|
// ../contracts/src/legion-daemon-api.ts
|
|
30602
30602
|
var nonEmptyString = exports_external.string().min(1);
|
|
30603
|
+
var appLogin = exports_external.string().regex(/^[^[\]]+\[bot\]$/);
|
|
30603
30604
|
var legionRole = exports_external.enum(LEGION_ROLES);
|
|
30604
30605
|
var requiredUnknown = exports_external.unknown().refine((value) => value !== undefined, {
|
|
30605
30606
|
message: "Required"
|
|
@@ -30853,7 +30854,11 @@ var LegionDaemonApi = {
|
|
|
30853
30854
|
},
|
|
30854
30855
|
GitHubToken: {
|
|
30855
30856
|
request: exports_external.strictObject({ grantId: nonEmptyString }),
|
|
30856
|
-
response: exports_external.object({
|
|
30857
|
+
response: exports_external.object({
|
|
30858
|
+
token: nonEmptyString,
|
|
30859
|
+
appLogin: exports_external.string().endsWith("[bot]"),
|
|
30860
|
+
legionAppLogins: exports_external.object({ implement: appLogin, review: appLogin }).optional()
|
|
30861
|
+
})
|
|
30857
30862
|
},
|
|
30858
30863
|
GitCredential: {
|
|
30859
30864
|
request: exports_external.strictObject({ grantId: nonEmptyString })
|
package/dist/legion.js
CHANGED
|
@@ -30769,6 +30769,7 @@ function controllerToken(project) {
|
|
|
30769
30769
|
|
|
30770
30770
|
// ../contracts/src/legion-daemon-api.ts
|
|
30771
30771
|
var nonEmptyString = exports_external.string().min(1);
|
|
30772
|
+
var appLogin = exports_external.string().regex(/^[^[\]]+\[bot\]$/);
|
|
30772
30773
|
var legionRole = exports_external.enum(LEGION_ROLES);
|
|
30773
30774
|
var requiredUnknown = exports_external.unknown().refine((value) => value !== undefined, {
|
|
30774
30775
|
message: "Required"
|
|
@@ -31022,7 +31023,11 @@ var LegionDaemonApi = {
|
|
|
31022
31023
|
},
|
|
31023
31024
|
GitHubToken: {
|
|
31024
31025
|
request: exports_external.strictObject({ grantId: nonEmptyString }),
|
|
31025
|
-
response: exports_external.object({
|
|
31026
|
+
response: exports_external.object({
|
|
31027
|
+
token: nonEmptyString,
|
|
31028
|
+
appLogin: exports_external.string().endsWith("[bot]"),
|
|
31029
|
+
legionAppLogins: exports_external.object({ implement: appLogin, review: appLogin }).optional()
|
|
31030
|
+
})
|
|
31026
31031
|
},
|
|
31027
31032
|
GitCredential: {
|
|
31028
31033
|
request: exports_external.strictObject({ grantId: nonEmptyString })
|
|
@@ -33415,7 +33420,7 @@ import { logger } from "@oh-my-pi/pi-utils";
|
|
|
33415
33420
|
// package.json
|
|
33416
33421
|
var package_default = {
|
|
33417
33422
|
name: "@sjawhar/pi-legion-envoy",
|
|
33418
|
-
version: "5.16.
|
|
33423
|
+
version: "5.16.8",
|
|
33419
33424
|
type: "module",
|
|
33420
33425
|
omp: {
|
|
33421
33426
|
extensions: [
|
|
@@ -33428,7 +33433,7 @@ var package_default = {
|
|
|
33428
33433
|
},
|
|
33429
33434
|
legion: {
|
|
33430
33435
|
daemonApiVersion: 9,
|
|
33431
|
-
goDaemonApiVersion:
|
|
33436
|
+
goDaemonApiVersion: 11
|
|
33432
33437
|
},
|
|
33433
33438
|
repository: {
|
|
33434
33439
|
type: "git",
|
|
@@ -33990,9 +33995,11 @@ var LegionGoGrantResponse = exports_external.strictObject({
|
|
|
33990
33995
|
grantId: nonEmptyString2,
|
|
33991
33996
|
expiresAt: timestamp
|
|
33992
33997
|
});
|
|
33998
|
+
var appLogin2 = exports_external.string().regex(/^[^[\]]+\[bot\]$/);
|
|
33993
33999
|
var LegionGoGitHubTokenResponse = exports_external.strictObject({
|
|
33994
34000
|
token: nonEmptyString2,
|
|
33995
|
-
appLogin: exports_external.string().endsWith("[bot]")
|
|
34001
|
+
appLogin: exports_external.string().endsWith("[bot]"),
|
|
34002
|
+
legionAppLogins: exports_external.strictObject({ implement: appLogin2, review: appLogin2 }).optional()
|
|
33996
34003
|
});
|
|
33997
34004
|
var LegionGoGitCredentialResponse = exports_external.strictObject({
|
|
33998
34005
|
username: exports_external.literal("x-access-token"),
|
|
@@ -285,9 +285,11 @@ later phase keeps it current rather than replacing it:
|
|
|
285
285
|
- Thread <id>: fixed in <commit-sha> — <one line>.
|
|
286
286
|
- Thread <id>: not a defect — <reason>.
|
|
287
287
|
`legion threads resolve --pr <n> --repo <owner>/<repo>` at <head-sha>:
|
|
288
|
-
resolved <thread URL>
|
|
288
|
+
resolved <thread URL> — its opener's acceptance
|
|
289
|
+
resolved <thread URL> — the Legion reviewer's acceptance of a bot's thread
|
|
289
290
|
left open <thread URL> — newest reply by <login> is not an acceptance
|
|
290
291
|
left open <thread URL> — newest reply by <login> is an unsubmitted draft in a pending review
|
|
292
|
+
left open <thread URL> — newest reply by <login> is not its opener's or the Legion reviewer's acceptance
|
|
291
293
|
|
|
292
294
|
**Thermo:** `ce-simplify-code` once at <head-sha>: <0 applied | applied → new head <sha>>; thermonuclear pair at the final head <sha>:
|
|
293
295
|
<verdict>. (omitted entirely on a docs-only PR — there is no code for either pass, so neither runs)
|
|
@@ -329,7 +331,8 @@ this proof.
|
|
|
329
331
|
|
|
330
332
|
- **Threads are dispositioned individually, never resolved in bulk.** Every open review
|
|
331
333
|
thread gets its own line naming the fixing commit or the reason it isn't a defect. The
|
|
332
|
-
reviewer answers each thread it opened
|
|
334
|
+
reviewer answers each thread it opened, and each thread a bot opened that is none of Legion's
|
|
335
|
+
role Apps, with exactly one of `Accepted: fixed in <commit> — <one line>`,
|
|
333
336
|
`Accepted: not a defect — <reason>`, or `Still open: <what remains>`; nothing else is an
|
|
334
337
|
acceptance, and nobody replies after an `Accepted:` (any later reply that is not itself an
|
|
335
338
|
`Accepted:` — the opener's own follow-up included — leaves the thread open, because resolution
|
|
@@ -341,9 +344,16 @@ this proof.
|
|
|
341
344
|
In a Legion pane, the **implementer** runs the command before every push that answers a review
|
|
342
345
|
(the corrective push and the final `.legion/` deletion push) and pastes its output into the
|
|
343
346
|
`Threads` section. The command resolves each unresolved thread whose newest submitted comment is
|
|
344
|
-
the opener's own `Accepted:` reply
|
|
345
|
-
|
|
346
|
-
|
|
347
|
+
the opener's own `Accepted:` reply. On a thread a bot account opened that is none of Legion's
|
|
348
|
+
role Apps (the daemon names them, keyed by App role), the Legion reviewer's `Accepted:` also
|
|
349
|
+
closes it. GitHub cannot tell a CI bot, which never accepts, from a person whose `gh` is routed
|
|
350
|
+
to an App, so the reviewer adjudicates such a finding, and it may accept one an App-routed person
|
|
351
|
+
raised. The subject of a finding never closes it: the implementer's `Fixed in <commit>: …` or
|
|
352
|
+
`Declined: …` answers a thread and closes none. A thread either Legion App opened, a reviewer's
|
|
353
|
+
finding included, still needs its opener's `Accepted:`. It makes one `resolveReviewThread` per
|
|
354
|
+
thread, prints `resolved <url> — <whose acceptance>` (its opener's, or the Legion reviewer's on a
|
|
355
|
+
bot's thread, so the ledger shows which) or `left open <url> — newest reply by <login> is …`
|
|
356
|
+
naming why, and exits 1 naming the thread's URL and GitHub's message when GitHub refuses one.
|
|
347
357
|
|
|
348
358
|
Without a grant, page through `reviewThreads`, skip `isResolved: true`, and compare the opener
|
|
349
359
|
with the newest comment. Query shape, inside `repository { pullRequest { … } }`:
|
|
@@ -353,15 +363,18 @@ this proof.
|
|
|
353
363
|
pageInfo { hasNextPage endCursor }
|
|
354
364
|
nodes {
|
|
355
365
|
id isResolved
|
|
356
|
-
opener: comments(first: 1) { nodes { author { login } } }
|
|
357
|
-
newest: comments(last: 1) { nodes { author { login } body state } }
|
|
366
|
+
opener: comments(first: 1) { nodes { author { __typename login } } }
|
|
367
|
+
newest: comments(last: 1) { nodes { author { __typename login } body state } }
|
|
358
368
|
}
|
|
359
369
|
}
|
|
360
370
|
```
|
|
361
371
|
|
|
362
|
-
Resolve only when the newest comment is submitted, its `author
|
|
363
|
-
and
|
|
364
|
-
|
|
372
|
+
Resolve only when the newest comment is submitted, its `author` is the opener's account (the same
|
|
373
|
+
`__typename` and `login`: a login alone is a string anyone may register), and its `body`, after
|
|
374
|
+
removing leading spaces, tabs, CR, and LF, begins `Accepted:`. Without a
|
|
375
|
+
grant nothing names Legion's own App logins, so this route closes a bot's thread only on its
|
|
376
|
+
opener's `Accepted:`: leave one the Legion reviewer accepted for the implementer's or merger's
|
|
377
|
+
run in a pane, or report it. For each thread to resolve:
|
|
365
378
|
|
|
366
379
|
```graphql
|
|
367
380
|
mutation($threadId: ID!) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sjawhar/pi-legion-envoy",
|
|
3
|
-
"version": "5.16.
|
|
3
|
+
"version": "5.16.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"omp": {
|
|
6
6
|
"extensions": [
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"legion": {
|
|
15
15
|
"daemonApiVersion": 9,
|
|
16
|
-
"goDaemonApiVersion":
|
|
16
|
+
"goDaemonApiVersion": 11
|
|
17
17
|
},
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|