@attalabs/vinaya 0.37.0 → 0.38.0

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 (174) hide show
  1. package/aeg-root/enforcement.md +5 -4
  2. package/aeg-root/roles/developer/reference.md +24 -22
  3. package/aeg-root/roles/developer.md +4 -4
  4. package/aeg-root/roles/planner/reference.md +11 -0
  5. package/aeg-root/roles/reviewer.md +5 -3
  6. package/aeg-root/roles/security.md +3 -2
  7. package/aeg-root/state-machine.md +1 -1
  8. package/aeg-root/templates/brief-template.md +4 -4
  9. package/aeg-root/tranche-model.md +6 -0
  10. package/dist/checks/bin/check-body-bare-digits.js +139 -12
  11. package/dist/checks/bin/check-branch-topology.js +171 -13
  12. package/dist/checks/bin/check-brief-shape.js +139 -12
  13. package/dist/checks/bin/check-changeset-coverage.js +177 -17
  14. package/dist/checks/bin/check-closes-n.js +171 -13
  15. package/dist/checks/bin/check-coherence.js +171 -13
  16. package/dist/checks/bin/check-dead-branch-push.js +139 -12
  17. package/dist/checks/bin/check-dispatch-readiness.js +195 -23
  18. package/dist/checks/bin/check-doc-coverage-push.js +173 -13
  19. package/dist/checks/bin/check-doc-coverage.js +180 -13
  20. package/dist/checks/bin/check-doctrine-no-procedures.js +139 -12
  21. package/dist/checks/bin/check-doctrine-portability.js +173 -13
  22. package/dist/checks/bin/check-evidence-fresh.js +173 -13
  23. package/dist/checks/bin/check-exec-bits.js +173 -13
  24. package/dist/checks/bin/check-first-push-dispatch.js +171 -13
  25. package/dist/checks/bin/check-issue-assignment.js +171 -13
  26. package/dist/checks/bin/check-issue-milestone-attach.js +139 -12
  27. package/dist/checks/bin/check-issue-objectives-numbering.js +139 -12
  28. package/dist/checks/bin/check-issue-parts-coverage.js +139 -12
  29. package/dist/checks/bin/check-issue-surface-globs.js +171 -13
  30. package/dist/checks/bin/check-issue-title-grammar.js +139 -12
  31. package/dist/checks/bin/check-issue-tranche-label.js +139 -12
  32. package/dist/checks/bin/check-main-branch-refusal.js +139 -12
  33. package/dist/checks/bin/check-no-disk-state.js +139 -12
  34. package/dist/checks/bin/check-pr-premise-reassert.js +139 -12
  35. package/dist/checks/bin/check-pr-report-density.js +139 -12
  36. package/dist/checks/bin/check-principal-test-plan-wait.js +139 -12
  37. package/dist/checks/bin/check-quoted-command.js +173 -13
  38. package/dist/checks/bin/check-reader-resolvable-prose.js +173 -13
  39. package/dist/checks/bin/check-registry-gates.js +406 -68
  40. package/dist/checks/bin/check-retired-vocabulary.js +173 -13
  41. package/dist/checks/bin/check-review-gate.js +139 -12
  42. package/dist/checks/bin/check-single-plan-pr.js +139 -12
  43. package/dist/checks/bin/check-surface-scope.js +171 -13
  44. package/dist/checks/bin/check-test-plan.js +139 -12
  45. package/dist/checks/bin/check-token-collection-wired.js +139 -12
  46. package/dist/checks/bin/check-workspace-escape.js +173 -13
  47. package/dist/checks/bin/verify-dispatch.js +3849 -0
  48. package/dist/index.js +7348 -2095
  49. package/dist/lib/pre-push-cache-test-run.js +42 -2
  50. package/dist/lib/pre-push-changed-files.js +16 -11
  51. package/dist/lib/pre-push-select-tests.js +177 -21
  52. package/package.json +1 -1
  53. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/anchored-region.ts +7 -6
  54. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-render.ts +33 -15
  55. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-validation.ts +51 -12
  56. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/index.ts +1 -0
  57. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/local.ts +31 -0
  58. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/records.ts +31 -2
  59. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts +214 -24
  60. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/fakes.ts +11 -3
  61. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/index.ts +5 -4
  62. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/journal-reconstruction.ts +13 -13
  63. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/render-summary.ts +46 -145
  64. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/types.ts +63 -14
  65. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/index.ts +3 -1
  66. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/published-prose.ts +30 -0
  67. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doctrine-portability.ts +6 -2
  68. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/gate-audience.ts +0 -1
  69. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/index.ts +56 -7
  70. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-validation.ts +7 -7
  71. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/leftover-detection.ts +24 -6
  72. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/custom.ts +157 -0
  73. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/envelope.ts +44 -6
  74. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/executions.ts +493 -0
  75. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/fact-sheets.ts +111 -0
  76. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/generator.ts +155 -0
  77. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/index.ts +12 -0
  78. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/index.ts +128 -0
  79. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/catches.ts +63 -0
  80. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/checks.ts +146 -0
  81. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/common.ts +137 -0
  82. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/completion.ts +137 -0
  83. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/convergence.ts +420 -0
  84. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/determinism.ts +65 -0
  85. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/index.ts +69 -0
  86. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/judgment.ts +132 -0
  87. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/labels.ts +21 -0
  88. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/time.ts +167 -0
  89. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/usage.ts +139 -0
  90. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema.ts +219 -15
  91. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/store.ts +7 -7
  92. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/cache-contract.ts +207 -0
  93. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/contracts.ts +105 -0
  94. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/engine.ts +308 -0
  95. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/index.ts +34 -0
  96. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/measured.ts +20 -0
  97. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/memory-cache.ts +78 -0
  98. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/normalize.ts +156 -0
  99. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/row.ts +103 -0
  100. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/reader-resolvable-prose.ts +34 -6
  101. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/registry-checks.ts +70 -6
  102. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-input-manifest.ts +19 -14
  103. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-policy.ts +38 -3
  104. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-status.ts +5 -2
  105. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-phase-history.ts +46 -0
  106. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-tools.ts +15 -28
  107. package/studio-standalone/apps/vinaya-studio/web/.next/BUILD_ID +1 -1
  108. package/studio-standalone/apps/vinaya-studio/web/.next/build-manifest.json +3 -3
  109. package/studio-standalone/apps/vinaya-studio/web/.next/prerender-manifest.json +3 -3
  110. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  111. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.html +1 -1
  112. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.rsc +1 -1
  113. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  114. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  115. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  116. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  117. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  118. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page/server-reference-manifest.json +2 -2
  119. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  120. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  121. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page/server-reference-manifest.json +2 -2
  122. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js.nft.json +1 -1
  123. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page_client-reference-manifest.js +1 -1
  124. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page/server-reference-manifest.json +2 -2
  125. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js.nft.json +1 -1
  126. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page_client-reference-manifest.js +1 -1
  127. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page/server-reference-manifest.json +2 -2
  128. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js.nft.json +1 -1
  129. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page_client-reference-manifest.js +1 -1
  130. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page/server-reference-manifest.json +2 -2
  131. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js.nft.json +1 -1
  132. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page_client-reference-manifest.js +1 -1
  133. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page/server-reference-manifest.json +3 -3
  134. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js.nft.json +1 -1
  135. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page_client-reference-manifest.js +1 -1
  136. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page/server-reference-manifest.json +2 -2
  137. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js.nft.json +1 -1
  138. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  139. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page/server-reference-manifest.json +2 -2
  140. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js.nft.json +1 -1
  141. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page_client-reference-manifest.js +1 -1
  142. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page/server-reference-manifest.json +2 -2
  143. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js.nft.json +1 -1
  144. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page_client-reference-manifest.js +1 -1
  145. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/1q96_modules_@clerk_nextjs_dist_esm_app-router_client_keyless-creator-reader_0lom2js.js +1 -1
  146. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__04adkz-._.js +1 -1
  147. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__08e39jo._.js +1 -1
  148. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0h9yhwx._.js +1 -1
  149. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__14ui9sz._.js → [root-of-the-server]__0jdjsxe._.js} +1 -1
  150. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ls23oh._.js +1 -1
  151. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1gjqmhq._.js +1 -1
  152. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1wc4-ip._.js +1 -1
  153. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_08onyya._.js +1 -1
  154. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_096f46i._.js +1 -1
  155. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0af2one._.js +1 -1
  156. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0e5tkdd._.js +1 -1
  157. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0kf2g72._.js +1 -1
  158. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0zf4d27._.js +1 -1
  159. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1-wo68i._.js +1 -1
  160. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1achbh9._.js +1 -1
  161. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/node_modules_@clerk_nextjs_dist_esm_app-router_server-actions_1x7vfhn.js +2 -2
  162. package/studio-standalone/apps/vinaya-studio/web/.next/server/middleware-build-manifest.js +3 -3
  163. package/studio-standalone/apps/vinaya-studio/web/.next/server/pages/500.html +1 -1
  164. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.js +1 -1
  165. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.json +4 -4
  166. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1-acpmtfmrc35.js +1 -0
  167. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3qtt1v3ya-ofe.js → 2f2y8xxok8zph.js} +1 -1
  168. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3l56x8wjdzvaw.js → 2xevgia1h8g0y.js} +4 -4
  169. package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
  170. package/dist/checks/bin/check-token-report.js +0 -6526
  171. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0vtfb0g813gki.js +0 -1
  172. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{yR5RsCxb1OGnYggiaO09S → yNZEFRSjP9BLUfdf96Eol}/_buildManifest.js +0 -0
  173. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{yR5RsCxb1OGnYggiaO09S → yNZEFRSjP9BLUfdf96Eol}/_clientMiddlewareManifest.js +0 -0
  174. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{yR5RsCxb1OGnYggiaO09S → yNZEFRSjP9BLUfdf96Eol}/_ssgManifest.js +0 -0
