@webpieces/rules-config 0.4.826 → 0.4.828
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 +1 -1
- package/src/checklist-config.js +2 -2
- package/src/checklist-config.js.map +1 -1
- package/src/checklist-instructions.d.ts +1 -1
- package/src/checklist-instructions.js +3 -3
- package/src/checklist-instructions.js.map +1 -1
- package/src/checklist-override.d.ts +4 -4
- package/src/checklist-override.js +4 -4
- package/src/checklist-override.js.map +1 -1
- package/src/checklist-validator.js +12 -3
- package/src/checklist-validator.js.map +1 -1
- package/src/index.d.ts +1 -1
- package/src/index.js +6 -4
- package/src/index.js.map +1 -1
- package/src/pr-gate-section-validators.js +2 -2
- package/src/pr-gate-section-validators.js.map +1 -1
- package/src/retired-config-keys.js +1 -1
- package/src/retired-config-keys.js.map +1 -1
- package/src/review-json-data.d.ts +11 -4
- package/src/review-json-data.js +40 -21
- package/src/review-json-data.js.map +1 -1
- package/src/review-json.d.ts +38 -42
- package/src/review-json.js +103 -96
- package/src/review-json.js.map +1 -1
- package/src/review-provenance.d.ts +1 -1
- package/src/review-provenance.js +2 -2
- package/src/review-provenance.js.map +1 -1
- package/src/reviewer-instructions.d.ts +6 -0
- package/src/reviewer-instructions.js +22 -6
- package/src/reviewer-instructions.js.map +1 -1
- package/src/state-dir.d.ts +2 -2
- package/src/state-dir.js +2 -2
- package/src/state-dir.js.map +1 -1
- package/src/subagent-provenance.d.ts +2 -2
- package/src/subagent-provenance.js +3 -3
- package/src/subagent-provenance.js.map +1 -1
- package/src/verdict-schema-renderer.js +6 -3
- package/src/verdict-schema-renderer.js.map +1 -1
- package/templates/webpieces.review-checklists.md +41 -24
package/src/review-json-data.js
CHANGED
|
@@ -8,20 +8,32 @@
|
|
|
8
8
|
* `from '@webpieces/rules-config'` keep resolving exactly as before and no consumer changes.
|
|
9
9
|
*/
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.PrContext = exports.ChecklistVerdict = exports.CK_BAD_FORMAT = exports.CK_MISSING = exports.CK_FAIL = exports.
|
|
12
|
-
// The
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
11
|
+
exports.PrContext = exports.ChecklistVerdict = exports.CK_BAD_FORMAT = exports.CK_MISSING = exports.CK_FAIL = exports.CK_OVERRIDDEN = exports.CK_ORANGE = exports.CK_ORANGE_FIXED = exports.CK_WARN = exports.CK_PASS = exports.PrSummary = exports.ChecklistReviewContext = exports.RequiredChecklist = exports.ChecklistResult = exports.VERDICT_STATUSES = exports.VERDICT_RED = exports.VERDICT_ORANGE = exports.VERDICT_YELLOW = exports.VERDICT_GREEN = void 0;
|
|
12
|
+
// The colors a reviewer subagent may report in `review-round<N>-<id>.json`. Not a boolean, because the
|
|
13
|
+
// boolean it replaced gave a reviewer no way to say "this passes, but a human should look at X" — the only
|
|
14
|
+
// way to raise a concern was to FAIL the PR and then override your own failure, which reads on the
|
|
15
|
+
// dashboard as a deliberately-accepted defect rather than as a note.
|
|
16
|
+
//
|
|
17
|
+
// RED and ORANGE are the two blocking colors, and WHICH one a reviewer may use is decided by the round
|
|
18
|
+
// (issue #1053). `commands.pr-gate.maxReviewerRounds` is a hard ceiling: red means "fix it and it will be
|
|
19
|
+
// reviewed again", which is only true while a round remains. On the FINAL round `wp-write-review` refuses
|
|
20
|
+
// red and the reviewer marks the finding ORANGE instead — "must fix, and nobody re-reviews it". The author
|
|
21
|
+
// fixes it best effort, records the fix with `wp-write-review-fixes`, and the PR ships with the finding and
|
|
22
|
+
// its claimed fix stamped on the dashboard. Before the final round orange is refused the other way round.
|
|
16
23
|
exports.VERDICT_GREEN = 'green';
|
|
17
24
|
exports.VERDICT_YELLOW = 'yellow';
|
|
25
|
+
exports.VERDICT_ORANGE = 'orange';
|
|
18
26
|
exports.VERDICT_RED = 'red';
|
|
19
|
-
exports.VERDICT_STATUSES = [exports.VERDICT_GREEN, exports.VERDICT_YELLOW, exports.VERDICT_RED];
|
|
20
|
-
// The verdict a reviewer SUBAGENT
|
|
21
|
-
//
|
|
22
|
-
// file
|
|
27
|
+
exports.VERDICT_STATUSES = [exports.VERDICT_GREEN, exports.VERDICT_YELLOW, exports.VERDICT_ORANGE, exports.VERDICT_RED];
|
|
28
|
+
// The verdict a reviewer SUBAGENT submits into `.webpieces/pr-review/<featureSlug>/review-round<N>-<id>.json`,
|
|
29
|
+
// one per briefed checklist per round. One file per checklist per ROUND, so N concurrent reviewer subagents
|
|
30
|
+
// never clobber a shared file and no round's verdict is ever overwritten by a later one (issue #1053): the
|
|
31
|
+
// gate reads the HIGHEST round per checklist, and the earlier rounds stay on disk as the audit trail. It
|
|
32
|
+
// records the OUTCOME:
|
|
23
33
|
// status:'green' → PASS
|
|
24
34
|
// status:'yellow' → WARN (passes; the concern is published on the PR, nothing is blocked)
|
|
35
|
+
// status:'orange' + a recorded fix → ORANGE_FIXED (ships, stamped "author-fixed, not re-reviewed")
|
|
36
|
+
// status:'orange' + no recorded fix → ORANGE (refuse until the author records a fix)
|
|
25
37
|
// status:'red' + an override-<id>.json → OVERRIDDEN (pass; the human's stated reason reaches the PR)
|
|
26
38
|
// status:'red' + no override file → FAIL (refuse; `output` is printed verbatim)
|
|
27
39
|
//
|
|
@@ -46,8 +58,13 @@ class ChecklistResult {
|
|
|
46
58
|
// data rather than thrown so the complaint can be reported by BOTH wp-review-upsert-pr and
|
|
47
59
|
// wp-finish-upsert-pr in identical words, and so a legacy file is never silently mistaken for a missing one.
|
|
48
60
|
problem;
|
|
49
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* Non-empty only for an ORANGE whose final-round fix the author recorded with `wp-write-review-fixes`:
|
|
63
|
+
* the dashboard line "orange at <fromHead>, author-fixed in <toHead>, not re-reviewed: <resolution>".
|
|
64
|
+
*/
|
|
50
65
|
remediation;
|
|
66
|
+
/** The review round this verdict was submitted in — the N of `review-round<N>-<id>.json`. */
|
|
67
|
+
round;
|
|
51
68
|
// eslint-disable-next-line @typescript-eslint/max-params
|
|
52
69
|
constructor(agent, model, id, status, output, override, problem = '') {
|
|
53
70
|
this.agent = agent;
|
|
@@ -58,12 +75,13 @@ class ChecklistResult {
|
|
|
58
75
|
this.override = override;
|
|
59
76
|
this.problem = problem;
|
|
60
77
|
this.remediation = '';
|
|
78
|
+
this.round = 0;
|
|
61
79
|
}
|
|
62
80
|
}
|
|
63
81
|
exports.ChecklistResult = ChecklistResult;
|
|
64
82
|
/**
|
|
65
83
|
* What the pr-gate command computed from the diff: a checklist this branch MATCHED (its patterns hit the
|
|
66
|
-
* diff, so its reviewer subagent is in scope). Drives review
|
|
84
|
+
* diff, so its reviewer subagent is in scope). Drives review-round<N>-<id>.json enforcement, provenance, the schema
|
|
67
85
|
* hint, and the dashboard. Data-only.
|
|
68
86
|
*
|
|
69
87
|
* NAME NOTE: "Required" here means MATCHED, not mandatory — it predates `required` by a long way and is
|
|
@@ -71,7 +89,7 @@ exports.ChecklistResult = ChecklistResult;
|
|
|
71
89
|
* Whether the reviewer must actually run is the {@link RequiredChecklist.required} field below.
|
|
72
90
|
*/
|
|
73
91
|
class RequiredChecklist {
|
|
74
|
-
id; // the checklist's name; keys review
|
|
92
|
+
id; // the checklist's name; keys review-round<N>-<id>.json and its instructions file
|
|
75
93
|
reviewer; // the agent type to spawn (agentType the harness stamps) + the round cap
|
|
76
94
|
doc; // REPO-RELATIVE guidance doc the reviewer reads ('' → it just reads the diff)
|
|
77
95
|
matchedFiles; // the changed files that matched it (for the dashboard + hint)
|
|
@@ -127,7 +145,7 @@ class ChecklistReviewContext {
|
|
|
127
145
|
exports.ChecklistReviewContext = ChecklistReviewContext;
|
|
128
146
|
// The AI-authored PR summary (title, risk, summary). Normally the AI writes summary.json between
|
|
129
147
|
// `wp-start-upsert-pr` (which prints the schema) and `wp-finish-upsert-pr` (which reads it), while reviewer
|
|
130
|
-
// subagents write review
|
|
148
|
+
// subagents write review-round<N>-<id>.json. The human-only `wp-human-post-pr` escape hatch also requires and reads
|
|
131
149
|
// this same summary shape, but deliberately skips reviewer verdicts. Data-only (per CLAUDE.md).
|
|
132
150
|
class PrSummary {
|
|
133
151
|
agent;
|
|
@@ -140,7 +158,7 @@ class PrSummary {
|
|
|
140
158
|
violations; // pattern/architecture violations; length = the Pattern Violations count
|
|
141
159
|
risks;
|
|
142
160
|
filesToReview;
|
|
143
|
-
results; // resolved per-checklist verdicts (from review
|
|
161
|
+
results; // resolved per-checklist verdicts (from review-round<N>-<id>.json); [] when none
|
|
144
162
|
mainAgentInstructions; // non-empty only for the opt-in single-round experiment
|
|
145
163
|
// eslint-disable-next-line @typescript-eslint/max-params
|
|
146
164
|
constructor(agent, model, title, riskScore, riskLevel, riskEmoji, summary, violations, risks, filesToReview, results = [], mainAgentInstructions = '') {
|
|
@@ -160,17 +178,18 @@ class PrSummary {
|
|
|
160
178
|
}
|
|
161
179
|
exports.PrSummary = PrSummary;
|
|
162
180
|
// A checklist's resolved outcome, shared by summary.json enforcement and the dashboard so both agree.
|
|
163
|
-
// PASS, WARN and OVERRIDDEN all ship; FAIL, MISSING and BAD_FORMAT all refuse the PR.
|
|
164
|
-
exports.CK_PASS = 'pass'; //
|
|
165
|
-
exports.CK_WARN = 'warn'; //
|
|
181
|
+
// PASS, WARN, ORANGE_FIXED and OVERRIDDEN all ship; ORANGE, FAIL, MISSING and BAD_FORMAT all refuse the PR.
|
|
182
|
+
exports.CK_PASS = 'pass'; // latest verdict status:'green'
|
|
183
|
+
exports.CK_WARN = 'warn'; // latest verdict status:'yellow' → 🟡 passes WITH concerns
|
|
184
|
+
exports.CK_ORANGE_FIXED = 'orange-fixed'; // status:'orange' + a recorded author fix → 🟠 ships, NOT re-reviewed
|
|
185
|
+
exports.CK_ORANGE = 'orange'; // status:'orange' + no recorded fix → refuse until one is recorded
|
|
166
186
|
exports.CK_OVERRIDDEN = 'overridden'; // status:'red' + a human's override-<id>.json → 🟠
|
|
167
|
-
exports.
|
|
168
|
-
exports.
|
|
169
|
-
exports.CK_MISSING = 'missing'; // no review-<id>.json written → refuse
|
|
187
|
+
exports.CK_FAIL = 'fail'; // latest verdict status:'red' + no override → refuse
|
|
188
|
+
exports.CK_MISSING = 'missing'; // no verdict submitted → refuse
|
|
170
189
|
exports.CK_BAD_FORMAT = 'bad-format'; // written, but its verdict is unreadable (e.g. legacy `success`)
|
|
171
190
|
class ChecklistVerdict {
|
|
172
191
|
id;
|
|
173
|
-
status; // one of CK_PASS | CK_WARN |
|
|
192
|
+
status; // one of CK_PASS | CK_WARN | CK_ORANGE_FIXED | CK_ORANGE | CK_OVERRIDDEN | CK_FAIL | CK_MISSING | CK_BAD_FORMAT
|
|
174
193
|
detail; // reviewer output / override justification / format complaint (dashboard + errors)
|
|
175
194
|
constructor(id, status, detail) {
|
|
176
195
|
this.id = id;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review-json-data.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/review-json-data.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAKH,qGAAqG;AACrG,yGAAyG;AACzG,0GAA0G;AAC1G,4EAA4E;AAC/D,QAAA,aAAa,GAAG,OAAO,CAAC;AACxB,QAAA,cAAc,GAAG,QAAQ,CAAC;AAC1B,QAAA,WAAW,GAAG,KAAK,CAAC;AACpB,QAAA,gBAAgB,GAAG,CAAC,qBAAa,EAAE,sBAAc,EAAE,mBAAW,CAAU,CAAC;AAEtF,6GAA6G;AAC7G,sGAAsG;AACtG,gCAAgC;AAChC,gDAAgD;AAChD,iHAAiH;AACjH,uGAAuG;AACvG,uFAAuF;AACvF,EAAE;AACF,mGAAmG;AACnG,yGAAyG;AACzG,0GAA0G;AAC1G,gGAAgG;AAChG,4GAA4G;AAC5G,2FAA2F;AAC3F,MAAa,eAAe;IACxB,KAAK,CAAS;IACd,KAAK,CAAS;IACd,EAAE,CAAS;IACX,MAAM,CAAS,CAAC,mEAAmE;IACnF,MAAM,CAAS,CAAC,qEAAqE;IACrF,wGAAwG;IACxG,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CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;CACJ;AAVD,4CAUC;AAED,iHAAiH;AACjH,yGAAyG;AACzG,0GAA0G;AAC1G,yGAAyG;AACzG,MAAa,SAAS;IAClB,IAAI,CAAS,CAAC,oDAAoD;IAClE;;;;OAIG;IACH,IAAI,CAAS;IACb,YAAY,CAAW,CAAC,iFAAiF;IACzG,KAAK,CAAU,CAAC,4DAA4D;IAC5E,UAAU,CAAW,CAAC,sEAAsE;IAC5F,WAAW,CAAS,CAAC,iFAAiF;IACtG,OAAO,CAAS,CAAC,mFAAmF;IACpG,WAAW,CAAS,CAAC,+EAA+E;IACpG;;;;;;;;OAQG;IACH,YAAY,CAAS;IAErB,yDAAyD;IACzD,YACI,IAAY,EACZ,IAAY,EACZ,YAAsB,EACtB,KAAK,GAAG,KAAK,EACb,aAAuB,EAAE,EACzB,WAAW,GAAG,EAAE,EAChB,OAAO,GAAG,EAAE,EACZ,WAAW,GAAG,EAAE,EAChB,YAAY,GAAG,EAAE;QAEjB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACnC,CAAC;CACJ;AA/CD,8BA+CC","sourcesContent":["/**\n * The DATA-ONLY classes and status constants of the PR review system — the verdict a reviewer writes, the\n * checklist that demanded it, the resolved outcome, and the diff context handed to reviewers.\n *\n * Split out of review-json.ts, which holds the SERVICE that reads and writes them. The split is purely by\n * kind (data vs behaviour): review-json.ts re-exports every name below, so `from './review-json'` and\n * `from '@webpieces/rules-config'` keep resolving exactly as before and no consumer changes.\n */\n\nimport { ReviewerAgentPolicy } from './checklist-config';\nimport { ChecklistOverride } from './checklist-override';\n\n// The three colors a reviewer subagent may report in `review-<id>.json`. A TRI-state, not a boolean,\n// because the boolean it replaced gave a reviewer no way to say \"this passes, but a human should look at\n// X\" — the only way to raise a concern was to FAIL the PR and then override your own failure, which reads\n// on the dashboard as a deliberately-accepted defect rather than as a note.\nexport const VERDICT_GREEN = 'green';\nexport const VERDICT_YELLOW = 'yellow';\nexport const VERDICT_RED = 'red';\nexport const VERDICT_STATUSES = [VERDICT_GREEN, VERDICT_YELLOW, VERDICT_RED] as const;\n\n// The verdict a reviewer SUBAGENT writes into `.webpieces/pr-review/<featureSlug>/review-<id>.json`, one per\n// matched checklist. One file per checklist so N concurrent reviewer subagents never clobber a shared\n// file. It records the OUTCOME:\n// status:'green' → PASS\n// status:'yellow' → WARN (passes; the concern is published on the PR, nothing is blocked)\n// status:'red' + an override-<id>.json → OVERRIDDEN (pass; the human's stated reason reaches the PR)\n// status:'red' + no override file → FAIL (refuse; `output` is printed verbatim)\n//\n// THE `override` FIELD IS GONE FROM THIS FILE, and there is no compatibility mode. The ship-anyway\n// justification used to live here as free text, which made the ONE participant who hears the human — the\n// coordinating agent — the one participant that could not record it, because editing a reviewer's verdict\n// file is (correctly) refused by the harness. It now lives in its own `override-<id>.json`; see\n// ChecklistOverride. A verdict file still carrying an `override` key is reported through `problem` with the\n// destination named, exactly as the removed `success` field is. Data-only (per CLAUDE.md).\nexport class ChecklistResult {\n agent: string;\n model: string;\n id: string;\n status: string; // one of VERDICT_STATUSES; anything else is reported via `problem`\n output: string; // what the reviewer found; printed verbatim when the checklist fails\n // The HUMAN's authorization loaded from `override-<id>.json` beside this verdict, or null when there is\n // none. Loaded alongside the verdict so `resolveVerdict` needs no second read of disk and every command\n // resolves the same outcome from the same bytes.\n override: ChecklistOverride | null;\n // '' = a well-formed verdict. Non-empty = the file exists and parses but its verdict cannot be READ\n // (most often: it still uses the removed `success` field, or the moved `override` field). Carried as\n // data rather than thrown so the complaint can be reported by BOTH wp-review-upsert-pr and\n // wp-finish-upsert-pr in identical words, and so a legacy file is never silently mistaken for a missing one.\n problem: string;\n /** Non-empty only when a valid SHA-bound author remediation resolves this red after the round cap. */\n remediation: string;\n\n // eslint-disable-next-line @typescript-eslint/max-params\n constructor(\n agent: string,\n model: string,\n id: string,\n status: string,\n output: string,\n override: ChecklistOverride | null,\n problem = '',\n ) {\n this.agent = agent;\n this.model = model;\n this.id = id;\n this.status = status;\n this.output = output;\n this.override = override;\n this.problem = problem;\n this.remediation = '';\n }\n}\n\n/**\n * What the pr-gate command computed from the diff: a checklist this branch MATCHED (its patterns hit the\n * diff, so its reviewer subagent is in scope). Drives review-<id>.json enforcement, provenance, the schema\n * hint, and the dashboard. Data-only.\n *\n * NAME NOTE: \"Required\" here means MATCHED, not mandatory — it predates `required` by a long way and is\n * the shared shape across review-json, the detector, the briefing builder, provenance and the dashboard.\n * Whether the reviewer must actually run is the {@link RequiredChecklist.required} field below.\n */\nexport class RequiredChecklist {\n id: string; // the checklist's name; keys review-<id>.json and its instructions file\n reviewer: ReviewerAgentPolicy; // the agent type to spawn (agentType the harness stamps) + the round cap\n doc: string; // REPO-RELATIVE guidance doc the reviewer reads ('' → it just reads the diff)\n matchedFiles: string[]; // the changed files that matched it (for the dashboard + hint)\n // Which of the checklist's OWN globs actually fired. Printed so a reviewer can judge how coarse the\n // match was — a precise `db/migrations/**` hit means something different from a blanket `**` — and the\n // template tells reviewers that matching IS deliberately coarse. [] = no patterns (matches every PR).\n matchedPatterns: string[];\n // Straight from the checklist's config `required`. true = blocking; false = the human is offered it and\n // may decline. Carried on the MATCH rather than looked up from config downstream so the set that gates\n // and the set that is reported cannot disagree about which of the two a checklist is.\n required: boolean;\n\n // eslint-disable-next-line @typescript-eslint/max-params\n constructor(\n id: string,\n reviewer: ReviewerAgentPolicy,\n doc: string,\n matchedFiles: string[],\n matchedPatterns: string[] = [],\n // Defaulted to the BLOCKING value so any construction that forgets it fails closed — a test or a\n // future call site that silently produced an optional checklist would be a hole in the gate.\n required = true,\n ) {\n this.id = id;\n this.reviewer = reviewer;\n this.doc = doc;\n this.matchedFiles = matchedFiles;\n this.matchedPatterns = matchedPatterns;\n this.required = required;\n }\n}\n\n/**\n * The per-PR facts every reviewer subagent needs GIVEN to it, alongside its own checklist: the exact base\n * sha the gate diffs against and the file holding the complete changed-file set. Both used to live only in\n * a doc the printed instruction told the AI to go read, one indirection away from the instruction to hand\n * them over — so the printed block could not stand on its own. Data-only; empty = omit those lines.\n */\nexport class ChecklistReviewContext {\n baseSha: string; // the 3-point merge-base sha\n prContextPath: string; // path of pr-context.json — the AUTHORITATIVE full changed-file set\n /**\n * The exact command that reproduces ONE file's diff, with a `-- <file>` tail — NOT assembled by the\n * caller. This used to be hardcoded as `git diff <baseSha> HEAD -- <file>`, which returns NOTHING on a\n * dirty tree because the changed-file set is computed base→working-tree. See DiffBasis, which derives\n * this string from the same range the file set came from.\n */\n fileDiffCommand: string;\n diffDir: string; // dir of the MATERIALIZED diff (diff/ALL.diff + diff/files/…); '' when not written\n dirty: boolean; // true ⇒ the range includes uncommitted + untracked work, and must be said out loud\n\n // eslint-disable-next-line @typescript-eslint/max-params\n constructor(\n baseSha = '',\n prContextPath = '',\n fileDiffCommand = '',\n diffDir = '',\n dirty = false,\n ) {\n this.baseSha = baseSha;\n this.prContextPath = prContextPath;\n this.fileDiffCommand = fileDiffCommand;\n this.diffDir = diffDir;\n this.dirty = dirty;\n }\n}\n\n// The AI-authored PR summary (title, risk, summary). Normally the AI writes summary.json between\n// `wp-start-upsert-pr` (which prints the schema) and `wp-finish-upsert-pr` (which reads it), while reviewer\n// subagents write review-<id>.json. The human-only `wp-human-post-pr` escape hatch also requires and reads\n// this same summary shape, but deliberately skips reviewer verdicts. Data-only (per CLAUDE.md).\nexport class PrSummary {\n agent: string;\n model: string;\n title: string; // human PR title describing the change; used as the `gh pr` title (empty → caller falls back)\n riskScore: number; // 0–100, drives the risk bar\n riskLevel: string; // 'green' | 'yellow' | 'red'\n riskEmoji: string; // '🟢' | '🟡' | '🔴' — derived from riskLevel when omitted\n summary: string; // rendered in the dashboard Summary section\n violations: string[]; // pattern/architecture violations; length = the Pattern Violations count\n risks: string[];\n filesToReview: string[];\n results: ChecklistResult[]; // resolved per-checklist verdicts (from review-<id>.json); [] when none\n mainAgentInstructions: string; // non-empty only for the opt-in single-round experiment\n\n // eslint-disable-next-line @typescript-eslint/max-params\n constructor(\n agent: string,\n model: string,\n title: string,\n riskScore: number,\n riskLevel: string,\n riskEmoji: string,\n summary: string,\n violations: string[],\n risks: string[],\n filesToReview: string[],\n results: ChecklistResult[] = [],\n mainAgentInstructions = '',\n ) {\n this.agent = agent;\n this.model = model;\n this.title = title;\n this.riskScore = riskScore;\n this.riskLevel = riskLevel;\n this.riskEmoji = riskEmoji;\n this.summary = summary;\n this.violations = violations;\n this.risks = risks;\n this.filesToReview = filesToReview;\n this.results = results;\n this.mainAgentInstructions = mainAgentInstructions;\n }\n}\n\n// A checklist's resolved outcome, shared by summary.json enforcement and the dashboard so both agree.\n// PASS, WARN and OVERRIDDEN all ship; FAIL, MISSING and BAD_FORMAT all refuse the PR.\nexport const CK_PASS = 'pass'; // review-<id>.json status:'green'\nexport const CK_WARN = 'warn'; // review-<id>.json status:'yellow' → 🟡 passes WITH concerns\nexport const CK_OVERRIDDEN = 'overridden'; // status:'red' + a human's override-<id>.json → 🟠\nexport const CK_REMEDIATED = 'remediated'; // red + valid author remediation after reviewer round cap → 🟠\nexport const CK_FAIL = 'fail'; // review-<id>.json status:'red' + no override → refuse\nexport const CK_MISSING = 'missing'; // no review-<id>.json written → refuse\nexport const CK_BAD_FORMAT = 'bad-format'; // written, but its verdict is unreadable (e.g. legacy `success`)\n\nexport class ChecklistVerdict {\n id: string;\n status: string; // one of CK_PASS | CK_WARN | CK_OVERRIDDEN | CK_REMEDIATED | CK_FAIL | CK_MISSING | CK_BAD_FORMAT\n detail: string; // reviewer output / override justification / format complaint (dashboard + errors)\n\n constructor(id: string, status: string, detail: string) {\n this.id = id;\n this.status = status;\n this.detail = detail;\n }\n}\n\n// The PR's diff context, written by wp-start-upsert-pr into `.webpieces/pr-review/<featureSlug>/pr-context.json`\n// so a reviewer subagent knows the exact 3-point base the gate used and the full changed-file set — then\n// reads any file's actual diff with `git diff <base> HEAD -- <file>`. This is what lets a checklist match\n// coarsely by path (in the config) while the subagent makes the fine, content-level judgment. Data-only.\nexport class PrContext {\n base: string; // the 3-point merge-base sha the gate diffs against\n /**\n * The real HEAD sha. This was once the literal string 'HEAD', which is not a fact — it cannot be\n * compared later to detect that the tree moved under a review, and it reads as a range that was never\n * actually diffed. Its only reader (reviewContextFor) takes `base`, so recording the sha is free.\n */\n head: string;\n changedFiles: string[]; // every file changed in the range (NOT tsOnly — includes .sql/.gql/Dockerfile/…)\n dirty: boolean; // true ⇒ changedFiles includes uncommitted + untracked work\n dirtyFiles: string[]; // exactly which paths are uncommitted/untracked — why `dirty` is true\n diffCommand: string; // the command that reproduces the WHOLE diff (see DiffBasis; correct when dirty)\n diffDir: string; // dir holding the materialized per-file diffs + ALL.diff; '' when not materialized\n generatedAt: string; // ISO timestamp, so a stale context is detectable rather than silently trusted\n /**\n * Main's head as this clone last saw it — the THIRD hash point, matching the trio the 3-point merge\n * records in `merge-info/<branch>/updatemain-hashes.json`. `base`/`head` above are points A and B\n * under the review side's older names.\n *\n * The review side used to record only A and B, so nothing could answer \"did main move while this was\n * under review?\" — the question you most want answered when a review looks stale. '' when origin/main\n * is unresolvable. Purely informational; nothing gates on it.\n */\n hashMainHead: string;\n\n // eslint-disable-next-line @typescript-eslint/max-params\n constructor(\n base: string,\n head: string,\n changedFiles: string[],\n dirty = false,\n dirtyFiles: string[] = [],\n diffCommand = '',\n diffDir = '',\n generatedAt = '',\n hashMainHead = '',\n ) {\n this.hashMainHead = hashMainHead;\n this.base = base;\n this.head = head;\n this.changedFiles = changedFiles;\n this.dirty = dirty;\n this.dirtyFiles = dirtyFiles;\n this.diffCommand = diffCommand;\n this.diffDir = diffDir;\n this.generatedAt = generatedAt;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"review-json-data.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/review-json-data.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAKH,uGAAuG;AACvG,2GAA2G;AAC3G,mGAAmG;AACnG,qEAAqE;AACrE,EAAE;AACF,uGAAuG;AACvG,0GAA0G;AAC1G,0GAA0G;AAC1G,2GAA2G;AAC3G,4GAA4G;AAC5G,0GAA0G;AAC7F,QAAA,aAAa,GAAG,OAAO,CAAC;AACxB,QAAA,cAAc,GAAG,QAAQ,CAAC;AAC1B,QAAA,cAAc,GAAG,QAAQ,CAAC;AAC1B,QAAA,WAAW,GAAG,KAAK,CAAC;AACpB,QAAA,gBAAgB,GAAG,CAAC,qBAAa,EAAE,sBAAc,EAAE,sBAAc,EAAE,mBAAW,CAAU,CAAC;AAEtG,+GAA+G;AAC/G,4GAA4G;AAC5G,2GAA2G;AAC3G,yGAAyG;AACzG,uBAAuB;AACvB,gDAAgD;AAChD,iHAAiH;AACjH,yGAAyG;AACzG,0FAA0F;AAC1F,uGAAuG;AACvG,uFAAuF;AACvF,EAAE;AACF,mGAAmG;AACnG,yGAAyG;AACzG,0GAA0G;AAC1G,gGAAgG;AAChG,4GAA4G;AAC5G,2FAA2F;AAC3F,MAAa,eAAe;IACxB,KAAK,CAAS;IACd,KAAK,CAAS;IACd,EAAE,CAAS;IACX,MAAM,CAAS,CAAC,mEAAmE;IACnF,MAAM,CAAS,CAAC,qEAAqE;IACrF,wGAAwG;IACxG,wGAAwG;IACxG,iDAAiD;IACjD,QAAQ,CAA2B;IACnC,oGAAoG;IACpG,qGAAqG;IACrG,2FAA2F;IAC3F,6GAA6G;IAC7G,OAAO,CAAS;IAChB;;;OAG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AAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;CACJ;AAVD,4CAUC;AAED,iHAAiH;AACjH,yGAAyG;AACzG,0GAA0G;AAC1G,yGAAyG;AACzG,MAAa,SAAS;IAClB,IAAI,CAAS,CAAC,oDAAoD;IAClE;;;;OAIG;IACH,IAAI,CAAS;IACb,YAAY,CAAW,CAAC,iFAAiF;IACzG,KAAK,CAAU,CAAC,4DAA4D;IAC5E,UAAU,CAAW,CAAC,sEAAsE;IAC5F,WAAW,CAAS,CAAC,iFAAiF;IACtG,OAAO,CAAS,CAAC,mFAAmF;IACpG,WAAW,CAAS,CAAC,+EAA+E;IACpG;;;;;;;;OAQG;IACH,YAAY,CAAS;IAErB,yDAAyD;IACzD,YACI,IAAY,EACZ,IAAY,EACZ,YAAsB,EACtB,KAAK,GAAG,KAAK,EACb,aAAuB,EAAE,EACzB,WAAW,GAAG,EAAE,EAChB,OAAO,GAAG,EAAE,EACZ,WAAW,GAAG,EAAE,EAChB,YAAY,GAAG,EAAE;QAEjB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACnC,CAAC;CACJ;AA/CD,8BA+CC","sourcesContent":["/**\n * The DATA-ONLY classes and status constants of the PR review system — the verdict a reviewer writes, the\n * checklist that demanded it, the resolved outcome, and the diff context handed to reviewers.\n *\n * Split out of review-json.ts, which holds the SERVICE that reads and writes them. The split is purely by\n * kind (data vs behaviour): review-json.ts re-exports every name below, so `from './review-json'` and\n * `from '@webpieces/rules-config'` keep resolving exactly as before and no consumer changes.\n */\n\nimport { ReviewerAgentPolicy } from './checklist-config';\nimport { ChecklistOverride } from './checklist-override';\n\n// The colors a reviewer subagent may report in `review-round<N>-<id>.json`. Not a boolean, because the\n// boolean it replaced gave a reviewer no way to say \"this passes, but a human should look at X\" — the only\n// way to raise a concern was to FAIL the PR and then override your own failure, which reads on the\n// dashboard as a deliberately-accepted defect rather than as a note.\n//\n// RED and ORANGE are the two blocking colors, and WHICH one a reviewer may use is decided by the round\n// (issue #1053). `commands.pr-gate.maxReviewerRounds` is a hard ceiling: red means \"fix it and it will be\n// reviewed again\", which is only true while a round remains. On the FINAL round `wp-write-review` refuses\n// red and the reviewer marks the finding ORANGE instead — \"must fix, and nobody re-reviews it\". The author\n// fixes it best effort, records the fix with `wp-write-review-fixes`, and the PR ships with the finding and\n// its claimed fix stamped on the dashboard. Before the final round orange is refused the other way round.\nexport const VERDICT_GREEN = 'green';\nexport const VERDICT_YELLOW = 'yellow';\nexport const VERDICT_ORANGE = 'orange';\nexport const VERDICT_RED = 'red';\nexport const VERDICT_STATUSES = [VERDICT_GREEN, VERDICT_YELLOW, VERDICT_ORANGE, VERDICT_RED] as const;\n\n// The verdict a reviewer SUBAGENT submits into `.webpieces/pr-review/<featureSlug>/review-round<N>-<id>.json`,\n// one per briefed checklist per round. One file per checklist per ROUND, so N concurrent reviewer subagents\n// never clobber a shared file and no round's verdict is ever overwritten by a later one (issue #1053): the\n// gate reads the HIGHEST round per checklist, and the earlier rounds stay on disk as the audit trail. It\n// records the OUTCOME:\n// status:'green' → PASS\n// status:'yellow' → WARN (passes; the concern is published on the PR, nothing is blocked)\n// status:'orange' + a recorded fix → ORANGE_FIXED (ships, stamped \"author-fixed, not re-reviewed\")\n// status:'orange' + no recorded fix → ORANGE (refuse until the author records a fix)\n// status:'red' + an override-<id>.json → OVERRIDDEN (pass; the human's stated reason reaches the PR)\n// status:'red' + no override file → FAIL (refuse; `output` is printed verbatim)\n//\n// THE `override` FIELD IS GONE FROM THIS FILE, and there is no compatibility mode. The ship-anyway\n// justification used to live here as free text, which made the ONE participant who hears the human — the\n// coordinating agent — the one participant that could not record it, because editing a reviewer's verdict\n// file is (correctly) refused by the harness. It now lives in its own `override-<id>.json`; see\n// ChecklistOverride. A verdict file still carrying an `override` key is reported through `problem` with the\n// destination named, exactly as the removed `success` field is. Data-only (per CLAUDE.md).\nexport class ChecklistResult {\n agent: string;\n model: string;\n id: string;\n status: string; // one of VERDICT_STATUSES; anything else is reported via `problem`\n output: string; // what the reviewer found; printed verbatim when the checklist fails\n // The HUMAN's authorization loaded from `override-<id>.json` beside this verdict, or null when there is\n // none. Loaded alongside the verdict so `resolveVerdict` needs no second read of disk and every command\n // resolves the same outcome from the same bytes.\n override: ChecklistOverride | null;\n // '' = a well-formed verdict. Non-empty = the file exists and parses but its verdict cannot be READ\n // (most often: it still uses the removed `success` field, or the moved `override` field). Carried as\n // data rather than thrown so the complaint can be reported by BOTH wp-review-upsert-pr and\n // wp-finish-upsert-pr in identical words, and so a legacy file is never silently mistaken for a missing one.\n problem: string;\n /**\n * Non-empty only for an ORANGE whose final-round fix the author recorded with `wp-write-review-fixes`:\n * the dashboard line \"orange at <fromHead>, author-fixed in <toHead>, not re-reviewed: <resolution>\".\n */\n remediation: string;\n /** The review round this verdict was submitted in — the N of `review-round<N>-<id>.json`. */\n round: number;\n\n // eslint-disable-next-line @typescript-eslint/max-params\n constructor(\n agent: string,\n model: string,\n id: string,\n status: string,\n output: string,\n override: ChecklistOverride | null,\n problem = '',\n ) {\n this.agent = agent;\n this.model = model;\n this.id = id;\n this.status = status;\n this.output = output;\n this.override = override;\n this.problem = problem;\n this.remediation = '';\n this.round = 0;\n }\n}\n\n/**\n * What the pr-gate command computed from the diff: a checklist this branch MATCHED (its patterns hit the\n * diff, so its reviewer subagent is in scope). Drives review-round<N>-<id>.json enforcement, provenance, the schema\n * hint, and the dashboard. Data-only.\n *\n * NAME NOTE: \"Required\" here means MATCHED, not mandatory — it predates `required` by a long way and is\n * the shared shape across review-json, the detector, the briefing builder, provenance and the dashboard.\n * Whether the reviewer must actually run is the {@link RequiredChecklist.required} field below.\n */\nexport class RequiredChecklist {\n id: string; // the checklist's name; keys review-round<N>-<id>.json and its instructions file\n reviewer: ReviewerAgentPolicy; // the agent type to spawn (agentType the harness stamps) + the round cap\n doc: string; // REPO-RELATIVE guidance doc the reviewer reads ('' → it just reads the diff)\n matchedFiles: string[]; // the changed files that matched it (for the dashboard + hint)\n // Which of the checklist's OWN globs actually fired. Printed so a reviewer can judge how coarse the\n // match was — a precise `db/migrations/**` hit means something different from a blanket `**` — and the\n // template tells reviewers that matching IS deliberately coarse. [] = no patterns (matches every PR).\n matchedPatterns: string[];\n // Straight from the checklist's config `required`. true = blocking; false = the human is offered it and\n // may decline. Carried on the MATCH rather than looked up from config downstream so the set that gates\n // and the set that is reported cannot disagree about which of the two a checklist is.\n required: boolean;\n\n // eslint-disable-next-line @typescript-eslint/max-params\n constructor(\n id: string,\n reviewer: ReviewerAgentPolicy,\n doc: string,\n matchedFiles: string[],\n matchedPatterns: string[] = [],\n // Defaulted to the BLOCKING value so any construction that forgets it fails closed — a test or a\n // future call site that silently produced an optional checklist would be a hole in the gate.\n required = true,\n ) {\n this.id = id;\n this.reviewer = reviewer;\n this.doc = doc;\n this.matchedFiles = matchedFiles;\n this.matchedPatterns = matchedPatterns;\n this.required = required;\n }\n}\n\n/**\n * The per-PR facts every reviewer subagent needs GIVEN to it, alongside its own checklist: the exact base\n * sha the gate diffs against and the file holding the complete changed-file set. Both used to live only in\n * a doc the printed instruction told the AI to go read, one indirection away from the instruction to hand\n * them over — so the printed block could not stand on its own. Data-only; empty = omit those lines.\n */\nexport class ChecklistReviewContext {\n baseSha: string; // the 3-point merge-base sha\n prContextPath: string; // path of pr-context.json — the AUTHORITATIVE full changed-file set\n /**\n * The exact command that reproduces ONE file's diff, with a `-- <file>` tail — NOT assembled by the\n * caller. This used to be hardcoded as `git diff <baseSha> HEAD -- <file>`, which returns NOTHING on a\n * dirty tree because the changed-file set is computed base→working-tree. See DiffBasis, which derives\n * this string from the same range the file set came from.\n */\n fileDiffCommand: string;\n diffDir: string; // dir of the MATERIALIZED diff (diff/ALL.diff + diff/files/…); '' when not written\n dirty: boolean; // true ⇒ the range includes uncommitted + untracked work, and must be said out loud\n\n // eslint-disable-next-line @typescript-eslint/max-params\n constructor(\n baseSha = '',\n prContextPath = '',\n fileDiffCommand = '',\n diffDir = '',\n dirty = false,\n ) {\n this.baseSha = baseSha;\n this.prContextPath = prContextPath;\n this.fileDiffCommand = fileDiffCommand;\n this.diffDir = diffDir;\n this.dirty = dirty;\n }\n}\n\n// The AI-authored PR summary (title, risk, summary). Normally the AI writes summary.json between\n// `wp-start-upsert-pr` (which prints the schema) and `wp-finish-upsert-pr` (which reads it), while reviewer\n// subagents write review-round<N>-<id>.json. The human-only `wp-human-post-pr` escape hatch also requires and reads\n// this same summary shape, but deliberately skips reviewer verdicts. Data-only (per CLAUDE.md).\nexport class PrSummary {\n agent: string;\n model: string;\n title: string; // human PR title describing the change; used as the `gh pr` title (empty → caller falls back)\n riskScore: number; // 0–100, drives the risk bar\n riskLevel: string; // 'green' | 'yellow' | 'red'\n riskEmoji: string; // '🟢' | '🟡' | '🔴' — derived from riskLevel when omitted\n summary: string; // rendered in the dashboard Summary section\n violations: string[]; // pattern/architecture violations; length = the Pattern Violations count\n risks: string[];\n filesToReview: string[];\n results: ChecklistResult[]; // resolved per-checklist verdicts (from review-round<N>-<id>.json); [] when none\n mainAgentInstructions: string; // non-empty only for the opt-in single-round experiment\n\n // eslint-disable-next-line @typescript-eslint/max-params\n constructor(\n agent: string,\n model: string,\n title: string,\n riskScore: number,\n riskLevel: string,\n riskEmoji: string,\n summary: string,\n violations: string[],\n risks: string[],\n filesToReview: string[],\n results: ChecklistResult[] = [],\n mainAgentInstructions = '',\n ) {\n this.agent = agent;\n this.model = model;\n this.title = title;\n this.riskScore = riskScore;\n this.riskLevel = riskLevel;\n this.riskEmoji = riskEmoji;\n this.summary = summary;\n this.violations = violations;\n this.risks = risks;\n this.filesToReview = filesToReview;\n this.results = results;\n this.mainAgentInstructions = mainAgentInstructions;\n }\n}\n\n// A checklist's resolved outcome, shared by summary.json enforcement and the dashboard so both agree.\n// PASS, WARN, ORANGE_FIXED and OVERRIDDEN all ship; ORANGE, FAIL, MISSING and BAD_FORMAT all refuse the PR.\nexport const CK_PASS = 'pass'; // latest verdict status:'green'\nexport const CK_WARN = 'warn'; // latest verdict status:'yellow' → 🟡 passes WITH concerns\nexport const CK_ORANGE_FIXED = 'orange-fixed'; // status:'orange' + a recorded author fix → 🟠 ships, NOT re-reviewed\nexport const CK_ORANGE = 'orange'; // status:'orange' + no recorded fix → refuse until one is recorded\nexport const CK_OVERRIDDEN = 'overridden'; // status:'red' + a human's override-<id>.json → 🟠\nexport const CK_FAIL = 'fail'; // latest verdict status:'red' + no override → refuse\nexport const CK_MISSING = 'missing'; // no verdict submitted → refuse\nexport const CK_BAD_FORMAT = 'bad-format'; // written, but its verdict is unreadable (e.g. legacy `success`)\n\nexport class ChecklistVerdict {\n id: string;\n status: string; // one of CK_PASS | CK_WARN | CK_ORANGE_FIXED | CK_ORANGE | CK_OVERRIDDEN | CK_FAIL | CK_MISSING | CK_BAD_FORMAT\n detail: string; // reviewer output / override justification / format complaint (dashboard + errors)\n\n constructor(id: string, status: string, detail: string) {\n this.id = id;\n this.status = status;\n this.detail = detail;\n }\n}\n\n// The PR's diff context, written by wp-start-upsert-pr into `.webpieces/pr-review/<featureSlug>/pr-context.json`\n// so a reviewer subagent knows the exact 3-point base the gate used and the full changed-file set — then\n// reads any file's actual diff with `git diff <base> HEAD -- <file>`. This is what lets a checklist match\n// coarsely by path (in the config) while the subagent makes the fine, content-level judgment. Data-only.\nexport class PrContext {\n base: string; // the 3-point merge-base sha the gate diffs against\n /**\n * The real HEAD sha. This was once the literal string 'HEAD', which is not a fact — it cannot be\n * compared later to detect that the tree moved under a review, and it reads as a range that was never\n * actually diffed. Its only reader (reviewContextFor) takes `base`, so recording the sha is free.\n */\n head: string;\n changedFiles: string[]; // every file changed in the range (NOT tsOnly — includes .sql/.gql/Dockerfile/…)\n dirty: boolean; // true ⇒ changedFiles includes uncommitted + untracked work\n dirtyFiles: string[]; // exactly which paths are uncommitted/untracked — why `dirty` is true\n diffCommand: string; // the command that reproduces the WHOLE diff (see DiffBasis; correct when dirty)\n diffDir: string; // dir holding the materialized per-file diffs + ALL.diff; '' when not materialized\n generatedAt: string; // ISO timestamp, so a stale context is detectable rather than silently trusted\n /**\n * Main's head as this clone last saw it — the THIRD hash point, matching the trio the 3-point merge\n * records in `merge-info/<branch>/updatemain-hashes.json`. `base`/`head` above are points A and B\n * under the review side's older names.\n *\n * The review side used to record only A and B, so nothing could answer \"did main move while this was\n * under review?\" — the question you most want answered when a review looks stale. '' when origin/main\n * is unresolvable. Purely informational; nothing gates on it.\n */\n hashMainHead: string;\n\n // eslint-disable-next-line @typescript-eslint/max-params\n constructor(\n base: string,\n head: string,\n changedFiles: string[],\n dirty = false,\n dirtyFiles: string[] = [],\n diffCommand = '',\n diffDir = '',\n generatedAt = '',\n hashMainHead = '',\n ) {\n this.hashMainHead = hashMainHead;\n this.base = base;\n this.head = head;\n this.changedFiles = changedFiles;\n this.dirty = dirty;\n this.dirtyFiles = dirtyFiles;\n this.diffCommand = diffCommand;\n this.diffDir = diffDir;\n this.generatedAt = generatedAt;\n }\n}\n"]}
|
package/src/review-json.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DotWebpieces } from './state-dir';
|
|
2
2
|
import { ChecklistOverride, ChecklistOverrideService, checklistOverrideService } from './checklist-override';
|
|
3
|
-
import { VERDICT_GREEN, VERDICT_YELLOW, VERDICT_RED, VERDICT_STATUSES, ChecklistResult, RequiredChecklist, ChecklistReviewContext, PrSummary, CK_PASS, CK_WARN, CK_OVERRIDDEN,
|
|
3
|
+
import { VERDICT_GREEN, VERDICT_YELLOW, VERDICT_ORANGE, VERDICT_RED, VERDICT_STATUSES, ChecklistResult, RequiredChecklist, ChecklistReviewContext, PrSummary, CK_PASS, CK_WARN, CK_OVERRIDDEN, CK_ORANGE_FIXED, CK_ORANGE, CK_FAIL, CK_MISSING, CK_BAD_FORMAT, ChecklistVerdict, PrContext } from './review-json-data';
|
|
4
4
|
export { ChecklistOverride, ChecklistOverrideService, checklistOverrideService };
|
|
5
|
-
export { VERDICT_GREEN, VERDICT_YELLOW, VERDICT_RED, VERDICT_STATUSES, ChecklistResult, RequiredChecklist, ChecklistReviewContext, PrSummary, CK_PASS, CK_WARN, CK_OVERRIDDEN,
|
|
5
|
+
export { VERDICT_GREEN, VERDICT_YELLOW, VERDICT_ORANGE, VERDICT_RED, VERDICT_STATUSES, ChecklistResult, RequiredChecklist, ChecklistReviewContext, PrSummary, CK_PASS, CK_WARN, CK_OVERRIDDEN, CK_ORANGE_FIXED, CK_ORANGE, CK_FAIL, CK_MISSING, CK_BAD_FORMAT, ChecklistVerdict, PrContext, };
|
|
6
6
|
/** Locates + loads/validates the AI-authored summary.json. `@injectable(bindingScopeValues.Singleton)` so it's drawn in the design. */
|
|
7
7
|
export declare class ReviewJsonService {
|
|
8
8
|
private readonly dotDir;
|
|
@@ -31,15 +31,9 @@ export declare class ReviewJsonService {
|
|
|
31
31
|
* The archived bytes: the original JSON with an AUDIT-ONLY note as its FIRST key, so anything that opens
|
|
32
32
|
* the file — human or AI — reads what it is before it reads any of its content.
|
|
33
33
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* a second copy of this method would be the thing that drifts.
|
|
38
|
-
*
|
|
39
|
-
* Falls back to the raw bytes when they do not parse. For summary.json `loadSummaryJson` has already
|
|
40
|
-
* accepted the file so that is close to impossible, but a verdict file is written by a subagent and may
|
|
41
|
-
* be half-written or not an object at all — and preserving the original always beats losing it to a
|
|
42
|
-
* stamping failure, since the archive exists precisely to be the record.
|
|
34
|
+
* Falls back to the raw bytes when they do not parse. `loadSummaryJson` has already accepted the file, so
|
|
35
|
+
* that is close to impossible, but preserving the original always beats losing it to a stamping failure,
|
|
36
|
+
* since the archive exists precisely to be the record.
|
|
43
37
|
*/
|
|
44
38
|
private archivedBody;
|
|
45
39
|
private tryParseObject;
|
|
@@ -56,7 +50,7 @@ export declare class ReviewJsonService {
|
|
|
56
50
|
writePrContext(repoRoot: string, featureName: string, context: PrContext, stage?: string): string;
|
|
57
51
|
/**
|
|
58
52
|
* The review context for a feature, recovered from the pr-context.json wp-start-upsert-pr already wrote.
|
|
59
|
-
* Lets wp-finish-upsert-pr's "you still owe me review
|
|
53
|
+
* Lets wp-finish-upsert-pr's "you still owe me review-round<N>-<id>.json" message inline the SAME self-sufficient
|
|
60
54
|
* per-reviewer block start printed, instead of a checklist name and an indirection. Empty when the file
|
|
61
55
|
* is absent or unreadable — the block then just omits those lines.
|
|
62
56
|
*/
|
|
@@ -69,51 +63,54 @@ export declare class ReviewJsonService {
|
|
|
69
63
|
*/
|
|
70
64
|
private archivedSummaryHint;
|
|
71
65
|
private renamedFileHint;
|
|
72
|
-
checklistResultPath(summaryJsonFilePath: string, checklistId: string): string;
|
|
73
66
|
/**
|
|
74
|
-
*
|
|
67
|
+
* The per-checklist verdict file for ONE round, beside summary.json: `review-round<N>-<id>.json`.
|
|
75
68
|
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* one fact worth keeping is "this checklist refused before, here is what it said".
|
|
69
|
+
* Round-numbered (issue #1053) so no round ever overwrites another. The top-level `review-<id>.json` this
|
|
70
|
+
* replaced was overwritten by every submission, and a separate `rounds/<N>/` copy had to be kept in step
|
|
71
|
+
* with it to recover the history: two records of one fact, and the copy was the one an agent could lose.
|
|
80
72
|
*/
|
|
81
|
-
|
|
73
|
+
checklistResultPath(summaryJsonFilePath: string, checklistId: string, round: number): string;
|
|
82
74
|
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* The point is the MOVE, exactly as in {@link archiveSummaryJson}. A red verdict left on the live path is
|
|
87
|
-
* re-read by the next run and re-reported as the CURRENT state of the branch, so the branch keeps being
|
|
88
|
-
* refused for a finding that may already be fixed — and the fix, when it comes, silently overwrites the
|
|
89
|
-
* only record that the gate ever refused anything. Moving it makes the refusal durable and makes a fresh
|
|
90
|
-
* reviewer run the only way forward, which is the honest requirement: the old verdict judged code that
|
|
91
|
-
* has since changed.
|
|
92
|
-
*
|
|
93
|
-
* Safe by construction for RED verdicts specifically, which is why the caller only archives on CK_FAIL:
|
|
94
|
-
* a red verdict is never reusable — it always blocks — so nothing is lost by moving it. Green and yellow
|
|
95
|
-
* verdicts ARE deliberately reused across finish attempts, and retiring one would force a needless (and
|
|
96
|
-
* expensive) subagent re-run.
|
|
75
|
+
* The HIGHEST round a verdict was submitted in for one checklist, or 0 when it has none. The live verdict
|
|
76
|
+
* is always that one; every lower round is history. Derived from the files present, so there is no
|
|
77
|
+
* counter to drift from them.
|
|
97
78
|
*/
|
|
98
|
-
|
|
79
|
+
latestVerdictRound(summaryJsonFilePath: string, checklistId: string): number;
|
|
80
|
+
/** The verdict file name with the round left as `<N>`, for messages that name it before a round is known. */
|
|
81
|
+
checklistResultPathTemplate(summaryJsonFilePath: string, checklistId: string): string;
|
|
82
|
+
/** The live (highest-round) verdict file for one checklist, or '' when none was ever submitted. */
|
|
83
|
+
latestChecklistResultPath(summaryJsonFilePath: string, checklistId: string): string;
|
|
84
|
+
private escapeRegExp;
|
|
99
85
|
/**
|
|
100
86
|
* Load + validate the AI-authored summary.json. Throws InformAiError (with the schema) when missing,
|
|
101
87
|
* unparseable, or structurally wrong. `required` is the set of checklists the diff matched: every one
|
|
102
|
-
* must have a well-formed, passing (or overridden) review
|
|
88
|
+
* must have a well-formed, passing (or overridden) review-round<N>-<id>.json or a validation error is raised
|
|
103
89
|
* alongside the usual ones so the AI gets ONE message.
|
|
104
90
|
*/
|
|
105
|
-
loadSummaryJson(filePath: string, required?: readonly RequiredChecklist[], expectedMainAgentInstructions?: string,
|
|
91
|
+
loadSummaryJson(filePath: string, required?: readonly RequiredChecklist[], expectedMainAgentInstructions?: string, orangeFixes?: Record<string, string>, retryCommand?: string): PrSummary;
|
|
106
92
|
private assertValidSummary;
|
|
107
93
|
/** Load the raw object and render every parse/shape error for the command that called us. */
|
|
108
94
|
private readSummaryObject;
|
|
109
95
|
private validateMainAgentInstructions;
|
|
110
96
|
/**
|
|
111
|
-
* The checklists that still OWE a verdict: no review
|
|
97
|
+
* The checklists that still OWE a verdict: no review-round<N>-<id>.json at all, a malformed one, or one whose
|
|
112
98
|
* verdict is an un-overridden FAIL. This is the set every message lists — a checklist already PASSed or
|
|
113
99
|
* OVERRIDDEN on this branch is deliberately NOT re-listed, because re-instructing it invites a redundant
|
|
114
100
|
* second run and reads as though the earlier verdict did not count.
|
|
115
101
|
*/
|
|
116
102
|
pendingChecklists(required: readonly RequiredChecklist[], results: readonly ChecklistResult[]): RequiredChecklist[];
|
|
103
|
+
/**
|
|
104
|
+
* The checklists whose latest verdict is ORANGE with no recorded author fix (issue #1053): a final-round
|
|
105
|
+
* must-fix. A strict subset of {@link pendingChecklists}, split out because its cure is neither a
|
|
106
|
+
* reviewer nor an override: the author fixes the code and records it with `wp-write-review-fixes`.
|
|
107
|
+
*/
|
|
108
|
+
orangeChecklists(required: readonly RequiredChecklist[], results: readonly ChecklistResult[]): RequiredChecklist[];
|
|
109
|
+
/**
|
|
110
|
+
* THE renderer for "this final-round reviewer marked ORANGE": the finding verbatim, then the ONE way past
|
|
111
|
+
* it. There is no re-review to ask for: the round cap is spent, and an orange is the reviewer saying so.
|
|
112
|
+
*/
|
|
113
|
+
orangeError(req: RequiredChecklist, verdict: ChecklistVerdict): string;
|
|
117
114
|
/**
|
|
118
115
|
* The OPTIONAL checklists (`required: false`) that matched the diff but have no verdict file at all.
|
|
119
116
|
*
|
|
@@ -154,12 +151,11 @@ export declare class ReviewJsonService {
|
|
|
154
151
|
* JSON. The ship-anyway route is now a SEPARATE file the coordinating agent may write, and the command
|
|
155
152
|
* that writes it is printed ready to run. See {@link ChecklistOverrideService.writerRule}.
|
|
156
153
|
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
* retirement, and a human who already decided to accept this checklist is never asked again.
|
|
154
|
+
* A red verdict is never moved or deleted (issue #1053): the next round's verdict is a NEW file,
|
|
155
|
+
* `review-round<N+1>-<id>.json`, and the gate reads the highest round, so the refusal stays on disk as the
|
|
156
|
+
* record of what was found.
|
|
161
157
|
*/
|
|
162
|
-
refusalError(req: RequiredChecklist, verdict: ChecklistVerdict, summaryJsonFilePath: string
|
|
158
|
+
refusalError(req: RequiredChecklist, verdict: ChecklistVerdict, summaryJsonFilePath: string): string;
|
|
163
159
|
/**
|
|
164
160
|
* The ship-anyway paragraph: who may authorize, and the exact command that records it.
|
|
165
161
|
*
|