@webpieces/pr-gate 0.4.825 โ 0.4.827
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/dashboard/checklist-comment-renderer.js +8 -6
- package/src/dashboard/checklist-comment-renderer.js.map +1 -1
- package/src/dashboard/checklist-comment-row.d.ts +6 -0
- package/src/dashboard/checklist-comment-row.js +6 -0
- package/src/dashboard/checklist-comment-row.js.map +1 -1
- package/src/dashboard/dashboard.d.ts +11 -0
- package/src/dashboard/dashboard.js +24 -6
- package/src/dashboard/dashboard.js.map +1 -1
- package/src/scripts/commands/await-reviews-command.d.ts +3 -3
- package/src/scripts/commands/await-reviews-command.js +25 -21
- package/src/scripts/commands/await-reviews-command.js.map +1 -1
- package/src/scripts/commands/finish-upsert-pr-command.js +26 -21
- package/src/scripts/commands/finish-upsert-pr-command.js.map +1 -1
- package/src/scripts/commands/review-upsert-pr-command.d.ts +3 -8
- package/src/scripts/commands/review-upsert-pr-command.js +16 -18
- package/src/scripts/commands/review-upsert-pr-command.js.map +1 -1
- package/src/scripts/commands/write-review-command.d.ts +43 -7
- package/src/scripts/commands/write-review-command.js +91 -12
- package/src/scripts/commands/write-review-command.js.map +1 -1
- package/src/scripts/commands/write-review-fixes-command.d.ts +5 -1
- package/src/scripts/commands/write-review-fixes-command.js +6 -2
- package/src/scripts/commands/write-review-fixes-command.js.map +1 -1
- package/src/scripts/pr-gate-app.d.ts +3 -1
- package/src/scripts/pr-gate-app.js +4 -0
- package/src/scripts/pr-gate-app.js.map +1 -1
- package/src/scripts/workflow/checklist-scanner.d.ts +61 -10
- package/src/scripts/workflow/checklist-scanner.js +105 -16
- package/src/scripts/workflow/checklist-scanner.js.map +1 -1
- package/src/scripts/workflow/hotfix-finish-preparer.js +1 -1
- package/src/scripts/workflow/hotfix-finish-preparer.js.map +1 -1
- package/src/scripts/workflow/provenance-enforcer.d.ts +2 -2
- package/src/scripts/workflow/provenance-enforcer.js +5 -5
- package/src/scripts/workflow/provenance-enforcer.js.map +1 -1
- package/src/scripts/workflow/review-report.d.ts +26 -8
- package/src/scripts/workflow/review-report.js +65 -39
- package/src/scripts/workflow/review-report.js.map +1 -1
- package/src/scripts/workflow/review-round-state.d.ts +90 -11
- package/src/scripts/workflow/review-round-state.js +256 -85
- package/src/scripts/workflow/review-round-state.js.map +1 -1
- package/src/scripts/workflow/review-round-text.d.ts +37 -0
- package/src/scripts/workflow/review-round-text.js +87 -0
- package/src/scripts/workflow/review-round-text.js.map +1 -0
- package/src/scripts/workflow/review-stage-receipt.d.ts +7 -6
- package/src/scripts/workflow/review-stage-receipt.js +7 -11
- package/src/scripts/workflow/review-stage-receipt.js.map +1 -1
- package/src/scripts/workflow/reviewer-briefing-builder.js +0 -1
- package/src/scripts/workflow/reviewer-briefing-builder.js.map +1 -1
- package/src/scripts/workflow/reviewer-verdict-gate.d.ts +14 -26
- package/src/scripts/workflow/reviewer-verdict-gate.js +38 -51
- package/src/scripts/workflow/reviewer-verdict-gate.js.map +1 -1
- package/src/scripts/workflow/verdict-provenance.d.ts +13 -7
- package/src/scripts/workflow/verdict-provenance.js +30 -22
- package/src/scripts/workflow/verdict-provenance.js.map +1 -1
- package/src/scripts/wp-write-review.js +7 -0
- package/src/scripts/wp-write-review.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webpieces/pr-gate",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.827",
|
|
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.
|
|
20
|
-
"@webpieces/rules-config": "0.4.
|
|
19
|
+
"@webpieces/ai-hook-rules": "0.4.827",
|
|
20
|
+
"@webpieces/rules-config": "0.4.827",
|
|
21
21
|
"inversify": "7.10.4",
|
|
22
22
|
"reflect-metadata": "0.2.2"
|
|
23
23
|
},
|
|
@@ -174,7 +174,7 @@ let ChecklistCommentRenderer = class ChecklistCommentRenderer {
|
|
|
174
174
|
rollupCounts(ran) {
|
|
175
175
|
const counts = [];
|
|
176
176
|
const emojiFor = ['๐ข', '๐ก', '๐ ', '๐ '];
|
|
177
|
-
const statusFor = [rules_config_1.CK_PASS, rules_config_1.CK_WARN, rules_config_1.CK_OVERRIDDEN, rules_config_1.
|
|
177
|
+
const statusFor = [rules_config_1.CK_PASS, rules_config_1.CK_WARN, rules_config_1.CK_OVERRIDDEN, rules_config_1.CK_ORANGE_FIXED];
|
|
178
178
|
statusFor.forEach((status, i) => {
|
|
179
179
|
const n = ran.filter((r) => r.status === status).length;
|
|
180
180
|
if (n > 0)
|
|
@@ -197,7 +197,7 @@ let ChecklistCommentRenderer = class ChecklistCommentRenderer {
|
|
|
197
197
|
* reviewer section on a review that nobody performed.
|
|
198
198
|
*/
|
|
199
199
|
reviewerRan(row) {
|
|
200
|
-
return row.ran && !this.declined(row);
|
|
200
|
+
return row.ran && !this.declined(row) && !row.notBriefed;
|
|
201
201
|
}
|
|
202
202
|
// Applied, optional, and carrying no verdict โ i.e. the human was offered this review and said no (or
|
|
203
203
|
// `--no-optional` skipped the offer). Never true of a required checklist: one of those with no verdict
|
|
@@ -227,7 +227,7 @@ let ChecklistCommentRenderer = class ChecklistCommentRenderer {
|
|
|
227
227
|
return '๐ข';
|
|
228
228
|
if (row.status === rules_config_1.CK_WARN)
|
|
229
229
|
return '๐ก';
|
|
230
|
-
if (row.status === rules_config_1.CK_OVERRIDDEN || row.status === rules_config_1.
|
|
230
|
+
if (row.status === rules_config_1.CK_OVERRIDDEN || row.status === rules_config_1.CK_ORANGE_FIXED)
|
|
231
231
|
return '๐ ';
|
|
232
232
|
if (row.status === rules_config_1.CK_FAIL)
|
|
233
233
|
return '๐ด';
|
|
@@ -241,6 +241,8 @@ let ChecklistCommentRenderer = class ChecklistCommentRenderer {
|
|
|
241
241
|
// a human deliberately declined.
|
|
242
242
|
if (this.declined(row))
|
|
243
243
|
return 'OPTIONAL โ applied to this diff but was NOT run (not selected)';
|
|
244
|
+
if (row.notBriefed)
|
|
245
|
+
return 'NOT REVIEWED, not blocking โ first triggered after the review was briefed';
|
|
244
246
|
if (!row.ran)
|
|
245
247
|
return 'skipped, not applicable to this diff (expected โ
)';
|
|
246
248
|
if (row.status === rules_config_1.CK_PASS)
|
|
@@ -253,8 +255,8 @@ let ChecklistCommentRenderer = class ChecklistCommentRenderer {
|
|
|
253
255
|
if (row.status === rules_config_1.CK_OVERRIDDEN) {
|
|
254
256
|
return `OVERRIDDEN โ a human authorized shipping it (recorded in override-${row.checklistId}.json)`;
|
|
255
257
|
}
|
|
256
|
-
if (row.status === rules_config_1.
|
|
257
|
-
return '
|
|
258
|
+
if (row.status === rules_config_1.CK_ORANGE_FIXED)
|
|
259
|
+
return 'ORANGE on the final round โ author-fixed, NOT re-reviewed';
|
|
258
260
|
if (row.status === rules_config_1.CK_FAIL)
|
|
259
261
|
return 'FAILED review';
|
|
260
262
|
if (row.status === rules_config_1.CK_MISSING)
|
|
@@ -288,7 +290,7 @@ let ChecklistCommentRenderer = class ChecklistCommentRenderer {
|
|
|
288
290
|
// Reviewers that ran, exceptions first (overridden โ warned โ passed) so a reader meets what needs
|
|
289
291
|
// attention before a wall of green.
|
|
290
292
|
ranOrdered(rows) {
|
|
291
|
-
const rank = [rules_config_1.
|
|
293
|
+
const rank = [rules_config_1.CK_ORANGE_FIXED, rules_config_1.CK_OVERRIDDEN, rules_config_1.CK_WARN, rules_config_1.CK_PASS];
|
|
292
294
|
return rows
|
|
293
295
|
.filter((r) => this.reviewerRan(r))
|
|
294
296
|
.slice()
|
|
@@ -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,0DAAuN;AACvN,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,EACvB,MAAe;QAEf,IAAI,MAAM;YAAE,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC5C,IAAI,eAAe,GAAG,CAAC;YAAE,OAAO,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QAC9E,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAClC,MAAM,IAAI,GAAG,kBAAkB,CAAC,CAAC,CAAC,6FAA6F,CAAC,CAAC,CAAC,iGAAiG,CAAC;QACpO,mGAAmG;QACnG,8EAA8E;QAC9E,MAAM,KAAK,GAAa,CAAC,gCAAwB,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;QAC1F,kGAAkG;QAClG,IAAI,GAAG,CAA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C,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YAC9E,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,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;AA/SY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,sBAAU,EAAC,8BAAkB,CAAC,SAAS,CAAC;GAC5B,wBAAwB,CA+SpC","sourcesContent":["import { ReviewIdentityRenderer } from './review-identity-renderer';\nimport { formatFileList, CK_PASS, CK_WARN, CK_OVERRIDDEN, CK_REMEDIATED, CK_FAIL, CK_MISSING, HOME_CONFIG_DIR, HOME_CONFIG_FILE, HOME_KEY_TURN_OFF_ALL_REVIEWERS, HOTFIX_AUDIT_BANNER } 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 hotfix: boolean,\n ): string {\n if (hotfix) return this.hotfixComment(rows);\n if (suppressedCount > 0) return this.suppressedComment(rows, suppressedCount);\n const ran = this.ranOrdered(rows);\n const prov = provenanceVerified ? '_Each reviewer ran as its own independent subagent, verified from the Claude Code harness._' : '_โ ๏ธ 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 private hotfixComment(rows: readonly ChecklistCommentRow[]): string {\n const lines = [\n HOTFIX_AUDIT_BANNER,\n '',\n CHECKLIST_COMMENT_MARKER,\n '## ๐ Company review checklists โ โซ BYPASSED BY /hotfix/',\n '_0 reviewer agents ran. Required and optional checklists were bypassed by the exact, case-sensitive /hotfix/ branch convention._',\n '',\n `### Checklists (all ${rows.length})`,\n ];\n for (const row of rows) {\n const applicability = row.ran ? 'would have applied to this diff' : 'did not apply to this diff';\n lines.push(`- [ ] **${row.checklistId}** โ โซ BYPASSED (${applicability}; no reviewer ran)`);\n }\n return lines.join('\\n');\n }\n\n /**\n * The whole comment when the project or machine reviewer policy disabled 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. Reviewer suppression is controlled by ` +\n `\\`commands.pr-gate.reviewerAgents: 0\\` in \\`webpieces.config.json\\` or ` +\n `\\`experimental.${HOME_KEY_TURN_OFF_ALL_REVIEWERS}: true\\` in the machine-local ` +\n `\\`~/${HOME_CONFIG_DIR}/${HOME_CONFIG_FILE}\\`. **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 ? `โซ SUPPRESSED${row.required ? ' (REQUIRED)' : ' (optional)'} โ no reviewer ran` : 'โช 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 `_No reviewer ran. ${declined.length} OPTIONAL checklist(s) DID apply to this diff and were not ` + `run; the rest were evaluated and did not apply._`;\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 `## ๐ Company review checklists โ โ ๏ธ NOT EVALUATED (${rows.length} defined)\\n` + `_No diff base (fork point of main) could be resolved, so no checklist was matched against ` + `anything. This is **not** an all-clear._`;\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, CK_REMEDIATED];\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 `${box} ${this.verdictEmoji(row)} **${row.checklistId}**${this.optionalTag(row)} โ ` + `${this.verdictWords(row)}${this.evidenceSuffix(row)}\\n` + ` - ${this.whyLine(row)}`;\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 || row.status === CK_REMEDIATED) 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_REMEDIATED) return 'AUTHOR-REMEDIATED AFTER REVIEW CAP โ NOT RE-REVIEWED';\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 `ALWAYS RUNS (no patterns) โ whole diff in scope, ${total} changed file(s): ` + `${formatFileList(row.matchedFiles)}`;\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 `matched ${this.asCode(row.firedPatterns)} โ ${row.matchedFiles.length} of ${total} ` + `changed file(s): ${formatFileList(row.matchedFiles)}`;\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_REMEDIATED, CK_OVERRIDDEN, CK_WARN, CK_PASS];\n return rows\n .filter((r: ChecklistCommentRow): boolean => this.reviewerRan(r))\n .slice()\n .sort((a: ChecklistCommentRow, b: ChecklistCommentRow): number => this.rankOf(rank, a.status) - this.rankOf(rank, b.status));\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 = 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 => `${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":["../../../../../../packages/tooling/pr-gate/src/dashboard/checklist-comment-renderer.ts"],"names":[],"mappings":";;;;AAAA,yEAAoE;AACpE,0DAAyN;AACzN,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;;;;;;;;;;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AAG,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;AAhTY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,sBAAU,EAAC,8BAAkB,CAAC,SAAS,CAAC;GAC5B,wBAAwB,CAgTpC","sourcesContent":["import { ReviewIdentityRenderer } from './review-identity-renderer';\nimport { formatFileList, CK_PASS, CK_WARN, CK_OVERRIDDEN, CK_ORANGE_FIXED, CK_FAIL, CK_MISSING, HOME_CONFIG_DIR, HOME_CONFIG_FILE, HOME_KEY_TURN_OFF_ALL_REVIEWERS, HOTFIX_AUDIT_BANNER } 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 hotfix: boolean,\n ): string {\n if (hotfix) return this.hotfixComment(rows);\n if (suppressedCount > 0) return this.suppressedComment(rows, suppressedCount);\n const ran = this.ranOrdered(rows);\n const prov = provenanceVerified ? '_Each reviewer ran as its own independent subagent, verified from the Claude Code harness._' : '_โ ๏ธ 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 private hotfixComment(rows: readonly ChecklistCommentRow[]): string {\n const lines = [\n HOTFIX_AUDIT_BANNER,\n '',\n CHECKLIST_COMMENT_MARKER,\n '## ๐ Company review checklists โ โซ BYPASSED BY /hotfix/',\n '_0 reviewer agents ran. Required and optional checklists were bypassed by the exact, case-sensitive /hotfix/ branch convention._',\n '',\n `### Checklists (all ${rows.length})`,\n ];\n for (const row of rows) {\n const applicability = row.ran ? 'would have applied to this diff' : 'did not apply to this diff';\n lines.push(`- [ ] **${row.checklistId}** โ โซ BYPASSED (${applicability}; no reviewer ran)`);\n }\n return lines.join('\\n');\n }\n\n /**\n * The whole comment when the project or machine reviewer policy disabled 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. Reviewer suppression is controlled by ` +\n `\\`commands.pr-gate.reviewerAgents: 0\\` in \\`webpieces.config.json\\` or ` +\n `\\`experimental.${HOME_KEY_TURN_OFF_ALL_REVIEWERS}: true\\` in the machine-local ` +\n `\\`~/${HOME_CONFIG_DIR}/${HOME_CONFIG_FILE}\\`. **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 ? `โซ SUPPRESSED${row.required ? ' (REQUIRED)' : ' (optional)'} โ no reviewer ran` : 'โช 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 `_No reviewer ran. ${declined.length} OPTIONAL checklist(s) DID apply to this diff and were not ` + `run; the rest were evaluated and did not apply._`;\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 `## ๐ Company review checklists โ โ ๏ธ NOT EVALUATED (${rows.length} defined)\\n` + `_No diff base (fork point of main) could be resolved, so no checklist was matched against ` + `anything. This is **not** an all-clear._`;\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, CK_ORANGE_FIXED];\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 `${box} ${this.verdictEmoji(row)} **${row.checklistId}**${this.optionalTag(row)} โ ` + `${this.verdictWords(row)}${this.evidenceSuffix(row)}\\n` + ` - ${this.whyLine(row)}`;\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) && !row.notBriefed;\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 || row.status === CK_ORANGE_FIXED) 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.notBriefed) return 'NOT REVIEWED, not blocking โ first triggered after the review was briefed';\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_ORANGE_FIXED) return 'ORANGE on the final round โ author-fixed, NOT re-reviewed';\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 `ALWAYS RUNS (no patterns) โ whole diff in scope, ${total} changed file(s): ` + `${formatFileList(row.matchedFiles)}`;\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 `matched ${this.asCode(row.firedPatterns)} โ ${row.matchedFiles.length} of ${total} ` + `changed file(s): ${formatFileList(row.matchedFiles)}`;\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_ORANGE_FIXED, CK_OVERRIDDEN, CK_WARN, CK_PASS];\n return rows\n .filter((r: ChecklistCommentRow): boolean => this.reviewerRan(r))\n .slice()\n .sort((a: ChecklistCommentRow, b: ChecklistCommentRow): number => this.rankOf(rank, a.status) - this.rankOf(rank, b.status));\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 = 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 => `${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"]}
|
|
@@ -40,5 +40,11 @@ export declare class ChecklistCommentRow {
|
|
|
40
40
|
* to set it is reported as the stricter of the two.
|
|
41
41
|
*/
|
|
42
42
|
required: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* The diff matches this checklist, but it was first triggered by a commit AFTER the review was briefed,
|
|
45
|
+
* so no round ever reviewed it (issue #1053). Informational and never blocking โ the checklist set is
|
|
46
|
+
* frozen at the briefing. Defaulted, so every existing construction site is unchanged.
|
|
47
|
+
*/
|
|
48
|
+
notBriefed: boolean;
|
|
43
49
|
constructor(agent: string, model: string, checklistId: string, status: string, detail: string, ran: boolean, configuredPatterns: string[], firedPatterns: string[], matchedFiles: string[], changedFileCount: number);
|
|
44
50
|
}
|
|
@@ -45,6 +45,12 @@ class ChecklistCommentRow {
|
|
|
45
45
|
* to set it is reported as the stricter of the two.
|
|
46
46
|
*/
|
|
47
47
|
required = true;
|
|
48
|
+
/**
|
|
49
|
+
* The diff matches this checklist, but it was first triggered by a commit AFTER the review was briefed,
|
|
50
|
+
* so no round ever reviewed it (issue #1053). Informational and never blocking โ the checklist set is
|
|
51
|
+
* frozen at the briefing. Defaulted, so every existing construction site is unchanged.
|
|
52
|
+
*/
|
|
53
|
+
notBriefed = false;
|
|
48
54
|
// eslint-disable-next-line @typescript-eslint/max-params
|
|
49
55
|
constructor(agent, model, checklistId, status, detail, ran, configuredPatterns, firedPatterns, matchedFiles, changedFileCount) {
|
|
50
56
|
this.agent = agent;
|
|
@@ -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,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;
|
|
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;IACzB;;;;OAIG;IACH,UAAU,GAAY,KAAK,CAAC;IAE5B,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;AA7DD,kDA6DC","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 * The diff matches this checklist, but it was first triggered by a commit AFTER the review was briefed,\n * so no round ever reviewed it (issue #1053). Informational and never blocking โ the checklist set is\n * frozen at the briefing. Defaulted, so every existing construction site is unchanged.\n */\n notBriefed: boolean = false;\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"]}
|
|
@@ -65,6 +65,12 @@ export declare class DashboardInput {
|
|
|
65
65
|
suppressedChecklistCount: number;
|
|
66
66
|
author: AuthorIdentity;
|
|
67
67
|
hotfix: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Checklists the final diff matches that were never briefed, because a review round had already started
|
|
70
|
+
* when a later commit first triggered them (issue #1053). NON-BLOCKING and informational: the checklist
|
|
71
|
+
* set is frozen at the briefing. Assigned after construction; empty on most PRs.
|
|
72
|
+
*/
|
|
73
|
+
notBriefed: string[];
|
|
68
74
|
constructor(title: string, gateResults: GateResult[], disables: DisableCounts, buildPassed: boolean, forkPoint: string, featureHead: string, mainHead: string, review: PrSummary, checklists: ChecklistRow[], buildCommand: string, suppressedChecklistCount: number, author: AuthorIdentity, hotfix: boolean);
|
|
69
75
|
}
|
|
70
76
|
/** Renders the PR-gate dashboard markdown (gates ร changed files, disables, risk, 3-point hashes). */
|
|
@@ -153,6 +159,11 @@ export declare class Dashboard {
|
|
|
153
159
|
*/
|
|
154
160
|
private prBodyFooter;
|
|
155
161
|
private nonGreenFlags;
|
|
162
|
+
/**
|
|
163
|
+
* The ONE informational line for checklists first triggered after the review was briefed (issue #1053).
|
|
164
|
+
* โช and "not blocking" both, so it can be read neither as a pass nor as something the PR still owes.
|
|
165
|
+
*/
|
|
166
|
+
private notBriefedLine;
|
|
156
167
|
private checklistStatusText;
|
|
157
168
|
private firstSentences;
|
|
158
169
|
private globToRegex;
|
|
@@ -128,6 +128,12 @@ class DashboardInput {
|
|
|
128
128
|
suppressedChecklistCount;
|
|
129
129
|
author;
|
|
130
130
|
hotfix;
|
|
131
|
+
/**
|
|
132
|
+
* Checklists the final diff matches that were never briefed, because a review round had already started
|
|
133
|
+
* when a later commit first triggered them (issue #1053). NON-BLOCKING and informational: the checklist
|
|
134
|
+
* set is frozen at the briefing. Assigned after construction; empty on most PRs.
|
|
135
|
+
*/
|
|
136
|
+
notBriefed;
|
|
131
137
|
// eslint-disable-next-line @typescript-eslint/max-params
|
|
132
138
|
constructor(title, gateResults, disables, buildPassed, forkPoint, featureHead, mainHead, review, checklists, buildCommand, suppressedChecklistCount, author, hotfix) {
|
|
133
139
|
this.title = title;
|
|
@@ -143,6 +149,7 @@ class DashboardInput {
|
|
|
143
149
|
this.suppressedChecklistCount = suppressedChecklistCount;
|
|
144
150
|
this.author = author;
|
|
145
151
|
this.hotfix = hotfix;
|
|
152
|
+
this.notBriefed = [];
|
|
146
153
|
}
|
|
147
154
|
}
|
|
148
155
|
exports.DashboardInput = DashboardInput;
|
|
@@ -216,6 +223,8 @@ let Dashboard = class Dashboard {
|
|
|
216
223
|
// looked at this PR" is a fact a reader must be told, and an absent row silently reads as a green
|
|
217
224
|
// all-clear (see checklistRollupLine).
|
|
218
225
|
lines.push(input.hotfix ? '**Checklists:** โซ BYPASSED by /hotfix/ convention ยท 0 reviewer agents ran' : this.checklistRollupLine(input.checklists, input.suppressedChecklistCount));
|
|
226
|
+
if (input.notBriefed.length > 0)
|
|
227
|
+
lines.push(this.notBriefedLine(input.notBriefed));
|
|
219
228
|
lines.push('');
|
|
220
229
|
if (input.review.summary.trim() !== '') {
|
|
221
230
|
lines.push('### Summary');
|
|
@@ -369,8 +378,17 @@ let Dashboard = class Dashboard {
|
|
|
369
378
|
for (const row of input.checklists) {
|
|
370
379
|
flags.push(`Checklist โ ${row.title}: ${this.checklistStatusText(row)}`);
|
|
371
380
|
}
|
|
381
|
+
if (input.notBriefed.length > 0)
|
|
382
|
+
flags.push(`Checklists โ ${this.notBriefedLine(input.notBriefed)}`);
|
|
372
383
|
return flags;
|
|
373
384
|
}
|
|
385
|
+
/**
|
|
386
|
+
* The ONE informational line for checklists first triggered after the review was briefed (issue #1053).
|
|
387
|
+
* โช and "not blocking" both, so it can be read neither as a pass nor as something the PR still owes.
|
|
388
|
+
*/
|
|
389
|
+
notBriefedLine(ids) {
|
|
390
|
+
return `โช not reviewed (not blocking): ${ids.join(', ')} โ first triggered after the review was briefed`;
|
|
391
|
+
}
|
|
374
392
|
// Emoji + words for a checklist verdict, shared by the dashboard row and the commit-body flag.
|
|
375
393
|
// Every state is matched EXPLICITLY and the fallthrough names the status it did not recognize. The
|
|
376
394
|
// previous `return '๐ข passed'` fallthrough meant any newly-added verdict rendered as a clean pass on
|
|
@@ -380,8 +398,8 @@ let Dashboard = class Dashboard {
|
|
|
380
398
|
const why = row.detail.trim() !== '' ? ` โ override: ${row.detail.trim()}` : '';
|
|
381
399
|
return `๐ OVERRIDDEN${why}`;
|
|
382
400
|
}
|
|
383
|
-
if (row.status === rules_config_1.
|
|
384
|
-
return `๐
|
|
401
|
+
if (row.status === rules_config_1.CK_ORANGE_FIXED)
|
|
402
|
+
return `๐ ${row.detail}`;
|
|
385
403
|
if (row.status === rules_config_1.CK_WARN)
|
|
386
404
|
return '๐ก passed with concerns';
|
|
387
405
|
if (row.status === rules_config_1.CK_FAIL)
|
|
@@ -521,7 +539,7 @@ let Dashboard = class Dashboard {
|
|
|
521
539
|
}
|
|
522
540
|
rollupBuckets(rows) {
|
|
523
541
|
const blocking = new RollupBucket('blocking', '๐ด', true);
|
|
524
|
-
const
|
|
542
|
+
const orangeFixed = new RollupBucket('orange, author-fixed (not re-reviewed)', '๐ ', true);
|
|
525
543
|
const overridden = new RollupBucket('overridden', '๐ ', true);
|
|
526
544
|
const warned = new RollupBucket('with concerns', '๐ก', true);
|
|
527
545
|
const passed = new RollupBucket('passed', '๐ข', false);
|
|
@@ -530,14 +548,14 @@ let Dashboard = class Dashboard {
|
|
|
530
548
|
passed.titles.push(row.title);
|
|
531
549
|
else if (row.status === rules_config_1.CK_WARN)
|
|
532
550
|
warned.titles.push(row.title);
|
|
533
|
-
else if (row.status === rules_config_1.
|
|
534
|
-
|
|
551
|
+
else if (row.status === rules_config_1.CK_ORANGE_FIXED)
|
|
552
|
+
orangeFixed.titles.push(row.title);
|
|
535
553
|
else if (row.status === rules_config_1.CK_OVERRIDDEN)
|
|
536
554
|
overridden.titles.push(row.title);
|
|
537
555
|
else
|
|
538
556
|
blocking.titles.push(row.title);
|
|
539
557
|
}
|
|
540
|
-
return [blocking,
|
|
558
|
+
return [blocking, orangeFixed, overridden, warned, passed];
|
|
541
559
|
}
|
|
542
560
|
// `2 overridden (a, b)` for the buckets a reviewer must act on; a bare `3 passed` for the one they need
|
|
543
561
|
// no list of. Names are capped so a many-checklist repo still gets a ONE-LINE row.
|