@webpieces/pr-gate 0.4.775 → 0.4.777

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 (26) hide show
  1. package/package.json +3 -3
  2. package/src/dashboard/checklist-comment-renderer.js +4 -4
  3. package/src/dashboard/checklist-comment-renderer.js.map +1 -1
  4. package/src/dashboard/checklist-comment-row.d.ts +2 -2
  5. package/src/dashboard/checklist-comment-row.js +3 -3
  6. package/src/dashboard/checklist-comment-row.js.map +1 -1
  7. package/src/scripts/commands/finish-upsert-pr-command.js +8 -8
  8. package/src/scripts/commands/finish-upsert-pr-command.js.map +1 -1
  9. package/src/scripts/commands/review-upsert-pr-command.js +5 -4
  10. package/src/scripts/commands/review-upsert-pr-command.js.map +1 -1
  11. package/src/scripts/workflow/checklist-detector.js +1 -1
  12. package/src/scripts/workflow/checklist-detector.js.map +1 -1
  13. package/src/scripts/workflow/checklist-notice.js +6 -4
  14. package/src/scripts/workflow/checklist-notice.js.map +1 -1
  15. package/src/scripts/workflow/provenance-enforcer.d.ts +2 -2
  16. package/src/scripts/workflow/provenance-enforcer.js +24 -22
  17. package/src/scripts/workflow/provenance-enforcer.js.map +1 -1
  18. package/src/scripts/workflow/repo-config-testkit.d.ts +5 -2
  19. package/src/scripts/workflow/repo-config-testkit.js +6 -2
  20. package/src/scripts/workflow/repo-config-testkit.js.map +1 -1
  21. package/src/scripts/workflow/review-report.d.ts +22 -2
  22. package/src/scripts/workflow/review-report.js +82 -12
  23. package/src/scripts/workflow/review-report.js.map +1 -1
  24. package/src/scripts/workflow/reviewer-briefing-builder.d.ts +1 -1
  25. package/src/scripts/workflow/reviewer-briefing-builder.js +5 -5
  26. package/src/scripts/workflow/reviewer-briefing-builder.js.map +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webpieces/pr-gate",
3
- "version": "0.4.775",
3
+ "version": "0.4.777",
4
4
  "description": "Gated PR system: 3-point squash-merge, merge validation gate, and red/yellow/green PR dashboard. Standalone scripts, no Nx dependency required.",
5
5
  "type": "commonjs",
6
6
  "main": "./src/index.js",
@@ -16,8 +16,8 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@inversifyjs/binding-decorators": "1.1.5",
19
- "@webpieces/ai-hook-rules": "0.4.775",
20
- "@webpieces/rules-config": "0.4.775",
19
+ "@webpieces/ai-hook-rules": "0.4.777",
20
+ "@webpieces/rules-config": "0.4.777",
21
21
  "inversify": "7.10.4",
22
22
  "reflect-metadata": "0.2.2"
23
23
  },
@@ -119,7 +119,7 @@ let ChecklistCommentRenderer = class ChecklistCommentRenderer {
119
119
  const state = row.ran
120
120
  ? `⚫ SUPPRESSED${row.required ? ' (REQUIRED)' : ' (optional)'} — no reviewer ran`
121
121
  : '⚪ did not apply to this diff';
122
- return `- [ ] **${row.subagent}** — ${state}\n - ${this.whyLine(row)}`;
122
+ return `- [ ] **${row.checklistId}** — ${state}\n - ${this.whyLine(row)}`;
123
123
  }
