@sjawhar/opencode-legion-envoy 3.11.3 → 3.11.4

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.
@@ -14459,6 +14459,7 @@ var LEGION_ROLES = [
14459
14459
 
14460
14460
  // ../contracts/src/legion-daemon-api.ts
14461
14461
  var nonEmptyString = exports_external.string().min(1);
14462
+ var appLogin = exports_external.string().regex(/^[^[\]]+\[bot\]$/);
14462
14463
  var legionRole = exports_external.enum(LEGION_ROLES);
14463
14464
  var requiredUnknown = exports_external.unknown().refine((value) => value !== undefined, {
14464
14465
  message: "Required"
@@ -14712,7 +14713,11 @@ var LegionDaemonApi = {
14712
14713
  },
14713
14714
  GitHubToken: {
14714
14715
  request: exports_external.strictObject({ grantId: nonEmptyString }),
14715
- response: exports_external.object({ token: nonEmptyString, appLogin: exports_external.string().endsWith("[bot]") })
14716
+ response: exports_external.object({
14717
+ token: nonEmptyString,
14718
+ appLogin: exports_external.string().endsWith("[bot]"),
14719
+ legionAppLogins: exports_external.object({ implement: appLogin, review: appLogin }).optional()
14720
+ })
14716
14721
  },
14717
14722
  GitCredential: {
14718
14723
  request: exports_external.strictObject({ grantId: nonEmptyString })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/opencode-legion-envoy",
3
- "version": "3.11.3",
3
+ "version": "3.11.4",
4
4
  "type": "module",
5
5
  "main": "dist/src/server.js",
6
6
  "exports": {
@@ -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 with exactly one of `Accepted: fixed in <commit> — <one line>`,
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, one `resolveReviewThread` per thread, prints `resolved <url>`
345
- or `left open <url> — newest reply by <login> is not an acceptance`, and exits 1 naming the
346
- thread's URL and GitHub's message when GitHub refuses one.
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 { login }` equals the opener's,
363
- and its `body`, after removing leading spaces, tabs, CR, and LF, begins `Accepted:`. For each
364
- such thread:
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!) {