@@ -35,23 +35,23 @@
35
35
  * what the numbering and the "already published?" decision need.
36
36
  */
37
37
 
38
- import { SEVERITY_COLUMNS, type RoundRecord } from './types'
38
+ import type { RoundRecord } from './types'
39
39
 
40
40
  /**
41
- * The published summary's own header row, byte-for-byte as `render-summary.ts`
42
- * emits it — both derived from `SEVERITY_COLUMNS`, so the detector here and
43
- * the renderer there can never drift about what a summary comment looks like.
44
- * A principal-authored comment carrying this line is the ready-for-merge
45
- * summary itself: the one honest "the summary was actually published" signal,
41
+ * The published marker line — `<!-- aeg:loop:published head=<sha>
42
+ * confidence=<round>:<cell>,… -->`, as `render-summary.ts` emits it. A
43
+ * principal-authored comment carrying this line is the ready-for-merge
44
+ * publication itself: the one honest "the loop actually published" signal,
46
45
  * distinct from a round merely deciding `publish` (the control store's own
47
46
  * `loop_state.phase === 'publish'` is written before `publishRound` runs, so
48
- * it can never stand in for this).
47
+ * it can never stand in for this). Group 1 is the published head, group 2 the
48
+ * confidence entries.
49
49
  */
50
- export const SUMMARY_TABLE_HEADER = `| round | ${SEVERITY_COLUMNS.join(' | ')} | confidence | outcome |`
50
+ export const PUBLISHED_MARKER_LINE = /^<!-- aeg:loop:published head=([0-9a-f]{7,64}) confidence=([^\s]*) -->$/
51
51
 
