@webpieces/rules-config 0.4.483 → 0.4.484
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/checklist-config.d.ts +4 -22
- package/src/checklist-config.js +23 -64
- package/src/checklist-config.js.map +1 -1
- package/src/checklist-docs-validator.d.ts +6 -5
- package/src/checklist-docs-validator.js +6 -5
- package/src/checklist-docs-validator.js.map +1 -1
- package/src/checklist-validator.d.ts +25 -0
- package/src/checklist-validator.js +78 -0
- package/src/checklist-validator.js.map +1 -0
- package/src/index.d.ts +2 -2
- package/src/index.js +6 -7
- package/src/index.js.map +1 -1
- package/src/pr-gate-config.d.ts +3 -3
- package/src/pr-gate-config.js +11 -21
- package/src/pr-gate-config.js.map +1 -1
- package/src/pr-gate-section-validators.d.ts +11 -8
- package/src/pr-gate-section-validators.js +48 -26
- package/src/pr-gate-section-validators.js.map +1 -1
- package/src/review-json.js +2 -2
- package/src/review-json.js.map +1 -1
- package/src/validate-config.js +2 -2
- package/src/validate-config.js.map +1 -1
- package/templates/webpieces.review-checklists.md +8 -7
- package/src/checklist-manifest.d.ts +0 -36
- package/src/checklist-manifest.js +0 -180
- package/src/checklist-manifest.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webpieces/rules-config",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.484",
|
|
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",
|
|
@@ -5,18 +5,6 @@ export declare class ChecklistDefinition {
|
|
|
5
5
|
patterns: string[];
|
|
6
6
|
constructor(id: string, subagent: string, doc: string, patterns: string[]);
|
|
7
7
|
}
|
|
8
|
-
/**
|
|
9
|
-
* WHERE a repo's checklists come from. Exactly one of the two is populated (an array in
|
|
10
|
-
* webpieces.config.json wins when both are present, and validation says so), and both are empty for the
|
|
11
|
-
* common case of a repo with no checklists at all. Data-only.
|
|
12
|
-
*/
|
|
13
|
-
export declare class ChecklistSource {
|
|
14
|
-
inline: ChecklistDefinition[];
|
|
15
|
-
doc: string;
|
|
16
|
-
constructor(inline?: ChecklistDefinition[], doc?: string);
|
|
17
|
-
isEmpty(): boolean;
|
|
18
|
-
describe(): string;
|
|
19
|
-
}
|
|
20
8
|
export interface RawChecklistItem {
|
|
21
9
|
subagent?: string;
|
|
22
10
|
doc?: string;
|
|
@@ -24,11 +12,11 @@ export interface RawChecklistItem {
|
|
|
24
12
|
}
|
|
25
13
|
/**
|
|
26
14
|
* Build a ChecklistDefinition from an omitting-friendly raw entry. `id` defaults to the subagent name (the
|
|
27
|
-
* only stable, human-meaningful key we have).
|
|
28
|
-
* `raw.doc` resolves against: '' for the array-in-config form (repo root), `dirname(manifestDoc)` for the
|
|
29
|
-
* legacy manifest form. The stored `doc` is always repo-relative — see ChecklistDefinition.doc.
|
|
15
|
+
* only stable, human-meaningful key we have).
|
|
30
16
|
*/
|
|
31
|
-
export declare function toChecklist(raw: RawChecklistItem
|
|
17
|
+
export declare function toChecklist(raw: RawChecklistItem): ChecklistDefinition;
|
|
18
|
+
/** Normalize a checklist entry's repo-relative `doc` to a POSIX path, so every printed path matches. */
|
|
19
|
+
export declare function normalizeChecklistDoc(doc: string): string;
|
|
32
20
|
export declare const MATCHED_FILES_CAP = 6;
|
|
33
21
|
/**
|
|
34
22
|
* Render a file list for a message, NEVER silently. A truncated list that looks complete is how a reviewer
|
|
@@ -36,9 +24,3 @@ export declare const MATCHED_FILES_CAP = 6;
|
|
|
36
24
|
* dropped count is always stated and the caller is expected to name the file holding the full set.
|
|
37
25
|
*/
|
|
38
26
|
export declare function formatFileList(files: readonly string[], cap?: number): string;
|
|
39
|
-
/**
|
|
40
|
-
* Resolve a checklist entry's `doc` to a repo-relative POSIX path. This is the fix for a reviewer subagent
|
|
41
|
-
* being handed a bare `deploy-infra.md` that exists nowhere relative to its CWD: the resolution against the
|
|
42
|
-
* manifest doc's directory happens ONCE, here, instead of being re-derived (or forgotten) at each print site.
|
|
43
|
-
*/
|
|
44
|
-
export declare function resolveChecklistDoc(doc: string, docBaseRel: string): string;
|
package/src/checklist-config.js
CHANGED
|
@@ -1,32 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MATCHED_FILES_CAP = exports.
|
|
3
|
+
exports.MATCHED_FILES_CAP = exports.ChecklistDefinition = void 0;
|
|
4
4
|
exports.toChecklist = toChecklist;
|
|
5
|
+
exports.normalizeChecklistDoc = normalizeChecklistDoc;
|
|
5
6
|
exports.formatFileList = formatFileList;
|
|
6
|
-
exports.resolveChecklistDoc = resolveChecklistDoc;
|
|
7
7
|
const tslib_1 = require("tslib");
|
|
8
8
|
const path = tslib_1.__importStar(require("path"));
|
|
9
9
|
// A company review checklist: a diff-triggered extension point that lets a CONSUMER inject its own
|
|
10
10
|
// PR-time review process into the webpieces gated flow WITHOUT forking the tooling. Each checklist names
|
|
11
11
|
// a reviewer SUBAGENT (a `.claude/agents/<subagent>.md`) and the doc that reviewer reads; when the diff
|
|
12
|
-
// matches the checklist's `patterns`, wp-
|
|
13
|
-
//
|
|
14
|
-
//
|
|
12
|
+
// matches the checklist's `patterns`, wp-checklist tells the AI to spawn that subagent to review it, and
|
|
13
|
+
// wp-finish-upsert-pr refuses to open the PR until a well-formed, passing review-<id>.json exists AND that
|
|
14
|
+
// named subagent is proven (from the harness's own artifacts) to have actually run.
|
|
15
15
|
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
// where every tool that reads webpieces.config.json can see, grep, and schema them.
|
|
20
|
-
// LEGACY — `checklists: { "doc": "..." }`, where the array lives in an HTML comment inside that doc.
|
|
21
|
-
// Still loaded (it is shipped and consumers depend on it), but no longer the recommended form.
|
|
16
|
+
// Checklists are configured as an ARRAY in `pr-gate.checklists` in webpieces.config.json — the ONLY
|
|
17
|
+
// accepted shape. `patterns` is a path-glob dispatch table and `subagent` is a name binding: both are
|
|
18
|
+
// config, so they live where every tool that reads webpieces.config.json can see, grep and schema them.
|
|
22
19
|
// Data-only.
|
|
23
20
|
class ChecklistDefinition {
|
|
24
21
|
id; // = the subagent name; keys review-<id>.json and the dashboard row
|
|
25
22
|
subagent; // reviewer agent name → .claude/agents/<subagent>.md; the agentType the harness stamps
|
|
26
|
-
// REPO-RELATIVE guidance doc the reviewer reads (may be '' — then it reads the
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
// directory is unresolvable from where that subagent stands.
|
|
23
|
+
// REPO-RELATIVE guidance doc the reviewer reads (may be '' — then it just reads the diff). Repo-relative
|
|
24
|
+
// because this value is printed verbatim to a reviewer subagent as "the file to open", and a path
|
|
25
|
+
// relative to anything else is unresolvable from where that subagent stands.
|
|
30
26
|
doc;
|
|
31
27
|
patterns; // path globs (isPathExcluded semantics); [] = matches any changed file (always runs)
|
|
32
28
|
constructor(id, subagent, doc, patterns) {
|
|
@@ -37,47 +33,24 @@ class ChecklistDefinition {
|
|
|
37
33
|
}
|
|
38
34
|
}
|
|
39
35
|
exports.ChecklistDefinition = ChecklistDefinition;
|
|
40
|
-
/**
|
|
41
|
-
* WHERE a repo's checklists come from. Exactly one of the two is populated (an array in
|
|
42
|
-
* webpieces.config.json wins when both are present, and validation says so), and both are empty for the
|
|
43
|
-
* common case of a repo with no checklists at all. Data-only.
|
|
44
|
-
*/
|
|
45
|
-
class ChecklistSource {
|
|
46
|
-
// The array form straight from `pr-gate.checklists` in webpieces.config.json (PRIMARY). Already
|
|
47
|
-
// narrowed + repo-relative-resolved. [] when the repo uses the legacy `{ doc }` form or has none.
|
|
48
|
-
inline;
|
|
49
|
-
// Repo-relative path of the ONE doc carrying a `<!-- webpieces:checklists [...] -->` manifest (LEGACY).
|
|
50
|
-
// '' when the repo uses the array form or has no checklists.
|
|
51
|
-
doc;
|
|
52
|
-
constructor(inline = [], doc = '') {
|
|
53
|
-
this.inline = inline;
|
|
54
|
-
this.doc = doc;
|
|
55
|
-
}
|
|
56
|
-
// True when this repo configured no checklists at all (neither shape).
|
|
57
|
-
isEmpty() {
|
|
58
|
-
return this.inline.length === 0 && this.doc.trim() === '';
|
|
59
|
-
}
|
|
60
|
-
// How to NAME this source in a message: the config key for the array form, the doc path for the
|
|
61
|
-
// manifest form. Every checklist error/notice cites one of these so a reader knows what file to open.
|
|
62
|
-
describe() {
|
|
63
|
-
if (this.doc.trim() !== '')
|
|
64
|
-
return this.doc;
|
|
65
|
-
return 'pr-gate.checklists in webpieces.config.json';
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
exports.ChecklistSource = ChecklistSource;
|
|
69
36
|
/**
|
|
70
37
|
* Build a ChecklistDefinition from an omitting-friendly raw entry. `id` defaults to the subagent name (the
|
|
71
|
-
* only stable, human-meaningful key we have).
|
|
72
|
-
* `raw.doc` resolves against: '' for the array-in-config form (repo root), `dirname(manifestDoc)` for the
|
|
73
|
-
* legacy manifest form. The stored `doc` is always repo-relative — see ChecklistDefinition.doc.
|
|
38
|
+
* only stable, human-meaningful key we have).
|
|
74
39
|
*/
|
|
75
40
|
// webpieces-disable no-function-outside-class -- pure config transform beside its data class
|
|
76
|
-
function toChecklist(raw
|
|
41
|
+
function toChecklist(raw) {
|
|
77
42
|
const subagent = raw.subagent ?? '';
|
|
78
|
-
return new ChecklistDefinition(subagent, subagent,
|
|
43
|
+
return new ChecklistDefinition(subagent, subagent, normalizeChecklistDoc(raw.doc ?? ''), raw.patterns ?? []);
|
|
44
|
+
}
|
|
45
|
+
/** Normalize a checklist entry's repo-relative `doc` to a POSIX path, so every printed path matches. */
|
|
46
|
+
// webpieces-disable no-function-outside-class -- pure path transform beside its data class
|
|
47
|
+
function normalizeChecklistDoc(doc) {
|
|
48
|
+
const trimmed = doc.trim();
|
|
49
|
+
if (trimmed === '')
|
|
50
|
+
return '';
|
|
51
|
+
return path.posix.normalize(trimmed.split(path.sep).join('/'));
|
|
79
52
|
}
|
|
80
|
-
// The ONE cap for every printed matched-file list. Two print sites used to slice to 4 and to 5 — two
|
|
53
|
+
// The ONE cap for every printed matched-file list. Two print sites once used to slice to 4 and to 5 — two
|
|
81
54
|
// different caps for the same list, neither chosen deliberately, and both without an ellipsis.
|
|
82
55
|
exports.MATCHED_FILES_CAP = 6;
|
|
83
56
|
/**
|
|
@@ -93,18 +66,4 @@ function formatFileList(files, cap = exports.MATCHED_FILES_CAP) {
|
|
|
93
66
|
return files.join(', ');
|
|
94
67
|
return `${files.slice(0, cap).join(', ')}, +${files.length - cap} more (${files.length} total)`;
|
|
95
68
|
}
|
|
96
|
-
/**
|
|
97
|
-
* Resolve a checklist entry's `doc` to a repo-relative POSIX path. This is the fix for a reviewer subagent
|
|
98
|
-
* being handed a bare `deploy-infra.md` that exists nowhere relative to its CWD: the resolution against the
|
|
99
|
-
* manifest doc's directory happens ONCE, here, instead of being re-derived (or forgotten) at each print site.
|
|
100
|
-
*/
|
|
101
|
-
// webpieces-disable no-function-outside-class -- pure path transform beside its data class
|
|
102
|
-
function resolveChecklistDoc(doc, docBaseRel) {
|
|
103
|
-
const trimmed = doc.trim();
|
|
104
|
-
if (trimmed === '')
|
|
105
|
-
return '';
|
|
106
|
-
const base = docBaseRel.trim();
|
|
107
|
-
const joined = base === '' || base === '.' ? trimmed : `${base}/${trimmed}`;
|
|
108
|
-
return path.posix.normalize(joined.split(path.sep).join('/'));
|
|
109
|
-
}
|
|
110
69
|
//# sourceMappingURL=checklist-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checklist-config.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/checklist-config.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"checklist-config.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/checklist-config.ts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CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACnE,CAAC;AAED,0GAA0G;AAC1G,+FAA+F;AAClF,QAAA,iBAAiB,GAAG,CAAC,CAAC;AAEnC;;;;GAIG;AACH,mGAAmG;AACnG,SAAgB,cAAc,CAAC,KAAwB,EAAE,MAAc,yBAAiB;IACpF,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IACxC,IAAI,KAAK,CAAC,MAAM,IAAI,GAAG;QAAE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjD,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,MAAM,GAAG,GAAG,UAAU,KAAK,CAAC,MAAM,SAAS,CAAC;AACpG,CAAC","sourcesContent":["import * as path from 'path';\n\n// A company review checklist: a diff-triggered extension point that lets a CONSUMER inject its own\n// PR-time review process into the webpieces gated flow WITHOUT forking the tooling. Each checklist names\n// a reviewer SUBAGENT (a `.claude/agents/<subagent>.md`) and the doc that reviewer reads; when the diff\n// matches the checklist's `patterns`, wp-checklist tells the AI to spawn that subagent to review it, and\n// wp-finish-upsert-pr refuses to open the PR until a well-formed, passing review-<id>.json exists AND that\n// named subagent is proven (from the harness's own artifacts) to have actually run.\n//\n// Checklists are configured as an ARRAY in `pr-gate.checklists` in webpieces.config.json — the ONLY\n// accepted shape. `patterns` is a path-glob dispatch table and `subagent` is a name binding: both are\n// config, so they live where every tool that reads webpieces.config.json can see, grep and schema them.\n// Data-only.\nexport class ChecklistDefinition {\n id: string; // = the subagent name; keys review-<id>.json and the dashboard row\n subagent: string; // reviewer agent name → .claude/agents/<subagent>.md; the agentType the harness stamps\n // REPO-RELATIVE guidance doc the reviewer reads (may be '' — then it just reads the diff). Repo-relative\n // because this value is printed verbatim to a reviewer subagent as \"the file to open\", and a path\n // relative to anything else is unresolvable from where that subagent stands.\n doc: string;\n patterns: string[]; // path globs (isPathExcluded semantics); [] = matches any changed file (always runs)\n\n constructor(id: string, subagent: string, doc: string, patterns: string[]) {\n this.id = id;\n this.subagent = subagent;\n this.doc = doc;\n this.patterns = patterns;\n }\n}\n\n// One config entry straight from JSON, before it is validated + narrowed into a class.\nexport interface RawChecklistItem {\n subagent?: string;\n doc?: string;\n patterns?: string[];\n}\n\n/**\n * Build a ChecklistDefinition from an omitting-friendly raw entry. `id` defaults to the subagent name (the\n * only stable, human-meaningful key we have).\n */\n// webpieces-disable no-function-outside-class -- pure config transform beside its data class\nexport function toChecklist(raw: RawChecklistItem): ChecklistDefinition {\n const subagent = raw.subagent ?? '';\n return new ChecklistDefinition(subagent, subagent, normalizeChecklistDoc(raw.doc ?? ''), raw.patterns ?? []);\n}\n\n/** Normalize a checklist entry's repo-relative `doc` to a POSIX path, so every printed path matches. */\n// webpieces-disable no-function-outside-class -- pure path transform beside its data class\nexport function normalizeChecklistDoc(doc: string): string {\n const trimmed = doc.trim();\n if (trimmed === '') return '';\n return path.posix.normalize(trimmed.split(path.sep).join('/'));\n}\n\n// The ONE cap for every printed matched-file list. Two print sites once used to slice to 4 and to 5 — two\n// different caps for the same list, neither chosen deliberately, and both without an ellipsis.\nexport const MATCHED_FILES_CAP = 6;\n\n/**\n * Render a file list for a message, NEVER silently. A truncated list that looks complete is how a reviewer\n * gets pointed at 4 of 40 changed files and reports success having reviewed a tenth of the diff, so the\n * dropped count is always stated and the caller is expected to name the file holding the full set.\n */\n// webpieces-disable no-function-outside-class -- pure display formatter beside the data it formats\nexport function formatFileList(files: readonly string[], cap: number = MATCHED_FILES_CAP): string {\n if (files.length === 0) return '(none)';\n if (files.length <= cap) return files.join(', ');\n return `${files.slice(0, cap).join(', ')}, +${files.length - cap} more (${files.length} total)`;\n}\n"]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Validate ONLY the pr-gate `checklists`
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* runs, but callable directly so
|
|
6
|
-
* (clear owner) instead of surfacing as an unrelated validator's banner.
|
|
2
|
+
* Validate ONLY the pr-gate `checklists` array, in isolation — that it IS an array (the removed `{ doc }`
|
|
3
|
+
* manifest shape is rejected with its migration steps), each entry's subagent is present, distinct, and
|
|
4
|
+
* names a real `.claude/agents/<subagent>.md`, each entry's repo-relative doc exists, and patterns are
|
|
5
|
+
* string[]. Same logic loadAndValidate runs, but callable directly so broken checklists fail as their OWN
|
|
6
|
+
* `validate-checklist-docs` check (clear owner) instead of surfacing as an unrelated validator's banner.
|
|
7
|
+
* Returns errors; never throws.
|
|
7
8
|
*/
|
|
8
9
|
export declare function validateChecklistDocs(cwd: string): string[];
|
|
@@ -8,11 +8,12 @@ const config_file_1 = require("./config-file");
|
|
|
8
8
|
const validate_config_1 = require("./validate-config");
|
|
9
9
|
const to_error_1 = require("./to-error");
|
|
10
10
|
/**
|
|
11
|
-
* Validate ONLY the pr-gate `checklists`
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* runs, but callable directly so
|
|
15
|
-
* (clear owner) instead of surfacing as an unrelated validator's banner.
|
|
11
|
+
* Validate ONLY the pr-gate `checklists` array, in isolation — that it IS an array (the removed `{ doc }`
|
|
12
|
+
* manifest shape is rejected with its migration steps), each entry's subagent is present, distinct, and
|
|
13
|
+
* names a real `.claude/agents/<subagent>.md`, each entry's repo-relative doc exists, and patterns are
|
|
14
|
+
* string[]. Same logic loadAndValidate runs, but callable directly so broken checklists fail as their OWN
|
|
15
|
+
* `validate-checklist-docs` check (clear owner) instead of surfacing as an unrelated validator's banner.
|
|
16
|
+
* Returns errors; never throws.
|
|
16
17
|
*/
|
|
17
18
|
// webpieces-disable no-function-outside-class -- module-level config validator, matches validate-config.ts
|
|
18
19
|
function validateChecklistDocs(cwd) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checklist-docs-validator.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/checklist-docs-validator.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"checklist-docs-validator.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/checklist-docs-validator.ts"],"names":[],"mappings":";;AAeA,sDAsBC;;AArCD,+CAAyB;AACzB,mDAA6B;AAC7B,+CAA+C;AAC/C,uDAA8D;AAC9D,yCAAqC;AAErC;;;;;;;GAOG;AACH,2GAA2G;AAC3G,SAAgB,qBAAqB,CAAC,GAAW;IAC7C,MAAM,UAAU,GAAG,IAAA,4BAAc,EAAC,GAAG,CAAC,CAAC;IACvC,IAAI,CAAC,UAAU;QAAE,OAAO,EAAE,CAAC;IAC3B,wFAAwF;IACxF,IAAI,GAA4B,CAAC;IACjC,6GAA6G;IAC7G,8DAA8D;IAC9D,IAAI,CAAC;QACD,wFAAwF;QACxF,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAA4B,CAAC;IACrF,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACpB,MAAM,KAAK,GAAG,IAAA,kBAAO,EAAC,GAAG,CAAC,CAAC;QAC3B,OAAO,CAAC,aAAa,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,uBAAuB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAC1F,CAAC;IACD,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC1C,+FAA+F;IAC/F,2EAA2E;IAC3E,MAAM,QAAQ,GAAG,GAAG,CAAC,UAAU,CAAwC,CAAC;IACxE,2EAA2E;IAC3E,MAAM,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,SAAS,CAAC,CAAwC,CAAC;IAChG,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,YAAY,IAAI,MAAM,CAAC;QAAE,OAAO,EAAE,CAAC;IACpD,OAAO,IAAA,2CAAyB,EAAC,MAAM,CAAC,YAAY,CAAC,EAAE,QAAQ,CAAC,CAAC;AACrE,CAAC","sourcesContent":["import * as fs from 'fs';\nimport * as path from 'path';\nimport { findConfigFile } from './config-file';\nimport { validateChecklistsSection } from './validate-config';\nimport { toError } from './to-error';\n\n/**\n * Validate ONLY the pr-gate `checklists` array, in isolation — that it IS an array (the removed `{ doc }`\n * manifest shape is rejected with its migration steps), each entry's subagent is present, distinct, and\n * names a real `.claude/agents/<subagent>.md`, each entry's repo-relative doc exists, and patterns are\n * string[]. Same logic loadAndValidate runs, but callable directly so broken checklists fail as their OWN\n * `validate-checklist-docs` check (clear owner) instead of surfacing as an unrelated validator's banner.\n * Returns errors; never throws.\n */\n// webpieces-disable no-function-outside-class -- module-level config validator, matches validate-config.ts\nexport function validateChecklistDocs(cwd: string): string[] {\n const configPath = findConfigFile(cwd);\n if (!configPath) return [];\n // webpieces-disable no-any-unknown -- parsed config JSON is opaque until narrowed below\n let raw: Record<string, unknown>;\n // webpieces-disable no-unmanaged-exceptions -- chokepoint: a malformed config surfaces as one readable error\n // eslint-disable-next-line @webpieces/no-unmanaged-exceptions\n try {\n // webpieces-disable no-any-unknown -- parsed config JSON is opaque until narrowed below\n raw = JSON.parse(fs.readFileSync(configPath, 'utf8')) as Record<string, unknown>;\n } catch (err: unknown) {\n const error = toError(err);\n return [`[pr-gate] ${path.basename(configPath)} is not valid JSON: ${error.message}`];\n }\n const repoRoot = path.dirname(configPath);\n // The pr-gate section lives under commands[\"pr-gate\"] (current) or a legacy top-level pr-gate.\n // webpieces-disable no-any-unknown -- narrowing the opaque command section\n const commands = raw['commands'] as Record<string, unknown> | undefined;\n // webpieces-disable no-any-unknown -- narrowing the opaque pr-gate section\n const prGate = (commands?.['pr-gate'] ?? raw['pr-gate']) as Record<string, unknown> | undefined;\n if (!prGate || !('checklists' in prGate)) return [];\n return validateChecklistsSection(prGate['checklists'], repoRoot);\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ChecklistDefinition } from './checklist-config';
|
|
2
|
+
/**
|
|
3
|
+
* Validates the review checklists declared in `pr-gate.checklists`. The array in webpieces.config.json is
|
|
4
|
+
* the ONLY accepted shape: there is deliberately no fallback, no second location, and no back-compat path
|
|
5
|
+
* for the `{ doc }` + `<!-- webpieces:checklists -->` HTML-comment manifest this replaced. A consumer on the
|
|
6
|
+
* old shape gets a hard config error naming the exact edit — which an AI applies in one pass — and that is
|
|
7
|
+
* strictly better than carrying two code paths forever so that nobody has to read an error message.
|
|
8
|
+
*
|
|
9
|
+
* `@injectable(bindingScopeValues.Singleton)` so it is injected by type + drawn in the DI design.
|
|
10
|
+
*/
|
|
11
|
+
export declare class ChecklistValidator {
|
|
12
|
+
/**
|
|
13
|
+
* Human-readable errors for the configured checklists, or [] when they are valid. Never throws.
|
|
14
|
+
* `defs` are already narrowed by buildPrGateConfig; this checks what only the filesystem can answer.
|
|
15
|
+
*/
|
|
16
|
+
validate(repoRoot: string, defs: readonly ChecklistDefinition[]): string[];
|
|
17
|
+
private validateSubagent;
|
|
18
|
+
/**
|
|
19
|
+
* The check this validator once lacked: nothing confirmed `subagent` named a real agent. A typo used to
|
|
20
|
+
* validate clean, then get printed to the coding agent as "spawn this" — and since wp-finish blocks on
|
|
21
|
+
* `review-<that-typo>.json`, the path of least resistance became writing the reviewer's verdict itself,
|
|
22
|
+
* which is the exact self-certification the distinct-subagent rule exists to prevent. Reject at load.
|
|
23
|
+
*/
|
|
24
|
+
private validateSubagentExists;
|
|
25
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChecklistValidator = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const fs = tslib_1.__importStar(require("fs"));
|
|
6
|
+
const path = tslib_1.__importStar(require("path"));
|
|
7
|
+
const inversify_1 = require("inversify");
|
|
8
|
+
// Where a reviewer subagent's definition must live for Claude Code to be able to spawn it.
|
|
9
|
+
const AGENTS_DIR = path.join('.claude', 'agents');
|
|
10
|
+
// Every checklist error names this, so a reader always knows which file and key to open. There is exactly
|
|
11
|
+
// ONE place checklists can be configured, so there is exactly one label.
|
|
12
|
+
const SOURCE = 'pr-gate.checklists in webpieces.config.json';
|
|
13
|
+
/**
|
|
14
|
+
* Validates the review checklists declared in `pr-gate.checklists`. The array in webpieces.config.json is
|
|
15
|
+
* the ONLY accepted shape: there is deliberately no fallback, no second location, and no back-compat path
|
|
16
|
+
* for the `{ doc }` + `<!-- webpieces:checklists -->` HTML-comment manifest this replaced. A consumer on the
|
|
17
|
+
* old shape gets a hard config error naming the exact edit — which an AI applies in one pass — and that is
|
|
18
|
+
* strictly better than carrying two code paths forever so that nobody has to read an error message.
|
|
19
|
+
*
|
|
20
|
+
* `@injectable(bindingScopeValues.Singleton)` so it is injected by type + drawn in the DI design.
|
|
21
|
+
*/
|
|
22
|
+
let ChecklistValidator = class ChecklistValidator {
|
|
23
|
+
/**
|
|
24
|
+
* Human-readable errors for the configured checklists, or [] when they are valid. Never throws.
|
|
25
|
+
* `defs` are already narrowed by buildPrGateConfig; this checks what only the filesystem can answer.
|
|
26
|
+
*/
|
|
27
|
+
validate(repoRoot, defs) {
|
|
28
|
+
const errors = [];
|
|
29
|
+
const seen = new Set();
|
|
30
|
+
// Only enforce the reviewer-agent file when this repo HAS an agents dir — a non-Claude-Code consumer
|
|
31
|
+
// that drives the gate some other way must not be broken by a check for a directory it never has.
|
|
32
|
+
const agentsDir = path.join(repoRoot, AGENTS_DIR);
|
|
33
|
+
const checkAgents = fs.existsSync(agentsDir);
|
|
34
|
+
defs.forEach((def, i) => {
|
|
35
|
+
const label = def.subagent !== '' ? `"${def.subagent}"` : `checklists[${i}]`;
|
|
36
|
+
errors.push(...this.validateSubagent(def, i, seen, checkAgents, agentsDir));
|
|
37
|
+
if (def.doc !== '' && !fs.existsSync(path.join(repoRoot, def.doc))) {
|
|
38
|
+
errors.push(`[pr-gate] ${SOURCE} ${label}.doc "${def.doc}" does not exist (paths are REPO-relative).`);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return errors;
|
|
42
|
+
}
|
|
43
|
+
// `subagent` is the ONE required field and the whole distinct-reviewer guarantee rests on it.
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
45
|
+
validateSubagent(def, i, seen, checkAgents, agentsDir) {
|
|
46
|
+
const label = def.subagent !== '' ? `"${def.subagent}"` : `checklists[${i}]`;
|
|
47
|
+
if (def.subagent.trim() === '') {
|
|
48
|
+
return [`[pr-gate] ${SOURCE} checklists[${i}].subagent must be a non-empty string (the reviewer agent name, matching ${AGENTS_DIR}/<subagent>.md).`];
|
|
49
|
+
}
|
|
50
|
+
if (seen.has(def.subagent)) {
|
|
51
|
+
return [`[pr-gate] ${SOURCE} duplicate subagent "${def.subagent}" — each checklist must use a DISTINCT reviewer subagent (that is how independent review is enforced).`];
|
|
52
|
+
}
|
|
53
|
+
seen.add(def.subagent);
|
|
54
|
+
return this.validateSubagentExists(def.subagent, label, checkAgents, agentsDir);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The check this validator once lacked: nothing confirmed `subagent` named a real agent. A typo used to
|
|
58
|
+
* validate clean, then get printed to the coding agent as "spawn this" — and since wp-finish blocks on
|
|
59
|
+
* `review-<that-typo>.json`, the path of least resistance became writing the reviewer's verdict itself,
|
|
60
|
+
* which is the exact self-certification the distinct-subagent rule exists to prevent. Reject at load.
|
|
61
|
+
*/
|
|
62
|
+
validateSubagentExists(subagent, label, checkAgents, agentsDir) {
|
|
63
|
+
if (!checkAgents)
|
|
64
|
+
return [];
|
|
65
|
+
if (fs.existsSync(path.join(agentsDir, `${subagent}.md`)))
|
|
66
|
+
return [];
|
|
67
|
+
return [
|
|
68
|
+
`[pr-gate] ${SOURCE} ${label}.subagent names no reviewer — ${AGENTS_DIR}/${subagent}.md does not exist, ` +
|
|
69
|
+
`so nothing can spawn it and wp-finish-upsert-pr would block forever on a review-${subagent}.json that no reviewer can write. ` +
|
|
70
|
+
`Create that agent file or fix the name.`,
|
|
71
|
+
];
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
exports.ChecklistValidator = ChecklistValidator;
|
|
75
|
+
exports.ChecklistValidator = ChecklistValidator = tslib_1.__decorate([
|
|
76
|
+
(0, inversify_1.injectable)(inversify_1.bindingScopeValues.Singleton)
|
|
77
|
+
], ChecklistValidator);
|
|
78
|
+
//# sourceMappingURL=checklist-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checklist-validator.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/checklist-validator.ts"],"names":[],"mappings":";;;;AAAA,+CAAyB;AACzB,mDAA6B;AAC7B,yCAA2D;AAG3D,2FAA2F;AAC3F,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAElD,0GAA0G;AAC1G,yEAAyE;AACzE,MAAM,MAAM,GAAG,6CAA6C,CAAC;AAE7D;;;;;;;;GAQG;AAEI,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC3B;;;OAGG;IACH,QAAQ,CAAC,QAAgB,EAAE,IAAoC;QAC3D,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;QAC/B,qGAAqG;QACrG,kGAAkG;QAClG,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QAClD,MAAM,WAAW,GAAG,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;QAC7C,IAAI,CAAC,OAAO,CAAC,CAAC,GAAwB,EAAE,CAAS,EAAQ,EAAE;YACvD,MAAM,KAAK,GAAG,GAAG,CAAC,QAAQ,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,QAAQ,GAAG,CAAC,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E,SAAS,CAAC,CAAC;IACpF,CAAC;IAED;;;;;OAKG;IACK,sBAAsB,CAAC,QAAgB,EAAE,KAAa,EAAE,WAAoB,EAAE,SAAiB;QACnG,IAAI,CAAC,WAAW;YAAE,OAAO,EAAE,CAAC;QAC5B,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,QAAQ,KAAK,CAAC,CAAC;YAAE,OAAO,EAAE,CAAC;QACrE,OAAO;YACH,aAAa,MAAM,IAAI,KAAK,iCAAiC,UAAU,IAAI,QAAQ,sBAAsB;gBACzG,mFAAmF,QAAQ,oCAAoC;gBAC/H,yCAAyC;SAC5C,CAAC;IACN,CAAC;CACJ,CAAA;AAnDY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,sBAAU,EAAC,8BAAkB,CAAC,SAAS,CAAC;GAC5B,kBAAkB,CAmD9B","sourcesContent":["import * as fs from 'fs';\nimport * as path from 'path';\nimport { injectable, bindingScopeValues } from 'inversify';\nimport { ChecklistDefinition } from './checklist-config';\n\n// Where a reviewer subagent's definition must live for Claude Code to be able to spawn it.\nconst AGENTS_DIR = path.join('.claude', 'agents');\n\n// Every checklist error names this, so a reader always knows which file and key to open. There is exactly\n// ONE place checklists can be configured, so there is exactly one label.\nconst SOURCE = 'pr-gate.checklists in webpieces.config.json';\n\n/**\n * Validates the review checklists declared in `pr-gate.checklists`. The array in webpieces.config.json is\n * the ONLY accepted shape: there is deliberately no fallback, no second location, and no back-compat path\n * for the `{ doc }` + `<!-- webpieces:checklists -->` HTML-comment manifest this replaced. A consumer on the\n * old shape gets a hard config error naming the exact edit — which an AI applies in one pass — and that is\n * strictly better than carrying two code paths forever so that nobody has to read an error message.\n *\n * `@injectable(bindingScopeValues.Singleton)` so it is injected by type + drawn in the DI design.\n */\n@injectable(bindingScopeValues.Singleton)\nexport class ChecklistValidator {\n /**\n * Human-readable errors for the configured checklists, or [] when they are valid. Never throws.\n * `defs` are already narrowed by buildPrGateConfig; this checks what only the filesystem can answer.\n */\n validate(repoRoot: string, defs: readonly ChecklistDefinition[]): string[] {\n const errors: string[] = [];\n const seen = new Set<string>();\n // Only enforce the reviewer-agent file when this repo HAS an agents dir — a non-Claude-Code consumer\n // that drives the gate some other way must not be broken by a check for a directory it never has.\n const agentsDir = path.join(repoRoot, AGENTS_DIR);\n const checkAgents = fs.existsSync(agentsDir);\n defs.forEach((def: ChecklistDefinition, i: number): void => {\n const label = def.subagent !== '' ? `\"${def.subagent}\"` : `checklists[${i}]`;\n errors.push(...this.validateSubagent(def, i, seen, checkAgents, agentsDir));\n if (def.doc !== '' && !fs.existsSync(path.join(repoRoot, def.doc))) {\n errors.push(`[pr-gate] ${SOURCE} ${label}.doc \"${def.doc}\" does not exist (paths are REPO-relative).`);\n }\n });\n return errors;\n }\n\n // `subagent` is the ONE required field and the whole distinct-reviewer guarantee rests on it.\n // eslint-disable-next-line @typescript-eslint/max-params\n private validateSubagent(def: ChecklistDefinition, i: number, seen: Set<string>, checkAgents: boolean, agentsDir: string): string[] {\n const label = def.subagent !== '' ? `\"${def.subagent}\"` : `checklists[${i}]`;\n if (def.subagent.trim() === '') {\n return [`[pr-gate] ${SOURCE} checklists[${i}].subagent must be a non-empty string (the reviewer agent name, matching ${AGENTS_DIR}/<subagent>.md).`];\n }\n if (seen.has(def.subagent)) {\n return [`[pr-gate] ${SOURCE} duplicate subagent \"${def.subagent}\" — each checklist must use a DISTINCT reviewer subagent (that is how independent review is enforced).`];\n }\n seen.add(def.subagent);\n return this.validateSubagentExists(def.subagent, label, checkAgents, agentsDir);\n }\n\n /**\n * The check this validator once lacked: nothing confirmed `subagent` named a real agent. A typo used to\n * validate clean, then get printed to the coding agent as \"spawn this\" — and since wp-finish blocks on\n * `review-<that-typo>.json`, the path of least resistance became writing the reviewer's verdict itself,\n * which is the exact self-certification the distinct-subagent rule exists to prevent. Reject at load.\n */\n private validateSubagentExists(subagent: string, label: string, checkAgents: boolean, agentsDir: string): string[] {\n if (!checkAgents) return [];\n if (fs.existsSync(path.join(agentsDir, `${subagent}.md`))) return [];\n return [\n `[pr-gate] ${SOURCE} ${label}.subagent names no reviewer — ${AGENTS_DIR}/${subagent}.md does not exist, ` +\n `so nothing can spawn it and wp-finish-upsert-pr would block forever on a review-${subagent}.json that no reviewer can write. ` +\n `Create that agent file or fix the name.`,\n ];\n }\n}\n"]}
|
package/src/index.d.ts
CHANGED
|
@@ -35,9 +35,9 @@ export type { ClientCreationSeverity } from './no-client-creation-config';
|
|
|
35
35
|
export type { MethodLimitMode, FileLimitMode, ReturnTypeMode, InlineTypeMode, ModifiedCodeMode, ProjectMode, PrismaValidateDtosMode, PrismaConverterMode, DirectApiResolverMode, ThrowCauseMode, OnOffMode, StructuralMode, ValidateTsMode, } from './rule-configs';
|
|
36
36
|
export { FeatureBranchGuardConfig, ReadStaleGuardConfig, MergedBranchBashGuardConfig, StaleMainBashGuardConfig, } from './main-sync-guard-configs';
|
|
37
37
|
export { GateDefinition, PrGateConfig, defaultGates, defaultPrGateConfig, buildPrGateConfig, MERGE_MODE_AUTO, MERGE_MODE_NONE, MERGE_MODES, } from './pr-gate-config';
|
|
38
|
-
export { ChecklistDefinition,
|
|
38
|
+
export { ChecklistDefinition, toChecklist, normalizeChecklistDoc, formatFileList, } from './checklist-config';
|
|
39
39
|
export type { RawChecklistItem } from './checklist-config';
|
|
40
|
-
export {
|
|
40
|
+
export { ChecklistValidator } from './checklist-validator';
|
|
41
41
|
export { ChecklistInstructionsService } from './checklist-instructions';
|
|
42
42
|
export { GateTokenService, computeGateToken, gateTokenMarker, extractGateToken, verifyGateToken, } from './gate-token';
|
|
43
43
|
export { SubagentProvenanceService, ProvenanceResult, PROVENANCE_OK, PROVENANCE_MISSING, PROVENANCE_SKIPPED, } from './subagent-provenance';
|
package/src/index.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FieldDef = exports.sectionForRule = exports.isHookGuard = exports.HOOK_GUARD_NAMES = exports.DEFAULT_MATCH_RULES = exports.renderMatchRuleMessage = exports.compileMatchRulePatterns = exports.isMatchRuleAllowedPath = exports.findMatchRuleViolations = exports.MatchRuleViolation = exports.MatchRuleConfig = exports.validateChecklistDocs = exports.allRuleNames = exports.validateMatchRulesSection = exports.validateExcludePaths = exports.validateCommandsSection = exports.validateSectionPlacement = exports.validateChecklistsSection = exports.validatePrGateSection = exports.validateWebpiecesConfig = exports.TemplateWriter = exports.writeTemplate = exports.writeTemplateIfMissing = exports.loadTemplate = exports.defaultRulesDir = exports.defaultRules = exports.isPathExcluded = exports.ExcludePaths = exports.DESIGN_METADATA_KEYS = exports.isDocumentDesign = exports.DocumentDesign = exports.RulesConfigDesign = exports.INSTRUCT_AI_DIR = exports.RepoRootFinder = exports.ConfigFile = exports.CONFIG_FILENAME = exports.findConfigFile = exports.ConfigLoader = exports.LoadedConfig = exports.loadAndValidate = exports.toError = exports.runMain = exports.CliArgs = exports.CliArgsCheck = exports.CliUsage = exports.CliExitError = exports.RuleFailError = exports.InformAiError = exports.ResolvedRuleConfig = exports.ResolvedConfig = void 0;
|
|
4
4
|
exports.PrCreationOrPushGuardConfig = exports.BranchCreationGuardConfig = exports.RoleTagConfig = exports.FrameworkTagConfig = exports.InjectAnnotationNotNeededForConcreteClassConfig = exports.NoFunctionOutsideClassConfig = exports.NoProcessExitOutsideMainConfig = exports.NoCustomCssConfig = exports.NoSymbolDiTokensConfig = exports.AngularNoDirectApiInResolverConfig = exports.ThrowCauseRequiredConfig = exports.CatchErrorPatternConfig = exports.NoUnmanagedExceptionsConfig = exports.NoDestructureConfig = exports.PrismaConverterConfig = exports.PrismaValidateDtosConfig = exports.NoImplicitAnyConfig = exports.NoAnyUnknownConfig = exports.NoInlineTypeLiteralsConfig = exports.RequireReturnTypeConfig = exports.MaxFileLinesConfig = exports.MaxMethodLinesConfig = exports.WP_FINISH_UPSERT_PR = exports.WP_START_UPSERT_PR = exports.WP_FINISH_UPDATE = exports.WP_START_UPDATE = exports.SyncFlowGuidance = exports.WebpiecesRulesConfig = 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.getCurrentBranch = exports.shouldSkipRule = void 0;
|
|
5
|
-
exports.
|
|
6
|
-
exports.ReapedBranch = exports.WorktreeService = exports.Worktree = 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 = exports.readMainSyncLock = exports.writeMainSyncStatus = exports.readMainSyncStatus = exports.mainSyncLockPath = exports.mainSyncStatusPath = exports.DEFAULT_HANG_TIMEOUT_MINUTES = exports.MainSyncStatusService = exports.MainSyncLock = exports.MainSyncStatus = exports.reviewJsonSchemaHint = exports.reviewJsonPath = exports.prDirFor = exports.loadReviewJson = exports.ReviewJsonService = exports.ChecklistReviewContext = exports.RequiredChecklist = exports.CK_MISSING = exports.CK_FAIL = exports.CK_OVERRIDDEN = exports.CK_PASS = exports.ChecklistVerdict = exports.ChecklistResult = exports.PrContext = exports.ReviewJson = exports.PROVENANCE_SKIPPED = exports.PROVENANCE_MISSING = exports.PROVENANCE_OK = exports.ProvenanceResult = exports.SubagentProvenanceService = exports.verifyGateToken = exports.extractGateToken = exports.gateTokenMarker =
|
|
7
|
-
exports.DEFAULT_MERGE_COMPLETE_COMMAND = exports.DEFAULT_UPSERT_PR_COMMAND = exports.buildCommandsConfig = exports.CommandsConfig = exports.logBranchMutation = exports.branchMutationLogPath = exports.BranchMutationLog = exports.BranchMutationEvent = exports.BranchReaper =
|
|
5
|
+
exports.computeGateToken = exports.GateTokenService = exports.ChecklistInstructionsService = exports.ChecklistValidator = exports.formatFileList = exports.normalizeChecklistDoc = exports.toChecklist = exports.ChecklistDefinition = exports.MERGE_MODES = exports.MERGE_MODE_NONE = exports.MERGE_MODE_AUTO = exports.buildPrGateConfig = exports.defaultPrGateConfig = exports.defaultGates = exports.PrGateConfig = exports.GateDefinition = exports.StaleMainBashGuardConfig = exports.MergedBranchBashGuardConfig = exports.ReadStaleGuardConfig = exports.FeatureBranchGuardConfig = 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.RedirectHowToMergeMainConfig = exports.PrMergeGuardConfig = exports.MergeInProgressGuardConfig = void 0;
|
|
6
|
+
exports.ReapResult = exports.ReapedBranch = exports.WorktreeService = exports.Worktree = 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 = exports.readMainSyncLock = exports.writeMainSyncStatus = exports.readMainSyncStatus = exports.mainSyncLockPath = exports.mainSyncStatusPath = exports.DEFAULT_HANG_TIMEOUT_MINUTES = exports.MainSyncStatusService = exports.MainSyncLock = exports.MainSyncStatus = exports.reviewJsonSchemaHint = exports.reviewJsonPath = exports.prDirFor = exports.loadReviewJson = exports.ReviewJsonService = exports.ChecklistReviewContext = exports.RequiredChecklist = exports.CK_MISSING = exports.CK_FAIL = exports.CK_OVERRIDDEN = exports.CK_PASS = exports.ChecklistVerdict = exports.ChecklistResult = exports.PrContext = exports.ReviewJson = exports.PROVENANCE_SKIPPED = exports.PROVENANCE_MISSING = exports.PROVENANCE_OK = exports.ProvenanceResult = exports.SubagentProvenanceService = exports.verifyGateToken = exports.extractGateToken = exports.gateTokenMarker = void 0;
|
|
7
|
+
exports.DEFAULT_MERGE_COMPLETE_COMMAND = exports.DEFAULT_UPSERT_PR_COMMAND = exports.buildCommandsConfig = exports.CommandsConfig = exports.logBranchMutation = exports.branchMutationLogPath = exports.BranchMutationLog = exports.BranchMutationEvent = exports.BranchReaper = void 0;
|
|
8
8
|
var types_1 = require("./types");
|
|
9
9
|
Object.defineProperty(exports, "ResolvedConfig", { enumerable: true, get: function () { return types_1.ResolvedConfig; } });
|
|
10
10
|
Object.defineProperty(exports, "ResolvedRuleConfig", { enumerable: true, get: function () { return types_1.ResolvedRuleConfig; } });
|
|
@@ -182,12 +182,11 @@ Object.defineProperty(exports, "MERGE_MODE_NONE", { enumerable: true, get: funct
|
|
|
182
182
|
Object.defineProperty(exports, "MERGE_MODES", { enumerable: true, get: function () { return pr_gate_config_1.MERGE_MODES; } });
|
|
183
183
|
var checklist_config_1 = require("./checklist-config");
|
|
184
184
|
Object.defineProperty(exports, "ChecklistDefinition", { enumerable: true, get: function () { return checklist_config_1.ChecklistDefinition; } });
|
|
185
|
-
Object.defineProperty(exports, "ChecklistSource", { enumerable: true, get: function () { return checklist_config_1.ChecklistSource; } });
|
|
186
185
|
Object.defineProperty(exports, "toChecklist", { enumerable: true, get: function () { return checklist_config_1.toChecklist; } });
|
|
187
|
-
Object.defineProperty(exports, "
|
|
186
|
+
Object.defineProperty(exports, "normalizeChecklistDoc", { enumerable: true, get: function () { return checklist_config_1.normalizeChecklistDoc; } });
|
|
188
187
|
Object.defineProperty(exports, "formatFileList", { enumerable: true, get: function () { return checklist_config_1.formatFileList; } });
|
|
189
|
-
var
|
|
190
|
-
Object.defineProperty(exports, "
|
|
188
|
+
var checklist_validator_1 = require("./checklist-validator");
|
|
189
|
+
Object.defineProperty(exports, "ChecklistValidator", { enumerable: true, get: function () { return checklist_validator_1.ChecklistValidator; } });
|
|
191
190
|
var checklist_instructions_1 = require("./checklist-instructions");
|
|
192
191
|
Object.defineProperty(exports, "ChecklistInstructionsService", { enumerable: true, get: function () { return checklist_instructions_1.ChecklistInstructionsService; } });
|
|
193
192
|
var gate_token_1 = require("./gate-token");
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,qDAAkD;AAAzC,gHAAA,aAAa,OAAA;AACtB,mDAAgD;AAAvC,8GAAA,YAAY,OAAA;AACrB,uCAA6D;AAApD,oGAAA,QAAQ,OAAA;AAAE,wGAAA,YAAY,OAAA;AAAE,mGAAA,OAAO,OAAA;AACxC,uCAAqC;AAA5B,mGAAA,OAAO,OAAA;AAChB,uCAAqC;AAA5B,mGAAA,OAAO,OAAA;AAChB,6CAA4E;AAAnE,8GAAA,eAAe,O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AAA;AACrB,gIAAA,4BAA4B,OAAA;AAC5B,sHAAA,kBAAkB,OAAA;AAClB,oHAAA,gBAAgB,OAAA;AAChB,sHAAA,kBAAkB,OAAA;AAClB,uHAAA,mBAAmB,OAAA;AACnB,oHAAA,gBAAgB,OAAA;AAChB,qHAAA,iBAAiB,OAAA;AACjB,+GAAA,WAAW,OAAA;AACX,uHAAA,mBAAmB,OAAA;AACnB,0HAAA,sBAAsB,OAAA;AACtB,iHAAA,aAAa,OAAA;AACb,gHAAA,YAAY,OAAA;AACZ,yHAAA,qBAAqB,OAAA;AACrB,4HAAA,wBAAwB,OAAA;AACxB,uHAAA,mBAAmB,OAAA;AAEvB,qDAM2B;AALvB,+GAAA,YAAY,OAAA;AACZ,kHAAA,eAAe,OAAA;AACf,oHAAA,iBAAiB,OAAA;AACjB,sHAAA,mBAAmB,OAAA;AACnB,wHAAA,qBAAqB,OAAA;AAEzB,yCAGqB;AAFjB,qGAAA,QAAQ,OAAA;AACR,4GAAA,eAAe,OAAA;AAEnB,iDAIyB;AAHrB,6GAAA,YAAY,OAAA;AACZ,2GAAA,UAAU,OAAA;AACV,6GAAA,YAAY,OAAA;AAGhB,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","sourcesContent":["export { ResolvedConfig, ResolvedRuleConfig, RuleOptions } from './types';\nexport { InformAiError } from './inform-ai-error';\nexport { RuleFailError } from './rule-fail-error';\nexport { CliExitError } from './cli-exit-error';\nexport { CliUsage, CliArgsCheck, CliArgs } from './cli-args';\nexport { runMain } from './run-main';\nexport { toError } from './to-error';\nexport { loadAndValidate, LoadedConfig, ConfigLoader } from './load-config';\nexport { findConfigFile, CONFIG_FILENAME, ConfigFile } from './config-file';\nexport { RepoRootFinder, INSTRUCT_AI_DIR } from './repo-root';\nexport { RulesConfigDesign } from './rules-config-design';\nexport { DocumentDesign, isDocumentDesign, DESIGN_METADATA_KEYS } from './di';\nexport { ExcludePaths } from './exclude-hook-paths';\nexport { isPathExcluded } from './exclude-paths';\nexport { defaultRules, defaultRulesDir } from './default-rules';\nexport { loadTemplate, writeTemplateIfMissing, writeTemplate, TemplateWriter } from './load-template';\nexport { validateWebpiecesConfig, validatePrGateSection, validateChecklistsSection, validateSectionPlacement, validateCommandsSection, validateExcludePaths, validateMatchRulesSection, allRuleNames } from './validate-config';\nexport { validateChecklistDocs } from './checklist-docs-validator';\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 { HOOK_GUARD_NAMES, isHookGuard, sectionForRule } from './sections';\nexport { FieldDef } from './field-def';\nexport type { SchemaShape } from './field-def';\nexport { shouldSkipRule, getCurrentBranch } from './skip-rule';\nexport type { 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} 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} 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 BranchCreationGuardConfig,\n PrCreationOrPushGuardConfig,\n MergeInProgressGuardConfig,\n PrMergeGuardConfig,\n RedirectHowToMergeMainConfig,\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';\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 {\n FeatureBranchGuardConfig,\n ReadStaleGuardConfig,\n MergedBranchBashGuardConfig,\n StaleMainBashGuardConfig,\n} from './main-sync-guard-configs';\nexport {\n GateDefinition,\n PrGateConfig,\n defaultGates,\n defaultPrGateConfig,\n buildPrGateConfig,\n MERGE_MODE_AUTO,\n MERGE_MODE_NONE,\n MERGE_MODES,\n} from './pr-gate-config';\nexport {\n ChecklistDefinition,\n ChecklistSource,\n toChecklist,\n resolveChecklistDoc,\n formatFileList,\n} from './checklist-config';\nexport type { RawChecklistItem } from './checklist-config';\nexport { ChecklistManifestService } from './checklist-manifest';\nexport { ChecklistInstructionsService } from './checklist-instructions';\nexport {\n GateTokenService,\n computeGateToken,\n gateTokenMarker,\n extractGateToken,\n verifyGateToken,\n} from './gate-token';\nexport {\n SubagentProvenanceService,\n ProvenanceResult,\n PROVENANCE_OK,\n PROVENANCE_MISSING,\n PROVENANCE_SKIPPED,\n} from './subagent-provenance';\nexport {\n ReviewJson,\n PrContext,\n ChecklistResult,\n ChecklistVerdict,\n CK_PASS,\n CK_OVERRIDDEN,\n CK_FAIL,\n CK_MISSING,\n RequiredChecklist,\n ChecklistReviewContext,\n ReviewJsonService,\n loadReviewJson,\n prDirFor,\n reviewJsonPath,\n reviewJsonSchemaHint,\n} from './review-json';\nexport {\n MainSyncStatus,\n MainSyncLock,\n MainSyncStatusService,\n DEFAULT_HANG_TIMEOUT_MINUTES,\n mainSyncStatusPath,\n mainSyncLockPath,\n readMainSyncStatus,\n writeMainSyncStatus,\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} from './merged-branches';\nexport {\n Worktree,\n WorktreeService,\n} from './worktrees';\nexport {\n ReapedBranch,\n ReapResult,\n BranchReaper,\n} from './branch-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';\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,qDAAkD;AAAzC,gHAAA,aAAa,OAAA;AACtB,mDAAgD;AAAvC,8GAAA,YAAY,OAAA;AACrB,uCAA6D;AAApD,oGAAA,QAAQ,OAAA;AAAE,wGAAA,YAAY,OAAA;AAAE,mGAAA,OAAO,OAAA;AACxC,uCAAqC;AAA5B,mGAAA,OAAO,OAAA;AAChB,uCAAqC;AAA5B,mGAAA,OAAO,OAAA;AAChB,6CAA4E;AAAnE,8GAAA,eAAe,OAAA;AAAE,2GAAA,YAAY,OAAA;AAAE,2GAAA,YAAY,OAAA;AACpD,6CAA4E;AAAnE,6GAAA,cAAc,OAAA;AAAE,8GAAA,eAAe,OAAA;AAAE,yGAAA,UAAU,OAAA;AACpD,yCAA8D;AAArD,2GAAA,cAAc,OAAA;AAAE,4GAAA,eAAe,OAAA;AACxC,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAC1B,2BAA8E;AAArE,oGAAA,cAAc,OAAA;AAAE,sGAAA,gBAAgB,OAAA;AAAE,0GAAA,oBAAoB,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A,wBAAwB,OAAA;AACxB,uHAAA,mBAAmB,OAAA;AAEvB,qDAM2B;AALvB,+GAAA,YAAY,OAAA;AACZ,kHAAA,eAAe,OAAA;AACf,oHAAA,iBAAiB,OAAA;AACjB,sHAAA,mBAAmB,OAAA;AACnB,wHAAA,qBAAqB,OAAA;AAEzB,yCAGqB;AAFjB,qGAAA,QAAQ,OAAA;AACR,4GAAA,eAAe,OAAA;AAEnB,iDAIyB;AAHrB,6GAAA,YAAY,OAAA;AACZ,2GAAA,UAAU,OAAA;AACV,6GAAA,YAAY,OAAA;AAGhB,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","sourcesContent":["export { ResolvedConfig, ResolvedRuleConfig, RuleOptions } from './types';\nexport { InformAiError } from './inform-ai-error';\nexport { RuleFailError } from './rule-fail-error';\nexport { CliExitError } from './cli-exit-error';\nexport { CliUsage, CliArgsCheck, CliArgs } from './cli-args';\nexport { runMain } from './run-main';\nexport { toError } from './to-error';\nexport { loadAndValidate, LoadedConfig, ConfigLoader } from './load-config';\nexport { findConfigFile, CONFIG_FILENAME, ConfigFile } from './config-file';\nexport { RepoRootFinder, INSTRUCT_AI_DIR } from './repo-root';\nexport { RulesConfigDesign } from './rules-config-design';\nexport { DocumentDesign, isDocumentDesign, DESIGN_METADATA_KEYS } from './di';\nexport { ExcludePaths } from './exclude-hook-paths';\nexport { isPathExcluded } from './exclude-paths';\nexport { defaultRules, defaultRulesDir } from './default-rules';\nexport { loadTemplate, writeTemplateIfMissing, writeTemplate, TemplateWriter } from './load-template';\nexport { validateWebpiecesConfig, validatePrGateSection, validateChecklistsSection, validateSectionPlacement, validateCommandsSection, validateExcludePaths, validateMatchRulesSection, allRuleNames } from './validate-config';\nexport { validateChecklistDocs } from './checklist-docs-validator';\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 { HOOK_GUARD_NAMES, isHookGuard, sectionForRule } from './sections';\nexport { FieldDef } from './field-def';\nexport type { SchemaShape } from './field-def';\nexport { shouldSkipRule, getCurrentBranch } from './skip-rule';\nexport type { 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} 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} 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 BranchCreationGuardConfig,\n PrCreationOrPushGuardConfig,\n MergeInProgressGuardConfig,\n PrMergeGuardConfig,\n RedirectHowToMergeMainConfig,\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';\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 {\n FeatureBranchGuardConfig,\n ReadStaleGuardConfig,\n MergedBranchBashGuardConfig,\n StaleMainBashGuardConfig,\n} from './main-sync-guard-configs';\nexport {\n GateDefinition,\n PrGateConfig,\n defaultGates,\n defaultPrGateConfig,\n buildPrGateConfig,\n MERGE_MODE_AUTO,\n MERGE_MODE_NONE,\n MERGE_MODES,\n} from './pr-gate-config';\nexport {\n ChecklistDefinition,\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 GateTokenService,\n computeGateToken,\n gateTokenMarker,\n extractGateToken,\n verifyGateToken,\n} from './gate-token';\nexport {\n SubagentProvenanceService,\n ProvenanceResult,\n PROVENANCE_OK,\n PROVENANCE_MISSING,\n PROVENANCE_SKIPPED,\n} from './subagent-provenance';\nexport {\n ReviewJson,\n PrContext,\n ChecklistResult,\n ChecklistVerdict,\n CK_PASS,\n CK_OVERRIDDEN,\n CK_FAIL,\n CK_MISSING,\n RequiredChecklist,\n ChecklistReviewContext,\n ReviewJsonService,\n loadReviewJson,\n prDirFor,\n reviewJsonPath,\n reviewJsonSchemaHint,\n} from './review-json';\nexport {\n MainSyncStatus,\n MainSyncLock,\n MainSyncStatusService,\n DEFAULT_HANG_TIMEOUT_MINUTES,\n mainSyncStatusPath,\n mainSyncLockPath,\n readMainSyncStatus,\n writeMainSyncStatus,\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} from './merged-branches';\nexport {\n Worktree,\n WorktreeService,\n} from './worktrees';\nexport {\n ReapedBranch,\n ReapResult,\n BranchReaper,\n} from './branch-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';\n"]}
|
package/src/pr-gate-config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChecklistDefinition } from './checklist-config';
|
|
2
2
|
export declare class GateDefinition {
|
|
3
3
|
name: string;
|
|
4
4
|
patterns: string[];
|
|
@@ -28,7 +28,7 @@ export declare class PrGateConfig {
|
|
|
28
28
|
* commits land as the internal "Squash merge of <branch>" subject.
|
|
29
29
|
*/
|
|
30
30
|
mergeMode: string;
|
|
31
|
-
checklists:
|
|
31
|
+
checklists: ChecklistDefinition[];
|
|
32
32
|
checklistComments: boolean;
|
|
33
33
|
/**
|
|
34
34
|
* Shared secret used to mint the server-verifiable gate token. `wp-finish-upsert-pr` writes
|
|
@@ -43,7 +43,7 @@ export declare class PrGateConfig {
|
|
|
43
43
|
* agent. See RESPONSE-pr-gate-ci-enforcement / the design memo for the full tradeoff.
|
|
44
44
|
*/
|
|
45
45
|
gateSalt: string;
|
|
46
|
-
constructor(mode: string, buildCommand: string, gates: GateDefinition[], mergeMode: string, checklists?:
|
|
46
|
+
constructor(mode: string, buildCommand: string, gates: GateDefinition[], mergeMode: string, checklists?: ChecklistDefinition[], gateSalt?: string, checklistComments?: boolean);
|
|
47
47
|
}
|
|
48
48
|
export declare function defaultGates(): GateDefinition[];
|
|
49
49
|
export declare function defaultPrGateConfig(): PrGateConfig;
|