@codyswann/lisa 8.7.0 → 8.7.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.
Files changed (162) hide show
  1. package/README.md +9 -0
  2. package/all/copy-overwrite/scripts/lib/changed-paths.mjs +146 -0
  3. package/all/copy-overwrite/scripts/lib/completion-proof-content.mjs +6 -2
  4. package/all/copy-overwrite/scripts/lisa-gates.mjs +16 -1
  5. package/all/copy-overwrite/scripts/lisa-hooks/block-direct-issue-create.sh +297 -177
  6. package/all/copy-overwrite/scripts/lisa-run-gates.mjs +24 -0
  7. package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +7 -6
  8. package/all/copy-overwrite/scripts/threshold-ratchet-compare.mjs +18 -12
  9. package/dist/cli/apply-cmd.d.ts +10 -0
  10. package/dist/cli/apply-cmd.d.ts.map +1 -0
  11. package/dist/cli/apply-cmd.js +28 -0
  12. package/dist/cli/apply-cmd.js.map +1 -0
  13. package/dist/cli/index.d.ts.map +1 -1
  14. package/dist/cli/index.js +3 -12
  15. package/dist/cli/index.js.map +1 -1
  16. package/dist/core/lisa-owned-hash-ledger.json +56 -4
  17. package/dist/core/nightly-e2e-guard-behavior-certificate.d.ts +5 -5
  18. package/dist/core/nightly-e2e-guard-behavior-certificate.js +7 -7
  19. package/dist/core/nightly-e2e-guard-behavior-certificate.js.map +1 -1
  20. package/dist/core/upstream-evidence-manifest.json +65 -24
  21. package/expo/copy-overwrite/scripts/check-bdd-coverage.mjs +4 -1
  22. package/expo/create-only/tsconfig.local.json +6 -1
  23. package/package.json +4 -4
  24. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  25. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  26. package/plugins/lisa/.codex-plugin/scripts/ready-queue-order.mjs +43 -18
  27. package/plugins/lisa/.codex-plugin/skills/lisa-enforce/references/missing-capability-tickets.md +44 -5
  28. package/plugins/lisa/.codex-plugin/skills/lisa-linear-write-issue/SKILL.md +6 -1
  29. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/SKILL.md +9 -2
  30. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-queue.mjs +32 -8
  31. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/queue-github.mjs +44 -1
  32. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/stale-links-github.mjs +14 -3
  33. package/plugins/lisa/.codex-plugin/skills/lisa-tracker-evidence/references/completion-authorization.md +4 -0
  34. package/plugins/lisa/hooks/block-direct-issue-create.sh +297 -177
  35. package/plugins/lisa/hooks/threshold-ratchet-compare.mjs +18 -12
  36. package/plugins/lisa/rules/reference/config-resolution.md +2 -2
  37. package/plugins/lisa/scripts/ready-queue-order.mjs +43 -18
  38. package/plugins/lisa/skills/lisa-enforce/references/missing-capability-tickets.md +44 -5
  39. package/plugins/lisa/skills/lisa-linear-write-issue/SKILL.md +6 -1
  40. package/plugins/lisa/skills/lisa-session-manager/SKILL.md +9 -2
  41. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-queue.mjs +32 -8
  42. package/plugins/lisa/skills/lisa-session-manager/scripts/queue-github.mjs +44 -1
  43. package/plugins/lisa/skills/lisa-session-manager/scripts/stale-links-github.mjs +14 -3
  44. package/plugins/lisa/skills/lisa-tracker-evidence/references/completion-authorization.md +4 -0
  45. package/plugins/lisa-agy/hooks/block-direct-issue-create.sh +297 -177
  46. package/plugins/lisa-agy/plugin.json +1 -1
  47. package/plugins/lisa-agy/scripts/ready-queue-order.mjs +43 -18
  48. package/plugins/lisa-agy/skills/lisa-enforce/references/missing-capability-tickets.md +44 -5
  49. package/plugins/lisa-agy/skills/lisa-linear-write-issue/SKILL.md +6 -1
  50. package/plugins/lisa-agy/skills/lisa-session-manager/SKILL.md +9 -2
  51. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-queue.mjs +32 -8
  52. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/queue-github.mjs +44 -1
  53. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/stale-links-github.mjs +14 -3
  54. package/plugins/lisa-agy/skills/lisa-tracker-evidence/references/completion-authorization.md +4 -0
  55. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  56. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  57. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  58. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  59. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  60. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  61. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  62. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  63. package/plugins/lisa-copilot/hooks/block-direct-issue-create.sh +297 -177
  64. package/plugins/lisa-copilot/hooks/threshold-ratchet-compare.mjs +18 -12
  65. package/plugins/lisa-copilot/rules/reference/config-resolution.md +2 -2
  66. package/plugins/lisa-copilot/scripts/ready-queue-order.mjs +43 -18
  67. package/plugins/lisa-copilot/skills/lisa-enforce/references/missing-capability-tickets.md +44 -5
  68. package/plugins/lisa-copilot/skills/lisa-linear-write-issue/SKILL.md +6 -1
  69. package/plugins/lisa-copilot/skills/lisa-session-manager/SKILL.md +9 -2
  70. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-queue.mjs +32 -8
  71. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/queue-github.mjs +44 -1
  72. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/stale-links-github.mjs +14 -3
  73. package/plugins/lisa-copilot/skills/lisa-tracker-evidence/references/completion-authorization.md +4 -0
  74. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  75. package/plugins/lisa-cursor/hooks/block-direct-issue-create.sh +297 -177
  76. package/plugins/lisa-cursor/hooks/threshold-ratchet-compare.mjs +18 -12
  77. package/plugins/lisa-cursor/rules/config-resolution-reference.mdc +2 -2
  78. package/plugins/lisa-cursor/scripts/ready-queue-order.mjs +43 -18
  79. package/plugins/lisa-cursor/skills/lisa-enforce/references/missing-capability-tickets.md +44 -5
  80. package/plugins/lisa-cursor/skills/lisa-linear-write-issue/SKILL.md +6 -1
  81. package/plugins/lisa-cursor/skills/lisa-session-manager/SKILL.md +9 -2
  82. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-queue.mjs +32 -8
  83. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/queue-github.mjs +44 -1
  84. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/stale-links-github.mjs +14 -3
  85. package/plugins/lisa-cursor/skills/lisa-tracker-evidence/references/completion-authorization.md +4 -0
  86. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  87. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  88. package/plugins/lisa-devin/hooks/block-direct-issue-create.sh +297 -177
  89. package/plugins/lisa-devin/hooks/threshold-ratchet-compare.mjs +18 -12
  90. package/plugins/lisa-devin/rules/reference/config-resolution.md +2 -2
  91. package/plugins/lisa-devin/scripts/ready-queue-order.mjs +43 -18
  92. package/plugins/lisa-devin/skills/lisa-enforce/references/missing-capability-tickets.md +44 -5
  93. package/plugins/lisa-devin/skills/lisa-linear-write-issue/SKILL.md +6 -1
  94. package/plugins/lisa-devin/skills/lisa-session-manager/SKILL.md +9 -2
  95. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-queue.mjs +32 -8
  96. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/queue-github.mjs +44 -1
  97. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/stale-links-github.mjs +14 -3
  98. package/plugins/lisa-devin/skills/lisa-tracker-evidence/references/completion-authorization.md +4 -0
  99. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  100. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  101. package/plugins/lisa-expo-agy/plugin.json +1 -1
  102. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  103. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  104. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  105. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  106. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  107. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  108. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  109. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  110. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  111. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  112. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  113. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  114. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  115. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  116. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  117. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  118. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  119. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  120. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  121. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  122. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  123. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  124. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  125. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  126. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  127. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  128. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  129. package/plugins/lisa-rails-agy/plugin.json +1 -1
  130. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  131. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  132. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  133. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  134. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  135. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  136. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  137. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  138. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  139. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  140. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  141. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  142. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  143. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  144. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  145. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  146. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  147. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  148. package/plugins/src/base/hooks/block-direct-issue-create.sh +297 -177
  149. package/plugins/src/base/hooks/threshold-ratchet-compare.mjs +18 -12
  150. package/plugins/src/base/rules/reference/config-resolution.md +2 -2
  151. package/plugins/src/base/scripts/ready-queue-order.mjs +43 -18
  152. package/plugins/src/base/skills/lisa-enforce/references/missing-capability-tickets.md +44 -5
  153. package/plugins/src/base/skills/lisa-linear-write-issue/SKILL.md +6 -1
  154. package/plugins/src/base/skills/lisa-session-manager/SKILL.md +9 -2
  155. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-queue.mjs +32 -8
  156. package/plugins/src/base/skills/lisa-session-manager/scripts/queue-github.mjs +44 -1
  157. package/plugins/src/base/skills/lisa-session-manager/scripts/stale-links-github.mjs +14 -3
  158. package/plugins/src/base/skills/lisa-tracker-evidence/references/completion-authorization.md +4 -0
  159. package/rails/copy-overwrite/scripts/check-nightly-e2e-health.mjs +28 -2
  160. package/rails/copy-overwrite/scripts/threshold-ratchet-compare.mjs +18 -12
  161. package/typescript/copy-overwrite/scripts/check-nightly-e2e-health.mjs +28 -2
  162. package/typescript/copy-overwrite/scripts/threshold-ratchet-compare.mjs +18 -12
