@webpieces/rules-config 0.4.471 → 0.4.473
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 +7 -21
- package/src/checklist-config.js +21 -45
- package/src/checklist-config.js.map +1 -1
- package/src/checklist-docs-validator.d.ts +5 -6
- package/src/checklist-docs-validator.js +7 -8
- package/src/checklist-docs-validator.js.map +1 -1
- package/src/checklist-manifest.d.ts +17 -0
- package/src/checklist-manifest.js +120 -0
- package/src/checklist-manifest.js.map +1 -0
- package/src/index.d.ts +6 -5
- package/src/index.js +8 -10
- package/src/index.js.map +1 -1
- package/src/main-sync-status.d.ts +32 -0
- package/src/main-sync-status.js +87 -1
- package/src/main-sync-status.js.map +1 -1
- package/src/pr-gate-config.d.ts +2 -3
- package/src/pr-gate-config.js +10 -11
- package/src/pr-gate-config.js.map +1 -1
- package/src/review-json.d.ts +8 -24
- package/src/review-json.js +66 -134
- package/src/review-json.js.map +1 -1
- package/src/subagent-provenance.d.ts +2 -0
- package/src/subagent-provenance.js +41 -8
- package/src/subagent-provenance.js.map +1 -1
- package/src/validate-config.d.ts +1 -1
- package/src/validate-config.js +21 -77
- package/src/validate-config.js.map +1 -1
- package/templates/webpieces.review-checklists.md +52 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webpieces/rules-config",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.473",
|
|
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",
|
|
@@ -1,27 +1,13 @@
|
|
|
1
|
-
export declare const CHECKLIST_BLOCK = "BLOCK";
|
|
2
|
-
export declare const CHECKLIST_WARN = "WARN";
|
|
3
|
-
export declare const CHECKLIST_SEVERITIES: string[];
|
|
4
1
|
export declare class ChecklistDefinition {
|
|
5
2
|
id: string;
|
|
6
|
-
title: string;
|
|
7
|
-
patterns: string[];
|
|
8
|
-
contentPatterns: string[];
|
|
9
|
-
docs: string[];
|
|
10
|
-
severity: string;
|
|
11
|
-
blockMessage: string;
|
|
12
|
-
disabled: boolean;
|
|
13
3
|
subagent: string;
|
|
14
|
-
|
|
4
|
+
doc: string;
|
|
5
|
+
patterns: string[];
|
|
6
|
+
constructor(id: string, subagent: string, doc: string, patterns: string[]);
|
|
15
7
|
}
|
|
16
|
-
export interface
|
|
17
|
-
id?: string;
|
|
18
|
-
title?: string;
|
|
19
|
-
patterns?: string[];
|
|
20
|
-
contentPatterns?: string[];
|
|
21
|
-
docs?: string[];
|
|
22
|
-
severity?: string;
|
|
23
|
-
blockMessage?: string;
|
|
24
|
-
disabled?: boolean;
|
|
8
|
+
export interface RawChecklistItem {
|
|
25
9
|
subagent?: string;
|
|
10
|
+
doc?: string;
|
|
11
|
+
patterns?: string[];
|
|
26
12
|
}
|
|
27
|
-
export declare function toChecklist(raw:
|
|
13
|
+
export declare function toChecklist(raw: RawChecklistItem): ChecklistDefinition;
|
package/src/checklist-config.js
CHANGED
|
@@ -1,59 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// A company review checklist: a diff-triggered extension point that lets a CONSUMER inject its own
|
|
3
|
-
// PR-time review process into the webpieces gated flow WITHOUT forking the tooling.
|
|
4
|
-
//
|
|
5
|
-
//
|
|
3
|
+
// PR-time review process into the webpieces gated flow WITHOUT forking the tooling. Each checklist names
|
|
4
|
+
// a reviewer SUBAGENT (a `.claude/agents/<subagent>.md`) and the doc that reviewer reads; when the diff
|
|
5
|
+
// matches the checklist's `patterns`, wp-start-upsert-pr tells the AI to spawn that subagent to review
|
|
6
|
+
// it, and wp-finish-upsert-pr refuses to open the PR until a well-formed, passing review-<id>.json exists
|
|
7
|
+
// AND that named subagent is proven (from the harness's own artifacts) to have actually run.
|
|
6
8
|
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
// webpieces owns only the mechanism. Data-only
|
|
10
|
-
//
|
|
11
|
-
// Lives in rules-config (not pr-gate) because both the config layer AND review.json validation need the
|
|
12
|
-
// severity vocabulary, and rules-config is the package every consumer already depends on.
|
|
9
|
+
// The checklist SET is NOT defined in webpieces.config.json — that only points at ONE manifest doc
|
|
10
|
+
// (`checklists: { "doc": "..." }`). The manifest lives in the doc so the review process is content, not
|
|
11
|
+
// config. This is a SURFACING + AUDIT extension point; webpieces owns only the mechanism. Data-only.
|
|
13
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.ChecklistDefinition =
|
|
13
|
+
exports.ChecklistDefinition = void 0;
|
|
15
14
|
exports.toChecklist = toChecklist;
|
|
16
|
-
exports.CHECKLIST_BLOCK = 'BLOCK';
|
|
17
|
-
exports.CHECKLIST_WARN = 'WARN';
|
|
18
|
-
// BLOCK — an unacknowledged one throws before the PR is opened (same guarantee buildCommand gives).
|
|
19
|
-
// WARN — never validated; absence just renders a yellow dashboard row (a nudge, not a gate).
|
|
20
|
-
exports.CHECKLIST_SEVERITIES = [exports.CHECKLIST_BLOCK, exports.CHECKLIST_WARN];
|
|
21
15
|
class ChecklistDefinition {
|
|
22
|
-
id; //
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
severity; // 'BLOCK' | 'WARN'
|
|
28
|
-
blockMessage; // consumer-owned wording shown when it blocks
|
|
29
|
-
disabled; // example/inactive checklist kept in the file (JSON has no comments)
|
|
30
|
-
// Expected agentType (e.g. "morpheus-reviewer") that must have run on this branch for the checklist
|
|
31
|
-
// to be considered independently reviewed. When set, wp-finish-upsert-pr reads the Claude Code
|
|
32
|
-
// harness's own subagent artifacts (agent-*.meta.json agentType + spawnDepth, sibling jsonl
|
|
33
|
-
// isSidechain/gitBranch) to VERIFY such a subagent actually ran — provenance is READ from harness
|
|
34
|
-
// artifacts, never asserted in review.json. '' = no provenance requirement.
|
|
35
|
-
//
|
|
36
|
-
// NOT tamper-proof: a determined agent can hand-write a fake agent-*.meta.json. This raises the bar
|
|
37
|
-
// from "trust the model's word" to "deliberate, auditable forgery"; it is not cryptographic proof.
|
|
38
|
-
// Absent CLAUDE_CODE_SESSION_ID (plain terminal / CI) the check warns + skips rather than failing.
|
|
39
|
-
subagent;
|
|
40
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
41
|
-
constructor(id, title, patterns, contentPatterns, docs, severity, blockMessage, disabled = false, subagent = '') {
|
|
16
|
+
id; // = the subagent name; keys review-<id>.json and the dashboard row
|
|
17
|
+
subagent; // reviewer agent name → .claude/agents/<subagent>.md; the agentType the harness stamps
|
|
18
|
+
doc; // repo-relative guidance doc the reviewer reads (may be '' — then it reads the manifest doc)
|
|
19
|
+
patterns; // path globs (isPathExcluded semantics); [] = matches any changed file (always runs)
|
|
20
|
+
constructor(id, subagent, doc, patterns) {
|
|
42
21
|
this.id = id;
|
|
43
|
-
this.title = title;
|
|
44
|
-
this.patterns = patterns;
|
|
45
|
-
this.contentPatterns = contentPatterns;
|
|
46
|
-
this.docs = docs;
|
|
47
|
-
this.severity = severity;
|
|
48
|
-
this.blockMessage = blockMessage;
|
|
49
|
-
this.disabled = disabled;
|
|
50
22
|
this.subagent = subagent;
|
|
23
|
+
this.doc = doc;
|
|
24
|
+
this.patterns = patterns;
|
|
51
25
|
}
|
|
52
26
|
}
|
|
53
27
|
exports.ChecklistDefinition = ChecklistDefinition;
|
|
54
|
-
//
|
|
55
|
-
//
|
|
28
|
+
// Build a ChecklistDefinition from an omitting-friendly raw manifest entry. id defaults to the subagent
|
|
29
|
+
// name (the only stable, human-meaningful key we have).
|
|
30
|
+
// webpieces-disable no-function-outside-class -- pure config transform beside its data class
|
|
56
31
|
function toChecklist(raw) {
|
|
57
|
-
|
|
32
|
+
const subagent = raw.subagent ?? '';
|
|
33
|
+
return new ChecklistDefinition(subagent, subagent, raw.doc ?? '', raw.patterns ?? []);
|
|
58
34
|
}
|
|
59
35
|
//# 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":";AAAA,mGAAmG;AACnG,
|
|
1
|
+
{"version":3,"file":"checklist-config.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/checklist-config.ts"],"names":[],"mappings":";AAAA,mGAAmG;AACnG,yGAAyG;AACzG,wGAAwG;AACxG,uGAAuG;AACvG,0GAA0G;AAC1G,6FAA6F;AAC7F,EAAE;AACF,mGAAmG;AACnG,wGAAwG;AACxG,qGAAqG;;;AA0BrG,kCAGC;AA3BD,MAAa,mBAAmB;IAC5B,EAAE,CAAS,CAAS,mEAAmE;IACvF,QAAQ,CAAS,CAAG,uFAAuF;IAC3G,GAAG,CAAS,CAAQ,6FAA6F;IACjH,QAAQ,CAAW,CAAC,qFAAqF;IAEzG,YAAY,EAAU,EAAE,QAAgB,EAAE,GAAW,EAAE,QAAkB;QACrE,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;CACJ;AAZD,kDAYC;AASD,wGAAwG;AACxG,wDAAwD;AACxD,6FAA6F;AAC7F,SAAgB,WAAW,CAAC,GAAqB;IAC7C,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC;IACpC,OAAO,IAAI,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;AAC1F,CAAC","sourcesContent":["// 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-start-upsert-pr tells the AI to spawn that subagent to review\n// it, and wp-finish-upsert-pr refuses to open the PR until a well-formed, passing review-<id>.json exists\n// AND that named subagent is proven (from the harness's own artifacts) to have actually run.\n//\n// The checklist SET is NOT defined in webpieces.config.json — that only points at ONE manifest doc\n// (`checklists: { \"doc\": \"...\" }`). The manifest lives in the doc so the review process is content, not\n// config. This is a SURFACING + AUDIT extension point; webpieces owns only the mechanism. Data-only.\n\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 doc: string; // repo-relative guidance doc the reviewer reads (may be '' — then it reads the manifest doc)\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 manifest entry straight from the doc's JSON block, before it is validated + narrowed into a class.\nexport interface RawChecklistItem {\n subagent?: string;\n doc?: string;\n patterns?: string[];\n}\n\n// Build a ChecklistDefinition from an omitting-friendly raw manifest entry. id defaults to the subagent\n// name (the only stable, human-meaningful key we have).\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, raw.doc ?? '', raw.patterns ?? []);\n}\n"]}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Validate ONLY the pr-gate `checklists
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* fails as its OWN `validate-checklist-docs` check
|
|
6
|
-
* unrelated validator's banner
|
|
7
|
-
* errors; never throws.
|
|
2
|
+
* Validate ONLY the pr-gate `checklists` config + its manifest doc, in isolation — the `{ doc }` shape,
|
|
3
|
+
* that the doc exists and carries a valid `<!-- webpieces:checklists [...] -->` block, each entry's
|
|
4
|
+
* subagent is present + distinct, each item doc exists, patterns are string[]. Same logic loadAndValidate
|
|
5
|
+
* runs, but callable directly so a broken review manifest fails as its OWN `validate-checklist-docs` check
|
|
6
|
+
* (clear owner) instead of surfacing as an unrelated validator's banner. Returns errors; never throws.
|
|
8
7
|
*/
|
|
9
8
|
export declare function validateChecklistDocs(cwd: string): string[];
|
|
@@ -8,12 +8,11 @@ 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
|
-
* fails as its OWN `validate-checklist-docs` check
|
|
15
|
-
* unrelated validator's banner
|
|
16
|
-
* errors; never throws.
|
|
11
|
+
* Validate ONLY the pr-gate `checklists` config + its manifest doc, in isolation — the `{ doc }` shape,
|
|
12
|
+
* that the doc exists and carries a valid `<!-- webpieces:checklists [...] -->` block, each entry's
|
|
13
|
+
* subagent is present + distinct, each item doc exists, patterns are string[]. Same logic loadAndValidate
|
|
14
|
+
* runs, but callable directly so a broken review manifest fails as its OWN `validate-checklist-docs` check
|
|
15
|
+
* (clear owner) instead of surfacing as an unrelated validator's banner. Returns errors; never throws.
|
|
17
16
|
*/
|
|
18
17
|
// webpieces-disable no-function-outside-class -- module-level config validator, matches validate-config.ts
|
|
19
18
|
function validateChecklistDocs(cwd) {
|
|
@@ -33,13 +32,13 @@ function validateChecklistDocs(cwd) {
|
|
|
33
32
|
return [`[pr-gate] ${path.basename(configPath)} is not valid JSON: ${error.message}`];
|
|
34
33
|
}
|
|
35
34
|
const repoRoot = path.dirname(configPath);
|
|
36
|
-
//
|
|
35
|
+
// The pr-gate section lives under commands["pr-gate"] (current) or a legacy top-level pr-gate.
|
|
37
36
|
// webpieces-disable no-any-unknown -- narrowing the opaque command section
|
|
38
37
|
const commands = raw['commands'];
|
|
39
38
|
// webpieces-disable no-any-unknown -- narrowing the opaque pr-gate section
|
|
40
39
|
const prGate = (commands?.['pr-gate'] ?? raw['pr-gate']);
|
|
41
40
|
if (!prGate || !('checklists' in prGate))
|
|
42
41
|
return [];
|
|
43
|
-
return (0, validate_config_1.
|
|
42
|
+
return (0, validate_config_1.validateChecklistsSection)(prGate['checklists'], repoRoot);
|
|
44
43
|
}
|
|
45
44
|
//# sourceMappingURL=checklist-docs-validator.js.map
|
|
@@ -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":";;AAcA,sDAsBC;;AApCD,+CAAyB;AACzB,mDAA6B;AAC7B,+CAA+C;AAC/C,uDAA8D;AAC9D,yCAAqC;AAErC;;;;;;GAMG;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` config + its manifest doc, in isolation — the `{ doc }` shape,\n * that the doc exists and carries a valid `<!-- webpieces:checklists [...] -->` block, each entry's\n * subagent is present + distinct, each item doc exists, patterns are string[]. Same logic loadAndValidate\n * runs, but callable directly so a broken review manifest fails as its OWN `validate-checklist-docs` check\n * (clear owner) instead of surfacing as an unrelated validator's banner. 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,17 @@
|
|
|
1
|
+
import { ChecklistDefinition } from './checklist-config';
|
|
2
|
+
/**
|
|
3
|
+
* Loads + validates the checklist manifest embedded in the single doc `pr-gate.checklists.doc` points at.
|
|
4
|
+
* The set of checklists lives in the DOC (content), not webpieces.config.json (config) — the config only
|
|
5
|
+
* carries the doc path. `@injectable(bindingScopeValues.Singleton)` so it is injected by type + drawn in
|
|
6
|
+
* the DI design.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ChecklistManifestService {
|
|
9
|
+
manifestDocPath(repoRoot: string, docRel: string): string;
|
|
10
|
+
load(repoRoot: string, docRel: string): ChecklistDefinition[];
|
|
11
|
+
validate(repoRoot: string, docRel: string): string[];
|
|
12
|
+
private validateItems;
|
|
13
|
+
private readItems;
|
|
14
|
+
private extractManifest;
|
|
15
|
+
private parse;
|
|
16
|
+
private isStringArray;
|
|
17
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChecklistManifestService = 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
|
+
const checklist_config_1 = require("./checklist-config");
|
|
9
|
+
const to_error_1 = require("./to-error");
|
|
10
|
+
// The delimited JSON manifest embedded in the review doc. An HTML comment so it does NOT render in the
|
|
11
|
+
// markdown a human reads, but is trivially + robustly parseable (JSON.parse — no YAML dependency, no
|
|
12
|
+
// hand-rolled frontmatter parser). Example, at the top of `.claude/review/index.md`:
|
|
13
|
+
//
|
|
14
|
+
// <!-- webpieces:checklists
|
|
15
|
+
// [ { "subagent": "morpheus-envvars-reviewer", "doc": "morpheus-envvars.md",
|
|
16
|
+
// "patterns": ["**/.env*", "**/Dockerfile*"] } ]
|
|
17
|
+
// -->
|
|
18
|
+
const MANIFEST_RE = /<!--\s*webpieces:checklists\s*([\s\S]*?)-->/;
|
|
19
|
+
/**
|
|
20
|
+
* Loads + validates the checklist manifest embedded in the single doc `pr-gate.checklists.doc` points at.
|
|
21
|
+
* The set of checklists lives in the DOC (content), not webpieces.config.json (config) — the config only
|
|
22
|
+
* carries the doc path. `@injectable(bindingScopeValues.Singleton)` so it is injected by type + drawn in
|
|
23
|
+
* the DI design.
|
|
24
|
+
*/
|
|
25
|
+
let ChecklistManifestService = class ChecklistManifestService {
|
|
26
|
+
// Absolute path of the manifest doc under repoRoot.
|
|
27
|
+
manifestDocPath(repoRoot, docRel) {
|
|
28
|
+
return path.join(repoRoot, docRel);
|
|
29
|
+
}
|
|
30
|
+
// The parsed checklists, or [] when the doc is missing / has no manifest block / is malformed. Callers
|
|
31
|
+
// that need to REPORT those problems use validate(); this one is the tolerant runtime read.
|
|
32
|
+
load(repoRoot, docRel) {
|
|
33
|
+
if (docRel.trim() === '')
|
|
34
|
+
return [];
|
|
35
|
+
const items = this.readItems(this.manifestDocPath(repoRoot, docRel));
|
|
36
|
+
return items === null ? [] : items.map(checklist_config_1.toChecklist).filter((d) => d.subagent !== '');
|
|
37
|
+
}
|
|
38
|
+
// Human-readable errors for the manifest doc, or [] when it is valid. Never throws.
|
|
39
|
+
validate(repoRoot, docRel) {
|
|
40
|
+
if (docRel.trim() === '')
|
|
41
|
+
return [];
|
|
42
|
+
const docPath = this.manifestDocPath(repoRoot, docRel);
|
|
43
|
+
if (!fs.existsSync(docPath)) {
|
|
44
|
+
return [`[pr-gate] checklists.doc "${docRel}" does not exist — it must be a markdown doc carrying a <!-- webpieces:checklists [...] --> manifest.`];
|
|
45
|
+
}
|
|
46
|
+
const raw = this.extractManifest(fs.readFileSync(docPath, 'utf8'));
|
|
47
|
+
if (raw === '') {
|
|
48
|
+
return [`[pr-gate] "${docRel}" has no <!-- webpieces:checklists [...] --> block. Add a JSON array of { subagent, doc?, patterns? } inside that HTML comment.`];
|
|
49
|
+
}
|
|
50
|
+
const parsed = this.parse(raw);
|
|
51
|
+
if (parsed === null) {
|
|
52
|
+
return [`[pr-gate] the <!-- webpieces:checklists --> block in "${docRel}" is not a valid JSON array.`];
|
|
53
|
+
}
|
|
54
|
+
return this.validateItems(parsed, repoRoot, docRel);
|
|
55
|
+
}
|
|
56
|
+
validateItems(items, repoRoot, docRel) {
|
|
57
|
+
const errors = [];
|
|
58
|
+
const seen = new Set();
|
|
59
|
+
const docDir = path.dirname(this.manifestDocPath(repoRoot, docRel));
|
|
60
|
+
items.forEach((item, i) => {
|
|
61
|
+
const label = typeof item.subagent === 'string' && item.subagent !== '' ? `"${item.subagent}"` : `checklists[${i}]`;
|
|
62
|
+
if (typeof item.subagent !== 'string' || item.subagent.trim() === '') {
|
|
63
|
+
errors.push(`[pr-gate] ${docRel} checklists[${i}].subagent must be a non-empty string (the reviewer agent name, matching .claude/agents/<subagent>.md).`);
|
|
64
|
+
}
|
|
65
|
+
else if (seen.has(item.subagent)) {
|
|
66
|
+
errors.push(`[pr-gate] ${docRel} duplicate subagent "${item.subagent}" — each checklist must use a DISTINCT reviewer subagent (that is how independent review is enforced).`);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
seen.add(item.subagent);
|
|
70
|
+
}
|
|
71
|
+
if (item.doc !== undefined && item.doc !== '' && !fs.existsSync(path.join(docDir, item.doc))) {
|
|
72
|
+
errors.push(`[pr-gate] ${docRel} ${label}.doc "${item.doc}" does not exist (resolved relative to the manifest doc).`);
|
|
73
|
+
}
|
|
74
|
+
if (item.patterns !== undefined && !this.isStringArray(item.patterns)) {
|
|
75
|
+
errors.push(`[pr-gate] ${docRel} ${label}.patterns must be a string[] of path globs (omit or [] to run on every PR).`);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
return errors;
|
|
79
|
+
}
|
|
80
|
+
// Read the manifest doc and return its parsed items, or null on any problem (missing/no block/bad JSON).
|
|
81
|
+
readItems(docPath) {
|
|
82
|
+
if (!fs.existsSync(docPath))
|
|
83
|
+
return null;
|
|
84
|
+
const raw = this.extractManifest(fs.readFileSync(docPath, 'utf8'));
|
|
85
|
+
if (raw === '')
|
|
86
|
+
return null;
|
|
87
|
+
return this.parse(raw);
|
|
88
|
+
}
|
|
89
|
+
extractManifest(content) {
|
|
90
|
+
const m = MANIFEST_RE.exec(content);
|
|
91
|
+
return m ? m[1].trim() : '';
|
|
92
|
+
}
|
|
93
|
+
// webpieces-disable no-any-unknown -- opaque parsed JSON, narrowed to an item array by the caller
|
|
94
|
+
parse(json) {
|
|
95
|
+
// webpieces-disable no-unmanaged-exceptions -- chokepoint: a malformed manifest is reported as one error / ignored
|
|
96
|
+
// eslint-disable-next-line @webpieces/no-unmanaged-exceptions
|
|
97
|
+
try {
|
|
98
|
+
// webpieces-disable no-any-unknown -- parsed JSON is opaque until narrowed below
|
|
99
|
+
const value = JSON.parse(json);
|
|
100
|
+
if (!Array.isArray(value))
|
|
101
|
+
return null;
|
|
102
|
+
// webpieces-disable no-any-unknown -- each opaque entry is narrowed field-by-field downstream
|
|
103
|
+
return value;
|
|
104
|
+
}
|
|
105
|
+
catch (err) {
|
|
106
|
+
const error = (0, to_error_1.toError)(err);
|
|
107
|
+
void error;
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
// webpieces-disable no-any-unknown -- opaque parsed JSON value, narrowed to string[] here
|
|
112
|
+
isStringArray(value) {
|
|
113
|
+
return Array.isArray(value) && value.every((v) => typeof v === 'string');
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
exports.ChecklistManifestService = ChecklistManifestService;
|
|
117
|
+
exports.ChecklistManifestService = ChecklistManifestService = tslib_1.__decorate([
|
|
118
|
+
(0, inversify_1.injectable)(inversify_1.bindingScopeValues.Singleton)
|
|
119
|
+
], ChecklistManifestService);
|
|
120
|
+
//# sourceMappingURL=checklist-manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checklist-manifest.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/checklist-manifest.ts"],"names":[],"mappings":";;;;AAAA,+CAAyB;AACzB,mDAA6B;AAC7B,yCAA2D;AAC3D,yDAAwF;AACxF,yCAAqC;AAErC,uGAAuG;AACvG,qGAAqG;AACrG,qFAAqF;AACrF,EAAE;AACF,8BAA8B;AAC9B,+EAA+E;AAC/E,uDAAuD;AACvD,QAAQ;AACR,MAAM,WAAW,GAAG,6CAA6C,CAAC;AAElE;;;;;GAKG;AAEI,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACjC,oDAAoD;IACpD,eAAe,CAAC,QAAgB,EAAE,MAAc;QAC5C,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACvC,CAAC;IAED,uGAAuG;IACvG,4FAA4F;IAC5F,IAAI,CAAC,QAAgB,EAAE,MAAc;QACjC,IAAI,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE;YAAE,OAAO,EAAE,CAAC;QACpC,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;QACrE,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,C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C;IAC/F,CAAC;CACJ,CAAA;AAzFY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,sBAAU,EAAC,8BAAkB,CAAC,SAAS,CAAC;GAC5B,wBAAwB,CAyFpC","sourcesContent":["import * as fs from 'fs';\nimport * as path from 'path';\nimport { injectable, bindingScopeValues } from 'inversify';\nimport { ChecklistDefinition, RawChecklistItem, toChecklist } from './checklist-config';\nimport { toError } from './to-error';\n\n// The delimited JSON manifest embedded in the review doc. An HTML comment so it does NOT render in the\n// markdown a human reads, but is trivially + robustly parseable (JSON.parse — no YAML dependency, no\n// hand-rolled frontmatter parser). Example, at the top of `.claude/review/index.md`:\n//\n// <!-- webpieces:checklists\n// [ { \"subagent\": \"morpheus-envvars-reviewer\", \"doc\": \"morpheus-envvars.md\",\n// \"patterns\": [\"**/.env*\", \"**/Dockerfile*\"] } ]\n// -->\nconst MANIFEST_RE = /<!--\\s*webpieces:checklists\\s*([\\s\\S]*?)-->/;\n\n/**\n * Loads + validates the checklist manifest embedded in the single doc `pr-gate.checklists.doc` points at.\n * The set of checklists lives in the DOC (content), not webpieces.config.json (config) — the config only\n * carries the doc path. `@injectable(bindingScopeValues.Singleton)` so it is injected by type + drawn in\n * the DI design.\n */\n@injectable(bindingScopeValues.Singleton)\nexport class ChecklistManifestService {\n // Absolute path of the manifest doc under repoRoot.\n manifestDocPath(repoRoot: string, docRel: string): string {\n return path.join(repoRoot, docRel);\n }\n\n // The parsed checklists, or [] when the doc is missing / has no manifest block / is malformed. Callers\n // that need to REPORT those problems use validate(); this one is the tolerant runtime read.\n load(repoRoot: string, docRel: string): ChecklistDefinition[] {\n if (docRel.trim() === '') return [];\n const items = this.readItems(this.manifestDocPath(repoRoot, docRel));\n return items === null ? [] : items.map(toChecklist).filter((d: ChecklistDefinition): boolean => d.subagent !== '');\n }\n\n // Human-readable errors for the manifest doc, or [] when it is valid. Never throws.\n validate(repoRoot: string, docRel: string): string[] {\n if (docRel.trim() === '') return [];\n const docPath = this.manifestDocPath(repoRoot, docRel);\n if (!fs.existsSync(docPath)) {\n return [`[pr-gate] checklists.doc \"${docRel}\" does not exist — it must be a markdown doc carrying a <!-- webpieces:checklists [...] --> manifest.`];\n }\n const raw = this.extractManifest(fs.readFileSync(docPath, 'utf8'));\n if (raw === '') {\n return [`[pr-gate] \"${docRel}\" has no <!-- webpieces:checklists [...] --> block. Add a JSON array of { subagent, doc?, patterns? } inside that HTML comment.`];\n }\n const parsed = this.parse(raw);\n if (parsed === null) {\n return [`[pr-gate] the <!-- webpieces:checklists --> block in \"${docRel}\" is not a valid JSON array.`];\n }\n return this.validateItems(parsed, repoRoot, docRel);\n }\n\n private validateItems(items: readonly RawChecklistItem[], repoRoot: string, docRel: string): string[] {\n const errors: string[] = [];\n const seen = new Set<string>();\n const docDir = path.dirname(this.manifestDocPath(repoRoot, docRel));\n items.forEach((item: RawChecklistItem, i: number): void => {\n const label = typeof item.subagent === 'string' && item.subagent !== '' ? `\"${item.subagent}\"` : `checklists[${i}]`;\n if (typeof item.subagent !== 'string' || item.subagent.trim() === '') {\n errors.push(`[pr-gate] ${docRel} checklists[${i}].subagent must be a non-empty string (the reviewer agent name, matching .claude/agents/<subagent>.md).`);\n } else if (seen.has(item.subagent)) {\n errors.push(`[pr-gate] ${docRel} duplicate subagent \"${item.subagent}\" — each checklist must use a DISTINCT reviewer subagent (that is how independent review is enforced).`);\n } else {\n seen.add(item.subagent);\n }\n if (item.doc !== undefined && item.doc !== '' && !fs.existsSync(path.join(docDir, item.doc))) {\n errors.push(`[pr-gate] ${docRel} ${label}.doc \"${item.doc}\" does not exist (resolved relative to the manifest doc).`);\n }\n if (item.patterns !== undefined && !this.isStringArray(item.patterns)) {\n errors.push(`[pr-gate] ${docRel} ${label}.patterns must be a string[] of path globs (omit or [] to run on every PR).`);\n }\n });\n return errors;\n }\n\n // Read the manifest doc and return its parsed items, or null on any problem (missing/no block/bad JSON).\n private readItems(docPath: string): RawChecklistItem[] | null {\n if (!fs.existsSync(docPath)) return null;\n const raw = this.extractManifest(fs.readFileSync(docPath, 'utf8'));\n if (raw === '') return null;\n return this.parse(raw);\n }\n\n private extractManifest(content: string): string {\n const m = MANIFEST_RE.exec(content);\n return m ? m[1].trim() : '';\n }\n\n // webpieces-disable no-any-unknown -- opaque parsed JSON, narrowed to an item array by the caller\n private parse(json: string): RawChecklistItem[] | null {\n // webpieces-disable no-unmanaged-exceptions -- chokepoint: a malformed manifest is reported as one error / ignored\n // eslint-disable-next-line @webpieces/no-unmanaged-exceptions\n try {\n // webpieces-disable no-any-unknown -- parsed JSON is opaque until narrowed below\n const value = JSON.parse(json) as unknown;\n if (!Array.isArray(value)) return null;\n // webpieces-disable no-any-unknown -- each opaque entry is narrowed field-by-field downstream\n return value as RawChecklistItem[];\n } catch (err: unknown) {\n const error = toError(err);\n void error;\n return null;\n }\n }\n\n // webpieces-disable no-any-unknown -- opaque parsed JSON value, narrowed to string[] here\n private isStringArray(value: unknown): boolean {\n return Array.isArray(value) && value.every((v: unknown): boolean => typeof v === 'string');\n }\n}\n"]}
|
package/src/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export { ExcludePaths } from './exclude-hook-paths';
|
|
|
14
14
|
export { isPathExcluded } from './exclude-paths';
|
|
15
15
|
export { defaultRules, defaultRulesDir } from './default-rules';
|
|
16
16
|
export { loadTemplate, writeTemplateIfMissing, writeTemplate, TemplateWriter } from './load-template';
|
|
17
|
-
export { validateWebpiecesConfig, validatePrGateSection,
|
|
17
|
+
export { validateWebpiecesConfig, validatePrGateSection, validateChecklistsSection, validateSectionPlacement, validateCommandsSection, validateExcludePaths, validateMatchRulesSection, allRuleNames } from './validate-config';
|
|
18
18
|
export { validateChecklistDocs } from './checklist-docs-validator';
|
|
19
19
|
export { MatchRuleConfig, MatchRuleViolation, findMatchRuleViolations, isMatchRuleAllowedPath, compileMatchRulePatterns, renderMatchRuleMessage, DEFAULT_MATCH_RULES, } from './match-rules-config';
|
|
20
20
|
export type { ConfigSection } from './sections';
|
|
@@ -34,12 +34,13 @@ export { NoClientCreationOutsideServerOrClientConfig, CLIENT_CREATION_SEVERITIES
|
|
|
34
34
|
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 { GateDefinition, PrGateConfig, defaultGates, defaultPrGateConfig, buildPrGateConfig, MERGE_MODE_AUTO, MERGE_MODE_NONE, MERGE_MODES, } from './pr-gate-config';
|
|
37
|
-
export { ChecklistDefinition, toChecklist,
|
|
38
|
-
export type {
|
|
37
|
+
export { ChecklistDefinition, toChecklist, } from './checklist-config';
|
|
38
|
+
export type { RawChecklistItem } from './checklist-config';
|
|
39
|
+
export { ChecklistManifestService } from './checklist-manifest';
|
|
39
40
|
export { GateTokenService, computeGateToken, gateTokenMarker, extractGateToken, verifyGateToken, } from './gate-token';
|
|
40
41
|
export { SubagentProvenanceService, ProvenanceResult, PROVENANCE_OK, PROVENANCE_MISSING, PROVENANCE_SKIPPED, } from './subagent-provenance';
|
|
41
|
-
export { ReviewJson,
|
|
42
|
-
export { MainSyncStatus, MainSyncLock, MainSyncStatusService, DEFAULT_HANG_TIMEOUT_MINUTES, mainSyncStatusPath, mainSyncLockPath, readMainSyncStatus, writeMainSyncStatus, readMainSyncLock, writeMainSyncLock, isLockStale, isRefreshInProgress, inProcessLock, finishedLock, computeMainSyncStatus, stampCleanMainSyncStatus, squashRecoverySteps, } from './main-sync-status';
|
|
42
|
+
export { ReviewJson, ChecklistResult, ChecklistVerdict, CK_PASS, CK_OVERRIDDEN, CK_FAIL, CK_MISSING, RequiredChecklist, ReviewJsonService, loadReviewJson, prDirFor, reviewJsonPath, reviewJsonSchemaHint, } from './review-json';
|
|
43
|
+
export { MainSyncStatus, MainSyncLock, MainSyncStatusService, DEFAULT_HANG_TIMEOUT_MINUTES, mainSyncStatusPath, mainSyncLockPath, readMainSyncStatus, writeMainSyncStatus, readMainSyncLock, writeMainSyncLock, isLockStale, isRefreshInProgress, tryAcquireMainSyncLock, inProcessLock, finishedLock, computeMainSyncStatus, stampCleanMainSyncStatus, squashRecoverySteps, } from './main-sync-status';
|
|
43
44
|
export { MergedBranch, DeletableBranch, DeletableWorktree, MergedBranchesCache, MergedBranchesService, } from './merged-branches';
|
|
44
45
|
export { Worktree, WorktreeService, } from './worktrees';
|
|
45
46
|
export { ReapedBranch, ReapResult, BranchReaper, } from './branch-reaper';
|
package/src/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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.
|
|
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.BranchMutationLog = exports.BranchMutationEvent = exports.BranchReaper = 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.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.RequiredChecklist = exports.
|
|
7
|
-
exports.DEFAULT_MERGE_COMPLETE_COMMAND = exports.DEFAULT_UPSERT_PR_COMMAND = exports.buildCommandsConfig =
|
|
5
|
+
exports.SubagentProvenanceService = exports.verifyGateToken = exports.extractGateToken = exports.gateTokenMarker = exports.computeGateToken = exports.GateTokenService = exports.ChecklistManifestService = 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.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.MergedBranchBashGuardConfig = exports.ReadStaleGuardConfig = exports.FeatureBranchGuardConfig = exports.RedirectHowToMergeMainConfig = exports.PrMergeGuardConfig = exports.MergeInProgressGuardConfig = void 0;
|
|
6
|
+
exports.CommandsConfig = exports.logBranchMutation = exports.branchMutationLogPath = exports.BranchMutationLog = exports.BranchMutationEvent = exports.BranchReaper = 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.RequiredChecklist = exports.CK_MISSING = exports.CK_FAIL = exports.CK_OVERRIDDEN = exports.CK_PASS = exports.ChecklistVerdict = exports.ChecklistResult = exports.ReviewJson = exports.PROVENANCE_SKIPPED = exports.PROVENANCE_MISSING = exports.PROVENANCE_OK = exports.ProvenanceResult = void 0;
|
|
7
|
+
exports.DEFAULT_MERGE_COMPLETE_COMMAND = exports.DEFAULT_UPSERT_PR_COMMAND = exports.buildCommandsConfig = 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; } });
|
|
@@ -54,7 +54,7 @@ Object.defineProperty(exports, "TemplateWriter", { enumerable: true, get: functi
|
|
|
54
54
|
var validate_config_1 = require("./validate-config");
|
|
55
55
|
Object.defineProperty(exports, "validateWebpiecesConfig", { enumerable: true, get: function () { return validate_config_1.validateWebpiecesConfig; } });
|
|
56
56
|
Object.defineProperty(exports, "validatePrGateSection", { enumerable: true, get: function () { return validate_config_1.validatePrGateSection; } });
|
|
57
|
-
Object.defineProperty(exports, "
|
|
57
|
+
Object.defineProperty(exports, "validateChecklistsSection", { enumerable: true, get: function () { return validate_config_1.validateChecklistsSection; } });
|
|
58
58
|
Object.defineProperty(exports, "validateSectionPlacement", { enumerable: true, get: function () { return validate_config_1.validateSectionPlacement; } });
|
|
59
59
|
Object.defineProperty(exports, "validateCommandsSection", { enumerable: true, get: function () { return validate_config_1.validateCommandsSection; } });
|
|
60
60
|
Object.defineProperty(exports, "validateExcludePaths", { enumerable: true, get: function () { return validate_config_1.validateExcludePaths; } });
|
|
@@ -181,9 +181,8 @@ Object.defineProperty(exports, "MERGE_MODES", { enumerable: true, get: function
|
|
|
181
181
|
var checklist_config_1 = require("./checklist-config");
|
|
182
182
|
Object.defineProperty(exports, "ChecklistDefinition", { enumerable: true, get: function () { return checklist_config_1.ChecklistDefinition; } });
|
|
183
183
|
Object.defineProperty(exports, "toChecklist", { enumerable: true, get: function () { return checklist_config_1.toChecklist; } });
|
|
184
|
-
|
|
185
|
-
Object.defineProperty(exports, "
|
|
186
|
-
Object.defineProperty(exports, "CHECKLIST_SEVERITIES", { enumerable: true, get: function () { return checklist_config_1.CHECKLIST_SEVERITIES; } });
|
|
184
|
+
var checklist_manifest_1 = require("./checklist-manifest");
|
|
185
|
+
Object.defineProperty(exports, "ChecklistManifestService", { enumerable: true, get: function () { return checklist_manifest_1.ChecklistManifestService; } });
|
|
187
186
|
var gate_token_1 = require("./gate-token");
|
|
188
187
|
Object.defineProperty(exports, "GateTokenService", { enumerable: true, get: function () { return gate_token_1.GateTokenService; } });
|
|
189
188
|
Object.defineProperty(exports, "computeGateToken", { enumerable: true, get: function () { return gate_token_1.computeGateToken; } });
|
|
@@ -198,14 +197,12 @@ Object.defineProperty(exports, "PROVENANCE_MISSING", { enumerable: true, get: fu
|
|
|
198
197
|
Object.defineProperty(exports, "PROVENANCE_SKIPPED", { enumerable: true, get: function () { return subagent_provenance_1.PROVENANCE_SKIPPED; } });
|
|
199
198
|
var review_json_1 = require("./review-json");
|
|
200
199
|
Object.defineProperty(exports, "ReviewJson", { enumerable: true, get: function () { return review_json_1.ReviewJson; } });
|
|
201
|
-
Object.defineProperty(exports, "ChecklistAck", { enumerable: true, get: function () { return review_json_1.ChecklistAck; } });
|
|
202
200
|
Object.defineProperty(exports, "ChecklistResult", { enumerable: true, get: function () { return review_json_1.ChecklistResult; } });
|
|
203
201
|
Object.defineProperty(exports, "ChecklistVerdict", { enumerable: true, get: function () { return review_json_1.ChecklistVerdict; } });
|
|
204
202
|
Object.defineProperty(exports, "CK_PASS", { enumerable: true, get: function () { return review_json_1.CK_PASS; } });
|
|
205
203
|
Object.defineProperty(exports, "CK_OVERRIDDEN", { enumerable: true, get: function () { return review_json_1.CK_OVERRIDDEN; } });
|
|
206
204
|
Object.defineProperty(exports, "CK_FAIL", { enumerable: true, get: function () { return review_json_1.CK_FAIL; } });
|
|
207
205
|
Object.defineProperty(exports, "CK_MISSING", { enumerable: true, get: function () { return review_json_1.CK_MISSING; } });
|
|
208
|
-
Object.defineProperty(exports, "CK_ACKED", { enumerable: true, get: function () { return review_json_1.CK_ACKED; } });
|
|
209
206
|
Object.defineProperty(exports, "RequiredChecklist", { enumerable: true, get: function () { return review_json_1.RequiredChecklist; } });
|
|
210
207
|
Object.defineProperty(exports, "ReviewJsonService", { enumerable: true, get: function () { return review_json_1.ReviewJsonService; } });
|
|
211
208
|
Object.defineProperty(exports, "loadReviewJson", { enumerable: true, get: function () { return review_json_1.loadReviewJson; } });
|
|
@@ -225,6 +222,7 @@ Object.defineProperty(exports, "readMainSyncLock", { enumerable: true, get: func
|
|
|
225
222
|
Object.defineProperty(exports, "writeMainSyncLock", { enumerable: true, get: function () { return main_sync_status_1.writeMainSyncLock; } });
|
|
226
223
|
Object.defineProperty(exports, "isLockStale", { enumerable: true, get: function () { return main_sync_status_1.isLockStale; } });
|
|
227
224
|
Object.defineProperty(exports, "isRefreshInProgress", { enumerable: true, get: function () { return main_sync_status_1.isRefreshInProgress; } });
|
|
225
|
+
Object.defineProperty(exports, "tryAcquireMainSyncLock", { enumerable: true, get: function () { return main_sync_status_1.tryAcquireMainSyncLock; } });
|
|
228
226
|
Object.defineProperty(exports, "inProcessLock", { enumerable: true, get: function () { return main_sync_status_1.inProcessLock; } });
|
|
229
227
|
Object.defineProperty(exports, "finishedLock", { enumerable: true, get: function () { return main_sync_status_1.finishedLock; } });
|
|
230
228
|
Object.defineProperty(exports, "computeMainSyncStatus", { enumerable: true, get: function () { return main_sync_status_1.computeMainSyncStatus; } });
|
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,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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,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, validateChecklists, 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 FeatureBranchGuardConfig,\n ReadStaleGuardConfig,\n MergedBranchBashGuardConfig,\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 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 CHECKLIST_BLOCK,\n CHECKLIST_WARN,\n CHECKLIST_SEVERITIES,\n} from './checklist-config';\nexport type { RawChecklist } from './checklist-config';\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 ChecklistAck,\n ChecklistResult,\n ChecklistVerdict,\n CK_PASS,\n CK_OVERRIDDEN,\n CK_FAIL,\n CK_MISSING,\n CK_ACKED,\n RequiredChecklist,\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 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,OAAA;AAC/D,2DAAoD;AAA3C,kHAAA,YAAY,OAAA;AACrB,iDAAiD;AAAxC,+GAAA,cAAc,OAAA;AACvB,iDAAgE;AAAvD,6GAAA,YAAY,OAAA;AAAE,gHAAA,eAAe,OAAA;AACtC,iDAAsG;AAA7F,6GAAA,YAAY,OAAA;AAAE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;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 FeatureBranchGuardConfig,\n ReadStaleGuardConfig,\n MergedBranchBashGuardConfig,\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 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} from './checklist-config';\nexport type { RawChecklistItem } from './checklist-config';\nexport { ChecklistManifestService } from './checklist-manifest';\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 ChecklistResult,\n ChecklistVerdict,\n CK_PASS,\n CK_OVERRIDDEN,\n CK_FAIL,\n CK_MISSING,\n RequiredChecklist,\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"]}
|