@webpieces/rules-config 0.4.801 → 0.4.803
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-instructions.js +8 -7
- package/src/checklist-instructions.js.map +1 -1
- package/src/index.d.ts +1 -0
- package/src/index.js +12 -4
- package/src/index.js.map +1 -1
- package/src/review-identity-stamp.d.ts +82 -0
- package/src/review-identity-stamp.js +172 -0
- package/src/review-identity-stamp.js.map +1 -0
- package/src/review-json.d.ts +6 -5
- package/src/review-json.js +16 -32
- package/src/review-json.js.map +1 -1
- package/src/reviewer-instructions.d.ts +1 -1
- package/src/reviewer-instructions.js +10 -5
- package/src/reviewer-instructions.js.map +1 -1
- package/src/subagent-provenance.d.ts +1 -0
- package/src/subagent-provenance.js +13 -13
- package/src/subagent-provenance.js.map +1 -1
- package/src/verdict-schema-renderer.d.ts +14 -0
- package/src/verdict-schema-renderer.js +44 -0
- package/src/verdict-schema-renderer.js.map +1 -0
- package/templates/webpieces.git-workflow.md +1 -1
- package/templates/webpieces.location-matrix.md +1 -1
- package/templates/webpieces.review-checklists.md +28 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webpieces/rules-config",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.803",
|
|
4
4
|
"description": "Shared webpieces.config.json loader. Single source of truth for validation rule configuration consumed by @webpieces/ai-hook-rules, @webpieces/code-rules, and @webpieces/nx-webpieces-rules.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -55,18 +55,18 @@ let ChecklistInstructionsService = class ChecklistInstructionsService {
|
|
|
55
55
|
if (reviewer.maxAgents === 0) {
|
|
56
56
|
return [
|
|
57
57
|
'Reviewer-agent reviews are disabled for this project (commands.pr-gate.reviewerAgents = 0).',
|
|
58
|
-
'Do not spawn reviewer subagents and do not
|
|
58
|
+
'Do not spawn reviewer subagents and do not submit checklist verdicts.',
|
|
59
59
|
];
|
|
60
60
|
}
|
|
61
61
|
const own = [
|
|
62
|
-
'You may NOT review your own work, and you may NOT
|
|
62
|
+
'You may NOT review your own work, and you may NOT submit a reviewer\'s verdict on its behalf — wp-write-review refuses the coordinating agent.',
|
|
63
63
|
];
|
|
64
64
|
const cap = Math.min(reviewer.maxAgents, pending.length);
|
|
65
65
|
return [
|
|
66
66
|
`You MUST run these ${pending.length} checklist review(s) using AT MOST ${cap} \`${reviewer.agentName}\` subagent(s)`,
|
|
67
67
|
`(commands.pr-gate.reviewerAgents = ${reviewer.maxAgents}). ${this.groupingHint(pending.length, cap)}`,
|
|
68
|
-
'Give each subagent every checklist it covers (doc, in-scope files
|
|
69
|
-
'
|
|
68
|
+
'Give each subagent every checklist it covers (doc, in-scope files); it submits ONE verdict per checklist',
|
|
69
|
+
'it covers through pnpm wp-write-review, and never one for a checklist it was not given.',
|
|
70
70
|
...own,
|
|
71
71
|
];
|
|
72
72
|
}
|
|
@@ -94,7 +94,8 @@ let ChecklistInstructionsService = class ChecklistInstructionsService {
|
|
|
94
94
|
lines.push(` doc to read: ${req.doc}`);
|
|
95
95
|
for (const scopeLine of this.scope(req))
|
|
96
96
|
lines.push(` ${scopeLine}`);
|
|
97
|
-
lines.push(`
|
|
97
|
+
lines.push(` submits via: ${this.reviewJsonService.submitCommand(req.id)}`);
|
|
98
|
+
lines.push(` which writes: ${this.reviewJsonService.checklistResultPath(reviewPath, req.id)}`);
|
|
98
99
|
return lines;
|
|
99
100
|
}
|
|
100
101
|
/**
|
|
@@ -122,9 +123,9 @@ let ChecklistInstructionsService = class ChecklistInstructionsService {
|
|
|
122
123
|
// hand-written agent .md.)
|
|
123
124
|
verdictFormat() {
|
|
124
125
|
return [
|
|
125
|
-
'TELL EACH subagent to
|
|
126
|
+
'TELL EACH subagent to submit each of its verdicts with EXACTLY this format (there is NO "success" field —',
|
|
126
127
|
'it was removed; "status" is a tri-state so a reviewer can pass a change AND still raise a concern):',
|
|
127
|
-
...this.reviewJsonService.
|
|
128
|
+
...this.reviewJsonService.renderVerdictSchema('<the checklist id>', ' ').split('\n'),
|
|
128
129
|
];
|
|
129
130
|
}
|
|
130
131
|
// The diff every reviewer judges. Stated once, here, because path matching is deliberately coarse and a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checklist-instructions.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/checklist-instructions.ts"],"names":[],"mappings":";;;;AAAA,yCAA2D;AAC3D,yDAAoD;AACpD,+CAEuB;AAEvB;;;;;;;;;;;;;;GAcG;AAEI,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IAKR;IAJ7B,oGAAoG;IACpG,2FAA2F;IAC3F,uGAAuG;IACvG,kDAAkD;IAClD,YAA6B,iBAAoC;QAApC,sBAAiB,GAAjB,iBAAiB,CAAmB;IAAG,CAAC;IAErE;;;OAGG;IACH,MAAM,CAAC,OAAqC,EAAE,UAAkB,EAAE,OAA+B;QAC7F,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QACpC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnF,MAAM,KAAK,GAAa,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;QACzD,KAAK,MAAM,GAAG,IAAI,OAAO;YAAE,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC;QAC5E,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;QACxC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,SAAS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AC,IAAI,CAAC,4FAA4F,CAAC,CAAC;QAC7G,CAAC;QACD,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;YAChB,KAAK,CAAC,IAAI,CAAC,6FAA6F,CAAC,CAAC;YAC1G,KAAK,CAAC,IAAI,CAAC,qFAAqF,CAAC,CAAC;QACtG,CAAC;QACD,IAAI,OAAO,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACtC,KAAK,CAAC,IAAI,CAAC,6CAA6C,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;QACrF,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;CAEJ,CAAA;AAvJY,oEAA4B;uCAA5B,4BAA4B;IADxC,IAAA,sBAAU,EAAC,8BAAkB,CAAC,SAAS,CAAC;6CAMW,+BAAiB;GALxD,4BAA4B,CAuJxC","sourcesContent":["import { injectable, bindingScopeValues } from 'inversify';\nimport { formatFileList } from './checklist-config';\nimport {\n ChecklistReviewContext, RequiredChecklist, ReviewJsonService,\n} from './review-json';\n\n/**\n * Renders the ONE block that tells the coding agent which reviewer subagents it must run and exactly what\n * to tell them. There is a single renderer because three callers need the identical text and any drift\n * between them is a correctness bug, not a cosmetic one:\n *\n * - `wp-review-upsert-pr` — the AI asks \"what review do I owe on this diff?\"\n * - `wp-finish-upsert-pr` — fails fast, listing ONLY the reviewers that still have not run\n * - `ReviewJsonService` — the same list appended to a review.json validation failure\n *\n * Callers pass ONLY the checklists still needing a verdict. A checklist already reviewed on this branch is\n * never re-listed — re-instructing it invites a redundant second run, and (worse) reads as though the\n * earlier verdict did not count.\n *\n * `@injectable(bindingScopeValues.Singleton)` so it is injected by type and drawn in the DI design.\n */\n@injectable(bindingScopeValues.Singleton)\nexport class ChecklistInstructionsService {\n // Injected so the verdict path comes from the ONE place that knows it. This class used to hand-roll\n // dirname with a regex and a hardcoded '/', a second implementation of ReviewJsonService's\n // checklistResultPath that agreed on POSIX and disagreed on Windows — the same duplicate-logic trap as\n // the two different matched-file truncation caps.\n constructor(private readonly reviewJsonService: ReviewJsonService) {}\n\n /**\n * The full instruction block, or '' when nothing is pending (so a caller can concatenate it blindly).\n * `reviewPath` is the branch's review.json — each verdict file sits beside it as review-<id>.json.\n */\n render(pending: readonly RequiredChecklist[], reviewPath: string, context: ChecklistReviewContext): string {\n if (pending.length === 0) return '';\n if (pending[0].reviewer.maxAgents === 0) return this.spawnRule(pending).join('\\n');\n const lines: string[] = [...this.spawnRule(pending), ''];\n for (const req of pending) lines.push(...this.oneReviewer(req, reviewPath));\n lines.push('', ...this.verdictFormat());\n lines.push('', ...this.diffLines(context));\n return lines.join('\\n');\n }\n\n /**\n * HOW MANY subagents, of WHICH type: at most `reviewerAgents` of them, with the owed checklists grouped\n * across them as the AI judges best. Every subagent is the repo's ONE reviewer agent type, and every\n * checklist still gets its own verdict file no matter how they were grouped.\n */\n spawnRule(pending: readonly RequiredChecklist[]): string[] {\n const reviewer = pending[0].reviewer;\n if (reviewer.maxAgents === 0) {\n return [\n 'Reviewer-agent reviews are disabled for this project (commands.pr-gate.reviewerAgents = 0).',\n 'Do not spawn reviewer subagents and do not write checklist verdict files.',\n ];\n }\n const own = [\n 'You may NOT review your own work, and you may NOT write a reviewer\\'s verdict file on its behalf.',\n ];\n const cap = Math.min(reviewer.maxAgents, pending.length);\n return [\n `You MUST run these ${pending.length} checklist review(s) using AT MOST ${cap} \\`${reviewer.agentName}\\` subagent(s)`,\n `(commands.pr-gate.reviewerAgents = ${reviewer.maxAgents}). ${this.groupingHint(pending.length, cap)}`,\n 'Give each subagent every checklist it covers (doc, in-scope files, verdict path); it writes ONE verdict',\n 'file per checklist it covers, and never one for a checklist it was not given.',\n ...own,\n ];\n }\n\n /**\n * The grouping sentence, with an example that fits THIS round's numbers — a cap of 1 has no choice to\n * make, and saying \"group them as you judge best\" there would invite a second subagent.\n */\n groupingHint(count: number, cap: number): string {\n if (cap <= 1) return 'Use ONE subagent for all of them.';\n const per = Math.ceil(count / cap);\n return `Group the checklists across them as you judge best — e.g. one subagent for all of them, or ${cap} with about ${per} each.`;\n }\n\n // Just the checklist IDS, for a caller that wants a one-line summary rather than the whole block.\n names(pending: readonly RequiredChecklist[]): string {\n return pending.map((r: RequiredChecklist): string => r.id).join(', ');\n }\n\n // What the subagent reviewing ONE checklist must be given: its doc, why it is running + over what, and\n // the file it must write.\n private oneReviewer(req: RequiredChecklist, reviewPath: string): string[] {\n const lines = [` • checklist ${req.id}`];\n // The doc is REPO-relative by the time it reaches here (see ChecklistDefinition.doc), so a subagent\n // handed this string can actually open it. Printing the raw config value would not resolve.\n if (req.doc.trim() !== '') lines.push(` doc to read: ${req.doc}`);\n for (const scopeLine of this.scope(req)) lines.push(` ${scopeLine}`);\n lines.push(` must write: ${this.reviewJsonService.checklistResultPath(reviewPath, req.id)}`);\n return lines;\n }\n\n /**\n * WHY this reviewer is running, and over what. NOT every checklist is pattern-matched: one with no\n * `patterns` runs on EVERY PR, and calling its file list \"matched\" implies the list is a narrow,\n * pre-filtered slice of the diff when it is in fact the whole thing. When patterns DID fire, they are\n * named — the reviewer cannot otherwise tell a precise migrations-only glob from a blanket match-all one.\n */\n private scope(req: RequiredChecklist): string[] {\n if (req.matchedPatterns.length === 0) {\n return [\n `in scope: ALWAYS RUNS — this checklist has no patterns, so the WHOLE diff is in scope`,\n ` all ${req.matchedFiles.length} changed file(s): ${formatFileList(req.matchedFiles)}`,\n ];\n }\n const globs = req.matchedPatterns.map((p: string): string => `\"${p}\"`).join(', ');\n return [\n `in scope: ${req.matchedFiles.length} file(s) matched ${globs}`,\n ` ${formatFileList(req.matchedFiles)}`,\n ];\n }\n\n // ONE shared format block for every reviewer, rather than repeating the schema under each name — and\n // the schema itself comes from ReviewJsonService, the single renderer, so a change to the verdict shape\n // cannot leave a stale copy in print. (It did once: `success` outlived its own removal in every\n // hand-written agent .md.)\n private verdictFormat(): string[] {\n return [\n 'TELL EACH subagent to write each of its verdict files with EXACTLY this format (there is NO \"success\" field —',\n 'it was removed; \"status\" is a tri-state so a reviewer can pass a change AND still raise a concern):',\n ...this.reviewJsonService.verdictSchemaFor('<the checklist id>', '', ' ').split('\\n'),\n ];\n }\n\n // The diff every reviewer judges. Stated once, here, because path matching is deliberately coarse and a\n // reviewer that only sees filenames cannot make the content-level call the checklist is asking for.\n private diffLines(context: ChecklistReviewContext): string[] {\n // NEVER omit these lines quietly. A reviewer given filenames but no way to read the change cannot make\n // the content-level judgment the checklist asks for, and a silently shorter instruction block is\n // indistinguishable from a complete one — so an unresolvable base is stated as the problem it is.\n if (context.baseSha.trim() === '') {\n return [\n '⚠️ No diff base resolved for this branch, so the exact `git diff` command could not be given.',\n ' Tell each reviewer to diff against main itself (`git diff $(git merge-base origin/main HEAD) HEAD -- <file>`)',\n ' and note that path matching is COARSE — judge the real change, not the path.',\n ];\n }\n const lines = ['Also give EACH one the real diff — path matching is COARSE, so judge the change, not the path:'];\n // The MATERIALIZED diff when it exists: it cannot go empty the way a hand-assembled range can. The\n // MANIFEST leads, and ALL.diff follows it, for the same reason the per-reviewer instructions were\n // reordered: whichever one is printed first and framed as \"everything\" is the only one that gets\n // opened — measured 4/4 — and ALL.diff is the one that can be silently incomplete.\n if (context.diffDir.trim() !== '') {\n lines.push(` path map, AUTHORITATIVE: ${context.diffDir}/manifest.json`);\n lines.push(' per file: status, bytes, absolute source + diff paths,');\n lines.push(' plus what was truncated or excluded');\n lines.push(` per-file diffs: ${context.diffDir}/files/`);\n lines.push(` combined view (may be capped): ${context.diffDir}/ALL.diff`);\n }\n // NEVER hand-assemble `<baseSha> HEAD` here. On a dirty tree the changed-file set is base→working\n // tree, so that range is empty and the reviewer is handed a command that shows it nothing — the\n // failure this whole class of field exists to prevent. The command is derived from the same basis\n // the file set was; when it is absent (an older pr-gate wrote the context), say so instead.\n if (context.fileDiffCommand.trim() !== '') {\n lines.push(` reproduce one file: ${context.fileDiffCommand}`);\n } else {\n lines.push(` ⚠️ no reproduce command recorded — derive it yourself from base ${context.baseSha},`);\n lines.push(' and check `git status` first: uncommitted work needs `git diff <base>` with NO head.');\n }\n if (context.dirty) {\n lines.push(' ⚠️ this diff INCLUDES uncommitted + untracked work, so it is not what a commit-to-commit');\n lines.push(' range would show. Judge it anyway — it is what the checklist matched against.');\n }\n if (context.prContextPath.trim() !== '') {\n lines.push(` full changed-file set + base/head sha: ${context.prContextPath}`);\n }\n return lines;\n }\n\n}\n"]}
|
|
1
|
+
{"version":3,"file":"checklist-instructions.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/checklist-instructions.ts"],"names":[],"mappings":";;;;AAAA,yCAA2D;AAC3D,yDAAoD;AACpD,+CAEuB;AAEvB;;;;;;;;;;;;;;GAcG;AAEI,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IAKR;IAJ7B,oGAAoG;IACpG,2FAA2F;IAC3F,uGAAuG;IACvG,kDAAkD;IAClD,YAA6B,iBAAoC;QAApC,sBAAiB,GAAjB,iBAAiB,CAAmB;IAAG,CAAC;IAErE;;;OAGG;IACH,MAAM,CAAC,OAAqC,EAAE,UAAkB,EAAE,OAA+B;QAC7F,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QACpC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnF,MAAM,KAAK,GAAa,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;QACzD,KAAK,MAAM,GAAG,IAAI,OAAO;YAAE,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC;QAC5E,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;QACxC,KAAK,CAAC,IAAI,CA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AO,CAAC,eAAe,EAAE,CAAC,CAAC;QAC/E,CAAC;aAAM,CAAC;YACJ,KAAK,CAAC,IAAI,CAAC,sEAAsE,OAAO,CAAC,OAAO,GAAG,CAAC,CAAC;YACrG,KAAK,CAAC,IAAI,CAAC,4FAA4F,CAAC,CAAC;QAC7G,CAAC;QACD,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;YAChB,KAAK,CAAC,IAAI,CAAC,6FAA6F,CAAC,CAAC;YAC1G,KAAK,CAAC,IAAI,CAAC,qFAAqF,CAAC,CAAC;QACtG,CAAC;QACD,IAAI,OAAO,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACtC,KAAK,CAAC,IAAI,CAAC,6CAA6C,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;QACrF,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;CAEJ,CAAA;AAxJY,oEAA4B;uCAA5B,4BAA4B;IADxC,IAAA,sBAAU,EAAC,8BAAkB,CAAC,SAAS,CAAC;6CAMW,+BAAiB;GALxD,4BAA4B,CAwJxC","sourcesContent":["import { injectable, bindingScopeValues } from 'inversify';\nimport { formatFileList } from './checklist-config';\nimport {\n ChecklistReviewContext, RequiredChecklist, ReviewJsonService,\n} from './review-json';\n\n/**\n * Renders the ONE block that tells the coding agent which reviewer subagents it must run and exactly what\n * to tell them. There is a single renderer because three callers need the identical text and any drift\n * between them is a correctness bug, not a cosmetic one:\n *\n * - `wp-review-upsert-pr` — the AI asks \"what review do I owe on this diff?\"\n * - `wp-finish-upsert-pr` — fails fast, listing ONLY the reviewers that still have not run\n * - `ReviewJsonService` — the same list appended to a review.json validation failure\n *\n * Callers pass ONLY the checklists still needing a verdict. A checklist already reviewed on this branch is\n * never re-listed — re-instructing it invites a redundant second run, and (worse) reads as though the\n * earlier verdict did not count.\n *\n * `@injectable(bindingScopeValues.Singleton)` so it is injected by type and drawn in the DI design.\n */\n@injectable(bindingScopeValues.Singleton)\nexport class ChecklistInstructionsService {\n // Injected so the verdict path comes from the ONE place that knows it. This class used to hand-roll\n // dirname with a regex and a hardcoded '/', a second implementation of ReviewJsonService's\n // checklistResultPath that agreed on POSIX and disagreed on Windows — the same duplicate-logic trap as\n // the two different matched-file truncation caps.\n constructor(private readonly reviewJsonService: ReviewJsonService) {}\n\n /**\n * The full instruction block, or '' when nothing is pending (so a caller can concatenate it blindly).\n * `reviewPath` is the branch's review.json — each verdict file sits beside it as review-<id>.json.\n */\n render(pending: readonly RequiredChecklist[], reviewPath: string, context: ChecklistReviewContext): string {\n if (pending.length === 0) return '';\n if (pending[0].reviewer.maxAgents === 0) return this.spawnRule(pending).join('\\n');\n const lines: string[] = [...this.spawnRule(pending), ''];\n for (const req of pending) lines.push(...this.oneReviewer(req, reviewPath));\n lines.push('', ...this.verdictFormat());\n lines.push('', ...this.diffLines(context));\n return lines.join('\\n');\n }\n\n /**\n * HOW MANY subagents, of WHICH type: at most `reviewerAgents` of them, with the owed checklists grouped\n * across them as the AI judges best. Every subagent is the repo's ONE reviewer agent type, and every\n * checklist still gets its own verdict file no matter how they were grouped.\n */\n spawnRule(pending: readonly RequiredChecklist[]): string[] {\n const reviewer = pending[0].reviewer;\n if (reviewer.maxAgents === 0) {\n return [\n 'Reviewer-agent reviews are disabled for this project (commands.pr-gate.reviewerAgents = 0).',\n 'Do not spawn reviewer subagents and do not submit checklist verdicts.',\n ];\n }\n const own = [\n 'You may NOT review your own work, and you may NOT submit a reviewer\\'s verdict on its behalf — wp-write-review refuses the coordinating agent.',\n ];\n const cap = Math.min(reviewer.maxAgents, pending.length);\n return [\n `You MUST run these ${pending.length} checklist review(s) using AT MOST ${cap} \\`${reviewer.agentName}\\` subagent(s)`,\n `(commands.pr-gate.reviewerAgents = ${reviewer.maxAgents}). ${this.groupingHint(pending.length, cap)}`,\n 'Give each subagent every checklist it covers (doc, in-scope files); it submits ONE verdict per checklist',\n 'it covers through pnpm wp-write-review, and never one for a checklist it was not given.',\n ...own,\n ];\n }\n\n /**\n * The grouping sentence, with an example that fits THIS round's numbers — a cap of 1 has no choice to\n * make, and saying \"group them as you judge best\" there would invite a second subagent.\n */\n groupingHint(count: number, cap: number): string {\n if (cap <= 1) return 'Use ONE subagent for all of them.';\n const per = Math.ceil(count / cap);\n return `Group the checklists across them as you judge best — e.g. one subagent for all of them, or ${cap} with about ${per} each.`;\n }\n\n // Just the checklist IDS, for a caller that wants a one-line summary rather than the whole block.\n names(pending: readonly RequiredChecklist[]): string {\n return pending.map((r: RequiredChecklist): string => r.id).join(', ');\n }\n\n // What the subagent reviewing ONE checklist must be given: its doc, why it is running + over what, and\n // the file it must write.\n private oneReviewer(req: RequiredChecklist, reviewPath: string): string[] {\n const lines = [` • checklist ${req.id}`];\n // The doc is REPO-relative by the time it reaches here (see ChecklistDefinition.doc), so a subagent\n // handed this string can actually open it. Printing the raw config value would not resolve.\n if (req.doc.trim() !== '') lines.push(` doc to read: ${req.doc}`);\n for (const scopeLine of this.scope(req)) lines.push(` ${scopeLine}`);\n lines.push(` submits via: ${this.reviewJsonService.submitCommand(req.id)}`);\n lines.push(` which writes: ${this.reviewJsonService.checklistResultPath(reviewPath, req.id)}`);\n return lines;\n }\n\n /**\n * WHY this reviewer is running, and over what. NOT every checklist is pattern-matched: one with no\n * `patterns` runs on EVERY PR, and calling its file list \"matched\" implies the list is a narrow,\n * pre-filtered slice of the diff when it is in fact the whole thing. When patterns DID fire, they are\n * named — the reviewer cannot otherwise tell a precise migrations-only glob from a blanket match-all one.\n */\n private scope(req: RequiredChecklist): string[] {\n if (req.matchedPatterns.length === 0) {\n return [\n `in scope: ALWAYS RUNS — this checklist has no patterns, so the WHOLE diff is in scope`,\n ` all ${req.matchedFiles.length} changed file(s): ${formatFileList(req.matchedFiles)}`,\n ];\n }\n const globs = req.matchedPatterns.map((p: string): string => `\"${p}\"`).join(', ');\n return [\n `in scope: ${req.matchedFiles.length} file(s) matched ${globs}`,\n ` ${formatFileList(req.matchedFiles)}`,\n ];\n }\n\n // ONE shared format block for every reviewer, rather than repeating the schema under each name — and\n // the schema itself comes from ReviewJsonService, the single renderer, so a change to the verdict shape\n // cannot leave a stale copy in print. (It did once: `success` outlived its own removal in every\n // hand-written agent .md.)\n private verdictFormat(): string[] {\n return [\n 'TELL EACH subagent to submit each of its verdicts with EXACTLY this format (there is NO \"success\" field —',\n 'it was removed; \"status\" is a tri-state so a reviewer can pass a change AND still raise a concern):',\n ...this.reviewJsonService.renderVerdictSchema('<the checklist id>', ' ').split('\\n'),\n ];\n }\n\n // The diff every reviewer judges. Stated once, here, because path matching is deliberately coarse and a\n // reviewer that only sees filenames cannot make the content-level call the checklist is asking for.\n private diffLines(context: ChecklistReviewContext): string[] {\n // NEVER omit these lines quietly. A reviewer given filenames but no way to read the change cannot make\n // the content-level judgment the checklist asks for, and a silently shorter instruction block is\n // indistinguishable from a complete one — so an unresolvable base is stated as the problem it is.\n if (context.baseSha.trim() === '') {\n return [\n '⚠️ No diff base resolved for this branch, so the exact `git diff` command could not be given.',\n ' Tell each reviewer to diff against main itself (`git diff $(git merge-base origin/main HEAD) HEAD -- <file>`)',\n ' and note that path matching is COARSE — judge the real change, not the path.',\n ];\n }\n const lines = ['Also give EACH one the real diff — path matching is COARSE, so judge the change, not the path:'];\n // The MATERIALIZED diff when it exists: it cannot go empty the way a hand-assembled range can. The\n // MANIFEST leads, and ALL.diff follows it, for the same reason the per-reviewer instructions were\n // reordered: whichever one is printed first and framed as \"everything\" is the only one that gets\n // opened — measured 4/4 — and ALL.diff is the one that can be silently incomplete.\n if (context.diffDir.trim() !== '') {\n lines.push(` path map, AUTHORITATIVE: ${context.diffDir}/manifest.json`);\n lines.push(' per file: status, bytes, absolute source + diff paths,');\n lines.push(' plus what was truncated or excluded');\n lines.push(` per-file diffs: ${context.diffDir}/files/`);\n lines.push(` combined view (may be capped): ${context.diffDir}/ALL.diff`);\n }\n // NEVER hand-assemble `<baseSha> HEAD` here. On a dirty tree the changed-file set is base→working\n // tree, so that range is empty and the reviewer is handed a command that shows it nothing — the\n // failure this whole class of field exists to prevent. The command is derived from the same basis\n // the file set was; when it is absent (an older pr-gate wrote the context), say so instead.\n if (context.fileDiffCommand.trim() !== '') {\n lines.push(` reproduce one file: ${context.fileDiffCommand}`);\n } else {\n lines.push(` ⚠️ no reproduce command recorded — derive it yourself from base ${context.baseSha},`);\n lines.push(' and check `git status` first: uncommitted work needs `git diff <base>` with NO head.');\n }\n if (context.dirty) {\n lines.push(' ⚠️ this diff INCLUDES uncommitted + untracked work, so it is not what a commit-to-commit');\n lines.push(' range would show. Judge it anyway — it is what the checklist matched against.');\n }\n if (context.prContextPath.trim() !== '') {\n lines.push(` full changed-file set + base/head sha: ${context.prContextPath}`);\n }\n return lines;\n }\n\n}\n"]}
|
package/src/index.d.ts
CHANGED
|
@@ -68,6 +68,7 @@ export { ReviewerInstructionsService, ReviewerBriefing, BriefedFile, ContextEntr
|
|
|
68
68
|
export { GateTokenService, computeGateToken, gateTokenMarker, extractGateToken, verifyGateToken, } from './gate-token';
|
|
69
69
|
export { SubagentProvenanceService, ReviewerEvidence, ReviewerContext, ExpectedReviewer, TranscriptScan, ProvenanceResult, PROVENANCE_OK, PROVENANCE_MISSING, PROVENANCE_SKIPPED, } from './subagent-provenance';
|
|
70
70
|
export { CLAUDE_CONFIG_DIR_ENV, ClaudeConfigDir, claudeConfigDir } from './claude-config-dir';
|
|
71
|
+
export { ReviewIdentityStamp, ReviewIdentityStampService, reviewIdentityStamps, WRITE_REVIEW_BIN, WRITE_REVIEW_CHECKLIST_FLAG, REVIEW_STAMP_DIR, REVIEW_STAMP_MAX_AGE_MS, } from './review-identity-stamp';
|
|
71
72
|
export { ReviewProvenanceService, ReviewProvenance, ReviewerTranscript, ReviewerPaths, OfferedContext, ProvenanceWriteRequest, DEFAULT_RETENTION_DAYS, } from './review-provenance';
|
|
72
73
|
export { ReviewJson, PrContext, ChecklistResult, ChecklistVerdict, ChecklistOverride, ChecklistOverrideService, checklistOverrideService, CK_PASS, CK_WARN, CK_OVERRIDDEN, CK_FAIL, CK_MISSING, CK_BAD_FORMAT, VERDICT_GREEN, VERDICT_YELLOW, VERDICT_RED, VERDICT_STATUSES, SINGLE_ROUND_MAIN_AGENT_INSTRUCTIONS, RequiredChecklist, ChecklistReviewContext, ReviewJsonService, prDirFor, reviewJsonPath, reviewJsonSchemaHint, } from './review-json';
|
|
73
74
|
export { MainSyncStatus, MainSyncStatusFile, MainSyncFileStore, PullRequestIndex, MAIN_SYNC_STATUS_VERSION, } from './main-sync-file';
|
package/src/index.js
CHANGED
|
@@ -5,10 +5,10 @@ exports.ConfigPruner = exports.retiredRuleFor = exports.retiredKeyErrorsIn = exp
|
|
|
5
5
|
exports.DEFAULT_MATCH_RULES = exports.renderMatchRuleMessage = exports.compileMatchRulePatterns = exports.isMatchRuleAllowedPath = exports.findMatchRuleViolations = exports.MatchRuleViolation = exports.MatchRuleConfig = exports.OrphanSweepReport = exports.OrphanDirSweeper = exports.TRASH_RETENTION_DAYS = exports.TRASH_MANIFEST_FILE = exports.TRASH_STATE_DIR = exports.OrphanSweepManifest = exports.OrphanSweepResult = exports.FailedOrphan = exports.ArchivedOrphan = exports.OrphanDirArchiver = exports.OrphanCandidate = exports.OrphanDirScanner = exports.MAX_ROW_BYTES = exports.BUILDS_LOG_GENERATIONS = exports.MAX_BUILDS_LOG_BYTES = exports.BUILD_DONE_FAIL = exports.BUILD_DONE_SUCCESS = exports.BUILD_START = exports.BUILDS_LOCK_FILE = exports.BUILDS_LOG_FILE = exports.RunningBuild = exports.BuildTermination = exports.BuildTicket = exports.BuildsLog = exports.DOCUMENTATION_KEYS = exports.HOME_KEY_AI_DOC = exports.HOME_KEY_DOC = exports.DEFAULT_MAX_CONCURRENT_BUILDS = exports.HOME_KEY_SINGLE_ROUND_REVIEW = exports.HOME_KEY_TURN_OFF_ALL_REVIEWERS = exports.HOME_KEY_MAX_CONCURRENT_BUILDS = exports.HOME_KEY_WHOLE_REPO_BUILD_GUARD = exports.HOME_KEY_ORPHAN_DIR_SWEEP = exports.HOME_EXPERIMENTAL_SECTION = exports.HOME_CONFIG_FILE = exports.HOME_CONFIG_DIR = exports.RETIRED_HOME_CONFIG_KEYS = exports.RetiredHomeConfigKey = exports.HomeConfigService = exports.HomeConfig = exports.validateChecklistDocs = exports.PrunedKey = exports.PruneResult = void 0;
|
|
6
6
|
exports.NoDestructureConfig = exports.PrismaConverterConfig = exports.PrismaValidateDtosConfig = exports.NoImplicitAnyConfig = exports.NoAnyUnknownConfig = exports.NoInlineTypeLiteralsConfig = exports.RequireReturnTypeConfig = exports.MaxFileLinesConfig = exports.MaxMethodLinesConfig = exports.WP_FINISH_PUSH_DEV = exports.WP_PUSH_DEV = exports.WP_FINISH_UPSERT_PR = exports.WP_START_UPSERT_PR = exports.WP_FINISH_UPDATE = exports.WP_START_UPDATE = exports.SyncFlowGuidance = exports.WebpiecesRulesConfig = exports.UPGRADE_SHIM_COMMAND = exports.PRUNE_UNKNOWN_COMMAND = exports.PUSH_DEV_STATE_FILE = exports.MERGE_EXPLANATION_FILE = exports.MERGE_IN_PROGRESS_FILE = exports.PR_REVIEW_DIR = exports.MERGE_INFO_DIR = exports.WEBPIECES_TMP_DIR = exports.hasDisable = exports.RULE_NAMES = exports.WEBPIECES_DISABLE = exports.AbstractRule = exports.ChangedFilesOptions = exports.DiffRange = exports.DiffScope = exports.isNewOrModified = exports.hasChangesInRange = exports.findNewMethodSignaturesInDiff = exports.getChangedLineNumbers = exports.getFileDiff = exports.getChangedFiles = exports.resolveBase = exports.detectBase = exports.SkipRuleResult = exports.getCurrentBranch = exports.shouldSkipRule = exports.FieldDef = exports.sectionForRule = exports.isHookGuard = exports.PR_LIFECYCLE_GUARD_KEY = exports.BRANCH_STATE_GUARD_KEY = exports.HOOK_GUARD_NAMES = exports.schemaFieldNames = void 0;
|
|
7
7
|
exports.LandPrConfig = exports.DEFAULT_BUILD_COMMAND = exports.PrGateConfig = exports.GateDefinition = exports.DEFAULT_MAX_COMMITS_BEHIND = exports.BranchStateGuardConfig = exports.DEFAULT_BANNED_STATE_PATH_PREFIXES = exports.DEFAULT_TEMPLATE_DIRS = exports.NoStatePathsInTemplatesConfig = exports.CLIENT_CREATION_SEVERITIES = exports.NoClientCreationOutsideServerOrClientConfig = exports.VALIDATE_TS_MODES = exports.STRUCTURAL_MODES = exports.ON_OFF_MODES = exports.THROW_CAUSE_MODES = exports.DIRECT_API_RESOLVER_MODES = exports.PRISMA_CONVERTER_MODES = exports.PRISMA_DTOS_MODES = exports.PROJECT_MODES = exports.MODIFIED_CODE_MODES = exports.INLINE_TYPE_MODES = exports.RETURN_TYPE_MODES = exports.FILE_LIMIT_MODES = exports.METHOD_LIMIT_MODES = exports.BaseRuleConfig = exports.ValidateEslintSyncConfig = exports.ValidateVersionsLockedConfig = exports.ValidatePackageJsonConfig = exports.ValidateNoArchitectureCyclesConfig = exports.ValidateArchitectureUnchangedConfig = exports.ValidateTsInSrcConfig = exports.NoJsFilesConfig = exports.DiGraphConfig = exports.NxWiringConfig = exports.RuntimeArchitectureConfig = exports.NoFileImportCyclesConfig = exports.PrLifecycleGuardConfig = exports.BranchCreationGuardConfig = exports.EnsureWeAreSecureConfig = exports.RoleTagConfig = exports.FrameworkTagConfig = exports.InjectAnnotationNotNeededForConcreteClassConfig = exports.NoFunctionOutsideClassConfig = exports.NoProcessExitOutsideMainConfig = exports.NoCustomCssConfig = exports.NoSymbolDiTokensConfig = exports.AngularNoDirectApiInResolverConfig = exports.ThrowCauseRequiredConfig = exports.CatchErrorPatternConfig = exports.NoUnmanagedExceptionsConfig = void 0;
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
11
|
-
exports.TMP_SCRATCH_PREFIX = exports.TMP_SCRATCH_RETENTION_DAYS = exports.TmpScratchSweeper = exports.SCRATCH_DIR_NAME = exports.RepoScratchDirs = exports.specTempDirs = exports.SpecTempDirs = exports.staleBinSweeper = exports.StaleBinSweeper = exports.StaleBinRemoval = exports.DEFAULT_MERGE_COMPLETE_COMMAND = exports.DEFAULT_UPSERT_PR_COMMAND = exports.buildCommandsConfig = exports.CommandsConfig = exports.logBranchMutation = exports.branchMutationLogPath = exports.BranchMutationLog = exports.BranchMutationEvent = exports.WorktreeReaper = void 0;
|
|
8
|
+
exports.WRITE_REVIEW_BIN = exports.reviewIdentityStamps = exports.ReviewIdentityStampService = exports.ReviewIdentityStamp = exports.claudeConfigDir = exports.ClaudeConfigDir = exports.CLAUDE_CONFIG_DIR_ENV = exports.PROVENANCE_SKIPPED = exports.PROVENANCE_MISSING = exports.PROVENANCE_OK = exports.ProvenanceResult = exports.TranscriptScan = exports.ExpectedReviewer = exports.ReviewerContext = exports.ReviewerEvidence = exports.SubagentProvenanceService = exports.verifyGateToken = exports.extractGateToken = exports.gateTokenMarker = exports.computeGateToken = exports.GateTokenService = exports.ALL_DIFF_ONE_READ_LINES = exports.READ_TRUNCATION_LINES = exports.ContextEntry = exports.BriefedFile = exports.ReviewerBriefing = exports.ReviewerInstructionsService = exports.ChecklistInstructionsService = exports.ChecklistValidator = exports.formatFileList = exports.normalizeChecklistDoc = exports.toChecklist = exports.DEFAULT_REVIEWER_AGENT_NAME = exports.REVIEWER_AGENTS_PLACEHOLDER = exports.ReviewerAgentPolicy = exports.ChecklistDefinition = exports.MERGE_MODES = exports.MERGE_MODE_NONE = exports.MERGE_MODE_AUTO = exports.buildDevDeployConfig = exports.buildLandPrConfig = exports.buildPrGateConfig = exports.defaultDevDeployConfig = exports.defaultLandPrConfig = exports.defaultPrGateConfig = exports.defaultGates = exports.ReviewContextEntry = exports.DEFAULT_DEV_BRANCH = exports.DEFAULT_DEV_BRANCH_NAMESPACE = exports.DevDeployConfig = void 0;
|
|
9
|
+
exports.readMainSyncLock = exports.computeAllMainSyncStatuses = exports.writeMainSyncStatusFile = exports.writeMainSyncStatus = exports.readMainSyncStatusFile = exports.readMainSyncStatus = exports.mainSyncLockPath = exports.mainSyncStatusPath = exports.DEFAULT_HANG_TIMEOUT_MINUTES = exports.MainSyncStatusService = exports.MainSyncLock = exports.MAIN_SYNC_STATUS_VERSION = exports.PullRequestIndex = exports.MainSyncFileStore = exports.MainSyncStatusFile = exports.MainSyncStatus = exports.reviewJsonSchemaHint = exports.reviewJsonPath = exports.prDirFor = exports.ReviewJsonService = exports.ChecklistReviewContext = exports.RequiredChecklist = exports.SINGLE_ROUND_MAIN_AGENT_INSTRUCTIONS = exports.VERDICT_STATUSES = exports.VERDICT_RED = exports.VERDICT_YELLOW = exports.VERDICT_GREEN = exports.CK_BAD_FORMAT = exports.CK_MISSING = exports.CK_FAIL = exports.CK_OVERRIDDEN = exports.CK_WARN = exports.CK_PASS = exports.checklistOverrideService = exports.ChecklistOverrideService = exports.ChecklistOverride = exports.ChecklistVerdict = exports.ChecklistResult = exports.PrContext = exports.ReviewJson = exports.DEFAULT_RETENTION_DAYS = exports.ProvenanceWriteRequest = exports.OfferedContext = exports.ReviewerPaths = exports.ReviewerTranscript = exports.ReviewProvenance = exports.ReviewProvenanceService = exports.REVIEW_STAMP_MAX_AGE_MS = exports.REVIEW_STAMP_DIR = exports.WRITE_REVIEW_CHECKLIST_FLAG = void 0;
|
|
10
|
+
exports.AGENT_TRANSCRIPT_QUIET_MS = exports.AGENT_ACTIVITY_UNKNOWN = exports.AGENT_ACTIVITY_RETURNED = exports.AGENT_ACTIVITY_LIVE = exports.WorktreeLockVerdicts = exports.LockEvidence = exports.LockDecision = exports.LOCK_LIVENESS_UNVERIFIABLE = exports.HARNESS_NOT_CONSULTED = exports.AgentWorktreeLockReader = exports.AgentWorktreeLock = exports.WorktreeService = exports.WorktreeWorkInFlight = exports.Worktree = exports.BRANCH_RETENTION_KEEP = exports.BRANCH_RETENTION_ARCHIVE_TAG = exports.BRANCH_RETENTION_DELETE = exports.BRANCH_RETENTIONS = exports.ARCHIVE_TAG_PREFIX = exports.ArchiveResult = exports.BranchArchiver = exports.ADJUDICATED_CLASSIFICATIONS = exports.CLASSIFICATION_DETACHED = exports.CLASSIFICATION_CURRENT = exports.CLASSIFICATION_LOCKED = exports.CLASSIFICATION_PRUNABLE = exports.CLASSIFICATION_IN_USE = exports.CLASSIFICATION_NEVER_PROPOSED = exports.CLASSIFICATION_CONTENT_IN_MAIN = exports.CLASSIFICATION_SUPERSEDED = exports.CLASSIFICATION_NO_COMMITS = exports.CLASSIFICATION_BACKUP_OF_LIVE = exports.CLASSIFICATION_BACKUP_OF_MERGED = exports.CLASSIFICATION_MERGED_PR = exports.CACHE_STALE_AFTER_MS = exports.CacheFreshness = exports.MergedBranchesService = exports.MergedBranchesCache = exports.DeletableWorktree = exports.DeletableBranch = exports.MergedBranch = exports.squashRecoverySteps = exports.stampCleanMainSyncStatus = exports.computeMainSyncStatus = exports.finishedLock = exports.inProcessLock = exports.tryAcquireMainSyncLock = exports.isRefreshInProgress = exports.isLockStale = exports.writeMainSyncLock = void 0;
|
|
11
|
+
exports.TMP_SCRATCH_PREFIX = exports.TMP_SCRATCH_RETENTION_DAYS = exports.TmpScratchSweeper = exports.SCRATCH_DIR_NAME = exports.RepoScratchDirs = exports.specTempDirs = exports.SpecTempDirs = exports.staleBinSweeper = exports.StaleBinSweeper = exports.StaleBinRemoval = exports.DEFAULT_MERGE_COMPLETE_COMMAND = exports.DEFAULT_UPSERT_PR_COMMAND = exports.buildCommandsConfig = exports.CommandsConfig = exports.logBranchMutation = exports.branchMutationLogPath = exports.BranchMutationLog = exports.BranchMutationEvent = exports.WorktreeReaper = exports.WorktreeReapResult = exports.ReapedWorktree = exports.BranchReaper = exports.ReapResult = exports.ReapedBranch = exports.HarnessAgentActivityReader = exports.AgentActivity = void 0;
|
|
12
12
|
var types_1 = require("./types");
|
|
13
13
|
Object.defineProperty(exports, "ResolvedConfig", { enumerable: true, get: function () { return types_1.ResolvedConfig; } });
|
|
14
14
|
Object.defineProperty(exports, "ResolvedRuleConfig", { enumerable: true, get: function () { return types_1.ResolvedRuleConfig; } });
|
|
@@ -414,6 +414,14 @@ var claude_config_dir_1 = require("./claude-config-dir");
|
|
|
414
414
|
Object.defineProperty(exports, "CLAUDE_CONFIG_DIR_ENV", { enumerable: true, get: function () { return claude_config_dir_1.CLAUDE_CONFIG_DIR_ENV; } });
|
|
415
415
|
Object.defineProperty(exports, "ClaudeConfigDir", { enumerable: true, get: function () { return claude_config_dir_1.ClaudeConfigDir; } });
|
|
416
416
|
Object.defineProperty(exports, "claudeConfigDir", { enumerable: true, get: function () { return claude_config_dir_1.claudeConfigDir; } });
|
|
417
|
+
var review_identity_stamp_1 = require("./review-identity-stamp");
|
|
418
|
+
Object.defineProperty(exports, "ReviewIdentityStamp", { enumerable: true, get: function () { return review_identity_stamp_1.ReviewIdentityStamp; } });
|
|
419
|
+
Object.defineProperty(exports, "ReviewIdentityStampService", { enumerable: true, get: function () { return review_identity_stamp_1.ReviewIdentityStampService; } });
|
|
420
|
+
Object.defineProperty(exports, "reviewIdentityStamps", { enumerable: true, get: function () { return review_identity_stamp_1.reviewIdentityStamps; } });
|
|
421
|
+
Object.defineProperty(exports, "WRITE_REVIEW_BIN", { enumerable: true, get: function () { return review_identity_stamp_1.WRITE_REVIEW_BIN; } });
|
|
422
|
+
Object.defineProperty(exports, "WRITE_REVIEW_CHECKLIST_FLAG", { enumerable: true, get: function () { return review_identity_stamp_1.WRITE_REVIEW_CHECKLIST_FLAG; } });
|
|
423
|
+
Object.defineProperty(exports, "REVIEW_STAMP_DIR", { enumerable: true, get: function () { return review_identity_stamp_1.REVIEW_STAMP_DIR; } });
|
|
424
|
+
Object.defineProperty(exports, "REVIEW_STAMP_MAX_AGE_MS", { enumerable: true, get: function () { return review_identity_stamp_1.REVIEW_STAMP_MAX_AGE_MS; } });
|
|
417
425
|
var review_provenance_1 = require("./review-provenance");
|
|
418
426
|
Object.defineProperty(exports, "ReviewProvenanceService", { enumerable: true, get: function () { return review_provenance_1.ReviewProvenanceService; } });
|
|
419
427
|
Object.defineProperty(exports, "ReviewProvenance", { enumerable: true, get: function () { return review_provenance_1.ReviewProvenance; } });
|
package/src/index.js.map
CHAN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8HAAA,oBAAoB,OAAA;AAExB,mEAOkC;AAN9B,6HAAA,mBAAmB,OAAA;AACnB,iIAAA,uBAAuB,OAAA;AACvB,gIAAA,sBAAsB,OAAA;AACtB,mIAAA,yBAAyB,OAAA;AACzB,uHAAA,aAAa,OAAA;AACb,oIAAA,0BAA0B,OAAA;AAE9B,iDAAyE;AAAhE,6GAAA,YAAY,OAAA;AAAE,2GAAA,UAAU,OAAA;AAAE,6GAAA,YAAY,OAAA;AAC/C,qDAAuF;AAA9E,iHAAA,cAAc,OAAA;AAAE,qHAAA,kBAAkB,OAAA;AAAE,iHAAA,cAAc,OAAA;AAE3D,6DAK+B;AAJ3B,0HAAA,mBAAmB,OAAA;AACnB,wHAAA,iBAAiB,OAAA;AACjB,4HAAA,qBAAqB,OAAA;AACrB,wHAAA,iBAAiB,OAAA;AAErB,qDAK2B;AAJvB,iHAAA,cAAc,OAAA;AACd,sHAAA,mBAAmB,OAAA;AACnB,4HAAA,yBAAyB,OAAA;AACzB,iIAAA,8BAA8B,OAAA;AAElC,qDAAsF;AAA7E,kHAAA,eAAe,OAAA;AAAE,kHAAA,eAAe,OAAA;AAAE,kHAAA,eAAe,OAAA;AAC1D,mDAA8D;AAArD,8GAAA,YAAY,OAAA;AAAE,8GAAA,YAAY,OAAA;AACnC,yDAAwE;AAA/D,oHAAA,eAAe,OAAA;AAAE,qHAAA,gBAAgB,OAAA;AAC1C,yDAAwG;AAA/F,sHAAA,iBAAiB,OAAA;AAAE,+HAAA,0BAA0B,OAAA;AAAE,uHAAA,kBAAkB,OAAA","sourcesContent":["export { ResolvedConfig, ResolvedRuleConfig, RuleOptions } from './types';\nexport { InformAiError } from './inform-ai-error';\nexport { RuleFailError, renderRuleFailForAi, renderRuleFailForHuman } from './rule-fail-error';\n// THE one representation of a cure, shared by RuleFailError (build-time) and FixHint (edit-time), plus\n// the one renderer that owns the \"Fix Option N:\" numbering and the \"(preferred)\" tag.\nexport { Option, formatFixOptions } from './fix-option';\nexport { CliExitError } from './cli-exit-error';\nexport { CliUsage, CliFlag, CliArgSet, CliArgsCheck, CliArgs } from './cli-args';\nexport { runMain } from './run-main';\nexport { toError } from './to-error';\nexport { loadAndValidate, LoadedConfig, ConfigLoader } from './load-config';\n// The validation-failure banner: ONE cure (edit the file), plus the marker phrases the validator\n// messages embed rather than re-type.\nexport {\n formatConfigErrorsBanner,\n CONFIG_POLICY_DOC,\n RETIRED_KEY_MARKER,\n RETIRED_TOP_LEVEL_MARKER,\n SECTION_PLACEMENT_MARKER,\n} from './config-error-banner';\nexport {\n findConfigFile,\n CONFIG_FILENAME,\n ConfigFile,\n ConfigParseAttempt,\n CONFIG_PARSE_ATTEMPTS,\n CONFIG_PARSE_RETRY_MILLIS,\n} from './config-file';\n// The PARSED-BUT-UNVALIDATED config shape. Exported for readers that walk the file generically rather\n// than through the typed config (the pr-gate active-hatch dashboard section reads every rule's hatches).\nexport type { RawConfigFile } from './config-file';\nexport { RepoRootFinder, INSTRUCT_AI_DIR, INSTRUCT_AI_LEAF } from './repo-root';\n// The scoped `.webpieces` resolver. EVERY reader/writer of `.webpieces/...` goes through one of its two\n// named methods so the call site declares whether the state is repo-wide or worktree-private.\nexport {\n DotWebpieces,\n dotWebpieces,\n GitDirs,\n WORKTREE_STATE_DIR,\n LOGS_STATE_DIR,\n} from './state-dir';\nexport { StateDirMigrator, StateMigrationReport } from './state-dir-migration';\n// There is NO machine-global state root. `MachineStateHome`/`StateHome`/`WEBPIECES_STATE_HOME` and the\n// `PrBodyStore` that used them are DELETED: the one artifact that needed a scope above the clone was the\n// gated squash body, and GitHub holds it now (it IS the PR description). Every `.webpieces` path a\n// webpieces tool writes is `{repo}/.webpieces`, resolved through `DotWebpieces` above. See\n// `decisions/0005-the-pr-description-is-the-merge-body.md`.\nexport { AgedTreeSweeper, SweepCount, RETENTION_DAYS } from './aged-tree-sweep';\nexport {\n ClaudeEnv,\n claudeEnv,\n CLAUDE_PROJECT_DIR_ENV,\n CLAUDE_PROJECT_DIR_UNSET,\n} from './claude-env';\nexport { AtomicFile } from './atomic-file';\n// The ONE formatter for a remedy that must run in a named directory: `cd '<root>' && <command>`.\n// Single-quoted so a repo path containing a space is still runnable (and still un-smuggleable).\nexport { atRoot } from './at-root';\nexport { RulesConfigDesign } from './rules-config-design';\nexport { DocumentDesign, isDocumentDesign, DESIGN_METADATA_KEYS } from './di';\nexport { ExcludePaths, isWebpiecesStateDir } from './exclude-hook-paths';\nexport { isPathExcluded, matchesAnyGlob } from './exclude-paths';\n// The machine-generated trees a line-count rule never fires on. A FLOOR, not a default value:\n// `max-file-lines.allowedPaths` adds to it, so configuring your own tree cannot lose it.\nexport { GENERATED_CODE_PATHS } from './generated-code-paths';\n// THE one `no-custom-css` path exemption. Both engines that enforce the rule (the edit-time hook and the\n// CI validator) consult this class, so `allowGlobs` cannot be honoured by one half and ignored by the other.\nexport { NoCustomCssScope } from './no-custom-css-scope';\nexport { defaultRules, defaultRulesDir } from './default-rules';\nexport {\n loadTemplate,\n writeTemplateIfMissing,\n writeTemplate,\n TemplateWriter,\n} from './load-template';\n// The instruct-ai docs are delivered as a SET: writing one writes the transitive closure of the docs it\n// links to, so a doc and everything it points at always land together. See instruct-ai-docs.ts.\nexport {\n GIT_WORKFLOW_DOC,\n GitWorkflowDoc,\n InstructAiDoc,\n InstructAiDocSet,\n MergeProcessDoc,\n} from './instruct-ai-docs';\nexport {\n MERGE_PROCESS_DOC,\n MergeProcessText,\n MergeRun,\n ReferenceMergeRun,\n} from './merge-process-doc';\nexport { BUILD_LOG_DOC } from './build-log-doc';\nexport {\n validateWebpiecesConfig,\n validatePrGateSection,\n validateChecklistsSection,\n validateSectionPlacement,\n validateExcludePaths,\n validateMatchRulesSection,\n allRuleNames,\n recommendedSeedMode,\n recommendedSeedModeFor,\n seedEntryForRule,\n} from './validate-config';\nexport { validateCommandsSection } from './commands-section-validators';\nexport {\n unknownKeyErrors,\n isCommentKey,\n validateTopLevelKeys,\n COMMENT_KEY_SUFFIX,\n} from './config-key-rules';\n// The retired-key table + the no-back-compat policy it enforces. Exported so the installer can migrate\n// what the errors instruct, and so consumers can enumerate retirements.\nexport {\n RETIRED_CONFIG_KEYS,\n RETIRED_SCOPE_KEY,\n RETIRED_SCOPE_RULE,\n RetiredConfigKey,\n isRetiredKey,\n retiredEntry,\n retiredKeyError,\n retiredKeyErrorsIn,\n retiredRuleFor,\n} from './retired-config-keys';\n// The MECHANICAL cure the unknown-rule error and the banner both name: strip every key no validator has a\n// schema for, so cleanliness is one command rather than a judgement call made while every Bash call is\n// blocked. `PRUNE_UNKNOWN_COMMAND` (constants.ts) is the single spelling of that command.\nexport { ConfigPruner, PruneResult, PrunedKey } from './config-pruner';\nexport { validateChecklistDocs } from './checklist-docs-validator';\n// The OPTIONAL machine-local `~/.webpieces/config.json`: absent (the normal state for every consumer) means\n// each key's declared default, silently; present means STRICT about what it understands and FORWARD-COMPATIBLE\n// about what it does not. A retired key (its own retirement table), a known key of the wrong TYPE and an\n// unparseable document all REJECT; a key this release simply does not recognise is IGNORED with a warning,\n// because the file is machine-global and the repos reading it pin different releases — rejecting a newer\n// release's key would hard-block every repo on the machine that is not yet on it. See home-config.ts.\n// `isHomeConfigPath` is what grants the file its unconditional Write/Edit PASS in the hook guards, which is\n// what keeps a rejection repairable. Every `experimental.*` key is an OPT-IN that defaults OFF, including\n// `whole-repo-build-guard`: ON requires an explicit `true`, and there is no per-key default to export.\nexport {\n HomeConfig,\n HomeConfigService,\n RetiredHomeConfigKey,\n RETIRED_HOME_CONFIG_KEYS,\n HOME_CONFIG_DIR,\n HOME_CONFIG_FILE,\n HOME_EXPERIMENTAL_SECTION,\n HOME_KEY_ORPHAN_DIR_SWEEP,\n HOME_KEY_WHOLE_REPO_BUILD_GUARD,\n HOME_KEY_MAX_CONCURRENT_BUILDS,\n HOME_KEY_TURN_OFF_ALL_REVIEWERS,\n HOME_KEY_SINGLE_ROUND_REVIEW,\n DEFAULT_MAX_CONCURRENT_BUILDS,\n HOME_KEY_DOC,\n HOME_KEY_AI_DOC,\n DOCUMENTATION_KEYS,\n} from './home-config';\n// The MACHINE-WIDE build ledger, `~/.webpieces/builds.log`. THE one carve-out from\n// `no-machine-global-state.spec.ts`'s rule that webpieces writes only under `{repo}/.webpieces` — the\n// argument is in `decisions/0006-the-build-ledger-is-machine-global.md`, and the short form is that \"how\n// many builds are burning this box's CPU\" is a fact about the MACHINE, is not a cache of anything a\n// remote owns, and cannot be answered from a per-repo file because every linked worktree has its own\n// `.webpieces/` and would be blind to the sibling it is contending with. See builds-log.ts.\nexport {\n BuildsLog,\n BuildTicket,\n BuildTermination,\n RunningBuild,\n BUILDS_LOG_FILE,\n BUILDS_LOCK_FILE,\n BUILD_START,\n BUILD_DONE_SUCCESS,\n BUILD_DONE_FAIL,\n MAX_BUILDS_LOG_BYTES,\n BUILDS_LOG_GENERATIONS,\n MAX_ROW_BYTES,\n} from './builds-log';\n// The orphan-directory sweep: the corpse an `nx g move` leaves on every clone, which git cannot remove\n// because an ignored dist/ or node_modules/ outlives every tracked file under it. See orphan-dir-scan.ts\n// for why the predicate is git's own `clean -Xdn` answer rather than a hand-rolled ignore walk.\nexport { OrphanDirScanner, OrphanCandidate } from './orphan-dir-scan';\nexport {\n OrphanDirArchiver,\n ArchivedOrphan,\n FailedOrphan,\n OrphanSweepResult,\n OrphanSweepManifest,\n TRASH_STATE_DIR,\n TRASH_MANIFEST_FILE,\n TRASH_RETENTION_DAYS,\n} from './orphan-dir-archive';\nexport { OrphanDirSweeper, OrphanSweepReport } from './orphan-dir-sweep';\nexport {\n MatchRuleConfig,\n MatchRuleViolation,\n findMatchRuleViolations,\n isMatchRuleAllowedPath,\n compileMatchRulePatterns,\n renderMatchRuleMessage,\n DEFAULT_MATCH_RULES,\n} from './match-rules-config';\nexport type { ConfigSection } from './sections';\nexport { schemaFieldNames } from './rule-schemas';\nexport {\n HOOK_GUARD_NAMES,\n BRANCH_STATE_GUARD_KEY,\n PR_LIFECYCLE_GUARD_KEY,\n isHookGuard,\n sectionForRule,\n} from './sections';\nexport { FieldDef } from './field-def';\nexport type { SchemaShape } from './field-def';\nexport { shouldSkipRule, getCurrentBranch } from './skip-rule';\nexport { SkipRuleResult } from './skip-rule';\nexport {\n detectBase,\n resolveBase,\n getChangedFiles,\n getFileDiff,\n getChangedLineNumbers,\n findNewMethodSignaturesInDiff,\n hasChangesInRange,\n isNewOrModified,\n DiffScope,\n DiffRange,\n ChangedFilesOptions,\n} from './diff-scope';\nexport { AbstractRule } from './abstract-rule';\nexport {\n WEBPIECES_DISABLE,\n RULE_NAMES,\n hasDisable,\n WEBPIECES_TMP_DIR,\n MERGE_INFO_DIR,\n PR_REVIEW_DIR,\n MERGE_IN_PROGRESS_FILE,\n MERGE_EXPLANATION_FILE,\n PUSH_DEV_STATE_FILE,\n PRUNE_UNKNOWN_COMMAND,\n UPGRADE_SHIM_COMMAND,\n} from './constants';\nexport { WebpiecesRulesConfig } from './WebpiecesRulesConfig';\nexport {\n SyncFlowGuidance,\n WP_START_UPDATE,\n WP_FINISH_UPDATE,\n WP_START_UPSERT_PR,\n WP_FINISH_UPSERT_PR,\n WP_PUSH_DEV,\n WP_FINISH_PUSH_DEV,\n} from './sync-flow-guidance';\nexport {\n MaxMethodLinesConfig,\n MaxFileLinesConfig,\n RequireReturnTypeConfig,\n NoInlineTypeLiteralsConfig,\n NoAnyUnknownConfig,\n NoImplicitAnyConfig,\n PrismaValidateDtosConfig,\n PrismaConverterConfig,\n NoDestructureConfig,\n NoUnmanagedExceptionsConfig,\n CatchErrorPatternConfig,\n ThrowCauseRequiredConfig,\n AngularNoDirectApiInResolverConfig,\n NoSymbolDiTokensConfig,\n NoCustomCssConfig,\n NoProcessExitOutsideMainConfig,\n NoFunctionOutsideClassConfig,\n InjectAnnotationNotNeededForConcreteClassConfig,\n FrameworkTagConfig,\n RoleTagConfig,\n EnsureWeAreSecureConfig,\n BranchCreationGuardConfig,\n PrLifecycleGuardConfig,\n NoFileImportCyclesConfig,\n RuntimeArchitectureConfig,\n NxWiringConfig,\n DiGraphConfig,\n NoJsFilesConfig,\n ValidateTsInSrcConfig,\n ValidateArchitectureUnchangedConfig,\n ValidateNoArchitectureCyclesConfig,\n ValidatePackageJsonConfig,\n ValidateVersionsLockedConfig,\n ValidateEslintSyncConfig,\n BaseRuleConfig,\n} from './rule-configs';\n// Mode unions + their value arrays — the single source of truth shared with code-rules.\nexport {\n METHOD_LIMIT_MODES,\n FILE_LIMIT_MODES,\n RETURN_TYPE_MODES,\n INLINE_TYPE_MODES,\n MODIFIED_CODE_MODES,\n PROJECT_MODES,\n PRISMA_DTOS_MODES,\n PRISMA_CONVERTER_MODES,\n DIRECT_API_RESOLVER_MODES,\n THROW_CAUSE_MODES,\n ON_OFF_MODES,\n STRUCTURAL_MODES,\n VALIDATE_TS_MODES,\n} from './rule-configs';\nexport {\n NoClientCreationOutsideServerOrClientConfig,\n CLIENT_CREATION_SEVERITIES,\n} from './no-client-creation-config';\nexport type { ClientCreationSeverity } from './no-client-creation-config';\n// The `no-state-paths-in-templates` config, in its own module for the same reason no-client-creation is:\n// rule-configs.ts is at its file-size cap and a rule that carries real defaults belongs beside them.\nexport {\n NoStatePathsInTemplatesConfig,\n DEFAULT_TEMPLATE_DIRS,\n DEFAULT_BANNED_STATE_PATH_PREFIXES,\n} from './no-state-paths-config';\nexport type {\n MethodLimitMode,\n FileLimitMode,\n ReturnTypeMode,\n InlineTypeMode,\n ModifiedCodeMode,\n ProjectMode,\n PrismaValidateDtosMode,\n PrismaConverterMode,\n DirectApiResolverMode,\n ThrowCauseMode,\n OnOffMode,\n StructuralMode,\n ValidateTsMode,\n} from './rule-configs';\nexport { BranchStateGuardConfig, DEFAULT_MAX_COMMITS_BEHIND } from './main-sync-guard-configs';\nexport {\n GateDefinition,\n PrGateConfig,\n DEFAULT_BUILD_COMMAND,\n LandPrConfig,\n DevDeployConfig,\n DEFAULT_DEV_BRANCH_NAMESPACE,\n DEFAULT_DEV_BRANCH,\n ReviewContextEntry,\n defaultGates,\n defaultPrGateConfig,\n defaultLandPrConfig,\n defaultDevDeployConfig,\n buildPrGateConfig,\n buildLandPrConfig,\n buildDevDeployConfig,\n MERGE_MODE_AUTO,\n MERGE_MODE_NONE,\n MERGE_MODES,\n} from './pr-gate-config';\nexport {\n ChecklistDefinition,\n ReviewerAgentPolicy,\n REVIEWER_AGENTS_PLACEHOLDER,\n DEFAULT_REVIEWER_AGENT_NAME,\n toChecklist,\n normalizeChecklistDoc,\n formatFileList,\n} from './checklist-config';\nexport type { RawChecklistItem } from './checklist-config';\nexport { ChecklistValidator } from './checklist-validator';\nexport { ChecklistInstructionsService } from './checklist-instructions';\nexport {\n ReviewerInstructionsService,\n ReviewerBriefing,\n BriefedFile,\n ContextEntry,\n READ_TRUNCATION_LINES,\n ALL_DIFF_ONE_READ_LINES,\n} from './reviewer-instructions';\nexport {\n GateTokenService,\n computeGateToken,\n gateTokenMarker,\n extractGateToken,\n verifyGateToken,\n} from './gate-token';\nexport {\n SubagentProvenanceService,\n ReviewerEvidence,\n ReviewerContext,\n ExpectedReviewer,\n TranscriptScan,\n ProvenanceResult,\n PROVENANCE_OK,\n PROVENANCE_MISSING,\n PROVENANCE_SKIPPED,\n} from './subagent-provenance';\nexport { CLAUDE_CONFIG_DIR_ENV, ClaudeConfigDir, claudeConfigDir } from './claude-config-dir';\nexport {\n ReviewProvenanceService,\n ReviewProvenance,\n ReviewerTranscript,\n ReviewerPaths,\n OfferedContext,\n ProvenanceWriteRequest,\n DEFAULT_RETENTION_DAYS,\n} from './review-provenance';\nexport {\n ReviewJson,\n PrContext,\n ChecklistResult,\n ChecklistVerdict,\n ChecklistOverride,\n ChecklistOverrideService,\n checklistOverrideService,\n CK_PASS,\n CK_WARN,\n CK_OVERRIDDEN,\n CK_FAIL,\n CK_MISSING,\n CK_BAD_FORMAT,\n VERDICT_GREEN,\n VERDICT_YELLOW,\n VERDICT_RED,\n VERDICT_STATUSES,\n SINGLE_ROUND_MAIN_AGENT_INSTRUCTIONS,\n RequiredChecklist,\n ChecklistReviewContext,\n ReviewJsonService,\n prDirFor,\n reviewJsonPath,\n reviewJsonSchemaHint,\n} from './review-json';\nexport {\n MainSyncStatus,\n MainSyncStatusFile,\n MainSyncFileStore,\n PullRequestIndex,\n MAIN_SYNC_STATUS_VERSION,\n} from './main-sync-file';\nexport {\n MainSyncLock,\n MainSyncStatusService,\n DEFAULT_HANG_TIMEOUT_MINUTES,\n mainSyncStatusPath,\n mainSyncLockPath,\n readMainSyncStatus,\n readMainSyncStatusFile,\n writeMainSyncStatus,\n writeMainSyncStatusFile,\n computeAllMainSyncStatuses,\n readMainSyncLock,\n writeMainSyncLock,\n isLockStale,\n isRefreshInProgress,\n tryAcquireMainSyncLock,\n inProcessLock,\n finishedLock,\n computeMainSyncStatus,\n stampCleanMainSyncStatus,\n squashRecoverySteps,\n} from './main-sync-status';\nexport {\n MergedBranch,\n DeletableBranch,\n DeletableWorktree,\n MergedBranchesCache,\n MergedBranchesService,\n CacheFreshness,\n CACHE_STALE_AFTER_MS,\n CLASSIFICATION_MERGED_PR,\n CLASSIFICATION_BACKUP_OF_MERGED,\n CLASSIFICATION_BACKUP_OF_LIVE,\n CLASSIFICATION_NO_COMMITS,\n CLASSIFICATION_SUPERSEDED,\n CLASSIFICATION_CONTENT_IN_MAIN,\n CLASSIFICATION_NEVER_PROPOSED,\n CLASSIFICATION_IN_USE,\n CLASSIFICATION_PRUNABLE,\n CLASSIFICATION_LOCKED,\n CLASSIFICATION_CURRENT,\n CLASSIFICATION_DETACHED,\n ADJUDICATED_CLASSIFICATIONS,\n} from './merged-branches';\nexport {\n BranchArchiver,\n ArchiveResult,\n ARCHIVE_TAG_PREFIX,\n BRANCH_RETENTIONS,\n BRANCH_RETENTION_DELETE,\n BRANCH_RETENTION_ARCHIVE_TAG,\n BRANCH_RETENTION_KEEP,\n} from './branch-archiver';\nexport { Worktree, WorktreeWorkInFlight, WorktreeService } from './worktrees';\nexport { AgentWorktreeLock, AgentWorktreeLockReader } from './agent-worktree-lock';\nexport {\n HARNESS_NOT_CONSULTED,\n LOCK_LIVENESS_UNVERIFIABLE,\n LockDecision,\n LockEvidence,\n WorktreeLockVerdicts,\n} from './worktree-lock-verdicts';\nexport {\n AGENT_ACTIVITY_LIVE,\n AGENT_ACTIVITY_RETURNED,\n AGENT_ACTIVITY_UNKNOWN,\n AGENT_TRANSCRIPT_QUIET_MS,\n AgentActivity,\n HarnessAgentActivityReader,\n} from './harness-agent-activity';\nexport { ReapedBranch, ReapResult, BranchReaper } from './branch-reaper';\nexport { ReapedWorktree, WorktreeReapResult, WorktreeReaper } from './worktree-reaper';\nexport type { MutationVerb, MutationPhase } from './branch-mutation-log';\nexport {\n BranchMutationEvent,\n BranchMutationLog,\n branchMutationLogPath,\n logBranchMutation,\n} from './branch-mutation-log';\nexport {\n CommandsConfig,\n buildCommandsConfig,\n DEFAULT_UPSERT_PR_COMMAND,\n DEFAULT_MERGE_COMPLETE_COMMAND,\n} from './commands-config';\nexport { StaleBinRemoval, StaleBinSweeper, staleBinSweeper } from './stale-bin-sweep';\nexport { SpecTempDirs, specTempDirs } from './spec-temp-dirs';\nexport { RepoScratchDirs, SCRATCH_DIR_NAME } from './repo-scratch-dirs';\nexport { TmpScratchSweeper, TMP_SCRATCH_RETENTION_DAYS, TMP_SCRATCH_PREFIX } from './tmp-scratch-sweep';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,iCAA0E;AAAjE,uGAAA,cAAc,OAAA;AAAE,2GAAA,kBAAkB,OAAA;AAC3C,qDAAkD;AAAzC,gHAAA,aAAa,OAAA;AACtB,qDAA+F;AAAtF,gHAAA,aAAa,OAAA;AAAE,sHAAA,mBAAmB,OAAA;AAAE,yHAAA,sBAAsB,OAAA;AACnE,uGAAuG;AACvG,sFAAsF;AACtF,2CAAwD;AAA/C,oGAAA,MAAM,OAAA;AAAE,8GAAA,gBAAgB,OAAA;AACjC,m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,6GAAA,YAAY,OAAA;AAAE,2GAAA,UAAU,OAAA;AAAE,6GAAA,YAAY,OAAA;AAC/C,qDAAuF;AAA9E,iHAAA,cAAc,OAAA;AAAE,qHAAA,kBAAkB,OAAA;AAAE,iHAAA,cAAc,OAAA;AAE3D,6DAK+B;AAJ3B,0HAAA,mBAAmB,OAAA;AACnB,wHAAA,iBAAiB,OAAA;AACjB,4HAAA,qBAAqB,OAAA;AACrB,wHAAA,iBAAiB,OAAA;AAErB,qDAK2B;AAJvB,iHAAA,cAAc,OAAA;AACd,sHAAA,mBAAmB,OAAA;AACnB,4HAAA,yBAAyB,OAAA;AACzB,iIAAA,8BAA8B,OAAA;AAElC,qDAAsF;AAA7E,kHAAA,eAAe,OAAA;AAAE,kHAAA,eAAe,OAAA;AAAE,kHAAA,eAAe,OAAA;AAC1D,mDAA8D;AAArD,8GAAA,YAAY,OAAA;AAAE,8GAAA,YAAY,OAAA;AACnC,yDAAwE;AAA/D,oHAAA,eAAe,OAAA;AAAE,qHAAA,gBAAgB,OAAA;AAC1C,yDAAwG;AAA/F,sHAAA,iBAAiB,OAAA;AAAE,+HAAA,0BAA0B,OAAA;AAAE,uHAAA,kBAAkB,OAAA","sourcesContent":["export { ResolvedConfig, ResolvedRuleConfig, RuleOptions } from './types';\nexport { InformAiError } from './inform-ai-error';\nexport { RuleFailError, renderRuleFailForAi, renderRuleFailForHuman } from './rule-fail-error';\n// THE one representation of a cure, shared by RuleFailError (build-time) and FixHint (edit-time), plus\n// the one renderer that owns the \"Fix Option N:\" numbering and the \"(preferred)\" tag.\nexport { Option, formatFixOptions } from './fix-option';\nexport { CliExitError } from './cli-exit-error';\nexport { CliUsage, CliFlag, CliArgSet, CliArgsCheck, CliArgs } from './cli-args';\nexport { runMain } from './run-main';\nexport { toError } from './to-error';\nexport { loadAndValidate, LoadedConfig, ConfigLoader } from './load-config';\n// The validation-failure banner: ONE cure (edit the file), plus the marker phrases the validator\n// messages embed rather than re-type.\nexport {\n formatConfigErrorsBanner,\n CONFIG_POLICY_DOC,\n RETIRED_KEY_MARKER,\n RETIRED_TOP_LEVEL_MARKER,\n SECTION_PLACEMENT_MARKER,\n} from './config-error-banner';\nexport {\n findConfigFile,\n CONFIG_FILENAME,\n ConfigFile,\n ConfigParseAttempt,\n CONFIG_PARSE_ATTEMPTS,\n CONFIG_PARSE_RETRY_MILLIS,\n} from './config-file';\n// The PARSED-BUT-UNVALIDATED config shape. Exported for readers that walk the file generically rather\n// than through the typed config (the pr-gate active-hatch dashboard section reads every rule's hatches).\nexport type { RawConfigFile } from './config-file';\nexport { RepoRootFinder, INSTRUCT_AI_DIR, INSTRUCT_AI_LEAF } from './repo-root';\n// The scoped `.webpieces` resolver. EVERY reader/writer of `.webpieces/...` goes through one of its two\n// named methods so the call site declares whether the state is repo-wide or worktree-private.\nexport {\n DotWebpieces,\n dotWebpieces,\n GitDirs,\n WORKTREE_STATE_DIR,\n LOGS_STATE_DIR,\n} from './state-dir';\nexport { StateDirMigrator, StateMigrationReport } from './state-dir-migration';\n// There is NO machine-global state root. `MachineStateHome`/`StateHome`/`WEBPIECES_STATE_HOME` and the\n// `PrBodyStore` that used them are DELETED: the one artifact that needed a scope above the clone was the\n// gated squash body, and GitHub holds it now (it IS the PR description). Every `.webpieces` path a\n// webpieces tool writes is `{repo}/.webpieces`, resolved through `DotWebpieces` above. See\n// `decisions/0005-the-pr-description-is-the-merge-body.md`.\nexport { AgedTreeSweeper, SweepCount, RETENTION_DAYS } from './aged-tree-sweep';\nexport {\n ClaudeEnv,\n claudeEnv,\n CLAUDE_PROJECT_DIR_ENV,\n CLAUDE_PROJECT_DIR_UNSET,\n} from './claude-env';\nexport { AtomicFile } from './atomic-file';\n// The ONE formatter for a remedy that must run in a named directory: `cd '<root>' && <command>`.\n// Single-quoted so a repo path containing a space is still runnable (and still un-smuggleable).\nexport { atRoot } from './at-root';\nexport { RulesConfigDesign } from './rules-config-design';\nexport { DocumentDesign, isDocumentDesign, DESIGN_METADATA_KEYS } from './di';\nexport { ExcludePaths, isWebpiecesStateDir } from './exclude-hook-paths';\nexport { isPathExcluded, matchesAnyGlob } from './exclude-paths';\n// The machine-generated trees a line-count rule never fires on. A FLOOR, not a default value:\n// `max-file-lines.allowedPaths` adds to it, so configuring your own tree cannot lose it.\nexport { GENERATED_CODE_PATHS } from './generated-code-paths';\n// THE one `no-custom-css` path exemption. Both engines that enforce the rule (the edit-time hook and the\n// CI validator) consult this class, so `allowGlobs` cannot be honoured by one half and ignored by the other.\nexport { NoCustomCssScope } from './no-custom-css-scope';\nexport { defaultRules, defaultRulesDir } from './default-rules';\nexport {\n loadTemplate,\n writeTemplateIfMissing,\n writeTemplate,\n TemplateWriter,\n} from './load-template';\n// The instruct-ai docs are delivered as a SET: writing one writes the transitive closure of the docs it\n// links to, so a doc and everything it points at always land together. See instruct-ai-docs.ts.\nexport {\n GIT_WORKFLOW_DOC,\n GitWorkflowDoc,\n InstructAiDoc,\n InstructAiDocSet,\n MergeProcessDoc,\n} from './instruct-ai-docs';\nexport {\n MERGE_PROCESS_DOC,\n MergeProcessText,\n MergeRun,\n ReferenceMergeRun,\n} from './merge-process-doc';\nexport { BUILD_LOG_DOC } from './build-log-doc';\nexport {\n validateWebpiecesConfig,\n validatePrGateSection,\n validateChecklistsSection,\n validateSectionPlacement,\n validateExcludePaths,\n validateMatchRulesSection,\n allRuleNames,\n recommendedSeedMode,\n recommendedSeedModeFor,\n seedEntryForRule,\n} from './validate-config';\nexport { validateCommandsSection } from './commands-section-validators';\nexport {\n unknownKeyErrors,\n isCommentKey,\n validateTopLevelKeys,\n COMMENT_KEY_SUFFIX,\n} from './config-key-rules';\n// The retired-key table + the no-back-compat policy it enforces. Exported so the installer can migrate\n// what the errors instruct, and so consumers can enumerate retirements.\nexport {\n RETIRED_CONFIG_KEYS,\n RETIRED_SCOPE_KEY,\n RETIRED_SCOPE_RULE,\n RetiredConfigKey,\n isRetiredKey,\n retiredEntry,\n retiredKeyError,\n retiredKeyErrorsIn,\n retiredRuleFor,\n} from './retired-config-keys';\n// The MECHANICAL cure the unknown-rule error and the banner both name: strip every key no validator has a\n// schema for, so cleanliness is one command rather than a judgement call made while every Bash call is\n// blocked. `PRUNE_UNKNOWN_COMMAND` (constants.ts) is the single spelling of that command.\nexport { ConfigPruner, PruneResult, PrunedKey } from './config-pruner';\nexport { validateChecklistDocs } from './checklist-docs-validator';\n// The OPTIONAL machine-local `~/.webpieces/config.json`: absent (the normal state for every consumer) means\n// each key's declared default, silently; present means STRICT about what it understands and FORWARD-COMPATIBLE\n// about what it does not. A retired key (its own retirement table), a known key of the wrong TYPE and an\n// unparseable document all REJECT; a key this release simply does not recognise is IGNORED with a warning,\n// because the file is machine-global and the repos reading it pin different releases — rejecting a newer\n// release's key would hard-block every repo on the machine that is not yet on it. See home-config.ts.\n// `isHomeConfigPath` is what grants the file its unconditional Write/Edit PASS in the hook guards, which is\n// what keeps a rejection repairable. Every `experimental.*` key is an OPT-IN that defaults OFF, including\n// `whole-repo-build-guard`: ON requires an explicit `true`, and there is no per-key default to export.\nexport {\n HomeConfig,\n HomeConfigService,\n RetiredHomeConfigKey,\n RETIRED_HOME_CONFIG_KEYS,\n HOME_CONFIG_DIR,\n HOME_CONFIG_FILE,\n HOME_EXPERIMENTAL_SECTION,\n HOME_KEY_ORPHAN_DIR_SWEEP,\n HOME_KEY_WHOLE_REPO_BUILD_GUARD,\n HOME_KEY_MAX_CONCURRENT_BUILDS,\n HOME_KEY_TURN_OFF_ALL_REVIEWERS,\n HOME_KEY_SINGLE_ROUND_REVIEW,\n DEFAULT_MAX_CONCURRENT_BUILDS,\n HOME_KEY_DOC,\n HOME_KEY_AI_DOC,\n DOCUMENTATION_KEYS,\n} from './home-config';\n// The MACHINE-WIDE build ledger, `~/.webpieces/builds.log`. THE one carve-out from\n// `no-machine-global-state.spec.ts`'s rule that webpieces writes only under `{repo}/.webpieces` — the\n// argument is in `decisions/0006-the-build-ledger-is-machine-global.md`, and the short form is that \"how\n// many builds are burning this box's CPU\" is a fact about the MACHINE, is not a cache of anything a\n// remote owns, and cannot be answered from a per-repo file because every linked worktree has its own\n// `.webpieces/` and would be blind to the sibling it is contending with. See builds-log.ts.\nexport {\n BuildsLog,\n BuildTicket,\n BuildTermination,\n RunningBuild,\n BUILDS_LOG_FILE,\n BUILDS_LOCK_FILE,\n BUILD_START,\n BUILD_DONE_SUCCESS,\n BUILD_DONE_FAIL,\n MAX_BUILDS_LOG_BYTES,\n BUILDS_LOG_GENERATIONS,\n MAX_ROW_BYTES,\n} from './builds-log';\n// The orphan-directory sweep: the corpse an `nx g move` leaves on every clone, which git cannot remove\n// because an ignored dist/ or node_modules/ outlives every tracked file under it. See orphan-dir-scan.ts\n// for why the predicate is git's own `clean -Xdn` answer rather than a hand-rolled ignore walk.\nexport { OrphanDirScanner, OrphanCandidate } from './orphan-dir-scan';\nexport {\n OrphanDirArchiver,\n ArchivedOrphan,\n FailedOrphan,\n OrphanSweepResult,\n OrphanSweepManifest,\n TRASH_STATE_DIR,\n TRASH_MANIFEST_FILE,\n TRASH_RETENTION_DAYS,\n} from './orphan-dir-archive';\nexport { OrphanDirSweeper, OrphanSweepReport } from './orphan-dir-sweep';\nexport {\n MatchRuleConfig,\n MatchRuleViolation,\n findMatchRuleViolations,\n isMatchRuleAllowedPath,\n compileMatchRulePatterns,\n renderMatchRuleMessage,\n DEFAULT_MATCH_RULES,\n} from './match-rules-config';\nexport type { ConfigSection } from './sections';\nexport { schemaFieldNames } from './rule-schemas';\nexport {\n HOOK_GUARD_NAMES,\n BRANCH_STATE_GUARD_KEY,\n PR_LIFECYCLE_GUARD_KEY,\n isHookGuard,\n sectionForRule,\n} from './sections';\nexport { FieldDef } from './field-def';\nexport type { SchemaShape } from './field-def';\nexport { shouldSkipRule, getCurrentBranch } from './skip-rule';\nexport { SkipRuleResult } from './skip-rule';\nexport {\n detectBase,\n resolveBase,\n getChangedFiles,\n getFileDiff,\n getChangedLineNumbers,\n findNewMethodSignaturesInDiff,\n hasChangesInRange,\n isNewOrModified,\n DiffScope,\n DiffRange,\n ChangedFilesOptions,\n} from './diff-scope';\nexport { AbstractRule } from './abstract-rule';\nexport {\n WEBPIECES_DISABLE,\n RULE_NAMES,\n hasDisable,\n WEBPIECES_TMP_DIR,\n MERGE_INFO_DIR,\n PR_REVIEW_DIR,\n MERGE_IN_PROGRESS_FILE,\n MERGE_EXPLANATION_FILE,\n PUSH_DEV_STATE_FILE,\n PRUNE_UNKNOWN_COMMAND,\n UPGRADE_SHIM_COMMAND,\n} from './constants';\nexport { WebpiecesRulesConfig } from './WebpiecesRulesConfig';\nexport {\n SyncFlowGuidance,\n WP_START_UPDATE,\n WP_FINISH_UPDATE,\n WP_START_UPSERT_PR,\n WP_FINISH_UPSERT_PR,\n WP_PUSH_DEV,\n WP_FINISH_PUSH_DEV,\n} from './sync-flow-guidance';\nexport {\n MaxMethodLinesConfig,\n MaxFileLinesConfig,\n RequireReturnTypeConfig,\n NoInlineTypeLiteralsConfig,\n NoAnyUnknownConfig,\n NoImplicitAnyConfig,\n PrismaValidateDtosConfig,\n PrismaConverterConfig,\n NoDestructureConfig,\n NoUnmanagedExceptionsConfig,\n CatchErrorPatternConfig,\n ThrowCauseRequiredConfig,\n AngularNoDirectApiInResolverConfig,\n NoSymbolDiTokensConfig,\n NoCustomCssConfig,\n NoProcessExitOutsideMainConfig,\n NoFunctionOutsideClassConfig,\n InjectAnnotationNotNeededForConcreteClassConfig,\n FrameworkTagConfig,\n RoleTagConfig,\n EnsureWeAreSecureConfig,\n BranchCreationGuardConfig,\n PrLifecycleGuardConfig,\n NoFileImportCyclesConfig,\n RuntimeArchitectureConfig,\n NxWiringConfig,\n DiGraphConfig,\n NoJsFilesConfig,\n ValidateTsInSrcConfig,\n ValidateArchitectureUnchangedConfig,\n ValidateNoArchitectureCyclesConfig,\n ValidatePackageJsonConfig,\n ValidateVersionsLockedConfig,\n ValidateEslintSyncConfig,\n BaseRuleConfig,\n} from './rule-configs';\n// Mode unions + their value arrays — the single source of truth shared with code-rules.\nexport {\n METHOD_LIMIT_MODES,\n FILE_LIMIT_MODES,\n RETURN_TYPE_MODES,\n INLINE_TYPE_MODES,\n MODIFIED_CODE_MODES,\n PROJECT_MODES,\n PRISMA_DTOS_MODES,\n PRISMA_CONVERTER_MODES,\n DIRECT_API_RESOLVER_MODES,\n THROW_CAUSE_MODES,\n ON_OFF_MODES,\n STRUCTURAL_MODES,\n VALIDATE_TS_MODES,\n} from './rule-configs';\nexport {\n NoClientCreationOutsideServerOrClientConfig,\n CLIENT_CREATION_SEVERITIES,\n} from './no-client-creation-config';\nexport type { ClientCreationSeverity } from './no-client-creation-config';\n// The `no-state-paths-in-templates` config, in its own module for the same reason no-client-creation is:\n// rule-configs.ts is at its file-size cap and a rule that carries real defaults belongs beside them.\nexport {\n NoStatePathsInTemplatesConfig,\n DEFAULT_TEMPLATE_DIRS,\n DEFAULT_BANNED_STATE_PATH_PREFIXES,\n} from './no-state-paths-config';\nexport type {\n MethodLimitMode,\n FileLimitMode,\n ReturnTypeMode,\n InlineTypeMode,\n ModifiedCodeMode,\n ProjectMode,\n PrismaValidateDtosMode,\n PrismaConverterMode,\n DirectApiResolverMode,\n ThrowCauseMode,\n OnOffMode,\n StructuralMode,\n ValidateTsMode,\n} from './rule-configs';\nexport { BranchStateGuardConfig, DEFAULT_MAX_COMMITS_BEHIND } from './main-sync-guard-configs';\nexport {\n GateDefinition,\n PrGateConfig,\n DEFAULT_BUILD_COMMAND,\n LandPrConfig,\n DevDeployConfig,\n DEFAULT_DEV_BRANCH_NAMESPACE,\n DEFAULT_DEV_BRANCH,\n ReviewContextEntry,\n defaultGates,\n defaultPrGateConfig,\n defaultLandPrConfig,\n defaultDevDeployConfig,\n buildPrGateConfig,\n buildLandPrConfig,\n buildDevDeployConfig,\n MERGE_MODE_AUTO,\n MERGE_MODE_NONE,\n MERGE_MODES,\n} from './pr-gate-config';\nexport {\n ChecklistDefinition,\n ReviewerAgentPolicy,\n REVIEWER_AGENTS_PLACEHOLDER,\n DEFAULT_REVIEWER_AGENT_NAME,\n toChecklist,\n normalizeChecklistDoc,\n formatFileList,\n} from './checklist-config';\nexport type { RawChecklistItem } from './checklist-config';\nexport { ChecklistValidator } from './checklist-validator';\nexport { ChecklistInstructionsService } from './checklist-instructions';\nexport {\n ReviewerInstructionsService,\n ReviewerBriefing,\n BriefedFile,\n ContextEntry,\n READ_TRUNCATION_LINES,\n ALL_DIFF_ONE_READ_LINES,\n} from './reviewer-instructions';\nexport {\n GateTokenService,\n computeGateToken,\n gateTokenMarker,\n extractGateToken,\n verifyGateToken,\n} from './gate-token';\nexport {\n SubagentProvenanceService,\n ReviewerEvidence,\n ReviewerContext,\n ExpectedReviewer,\n TranscriptScan,\n ProvenanceResult,\n PROVENANCE_OK,\n PROVENANCE_MISSING,\n PROVENANCE_SKIPPED,\n} from './subagent-provenance';\nexport { CLAUDE_CONFIG_DIR_ENV, ClaudeConfigDir, claudeConfigDir } from './claude-config-dir';\nexport {\n ReviewIdentityStamp,\n ReviewIdentityStampService,\n reviewIdentityStamps,\n WRITE_REVIEW_BIN,\n WRITE_REVIEW_CHECKLIST_FLAG,\n REVIEW_STAMP_DIR,\n REVIEW_STAMP_MAX_AGE_MS,\n} from './review-identity-stamp';\nexport {\n ReviewProvenanceService,\n ReviewProvenance,\n ReviewerTranscript,\n ReviewerPaths,\n OfferedContext,\n ProvenanceWriteRequest,\n DEFAULT_RETENTION_DAYS,\n} from './review-provenance';\nexport {\n ReviewJson,\n PrContext,\n ChecklistResult,\n ChecklistVerdict,\n ChecklistOverride,\n ChecklistOverrideService,\n checklistOverrideService,\n CK_PASS,\n CK_WARN,\n CK_OVERRIDDEN,\n CK_FAIL,\n CK_MISSING,\n CK_BAD_FORMAT,\n VERDICT_GREEN,\n VERDICT_YELLOW,\n VERDICT_RED,\n VERDICT_STATUSES,\n SINGLE_ROUND_MAIN_AGENT_INSTRUCTIONS,\n RequiredChecklist,\n ChecklistReviewContext,\n ReviewJsonService,\n prDirFor,\n reviewJsonPath,\n reviewJsonSchemaHint,\n} from './review-json';\nexport {\n MainSyncStatus,\n MainSyncStatusFile,\n MainSyncFileStore,\n PullRequestIndex,\n MAIN_SYNC_STATUS_VERSION,\n} from './main-sync-file';\nexport {\n MainSyncLock,\n MainSyncStatusService,\n DEFAULT_HANG_TIMEOUT_MINUTES,\n mainSyncStatusPath,\n mainSyncLockPath,\n readMainSyncStatus,\n readMainSyncStatusFile,\n writeMainSyncStatus,\n writeMainSyncStatusFile,\n computeAllMainSyncStatuses,\n readMainSyncLock,\n writeMainSyncLock,\n isLockStale,\n isRefreshInProgress,\n tryAcquireMainSyncLock,\n inProcessLock,\n finishedLock,\n computeMainSyncStatus,\n stampCleanMainSyncStatus,\n squashRecoverySteps,\n} from './main-sync-status';\nexport {\n MergedBranch,\n DeletableBranch,\n DeletableWorktree,\n MergedBranchesCache,\n MergedBranchesService,\n CacheFreshness,\n CACHE_STALE_AFTER_MS,\n CLASSIFICATION_MERGED_PR,\n CLASSIFICATION_BACKUP_OF_MERGED,\n CLASSIFICATION_BACKUP_OF_LIVE,\n CLASSIFICATION_NO_COMMITS,\n CLASSIFICATION_SUPERSEDED,\n CLASSIFICATION_CONTENT_IN_MAIN,\n CLASSIFICATION_NEVER_PROPOSED,\n CLASSIFICATION_IN_USE,\n CLASSIFICATION_PRUNABLE,\n CLASSIFICATION_LOCKED,\n CLASSIFICATION_CURRENT,\n CLASSIFICATION_DETACHED,\n ADJUDICATED_CLASSIFICATIONS,\n} from './merged-branches';\nexport {\n BranchArchiver,\n ArchiveResult,\n ARCHIVE_TAG_PREFIX,\n BRANCH_RETENTIONS,\n BRANCH_RETENTION_DELETE,\n BRANCH_RETENTION_ARCHIVE_TAG,\n BRANCH_RETENTION_KEEP,\n} from './branch-archiver';\nexport { Worktree, WorktreeWorkInFlight, WorktreeService } from './worktrees';\nexport { AgentWorktreeLock, AgentWorktreeLockReader } from './agent-worktree-lock';\nexport {\n HARNESS_NOT_CONSULTED,\n LOCK_LIVENESS_UNVERIFIABLE,\n LockDecision,\n LockEvidence,\n WorktreeLockVerdicts,\n} from './worktree-lock-verdicts';\nexport {\n AGENT_ACTIVITY_LIVE,\n AGENT_ACTIVITY_RETURNED,\n AGENT_ACTIVITY_UNKNOWN,\n AGENT_TRANSCRIPT_QUIET_MS,\n AgentActivity,\n HarnessAgentActivityReader,\n} from './harness-agent-activity';\nexport { ReapedBranch, ReapResult, BranchReaper } from './branch-reaper';\nexport { ReapedWorktree, WorktreeReapResult, WorktreeReaper } from './worktree-reaper';\nexport type { MutationVerb, MutationPhase } from './branch-mutation-log';\nexport {\n BranchMutationEvent,\n BranchMutationLog,\n branchMutationLogPath,\n logBranchMutation,\n} from './branch-mutation-log';\nexport {\n CommandsConfig,\n buildCommandsConfig,\n DEFAULT_UPSERT_PR_COMMAND,\n DEFAULT_MERGE_COMPLETE_COMMAND,\n} from './commands-config';\nexport { StaleBinRemoval, StaleBinSweeper, staleBinSweeper } from './stale-bin-sweep';\nexport { SpecTempDirs, specTempDirs } from './spec-temp-dirs';\nexport { RepoScratchDirs, SCRATCH_DIR_NAME } from './repo-scratch-dirs';\nexport { TmpScratchSweeper, TMP_SCRATCH_RETENTION_DAYS, TMP_SCRATCH_PREFIX } from './tmp-scratch-sweep';\n"]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { AtomicFile } from './atomic-file';
|
|
2
|
+
import { DotWebpieces } from './state-dir';
|
|
3
|
+
/** The ONE sanctioned way a reviewer submits a checklist verdict (issue #863). */
|
|
4
|
+
export declare const WRITE_REVIEW_BIN = "wp-write-review";
|
|
5
|
+
/** The flag that names the checklist a `wp-write-review` call submits for. */
|
|
6
|
+
export declare const WRITE_REVIEW_CHECKLIST_FLAG = "--checklist";
|
|
7
|
+
/** Where the stamps live, beneath this worktree's tooling-owned state dir (never the AI-writable one). */
|
|
8
|
+
export declare const REVIEW_STAMP_DIR = "review-stamps";
|
|
9
|
+
/**
|
|
10
|
+
* How long a stamp stays usable. The hook writes it a few milliseconds before the harness starts the very
|
|
11
|
+
* Bash command it stamped, so anything older than this is left over from a call that never reached the bin
|
|
12
|
+
* — and must not be available to lend its identity to a later caller.
|
|
13
|
+
*/
|
|
14
|
+
export declare const REVIEW_STAMP_MAX_AGE_MS = 120000;
|
|
15
|
+
/**
|
|
16
|
+
* WHO is running a `pnpm wp-write-review` Bash call, as the HARNESS reported it to the PreToolUse hook.
|
|
17
|
+
* Data-only (per CLAUDE.md), and its field names are the JSON keys on disk.
|
|
18
|
+
*
|
|
19
|
+
* WHY a hook stamp and not the environment (issue #863). A Bash-invoked bin sees only its env, and the env
|
|
20
|
+
* cannot answer "is this a subagent?" in either harness:
|
|
21
|
+
* - Claude Code exports `CLAUDE_CODE_SESSION_ID`, which is the PARENT session's id in a subagent too, and
|
|
22
|
+
* no agent id at all — a reviewer and its coordinator have byte-identical identity env.
|
|
23
|
+
* - Codex exports `CODEX_SESSION_ID` / `CODEX_THREAD_ID`, and nothing documents (or has been measured to
|
|
24
|
+
* show) that a spawned subagent gets a thread id of its own rather than inheriting the coordinator's.
|
|
25
|
+
* The hook payload DOES carry the answer, in both harnesses, on the same key: `agent_id` is empty for the
|
|
26
|
+
* main loop and populated for a subagent. So the hook — which sees every Bash call before it runs — writes
|
|
27
|
+
* that identity here for each checklist the command names, and the bin consumes it.
|
|
28
|
+
*
|
|
29
|
+
* NOT tamper-proof, and not claimed to be: an agent can write this file by hand. It moves forging a verdict
|
|
30
|
+
* from "write one JSON file" (what a coordinator did on two merged PRs) to a deliberate, auditable forgery of
|
|
31
|
+
* tooling state outside the AI-writable dir — the same bar SubagentProvenanceService sets.
|
|
32
|
+
*/
|
|
33
|
+
export declare class ReviewIdentityStamp {
|
|
34
|
+
checklistId: string;
|
|
35
|
+
aiType: string;
|
|
36
|
+
sessionId: string;
|
|
37
|
+
agentId: string;
|
|
38
|
+
agentType: string;
|
|
39
|
+
cwd: string;
|
|
40
|
+
stampedAt: string;
|
|
41
|
+
constructor(checklistId: string, aiType: string, sessionId: string, agentId: string, agentType: string, cwd: string, stampedAt: string);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Writes (from the PreToolUse hook) and consumes (from `wp-write-review`) {@link ReviewIdentityStamp}s.
|
|
45
|
+
*
|
|
46
|
+
* Both ends resolve the path from their OWN working directory through {@link DotWebpieces.local}, which is
|
|
47
|
+
* keyed by git's answer for that tree — so the hook's payload cwd and the bin's process cwd land on the same
|
|
48
|
+
* file for the same worktree, and two worktrees never share a stamp.
|
|
49
|
+
*
|
|
50
|
+
* `@injectable(bindingScopeValues.Singleton)` so it is injected by type; {@link reviewIdentityStamps} is the
|
|
51
|
+
* instance the dependency-free hook adapter uses.
|
|
52
|
+
*/
|
|
53
|
+
export declare class ReviewIdentityStampService {
|
|
54
|
+
private readonly dotDir;
|
|
55
|
+
private readonly atomicFile;
|
|
56
|
+
constructor(dotDir?: DotWebpieces, atomicFile?: AtomicFile);
|
|
57
|
+
/**
|
|
58
|
+
* The checklist ids a Bash command submits verdicts for, or [] when it does not invoke the bin at all.
|
|
59
|
+
* Every `--checklist <id>` / `--checklist=<id>` is returned, because one reviewer covering several
|
|
60
|
+
* checklists may chain several submissions into one command.
|
|
61
|
+
*/
|
|
62
|
+
invokedChecklists(command: string): string[];
|
|
63
|
+
/**
|
|
64
|
+
* True when the stamp names the COORDINATING agent rather than a subagent: no agent id, or an agent id
|
|
65
|
+
* equal to the session id (a harness that fills the main loop's agent id with the session id instead of
|
|
66
|
+
* leaving it empty). The coordinator may never submit a reviewer's verdict — that is the whole point.
|
|
67
|
+
*/
|
|
68
|
+
isCoordinator(stamp: ReviewIdentityStamp): boolean;
|
|
69
|
+
stampPath(startDir: string, checklistId: string): string;
|
|
70
|
+
/** Best-effort: a stamp that cannot be written makes the bin refuse, which is the safe direction. */
|
|
71
|
+
write(startDir: string, stamp: ReviewIdentityStamp): void;
|
|
72
|
+
/**
|
|
73
|
+
* Read AND delete the stamp for one checklist. null when there is none, it is unreadable, or it is
|
|
74
|
+
* older than {@link REVIEW_STAMP_MAX_AGE_MS}. Deleted on read so one hook call vouches for one
|
|
75
|
+
* submission; a delete that fails (a sandbox that denies it) is harmless, because age bounds it anyway.
|
|
76
|
+
*/
|
|
77
|
+
take(startDir: string, checklistId: string, nowMs?: number): ReviewIdentityStamp | null;
|
|
78
|
+
private read;
|
|
79
|
+
private remove;
|
|
80
|
+
}
|
|
81
|
+
/** The instance the hook adapter uses — it runs without a DI container (see hook-core.ts). */
|
|
82
|
+
export declare const reviewIdentityStamps: ReviewIdentityStampService;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.reviewIdentityStamps = exports.ReviewIdentityStampService = exports.ReviewIdentityStamp = exports.REVIEW_STAMP_MAX_AGE_MS = exports.REVIEW_STAMP_DIR = exports.WRITE_REVIEW_CHECKLIST_FLAG = exports.WRITE_REVIEW_BIN = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const fs = tslib_1.__importStar(require("fs"));
|
|
6
|
+
const inversify_1 = require("inversify");
|
|
7
|
+
const atomic_file_1 = require("./atomic-file");
|
|
8
|
+
const state_dir_1 = require("./state-dir");
|
|
9
|
+
const to_error_1 = require("./to-error");
|
|
10
|
+
/** The ONE sanctioned way a reviewer submits a checklist verdict (issue #863). */
|
|
11
|
+
exports.WRITE_REVIEW_BIN = 'wp-write-review';
|
|
12
|
+
/** The flag that names the checklist a `wp-write-review` call submits for. */
|
|
13
|
+
exports.WRITE_REVIEW_CHECKLIST_FLAG = '--checklist';
|
|
14
|
+
/** Where the stamps live, beneath this worktree's tooling-owned state dir (never the AI-writable one). */
|
|
15
|
+
exports.REVIEW_STAMP_DIR = 'review-stamps';
|
|
16
|
+
/**
|
|
17
|
+
* How long a stamp stays usable. The hook writes it a few milliseconds before the harness starts the very
|
|
18
|
+
* Bash command it stamped, so anything older than this is left over from a call that never reached the bin
|
|
19
|
+
* — and must not be available to lend its identity to a later caller.
|
|
20
|
+
*/
|
|
21
|
+
exports.REVIEW_STAMP_MAX_AGE_MS = 120_000;
|
|
22
|
+
/**
|
|
23
|
+
* WHO is running a `pnpm wp-write-review` Bash call, as the HARNESS reported it to the PreToolUse hook.
|
|
24
|
+
* Data-only (per CLAUDE.md), and its field names are the JSON keys on disk.
|
|
25
|
+
*
|
|
26
|
+
* WHY a hook stamp and not the environment (issue #863). A Bash-invoked bin sees only its env, and the env
|
|
27
|
+
* cannot answer "is this a subagent?" in either harness:
|
|
28
|
+
* - Claude Code exports `CLAUDE_CODE_SESSION_ID`, which is the PARENT session's id in a subagent too, and
|
|
29
|
+
* no agent id at all — a reviewer and its coordinator have byte-identical identity env.
|
|
30
|
+
* - Codex exports `CODEX_SESSION_ID` / `CODEX_THREAD_ID`, and nothing documents (or has been measured to
|
|
31
|
+
* show) that a spawned subagent gets a thread id of its own rather than inheriting the coordinator's.
|
|
32
|
+
* The hook payload DOES carry the answer, in both harnesses, on the same key: `agent_id` is empty for the
|
|
33
|
+
* main loop and populated for a subagent. So the hook — which sees every Bash call before it runs — writes
|
|
34
|
+
* that identity here for each checklist the command names, and the bin consumes it.
|
|
35
|
+
*
|
|
36
|
+
* NOT tamper-proof, and not claimed to be: an agent can write this file by hand. It moves forging a verdict
|
|
37
|
+
* from "write one JSON file" (what a coordinator did on two merged PRs) to a deliberate, auditable forgery of
|
|
38
|
+
* tooling state outside the AI-writable dir — the same bar SubagentProvenanceService sets.
|
|
39
|
+
*/
|
|
40
|
+
class ReviewIdentityStamp {
|
|
41
|
+
checklistId;
|
|
42
|
+
aiType; // 'claude-code' | 'codex' — the adapter's answer, never the model's
|
|
43
|
+
sessionId;
|
|
44
|
+
agentId; // '' ⇒ the MAIN loop, i.e. the coordinating agent
|
|
45
|
+
agentType;
|
|
46
|
+
cwd;
|
|
47
|
+
stampedAt; // ISO
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
49
|
+
constructor(checklistId, aiType, sessionId, agentId, agentType, cwd, stampedAt) {
|
|
50
|
+
this.checklistId = checklistId;
|
|
51
|
+
this.aiType = aiType;
|
|
52
|
+
this.sessionId = sessionId;
|
|
53
|
+
this.agentId = agentId;
|
|
54
|
+
this.agentType = agentType;
|
|
55
|
+
this.cwd = cwd;
|
|
56
|
+
this.stampedAt = stampedAt;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.ReviewIdentityStamp = ReviewIdentityStamp;
|
|
60
|
+
/**
|
|
61
|
+
* Writes (from the PreToolUse hook) and consumes (from `wp-write-review`) {@link ReviewIdentityStamp}s.
|
|
62
|
+
*
|
|
63
|
+
* Both ends resolve the path from their OWN working directory through {@link DotWebpieces.local}, which is
|
|
64
|
+
* keyed by git's answer for that tree — so the hook's payload cwd and the bin's process cwd land on the same
|
|
65
|
+
* file for the same worktree, and two worktrees never share a stamp.
|
|
66
|
+
*
|
|
67
|
+
* `@injectable(bindingScopeValues.Singleton)` so it is injected by type; {@link reviewIdentityStamps} is the
|
|
68
|
+
* instance the dependency-free hook adapter uses.
|
|
69
|
+
*/
|
|
70
|
+
let ReviewIdentityStampService = class ReviewIdentityStampService {
|
|
71
|
+
dotDir;
|
|
72
|
+
atomicFile;
|
|
73
|
+
constructor(dotDir = state_dir_1.dotWebpieces, atomicFile = new atomic_file_1.AtomicFile()) {
|
|
74
|
+
this.dotDir = dotDir;
|
|
75
|
+
this.atomicFile = atomicFile;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The checklist ids a Bash command submits verdicts for, or [] when it does not invoke the bin at all.
|
|
79
|
+
* Every `--checklist <id>` / `--checklist=<id>` is returned, because one reviewer covering several
|
|
80
|
+
* checklists may chain several submissions into one command.
|
|
81
|
+
*/
|
|
82
|
+
invokedChecklists(command) {
|
|
83
|
+
if (!new RegExp(`\\b${exports.WRITE_REVIEW_BIN}\\b`).test(command))
|
|
84
|
+
return [];
|
|
85
|
+
const ids = [];
|
|
86
|
+
const flag = /--checklist(?:=|\s+)(["']?)([A-Za-z0-9._-]+)\1/g;
|
|
87
|
+
let match = flag.exec(command);
|
|
88
|
+
while (match !== null) {
|
|
89
|
+
if (!ids.includes(match[2]))
|
|
90
|
+
ids.push(match[2]);
|
|
91
|
+
match = flag.exec(command);
|
|
92
|
+
}
|
|
93
|
+
return ids;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* True when the stamp names the COORDINATING agent rather than a subagent: no agent id, or an agent id
|
|
97
|
+
* equal to the session id (a harness that fills the main loop's agent id with the session id instead of
|
|
98
|
+
* leaving it empty). The coordinator may never submit a reviewer's verdict — that is the whole point.
|
|
99
|
+
*/
|
|
100
|
+
isCoordinator(stamp) {
|
|
101
|
+
return stamp.agentId.trim() === '' || stamp.agentId === stamp.sessionId;
|
|
102
|
+
}
|
|
103
|
+
stampPath(startDir, checklistId) {
|
|
104
|
+
return this.dotDir.localFile(startDir, exports.REVIEW_STAMP_DIR, `${checklistId.replace(/[^A-Za-z0-9._-]/g, '_')}.json`);
|
|
105
|
+
}
|
|
106
|
+
/** Best-effort: a stamp that cannot be written makes the bin refuse, which is the safe direction. */
|
|
107
|
+
write(startDir, stamp) {
|
|
108
|
+
// webpieces-disable no-unmanaged-exceptions -- chokepoint: the hook must never fail a tool call over its own bookkeeping
|
|
109
|
+
// eslint-disable-next-line @webpieces/no-unmanaged-exceptions
|
|
110
|
+
try {
|
|
111
|
+
this.atomicFile.writeJsonAtomic(this.stampPath(startDir, stamp.checklistId), stamp);
|
|
112
|
+
}
|
|
113
|
+
catch (err) {
|
|
114
|
+
const error = (0, to_error_1.toError)(err);
|
|
115
|
+
void error;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Read AND delete the stamp for one checklist. null when there is none, it is unreadable, or it is
|
|
120
|
+
* older than {@link REVIEW_STAMP_MAX_AGE_MS}. Deleted on read so one hook call vouches for one
|
|
121
|
+
* submission; a delete that fails (a sandbox that denies it) is harmless, because age bounds it anyway.
|
|
122
|
+
*/
|
|
123
|
+
take(startDir, checklistId, nowMs = Date.now()) {
|
|
124
|
+
const file = this.stampPath(startDir, checklistId);
|
|
125
|
+
const stamp = this.read(file);
|
|
126
|
+
this.remove(file);
|
|
127
|
+
if (stamp === null || stamp.checklistId !== checklistId)
|
|
128
|
+
return null;
|
|
129
|
+
const age = nowMs - Date.parse(stamp.stampedAt);
|
|
130
|
+
if (!Number.isFinite(age) || age < 0 || age > exports.REVIEW_STAMP_MAX_AGE_MS)
|
|
131
|
+
return null;
|
|
132
|
+
return stamp;
|
|
133
|
+
}
|
|
134
|
+
read(file) {
|
|
135
|
+
if (!fs.existsSync(file))
|
|
136
|
+
return null;
|
|
137
|
+
// webpieces-disable no-unmanaged-exceptions -- chokepoint: an unreadable stamp is no stamp
|
|
138
|
+
// eslint-disable-next-line @webpieces/no-unmanaged-exceptions
|
|
139
|
+
try {
|
|
140
|
+
// webpieces-disable no-any-unknown -- opaque parsed JSON, narrowed field-by-field below
|
|
141
|
+
const raw = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
142
|
+
// webpieces-disable no-any-unknown -- one opaque JSON value, narrowed to a string
|
|
143
|
+
const str = (v) => (typeof v === 'string' ? v : '');
|
|
144
|
+
return new ReviewIdentityStamp(str(raw['checklistId']), str(raw['aiType']), str(raw['sessionId']), str(raw['agentId']), str(raw['agentType']), str(raw['cwd']), str(raw['stampedAt']));
|
|
145
|
+
}
|
|
146
|
+
catch (err) {
|
|
147
|
+
const error = (0, to_error_1.toError)(err);
|
|
148
|
+
void error;
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
remove(file) {
|
|
153
|
+
// webpieces-disable no-unmanaged-exceptions -- chokepoint: a stamp that cannot be deleted still expires
|
|
154
|
+
// eslint-disable-next-line @webpieces/no-unmanaged-exceptions
|
|
155
|
+
try {
|
|
156
|
+
fs.rmSync(file, { force: true });
|
|
157
|
+
}
|
|
158
|
+
catch (err) {
|
|
159
|
+
const error = (0, to_error_1.toError)(err);
|
|
160
|
+
void error;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
exports.ReviewIdentityStampService = ReviewIdentityStampService;
|
|
165
|
+
exports.ReviewIdentityStampService = ReviewIdentityStampService = tslib_1.__decorate([
|
|
166
|
+
(0, inversify_1.injectable)(inversify_1.bindingScopeValues.Singleton),
|
|
167
|
+
tslib_1.__metadata("design:paramtypes", [state_dir_1.DotWebpieces,
|
|
168
|
+
atomic_file_1.AtomicFile])
|
|
169
|
+
], ReviewIdentityStampService);
|
|
170
|
+
/** The instance the hook adapter uses — it runs without a DI container (see hook-core.ts). */
|
|
171
|
+
exports.reviewIdentityStamps = new ReviewIdentityStampService();
|
|
172
|
+
//# sourceMappingURL=review-identity-stamp.js.map
|