52
- /** True when `body` is (or contains, verbatim on its own line) the published summary's header — the caller has already confirmed the comment is principal-authored. */
52
+ /** True when `body` carries the published marker verbatim on its own line — the caller has already confirmed the comment is principal-authored. */
53
53
  export function isPublishedSummaryComment(body: string): boolean {
54
- return body.split('\n').some((line) => line.trim() === SUMMARY_TABLE_HEADER)
54
+ return body.split('\n').some((line) => PUBLISHED_MARKER_LINE.test(line.trim()))
55
55
  }
56
56
 
57
57
  /**
@@ -112,15 +112,15 @@ export type ReconstructedJournal = {
112
112
  reviewGate: ReviewGateFact
113
113
  /**
114
114
  * `{ result: 'merged_ready' }` while a principal-authored ready-for-merge
115
- * summary comment is actually on the forge AND the review gate has not
115
+ * publication comment is actually on the forge AND the review gate has not
116
116
  * FAILED against the pull request's CURRENT state (`ReviewGateFact`, whose
117
117
  * own doc explains why an `'unknown'` gate is not a reopen). Concluded is a
118
118
  * property of the pull request now, not a one-way latch it once passed
119
119
  * through.
120
120
  *
121
121
  * The summary alone was the old signal, and it is sticky in a way the forge
122
- * is not: the summary table records no head, so a summary posted for an
123
- * older head keeps reading "done forever" after a red gate, a newer
122
+ * is not: the published marker comment is never edited, so a publication posted
123
+ * for an older head keeps reading "done forever" after a red gate, a newer
124
124
  * Principal ruling, a superseded brief or a moved head — observed on an
125
125
  * adopter pull request whose every `--resume` was refused while the gate was
126
126
  * red and a ruling sat unaddressed. The gate is the one evaluation already
@@ -1,181 +1,82 @@
1
1
  /**
2
- * `renderSummary(journal)` — the publication comment. One markdown table, rows per round, counts and the
3
- * outcome only — no finding prose, and no line either verdict extractor
4
- * (`../verdict-extraction`) would read as a real verdict: no `VERDICT:`,
5
- * `Judged head:`, or `Objectives version:` label anywhere in the output.
2
+ * `renderPublishedMarker(journal, head)` — the publication comment. A single
3
+ * HTML comment line, invisible on the pull request, carrying what the loop's
4
+ * own readers need: that the loop published, the head it published, and each
5
+ * round's confidence. The round table is not posted — the Vinaya Log is the
6
+ * record of each round's findings and outcome. The line carries no `VERDICT:`,
7
+ * `Judged head:`, or `Objectives version:` label, so neither verdict extractor
8
+ * (`../verdict-extraction`) can read it as a real verdict.
6
9
  */
7
10
 
8
- import { DEFERRAL_REASON_TEXT } from '../review-policy'
9
- import { SUMMARY_TABLE_HEADER } from './journal-reconstruction'
10
- import {
11
- SEVERITY_COLUMNS,
12
- type Confidence,
13
- type DeferredFindingRow,
14
- type Journal,
15
- type NotReviewedReason,
16
- type RoundRecord
17
- } from './types'
11
+ import { PUBLISHED_MARKER_LINE } from './journal-reconstruction'
12
+ import type { Confidence, Journal } from './types'
18
13
 
19
- /**
20
- * The two non-numeric cells this table writes, named once so the parser below
21
- * reads the same literals the renderer wrote. They are DIFFERENT facts: the
22
- * loop never asked this round for a confidence at all (round 1 never is), or
23
- * it asked and the developer stated nothing readable.
24
- *
25
- * `CONFIDENCE_NOT_ASKED_CELL`'s glyph is also the count columns' own
26
- * "nothing to report" cell (`countCells` below) — one glyph for one meaning
27
- * across the table, rather than a second literal saying the same thing. Only
28
- * the confidence column is read back out of a posted table, so the shared
29
- * glyph never makes a count cell parseable as a confidence.
30
- */
31
- export const CONFIDENCE_NOT_ASKED_CELL = '—'
14
+ /** The cell a round the loop never asked for a confidence at all (round 1 never is) writes. */
15
+ export const CONFIDENCE_NOT_ASKED_CELL = '-'
16
+ /** The cell a round that was asked, with no readable statement, writes. */
32
17
  export const CONFIDENCE_ABSENT_CELL = 'absent'