124
124
  /**
125
125
  * The closing note when no reviewer produced a verdict. The original wording — "every configured
@@ -174,7 +174,7 @@ let ChecklistCommentRenderer = class ChecklistCommentRenderer {
174
174
  // checklist was evaluated and did not apply, which the words state as the good news it is.
175
175
  rosterBullet(row) {
176
176
  const box = this.reviewerRan(row) ? '- [x]' : '- [ ]';
177
- return (`${box} ${this.verdictEmoji(row)} **${row.subagent}**${this.optionalTag(row)} — ` +
177
+ return (`${box} ${this.verdictEmoji(row)} **${row.checklistId}**${this.optionalTag(row)} — ` +
178
178
  `${this.verdictWords(row)}${this.evidenceSuffix(row)}\n` +
179
179
  ` - ${this.whyLine(row)}`);
180
180
  }
@@ -241,7 +241,7 @@ let ChecklistCommentRenderer = class ChecklistCommentRenderer {
241
241
  // rather than take "someone approved this" on trust. The reason, who authorized it and when are
242
242
  // rendered verbatim in this row's section below.
243
243
  if (row.status === rules_config_1.CK_OVERRIDDEN) {
244
- return `OVERRIDDEN — a human authorized shipping it (recorded in override-${row.subagent}.json)`;
244
+ return `OVERRIDDEN — a human authorized shipping it (recorded in override-${row.checklistId}.json)`;
245
245
  }
246
246
  if (row.status === rules_config_1.CK_FAIL)
247
247
  return 'FAILED review';
@@ -289,7 +289,7 @@ let ChecklistCommentRenderer = class ChecklistCommentRenderer {
289
289
  return idx < 0 ? rank.length : idx;
290
290
  }
291
291
  commentSection(row) {
292
- const heading = `#### ${this.verdictEmoji(row)} ${row.subagent} — ${this.verdictWords(row)}`;
292
+ const heading = `#### ${this.verdictEmoji(row)} ${row.checklistId} — ${this.verdictWords(row)}`;
293
293
  const body = row.detail.trim() !== '' ? row.detail.trim() : '_(reviewer recorded no output)_';
294
294
  return new CommentSection(heading + '\n\n' + new review_identity_renderer_1.ReviewIdentityRenderer().render(row.agent, row.model), body);
295
295
  }
@@ -1 +1 @@
1
- {"version":3,"file":"checklist-comment-renderer.js","sourceRoot":"","sources":["../../../../../../packages/tooling/pr-gate/src/dashboard/checklist-comment-renderer.ts"],"names":[],"mappings":";;;;AAAA,yEAAoE;AACpE,0DAGiC;AACjC,yCAA2D;AAG3D;;;;;GAKG;AACU,QAAA,wBAAwB,GAAG,kCAAkC,CAAC;AAE3E,MAAM,aAAa,GAAG,KAAK,CAAC,CAAC,yEAAyE;AAEtG,mGAAmG;AACnG,kFAAkF;AAClF,MAAM,cAAc;IAChB,OAAO,CAAS;IAChB,IAAI,CAAS;IAEb,YAAY,OAAe,EAAE,IAAY;QACrC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;CACJ;AAED;;;;;;;;;;;GAWG;AAEI,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACjC;;;;;;;;;;;;OAYG;IACH,MAAM,CACF,IAAoC,EACpC,kBAA2B,EAC3B,YAAqB;IACrB,oGAAoG;IACpG,8FAA8F;IAC9F,qGAAqG;IACrG,mGAAmG;IACnG,uGAAuG;IACvG,eAAuB;QAEvB,IAAI,eA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AC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,GAAG,KAAK,CAAC;YACzE,GAAG,GAAG,QAAQ,EAAE,CAAC;QACrB,CAAC;QACD,OAAO,GAAG,CAAC;IACf,CAAC;IAEO,gBAAgB,CAAC,QAAmC;QACxD,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC;QACb,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC;QACb,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAiB,EAAE,CAAS,EAAQ,EAAE;YACpD,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;gBACtB,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;gBACpB,GAAG,GAAG,CAAC,CAAC;YACZ,CAAC;QACL,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,CAAC;IACf,CAAC;CACJ,CAAA;AApTY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,sBAAU,EAAC,8BAAkB,CAAC,SAAS,CAAC;GAC5B,wBAAwB,CAoTpC","sourcesContent":["import { ReviewIdentityRenderer } from './review-identity-renderer';\nimport {\n formatFileList, CK_PASS, CK_WARN, CK_OVERRIDDEN, CK_FAIL, CK_MISSING,\n HOME_CONFIG_DIR, HOME_CONFIG_FILE, HOME_KEY_TURN_OFF_ALL_REVIEWERS,\n} from '@webpieces/rules-config';\nimport { injectable, bindingScopeValues } from 'inversify';\nimport { ChecklistCommentRow } from './checklist-comment-row';\n\n/**\n * Hidden marker on the checklist review COMMENT — the \"2nd comment\" the PR description points at — so\n * wp-finish can find and PATCH its own comment on every push instead of appending a new one. Versioned so\n * the format can evolve without matching an old shape. v2 = the full roster (every DEFINED checklist,\n * matched or not) + tri-state verdicts.\n */\nexport const CHECKLIST_COMMENT_MARKER = '<!-- webpieces-checklists v2 -->';\n\nconst COMMENT_LIMIT = 65000; // under GitHub's 65536-char cap, with headroom for the marker + roll-up.\n\n// One checklist section for the combined comment (heading + verbatim reviewer output), so oversize\n// truncation can shrink the longest BODY without ever dropping a verdict heading.\nclass CommentSection {\n heading: string;\n body: string;\n\n constructor(heading: string, body: string) {\n this.heading = heading;\n this.body = body;\n }\n}\n\n/**\n * Renders the 2nd PR comment: the reviewer checklist — full roster plus each reviewer's verbatim output.\n *\n * Split out of `Dashboard` when the PR-description/commit-body swap pushed that file over the 700-line\n * cap, and the seam was already there to be found: this is ONE of the three surfaces the gated flow\n * writes, it shares no rendering helper with the other two (it speaks `ChecklistCommentRow`, where the\n * dashboard speaks `ChecklistRow`), and it owns the only size-fitting logic in the package. One class per\n * surface is the shape the rest of this change assumes — see `Dashboard.renderPrBody` and\n * `Dashboard.renderDetailComment`.\n *\n * `@injectable(bindingScopeValues.Singleton)` so it is drawn in the DI design and injected by type.\n */\n@injectable(bindingScopeValues.Singleton)\nexport class ChecklistCommentRenderer {\n /**\n * The ONE combined PR comment. Two halves, in this order:\n *\n * 1. A roll-up plus the FULL ROSTER — every DEFINED checklist as a checkbox, each with a sub-bullet\n * stating exactly which globs fired against which files, or which did not and out of how many.\n * Skipped checklists are listed on purpose: skipping is the normal, healthy outcome, and a comment\n * that names only the reviewers that fired cannot distinguish \"evaluated and irrelevant\" from\n * \"never wired up\" — nor answer \"why did the DB reviewer run on my frontend PR?\".\n * 2. One section per reviewer that RAN, carrying its full `output` — the depth a verdict line throws\n * away. Overridden first, then warned, then passed: a reader should meet the exceptions first.\n *\n * Idempotent: keyed by the hidden marker so wp-finish PATCHes this same comment on every push.\n */\n render(\n rows: readonly ChecklistCommentRow[],\n provenanceVerified: boolean,\n baseResolved: boolean,\n // How many checklists `experimental.turnOffAllReviewers` killed. REQUIRED, no default: this comment\n // renders a roster of checkboxes and a provenance ATTESTATION, and under suppression both are\n // false-by-omission — the boxes are unchecked because nothing ran, and \"each reviewer ran as its own\n // independent subagent, verified\" would be an outright untrue sentence under a PR nobody reviewed.\n // A defaulted 0 would let every existing caller keep printing it. See HOME_KEY_TURN_OFF_ALL_REVIEWERS.\n suppressedCount: number,\n ): string {\n if (suppressedCount > 0) return this.suppressedComment(rows, suppressedCount);\n const ran = this.ranOrdered(rows);\n const prov = provenanceVerified\n ? '_Each reviewer ran as its own independent subagent, verified from the Claude Code harness._'\n : '_⚠️ Reviewer provenance was NOT verified (no Claude Code session) — treat these as unverified._';\n // The roster lives in the HEADER, never in a section: fitComment only ever shrinks section bodies,\n // so a roster line can never be the thing an oversize comment silently drops.\n const lines: string[] = [CHECKLIST_COMMENT_MARKER, this.rollupHeader(rows, baseResolved)];\n // No reviewer ran ⇒ no provenance claim to make. Printing one either way would attest to nothing.\n if (ran.length > 0) lines.push(prov);\n lines.push('', `### Checklists (all ${rows.length})`);\n for (const row of rows) lines.push(this.rosterBullet(row));\n const header = lines.join('\\n');\n if (ran.length === 0) {\n return `${header}\\n\\n${this.nothingRanNote(rows)}`;\n }\n return this.fitComment(\n `${header}\\n\\n### Reviews that ran`,\n ran.map((r: ChecklistCommentRow): CommentSection => this.commentSection(r)),\n );\n }\n\n /**\n * The whole comment when `experimental.turnOffAllReviewers` killed every reviewer.\n *\n * It REPLACES the ordinary body rather than adding a line to it, because three things in there would\n * each be false here and none of them is fixable in place: the roll-up would count matched checklists\n * as \"skipped ✅\", the provenance line would attest that each reviewer ran as its own verified\n * subagent, and the closing note would say every checklist was evaluated and none applied. Under\n * suppression they DID apply, nobody looked, and this comment is one of only three places that says so.\n *\n * It keeps the full roster — every checklist unchecked, with which ones were REQUIRED — because the\n * count alone cannot answer \"which required reviewer did this PR skip?\".\n */\n private suppressedComment(rows: readonly ChecklistCommentRow[], suppressedCount: number): string {\n const required = rows.filter((r: ChecklistCommentRow): boolean => r.required && r.ran);\n const lines: string[] = [\n CHECKLIST_COMMENT_MARKER,\n `## 🔍 Company review checklists — ⚫ ALL SUPPRESSED (${suppressedCount} of ${rows.length} would have run)`,\n `_No reviewer subagent ran on this PR. Switched off by \\`experimental.${HOME_KEY_TURN_OFF_ALL_REVIEWERS}: true\\` `\n + `in the machine-local \\`~/${HOME_CONFIG_DIR}/${HOME_CONFIG_FILE}\\` — a MACHINE setting, not a repo one, so `\n + `nothing in this branch could have caused it. **This is not an all-clear**, and `\n + `${required.length} of the suppressed checklist(s) were REQUIRED._`,\n '',\n `### Checklists (all ${rows.length})`,\n ];\n for (const row of rows) lines.push(this.suppressedBullet(row));\n return lines.join('\\n');\n }\n\n /**\n * One roster line under suppression. ALWAYS an unchecked box — never `rosterBullet`, whose box is\n * `reviewerRan(row)`, which is true for any REQUIRED checklist that applied. Under suppression that\n * would tick every required reviewer's box on a PR none of them looked at, which is the precise\n * inversion this whole feature has to avoid.\n *\n * `row.ran` here means \"this checklist APPLIED\", so it is what separates a SUPPRESSED entry from one\n * that genuinely did not match. Both stay listed: the second is the good news the roster exists to\n * deliver, and dropping either would make the reader recompute the diff to tell them apart.\n */\n private suppressedBullet(row: ChecklistCommentRow): string {\n const state = row.ran\n ? `⚫ SUPPRESSED${row.required ? ' (REQUIRED)' : ' (optional)'} — no reviewer ran`\n : '⚪ did not apply to this diff';\n return `- [ ] **${row.subagent}** — ${state}\\n - ${this.whyLine(row)}`;\n }\n\n /**\n * The closing note when no reviewer produced a verdict. The original wording — \"every configured\n * checklist was evaluated and none of them applied\" — is an all-clear, and it becomes FALSE the moment a\n * checklist did apply and was declined. That sentence under a PR nobody reviewed is precisely the\n * misreport this feature could otherwise introduce, so the declined case gets its own words.\n */\n private nothingRanNote(rows: readonly ChecklistCommentRow[]): string {\n const declined = rows.filter((r: ChecklistCommentRow): boolean => this.declined(r));\n if (declined.length === 0) {\n return '_No reviewer had to run on this diff — every configured checklist was evaluated and none of them applied._';\n }\n return (\n `_No reviewer ran. ${declined.length} OPTIONAL checklist(s) DID apply to this diff and were not ` +\n `run; the rest were evaluated and did not apply._`\n );\n }\n\n // The roll-up line. `baseResolved:false` replaces it entirely: with no fork point the changed-file set is\n // EMPTY, so nothing matched — including patternless ALWAYS-RUNS checklists — and reporting that as\n // \"all skipped ✅\" would post a green all-clear for a PR where nothing was actually evaluated.\n private rollupHeader(rows: readonly ChecklistCommentRow[], baseResolved: boolean): string {\n if (!baseResolved) {\n return (\n `## 🔍 Company review checklists — ⚠️ NOT EVALUATED (${rows.length} defined)\\n` +\n `_No diff base (fork point of main) could be resolved, so no checklist was matched against ` +\n `anything. This is **not** an all-clear._`\n );\n }\n const ran = rows.filter((r: ChecklistCommentRow): boolean => this.reviewerRan(r));\n const declined = rows.filter((r: ChecklistCommentRow): boolean => this.declined(r));\n const skipped = rows.length - ran.length - declined.length;\n const parts: string[] = [];\n for (const pair of this.rollupCounts(ran)) parts.push(pair);\n const breakdown = parts.length > 0 ? ` (${parts.join(' · ')})` : '';\n const skip = skipped > 0 ? ` · ${skipped} skipped ✅` : '';\n // Counted SEPARATELY from \"skipped\", and without a ✅. A declined optional review is a legitimate\n // outcome, but it is not the same good news as a checklist that had nothing to look at — folding the\n // two together would let a PR that declined every optional review read as fully covered.\n const notRun = declined.length > 0 ? ` · ${declined.length} optional not run` : '';\n return `## 🔍 Company review checklists — ${rows.length} defined · ${ran.length} ran${breakdown}${skip}${notRun}`;\n }\n\n // `🟢 2 · 🟡 1` — only the non-zero buckets, so a clean run reads as one number rather than four.\n private rollupCounts(ran: readonly ChecklistCommentRow[]): string[] {\n const counts: string[] = [];\n const emojiFor: string[] = ['🟢', '🟡', '🟠'];\n const statusFor: string[] = [CK_PASS, CK_WARN, CK_OVERRIDDEN];\n statusFor.forEach((status: string, i: number): void => {\n const n = ran.filter((r: ChecklistCommentRow): boolean => r.status === status).length;\n if (n > 0) counts.push(`${emojiFor[i]} ${n}`);\n });\n return counts;\n }\n\n // One roster line + its why sub-bullet. A checked box means a reviewer ran; an unchecked one means the\n // checklist was evaluated and did not apply, which the words state as the good news it is.\n private rosterBullet(row: ChecklistCommentRow): string {\n const box = this.reviewerRan(row) ? '- [x]' : '- [ ]';\n return (\n `${box} ${this.verdictEmoji(row)} **${row.subagent}**${this.optionalTag(row)} — ` +\n `${this.verdictWords(row)}${this.evidenceSuffix(row)}\\n` +\n ` - ${this.whyLine(row)}`\n );\n }\n\n /**\n * Did a reviewer actually produce a verdict for this row?\n *\n * `row.ran` is really \"this checklist APPLIED to the diff\" — for a required checklist the two are the\n * same thing, because the PR cannot open otherwise, and the field was named before optional checklists\n * existed. For a DECLINED optional one they diverge, and using `ran` alone would put a checked box and a\n * reviewer section on a review that nobody performed.\n */\n private reviewerRan(row: ChecklistCommentRow): boolean {\n return row.ran && !this.declined(row);\n }\n\n // Applied, optional, and carrying no verdict — i.e. the human was offered this review and said no (or\n // `--no-optional` skipped the offer). Never true of a required checklist: one of those with no verdict\n // does not reach a PR at all.\n private declined(row: ChecklistCommentRow): boolean {\n return row.ran && !row.required && (row.status === CK_MISSING || row.status === '');\n }\n\n // Marks which rows the human could have declined. Without it a reader cannot tell a review that was\n // skippable from one that simply passed, and so cannot judge how much this PR was actually reviewed.\n private optionalTag(row: ChecklistCommentRow): string {\n return row.required ? '' : ' _(optional)_';\n }\n\n /**\n * Whether the reviewer demonstrably opened the diff, read from its own transcript. A QUALITY signal and\n * never a blocker (see SubagentProvenanceService.evidenceFor) — but published, because \"wrote a verdict\n * without reading the change\" is exactly what a reader of this comment would want to weigh.\n */\n private evidenceSuffix(row: ChecklistCommentRow): string {\n if (!this.reviewerRan(row) || row.diffRead === '') return '';\n return row.diffRead === 'yes' ? ' _(diff read ✓)_' : ' _(⚠️ no diff read recorded)_';\n }\n\n private verdictEmoji(row: ChecklistCommentRow): string {\n if (!this.reviewerRan(row)) return '⚪';\n if (row.status === CK_PASS) return '🟢';\n if (row.status === CK_WARN) return '🟡';\n if (row.status === CK_OVERRIDDEN) return '🟠';\n if (row.status === CK_FAIL) return '🔴';\n return '⚪';\n }\n\n // SHORT words for a roster line / section heading. Short on purpose: the reviewer's own output and any\n // override justification get their own section below, and a roster exists to be scanned.\n private verdictWords(row: ChecklistCommentRow): string {\n // Two different unchecked boxes, two different sentences. \"Not applicable\" is the diff's doing;\n // \"not run\" is a person's, and reporting the second as the first would quietly credit a review that\n // a human deliberately declined.\n if (this.declined(row)) return 'OPTIONAL — applied to this diff but was NOT run (not selected)';\n if (!row.ran) return 'skipped, not applicable to this diff (expected ✅)';\n if (row.status === CK_PASS) return 'passed';\n if (row.status === CK_WARN) return 'passed with concerns';\n // Names the FILE the authorization lives in, so a reader of the PR can go and check the provenance\n // rather than take \"someone approved this\" on trust. The reason, who authorized it and when are\n // rendered verbatim in this row's section below.\n if (row.status === CK_OVERRIDDEN) {\n return `OVERRIDDEN — a human authorized shipping it (recorded in override-${row.subagent}.json)`;\n }\n if (row.status === CK_FAIL) return 'FAILED review';\n if (row.status === CK_MISSING) return 'no verdict written';\n return `unknown verdict (${row.status})`;\n }\n\n /**\n * WHY this checklist ran or did not — the line that answers \"why was this reviewer involved?\". Branches\n * on `configuredPatterns`, NEVER on `firedPatterns.length`: a patternless checklist and a skipped one\n * both fired zero globs and they mean opposite things, so keying off the fired list would tell every\n * skipped checklist's reader that the whole diff had been in its scope.\n */\n private whyLine(row: ChecklistCommentRow): string {\n const total = row.changedFileCount;\n if (row.configuredPatterns.length === 0) {\n // State the fact, not a suspicion. Patternless is a deliberate configuration — an always-runs\n // gate (every PR names a ticket, every PR has an owner) is exactly what it is FOR — so telling\n // every such row to \"add `patterns` if that is not intended\" nags the repos that meant it, on\n // every PR, forever. A reader who wants to know whether it was intended can read the config.\n return (\n `ALWAYS RUNS (no patterns) — whole diff in scope, ${total} changed file(s): ` +\n `${formatFileList(row.matchedFiles)}`\n );\n }\n const configured = this.asCode(row.configuredPatterns);\n if (row.firedPatterns.length === 0) {\n return `${configured} matched 0 of ${total} changed file(s)`;\n }\n return (\n `matched ${this.asCode(row.firedPatterns)} → ${row.matchedFiles.length} of ${total} ` +\n `changed file(s): ${formatFileList(row.matchedFiles)}`\n );\n }\n\n private asCode(patterns: readonly string[]): string {\n return patterns.map((p: string): string => `\\`${p}\\``).join(', ');\n }\n\n // Reviewers that ran, exceptions first (overridden → warned → passed) so a reader meets what needs\n // attention before a wall of green.\n private ranOrdered(rows: readonly ChecklistCommentRow[]): ChecklistCommentRow[] {\n const rank: string[] = [CK_OVERRIDDEN, CK_WARN, CK_PASS];\n return rows\n .filter((r: ChecklistCommentRow): boolean => this.reviewerRan(r))\n .slice()\n .sort(\n (a: ChecklistCommentRow, b: ChecklistCommentRow): number =>\n this.rankOf(rank, a.status) - this.rankOf(rank, b.status),\n );\n }\n\n private rankOf(rank: readonly string[], status: string): number {\n const idx = rank.indexOf(status);\n return idx < 0 ? rank.length : idx;\n }\n\n private commentSection(row: ChecklistCommentRow): CommentSection {\n const heading = `#### ${this.verdictEmoji(row)} ${row.subagent} — ${this.verdictWords(row)}`;\n const body =\n row.detail.trim() !== '' ? row.detail.trim() : '_(reviewer recorded no output)_';\n return new CommentSection(heading + '\\n\\n' + new ReviewIdentityRenderer().render(row.agent, row.model), body);\n }\n\n // Keep the comment under GitHub's size cap by shrinking the LONGEST section body first (so a short\n // overridden note is never cut to make room for a long passing one), never dropping a verdict heading.\n private fitComment(header: string, sections: CommentSection[]): string {\n const assemble = (): string =>\n `${header}\\n\\n${sections.map((s: CommentSection): string => `${s.heading}\\n\\n${s.body}`).join('\\n\\n')}`;\n const trunc = '\\n\\n…_[truncated to fit the GitHub comment size limit]_';\n let out = assemble();\n while (out.length > COMMENT_LIMIT) {\n const idx = this.longestBodyIndex(sections);\n if (idx < 0 || sections[idx].body.length <= trunc.length + 1) break;\n const over = out.length - COMMENT_LIMIT;\n const keep = Math.max(0, sections[idx].body.length - over - trunc.length - 8);\n sections[idx].body = sections[idx].body.slice(0, keep).trimEnd() + trunc;\n out = assemble();\n }\n return out;\n }\n\n private longestBodyIndex(sections: readonly CommentSection[]): number {\n let idx = -1;\n let max = -1;\n sections.forEach((s: CommentSection, i: number): void => {\n if (s.body.length > max) {\n max = s.body.length;\n idx = i;\n }\n });\n return idx;\n }\n}\n"]}
1
+ {"version":3,"file":"checklist-comment-renderer.js","sourceRoot":"","sources":["../../../../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,CAAA;AApTY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,sBAAU,EAAC,8BAAkB,CAAC,SAAS,CAAC;GAC5B,wBAAwB,CAoTpC","sourcesContent":["import { ReviewIdentityRenderer } from './review-identity-renderer';\nimport {\n formatFileList, CK_PASS, CK_WARN, CK_OVERRIDDEN, CK_FAIL, CK_MISSING,\n HOME_CONFIG_DIR, HOME_CONFIG_FILE, HOME_KEY_TURN_OFF_ALL_REVIEWERS,\n} from '@webpieces/rules-config';\nimport { injectable, bindingScopeValues } from 'inversify';\nimport { ChecklistCommentRow } from './checklist-comment-row';\n\n/**\n * Hidden marker on the checklist review COMMENT — the \"2nd comment\" the PR description points at — so\n * wp-finish can find and PATCH its own comment on every push instead of appending a new one. Versioned so\n * the format can evolve without matching an old shape. v2 = the full roster (every DEFINED checklist,\n * matched or not) + tri-state verdicts.\n */\nexport const CHECKLIST_COMMENT_MARKER = '<!-- webpieces-checklists v2 -->';\n\nconst COMMENT_LIMIT = 65000; // under GitHub's 65536-char cap, with headroom for the marker + roll-up.\n\n// One checklist section for the combined comment (heading + verbatim reviewer output), so oversize\n// truncation can shrink the longest BODY without ever dropping a verdict heading.\nclass CommentSection {\n heading: string;\n body: string;\n\n constructor(heading: string, body: string) {\n this.heading = heading;\n this.body = body;\n }\n}\n\n/**\n * Renders the 2nd PR comment: the reviewer checklist — full roster plus each reviewer's verbatim output.\n *\n * Split out of `Dashboard` when the PR-description/commit-body swap pushed that file over the 700-line\n * cap, and the seam was already there to be found: this is ONE of the three surfaces the gated flow\n * writes, it shares no rendering helper with the other two (it speaks `ChecklistCommentRow`, where the\n * dashboard speaks `ChecklistRow`), and it owns the only size-fitting logic in the package. One class per\n * surface is the shape the rest of this change assumes — see `Dashboard.renderPrBody` and\n * `Dashboard.renderDetailComment`.\n *\n * `@injectable(bindingScopeValues.Singleton)` so it is drawn in the DI design and injected by type.\n */\n@injectable(bindingScopeValues.Singleton)\nexport class ChecklistCommentRenderer {\n /**\n * The ONE combined PR comment. Two halves, in this order:\n *\n * 1. A roll-up plus the FULL ROSTER — every DEFINED checklist as a checkbox, each with a sub-bullet\n * stating exactly which globs fired against which files, or which did not and out of how many.\n * Skipped checklists are listed on purpose: skipping is the normal, healthy outcome, and a comment\n * that names only the reviewers that fired cannot distinguish \"evaluated and irrelevant\" from\n * \"never wired up\" — nor answer \"why did the DB reviewer run on my frontend PR?\".\n * 2. One section per reviewer that RAN, carrying its full `output` — the depth a verdict line throws\n * away. Overridden first, then warned, then passed: a reader should meet the exceptions first.\n *\n * Idempotent: keyed by the hidden marker so wp-finish PATCHes this same comment on every push.\n */\n render(\n rows: readonly ChecklistCommentRow[],\n provenanceVerified: boolean,\n baseResolved: boolean,\n // How many checklists `experimental.turnOffAllReviewers` killed. REQUIRED, no default: this comment\n // renders a roster of checkboxes and a provenance ATTESTATION, and under suppression both are\n // false-by-omission — the boxes are unchecked because nothing ran, and \"each reviewer ran as its own\n // independent subagent, verified\" would be an outright untrue sentence under a PR nobody reviewed.\n // A defaulted 0 would let every existing caller keep printing it. See HOME_KEY_TURN_OFF_ALL_REVIEWERS.\n suppressedCount: number,\n ): string {\n if (suppressedCount > 0) return this.suppressedComment(rows, suppressedCount);\n const ran = this.ranOrdered(rows);\n const prov = provenanceVerified\n ? '_Each reviewer ran as its own independent subagent, verified from the Claude Code harness._'\n : '_⚠️ Reviewer provenance was NOT verified (no Claude Code session) — treat these as unverified._';\n // The roster lives in the HEADER, never in a section: fitComment only ever shrinks section bodies,\n // so a roster line can never be the thing an oversize comment silently drops.\n const lines: string[] = [CHECKLIST_COMMENT_MARKER, this.rollupHeader(rows, baseResolved)];\n // No reviewer ran ⇒ no provenance claim to make. Printing one either way would attest to nothing.\n if (ran.length > 0) lines.push(prov);\n lines.push('', `### Checklists (all ${rows.length})`);\n for (const row of rows) lines.push(this.rosterBullet(row));\n const header = lines.join('\\n');\n if (ran.length === 0) {\n return `${header}\\n\\n${this.nothingRanNote(rows)}`;\n }\n return this.fitComment(\n `${header}\\n\\n### Reviews that ran`,\n ran.map((r: ChecklistCommentRow): CommentSection => this.commentSection(r)),\n );\n }\n\n /**\n * The whole comment when `experimental.turnOffAllReviewers` killed every reviewer.\n *\n * It REPLACES the ordinary body rather than adding a line to it, because three things in there would\n * each be false here and none of them is fixable in place: the roll-up would count matched checklists\n * as \"skipped ✅\", the provenance line would attest that each reviewer ran as its own verified\n * subagent, and the closing note would say every checklist was evaluated and none applied. Under\n * suppression they DID apply, nobody looked, and this comment is one of only three places that says so.\n *\n * It keeps the full roster — every checklist unchecked, with which ones were REQUIRED — because the\n * count alone cannot answer \"which required reviewer did this PR skip?\".\n */\n private suppressedComment(rows: readonly ChecklistCommentRow[], suppressedCount: number): string {\n const required = rows.filter((r: ChecklistCommentRow): boolean => r.required && r.ran);\n const lines: string[] = [\n CHECKLIST_COMMENT_MARKER,\n `## 🔍 Company review checklists — ⚫ ALL SUPPRESSED (${suppressedCount} of ${rows.length} would have run)`,\n `_No reviewer subagent ran on this PR. Switched off by \\`experimental.${HOME_KEY_TURN_OFF_ALL_REVIEWERS}: true\\` `\n + `in the machine-local \\`~/${HOME_CONFIG_DIR}/${HOME_CONFIG_FILE}\\` — a MACHINE setting, not a repo one, so `\n + `nothing in this branch could have caused it. **This is not an all-clear**, and `\n + `${required.length} of the suppressed checklist(s) were REQUIRED._`,\n '',\n `### Checklists (all ${rows.length})`,\n ];\n for (const row of rows) lines.push(this.suppressedBullet(row));\n return lines.join('\\n');\n }\n\n /**\n * One roster line under suppression. ALWAYS an unchecked box — never `rosterBullet`, whose box is\n * `reviewerRan(row)`, which is true for any REQUIRED checklist that applied. Under suppression that\n * would tick every required reviewer's box on a PR none of them looked at, which is the precise\n * inversion this whole feature has to avoid.\n *\n * `row.ran` here means \"this checklist APPLIED\", so it is what separates a SUPPRESSED entry from one\n * that genuinely did not match. Both stay listed: the second is the good news the roster exists to\n * deliver, and dropping either would make the reader recompute the diff to tell them apart.\n */\n private suppressedBullet(row: ChecklistCommentRow): string {\n const state = row.ran\n ? `⚫ SUPPRESSED${row.required ? ' (REQUIRED)' : ' (optional)'} — no reviewer ran`\n : '⚪ did not apply to this diff';\n return `- [ ] **${row.checklistId}** — ${state}\\n - ${this.whyLine(row)}`;\n }\n\n /**\n * The closing note when no reviewer produced a verdict. The original wording — \"every configured\n * checklist was evaluated and none of them applied\" — is an all-clear, and it becomes FALSE the moment a\n * checklist did apply and was declined. That sentence under a PR nobody reviewed is precisely the\n * misreport this feature could otherwise introduce, so the declined case gets its own words.\n */\n private nothingRanNote(rows: readonly ChecklistCommentRow[]): string {\n const declined = rows.filter((r: ChecklistCommentRow): boolean => this.declined(r));\n if (declined.length === 0) {\n return '_No reviewer had to run on this diff — every configured checklist was evaluated and none of them applied._';\n }\n return (\n `_No reviewer ran. ${declined.length} OPTIONAL checklist(s) DID apply to this diff and were not ` +\n `run; the rest were evaluated and did not apply._`\n );\n }\n\n // The roll-up line. `baseResolved:false` replaces it entirely: with no fork point the changed-file set is\n // EMPTY, so nothing matched — including patternless ALWAYS-RUNS checklists — and reporting that as\n // \"all skipped ✅\" would post a green all-clear for a PR where nothing was actually evaluated.\n private rollupHeader(rows: readonly ChecklistCommentRow[], baseResolved: boolean): string {\n if (!baseResolved) {\n return (\n `## 🔍 Company review checklists — ⚠️ NOT EVALUATED (${rows.length} defined)\\n` +\n `_No diff base (fork point of main) could be resolved, so no checklist was matched against ` +\n `anything. This is **not** an all-clear._`\n );\n }\n const ran = rows.filter((r: ChecklistCommentRow): boolean => this.reviewerRan(r));\n const declined = rows.filter((r: ChecklistCommentRow): boolean => this.declined(r));\n const skipped = rows.length - ran.length - declined.length;\n const parts: string[] = [];\n for (const pair of this.rollupCounts(ran)) parts.push(pair);\n const breakdown = parts.length > 0 ? ` (${parts.join(' · ')})` : '';\n const skip = skipped > 0 ? ` · ${skipped} skipped ✅` : '';\n // Counted SEPARATELY from \"skipped\", and without a ✅. A declined optional review is a legitimate\n // outcome, but it is not the same good news as a checklist that had nothing to look at — folding the\n // two together would let a PR that declined every optional review read as fully covered.\n const notRun = declined.length > 0 ? ` · ${declined.length} optional not run` : '';\n return `## 🔍 Company review checklists — ${rows.length} defined · ${ran.length} ran${breakdown}${skip}${notRun}`;\n }\n\n // `🟢 2 · 🟡 1` — only the non-zero buckets, so a clean run reads as one number rather than four.\n private rollupCounts(ran: readonly ChecklistCommentRow[]): string[] {\n const counts: string[] = [];\n const emojiFor: string[] = ['🟢', '🟡', '🟠'];\n const statusFor: string[] = [CK_PASS, CK_WARN, CK_OVERRIDDEN];\n statusFor.forEach((status: string, i: number): void => {\n const n = ran.filter((r: ChecklistCommentRow): boolean => r.status === status).length;\n if (n > 0) counts.push(`${emojiFor[i]} ${n}`);\n });\n return counts;\n }\n\n // One roster line + its why sub-bullet. A checked box means a reviewer ran; an unchecked one means the\n // checklist was evaluated and did not apply, which the words state as the good news it is.\n private rosterBullet(row: ChecklistCommentRow): string {\n const box = this.reviewerRan(row) ? '- [x]' : '- [ ]';\n return (\n `${box} ${this.verdictEmoji(row)} **${row.checklistId}**${this.optionalTag(row)} — ` +\n `${this.verdictWords(row)}${this.evidenceSuffix(row)}\\n` +\n ` - ${this.whyLine(row)}`\n );\n }\n\n /**\n * Did a reviewer actually produce a verdict for this row?\n *\n * `row.ran` is really \"this checklist APPLIED to the diff\" — for a required checklist the two are the\n * same thing, because the PR cannot open otherwise, and the field was named before optional checklists\n * existed. For a DECLINED optional one they diverge, and using `ran` alone would put a checked box and a\n * reviewer section on a review that nobody performed.\n */\n private reviewerRan(row: ChecklistCommentRow): boolean {\n return row.ran && !this.declined(row);\n }\n\n // Applied, optional, and carrying no verdict — i.e. the human was offered this review and said no (or\n // `--no-optional` skipped the offer). Never true of a required checklist: one of those with no verdict\n // does not reach a PR at all.\n private declined(row: ChecklistCommentRow): boolean {\n return row.ran && !row.required && (row.status === CK_MISSING || row.status === '');\n }\n\n // Marks which rows the human could have declined. Without it a reader cannot tell a review that was\n // skippable from one that simply passed, and so cannot judge how much this PR was actually reviewed.\n private optionalTag(row: ChecklistCommentRow): string {\n return row.required ? '' : ' _(optional)_';\n }\n\n /**\n * Whether the reviewer demonstrably opened the diff, read from its own transcript. A QUALITY signal and\n * never a blocker (see SubagentProvenanceService.evidenceFor) — but published, because \"wrote a verdict\n * without reading the change\" is exactly what a reader of this comment would want to weigh.\n */\n private evidenceSuffix(row: ChecklistCommentRow): string {\n if (!this.reviewerRan(row) || row.diffRead === '') return '';\n return row.diffRead === 'yes' ? ' _(diff read ✓)_' : ' _(⚠️ no diff read recorded)_';\n }\n\n private verdictEmoji(row: ChecklistCommentRow): string {\n if (!this.reviewerRan(row)) return '⚪';\n if (row.status === CK_PASS) return '🟢';\n if (row.status === CK_WARN) return '🟡';\n if (row.status === CK_OVERRIDDEN) return '🟠';\n if (row.status === CK_FAIL) return '🔴';\n return '⚪';\n }\n\n // SHORT words for a roster line / section heading. Short on purpose: the reviewer's own output and any\n // override justification get their own section below, and a roster exists to be scanned.\n private verdictWords(row: ChecklistCommentRow): string {\n // Two different unchecked boxes, two different sentences. \"Not applicable\" is the diff's doing;\n // \"not run\" is a person's, and reporting the second as the first would quietly credit a review that\n // a human deliberately declined.\n if (this.declined(row)) return 'OPTIONAL — applied to this diff but was NOT run (not selected)';\n if (!row.ran) return 'skipped, not applicable to this diff (expected ✅)';\n if (row.status === CK_PASS) return 'passed';\n if (row.status === CK_WARN) return 'passed with concerns';\n // Names the FILE the authorization lives in, so a reader of the PR can go and check the provenance\n // rather than take \"someone approved this\" on trust. The reason, who authorized it and when are\n // rendered verbatim in this row's section below.\n if (row.status === CK_OVERRIDDEN) {\n return `OVERRIDDEN — a human authorized shipping it (recorded in override-${row.checklistId}.json)`;\n }\n if (row.status === CK_FAIL) return 'FAILED review';\n if (row.status === CK_MISSING) return 'no verdict written';\n return `unknown verdict (${row.status})`;\n }\n\n /**\n * WHY this checklist ran or did not — the line that answers \"why was this reviewer involved?\". Branches\n * on `configuredPatterns`, NEVER on `firedPatterns.length`: a patternless checklist and a skipped one\n * both fired zero globs and they mean opposite things, so keying off the fired list would tell every\n * skipped checklist's reader that the whole diff had been in its scope.\n */\n private whyLine(row: ChecklistCommentRow): string {\n const total = row.changedFileCount;\n if (row.configuredPatterns.length === 0) {\n // State the fact, not a suspicion. Patternless is a deliberate configuration — an always-runs\n // gate (every PR names a ticket, every PR has an owner) is exactly what it is FOR — so telling\n // every such row to \"add `patterns` if that is not intended\" nags the repos that meant it, on\n // every PR, forever. A reader who wants to know whether it was intended can read the config.\n return (\n `ALWAYS RUNS (no patterns) — whole diff in scope, ${total} changed file(s): ` +\n `${formatFileList(row.matchedFiles)}`\n );\n }\n const configured = this.asCode(row.configuredPatterns);\n if (row.firedPatterns.length === 0) {\n return `${configured} matched 0 of ${total} changed file(s)`;\n }\n return (\n `matched ${this.asCode(row.firedPatterns)} → ${row.matchedFiles.length} of ${total} ` +\n `changed file(s): ${formatFileList(row.matchedFiles)}`\n );\n }\n\n private asCode(patterns: readonly string[]): string {\n return patterns.map((p: string): string => `\\`${p}\\``).join(', ');\n }\n\n // Reviewers that ran, exceptions first (overridden → warned → passed) so a reader meets what needs\n // attention before a wall of green.\n private ranOrdered(rows: readonly ChecklistCommentRow[]): ChecklistCommentRow[] {\n const rank: string[] = [CK_OVERRIDDEN, CK_WARN, CK_PASS];\n return rows\n .filter((r: ChecklistCommentRow): boolean => this.reviewerRan(r))\n .slice()\n .sort(\n (a: ChecklistCommentRow, b: ChecklistCommentRow): number =>\n this.rankOf(rank, a.status) - this.rankOf(rank, b.status),\n );\n }\n\n private rankOf(rank: readonly string[], status: string): number {\n const idx = rank.indexOf(status);\n return idx < 0 ? rank.length : idx;\n }\n\n private commentSection(row: ChecklistCommentRow): CommentSection {\n const heading = `#### ${this.verdictEmoji(row)} ${row.checklistId} — ${this.verdictWords(row)}`;\n const body =\n row.detail.trim() !== '' ? row.detail.trim() : '_(reviewer recorded no output)_';\n return new CommentSection(heading + '\\n\\n' + new ReviewIdentityRenderer().render(row.agent, row.model), body);\n }\n\n // Keep the comment under GitHub's size cap by shrinking the LONGEST section body first (so a short\n // overridden note is never cut to make room for a long passing one), never dropping a verdict heading.\n private fitComment(header: string, sections: CommentSection[]): string {\n const assemble = (): string =>\n `${header}\\n\\n${sections.map((s: CommentSection): string => `${s.heading}\\n\\n${s.body}`).join('\\n\\n')}`;\n const trunc = '\\n\\n…_[truncated to fit the GitHub comment size limit]_';\n let out = assemble();\n while (out.length > COMMENT_LIMIT) {\n const idx = this.longestBodyIndex(sections);\n if (idx < 0 || sections[idx].body.length <= trunc.length + 1) break;\n const over = out.length - COMMENT_LIMIT;\n const keep = Math.max(0, sections[idx].body.length - over - trunc.length - 8);\n sections[idx].body = sections[idx].body.slice(0, keep).trimEnd() + trunc;\n out = assemble();\n }\n return out;\n }\n\n private longestBodyIndex(sections: readonly CommentSection[]): number {\n let idx = -1;\n let max = -1;\n sections.forEach((s: CommentSection, i: number): void => {\n if (s.body.length > max) {\n max = s.body.length;\n idx = i;\n }\n });\n return idx;\n }\n}\n"]}
@@ -13,7 +13,7 @@
13
13
  export declare class ChecklistCommentRow {
14
14
  agent: string;
15
15
  model: string;
16
- subagent: string;
16
+ checklistId: string;
17
17
  status: string;
18
18
  detail: string;
19
19
  ran: boolean;
@@ -40,5 +40,5 @@ export declare class ChecklistCommentRow {
40
40
  * to set it is reported as the stricter of the two.
41
41
  */
42
42
  required: boolean;
43
- constructor(agent: string, model: string, subagent: string, status: string, detail: string, ran: boolean, configuredPatterns: string[], firedPatterns: string[], matchedFiles: string[], changedFileCount: number);
43
+ constructor(agent: string, model: string, checklistId: string, status: string, detail: string, ran: boolean, configuredPatterns: string[], firedPatterns: string[], matchedFiles: string[], changedFileCount: number);
44
44
  }
@@ -16,7 +16,7 @@ exports.ChecklistCommentRow = void 0;
16
16
  class ChecklistCommentRow {
17
17
  agent;
18
18
  model;
19
- subagent; // the reviewer / checklist id
19
+ checklistId; // the checklist id
20
20
  status; // CK_* verdict; '' when it did not run
21
21
  detail; // verbatim reviewer output
22
22
  ran; // false = skipped, which is a NORMAL, healthy outcome
@@ -46,10 +46,10 @@ class ChecklistCommentRow {
46
46
  */
47
47
  required = true;
48
48
  // eslint-disable-next-line @typescript-eslint/max-params
49
- constructor(agent, model, subagent, status, detail, ran, configuredPatterns, firedPatterns, matchedFiles, changedFileCount) {
49
+ constructor(agent, model, checklistId, status, detail, ran, configuredPatterns, firedPatterns, matchedFiles, changedFileCount) {
50
50
  this.agent = agent;
51
51
  this.model = model;
52
- this.subagent = subagent;
52
+ this.checklistId = checklistId;
53
53
  this.status = status;
54
54
  this.detail = detail;
55
55
  this.ran = ran;
@@ -1 +1 @@
1
- {"version":3,"file":"checklist-comment-row.js","sourceRoot":"","sources":["../../../../../../packages/tooling/pr-gate/src/dashboard/checklist-comment-row.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;GAWG;AACH,MAAa,mBAAmB;IAC5B,KAAK,CAAS;IACd,KAAK,CAAS;IACd,QAAQ,CAAS,CAAC,8BAA8B;IAChD,MAAM,CAAS,CAAC,uCAAuC;IACvD,MAAM,CAAS,CAAC,2BAA2B;IAC3C,GAAG,CAAU,CAAC,sDAAsD;IACpE,wGAAwG;IACxG,mFAAmF;IACnF,kBAAkB,CAAW;IAC7B,aAAa,CAAW,CAAC,qDAAqD;IAC9E,YAAY,CAAW;IACvB,gBAAgB,CAAS,CAAC,+DAA+D;IACzF;;;;;;;OAOG;IACH,QAAQ,GAAW,EAAE,CAAC;IACtB;;;;;;;;OAQG;IACH,QAAQ,GAAY,IAAI,CAAC;IAEzB,yDAAyD;IACzD,YAAY,KAAa,EAAE,KAAa,EACpC,QAAgB,EAChB,MAAc,EACd,MAAc,EACd,GAAY,EACZ,kBAA4B,EAC5B,aAAuB,EACvB,YAAsB,EACtB,gBAAwB;QAExB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;QAC7C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC7C,CAAC;CACJ;AAvDD,kDAuDC","sourcesContent":["/**\n * One roster line of the checklist COMMENT: a defined checklist, whether its reviewer ran, and the evidence\n * for WHY. Deliberately separate from {@link ChecklistRow} rather than five more fields on it — ChecklistRow\n * also feeds the PR body and the squash-commit body, and roster evidence has no business travelling into\n * main's git history or through every DashboardInput construction site.\n *\n * Kept in pr-gate, not rules-config: the shape of a GitHub comment is this package's concern, and\n * rules-config is the dependency, not the dependent. Its own FILE (rather than sitting in dashboard.ts)\n * per the one-class-per-file convention — dashboard.ts is a large renderer against a hard max-file-lines\n * limit, while this is a data class its consumers construct directly: finish builds these, Dashboard only\n * reads them.\n */\nexport class ChecklistCommentRow {\n agent: string;\n model: string;\n subagent: string; // the reviewer / checklist id\n status: string; // CK_* verdict; '' when it did not run\n detail: string; // verbatim reviewer output\n ran: boolean; // false = skipped, which is a NORMAL, healthy outcome\n // The checklist's CONFIGURED globs. The only safe signal for \"always runs\": a patternless checklist and\n // a skipped one both have an empty `firedPatterns`, and they mean opposite things.\n configuredPatterns: string[];\n firedPatterns: string[]; // which configured globs actually hit a changed file\n matchedFiles: string[];\n changedFileCount: number; // how many files were considered at all — \"0 of N\" needs the N\n /**\n * Whether this reviewer's own transcript shows it OPENING the extracted diff.\n *\n * '' = not assessed (no Claude Code session, or nothing was materialized) and prints nothing — \"no\n * evidence recorded\" and \"evidence says it never looked\" are different claims, and conflating them\n * would accuse a reviewer that ran perfectly well in CI. 'yes' | 'no' otherwise. Defaulted, so every\n * existing construction site is unchanged.\n */\n diffRead: string = '';\n /**\n * The checklist's configured `required`. Published because \"no verdict\" means two opposite things and the\n * roster is the only place a reader can tell them apart: a REQUIRED checklist with no verdict could not\n * have opened this PR at all, so seeing one means something went wrong; an OPTIONAL one with no verdict\n * is a review the human was offered and declined, which is the feature working.\n *\n * Defaulted to the blocking value so every existing construction site is unchanged and a row that forgets\n * to set it is reported as the stricter of the two.\n */\n required: boolean = true;\n\n // eslint-disable-next-line @typescript-eslint/max-params\n constructor(agent: string, model: string,\n subagent: string,\n status: string,\n detail: string,\n ran: boolean,\n configuredPatterns: string[],\n firedPatterns: string[],\n matchedFiles: string[],\n changedFileCount: number,\n ) {\n this.agent = agent;\n this.model = model;\n this.subagent = subagent;\n this.status = status;\n this.detail = detail;\n this.ran = ran;\n this.configuredPatterns = configuredPatterns;\n this.firedPatterns = firedPatterns;\n this.matchedFiles = matchedFiles;\n this.changedFileCount = changedFileCount;\n }\n}\n"]}
1
+ {"version":3,"file":"checklist-comment-row.js","sourceRoot":"","sources":["../../../../../../packages/tooling/pr-gate/src/dashboard/checklist-comment-row.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;GAWG;AACH,MAAa,mBAAmB;IAC5B,KAAK,CAAS;IACd,KAAK,CAAS;IACd,WAAW,CAAS,CAAC,mBAAmB;IACxC,MAAM,CAAS,CAAC,uCAAuC;IACvD,MAAM,CAAS,CAAC,2BAA2B;IAC3C,GAAG,CAAU,CAAC,sDAAsD;IACpE,wGAAwG;IACxG,mFAAmF;IACnF,kBAAkB,CAAW;IAC7B,aAAa,CAAW,CAAC,qDAAqD;IAC9E,YAAY,CAAW;IACvB,gBAAgB,CAAS,CAAC,+DAA+D;IACzF;;;;;;;OAOG;IACH,QAAQ,GAAW,EAAE,CAAC;IACtB;;;;;;;;OAQG;IACH,QAAQ,GAAY,IAAI,CAAC;IAEzB,yDAAyD;IACzD,YAAY,KAAa,EAAE,KAAa,EACpC,WAAmB,EACnB,MAAc,EACd,MAAc,EACd,GAAY,EACZ,kBAA4B,EAC5B,aAAuB,EACvB,YAAsB,EACtB,gBAAwB;QAExB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;QAC7C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC7C,CAAC;CACJ;AAvDD,kDAuDC","sourcesContent":["/**\n * One roster line of the checklist COMMENT: a defined checklist, whether its reviewer ran, and the evidence\n * for WHY. Deliberately separate from {@link ChecklistRow} rather than five more fields on it — ChecklistRow\n * also feeds the PR body and the squash-commit body, and roster evidence has no business travelling into\n * main's git history or through every DashboardInput construction site.\n *\n * Kept in pr-gate, not rules-config: the shape of a GitHub comment is this package's concern, and\n * rules-config is the dependency, not the dependent. Its own FILE (rather than sitting in dashboard.ts)\n * per the one-class-per-file convention — dashboard.ts is a large renderer against a hard max-file-lines\n * limit, while this is a data class its consumers construct directly: finish builds these, Dashboard only\n * reads them.\n */\nexport class ChecklistCommentRow {\n agent: string;\n model: string;\n checklistId: string; // the checklist id\n status: string; // CK_* verdict; '' when it did not run\n detail: string; // verbatim reviewer output\n ran: boolean; // false = skipped, which is a NORMAL, healthy outcome\n // The checklist's CONFIGURED globs. The only safe signal for \"always runs\": a patternless checklist and\n // a skipped one both have an empty `firedPatterns`, and they mean opposite things.\n configuredPatterns: string[];\n firedPatterns: string[]; // which configured globs actually hit a changed file\n matchedFiles: string[];\n changedFileCount: number; // how many files were considered at all — \"0 of N\" needs the N\n /**\n * Whether this reviewer's own transcript shows it OPENING the extracted diff.\n *\n * '' = not assessed (no Claude Code session, or nothing was materialized) and prints nothing — \"no\n * evidence recorded\" and \"evidence says it never looked\" are different claims, and conflating them\n * would accuse a reviewer that ran perfectly well in CI. 'yes' | 'no' otherwise. Defaulted, so every\n * existing construction site is unchanged.\n */\n diffRead: string = '';\n /**\n * The checklist's configured `required`. Published because \"no verdict\" means two opposite things and the\n * roster is the only place a reader can tell them apart: a REQUIRED checklist with no verdict could not\n * have opened this PR at all, so seeing one means something went wrong; an OPTIONAL one with no verdict\n * is a review the human was offered and declined, which is the feature working.\n *\n * Defaulted to the blocking value so every existing construction site is unchanged and a row that forgets\n * to set it is reported as the stricter of the two.\n */\n required: boolean = true;\n\n // eslint-disable-next-line @typescript-eslint/max-params\n constructor(agent: string, model: string,\n checklistId: string,\n status: string,\n detail: string,\n ran: boolean,\n configuredPatterns: string[],\n firedPatterns: string[],\n matchedFiles: string[],\n changedFileCount: number,\n ) {\n this.agent = agent;\n this.model = model;\n this.checklistId = checklistId;\n this.status = status;\n this.detail = detail;\n this.ran = ran;\n this.configuredPatterns = configuredPatterns;\n this.firedPatterns = firedPatterns;\n this.matchedFiles = matchedFiles;\n this.changedFileCount = changedFileCount;\n }\n}\n"]}
@@ -202,8 +202,8 @@ let FinishUpsertPrCommand = class FinishUpsertPrCommand {
202
202
  // distinction between unreadable / REFUSED / never-ran, and retires the red verdicts it acts on.
203
203
  this.verdictGate.assertEveryReviewerRan(scan);
204
204
  const review = this.reviewJsonService.loadReviewJson((0, rules_config_1.reviewJsonPath)(repoRoot, featureName), required, scan.singleRoundReview ? rules_config_1.SINGLE_ROUND_MAIN_AGENT_INSTRUCTIONS : '');
205
- // 2c. For any BLOCK checklist that names a reviewer `subagent`, VERIFY (from the harness's own
206
- // artifacts) that such a subagent actually ran on this branch — the coding agent may not
205
+ // 2c. For every verdicted checklist, VERIFY (from the harness's own artifacts) that a subagent of the
206
+ // repo's reviewerAgentName type actually ran on this branch — the coding agent may not
207
207
  // self-certify. Absent CLAUDE_CODE_SESSION_ID this skips with a warning (CI / plain terminal).
208
208
  const currentBranch = (0, child_process_1.execSync)('git branch --show-current', { encoding: 'utf8' }).trim();
209
209
  const provenance = this.provenanceEnforcer.enforce(verdicted, currentBranch, repoRoot, (0, rules_config_1.loadAndValidate)(repoRoot).prGate);
@@ -419,22 +419,22 @@ let FinishUpsertPrCommand = class FinishUpsertPrCommand {
419
419
  * changed-file total) exists nowhere else without recomputing the diff a second way.
420
420
  */
421
421
  commentRows(scan, review, provenance) {
422
- // agentType -> did it open the diff. Absent ⇒ not assessed, which prints nothing (see ChecklistCommentRow.diffRead).
423
- const readByAgent = new Map();
422
+ // checklist id -> did its reviewer open the diff. Absent ⇒ not assessed, which prints nothing (see ChecklistCommentRow.diffRead).
423
+ const readByChecklist = new Map();
424
424
  for (const e of provenance.evidence)
425
- readByAgent.set(e.agentType, e.readDiff);
425
+ readByChecklist.set(e.checklistId, e.readDiff);
426
426
  return scan.roster.entries.map((entry) => {
427
427
  const ran = entry.matchedFiles.length > 0;
428
- const req = new rules_config_1.RequiredChecklist(entry.def.id, entry.def.subagent, entry.def.doc, entry.matchedFiles, entry.matchedPatterns, entry.def.required);
428
+ const req = new rules_config_1.RequiredChecklist(entry.def.id, entry.def.reviewer, entry.def.doc, entry.matchedFiles, entry.matchedPatterns, entry.def.required);
429
429
  // A skipped checklist has no verdict to resolve — asking for one would report it as MISSING,
430
430
  // i.e. as an unreviewed obligation, when in fact it never had one.
431
431
  const verdict = ran
432
432
  ? this.reviewJsonService.resolveVerdict(req, review.results)
433
433
  : new rules_config_1.ChecklistVerdict(entry.def.id, '', '');
434
434
  const identity = review.results.find((result) => result.id === entry.def.id);
435
- const row = new checklist_comment_row_1.ChecklistCommentRow(identity?.agent ?? 'unknown', identity?.model ?? 'unknown', entry.def.subagent, verdict.status, verdict.detail, ran, entry.def.patterns, entry.matchedPatterns, entry.matchedFiles, scan.roster.changedFileCount);
435
+ const row = new checklist_comment_row_1.ChecklistCommentRow(identity?.agent ?? 'unknown', identity?.model ?? 'unknown', entry.def.id, verdict.status, verdict.detail, ran, entry.def.patterns, entry.matchedPatterns, entry.matchedFiles, scan.roster.changedFileCount);
436
436
  row.required = entry.def.required;
437
- const read = readByAgent.get(entry.def.subagent);
437
+ const read = readByChecklist.get(entry.def.id);
438
438
  row.diffRead = read === undefined ? '' : (read ? 'yes' : 'no');
439
439
  return row;
440
440
  });