@@ -261,7 +261,7 @@ function compareK6(relPath, base, current) {
261
261
  }
262
262
 
263
263
  /**
264
- * Compare .lisa.config.json allow lists: report every added exception entry.
264
+ * Compare .lisa.config.json allow lists: report new or edited exceptions.
265
265
  *
266
266
  * The finding says only what was added, and carries the entry. Whether an
267
267
  * added entry is accepted or refused is {@link settleAddedExceptions}' call,
@@ -270,15 +270,15 @@ function compareK6(relPath, base, current) {
270
270
  * @param {string} relPath Repo-relative path
271
271
  * @param {unknown} base Parsed baseline config
272
272
  * @param {unknown} current Parsed current config
273
- * @returns {Finding[]} One finding per newly added allow entry
273
+ * @returns {Finding[]} One finding per new or edited allow entry
274
274
  */
275
275
  function compareAllowList(relPath, base, current) {
276
- const baseKeys = new Set(
277
- extractAllowEntries(base).map(e => `${e.file} ${e.key}`)
278
- );
276
+ const identity = ({ file, key, reason, until }) =>
277
+ JSON.stringify({ file, key, reason, until });
278
+ const previous = new Set(extractAllowEntries(base).map(identity));
279
279
  const findings = [];
280
280
  for (const entry of extractAllowEntries(current)) {
281
- if (!baseKeys.has(`${entry.file} ${entry.key}`)) {
281
+ if (!previous.has(identity(entry))) {
282
282
  findings.push({
283
283
  file: relPath,
284
284
  key: `thresholdRatchet.allow ${entry.file}#${entry.key}`,
@@ -812,7 +812,12 @@ function compareHumanGateMode(relPath, baselineText, currentText) {
812
812
  */
813
813
  export function compareFile(relPath, baselineText, currentText) {
814
814
  const family = familyFor(relPath);
815
- if (!family || baselineText === null || baselineText === undefined) return [];
815
+ if (!family) return [];
816
+ if (baselineText === null || baselineText === undefined) {
817
+ return family.kind === KIND_ALLOW_LIST
818
+ ? compareAllowList(relPath, undefined, parseJson(currentText))
819
+ : [];
820
+ }
816
821
 
817
822
  if (currentText === null || currentText === undefined) {
818
823
  // Deleting an allow list grants nothing, so that half stays silent. The
@@ -860,13 +865,14 @@ export function compareFile(relPath, baselineText, currentText) {
860
865
  // separates absent from present-but-unreadable with `cat-file -e` before
861
866
  // calling.
862
867
  //
863
- // The allow-list carve-out is symmetric with the current side and holds for
864
- // the same reason: an allow list nobody can read grants no exceptions, so an
865
- // unreadable one on either side already fails closed. Reporting it would
866
- // block every change touching the file without making anything safer.
868
+ // An unreadable baseline allow list grants no exceptions. A repaired config
869
+ // must record each current exception through the same check as a new entry.
867
870
  if (base === undefined) {
868
871
  return family.kind === KIND_ALLOW_LIST
869
- ? compareHumanGateMode(relPath, baselineText, currentText)
872
+ ? [
873
+ ...compareHumanGateMode(relPath, baselineText, currentText),
874
+ ...compareAllowList(relPath, undefined, current),
875
+ ]
870
876
  : [unparseableBaseline(relPath)];
871
877
  }
872
878
  if (current === undefined) {
@@ -752,8 +752,8 @@ operator chooses Telegram (`init-config --notify telegram`).
752
752
  | `sessionManager.notify.provider` | no | `none` | `none` (no notification channel) or `telegram`. Absent, like an absent `notify` block, means `none`. Any other value fails validation. |
753
753
  | `sessionManager.notify.level` | no | `all` | `all` sends both action requests and routine notices with Telegram. `asks-only` sends human-needed questions, requests for operator action, duplicate-manager warnings and the hold digest. Routine notices go to the transcript. `status` reports `notifyLevel`, and the session-start config shows the resolved level. |
754
754
  | `sessionManager.notify.stateDir` | **yes** with `telegram`; must be absent otherwise | — | This project's own Telegram state dir. A `stateDir` without the `telegram` provider fails validation, because no bot would use it. Never the shared default `~/.claude/channels/telegram`, because one bot per state dir is how projects stay isolated. Setup writes `~/.claude/channels/telegram-<project>`. |
755
- | `sessionManager.trustedAuthorIds` | no | — | Optional list of **stable tracker user ids**, as strings: the GitHub numeric user id (`gh api users/<login> --jq .id`), the Jira `accountId`, or the Linear user id. Not logins or display names: matching compares ids, so a plain login silently matches no one and excludes every item. An entry may name its kind: `id:<v>` is an id, `login:<v>` a GitHub login (matched by the queue and on-item answers; the hold-release check compares ids only and ignores it). A login GitHub frees (after a rename or a deleted account) can be re-registered by someone else, so prefer `id:` for trust. `integration:<service>` trusts items an integration files with no person behind them (Linear's `botActor`, by `subType` such as `sentry`, else its bot `id`, never its self-chosen display name; never an item a person or an outside user filed; it trusts who filed the item, not text an outsider can get into it, such as a quoted error message); GitHub Apps and Jira automation file as an account, so trust them by `id:`. An unknown prefix or an empty value fails validation. When set, the manager takes only items authored by these people or integrations. It is also who may release a human hold, unless `trustedReleaseIds` is set — so removing it removes every hold releaser too. |
756
- | `sessionManager.trustedReleaseIds` | no | `trustedAuthorIds` | Optional, non-empty list of the **people** who may release a human hold (`blocked-plan`, the orphan sweep) and answer a question on the item. Same entry grammar as `trustedAuthorIds` minus `integration:`, which is refused: an integration is not a person. Unset, it falls back to `trustedAuthorIds`, so existing projects are unaffected; with neither set, no hold is released. |
755
+ | `sessionManager.trustedAuthorIds` | no | — | Optional list of **stable tracker user ids**, as strings: the GitHub numeric user id (`gh api users/<login> --jq .id`), the Jira `accountId`, or the Linear user id. Not logins or display names: matching compares ids, so a plain login silently matches no one and excludes every item. An entry may name its kind: `id:<v>` is an id, `login:<v>` a GitHub login (matched by the queue and on-item answers; the GitHub Ready queue resolves it to an account ID before checking hold releases). A login GitHub frees (after a rename or a deleted account) can be re-registered by someone else, so prefer `id:` for trust. `integration:<service>` trusts items an integration files with no person behind them (Linear's `botActor`, by `subType` such as `sentry`, else its bot `id`, never its self-chosen display name; never an item a person or an outside user filed; it trusts who filed the item, not text an outsider can get into it, such as a quoted error message); GitHub Apps and Jira automation file as an account, so trust them by `id:`. An unknown prefix or an empty value fails validation. When set, the manager takes only items authored by these people or integrations. It is also who may release a human hold, unless `trustedReleaseIds` is set — so removing it removes every hold releaser too. |
756
+ | `sessionManager.trustedReleaseIds` | no | `trustedAuthorIds` | Optional, non-empty list of the **people** who may release a human hold (`queue`, `blocked-plan`, the orphan sweep) and answer a question on the item. Use `id:` for hold releases across all three paths. Same entry grammar as `trustedAuthorIds` minus `integration:`, which is refused: an integration is not a person. Unset, it falls back to `trustedAuthorIds`, so existing projects are unaffected; with neither set, no hold is released. |
757
757
  | `sessionManager.operatorIds` | no | — | Optional, non-empty list of the people the manager works for, as tracker user ids matched against the **assignee** the same way "me" is: the GitHub **login**, the Jira `accountId`, or the Linear user id, spelled exactly as the tracker API returns it (matching is case-sensitive, so look the OPERATOR up rather than typing from memory: `gh api users/<operator-login> --jq .login` returns the canonical GitHub spelling. Do not use `gh api user`, which returns whoever the credential belongs to — the agent account, when that is the case this key exists for). Dispatch order is assigned to an operator, then to "me" (the tracker credential's identity), then unassigned; items assigned to anyone else are skipped. Set it whenever the tracker credential is not the operator's own (an agent account), or the operator's Ready items are never dispatched. Prefer the kind-keyed form, which the queue, the claim and on-item answers all match the same way: `login:<GitHub login>` matches only a GitHub login, `id:<v>` only an account id (GitHub numeric id, Jira `accountId`, Linear user id). A plain entry keeps its meaning, but a plain all-digit entry is a login to the queue and the claim and a numeric id to on-item answers, so validation warns about it (without failing) and names both forms. An unknown prefix or an empty value fails validation. A Jira accountId holding a colon (`557058:…`, `qm:…`) is still plain. |
758
758
  | `sessionManager.backlogPickup` | no | `false` | Opt-in lowest dispatch tier. When the Ready queue is exhausted and capacity remains, the manager considers backlog items (open leaves in no lifecycle role) with the Ready exclusions plus any unfinished blocker; each one that passes the tracker validator (all gates, including the stateless-pickup dry-run) is moved to Ready in one write that keeps any assignee it already has and assigns an unassigned one to the manager ("me"), then read back and dispatched. A failed validation is cached against the item's `updatedAt`, so it is re-judged only after the item changes. Requires `operatorIds`. |
759
759
 
@@ -464,6 +464,43 @@ function isTrustedAuthor(item, context) {
464
464
  return context.trusted.some(entry => entryMatches(entry, fields));
465
465
  }
466
466
 
467
+ /**
468
+ * @typedef {object} OrderingOptions
469
+ * @property {string | null} [me] - Current tracker identity
470
+ * @property {readonly unknown[]} [operators] - Configured operator identities
471
+ * @property {readonly unknown[]} [trustedAuthorIds] - Configured issue authors
472
+ * @property {readonly string[]} [trustedHumanActorIds] - Configured hold releasers
473
+ * @property {(ref: string) => unknown} [commentsFor] - Current provider comments
474
+ * @property {string} [humanNeededLabel] - Human-needed label
475
+ * @property {unknown} [humanOnly] - Human-only reasons
476
+ * @property {unknown} [humanGateMode] - Human-gate mode
477
+ */
478
+
479
+ /**
480
+ * Read comments only when a hold is still active and the policy can honor a release.
481
+ * @param {Record<string, any>} item - Normalized issue
482
+ * @param {ReturnType<typeof orderingContext>} context - Queue policy
483
+ * @returns {boolean} Whether a hold still bars dispatch
484
+ */
485
+ function hasUnreleasedHold(item, context) {
486
+ const hold = {
487
+ labels: item.labels,
488
+ body: item.body,
489
+ comments: item.comments,
490
+ trustedHumanActorIds:
491
+ context.trustedHumanActorIds ?? item.trustedHumanActorIds,
492
+ humanNeededLabel: context.humanNeededLabel,
493
+ humanOnly: context.humanOnly,
494
+ humanGateMode: context.humanGateMode,
495
+ };
496
+ return (
497
+ isHumanGated(hold) &&
498
+ (!context.commentsFor ||
499
+ !hold.trustedHumanActorIds?.length ||
500
+ isHumanGated({ ...hold, comments: context.commentsFor(item.ref) }))
501
+ );
502
+ }
503
+
467
504
  /**
468
505
  * Why an item may not be dispatched, or null when it may.
469
506
  *
@@ -483,21 +520,7 @@ function exclusionReason(item, context) {
483
520
  return "assigned-to-other";
484
521
  }
485
522
  if (item.isContainer === true) return "container";
486
- if (
487
- isHumanGated({
488
- labels: item.labels,
489
- body: item.body,
490
- comments: item.comments,
491
- trustedHumanActorIds: item.trustedHumanActorIds,
492
- humanNeededLabel: context.humanNeededLabel,
493
- // The project's policy decides whether a lifted hold is valid again
494
- // (CodySwannGT/lisa#4687): omitted, strict holds read as access-only.
495
- humanOnly: context.humanOnly,
496
- humanGateMode: context.humanGateMode,
497
- })
498
- ) {
499
- return "human-gated";
500
- }
523
+ if (hasUnreleasedHold(item, context)) return "human-gated";
501
524
  if (context.trusted.length > 0 && !isTrustedAuthor(item, context)) {
502
525
  return "untrusted-author";
503
526
  }
@@ -536,7 +559,7 @@ function compareWithinGroup(left, right) {
536
559
  * `blockers-unreadable` (CodySwannGT/lisa#5065); every other item is still
537
560
  * offered.
538
561
  * @param {readonly Record<string, any>[]} items - Normalized items
539
- * @param {{ me?: string | null, operators?: readonly unknown[], trustedAuthorIds?: readonly unknown[], humanNeededLabel?: string, humanOnly?: unknown, humanGateMode?: unknown }} [options]
562
+ * @param {OrderingOptions} [options]
540
563
  * @returns {{ ordered: Record<string, any>[], excluded: { ref: string, reason: string }[] }}
541
564
  */
542
565
  export function orderReadyQueue(items, options = {}) {
@@ -572,7 +595,7 @@ function unreadableBlockers(item) {
572
595
  * again, so it waits until someone edits it. Grouping and ordering match
573
596
  * {@link orderReadyQueue}.
574
597
  * @param {readonly Record<string, any>[]} items - Normalized items
575
- * @param {{ me?: string | null, operators?: readonly unknown[], trustedAuthorIds?: readonly unknown[], humanNeededLabel?: string, humanOnly?: unknown, humanGateMode?: unknown, validationFailures?: Readonly<Record<string, { updatedAt?: string }>> }} [options]
598
+ * @param {OrderingOptions & { validationFailures?: Readonly<Record<string, { updatedAt?: string }>> }} [options]
576
599
  * @returns {{ ordered: Record<string, any>[], excluded: { ref: string, reason: string }[] }}
577
600
  */
578
601
  export function orderBacklogQueue(items, options = {}) {
@@ -614,13 +637,15 @@ function configuredEntries(entries) {
614
637
 
615
638
  /**
616
639
  * The identities and policy every ordering judges against.
617
- * @param {{ me?: string | null, operators?: readonly unknown[], trustedAuthorIds?: readonly unknown[], humanNeededLabel?: string, humanOnly?: unknown, humanGateMode?: unknown }} options
640
+ * @param {OrderingOptions} options
618
641
  */
619
642
  function orderingContext(options) {
620
643
  return {
621
644
  me: idOrNull(options.me),
622
645
  operators: configuredEntries(options.operators),
623
646
  trusted: configuredEntries(options.trustedAuthorIds),
647
+ trustedHumanActorIds: options.trustedHumanActorIds,
648
+ commentsFor: options.commentsFor,
624
649
  humanNeededLabel: options.humanNeededLabel ?? DEFAULT_HUMAN_NEEDED_LABEL,
625
650
  humanOnly: options.humanOnly,
626
651
  humanGateMode: options.humanGateMode,
@@ -19,8 +19,7 @@ file in.
19
19
 
20
20
  Two things follow, and both are rules:
21
21
 
22
- - **Never work out a key or a marker yourself.** Copy them from the command's output. A key worked
23
- out by an agent can differ between two runs, and then the second run files a duplicate.
22
+ - **Copy each gap's key and marker exactly as printed.** A key worked out by an agent can differ between two runs, and then the second run files a duplicate.
24
23
  - **Never create a ticket any other way.** No direct tracker command, no vendor-specific writer.
25
24
  Every ticket goes through `lisa-tracker-write`.
26
25
 
@@ -124,7 +123,8 @@ the tickets with their descriptions and look through them for the key before dec
124
123
  **A ticket is this gap's ticket only when its description contains both `lisa-control-gap` and
125
124
  `key=<key>`.** Match on those two pieces of text and nothing else: never on the title, and never on
126
125
  `criterion=` or `scope=` alone. A tracker may show the brackets escaped, or change the spacing; the
127
- tag and the key come back unchanged.
126
+ tag and the key come back unchanged. Skip a parent marker when matching a gap, even if the
127
+ parent's description happens to mention the gap's key.
128
128
 
129
129
  If the search cannot be run (the tracker cannot be reached, or the credentials were refused), do
130
130
  not create anything for that entry. Its result is `blocked`, with a reason that says the tracker
@@ -151,10 +151,49 @@ first.
151
151
  **An existing ticket is never changed by this flow.** In particular, `build_ready=true` does not
152
152
  move a ticket that an earlier run filed on hold. It applies only to tickets this run creates.
153
153
 
154
+ ## Choose the parent
155
+
156
+ Do this once, just before the first new gap ticket. If all gaps already have tickets, there is
157
+ nothing to create. Use the canonical repository slug associated with the audit for
158
+ `<owner>/<repo>`, even when a JIRA project or Linear team tracks several repositories.
159
+
160
+ ~~~text
161
+ [lisa-control-gap-parent] repository=<owner>/<repo>
162
+ ~~~
163
+
164
+ 1. For Linear, use `lisa-linear-access operation: list-projects team:<team>` and read each open
165
+ Project with `get-project id:<ID>` to get its description and creation time. Use `list-issues`
166
+ only to match individual gap tickets in step 4.
167
+ - On GitHub, list repository issues labeled `type:Epic` through the REST endpoint
168
+ `repos/<owner>/<repo>/issues?state=open&labels=type%3AEpic&per_page=100`. Read through the
169
+ final page using `gh api --paginate --slurp` or the same endpoint's `Link` headers. Exclude
170
+ pull requests and read `body` and `created_at` from every issue.
171
+ - On Jira, use `lisa-atlassian-access operation: search-issues` with
172
+ `project = <project> AND issuetype = Epic AND statusCategory != Done`. Use an adapter that
173
+ exposes pagination and request `description` and `created`. Follow each `nextPageToken`
174
+ through the final page and read the marker from the description text.
175
+
176
+ For every tracker, finish reading the full list before selecting the parent. Check that each
177
+ candidate includes its description field and creation time. An explicit empty description has
178
+ no marker. If a read fails, a required field is absent, or a page repeats without advancing,
179
+ report the new gap tickets as blocked and file nothing. Match the full marker with the
180
+ repository slug. Use the oldest open match if there are several, and mention the others in the
181
+ summary.
182
+ 2. When there is no match, call `lisa-tracker-write` once to create an Epic (a Project in Linear)
183
+ titled **Missing capabilities found by the audit**. Say that it groups work found by the audit
184
+ for this repository. Include the parent marker as its own visible line. Give the writer the
185
+ container declaration `None — container: state rolls up from children` for the Target Backend
186
+ Environment section and leave the parent out of the build-ready queue. Read back the parent
187
+ through `lisa-tracker-read` and confirm the marker is present before filing children. If the
188
+ writer cannot create or verify it, report the new gap tickets as blocked and file no children.
189
+ 3. For each new gap ticket in step 5, pass the same reference as `parent_ref`. Later runs reuse the
190
+ open parent. Count only the gap tickets in step 7. Keep the gap marker and gap keys out of the
191
+ parent description so searches for a gap cannot mistake the parent for the ticket.
192
+
154
193
  ## Step 5: create the ticket
155
194
 
156
- Call `lisa-tracker-write` once for each entry that needs a ticket, with the content below. The
157
- writer lays the description out in its own sections and checks it. If it asks for more, give it
195
+ Call `lisa-tracker-write` once for each entry that needs a ticket, with the chosen `parent_ref` and the
196
+ content below. The writer lays the description out in its own sections and checks it. If it asks for more, give it
158
197
  what it asks for and call it again. Never file by another path because the writer refused.
159
198
 
160
199
  **Issue type:** `Task`.
@@ -203,7 +203,12 @@ If the item is **not an Epic** and **not a top-level Bug/Spike**, it MUST have a
203
203
  - **Story / Task / Improvement** → must have a `projectId` (the Epic Project) set.
204
204
  - **Sub-task** → must have a `parentId` (the Story Issue) set.
205
205
 
206
- If the parent is explicitly provided, use it. Otherwise:
206
+ For a Story, Task, Bug, Spike or Improvement, a caller's `parent_ref` names the
207
+ explicit Linear Project. Resolve it through `get-project` and pass the returned
208
+ ID as `projectId` to `save-issue`. If that Project cannot be resolved, stop
209
+ before saving. For a Sub-task, `parent_ref` names the parent Issue instead.
210
+
211
+ When there is no explicit parent, discover it:
207
212
 
208
213
  1. Search active Projects in the team:
209
214
  ```text
@@ -148,9 +148,12 @@ the manager.
148
148
  who filed the item, not what it says: an alarm or error ticket can quote text an outsider
149
149
  controls (an error message, a request path), and that text reaches the worker too.
150
150
  - **Who may release a hold is a separate list.** `sessionManager.trustedReleaseIds` names who may
151
- release a human hold in `blocked-plan` and the orphan sweep, and who may answer on the item; unset,
151
+ release a human hold in `queue`, `blocked-plan` and the orphan sweep, and who may answer on the item; unset,
152
152
  it falls back to `trustedAuthorIds`. It takes the same `id:` / `login:` / plain entries, never
153
- `integration:`, because an integration is not a person. With neither set, no hold is released.
153
+ `integration:`, because an integration is not a person. The GitHub `queue` resolves each `login:`
154
+ entry to an account ID before comparing comments. Use `id:` for the same identity across the
155
+ release commands and to keep trusting the account after a GitHub rename. With neither list set,
156
+ no hold is released.
154
157
  Removing `trustedAuthorIds` to dispatch integration-filed items would also remove every hold
155
158
  releaser; add `integration:<service>` instead.
156
159
 
@@ -784,6 +787,10 @@ Skip while `capacity` reports `paused`. Otherwise:
784
787
  `externalUserCreator { id }` and children with their state type. Ask for both author fields:
785
788
  without `externalUserCreator` an integration-filed item is never trusted by an
786
789
  `integration:` entry, because an outside user may have filed it.
790
+ Fetch every page of comments for held items in both tiers. Include Linear comment `body`,
791
+ `user { id }`, and provider bot metadata in `comments.nodes`. For Jira include each comment's
792
+ body and `author` with its `accountId` and `accountType` in `fields.comment.comments`. The
793
+ queue checks release markers against the configured hold releasers and excludes bot comments.
787
794
  - `ordered` is the dispatch order: assigned to an operator, then to "me", then unassigned; each
788
795
  group by priority, then age. `excluded` needs no action. `setupGaps` lists each repo the
789
796
  manager will not dispatch to until the operator fixes it (`kind`, `detail`, and `clear`, the
@@ -30,6 +30,7 @@
30
30
  * @module session-manager/cli-queue
31
31
  */
32
32
  import {
33
+ adfText,
33
34
  assertPagedToCompletion,
34
35
  normalizeJiraIssue,
35
36
  normalizeLinearIssue,
@@ -44,14 +45,22 @@ import {
44
45
  validOrAbsent,
45
46
  } from "./cli-runtime.mjs";
46
47
  import { resolveHumanGatePolicy } from "../../../scripts/human-gate-act.mjs";
48
+ import { idComparableValues } from "../../../scripts/operator-id-kinds.mjs";
49
+ import { commentsOf } from "../../../scripts/stale-blocker-comment.mjs";
47
50
  import {
48
51
  landedDoneRoles,
49
52
  terminalDoneRoles,
50
53
  } from "../../../scripts/stale-blocker-edges.mjs";
54
+ import { trustedReleaseEntries } from "./config.mjs";
51
55
  import { readJsonFile } from "./json-input.mjs";
52
56
  import { readLedger } from "./ledger.mjs";
53
57
  import { blockingGapRepo, listSetupGaps } from "./ledger-setup-gaps.mjs";
54
- import { fetchGithubBacklog, fetchGithubQueue } from "./queue-github.mjs";
58
+ import {
59
+ fetchGithubBacklog,
60
+ fetchGithubQueue,
61
+ githubReleaserIds,
62
+ } from "./queue-github.mjs";
63
+ import { readIssueComments } from "./stale-links-github.mjs";
55
64
  import { readInFlight, readRestores } from "./stale-links-state.mjs";
56
65
 
57
66
  export { parseJson, readJsonFile } from "./json-input.mjs";
@@ -65,17 +74,20 @@ const NORMALIZERS = { jira: normalizeJiraIssue, linear: normalizeLinearIssue };
65
74
  * @param {"jira"|"linear"} tracker - Vendor
66
75
  * @param {readonly string[]} doneRoles - Configured terminal done names, so
67
76
  * a blocker there counts as finished (#5065)
68
- * @returns {{ items: object[], pages: unknown }} Normalized items
77
+ * @returns {{ items: object[], pages: unknown, rawByRef: Map<string, object> }} Normalized items
69
78
  */
70
79
  function normalizeEnvelope(envelope, where, tracker, judging) {
71
80
  asSetupError(() => assertPagedToCompletion(envelope));
72
81
  if (!Array.isArray(envelope.items)) {
73
82
  throw new CliError(`${where}: items must be an array.`, 2);
74
83
  }
75
- return {
76
- items: envelope.items.map(item => NORMALIZERS[tracker](item, judging)),
77
- pages: envelope.pages ?? null,
78
- };
84
+ const rawByRef = new Map();
85
+ const items = envelope.items.map(raw => {
86
+ const item = NORMALIZERS[tracker](raw, judging);
87
+ rawByRef.set(item.ref, raw);
88
+ return item;
89
+ });
90
+ return { items, pages: envelope.pages ?? null, rawByRef };
79
91
  }
80
92
 
81
93
  /**
@@ -86,7 +98,7 @@ function normalizeEnvelope(envelope, where, tracker, judging) {
86
98
  * @param {"jira"|"linear"} tracker - Vendor
87
99
  * @param {boolean} withBacklog - Whether the backlog tier is required
88
100
  * @param {ReturnType<typeof loadProject>} project - Loaded project
89
- * @returns {{ items: object[], pages: unknown, backlog: { items: object[], pages: unknown } | null }} Normalized items
101
+ * @returns {ReturnType<typeof normalizeEnvelope> & { backlog: ReturnType<typeof normalizeEnvelope> | null }} Normalized items
90
102
  */
91
103
  function readEnvelopeQueue(ctx, tracker, withBacklog, project) {
92
104
  const file = ctx.values.input;
@@ -239,7 +251,7 @@ export async function queue(ctx) {
239
251
  const project = loadProject(ctx.root);
240
252
  const config = validOrAbsent(project);
241
253
  const backlogPickup = config?.backlogPickup === true;
242
- const { items, pages, backlog } =
254
+ const { items, pages, backlog, rawByRef } =
243
255
  tracker === "github"
244
256
  ? {
245
257
  ...fetchGithubQueue(ctx, project),
@@ -252,10 +264,22 @@ export async function queue(ctx) {
252
264
  // Resolved local-then-global like `human-gate-act.mjs policy`, so a hold
253
265
  // the project's mode keeps is never dispatched as Ready work (#4687).
254
266
  const gatePolicy = resolveHumanGatePolicy(project.local, project.global);
267
+ const releasers = trustedReleaseEntries(config);
255
268
  const policy = {
256
269
  me,
257
270
  operators,
258
271
  trustedAuthorIds: config?.trustedAuthorIds ?? undefined,
272
+ trustedHumanActorIds:
273
+ tracker === "github"
274
+ ? githubReleaserIds(ctx, releasers)
275
+ : idComparableValues(releasers),
276
+ commentsFor:
277
+ tracker === "github"
278
+ ? ref => readIssueComments(ctx, ref)
279
+ : ref =>
280
+ commentsOf(rawByRef?.get(ref) ?? backlog?.rawByRef?.get(ref)).map(
281
+ comment => ({ ...comment, body: adfText(comment.body) })
282
+ ),
259
283
  humanNeededLabel: humanNeededLabel(project, tracker),
260
284
  humanOnly: gatePolicy.humanOnly,
261
285
  humanGateMode: gatePolicy.mode,
@@ -10,12 +10,16 @@ import {
10
10
  labelNames,
11
11
  normalizeGithubIssue,
12
12
  } from "../../../scripts/ready-queue-order.mjs";
13
+ import {
14
+ idComparableValues,
15
+ parseIdEntries,
16
+ } from "../../../scripts/operator-id-kinds.mjs";
13
17
  import { resolveRole } from "../../../scripts/resolve-lifecycle-role.mjs";
14
18
  import {
15
19
  landedDoneRoles,
16
20
  terminalDoneRoles,
17
21
  } from "../../../scripts/stale-blocker-edges.mjs";
18
- import { CliError, mustRun } from "./cli-runtime.mjs";
22
+ import { CliError, mustRun, run } from "./cli-runtime.mjs";
19
23
  import { parseJson } from "./json-input.mjs";
20
24
  import {
21
25
  blockerReader,
@@ -26,6 +30,45 @@ import { scrubWorkerEnv } from "./workers.mjs";
26
30
 
27
31
  const OWNER_REPO = /^[\w.-]+\/[\w.-]+$/;
28
32
 
33
+ /**
34
+ * Resolve configured GitHub logins to provider account IDs for hold releases.
35
+ * A failed or mismatched lookup authorizes nobody for that entry.
36
+ * @param {object} ctx - CLI context
37
+ * @param {unknown} entries - Configured release identities
38
+ * @returns {string[]} Account IDs to compare with native comment authorship
39
+ */
40
+ export function githubReleaserIds(ctx, entries) {
41
+ const logins = new Set(
42
+ parseIdEntries(entries)
43
+ .filter(
44
+ entry => entry.kind === "login" && /^[A-Za-z0-9_-]+$/u.test(entry.value)
45
+ )
46
+ .map(entry => entry.value.toLowerCase())
47
+ );
48
+ const ids = idComparableValues(entries);
49
+ const env = scrubWorkerEnv(ctx.env);
50
+ for (const login of logins) {
51
+ const endpoint = `users/${login}`;
52
+ const result = run("gh", ["api", endpoint], { env });
53
+ if (result.status !== 0) continue;
54
+ try {
55
+ const account = parseJson(result.stdout, endpoint);
56
+ if (
57
+ account?.type === "User" &&
58
+ typeof account.login === "string" &&
59
+ account.login.toLowerCase() === login &&
60
+ Number.isSafeInteger(account.id) &&
61
+ account.id > 0
62
+ ) {
63
+ ids.push(String(account.id));
64
+ }
65
+ } catch {
66
+ // An unreadable account does not authorize a release.
67
+ }
68
+ }
69
+ return ids;
70
+ }
71
+
29
72
  /**
30
73
  * The GitHub repo to read: `--github-repo`, else github.org/github.repo.
31
74
  * @param {object} ctx - CLI context
@@ -107,6 +107,19 @@ export function withBlockers(ctx, repo, row, blocker) {
107
107
  return { ...row, nativeBlockers, bodyBlockers };
108
108
  }
109
109
 
110
+ /**
111
+ * Read all native issue comments with GitHub's author metadata.
112
+ * @param {object} ctx - CLI context
113
+ * @param {string} ref - GitHub issue reference
114
+ * @returns {object[] | null} Comments, or null when the read fails
115
+ */
116
+ export function readIssueComments(ctx, ref) {
117
+ const [repo, number] = ref.split("#");
118
+ return readOrUnreadable(() =>
119
+ listAll(ctx, `repos/${repo}/issues/${number}/comments?per_page=100`)
120
+ );
121
+ }
122
+
110
123
  /**
111
124
  * One issue with its blockers and comments, as the plan reads it.
112
125
  * @param {object} ctx - CLI context
@@ -119,9 +132,7 @@ function staleLinkItem(ctx, repo, row, blocker) {
119
132
  const enriched = readOrUnreadable(() =>
120
133
  withBlockers(ctx, repo, row, blocker)
121
134
  );
122
- const comments = readOrUnreadable(() =>
123
- listAll(ctx, `repos/${repo}/issues/${row.number}/comments?per_page=100`)
124
- );
135
+ const comments = readIssueComments(ctx, `${repo}#${row.number}`);
125
136
  // probe-direction: fail-closed — a candidate whose dependency list or
126
137
  // comments could not be read gets `nativeBlockers: null`, which the plan
127
138
  // reads as "blocker list not read": it is reported and nothing of it is
@@ -170,6 +170,10 @@ things somewhere in the file:
170
170
  `test_name`, `fullName`, or ` > ` (space, greater-than, space, as in
171
171
  `file > suite > test`).
172
172
 
173
+ RSpec console logs can also provide a full summary line such as `38 examples, 0 failures, 9 pending`.
174
+ The example count must be positive. Capture RSpec with a console formatter such as
175
+ `--format documentation`.
176
+
173
177
  A log snippet needs a timestamp whose date is written `YYYY-MM-DD`, followed by
174
178
  `T` or a space and the time, for example `2026-11-13T08:00:01` or
175
179
  `2026-11-13 08:00:01`. Syslog-style dates (`Nov 13 08:00:01`) and epoch numbers
@@ -160,6 +160,8 @@
160
160
  * @module scripts/check-nightly-e2e-health
161
161
  */
162
162
 
163
+ import { lstatSync } from "node:fs";
164
+ import { join } from "node:path";
163
165
  import { invokedAsScript } from "./lib/invoked-as-script.mjs";
164
166
 
165
167
  /**
@@ -1225,7 +1227,7 @@ export function assessSuiteScope(suite, scope) {
1225
1227
  * anyone claiming the contract changed.
1226
1228
  *
1227
1229
  * @param {object} suite - A validated suite entry
1228
- * @param {object} observation - `{ run, jobs, workflowMissing }`
1230
+ * @param {object} observation - `{ run, jobs, workflowMissing, workflowUnregistered }`
1229
1231
  * @param {{branch: string, freshnessHours: number, now: Date}} context - Evaluation context
1230
1232
  * @returns {{label: string, state: string, reason: string, conclusion: string|null, url: string|null, createdAt: string|null, event: string|null}} The finding
1231
1233
  */
@@ -1332,6 +1334,15 @@ export function assessSuite(suite, observation, context) {
1332
1334
  };
1333
1335
  }
1334
1336
 
1337
+ if (observation.workflowUnregistered) {
1338
+ return {
1339
+ ...base,
1340
+ ...blank,
1341
+ state: SUITE_STATES.unknown,
1342
+ reason: "workflow_not_registered",
1343
+ };
1344
+ }
1345
+
1335
1346
  const run = observation.run ?? null;
1336
1347
  if (!run) {
1337
1348
  return { ...base, ...blank, state: SUITE_STATES.unknown, reason: "no_run" };
@@ -2039,6 +2050,8 @@ const STATE_MARKERS = Object.freeze({
2039
2050
  const REASON_TEXT = Object.freeze({
2040
2051
  workflow_not_found:
2041
2052
  "the workflow file this gate watches does not exist any more. Someone renamed or deleted the suite out from under the gate — fix the `suites` table or restore the workflow.",
2053
+ workflow_not_registered:
2054
+ "GitHub returned 404 for the workflow file in the checkout. Run the suite once GitHub registers it.",
2042
2055
  no_run: "no completed run on this branch at all.",
2043
2056
  stale_run: "no completed run inside the freshness window.",
2044
2057
  wrong_branch: "the run this gate scored is on a different branch.",
@@ -3689,6 +3702,16 @@ async function selectScoredRun(
3689
3702
  };
3690
3703
  }
3691
3704
 
3705
+ /** Check for a regular workflow file in the checkout being evaluated. */
3706
+ function workflowInCheckout(workflow) {
3707
+ return (
3708
+ /^[^/\\]+\.ya?ml$/u.test(workflow) &&
3709
+ lstatSync(join(".github", "workflows", workflow), {
3710
+ throwIfNoEntry: false,
3711
+ })?.isFile() === true
3712
+ );
3713
+ }
3714
+
3692
3715
  /**
3693
3716
  * Observes every suite.
3694
3717
  *
@@ -3712,7 +3735,10 @@ export async function observe(api, suites, branch, context, wait) {
3712
3735
  wait
3713
3736
  );
3714
3737
  if (missing) {
3715
- return { workflowMissing: true, run: null, jobs: [] };
3738
+ const availability = workflowInCheckout(suite.workflow)
3739
+ ? { workflowUnregistered: true }
3740
+ : { workflowMissing: true };
3741
+ return { ...availability, run: null, jobs: [] };
3716
3742
  }
3717
3743
  // Jobs are read for EVERY match mode, `run` included. A run-scoped suite
3718
3744
  // needs them to prove the run was complete (row 26) — a `success` run
@@ -264,7 +264,7 @@ function compareK6(relPath, base, current) {
264
264
  }
265
265
 
266
266
  /**
267
- * Compare .lisa.config.json allow lists: report every added exception entry.
267
+ * Compare .lisa.config.json allow lists: report new or edited exceptions.
268
268
  *
269
269
  * The finding says only what was added, and carries the entry. Whether an
270
270
  * added entry is accepted or refused is {@link settleAddedExceptions}' call,
@@ -273,15 +273,15 @@ function compareK6(relPath, base, current) {
273
273
  * @param {string} relPath Repo-relative path
274
274
  * @param {unknown} base Parsed baseline config
275
275
  * @param {unknown} current Parsed current config
276
- * @returns {Finding[]} One finding per newly added allow entry
276
+ * @returns {Finding[]} One finding per new or edited allow entry
277
277
  */
278
278
  function compareAllowList(relPath, base, current) {
279
- const baseKeys = new Set(
280
- extractAllowEntries(base).map(e => `${e.file} ${e.key}`)
281
- );
279
+ const identity = ({ file, key, reason, until }) =>
280
+ JSON.stringify({ file, key, reason, until });
281
+ const previous = new Set(extractAllowEntries(base).map(identity));
282
282
  const findings = [];
283
283
  for (const entry of extractAllowEntries(current)) {
284
- if (!baseKeys.has(`${entry.file} ${entry.key}`)) {
284
+ if (!previous.has(identity(entry))) {
285
285
  findings.push({
286
286
  file: relPath,
287
287
  key: `thresholdRatchet.allow ${entry.file}#${entry.key}`,
@@ -815,7 +815,12 @@ function compareHumanGateMode(relPath, baselineText, currentText) {
815
815
  */
816
816
  export function compareFile(relPath, baselineText, currentText) {
817
817
  const family = familyFor(relPath);
818
- if (!family || baselineText === null || baselineText === undefined) return [];
818
+ if (!family) return [];
819
+ if (baselineText === null || baselineText === undefined) {
820
+ return family.kind === KIND_ALLOW_LIST
821
+ ? compareAllowList(relPath, undefined, parseJson(currentText))
822
+ : [];
823
+ }
819
824
 
820
825
  if (currentText === null || currentText === undefined) {
821
826
  // Deleting an allow list grants nothing, so that half stays silent. The
@@ -863,13 +868,14 @@ export function compareFile(relPath, baselineText, currentText) {
863
868
  // separates absent from present-but-unreadable with `cat-file -e` before
864
869
  // calling.
865
870
  //
866
- // The allow-list carve-out is symmetric with the current side and holds for
867
- // the same reason: an allow list nobody can read grants no exceptions, so an
868
- // unreadable one on either side already fails closed. Reporting it would
869
- // block every change touching the file without making anything safer.
871
+ // An unreadable baseline allow list grants no exceptions. A repaired config
872
+ // must record each current exception through the same check as a new entry.
870
873
  if (base === undefined) {
871
874
  return family.kind === KIND_ALLOW_LIST
872
- ? compareHumanGateMode(relPath, baselineText, currentText)
875
+ ? [
876
+ ...compareHumanGateMode(relPath, baselineText, currentText),
877
+ ...compareAllowList(relPath, undefined, current),
878
+ ]
873
879
  : [unparseableBaseline(relPath)];
874
880
  }
875
881
  if (current === undefined) {