33
18
 
34
- /** The highest percentage this table ever records — the same ceiling `CONFIDENCE_LINE`'s own `0-100` grammar accepts, named here because the parser below refuses a row that exceeds it. */
19
+ /** The highest percentage the marker ever records — the same ceiling `CONFIDENCE_LINE`'s own `0-100` grammar accepts, named here because the parser below refuses a figure that exceeds it. */
35
20
  export const CONFIDENCE_MAX_PERCENT = 100
36
21
 
37
22
  function confidenceCell(confidence: Confidence | null): string {
38
23
  if (confidence === null) return CONFIDENCE_NOT_ASKED_CELL
39
24
  if (confidence === 'absent') return CONFIDENCE_ABSENT_CELL
40
- return `${confidence.value}%`
41
- }
42
-
43
- /**
44
- * One round's count cells — numbers when the loop recorded this round's
45
- * findings, the not-reported glyph when it never recorded them at all.
46
- *
47
- * A round the loop ASSESSED records every severity column, zeros included
48
- * (`buildRoundRecord`, `assess-round.ts`), so a record carrying none of them
49
- * is one whose counts have no source. Two kinds carry none: a round rebuilt
50
- * from the pull request's own round markers after a restart, which name a
51
- * round's number and head and carry no finding breakdown at all
52
- * (`journal-reconstruction.ts`); and a round no reviewer ever saw — its gate
53
- * was red, or a low confidence sent the developer back — which records no
54
- * counts on purpose (`buildUnreviewedRecord`, `assess-round.ts`) and names why
55
- * in its outcome cell (`outcomeCell` below). Writing `0` for those cells told a
56
- * reader the round was clean — four rounds of a real task's published table
57
- * read as zero findings when the truth was that nobody knew, and an unreviewed
58
- * round read as a clean review that never ran. The distinction is whether the
59
- * counts were recorded, never whether they are zero: a round the loop assessed
60
- * and found nothing in still reads `0`, because that zero is a measurement.
61
- */
62
- function countCells(record: RoundRecord): string[] {
63
- const recorded = SEVERITY_COLUMNS.some((key) => record.countsBySeverity[key] !== undefined)
64
- if (!recorded) return SEVERITY_COLUMNS.map(() => CONFIDENCE_NOT_ASKED_CELL)
65
- return SEVERITY_COLUMNS.map((key) => String(record.countsBySeverity[key] ?? 0))
66
- }
67
-
68
- /**
69
- * The outcome cell. A round the loop assessed (or one rebuilt from a marker)
70
- * prints its own `outcome` verbatim — the vocabulary `render-summary.test.ts`
71
- * pins (`green`, `changes_requested`, `escalated`, `stopped`). A round no
72
- * reviewer saw (`notReviewed` set, `buildUnreviewedRecord` in
73
- * `assess-round.ts`) instead states that no review ran and why, so a reader
74
- * never takes its `—` counts for a clean round the way the old `0` /
75
- * `changes_requested` row read.
76
- */
77
- const NOT_REVIEWED_REASON_TEXT: Record<NotReviewedReason, string> = {
78
- checks_red: 'checks red',
79
- low_confidence: 'low confidence',
80
- mechanical_failure: 'mechanical failure'
81
- }
82
-
83
- function outcomeCell(record: RoundRecord): string {
84
- if (record.notReviewed !== undefined) return `not reviewed — ${NOT_REVIEWED_REASON_TEXT[record.notReviewed]}`
85
- return record.outcome
86
- }
87
-
88
- function row(record: RoundRecord): string {
89
- return `| ${record.round} | ${countCells(record).join(' | ')} | ${confidenceCell(record.confidence)} | ${outcomeCell(record)} |`
90
- }
91
-
92
- /** The heading that opens the deferred-findings block, so a reader (and a test) can find it without matching a whole line. */
93
- export const DEFERRED_FINDINGS_HEADING = 'Deferred findings (reported, not blocking this round):'
94
-
95
- /** One deferred finding as the summary lists it (O4): its original severity, its `file:line` (or `(no location)` when it carried none), and why. */
96
- export function renderDeferredFindingLine(round: number, f: DeferredFindingRow): string {
97
- const where = f.location.length > 0 ? f.location : '(no location)'
98
- return `- round ${round} — ${f.severity} ${where} — ${DEFERRAL_REASON_TEXT[f.reason]}`
25
+ return String(confidence.value)
99
26
  }
100
27
 
101
28
  /**
102
- * The deferred-findings block appended below the table (O4) — one line per
103
- * deferred finding across every round, in round then report order. Empty
104
- * string when no round deferred anything, so the summary is byte-identical to
105
- * what it was before this task on a run that deferred nothing. Deliberately
106
- * NOT a `|`-delimited table: `parseSummaryConfidenceRows` reads the table by
107
- * its pipe-delimited rows, so a plain-list block can never be misread as a
108
- * round row.
29
+ * The published marker: `<!-- aeg:loop:published head=<sha> confidence=1:-,2:80,3:absent -->`.
30
+ * Each round contributes `<round>:<cell>` — a percentage, `absent` (asked, no
31
+ * readable statement) or `-` (never asked).
109
32
  */
110
- function renderDeferredBlock(journal: Journal): string[] {
111
- const lines: string[] = []
112
- for (const record of journal.rounds) {
113
- for (const f of record.deferred ?? []) lines.push(renderDeferredFindingLine(record.round, f))
114
- }
115
- return lines.length === 0 ? [] : ['', DEFERRED_FINDINGS_HEADING, ...lines]
116
- }
117
-
118
- export function renderSummary(journal: Journal): string {
119
- const header = SUMMARY_TABLE_HEADER
120
- const divider = `| --- | ${SEVERITY_COLUMNS.map(() => '---').join(' | ')} | --- | --- |`
121
- const rows = journal.rounds.map(row)
122
- return [header, divider, ...rows, ...renderDeferredBlock(journal)].join('\n')
33
+ export function renderPublishedMarker(journal: Journal, head: string): string {
34
+ const confidence = journal.rounds.map((record) => `${record.round}:${confidenceCell(record.confidence)}`).join(',')
35
+ return `<!-- aeg:loop:published head=${head} confidence=${confidence} -->`
123
36
  }
124
37
 
125
38
  /**
126
- * One round's confidence as this table records it, in three distinguishable
39
+ * One round's confidence as the marker records it, in three distinguishable
127
40
  * states rather than two:
128
41
  *
129
42
  * - `asked: true` with a `percent` — the developer stated that figure;
130
43
  * - `asked: true`, `percent: null` — the round WAS asked and the statement
131
- * was missing or unreadable (the table's own `absent` cell);
44
+ * was missing or unreadable (the `absent` cell);
132
45
  * - `asked: false`, `percent: null` — the loop never asked this round at all
133
- * (its `—` cell; round 1 is never asked), so the round has no confidence
134
- * to report and a reader must not be told the developer skipped one.
46
+ * (the `-` cell; round 1 is never asked), so a reader must not be told the
47
+ * developer skipped a statement.
135
48
  */
136
49
  export type SummaryConfidenceRow = { round: number; percent: number | null; asked: boolean }
137
50
 
138
51
  /**
139
- * The inverse of `row` above — the confidence column read back out of a
140
- * posted summary table. Kept here, beside the renderer, so the column's
141
- * position is written down once: a reader elsewhere would have to hand-copy
142
- * the table's shape and would drift the first time a column moved.
143
- *
144
- * Only rows this renderer could have produced are read: a leading round
145
- * number, then one cell per severity column, then the confidence cell, then
146
- * the outcome. Anything else in the comment — prose above or below the table,
147
- * a differently-shaped table — yields no row at all rather than a guess.
52
+ * The inverse of `renderPublishedMarker` — the confidence entries read back out
53
+ * of a posted marker. Kept beside the renderer so the entry shape is written
54
+ * down once.
148
55
  *
149
- * This function is the boundary between pull-request comment text (which
150
- * anybody with write access to a fork's branch can shape) and the confidence
151
- * figure a tool result publishes, so the percentage is bounded HERE: a cell
152
- * claiming more than `CONFIDENCE_MAX_PERCENT` is dropped rather than carried
153
- * out of range into a caller that declares `0-100`.
56
+ * This is the boundary between pull-request comment text (which anybody with
57
+ * write access to a fork's branch can shape) and the confidence figure a tool
58
+ * result publishes, so the percentage is bounded HERE: an entry claiming more
59
+ * than `CONFIDENCE_MAX_PERCENT` is dropped rather than carried out of range. A
60
+ * comment with no marker line, and any entry not shaped `<round>:<cell>`,
61
+ * yields no row at all rather than a guess.
154
62
  */
155
63
  export function parseSummaryConfidenceRows(body: string): SummaryConfidenceRow[] {
156
- const cellCount = SEVERITY_COLUMNS.length + 3
157
64
  const rows: SummaryConfidenceRow[] = []
158
65
  for (const line of body.split('\n')) {
159
- const trimmed = line.trim()
160
- if (!trimmed.startsWith('|') || !trimmed.endsWith('|')) continue
161
- const cells = trimmed.slice(1, -1).split('|')
162
- if (cells.length !== cellCount) continue
163
- const round = Number((cells[0] as string).trim())
164
- if (!Number.isInteger(round) || round <= 0) continue
165
- const confidenceCellText = (cells[cellCount - 2] as string).trim()
166
- if (confidenceCellText === CONFIDENCE_NOT_ASKED_CELL) {
167
- rows.push({ round, percent: null, asked: false })
168
- continue
169
- }
170
- if (confidenceCellText === CONFIDENCE_ABSENT_CELL) {
171
- rows.push({ round, percent: null, asked: true })
172
- continue
66
+ const match = PUBLISHED_MARKER_LINE.exec(line.trim())
67
+ if (!match) continue
68
+ for (const entry of (match[2] as string).split(',')) {
69
+ const [roundText, cell] = entry.split(':')
70
+ const round = Number(roundText)
71
+ if (!Number.isInteger(round) || round <= 0 || cell === undefined) continue
72
+ if (cell === CONFIDENCE_NOT_ASKED_CELL) {
73
+ rows.push({ round, percent: null, asked: false })
74
+ } else if (cell === CONFIDENCE_ABSENT_CELL) {
75
+ rows.push({ round, percent: null, asked: true })
76
+ } else if (/^\d{1,3}$/.test(cell) && Number(cell) <= CONFIDENCE_MAX_PERCENT) {
77
+ rows.push({ round, percent: Number(cell), asked: true })
78
+ }
173
79
  }
174
- const percentMatch = /^(\d{1,3})%$/.exec(confidenceCellText)
175
- if (!percentMatch) continue
176
- const percent = Number(percentMatch[1])
177
- if (percent > CONFIDENCE_MAX_PERCENT) continue
178
- rows.push({ round, percent, asked: true })
179
80
  }
180
81
  return rows
181
82
  }
@@ -19,7 +19,7 @@ type Envelope = { meta: unknown; subject: unknown }
19
19
  type StripEnvelope<T> = T extends Envelope ? Omit<T, 'meta' | 'subject'> : never
20
20
  export type DevReviewLoopEventInput = StripEnvelope<DevReviewLoopEvent>
21
21
 
22
- /** O4's fixed column order — shared by `assess-round.ts` (counting) and `render-summary.ts` (rendering) so the two never drift apart. */
22
+ /** O4's fixed column order — shared by `assess-round.ts` (counting) so every round records the same columns. */
23
23
  export const SEVERITY_COLUMNS = ['blocker', 'major', 'minor', 'critical', 'high', 'medium', 'low'] as const
24
24
 
25
25
  /** The built form's finding identity (spec §0 item 1) — no fingerprint hashing. */
@@ -42,7 +42,7 @@ export type FindingObservation = {
42
42
  id: string
43
43
  severity: string
44
44
  /**
45
- * The finding's own `file:line` (O4) — carried so the round summary can name
45
+ * The finding's own `file:line` (O4) — carried so the round record can name
46
46
  * every deferred finding's location. Optional: an older extraction shape, or
47
47
  * a finding with none, simply has none to report.
48
48
  */
@@ -209,6 +209,17 @@ export type Observations =
209
209
  * vocabulary and rendering path every other pause reason already uses.
210
210
  * `detail` is set for this reason too, naming the branch and the dirty
211
211
  * file(s) observed.
212
+ *
213
+ * `'time_budget'`: the task's ACTIVE working time — the sum of the phases a
214
+ * driver spent developing, reviewing and awaiting confidence, never the hours
215
+ * it sat paused, published or driverless — passed `ReviewPolicy.maxTaskMinutes`.
216
+ * Unlike every other bound here it counts neither rounds nor attempts, so it is
217
+ * the one stop a loop cannot outrun by never advancing: time spent pushing,
218
+ * rebasing, waiting on checks and retrying all counts toward it (it is recorded
219
+ * as developing), while time waiting on a Principal does not. Decided by
220
+ * `assessRound` from the clock its caller reads (this module has none of its
221
+ * own); `detail` names the budget, the active time spent, and the active phases
222
+ * that time was summed from.
212
223
  */
213
224
  export type PauseReason =
214
225
  | 'escalation'
@@ -218,6 +229,7 @@ export type PauseReason =
218
229
  | 'reappearance'
219
230
  | 'repeat_finding'
220
231
  | 'repeat_failure'
232
+ | 'time_budget'
221
233
  | 'infrastructure'
222
234
  | 'no_push'
223
235
  | 'objectives_changed'
@@ -238,8 +250,10 @@ export type Decision =
238
250
  * The pause's own narration, when the deciding component has one:
239
251
  * `'infrastructure'` (the role and missing artifact(s) the driver
240
252
  * observed), `'max_rounds'` (the configured cap), `'repeat_finding'`
241
- * (the reviewer-qualified finding key(s) open two rounds running), and
242
- * `'repeat_failure'` (the exact failure message, unnormalised). Every
253
+ * (the reviewer-qualified finding key(s) open two rounds running),
254
+ * `'repeat_failure'` (the exact failure message, unnormalised), and
255
+ * `'time_budget'` (the budget, the active time spent, and the active
256
+ * phases it was summed from). Every
243
257
  * other reason omits it here — the driver narrates several of them
244
258
  * itself from facts it already holds (`deriveVerdictPauseDetail`).
245
259
  */
@@ -247,7 +261,7 @@ export type Decision =
247
261
  }
248
262
 
249
263
  /**
250
- * The summary's own outcome vocabulary — wider than `round_ended`'s
264
+ * The journal's own outcome vocabulary — wider than `round_ended`'s
251
265
  * schema-constrained `green | changes_requested | escalated`: a round whose
252
266
  * processing triggered one of the assessment exits (max_rounds, confidence,
253
267
  * reappearance) records `'stopped'` here, even though the log
@@ -258,9 +272,9 @@ export type Decision =
258
272
  export type RoundOutcome = 'green' | 'changes_requested' | 'escalated' | 'stopped'
259
273
 
260
274
  /**
261
- * Why a round ended before any reviewer ran, for the published table's outcome
275
+ * Why a round ended before any reviewer ran, for the journal's outcome
262
276
  * cell. A round no reviewer saw has no findings from any source, so it records
263
- * no counts at all (an empty `countsBySeverity`, `render-summary.ts`' own `—`)
277
+ * no counts at all (an empty `countsBySeverity`)
264
278
  * rather than a zero that reads as a clean review — and this names the reason
265
279
  * the outcome cell states instead of the log-parity `outcome` a reviewed round
266
280
  * carries:
@@ -271,15 +285,17 @@ export type RoundOutcome = 'green' | 'changes_requested' | 'escalated' | 'stoppe
271
285
  * without dispatching reviewers;
272
286
  * - `'mechanical_failure'` — the same mechanical failure ended two
273
287
  * consecutive attempts that never produced a head (`'repeat_failure'`),
274
- * so no gate ever judged one and no reviewer ever saw it.
288
+ * so no gate ever judged one and no reviewer ever saw it;
289
+ * - `'time_budget'` — the task's wall-clock budget ran out before this
290
+ * round reached review, so reviewers were never dispatched for it.
275
291
  *
276
292
  * `outcome` stays whatever the round would otherwise carry (both reasons are
277
293
  * `changes_requested` today), so the `round_ended` log event a reader parses is
278
- * unaffected — only the summary table's rendering changes.
294
+ * unaffected — only the `RoundRecord` the journal carries changes.
279
295
  */
280
- export type NotReviewedReason = 'checks_red' | 'low_confidence' | 'mechanical_failure'
296
+ export type NotReviewedReason = 'checks_red' | 'low_confidence' | 'mechanical_failure' | 'time_budget'
281
297
 
282
- /** One deferred finding, as the published summary reports it (O4) — its original severity, its `file:line`, and why this round set it aside, never its reported severity mutated. */
298
+ /** One deferred finding, as the journal records it (O4) — its original severity, its `file:line`, and why this round set it aside, never its reported severity mutated. */
283
299
  export type DeferredFindingRow = {
284
300
  severity: string
285
301
  /** The finding's own `file:line`, or `''` when it carried none. */
@@ -287,7 +303,7 @@ export type DeferredFindingRow = {
287
303
  reason: DeferralReason
288
304
  }
289
305
 
290
- /** One row of the published summary (`renderSummary`, O4) — counts only, no finding prose. */
306
+ /** One round of the journal (O4) — counts only, no finding prose. */
291
307
  export type RoundRecord = {
292
308
  round: number
293
309
  countsBySeverity: Record<string, number>
@@ -295,7 +311,7 @@ export type RoundRecord = {
295
311
  outcome: RoundOutcome
296
312
  /**
297
313
  * Every finding this round set aside rather than let it block (O2/O3),
298
- * carried so the published summary can list each with its original severity,
314
+ * carried so a reader can list each with its original severity,
299
315
  * location and reason (O4). Absent/`[]` for a round that deferred none, and
300
316
  * for a marker-reconstructed round (its findings are unknown — see
301
317
  * `journal-reconstruction.ts`).
@@ -304,7 +320,7 @@ export type RoundRecord = {
304
320
  /**
305
321
  * Set only for a round no reviewer saw (`buildUnreviewedRecord`,
306
322
  * `assess-round.ts`): its counts are absent (empty `countsBySeverity`) and the
307
- * table's outcome cell names this reason. Absent for every round the loop
323
+ * the round's outcome names this reason. Absent for every round the loop
308
324
  * assessed and for a round rebuilt from a marker — a marker-reconstructed
309
325
  * round's counts are likewise unknown, but the round DID reach review, so it
310
326
  * keeps its `outcome`, not a not-reviewed reason.
@@ -322,6 +338,39 @@ export type LoopConfig = {
322
338
  models: Record<string, string>
323
339
  /** The round cap — resolved by the driver from `ReviewPolicy.maxRounds` (repository config), never read here: this module has no config read of its own. */
324
340
  maxRounds: number
341
+ /** The task's wall-clock budget in minutes — resolved by the driver from `ReviewPolicy.maxTaskMinutes`, same discipline as `maxRounds` above. `0` turns the budget off. */
342
+ maxTaskMinutes: number
343
+ }
344
+
345
+ /**
346
+ * How long this task has been running, and where that time went — read by the
347
+ * DRIVER and handed to `assessRound`, never measured here: this module has no
348
+ * clock, the same way it has no config read.
349
+ *
350
+ * `elapsedMs` is the task's ACTIVE working time: the sum of the phases a driver
351
+ * spent working the task forward (`activeBudgetMs` over `byPhaseMs` —
352
+ * developing, reviewing, awaiting confidence), and nothing else. Time the task
353
+ * sat `paused` waiting for a Principal, time it spent `publishing` an approved
354
+ * pull request, and any stretch with no driver running at all are excluded — so
355
+ * a task first started days ago is measured by the minutes it worked, not by
356
+ * its age. It is a sum over per-phase times the durable control records carry
357
+ * across a restart, so a driver that was killed, taken over, or re-execed
358
+ * itself continues one budget rather than beginning a fresh one.
359
+ *
360
+ * `byPhaseMs` is the FULL record of what the loop recorded against each phase
361
+ * it worked in, keyed by the phase names the loop persists (`dispatch_developer`,
362
+ * `dispatch_reviewers`, and so on) — inactive phases (`pause`, `publish`)
363
+ * included, so it is a faithful account of where all the time went. The budget
364
+ * is decided on `elapsedMs`, which sums only the active subset; a breakdown
365
+ * that is thin — a run whose earlier phases were recorded by a driver that has
366
+ * since died — still stops on time and simply reports less about where the
367
+ * time went. The `'time_budget'` pause's detail names only the active phases
368
+ * (`renderTaskBudgetDetail`), so the phases it lists sum to the time it reports
369
+ * as spent.
370
+ */
371
+ export type TaskClock = {
372
+ elapsedMs: number
373
+ byPhaseMs: Record<string, number>
325
374
  }
326
375
 
327
376
  /** A round awaiting its `verdicts` observation, or awaiting a confidence re-ask — never both logged twice. */
@@ -18,12 +18,14 @@ export {
18
18
  enforcementPublishedText,
19
19
  evaluatePublishedProse,
20
20
  extractShortVersion,
21
+ extractShortVersionAndChecklist,
21
22
  publishedDoctrineBody,
22
23
  readabilityErrors,
23
24
  REFERENCE_HEADING,
24
25
  ROLE_BLOCKS,
25
26
  SHORT_VERSION_HEADING,
26
27
  SHORT_VERSION_MAX_WORDS,
27
- SHORT_VERSION_MIN_WORDS
28
+ SHORT_VERSION_MIN_WORDS,
29
+ WHAT_YOU_CHECK_HEADING
28
30
  } from './published-prose'
29
31
  export type { PublishedProseEntry, PublishedProseResult } from './published-prose'
@@ -49,6 +49,8 @@ import type { DocFrontmatter } from './types'
49
49
 
50
50
  export const SHORT_VERSION_HEADING = 'The short version'
51
51
  export const REFERENCE_HEADING = 'Reference'
52
+ /** The reviewer/security checklist heading a dispatched review pass carries alongside the short version. */
53
+ export const WHAT_YOU_CHECK_HEADING = 'What you check'
52
54
 
53
55
  /** Words. Under the floor means something was dropped; over the ceiling means
54
56
  * the reference is being summarised instead of the rule being stated. */
@@ -148,6 +150,34 @@ export function extractShortVersion(body: string): string | null {
148
150
  return sectionBody(body, SHORT_VERSION_HEADING)
149
151
  }
150
152
 
153
+ /** Strip the trailing `---` horizontal rule (and the blank lines around it) that closes every short version — the reviewer prompt carries the prose, never the rule (Traps to avoid). */
154
+ function stripTrailingRule(text: string): string {
155
+ return text.replace(/\n*-{3,}[ \t]*$/, '').trimEnd()
156
+ }
157
+
158
+ /**
159
+ * The published role doctrine a dispatched reviewer/security pass is handed as
160
+ * a fact: the role's short version (with the trailing `---` rule stripped),
161
+ * followed by its `## What you check` section verbatim when the body carries
162
+ * one. Reuses `extractShortVersion` so the injected short version and the
163
+ * `/docs` page can never disagree about what "published" means.
164
+ *
165
+ * Returns `null` when the body carries no `## The short version` at all — a
166
+ * body no resolvable role contract can have (`validateRoleContract` requires
167
+ * that section), so `null` here only ever names an unvalidated body. When the
168
+ * short version is present but `## What you check` is not, returns the short
169
+ * version alone rather than inventing a checklist: an adopter override missing
170
+ * the checklist heading is a Planner-level escalation (Stop conditions), never
171
+ * a fabricated section.
172
+ */
173
+ export function extractShortVersionAndChecklist(body: string): string | null {
174
+ const shortRaw = extractShortVersion(body)
175
+ if (shortRaw === null) return null
176
+ const short = stripTrailingRule(shortRaw)
177
+ const whatYouCheck = sectionBody(body, WHAT_YOU_CHECK_HEADING)
178
+ return whatYouCheck === null ? short : `${short}\n\n## ${WHAT_YOU_CHECK_HEADING}\n\n${whatYouCheck}`
179
+ }
180
+
151
181
  /**
152
182
  * What a role/contract page renders, with a degradation ladder that never
153
183
  * leaks the reference: the short version when present; otherwise the body
@@ -215,8 +215,12 @@ function extractVendorMentions(content: string): { name: string; index: number }
215
215
  return found
216
216
  }
217
217
 
218
- /** Every inline-backtick span in `content`, tested against `CITED_PATH_PATTERN`. */
219
- function extractCitedPaths(content: string): { cited: string; index: number }[] {
218
+ /**
219
+ * Every inline-backtick span in `content`, tested against `CITED_PATH_PATTERN`.
220
+ * Exported so `registry-checks.ts`'s hook-path scan reuses this extractor
221
+ * rather than carrying a second one.
222
+ */
223
+ export function extractCitedPaths(content: string): { cited: string; index: number }[] {
220
224
  const found: { cited: string; index: number }[] = []
221
225
  const spanPattern = /`([^`\n]+)`/g
222
226
  let match: RegExpExecArray | null = spanPattern.exec(content)
@@ -150,7 +150,6 @@ export const CLI_CHECK_RING: Readonly<Record<string, 0 | 1 | 2>> = {
150
150
  'quoted-command': 0,
151
151
  'main-branch-refusal': 0,
152
152
  'token-collection-wired': 0,
153
- 'token-report': 1,
154
153
  'pr-premise-reassert': 0,
155
154
  // The six write-only rules named apart — `ownWorkflow: true`
156
155
  // each, same ring reasoning as `review-gate`/`body-bare-digits` above.