@webpieces/rules-config 0.4.838 → 0.4.840
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/hook-config-diagnostics.d.ts +19 -0
- package/src/hook-config-diagnostics.js +79 -0
- package/src/hook-config-diagnostics.js.map +1 -0
- package/src/hook-fault-codes.d.ts +85 -0
- package/src/hook-fault-codes.js +121 -0
- package/src/hook-fault-codes.js.map +1 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +3 -0
- package/src/index.js.map +1 -1
- package/templates/webpieces.branch-state-matrix.md +11 -11
- package/templates/webpieces.guard-matrix.md +10 -10
- package/templates/webpieces.location-matrix.md +13 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webpieces/rules-config",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.840",
|
|
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",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"inversify": "7.10.4",
|
|
19
19
|
"reflect-metadata": "0.2.2",
|
|
20
20
|
"minimatch": "10.0.1",
|
|
21
|
-
"@webpieces/tooling-common": "0.4.
|
|
22
|
-
"@webpieces/repo-workflow-core": "0.4.
|
|
21
|
+
"@webpieces/tooling-common": "0.4.840",
|
|
22
|
+
"@webpieces/repo-workflow-core": "0.4.840"
|
|
23
23
|
},
|
|
24
24
|
"author": "Dean Hiller",
|
|
25
25
|
"license": "Apache-2.0",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const READ_COMMANDS: ReadonlySet<string>;
|
|
2
|
+
export declare const CODEX_READ_CMD = "sed -n '1,240p' package.json";
|
|
3
|
+
export declare const WORKSPACE_MANIFEST = "pnpm-workspace.yaml";
|
|
4
|
+
export declare const PACKAGE_MANIFEST = "package.json";
|
|
5
|
+
export declare const MANIFEST_FILENAMES: ReadonlySet<string>;
|
|
6
|
+
export declare const CODEX_READ_STILL_ALLOWED: string;
|
|
7
|
+
export declare const CONFIG_MISSING_REPORT: string;
|
|
8
|
+
export declare const CONFIG_OUT_OF_SYNC_HEADER: string;
|
|
9
|
+
export declare const GUARD_MATRIX_DOC = "webpieces.guard-matrix.md";
|
|
10
|
+
export declare function writeGuardMatrixDoc(workspaceRoot: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* The `READ <path>` pointer appended to an L0 deny, or '' when the doc could not be written.
|
|
13
|
+
*
|
|
14
|
+
* It opens with a NEWLINE, not a space: the JS-side L0 denies render in the house format now (a header,
|
|
15
|
+
* a `[guard-name]` block, `Fix Option N:` lines), so a pointer glued onto the end of the last line would
|
|
16
|
+
* be the one place the shape broke. A real newline is safe on both call paths — denyJson() JSON.stringifies
|
|
17
|
+
* it, exactly as it does for every multi-line L1 report.
|
|
18
|
+
*/
|
|
19
|
+
export declare function guardMatrixPointer(docPath: string): string;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GUARD_MATRIX_DOC = exports.CONFIG_OUT_OF_SYNC_HEADER = exports.CONFIG_MISSING_REPORT = exports.CODEX_READ_STILL_ALLOWED = exports.MANIFEST_FILENAMES = exports.PACKAGE_MANIFEST = exports.WORKSPACE_MANIFEST = exports.CODEX_READ_CMD = exports.READ_COMMANDS = void 0;
|
|
4
|
+
exports.writeGuardMatrixDoc = writeGuardMatrixDoc;
|
|
5
|
+
exports.guardMatrixPointer = guardMatrixPointer;
|
|
6
|
+
const config_file_1 = require("./config-file");
|
|
7
|
+
exports.READ_COMMANDS = new Set(['cat', 'head', 'tail', 'less', 'more', 'bat']);
|
|
8
|
+
exports.CODEX_READ_CMD = "sed -n '1,240p' package.json";
|
|
9
|
+
const hook_fault_codes_1 = require("./hook-fault-codes");
|
|
10
|
+
exports.WORKSPACE_MANIFEST = 'pnpm-workspace.yaml';
|
|
11
|
+
exports.PACKAGE_MANIFEST = 'package.json';
|
|
12
|
+
exports.MANIFEST_FILENAMES = new Set([exports.WORKSPACE_MANIFEST, exports.PACKAGE_MANIFEST]);
|
|
13
|
+
exports.CODEX_READ_STILL_ALLOWED = `on CODEX (no Read tool): a bare read command - ${[...exports.READ_COMMANDS].join('/')} <file>, `
|
|
14
|
+
+ `or ${exports.CODEX_READ_CMD} - with nothing piped, redirected or chained onto it`;
|
|
15
|
+
exports.CONFIG_MISSING_REPORT = [
|
|
16
|
+
`❌ webpieces ai-hooks blocked this call: ${config_file_1.CONFIG_FILENAME} not found.`,
|
|
17
|
+
'',
|
|
18
|
+
(0, hook_fault_codes_1.l0GuardHeader)(hook_fault_codes_1.L0_FAULT_CONFIG_MISSING, '1 violation'),
|
|
19
|
+
` ${config_file_1.CONFIG_FILENAME}`,
|
|
20
|
+
' → the webpieces guards cannot run without it, so every OTHER tool call is blocked.',
|
|
21
|
+
` → ${(0, hook_fault_codes_1.l0MatrixCitation)(hook_fault_codes_1.L0_FAULT_CONFIG_MISSING)}`,
|
|
22
|
+
'',
|
|
23
|
+
'Still allowed while this block is up:',
|
|
24
|
+
` - any Read, and ${exports.CODEX_READ_STILL_ALLOWED}`,
|
|
25
|
+
` - any Write/Edit whose target is ${config_file_1.CONFIG_FILENAME}`,
|
|
26
|
+
' - every command on the L0 allowlist, including the Fix Options below',
|
|
27
|
+
' THIS IS NOT A DEADLOCK - run one YOURSELF now; do not hand it back to the human.',
|
|
28
|
+
'',
|
|
29
|
+
` Fix Option 1: (preferred) it needs no other tool and it never prompts - create ${config_file_1.CONFIG_FILENAME}`,
|
|
30
|
+
' yourself. The validator reports EVERY missing/invalid entry at once (each with the snippet to',
|
|
31
|
+
' paste), so a minimal first draft converges in about two passes.',
|
|
32
|
+
' Fix Option 2: pick this ONLY at an interactive terminal where you can answer its two prompts - it',
|
|
33
|
+
' goes on to wire the Claude Code hooks and asks for a target twice, which hangs a non-interactive',
|
|
34
|
+
' session.',
|
|
35
|
+
' run EXACTLY: `pnpm exec wp-install-ai-hooks`',
|
|
36
|
+
'',
|
|
37
|
+
'Do not append anything to the option you pick — the allowlist is anchored to the whole command.',
|
|
38
|
+
].join('\n');
|
|
39
|
+
// The HEADER of the fault-Y deny (built out in runner.checkConfigSync, which appends the per-rule
|
|
40
|
+
// detail as the `[…]` block's offenders). Kept here so the fault table quotes the same text the runner
|
|
41
|
+
// emits, and so Y opens with the same `[guard-name] (layer=L0 fault=Y row=3)` coordinates as every
|
|
42
|
+
// other L0 fault — that triple is what joins the deny to the audit line and to the matrix row.
|
|
43
|
+
exports.CONFIG_OUT_OF_SYNC_HEADER = [
|
|
44
|
+
`❌ webpieces ai-hooks blocked this call: ${config_file_1.CONFIG_FILENAME} is out of sync.`,
|
|
45
|
+
'',
|
|
46
|
+
(0, hook_fault_codes_1.l0GuardHeader)(hook_fault_codes_1.L0_FAULT_CONFIG_OUT_OF_SYNC, '1 violation'),
|
|
47
|
+
` new built-in rules are present that have no entry in ${config_file_1.CONFIG_FILENAME}`,
|
|
48
|
+
` → ${(0, hook_fault_codes_1.l0MatrixCitation)(hook_fault_codes_1.L0_FAULT_CONFIG_OUT_OF_SYNC)}`,
|
|
49
|
+
].join('\n');
|
|
50
|
+
const load_template_1 = require("./load-template");
|
|
51
|
+
const to_error_1 = require("@webpieces/tooling-common/to-error");
|
|
52
|
+
exports.GUARD_MATRIX_DOC = 'webpieces.guard-matrix.md';
|
|
53
|
+
// webpieces-disable no-function-outside-class -- shared best-effort configuration diagnostic template writer
|
|
54
|
+
function writeGuardMatrixDoc(workspaceRoot) {
|
|
55
|
+
// eslint-disable-next-line @webpieces/no-unmanaged-exceptions
|
|
56
|
+
try {
|
|
57
|
+
return (0, load_template_1.writeTemplate)(workspaceRoot, exports.GUARD_MATRIX_DOC);
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
const error = (0, to_error_1.toError)(err);
|
|
61
|
+
void error; // best-effort: no doc → the deny simply omits the pointer
|
|
62
|
+
return '';
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The `READ <path>` pointer appended to an L0 deny, or '' when the doc could not be written.
|
|
67
|
+
*
|
|
68
|
+
* It opens with a NEWLINE, not a space: the JS-side L0 denies render in the house format now (a header,
|
|
69
|
+
* a `[guard-name]` block, `Fix Option N:` lines), so a pointer glued onto the end of the last line would
|
|
70
|
+
* be the one place the shape broke. A real newline is safe on both call paths — denyJson() JSON.stringifies
|
|
71
|
+
* it, exactly as it does for every multi-line L1 report.
|
|
72
|
+
*/
|
|
73
|
+
// webpieces-disable no-function-outside-class -- sibling of writeGuardMatrixDoc in this module
|
|
74
|
+
function guardMatrixPointer(docPath) {
|
|
75
|
+
if (docPath === '')
|
|
76
|
+
return '';
|
|
77
|
+
return `\nThe full L0 guard matrix - every fault and everything that is allowed through - is at ${docPath}; READ it if you are unsure why this call was blocked.`;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=hook-config-diagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook-config-diagnostics.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/hook-config-diagnostics.ts"],"names":[],"mappings":";;;AAwDA,kDASC;AAWD,gDAGC;AA/ED,+CAAgD;AACnC,QAAA,aAAa,GAAwB,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;AAC7F,QAAA,cAAc,GAAG,8BAA8B,CAAC;AAC7D,yDAA2H;AAE9G,QAAA,kBAAkB,GAAG,qBAAqB,CAAC;AAC3C,QAAA,gBAAgB,GAAG,cAAc,CAAC;AAClC,QAAA,kBAAkB,GAAwB,IAAI,GAAG,CAAC,CAAC,0BA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EAAE,CAAC;QACpB,MAAM,KAAK,GAAG,IAAA,kBAAO,EAAC,GAAG,CAAC,CAAC;QAC3B,KAAK,KAAK,CAAC,CAAC,0DAA0D;QACtE,OAAO,EAAE,CAAC;IACd,CAAC;AACL,CAAC;AAED;;;;;;;GAOG;AACH,+FAA+F;AAC/F,SAAgB,kBAAkB,CAAC,OAAe;IAC9C,IAAI,OAAO,KAAK,EAAE;QAAE,OAAO,EAAE,CAAC;IAC9B,OAAO,2FAA2F,OAAO,wDAAwD,CAAC;AACtK,CAAC","sourcesContent":["import { CONFIG_FILENAME } from './config-file';\nexport const READ_COMMANDS: ReadonlySet<string> = new Set(['cat', 'head', 'tail', 'less', 'more', 'bat']);\nexport const CODEX_READ_CMD = \"sed -n '1,240p' package.json\";\nimport { L0_FAULT_CONFIG_MISSING, L0_FAULT_CONFIG_OUT_OF_SYNC, l0GuardHeader, l0MatrixCitation } from './hook-fault-codes';\n\nexport const WORKSPACE_MANIFEST = 'pnpm-workspace.yaml';\nexport const PACKAGE_MANIFEST = 'package.json';\nexport const MANIFEST_FILENAMES: ReadonlySet<string> = new Set([WORKSPACE_MANIFEST, PACKAGE_MANIFEST]);\n\nexport const CODEX_READ_STILL_ALLOWED =\n `on CODEX (no Read tool): a bare read command - ${[...READ_COMMANDS].join('/')} <file>, `\n + `or ${CODEX_READ_CMD} - with nothing piped, redirected or chained onto it`;\n\nexport const CONFIG_MISSING_REPORT = [\n `❌ webpieces ai-hooks blocked this call: ${CONFIG_FILENAME} not found.`,\n '',\n l0GuardHeader(L0_FAULT_CONFIG_MISSING, '1 violation'),\n ` ${CONFIG_FILENAME}`,\n ' → the webpieces guards cannot run without it, so every OTHER tool call is blocked.',\n ` → ${l0MatrixCitation(L0_FAULT_CONFIG_MISSING)}`,\n '',\n 'Still allowed while this block is up:',\n ` - any Read, and ${CODEX_READ_STILL_ALLOWED}`,\n ` - any Write/Edit whose target is ${CONFIG_FILENAME}`,\n ' - every command on the L0 allowlist, including the Fix Options below',\n ' THIS IS NOT A DEADLOCK - run one YOURSELF now; do not hand it back to the human.',\n '',\n ` Fix Option 1: (preferred) it needs no other tool and it never prompts - create ${CONFIG_FILENAME}`,\n ' yourself. The validator reports EVERY missing/invalid entry at once (each with the snippet to',\n ' paste), so a minimal first draft converges in about two passes.',\n ' Fix Option 2: pick this ONLY at an interactive terminal where you can answer its two prompts - it',\n ' goes on to wire the Claude Code hooks and asks for a target twice, which hangs a non-interactive',\n ' session.',\n ' run EXACTLY: `pnpm exec wp-install-ai-hooks`',\n '',\n 'Do not append anything to the option you pick — the allowlist is anchored to the whole command.',\n].join('\\n');\n\n// The HEADER of the fault-Y deny (built out in runner.checkConfigSync, which appends the per-rule\n// detail as the `[…]` block's offenders). Kept here so the fault table quotes the same text the runner\n// emits, and so Y opens with the same `[guard-name] (layer=L0 fault=Y row=3)` coordinates as every\n// other L0 fault — that triple is what joins the deny to the audit line and to the matrix row.\nexport const CONFIG_OUT_OF_SYNC_HEADER = [\n `❌ webpieces ai-hooks blocked this call: ${CONFIG_FILENAME} is out of sync.`,\n '',\n l0GuardHeader(L0_FAULT_CONFIG_OUT_OF_SYNC, '1 violation'),\n ` new built-in rules are present that have no entry in ${CONFIG_FILENAME}`,\n ` → ${l0MatrixCitation(L0_FAULT_CONFIG_OUT_OF_SYNC)}`,\n].join('\\n');\n\n\nimport { writeTemplate } from './load-template';\nimport { toError } from '@webpieces/tooling-common/to-error';\nexport const GUARD_MATRIX_DOC = 'webpieces.guard-matrix.md';\n\n// webpieces-disable no-function-outside-class -- shared best-effort configuration diagnostic template writer\nexport function writeGuardMatrixDoc(workspaceRoot: string): string {\n // eslint-disable-next-line @webpieces/no-unmanaged-exceptions\n try {\n return writeTemplate(workspaceRoot, GUARD_MATRIX_DOC);\n } catch (err: unknown) {\n const error = toError(err);\n void error; // best-effort: no doc → the deny simply omits the pointer\n return '';\n }\n}\n\n/**\n * The `READ <path>` pointer appended to an L0 deny, or '' when the doc could not be written.\n *\n * It opens with a NEWLINE, not a space: the JS-side L0 denies render in the house format now (a header,\n * a `[guard-name]` block, `Fix Option N:` lines), so a pointer glued onto the end of the last line would\n * be the one place the shape broke. A real newline is safe on both call paths — denyJson() JSON.stringifies\n * it, exactly as it does for every multi-line L1 report.\n */\n// webpieces-disable no-function-outside-class -- sibling of writeGuardMatrixDoc in this module\nexport function guardMatrixPointer(docPath: string): string {\n if (docPath === '') return '';\n return `\\nThe full L0 guard matrix - every fault and everything that is allowed through - is at ${docPath}; READ it if you are unsure why this call was blocked.`;\n}\n"]}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/** `D` — version drift: the root package.json pin != the installed version. Decided in `sh`. */
|
|
2
|
+
export declare const L0_FAULT_DRIFT = "D";
|
|
3
|
+
/** `X` — the guard bin is missing (fresh clone, new worktree, package removed). Decided in `sh`. */
|
|
4
|
+
export declare const L0_FAULT_BIN_MISSING = "X";
|
|
5
|
+
/** `U` — the bin is missing AND nothing declares the package, so an install is a no-op. `sh`. */
|
|
6
|
+
export declare const L0_FAULT_UNDECLARED = "U";
|
|
7
|
+
/** `K` — the bin is present but CRASHED (corrupt node_modules). Decided in `sh`. */
|
|
8
|
+
export declare const L0_FAULT_BIN_BROKEN = "K";
|
|
9
|
+
/** `S` — the committed `.claude/webpieces/ai-hook.sh` != `renderShim()`. Decided in the bin, in JS. */
|
|
10
|
+
export declare const L0_FAULT_SHIM_STALE = "S";
|
|
11
|
+
/** `C` — `webpieces.config.json` is missing. Decided in the bin, in JS. */
|
|
12
|
+
export declare const L0_FAULT_CONFIG_MISSING = "C";
|
|
13
|
+
/** `Y` — a loaded rule has no `webpieces.config.json` key. Decided in the bin, in JS. */
|
|
14
|
+
export declare const L0_FAULT_CONFIG_OUT_OF_SYNC = "Y";
|
|
15
|
+
/**
|
|
16
|
+
* No fault AT THIS LAYER — the value every audit line carries when nothing fired.
|
|
17
|
+
*
|
|
18
|
+
* Never a claim that nothing was wrong: a `fault=-` line from the `sh` shim only says the sh half found
|
|
19
|
+
* nothing, and the bin it then exec'd may still have blocked on S/C/Y and stamped its own line.
|
|
20
|
+
*/
|
|
21
|
+
export declare const L0_FAULT_NONE = "-";
|
|
22
|
+
/**
|
|
23
|
+
* The faults decided in POSIX `sh`, BEFORE the bin runs — a stale, missing or broken validator cannot
|
|
24
|
+
* be trusted to validate itself. In first-match-wins order.
|
|
25
|
+
*/
|
|
26
|
+
export declare const L0_SH_FAULT_CODES: readonly ["D", "X", "U", "K"];
|
|
27
|
+
/**
|
|
28
|
+
* The faults decided INSIDE the guard bin, in JS. These reached the audit trail with no fault label at
|
|
29
|
+
* all until the JS emitters started stamping them: an `S` storm that blocked an agent for ~20 tool
|
|
30
|
+
* calls left two lines in the `rejections/` stream, both attributed to a downstream rule, and nothing
|
|
31
|
+
* anywhere identifying L0.
|
|
32
|
+
*/
|
|
33
|
+
export declare const L0_JS_FAULT_CODES: readonly ["S", "C", "Y"];
|
|
34
|
+
/**
|
|
35
|
+
* EVERY L0 fault code, as a type. The two arrays above are the halves; this is their union, and it is
|
|
36
|
+
* what makes `L0_FAULT_NAMES` TOTAL — a `Record<string, …>` would have forced a `?? 'unknown'` fallback
|
|
37
|
+
* at every read, which is shim shape #4 (a runtime default standing in for a type that could have
|
|
38
|
+
* expressed the invariant). With the union, a new fault added without a name is a COMPILE error, and
|
|
39
|
+
* neither reader needs a defensive branch.
|
|
40
|
+
*/
|
|
41
|
+
export type L0FaultCode = typeof L0_SH_FAULT_CODES[number] | typeof L0_JS_FAULT_CODES[number];
|
|
42
|
+
/**
|
|
43
|
+
* The stable, human-readable GUARD NAME per fault code — what goes in the deny's `[…]` header, in the
|
|
44
|
+
* matrix doc's own `guard` column, and nowhere else in a second spelling.
|
|
45
|
+
*
|
|
46
|
+
* L1 prints `[stale-main-bash-guard] (1 violation)` and L0 printed nothing comparable; the names below
|
|
47
|
+
* are deliberately in that same kebab shape so the two layers read as one system. They are IDENTITY, not
|
|
48
|
+
* prose: renaming one silently breaks a grep that spans all three artifacts, exactly as renumbering an
|
|
49
|
+
* L1 row would (see L1_ROWS' header).
|
|
50
|
+
*/
|
|
51
|
+
export declare const L0_FAULT_NAMES: Readonly<Record<L0FaultCode, string>>;
|
|
52
|
+
/**
|
|
53
|
+
* The LAYER token — the other half of every join key, spelled once. The deny header, the matrix
|
|
54
|
+
* citation, the sh audit line and guards/L0-tooling.md all read it from here, so `grep layer=L0` cannot
|
|
55
|
+
* miss an artifact that typed the token itself.
|
|
56
|
+
*/
|
|
57
|
+
export declare const L0_LAYER = "L0";
|
|
58
|
+
/**
|
|
59
|
+
* The three rows of L0's decision matrix, by number — the numbers `renderGuardMatrixDoc` prints, the
|
|
60
|
+
* numbers the audit line's `row=` carries, and the numbers a deny cites. L0's matrix has no genuine
|
|
61
|
+
* second dimension: every branch reduces to `fault present?` x `on the allowlist?`.
|
|
62
|
+
*
|
|
63
|
+
* All three are named because all three are LOGGED: the sh half writes a line for the healthy hand-down
|
|
64
|
+
* too (`PASS-BIN-ALLOW`), which is the line that tells "the guard ran and found nothing" apart from
|
|
65
|
+
* "the guard never ran".
|
|
66
|
+
*/
|
|
67
|
+
export declare const L0_ROW_HANDED_DOWN = "1";
|
|
68
|
+
/** Row 2: a fault is present but the call is on the L0 allowlist — a cure, a Read, or the config edit. */
|
|
69
|
+
export declare const L0_ROW_ALLOWLISTED = "2";
|
|
70
|
+
/** Row 3: a fault is present and the call is NOT on the allowlist. The one row that ever BLOCKS. */
|
|
71
|
+
export declare const L0_ROW_BLOCKED = "3";
|
|
72
|
+
/**
|
|
73
|
+
* The `[guard-name] (layer=L0 fault=<code> row=<n>)` header every L0 deny opens with, after the ❌ line.
|
|
74
|
+
*
|
|
75
|
+
* ONE builder, called by the JS denies directly and interpolated into the POSIX-sh denies at render
|
|
76
|
+
* time by renderShim() — so the sh half cannot spell the coordinates differently from the JS half even
|
|
77
|
+
* though it cannot import anything at runtime. `detail` is the per-fault count that mirrors
|
|
78
|
+
* formatReport's `(N violations)`.
|
|
79
|
+
*/
|
|
80
|
+
export declare function l0GuardHeader(fault: L0FaultCode, detail: string): string;
|
|
81
|
+
/**
|
|
82
|
+
* The one-line citation of WHICH matrix row was taken and on what dimension values — L1's pattern
|
|
83
|
+
* (its deny cites "`w` / `n` / `n` - row 8"), in L0's own two columns.
|
|
84
|
+
*/
|
|
85
|
+
export declare function l0MatrixCitation(fault: L0FaultCode): string;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ---------------------------------------------------------------------------
|
|
3
|
+
// THE L0 FAULT CODEBOOK — one letter per fault, declared HERE and nowhere else.
|
|
4
|
+
//
|
|
5
|
+
// Both halves of L0 stamp `fault=<code>` onto their audit lines: the POSIX `sh` shim writes D/X/U/K
|
|
6
|
+
// (shim-audit-log.ts), and the guard bin writes S/C/Y in JS (decision-log.ts, via runner.ts and
|
|
7
|
+
// hook-core.ts). The whole value of that field is that ONE grep — `grep 'fault=S'` — spans the entire
|
|
8
|
+
// trail, and that the faults actually observed can be diffed against `L0_FAULTS`. Both properties hold
|
|
9
|
+
// only while every emitter spells the letters the SAME way, and a hand-retyped 'S' in one emitter is
|
|
10
|
+
// exactly the drift this module exists to make impossible.
|
|
11
|
+
//
|
|
12
|
+
// It used to be retyped: the shim assigned `WP_FAULT=X` as a literal, SHIM_LOG_FAULTS listed the four
|
|
13
|
+
// sh-side letters again, and L0_FAULTS listed all seven a third time. Three spellings of one
|
|
14
|
+
// vocabulary, held together by a unit test that could only notice AFTER they diverged.
|
|
15
|
+
//
|
|
16
|
+
// This module is a LEAF — no imports at all — on purpose. `l0-matrix.ts` (core) builds `L0_FAULTS`
|
|
17
|
+
// from these constants and `shim-audit-log.ts` / `shim.ts` (bin) render them into the shim; parking the
|
|
18
|
+
// constants in either of those two would make the other one a core↔bin import cycle. It also keeps the
|
|
19
|
+
// shim renderer dependency-light, which it must be: it has to work on a tree too broken to load the
|
|
20
|
+
// rule engine.
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.L0_ROW_BLOCKED = exports.L0_ROW_ALLOWLISTED = exports.L0_ROW_HANDED_DOWN = exports.L0_LAYER = exports.L0_FAULT_NAMES = exports.L0_JS_FAULT_CODES = exports.L0_SH_FAULT_CODES = exports.L0_FAULT_NONE = exports.L0_FAULT_CONFIG_OUT_OF_SYNC = exports.L0_FAULT_CONFIG_MISSING = exports.L0_FAULT_SHIM_STALE = exports.L0_FAULT_BIN_BROKEN = exports.L0_FAULT_UNDECLARED = exports.L0_FAULT_BIN_MISSING = exports.L0_FAULT_DRIFT = void 0;
|
|
24
|
+
exports.l0GuardHeader = l0GuardHeader;
|
|
25
|
+
exports.l0MatrixCitation = l0MatrixCitation;
|
|
26
|
+
/** `D` — version drift: the root package.json pin != the installed version. Decided in `sh`. */
|
|
27
|
+
exports.L0_FAULT_DRIFT = 'D';
|
|
28
|
+
/** `X` — the guard bin is missing (fresh clone, new worktree, package removed). Decided in `sh`. */
|
|
29
|
+
exports.L0_FAULT_BIN_MISSING = 'X';
|
|
30
|
+
/** `U` — the bin is missing AND nothing declares the package, so an install is a no-op. `sh`. */
|
|
31
|
+
exports.L0_FAULT_UNDECLARED = 'U';
|
|
32
|
+
/** `K` — the bin is present but CRASHED (corrupt node_modules). Decided in `sh`. */
|
|
33
|
+
exports.L0_FAULT_BIN_BROKEN = 'K';
|
|
34
|
+
/** `S` — the committed `.claude/webpieces/ai-hook.sh` != `renderShim()`. Decided in the bin, in JS. */
|
|
35
|
+
exports.L0_FAULT_SHIM_STALE = 'S';
|
|
36
|
+
/** `C` — `webpieces.config.json` is missing. Decided in the bin, in JS. */
|
|
37
|
+
exports.L0_FAULT_CONFIG_MISSING = 'C';
|
|
38
|
+
/** `Y` — a loaded rule has no `webpieces.config.json` key. Decided in the bin, in JS. */
|
|
39
|
+
exports.L0_FAULT_CONFIG_OUT_OF_SYNC = 'Y';
|
|
40
|
+
/**
|
|
41
|
+
* No fault AT THIS LAYER — the value every audit line carries when nothing fired.
|
|
42
|
+
*
|
|
43
|
+
* Never a claim that nothing was wrong: a `fault=-` line from the `sh` shim only says the sh half found
|
|
44
|
+
* nothing, and the bin it then exec'd may still have blocked on S/C/Y and stamped its own line.
|
|
45
|
+
*/
|
|
46
|
+
exports.L0_FAULT_NONE = '-';
|
|
47
|
+
/**
|
|
48
|
+
* The faults decided in POSIX `sh`, BEFORE the bin runs — a stale, missing or broken validator cannot
|
|
49
|
+
* be trusted to validate itself. In first-match-wins order.
|
|
50
|
+
*/
|
|
51
|
+
exports.L0_SH_FAULT_CODES = [
|
|
52
|
+
exports.L0_FAULT_DRIFT, exports.L0_FAULT_BIN_MISSING, exports.L0_FAULT_UNDECLARED, exports.L0_FAULT_BIN_BROKEN,
|
|
53
|
+
];
|
|
54
|
+
/**
|
|
55
|
+
* The faults decided INSIDE the guard bin, in JS. These reached the audit trail with no fault label at
|
|
56
|
+
* all until the JS emitters started stamping them: an `S` storm that blocked an agent for ~20 tool
|
|
57
|
+
* calls left two lines in the `rejections/` stream, both attributed to a downstream rule, and nothing
|
|
58
|
+
* anywhere identifying L0.
|
|
59
|
+
*/
|
|
60
|
+
exports.L0_JS_FAULT_CODES = [
|
|
61
|
+
exports.L0_FAULT_SHIM_STALE, exports.L0_FAULT_CONFIG_MISSING, exports.L0_FAULT_CONFIG_OUT_OF_SYNC,
|
|
62
|
+
];
|
|
63
|
+
/**
|
|
64
|
+
* The stable, human-readable GUARD NAME per fault code — what goes in the deny's `[…]` header, in the
|
|
65
|
+
* matrix doc's own `guard` column, and nowhere else in a second spelling.
|
|
66
|
+
*
|
|
67
|
+
* L1 prints `[stale-main-bash-guard] (1 violation)` and L0 printed nothing comparable; the names below
|
|
68
|
+
* are deliberately in that same kebab shape so the two layers read as one system. They are IDENTITY, not
|
|
69
|
+
* prose: renaming one silently breaks a grep that spans all three artifacts, exactly as renumbering an
|
|
70
|
+
* L1 row would (see L1_ROWS' header).
|
|
71
|
+
*/
|
|
72
|
+
exports.L0_FAULT_NAMES = {
|
|
73
|
+
[exports.L0_FAULT_DRIFT]: 'version-drift',
|
|
74
|
+
[exports.L0_FAULT_BIN_MISSING]: 'guard-bin-missing',
|
|
75
|
+
[exports.L0_FAULT_UNDECLARED]: 'guard-pkg-undeclared',
|
|
76
|
+
[exports.L0_FAULT_BIN_BROKEN]: 'guard-bin-crashed',
|
|
77
|
+
[exports.L0_FAULT_SHIM_STALE]: 'managed-hook-surface',
|
|
78
|
+
[exports.L0_FAULT_CONFIG_MISSING]: 'config-missing',
|
|
79
|
+
[exports.L0_FAULT_CONFIG_OUT_OF_SYNC]: 'config-out-of-sync',
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* The LAYER token — the other half of every join key, spelled once. The deny header, the matrix
|
|
83
|
+
* citation, the sh audit line and guards/L0-tooling.md all read it from here, so `grep layer=L0` cannot
|
|
84
|
+
* miss an artifact that typed the token itself.
|
|
85
|
+
*/
|
|
86
|
+
exports.L0_LAYER = 'L0';
|
|
87
|
+
/**
|
|
88
|
+
* The three rows of L0's decision matrix, by number — the numbers `renderGuardMatrixDoc` prints, the
|
|
89
|
+
* numbers the audit line's `row=` carries, and the numbers a deny cites. L0's matrix has no genuine
|
|
90
|
+
* second dimension: every branch reduces to `fault present?` x `on the allowlist?`.
|
|
91
|
+
*
|
|
92
|
+
* All three are named because all three are LOGGED: the sh half writes a line for the healthy hand-down
|
|
93
|
+
* too (`PASS-BIN-ALLOW`), which is the line that tells "the guard ran and found nothing" apart from
|
|
94
|
+
* "the guard never ran".
|
|
95
|
+
*/
|
|
96
|
+
exports.L0_ROW_HANDED_DOWN = '1';
|
|
97
|
+
/** Row 2: a fault is present but the call is on the L0 allowlist — a cure, a Read, or the config edit. */
|
|
98
|
+
exports.L0_ROW_ALLOWLISTED = '2';
|
|
99
|
+
/** Row 3: a fault is present and the call is NOT on the allowlist. The one row that ever BLOCKS. */
|
|
100
|
+
exports.L0_ROW_BLOCKED = '3';
|
|
101
|
+
/**
|
|
102
|
+
* The `[guard-name] (layer=L0 fault=<code> row=<n>)` header every L0 deny opens with, after the ❌ line.
|
|
103
|
+
*
|
|
104
|
+
* ONE builder, called by the JS denies directly and interpolated into the POSIX-sh denies at render
|
|
105
|
+
* time by renderShim() — so the sh half cannot spell the coordinates differently from the JS half even
|
|
106
|
+
* though it cannot import anything at runtime. `detail` is the per-fault count that mirrors
|
|
107
|
+
* formatReport's `(N violations)`.
|
|
108
|
+
*/
|
|
109
|
+
// webpieces-disable no-function-outside-class -- pure string builder over this leaf module's own constants; it must stay importable by the dependency-free shim renderer.
|
|
110
|
+
function l0GuardHeader(fault, detail) {
|
|
111
|
+
return `[${exports.L0_FAULT_NAMES[fault]}] (layer=${exports.L0_LAYER} fault=${fault} row=${exports.L0_ROW_BLOCKED}, ${detail})`;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* The one-line citation of WHICH matrix row was taken and on what dimension values — L1's pattern
|
|
115
|
+
* (its deny cites "`w` / `n` / `n` - row 8"), in L0's own two columns.
|
|
116
|
+
*/
|
|
117
|
+
// webpieces-disable no-function-outside-class -- sibling of l0GuardHeader in this leaf codebook module.
|
|
118
|
+
function l0MatrixCitation(fault) {
|
|
119
|
+
return `matrix row ${exports.L0_ROW_BLOCKED}: fault=${fault} present / on the allowlist? no -> BLOCK. Those are the same coordinates the audit line carries (layer=${exports.L0_LAYER} row=${exports.L0_ROW_BLOCKED} fault=${fault}) and the same row webpieces.guard-matrix.md prints.`;
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=hook-fault-codes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook-fault-codes.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/hook-fault-codes.ts"],"names":[],"mappings":";AAAA,8EAA8E;AAC9E,gFAAgF;AAChF,EAAE;AACF,oGAAoG;AACpG,gGAAgG;AAChG,sGAAsG;AACtG,uGAAuG;AACvG,qGAAqG;AACrG,2DAA2D;AAC3D,EAAE;AACF,sGA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AAkB,GAAG,GAAG,CAAC;AAEtC,0GAA0G;AAC7F,QAAA,kBAAkB,GAAG,GAAG,CAAC;AAEtC,oGAAoG;AACvF,QAAA,cAAc,GAAG,GAAG,CAAC;AAElC;;;;;;;GAOG;AACH,0KAA0K;AAC1K,SAAgB,aAAa,CAAC,KAAkB,EAAE,MAAc;IAC5D,OAAO,IAAI,sBAAc,CAAC,KAAK,CAAC,YAAY,gBAAQ,UAAU,KAAK,QAAQ,sBAAc,KAAK,MAAM,GAAG,CAAC;AAC5G,CAAC;AAED;;;GAGG;AACH,wGAAwG;AACxG,SAAgB,gBAAgB,CAAC,KAAkB;IAC/C,OAAO,cAAc,sBAAc,WAAW,KAAK,0GAA0G,gBAAQ,QAAQ,sBAAc,UAAU,KAAK,sDAAsD,CAAC;AACrQ,CAAC","sourcesContent":["// ---------------------------------------------------------------------------\n// THE L0 FAULT CODEBOOK — one letter per fault, declared HERE and nowhere else.\n//\n// Both halves of L0 stamp `fault=<code>` onto their audit lines: the POSIX `sh` shim writes D/X/U/K\n// (shim-audit-log.ts), and the guard bin writes S/C/Y in JS (decision-log.ts, via runner.ts and\n// hook-core.ts). The whole value of that field is that ONE grep — `grep 'fault=S'` — spans the entire\n// trail, and that the faults actually observed can be diffed against `L0_FAULTS`. Both properties hold\n// only while every emitter spells the letters the SAME way, and a hand-retyped 'S' in one emitter is\n// exactly the drift this module exists to make impossible.\n//\n// It used to be retyped: the shim assigned `WP_FAULT=X` as a literal, SHIM_LOG_FAULTS listed the four\n// sh-side letters again, and L0_FAULTS listed all seven a third time. Three spellings of one\n// vocabulary, held together by a unit test that could only notice AFTER they diverged.\n//\n// This module is a LEAF — no imports at all — on purpose. `l0-matrix.ts` (core) builds `L0_FAULTS`\n// from these constants and `shim-audit-log.ts` / `shim.ts` (bin) render them into the shim; parking the\n// constants in either of those two would make the other one a core↔bin import cycle. It also keeps the\n// shim renderer dependency-light, which it must be: it has to work on a tree too broken to load the\n// rule engine.\n// ---------------------------------------------------------------------------\n\n/** `D` — version drift: the root package.json pin != the installed version. Decided in `sh`. */\nexport const L0_FAULT_DRIFT = 'D';\n\n/** `X` — the guard bin is missing (fresh clone, new worktree, package removed). Decided in `sh`. */\nexport const L0_FAULT_BIN_MISSING = 'X';\n\n/** `U` — the bin is missing AND nothing declares the package, so an install is a no-op. `sh`. */\nexport const L0_FAULT_UNDECLARED = 'U';\n\n/** `K` — the bin is present but CRASHED (corrupt node_modules). Decided in `sh`. */\nexport const L0_FAULT_BIN_BROKEN = 'K';\n\n/** `S` — the committed `.claude/webpieces/ai-hook.sh` != `renderShim()`. Decided in the bin, in JS. */\nexport const L0_FAULT_SHIM_STALE = 'S';\n\n/** `C` — `webpieces.config.json` is missing. Decided in the bin, in JS. */\nexport const L0_FAULT_CONFIG_MISSING = 'C';\n\n/** `Y` — a loaded rule has no `webpieces.config.json` key. Decided in the bin, in JS. */\nexport const L0_FAULT_CONFIG_OUT_OF_SYNC = 'Y';\n\n/**\n * No fault AT THIS LAYER — the value every audit line carries when nothing fired.\n *\n * Never a claim that nothing was wrong: a `fault=-` line from the `sh` shim only says the sh half found\n * nothing, and the bin it then exec'd may still have blocked on S/C/Y and stamped its own line.\n */\nexport const L0_FAULT_NONE = '-';\n\n/**\n * The faults decided in POSIX `sh`, BEFORE the bin runs — a stale, missing or broken validator cannot\n * be trusted to validate itself. In first-match-wins order.\n */\nexport const L0_SH_FAULT_CODES = [\n L0_FAULT_DRIFT, L0_FAULT_BIN_MISSING, L0_FAULT_UNDECLARED, L0_FAULT_BIN_BROKEN,\n] as const;\n\n/**\n * The faults decided INSIDE the guard bin, in JS. These reached the audit trail with no fault label at\n * all until the JS emitters started stamping them: an `S` storm that blocked an agent for ~20 tool\n * calls left two lines in the `rejections/` stream, both attributed to a downstream rule, and nothing\n * anywhere identifying L0.\n */\nexport const L0_JS_FAULT_CODES = [\n L0_FAULT_SHIM_STALE, L0_FAULT_CONFIG_MISSING, L0_FAULT_CONFIG_OUT_OF_SYNC,\n] as const;\n\n// ---------------------------------------------------------------------------\n// THE JOIN KEYS — the three artifacts that describe one L0 event, and the coordinates that line them up.\n//\n// There are three, and until now they could not be grepped together:\n// 1. THE DENY the agent reads in the moment (shim-deny-reason.ts for S; DENY_REASON_SH for D/X/U/K)\n// 2. THE AUDIT LINE (`.webpieces/logs/**`), which carries `layer=` `row=` `fault=`\n// 3. THE MATRIX DOC (webpieces.guard-matrix.md, rendered from L0_FAULTS + L0_ALLOWLIST)\n//\n// The deny had NONE of them: no fault letter, no row, and — the highest-value omission — no guard NAME,\n// while every L1/L2 deny opens `[<rule-name>] (N violations)`. So a transcript could not be debugged\n// against the log after the fact, and a reader could not find the matrix row by eye.\n//\n// These constants are that vocabulary, declared HERE for the same reason the letters are: this module is\n// a LEAF with no imports, so `core/l0-matrix.ts` (the doc), `bin/shim*.ts` (the denies) and\n// `core/decision-log.ts` (the log) can all reach it without an import cycle. Retyping a name in any one\n// of them is the drift this file exists to make impossible.\n// ---------------------------------------------------------------------------\n\n/**\n * EVERY L0 fault code, as a type. The two arrays above are the halves; this is their union, and it is\n * what makes `L0_FAULT_NAMES` TOTAL — a `Record<string, …>` would have forced a `?? 'unknown'` fallback\n * at every read, which is shim shape #4 (a runtime default standing in for a type that could have\n * expressed the invariant). With the union, a new fault added without a name is a COMPILE error, and\n * neither reader needs a defensive branch.\n */\nexport type L0FaultCode = typeof L0_SH_FAULT_CODES[number] | typeof L0_JS_FAULT_CODES[number];\n\n/**\n * The stable, human-readable GUARD NAME per fault code — what goes in the deny's `[…]` header, in the\n * matrix doc's own `guard` column, and nowhere else in a second spelling.\n *\n * L1 prints `[stale-main-bash-guard] (1 violation)` and L0 printed nothing comparable; the names below\n * are deliberately in that same kebab shape so the two layers read as one system. They are IDENTITY, not\n * prose: renaming one silently breaks a grep that spans all three artifacts, exactly as renumbering an\n * L1 row would (see L1_ROWS' header).\n */\nexport const L0_FAULT_NAMES: Readonly<Record<L0FaultCode, string>> = {\n [L0_FAULT_DRIFT]: 'version-drift',\n [L0_FAULT_BIN_MISSING]: 'guard-bin-missing',\n [L0_FAULT_UNDECLARED]: 'guard-pkg-undeclared',\n [L0_FAULT_BIN_BROKEN]: 'guard-bin-crashed',\n [L0_FAULT_SHIM_STALE]: 'managed-hook-surface',\n [L0_FAULT_CONFIG_MISSING]: 'config-missing',\n [L0_FAULT_CONFIG_OUT_OF_SYNC]: 'config-out-of-sync',\n};\n\n/**\n * The LAYER token — the other half of every join key, spelled once. The deny header, the matrix\n * citation, the sh audit line and guards/L0-tooling.md all read it from here, so `grep layer=L0` cannot\n * miss an artifact that typed the token itself.\n */\nexport const L0_LAYER = 'L0';\n\n/**\n * The three rows of L0's decision matrix, by number — the numbers `renderGuardMatrixDoc` prints, the\n * numbers the audit line's `row=` carries, and the numbers a deny cites. L0's matrix has no genuine\n * second dimension: every branch reduces to `fault present?` x `on the allowlist?`.\n *\n * All three are named because all three are LOGGED: the sh half writes a line for the healthy hand-down\n * too (`PASS-BIN-ALLOW`), which is the line that tells \"the guard ran and found nothing\" apart from\n * \"the guard never ran\".\n */\nexport const L0_ROW_HANDED_DOWN = '1';\n\n/** Row 2: a fault is present but the call is on the L0 allowlist — a cure, a Read, or the config edit. */\nexport const L0_ROW_ALLOWLISTED = '2';\n\n/** Row 3: a fault is present and the call is NOT on the allowlist. The one row that ever BLOCKS. */\nexport const L0_ROW_BLOCKED = '3';\n\n/**\n * The `[guard-name] (layer=L0 fault=<code> row=<n>)` header every L0 deny opens with, after the ❌ line.\n *\n * ONE builder, called by the JS denies directly and interpolated into the POSIX-sh denies at render\n * time by renderShim() — so the sh half cannot spell the coordinates differently from the JS half even\n * though it cannot import anything at runtime. `detail` is the per-fault count that mirrors\n * formatReport's `(N violations)`.\n */\n// webpieces-disable no-function-outside-class -- pure string builder over this leaf module's own constants; it must stay importable by the dependency-free shim renderer.\nexport function l0GuardHeader(fault: L0FaultCode, detail: string): string {\n return `[${L0_FAULT_NAMES[fault]}] (layer=${L0_LAYER} fault=${fault} row=${L0_ROW_BLOCKED}, ${detail})`;\n}\n\n/**\n * The one-line citation of WHICH matrix row was taken and on what dimension values — L1's pattern\n * (its deny cites \"`w` / `n` / `n` - row 8\"), in L0's own two columns.\n */\n// webpieces-disable no-function-outside-class -- sibling of l0GuardHeader in this leaf codebook module.\nexport function l0MatrixCitation(fault: L0FaultCode): string {\n return `matrix row ${L0_ROW_BLOCKED}: fault=${fault} present / on the allowlist? no -> BLOCK. Those are the same coordinates the audit line carries (layer=${L0_LAYER} row=${L0_ROW_BLOCKED} fault=${fault}) and the same row webpieces.guard-matrix.md prints.`;\n}\n"]}
|
package/src/index.d.ts
CHANGED
|
@@ -77,3 +77,5 @@ export { StaleBinRemoval, StaleBinSweeper, staleBinSweeper } from './stale-bin-s
|
|
|
77
77
|
export { SpecTempDirs, specTempDirs } from './spec-temp-dirs';
|
|
78
78
|
export { RepoScratchDirs, SCRATCH_DIR_NAME } from './repo-scratch-dirs';
|
|
79
79
|
export { TmpScratchSweeper, TMP_SCRATCH_RETENTION_DAYS, TMP_SCRATCH_PREFIX } from './tmp-scratch-sweep';
|
|
80
|
+
export * from './hook-fault-codes';
|
|
81
|
+
export * from './hook-config-diagnostics';
|
package/src/index.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.RoleTagConfig = exports.FrameworkTagConfig = exports.InjectAnnotationNot
|
|
|
7
7
|
exports.DEFAULT_TEMPLATE_DIRS = exports.NoStatePathsInTemplatesConfig = exports.CLIENT_CREATION_SEVERITIES = exports.NoClientCreationOutsideServerOrClientConfig = exports.VALIDATE_TS_MODES = exports.STRUCTURAL_MODES = exports.ON_OFF_MODES = exports.THROW_CAUSE_MODES = exports.DIRECT_API_RESOLVER_MODES = exports.PRISMA_CONVERTER_MODES = exports.PRISMA_DTOS_MODES = exports.PROJECT_MODES = exports.MODIFIED_CODE_MODES = exports.INLINE_TYPE_MODES = exports.RETURN_TYPE_MODES = exports.FILE_LIMIT_MODES = exports.METHOD_LIMIT_MODES = exports.API_DOC_MODES = exports.ApiRulesForOpenApiConfig = exports.ApiRulesForMcpConfig = exports.PROJECT_SCAN_MODES = exports.FrameworkTsconfigConfig = exports.FrameworkPackagesEntry = exports.FrameworkPackagesConfig = exports.FrameworkFolderEntry = exports.FrameworkFolderConfig = exports.ApiLibPathConfig = exports.ApiLibDependenciesConfig = exports.ApiClientPackagesEntry = exports.RequiredTypeSuffixEntry = exports.RequiredTypeSuffixConfig = exports.NoUtilityTypesInApiLibConfig = exports.OneEnumSpellingInApiLibConfig = exports.NoInlineImportInApiLibConfig = exports.NoRootUnionApiTypeConfig = exports.BaseRuleConfig = exports.ValidateEslintSyncConfig = exports.ValidateVersionsLockedConfig = exports.ValidatePackageJsonConfig = exports.ValidateNoArchitectureCyclesConfig = exports.ValidateArchitectureUnchangedConfig = exports.ValidateTsInSrcConfig = exports.NoJsFilesConfig = exports.DiGraphConfig = exports.NxWiringConfig = exports.RuntimeArchitectureConfig = exports.NoFileImportCyclesConfig = exports.PrLifecycleGuardConfig = exports.BranchCreationGuardConfig = exports.EnsureWeAreSecureConfig = void 0;
|
|
8
8
|
exports.PROVENANCE_SKIPPED = exports.PROVENANCE_MISSING = exports.PROVENANCE_OK = exports.ProvenanceResult = exports.TranscriptScan = exports.ExpectedReviewer = exports.ReviewerContext = exports.ReviewerEvidence = exports.SubagentProvenanceService = exports.verifyGateToken = exports.extractGateToken = exports.gateTokenMarker = exports.computeGateToken = exports.GateTokenService = exports.ALL_DIFF_ONE_READ_LINES = exports.READ_TRUNCATION_LINES = exports.ContextEntry = exports.BriefedFile = exports.ReviewerBriefing = exports.ReviewerInstructionsService = exports.ChecklistInstructionsService = exports.ChecklistValidator = exports.formatFileList = exports.normalizeChecklistDoc = exports.toChecklist = exports.DEFAULT_REVIEWER_AGENT_NAME = exports.REVIEWER_AGENTS_PLACEHOLDER = exports.ReviewerAgentPolicy = exports.ChecklistDefinition = exports.MERGE_MODES = exports.MERGE_MODE_NONE = exports.MERGE_MODE_AUTO = exports.buildDevDeployConfig = exports.buildLandPrConfig = exports.buildPrGateConfig = exports.defaultDevDeployConfig = exports.defaultLandPrConfig = exports.defaultPrGateConfig = exports.defaultGates = exports.ReviewContextEntry = exports.DEFAULT_DEV_BRANCH = exports.DEFAULT_DEV_BRANCH_NAMESPACE = exports.DevDeployConfig = exports.LandPrConfig = exports.DEFAULT_BUILD_COMMAND = exports.PrGateConfig = exports.GateDefinition = exports.DEFAULT_MAX_COMMITS_BEHIND = exports.BranchStateGuardConfig = exports.DEFAULT_BANNED_STATE_PATH_PREFIXES = void 0;
|
|
9
9
|
exports.TMP_SCRATCH_PREFIX = exports.TMP_SCRATCH_RETENTION_DAYS = exports.TmpScratchSweeper = exports.SCRATCH_DIR_NAME = exports.RepoScratchDirs = exports.specTempDirs = exports.SpecTempDirs = exports.staleBinSweeper = exports.StaleBinSweeper = exports.StaleBinRemoval = exports.DEFAULT_MERGE_COMPLETE_COMMAND = exports.DEFAULT_UPSERT_PR_COMMAND = exports.buildCommandsConfig = exports.CommandsConfig = exports.summaryJsonSchemaHint = exports.summaryJsonPath = exports.prDirFor = exports.ReviewJsonService = exports.ChecklistReviewContext = exports.RequiredChecklist = exports.VERDICT_STATUSES = exports.VERDICT_RED = exports.VERDICT_ORANGE = exports.VERDICT_YELLOW = exports.VERDICT_GREEN = exports.CK_BAD_FORMAT = exports.CK_MISSING = exports.CK_FAIL = exports.CK_ORANGE = exports.CK_ORANGE_FIXED = exports.CK_OVERRIDDEN = exports.CK_WARN = exports.CK_PASS = exports.checklistOverrideService = exports.ChecklistOverrideService = exports.ChecklistOverride = exports.ChecklistVerdict = exports.ChecklistResult = exports.PrContext = exports.PrSummary = exports.DEFAULT_RETENTION_DAYS = exports.ProvenanceWriteRequest = exports.OfferedContext = exports.ReviewerPaths = exports.ReviewerTranscript = exports.ReviewProvenance = exports.ReviewProvenanceService = void 0;
|
|
10
|
+
const tslib_1 = require("tslib");
|
|
10
11
|
var types_1 = require("./types");
|
|
11
12
|
Object.defineProperty(exports, "ResolvedConfig", { enumerable: true, get: function () { return types_1.ResolvedConfig; } });
|
|
12
13
|
Object.defineProperty(exports, "ResolvedRuleConfig", { enumerable: true, get: function () { return types_1.ResolvedRuleConfig; } });
|
|
@@ -470,4 +471,6 @@ var tmp_scratch_sweep_1 = require("./tmp-scratch-sweep");
|
|
|
470
471
|
Object.defineProperty(exports, "TmpScratchSweeper", { enumerable: true, get: function () { return tmp_scratch_sweep_1.TmpScratchSweeper; } });
|
|
471
472
|
Object.defineProperty(exports, "TMP_SCRATCH_RETENTION_DAYS", { enumerable: true, get: function () { return tmp_scratch_sweep_1.TMP_SCRATCH_RETENTION_DAYS; } });
|
|
472
473
|
Object.defineProperty(exports, "TMP_SCRATCH_PREFIX", { enumerable: true, get: function () { return tmp_scratch_sweep_1.TMP_SCRATCH_PREFIX; } });
|
|
474
|
+
tslib_1.__exportStar(require("./hook-fault-codes"), exports);
|
|
475
|
+
tslib_1.__exportStar(require("./hook-config-diagnostics"), exports);
|
|
473
476
|
//# sourceMappingURL=index.js.map
|
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;AAE3C,qDAA+F;AAAtF,gHAAA,aAAa,OAAA;AAAE,sHAAA,mBAAmB,OAAA;AAAE,yHAAA,sBAAsB,OAAA;AACnE,uGAAuG;AACvG,sFAAsF;AACtF,2CAAwD;AAA/C,oGAAA,MAAM,OAAA;AAAE,8GAAA,gBAAgB,OAAA;AACjC,mDAAgD;AAAvC,8GAAA,YAAY,OAAA;AACrB,uCAAiF;AAAxE,oGAAA,QAAQ,OAAA;AAAE,mGAAA,OAAO,OAAA;AAAE,qGAAA,SAAS,OAAA;AAAE,wGAAA,YAAY,OAAA;AAAE,mGAAA,OAAO,OAAA;AAC5D,uCAAqC;AAA5B,mGAAA,O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,OAAA;AACb,6GAAA,cAAc,OAAA;AACd,6GAAA,cAAc,OAAA;AACd,0GAAA,WAAW,OAAA;AACX,+GAAA,gBAAgB,OAAA;AAChB,gHAAA,iBAAiB,OAAA;AACjB,qHAAA,sBAAsB,OAAA;AACtB,gHAAA,iBAAiB,OAAA;AACjB,uGAAA,QAAQ,OAAA;AACR,8GAAA,eAAe,OAAA;AACf,oHAAA,qBAAqB,OAAA;AAczB,qDAK2B;AAJvB,iHAAA,cAAc,OAAA;AACd,sHAAA,mBAAmB,OAAA;AACnB,4HAAA,yBAAyB,OAAA;AACzB,iIAAA,8BAA8B,OAAA;AAElC,qDAAsF;AAA7E,kHAAA,eAAe,OAAA;AAAE,kHAAA,eAAe,OAAA;AAAE,kHAAA,eAAe,OAAA;AAC1D,mDAA8D;AAArD,8GAAA,YAAY,OAAA;AAAE,8GAAA,YAAY,OAAA;AACnC,yDAAwE;AAA/D,oHAAA,eAAe,OAAA;AAAE,qHAAA,gBAAgB,OAAA;AAC1C,yDAAwG;AAA/F,sHAAA,iBAAiB,OAAA;AAAE,+HAAA,0BAA0B,OAAA;AAAE,uHAAA,kBAAkB,OAAA","sourcesContent":["export { ResolvedConfig, ResolvedRuleConfig, RuleOptions } from './types';\n\nexport { RuleFailError, renderRuleFailForAi, renderRuleFailForHuman } from './rule-fail-error';\n// THE one representation of a cure, shared by RuleFailError (build-time) and FixHint (edit-time), plus\n// the one renderer that owns the \"Fix Option N:\" numbering and the \"(preferred)\" tag.\nexport { Option, formatFixOptions } from './fix-option';\nexport { CliExitError } from './cli-exit-error';\nexport { CliUsage, CliFlag, CliArgSet, CliArgsCheck, CliArgs } from './cli-args';\nexport { runMain } from './run-main';\n\nexport { loadAndValidate, LoadedConfig, ConfigLoader } from './load-config';\n// The validation-failure banner: ONE cure (edit the file), plus the marker phrases the validator\n// messages embed rather than re-type.\nexport {\n formatConfigErrorsBanner,\n CONFIG_POLICY_DOC,\n RETIRED_KEY_MARKER,\n RETIRED_TOP_LEVEL_MARKER,\n SECTION_PLACEMENT_MARKER,\n} from './config-error-banner';\nexport {\n findConfigFile,\n CONFIG_FILENAME,\n ConfigFile,\n ConfigParseAttempt,\n CONFIG_PARSE_ATTEMPTS,\n CONFIG_PARSE_RETRY_MILLIS,\n} from './config-file';\n// The PARSED-BUT-UNVALIDATED config shape. Exported for readers that walk the file generically rather\n// than through the typed config (the pr-gate active-hatch dashboard section reads every rule's hatches).\nexport type { RawConfigFile } from './config-file';\nexport { RepoRootFinder, INSTRUCT_AI_DIR, INSTRUCT_AI_LEAF } from './repo-root';\n// The scoped `.webpieces` resolver. EVERY reader/writer of `.webpieces/...` goes through one of its two\n// named methods so the call site declares whether the state is repo-wide or worktree-private.\n\n\n// There is NO machine-global state root. `MachineStateHome`/`StateHome`/`WEBPIECES_STATE_HOME` and the\n// `PrBodyStore` that used them are DELETED: the one artifact that needed a scope above the clone was the\n// gated squash body, and GitHub holds it now (it IS the PR description). Every `.webpieces` path a\n// webpieces tool writes is `{repo}/.webpieces`, resolved through `DotWebpieces` above. See\n// `decisions/0005-the-pr-description-is-the-merge-body.md`.\nexport { AgedTreeSweeper, SweepCount, RETENTION_DAYS } from './aged-tree-sweep';\nexport {\n ClaudeEnv,\n claudeEnv,\n CLAUDE_PROJECT_DIR_ENV,\n CLAUDE_PROJECT_DIR_UNSET,\n} from './claude-env';\n\n// The ONE formatter for a remedy that must run in a named directory: `cd '<root>' && <command>`.\n// Single-quoted so a repo path containing a space is still runnable (and still un-smuggleable).\nexport { atRoot } from './at-root';\nexport { RulesConfigDesign } from './rules-config-design';\nexport { DocumentDesign, isDocumentDesign, DESIGN_METADATA_KEYS } from './di';\nexport { ExcludePaths, isWebpiecesStateDir } from './exclude-hook-paths';\nexport { isPathExcluded, matchesAnyGlob } from './exclude-paths';\n// The machine-generated trees a line-count rule never fires on. A FLOOR, not a default value:\n// `max-file-lines.allowedPaths` adds to it, so configuring your own tree cannot lose it.\nexport { GENERATED_CODE_PATHS } from './generated-code-paths';\n// THE one `no-custom-css` path exemption. Both engines that enforce the rule (the edit-time hook and the\n// CI validator) consult this class, so `allowGlobs` cannot be honoured by one half and ignored by the other.\nexport { NoCustomCssScope } from './no-custom-css-scope';\nexport { defaultRules, defaultRulesDir } from './default-rules';\nexport {\n loadTemplate,\n writeTemplateIfMissing,\n writeTemplate,\n TemplateWriter,\n} from './load-template';\n// The instruct-ai docs are delivered as a SET: writing one writes the transitive closure of the docs it\n// links to, so a doc and everything it points at always land together. See instruct-ai-docs.ts.\nexport {\n GIT_WORKFLOW_DOC,\n GitWorkflowDoc,\n InstructAiDoc,\n InstructAiDocSet,\n MergeProcessDoc,\n} from './instruct-ai-docs';\nexport {\n MERGE_PROCESS_DOC,\n MergeProcessText,\n MergeRun,\n ReferenceMergeRun,\n} from './merge-process-doc';\nexport { BUILD_LOG_DOC } from './build-log-doc';\nexport {\n validateWebpiecesConfig,\n validatePrGateSection,\n validateChecklistsSection,\n validateSectionPlacement,\n validateExcludePaths,\n validateMatchRulesSection,\n allRuleNames,\n recommendedSeedMode,\n recommendedSeedModeFor,\n seedEntryForRule,\n} from './validate-config';\nexport { validateCommandsSection } from './commands-section-validators';\nexport {\n unknownKeyErrors,\n isCommentKey,\n validateTopLevelKeys,\n COMMENT_KEY_SUFFIX,\n} from './config-key-rules';\n// The retired-key table + the no-back-compat policy it enforces. Exported so the installer can migrate\n// what the errors instruct, and so consumers can enumerate retirements.\nexport {\n RETIRED_CONFIG_KEYS,\n RETIRED_SCOPE_KEY,\n RETIRED_SCOPE_RULE,\n RetiredConfigKey,\n isRetiredKey,\n retiredEntry,\n retiredKeyError,\n retiredKeyErrorsIn,\n retiredRuleFor,\n} from './retired-config-keys';\n// The MECHANICAL cure the unknown-rule error and the banner both name: strip every key no validator has a\n// schema for, so cleanliness is one command rather than a judgement call made while every Bash call is\n// blocked. `PRUNE_UNKNOWN_COMMAND` (constants.ts) is the single spelling of that command.\nexport { ConfigPruner, PruneResult, PrunedKey } from './config-pruner';\nexport { validateChecklistDocs } from './checklist-docs-validator';\n// The OPTIONAL machine-local `~/.webpieces/config.json`: absent (the normal state for every consumer) means\n// each key's declared default, silently; present means STRICT about what it understands and FORWARD-COMPATIBLE\n// about what it does not. A retired key (its own retirement table), a known key of the wrong TYPE and an\n// unparseable document all REJECT; a key this release simply does not recognise is IGNORED with a warning,\n// because the file is machine-global and the repos reading it pin different releases — rejecting a newer\n// release's key would hard-block every repo on the machine that is not yet on it. See home-config.ts.\n// `isHomeConfigPath` is what grants the file its unconditional Write/Edit PASS in the hook guards, which is\n// what keeps a rejection repairable. Every `experimental.*` key is an OPT-IN that defaults OFF, including\n// `whole-repo-build-guard`: ON requires an explicit `true`, and there is no per-key default to export.\nexport {\n HomeConfig,\n HomeConfigService,\n RetiredHomeConfigKey,\n RETIRED_HOME_CONFIG_KEYS,\n HOME_CONFIG_DIR,\n HOME_CONFIG_FILE,\n HOME_EXPERIMENTAL_SECTION,\n HOME_KEY_ORPHAN_DIR_SWEEP,\n HOME_KEY_WHOLE_REPO_BUILD_GUARD,\n HOME_KEY_MAX_CONCURRENT_BUILDS,\n HOME_KEY_TURN_OFF_ALL_REVIEWERS,\n DEFAULT_MAX_CONCURRENT_BUILDS,\n HOME_KEY_DOC,\n HOME_KEY_AI_DOC,\n DOCUMENTATION_KEYS,\n} from './home-config';\n// The MACHINE-WIDE build ledger, `~/.webpieces/builds.log`. THE one carve-out from\n// `no-machine-global-state.spec.ts`'s rule that webpieces writes only under `{repo}/.webpieces` — the\n// argument is in `decisions/0006-the-build-ledger-is-machine-global.md`, and the short form is that \"how\n// many builds are burning this box's CPU\" is a fact about the MACHINE, is not a cache of anything a\n// remote owns, and cannot be answered from a per-repo file because every linked worktree has its own\n// `.webpieces/` and would be blind to the sibling it is contending with. See builds-log.ts.\nexport {\n BuildsLog,\n BuildTicket,\n BuildTermination,\n RunningBuild,\n BUILDS_LOG_FILE,\n BUILDS_LOCK_FILE,\n BUILD_START,\n BUILD_DONE_SUCCESS,\n BUILD_DONE_FAIL,\n MAX_BUILDS_LOG_BYTES,\n BUILDS_LOG_GENERATIONS,\n MAX_ROW_BYTES,\n} from './builds-log';\n// The orphan-directory sweep: the corpse an `nx g move` leaves on every clone, which git cannot remove\n// because an ignored dist/ or node_modules/ outlives every tracked file under it. See orphan-dir-scan.ts\n// for why the predicate is git's own `clean -Xdn` answer rather than a hand-rolled ignore walk.\nexport { OrphanDirScanner, OrphanCandidate } from './orphan-dir-scan';\nexport {\n OrphanDirArchiver,\n ArchivedOrphan,\n FailedOrphan,\n OrphanSweepResult,\n OrphanSweepManifest,\n TRASH_STATE_DIR,\n TRASH_MANIFEST_FILE,\n TRASH_RETENTION_DAYS,\n} from './orphan-dir-archive';\nexport { OrphanDirSweeper, OrphanSweepReport } from './orphan-dir-sweep';\nexport {\n MatchRuleConfig,\n MatchRuleViolation,\n findMatchRuleViolations,\n isMatchRuleAllowedPath,\n compileMatchRulePatterns,\n renderMatchRuleMessage,\n DEFAULT_MATCH_RULES,\n} from './match-rules-config';\nexport type { ConfigSection } from './sections';\nexport { schemaFieldNames, RULE_SCHEMAS } from './rule-schemas';\nexport {\n HOOK_GUARD_NAMES,\n BRANCH_STATE_GUARD_KEY,\n PR_LIFECYCLE_GUARD_KEY,\n isHookGuard,\n sectionForRule,\n} from './sections';\nexport { FieldDef } from './field-def';\nexport type { SchemaShape } from './field-def';\nexport { shouldSkipRule, HOTFIX_BUILD_COMMAND, HOTFIX_AUDIT_BANNER } from './skip-rule';\nexport { SkipRuleResult } from './skip-rule';\nexport {\n detectBase,\n resolveBase,\n getChangedFiles,\n getFileDiff,\n getChangedLineNumbers,\n findNewMethodSignaturesInDiff,\n hasChangesInRange,\n isNewOrModified,\n DiffScope,\n DiffRange,\n ChangedFilesOptions,\n} from './diff-scope';\nexport { AbstractRule } from './abstract-rule';\nexport { WEBPIECES_DISABLE, RULE_NAMES, hasDisable, MERGE_INFO_DIR, MERGE_IN_PROGRESS_FILE, MERGE_EXPLANATION_FILE, PUSH_DEV_STATE_FILE, PRUNE_UNKNOWN_COMMAND, UPGRADE_SHIM_COMMAND } from './constants';\nexport { WebpiecesRulesConfig } from './WebpiecesRulesConfig';\nexport {\n SyncFlowGuidance,\n WP_START_UPDATE,\n WP_FINISH_UPDATE,\n WP_START_UPSERT_PR,\n WP_FINISH_UPSERT_PR,\n WP_PUSH_DEV,\n WP_FINISH_PUSH_DEV,\n} from './sync-flow-guidance';\nexport {\n MaxMethodLinesConfig,\n MaxFileLinesConfig,\n RequireReturnTypeConfig,\n NoInlineTypeLiteralsConfig,\n NoAnyUnknownConfig,\n NoImplicitAnyConfig,\n PrismaValidateDtosConfig,\n PrismaConverterConfig,\n NoDestructureConfig,\n NoUnmanagedExceptionsConfig,\n CatchErrorPatternConfig,\n ThrowCauseRequiredConfig,\n AngularNoDirectApiInResolverConfig,\n NoSymbolDiTokensConfig,\n NoCustomCssConfig,\n NoProcessExitOutsideMainConfig,\n NoFunctionOutsideClassConfig,\n InjectAnnotationNotNeededForConcreteClassConfig,\n FrameworkTagConfig,\n RoleTagConfig,\n EnsureWeAreSecureConfig,\n BranchCreationGuardConfig,\n PrLifecycleGuardConfig,\n NoFileImportCyclesConfig,\n RuntimeArchitectureConfig,\n NxWiringConfig,\n DiGraphConfig,\n NoJsFilesConfig,\n ValidateTsInSrcConfig,\n ValidateArchitectureUnchangedConfig,\n ValidateNoArchitectureCyclesConfig,\n ValidatePackageJsonConfig,\n ValidateVersionsLockedConfig,\n ValidateEslintSyncConfig,\n BaseRuleConfig,\n} from './rule-configs';\nexport { NoRootUnionApiTypeConfig } from './no-root-union-config';\nexport { NoInlineImportInApiLibConfig, OneEnumSpellingInApiLibConfig } from './api-lib-spelling-configs';\nexport { NoUtilityTypesInApiLibConfig } from './no-utility-types-config';\nexport { RequiredTypeSuffixConfig, RequiredTypeSuffixEntry } from './required-type-suffix-config';\nexport {\n ApiClientPackagesEntry,\n ApiLibDependenciesConfig,\n ApiLibPathConfig,\n FrameworkFolderConfig,\n FrameworkFolderEntry,\n FrameworkPackagesConfig,\n FrameworkPackagesEntry,\n FrameworkTsconfigConfig,\n PROJECT_SCAN_MODES,\n} from './tag-truth-configs';\nexport type { ProjectScanMode } from './tag-truth-configs';\nexport { ApiRulesForMcpConfig, ApiRulesForOpenApiConfig, API_DOC_MODES } from './api-doc-rules-config';\nexport type { ApiDocMode } from './api-doc-rules-config';\n// Mode unions + their value arrays — the single source of truth shared with code-rules.\nexport {\n METHOD_LIMIT_MODES,\n FILE_LIMIT_MODES,\n RETURN_TYPE_MODES,\n INLINE_TYPE_MODES,\n MODIFIED_CODE_MODES,\n PROJECT_MODES,\n PRISMA_DTOS_MODES,\n PRISMA_CONVERTER_MODES,\n DIRECT_API_RESOLVER_MODES,\n THROW_CAUSE_MODES,\n ON_OFF_MODES,\n STRUCTURAL_MODES,\n VALIDATE_TS_MODES,\n} from './rule-configs';\nexport {\n NoClientCreationOutsideServerOrClientConfig,\n CLIENT_CREATION_SEVERITIES,\n} from './no-client-creation-config';\nexport type { ClientCreationSeverity } from './no-client-creation-config';\n// The `no-state-paths-in-templates` config, in its own module for the same reason no-client-creation is:\n// rule-configs.ts is at its file-size cap and a rule that carries real defaults belongs beside them.\nexport {\n NoStatePathsInTemplatesConfig,\n DEFAULT_TEMPLATE_DIRS,\n DEFAULT_BANNED_STATE_PATH_PREFIXES,\n} from './no-state-paths-config';\nexport type {\n MethodLimitMode,\n FileLimitMode,\n ReturnTypeMode,\n InlineTypeMode,\n ModifiedCodeMode,\n ProjectMode,\n PrismaValidateDtosMode,\n PrismaConverterMode,\n DirectApiResolverMode,\n ThrowCauseMode,\n OnOffMode,\n StructuralMode,\n ValidateTsMode,\n} from './rule-configs';\nexport { BranchStateGuardConfig, DEFAULT_MAX_COMMITS_BEHIND } from './main-sync-guard-configs';\nexport {\n GateDefinition,\n PrGateConfig,\n DEFAULT_BUILD_COMMAND,\n LandPrConfig,\n DevDeployConfig,\n DEFAULT_DEV_BRANCH_NAMESPACE,\n DEFAULT_DEV_BRANCH,\n ReviewContextEntry,\n defaultGates,\n defaultPrGateConfig,\n defaultLandPrConfig,\n defaultDevDeployConfig,\n buildPrGateConfig,\n buildLandPrConfig,\n buildDevDeployConfig,\n MERGE_MODE_AUTO,\n MERGE_MODE_NONE,\n MERGE_MODES,\n} from './pr-gate-config';\nexport {\n ChecklistDefinition,\n ReviewerAgentPolicy,\n REVIEWER_AGENTS_PLACEHOLDER,\n DEFAULT_REVIEWER_AGENT_NAME,\n toChecklist,\n normalizeChecklistDoc,\n formatFileList,\n} from './checklist-config';\nexport type { RawChecklistItem } from './checklist-config';\nexport { ChecklistValidator } from './checklist-validator';\nexport { ChecklistInstructionsService } from './checklist-instructions';\nexport {\n ReviewerInstructionsService,\n ReviewerBriefing,\n BriefedFile,\n ContextEntry,\n READ_TRUNCATION_LINES,\n ALL_DIFF_ONE_READ_LINES,\n} from './reviewer-instructions';\nexport {\n GateTokenService,\n computeGateToken,\n gateTokenMarker,\n extractGateToken,\n verifyGateToken,\n} from './gate-token';\nexport {\n SubagentProvenanceService,\n ReviewerEvidence,\n ReviewerContext,\n ExpectedReviewer,\n TranscriptScan,\n ProvenanceResult,\n PROVENANCE_OK,\n PROVENANCE_MISSING,\n PROVENANCE_SKIPPED,\n} from './subagent-provenance';\n\n\nexport {\n ReviewProvenanceService,\n ReviewProvenance,\n ReviewerTranscript,\n ReviewerPaths,\n OfferedContext,\n ProvenanceWriteRequest,\n DEFAULT_RETENTION_DAYS,\n} from './review-provenance';\nexport {\n PrSummary,\n PrContext,\n ChecklistResult,\n ChecklistVerdict,\n ChecklistOverride,\n ChecklistOverrideService,\n checklistOverrideService,\n CK_PASS,\n CK_WARN,\n CK_OVERRIDDEN,\n CK_ORANGE_FIXED,\n CK_ORANGE,\n CK_FAIL,\n CK_MISSING,\n CK_BAD_FORMAT,\n VERDICT_GREEN,\n VERDICT_YELLOW,\n VERDICT_ORANGE,\n VERDICT_RED,\n VERDICT_STATUSES,\n RequiredChecklist,\n ChecklistReviewContext,\n ReviewJsonService,\n prDirFor,\n summaryJsonPath,\n summaryJsonSchemaHint,\n} from './review-json';\n\n\n\n\n\n\n\n\n\n\n\n\nexport {\n CommandsConfig,\n buildCommandsConfig,\n DEFAULT_UPSERT_PR_COMMAND,\n DEFAULT_MERGE_COMPLETE_COMMAND,\n} from './commands-config';\nexport { StaleBinRemoval, StaleBinSweeper, staleBinSweeper } from './stale-bin-sweep';\nexport { SpecTempDirs, specTempDirs } from './spec-temp-dirs';\nexport { RepoScratchDirs, SCRATCH_DIR_NAME } from './repo-scratch-dirs';\nexport { TmpScratchSweeper, TMP_SCRATCH_RETENTION_DAYS, TMP_SCRATCH_PREFIX } from './tmp-scratch-sweep';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/index.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,iCAA0E;AAAjE,uGAAA,cAAc,OAAA;AAAE,2GAAA,kBAAkB,OAAA;AAE3C,qDAA+F;AAAtF,gHAAA,aAAa,OAAA;AAAE,sHAAA,mBAAmB,OAAA;AAAE,yHAAA,sBAAsB,OAAA;AACnE,uGAAuG;AACvG,sFAAsF;AACtF,2CAAwD;AAA/C,oGAAA,MAAM,OAAA;AAAE,8GAAA,gBAAgB,OAAA;AACjC,mDAAgD;AAAvC,8GAAA,YAAY,OAAA;AACrB,uCAAiF;AAAxE,oGAAA,QAAQ,OAAA;AAAE,mGAAA,OAAO,OAAA;AAAE,qGAAA,SAAS,OAAA;AAAE,wGAAA,YAAY,OAAA;AAAE,mGAAA,OAAO,OAAA;AAC5D,uCAAqC;AAA5B,mGAAA,OAAO,OAAA;AAEhB,6CAA4E;AAAnE,8GAAA,eAAe,OAAA;AAAE,2GAAA,YAAY,OAAA;AAAE,2GAAA,YAAY,OAAA;AACpD,iGAAiG;AACjG,sCAAsC;AACtC,6DAM+B;AAL3B,+HAAA,wBAAwB,OAAA;AACxB,wHAAA,iBAAiB,OAAA;AACjB,yHAAA,kBAAkB,OAAA;AA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OAAA;AACf,oHAAA,qBAAqB,OAAA;AAczB,qDAK2B;AAJvB,iHAAA,cAAc,OAAA;AACd,sHAAA,mBAAmB,OAAA;AACnB,4HAAA,yBAAyB,OAAA;AACzB,iIAAA,8BAA8B,OAAA;AAElC,qDAAsF;AAA7E,kHAAA,eAAe,OAAA;AAAE,kHAAA,eAAe,OAAA;AAAE,kHAAA,eAAe,OAAA;AAC1D,mDAA8D;AAArD,8GAAA,YAAY,OAAA;AAAE,8GAAA,YAAY,OAAA;AACnC,yDAAwE;AAA/D,oHAAA,eAAe,OAAA;AAAE,qHAAA,gBAAgB,OAAA;AAC1C,yDAAwG;AAA/F,sHAAA,iBAAiB,OAAA;AAAE,+HAAA,0BAA0B,OAAA;AAAE,uHAAA,kBAAkB,OAAA;AAE1E,6DAAmC;AACnC,oEAA0C","sourcesContent":["export { ResolvedConfig, ResolvedRuleConfig, RuleOptions } from './types';\n\nexport { RuleFailError, renderRuleFailForAi, renderRuleFailForHuman } from './rule-fail-error';\n// THE one representation of a cure, shared by RuleFailError (build-time) and FixHint (edit-time), plus\n// the one renderer that owns the \"Fix Option N:\" numbering and the \"(preferred)\" tag.\nexport { Option, formatFixOptions } from './fix-option';\nexport { CliExitError } from './cli-exit-error';\nexport { CliUsage, CliFlag, CliArgSet, CliArgsCheck, CliArgs } from './cli-args';\nexport { runMain } from './run-main';\n\nexport { loadAndValidate, LoadedConfig, ConfigLoader } from './load-config';\n// The validation-failure banner: ONE cure (edit the file), plus the marker phrases the validator\n// messages embed rather than re-type.\nexport {\n formatConfigErrorsBanner,\n CONFIG_POLICY_DOC,\n RETIRED_KEY_MARKER,\n RETIRED_TOP_LEVEL_MARKER,\n SECTION_PLACEMENT_MARKER,\n} from './config-error-banner';\nexport {\n findConfigFile,\n CONFIG_FILENAME,\n ConfigFile,\n ConfigParseAttempt,\n CONFIG_PARSE_ATTEMPTS,\n CONFIG_PARSE_RETRY_MILLIS,\n} from './config-file';\n// The PARSED-BUT-UNVALIDATED config shape. Exported for readers that walk the file generically rather\n// than through the typed config (the pr-gate active-hatch dashboard section reads every rule's hatches).\nexport type { RawConfigFile } from './config-file';\nexport { RepoRootFinder, INSTRUCT_AI_DIR, INSTRUCT_AI_LEAF } from './repo-root';\n// The scoped `.webpieces` resolver. EVERY reader/writer of `.webpieces/...` goes through one of its two\n// named methods so the call site declares whether the state is repo-wide or worktree-private.\n\n\n// There is NO machine-global state root. `MachineStateHome`/`StateHome`/`WEBPIECES_STATE_HOME` and the\n// `PrBodyStore` that used them are DELETED: the one artifact that needed a scope above the clone was the\n// gated squash body, and GitHub holds it now (it IS the PR description). Every `.webpieces` path a\n// webpieces tool writes is `{repo}/.webpieces`, resolved through `DotWebpieces` above. See\n// `decisions/0005-the-pr-description-is-the-merge-body.md`.\nexport { AgedTreeSweeper, SweepCount, RETENTION_DAYS } from './aged-tree-sweep';\nexport {\n ClaudeEnv,\n claudeEnv,\n CLAUDE_PROJECT_DIR_ENV,\n CLAUDE_PROJECT_DIR_UNSET,\n} from './claude-env';\n\n// The ONE formatter for a remedy that must run in a named directory: `cd '<root>' && <command>`.\n// Single-quoted so a repo path containing a space is still runnable (and still un-smuggleable).\nexport { atRoot } from './at-root';\nexport { RulesConfigDesign } from './rules-config-design';\nexport { DocumentDesign, isDocumentDesign, DESIGN_METADATA_KEYS } from './di';\nexport { ExcludePaths, isWebpiecesStateDir } from './exclude-hook-paths';\nexport { isPathExcluded, matchesAnyGlob } from './exclude-paths';\n// The machine-generated trees a line-count rule never fires on. A FLOOR, not a default value:\n// `max-file-lines.allowedPaths` adds to it, so configuring your own tree cannot lose it.\nexport { GENERATED_CODE_PATHS } from './generated-code-paths';\n// THE one `no-custom-css` path exemption. Both engines that enforce the rule (the edit-time hook and the\n// CI validator) consult this class, so `allowGlobs` cannot be honoured by one half and ignored by the other.\nexport { NoCustomCssScope } from './no-custom-css-scope';\nexport { defaultRules, defaultRulesDir } from './default-rules';\nexport {\n loadTemplate,\n writeTemplateIfMissing,\n writeTemplate,\n TemplateWriter,\n} from './load-template';\n// The instruct-ai docs are delivered as a SET: writing one writes the transitive closure of the docs it\n// links to, so a doc and everything it points at always land together. See instruct-ai-docs.ts.\nexport {\n GIT_WORKFLOW_DOC,\n GitWorkflowDoc,\n InstructAiDoc,\n InstructAiDocSet,\n MergeProcessDoc,\n} from './instruct-ai-docs';\nexport {\n MERGE_PROCESS_DOC,\n MergeProcessText,\n MergeRun,\n ReferenceMergeRun,\n} from './merge-process-doc';\nexport { BUILD_LOG_DOC } from './build-log-doc';\nexport {\n validateWebpiecesConfig,\n validatePrGateSection,\n validateChecklistsSection,\n validateSectionPlacement,\n validateExcludePaths,\n validateMatchRulesSection,\n allRuleNames,\n recommendedSeedMode,\n recommendedSeedModeFor,\n seedEntryForRule,\n} from './validate-config';\nexport { validateCommandsSection } from './commands-section-validators';\nexport {\n unknownKeyErrors,\n isCommentKey,\n validateTopLevelKeys,\n COMMENT_KEY_SUFFIX,\n} from './config-key-rules';\n// The retired-key table + the no-back-compat policy it enforces. Exported so the installer can migrate\n// what the errors instruct, and so consumers can enumerate retirements.\nexport {\n RETIRED_CONFIG_KEYS,\n RETIRED_SCOPE_KEY,\n RETIRED_SCOPE_RULE,\n RetiredConfigKey,\n isRetiredKey,\n retiredEntry,\n retiredKeyError,\n retiredKeyErrorsIn,\n retiredRuleFor,\n} from './retired-config-keys';\n// The MECHANICAL cure the unknown-rule error and the banner both name: strip every key no validator has a\n// schema for, so cleanliness is one command rather than a judgement call made while every Bash call is\n// blocked. `PRUNE_UNKNOWN_COMMAND` (constants.ts) is the single spelling of that command.\nexport { ConfigPruner, PruneResult, PrunedKey } from './config-pruner';\nexport { validateChecklistDocs } from './checklist-docs-validator';\n// The OPTIONAL machine-local `~/.webpieces/config.json`: absent (the normal state for every consumer) means\n// each key's declared default, silently; present means STRICT about what it understands and FORWARD-COMPATIBLE\n// about what it does not. A retired key (its own retirement table), a known key of the wrong TYPE and an\n// unparseable document all REJECT; a key this release simply does not recognise is IGNORED with a warning,\n// because the file is machine-global and the repos reading it pin different releases — rejecting a newer\n// release's key would hard-block every repo on the machine that is not yet on it. See home-config.ts.\n// `isHomeConfigPath` is what grants the file its unconditional Write/Edit PASS in the hook guards, which is\n// what keeps a rejection repairable. Every `experimental.*` key is an OPT-IN that defaults OFF, including\n// `whole-repo-build-guard`: ON requires an explicit `true`, and there is no per-key default to export.\nexport {\n HomeConfig,\n HomeConfigService,\n RetiredHomeConfigKey,\n RETIRED_HOME_CONFIG_KEYS,\n HOME_CONFIG_DIR,\n HOME_CONFIG_FILE,\n HOME_EXPERIMENTAL_SECTION,\n HOME_KEY_ORPHAN_DIR_SWEEP,\n HOME_KEY_WHOLE_REPO_BUILD_GUARD,\n HOME_KEY_MAX_CONCURRENT_BUILDS,\n HOME_KEY_TURN_OFF_ALL_REVIEWERS,\n DEFAULT_MAX_CONCURRENT_BUILDS,\n HOME_KEY_DOC,\n HOME_KEY_AI_DOC,\n DOCUMENTATION_KEYS,\n} from './home-config';\n// The MACHINE-WIDE build ledger, `~/.webpieces/builds.log`. THE one carve-out from\n// `no-machine-global-state.spec.ts`'s rule that webpieces writes only under `{repo}/.webpieces` — the\n// argument is in `decisions/0006-the-build-ledger-is-machine-global.md`, and the short form is that \"how\n// many builds are burning this box's CPU\" is a fact about the MACHINE, is not a cache of anything a\n// remote owns, and cannot be answered from a per-repo file because every linked worktree has its own\n// `.webpieces/` and would be blind to the sibling it is contending with. See builds-log.ts.\nexport {\n BuildsLog,\n BuildTicket,\n BuildTermination,\n RunningBuild,\n BUILDS_LOG_FILE,\n BUILDS_LOCK_FILE,\n BUILD_START,\n BUILD_DONE_SUCCESS,\n BUILD_DONE_FAIL,\n MAX_BUILDS_LOG_BYTES,\n BUILDS_LOG_GENERATIONS,\n MAX_ROW_BYTES,\n} from './builds-log';\n// The orphan-directory sweep: the corpse an `nx g move` leaves on every clone, which git cannot remove\n// because an ignored dist/ or node_modules/ outlives every tracked file under it. See orphan-dir-scan.ts\n// for why the predicate is git's own `clean -Xdn` answer rather than a hand-rolled ignore walk.\nexport { OrphanDirScanner, OrphanCandidate } from './orphan-dir-scan';\nexport {\n OrphanDirArchiver,\n ArchivedOrphan,\n FailedOrphan,\n OrphanSweepResult,\n OrphanSweepManifest,\n TRASH_STATE_DIR,\n TRASH_MANIFEST_FILE,\n TRASH_RETENTION_DAYS,\n} from './orphan-dir-archive';\nexport { OrphanDirSweeper, OrphanSweepReport } from './orphan-dir-sweep';\nexport {\n MatchRuleConfig,\n MatchRuleViolation,\n findMatchRuleViolations,\n isMatchRuleAllowedPath,\n compileMatchRulePatterns,\n renderMatchRuleMessage,\n DEFAULT_MATCH_RULES,\n} from './match-rules-config';\nexport type { ConfigSection } from './sections';\nexport { schemaFieldNames, RULE_SCHEMAS } from './rule-schemas';\nexport {\n HOOK_GUARD_NAMES,\n BRANCH_STATE_GUARD_KEY,\n PR_LIFECYCLE_GUARD_KEY,\n isHookGuard,\n sectionForRule,\n} from './sections';\nexport { FieldDef } from './field-def';\nexport type { SchemaShape } from './field-def';\nexport { shouldSkipRule, HOTFIX_BUILD_COMMAND, HOTFIX_AUDIT_BANNER } from './skip-rule';\nexport { SkipRuleResult } from './skip-rule';\nexport {\n detectBase,\n resolveBase,\n getChangedFiles,\n getFileDiff,\n getChangedLineNumbers,\n findNewMethodSignaturesInDiff,\n hasChangesInRange,\n isNewOrModified,\n DiffScope,\n DiffRange,\n ChangedFilesOptions,\n} from './diff-scope';\nexport { AbstractRule } from './abstract-rule';\nexport { WEBPIECES_DISABLE, RULE_NAMES, hasDisable, MERGE_INFO_DIR, MERGE_IN_PROGRESS_FILE, MERGE_EXPLANATION_FILE, PUSH_DEV_STATE_FILE, PRUNE_UNKNOWN_COMMAND, UPGRADE_SHIM_COMMAND } from './constants';\nexport { WebpiecesRulesConfig } from './WebpiecesRulesConfig';\nexport {\n SyncFlowGuidance,\n WP_START_UPDATE,\n WP_FINISH_UPDATE,\n WP_START_UPSERT_PR,\n WP_FINISH_UPSERT_PR,\n WP_PUSH_DEV,\n WP_FINISH_PUSH_DEV,\n} from './sync-flow-guidance';\nexport {\n MaxMethodLinesConfig,\n MaxFileLinesConfig,\n RequireReturnTypeConfig,\n NoInlineTypeLiteralsConfig,\n NoAnyUnknownConfig,\n NoImplicitAnyConfig,\n PrismaValidateDtosConfig,\n PrismaConverterConfig,\n NoDestructureConfig,\n NoUnmanagedExceptionsConfig,\n CatchErrorPatternConfig,\n ThrowCauseRequiredConfig,\n AngularNoDirectApiInResolverConfig,\n NoSymbolDiTokensConfig,\n NoCustomCssConfig,\n NoProcessExitOutsideMainConfig,\n NoFunctionOutsideClassConfig,\n InjectAnnotationNotNeededForConcreteClassConfig,\n FrameworkTagConfig,\n RoleTagConfig,\n EnsureWeAreSecureConfig,\n BranchCreationGuardConfig,\n PrLifecycleGuardConfig,\n NoFileImportCyclesConfig,\n RuntimeArchitectureConfig,\n NxWiringConfig,\n DiGraphConfig,\n NoJsFilesConfig,\n ValidateTsInSrcConfig,\n ValidateArchitectureUnchangedConfig,\n ValidateNoArchitectureCyclesConfig,\n ValidatePackageJsonConfig,\n ValidateVersionsLockedConfig,\n ValidateEslintSyncConfig,\n BaseRuleConfig,\n} from './rule-configs';\nexport { NoRootUnionApiTypeConfig } from './no-root-union-config';\nexport { NoInlineImportInApiLibConfig, OneEnumSpellingInApiLibConfig } from './api-lib-spelling-configs';\nexport { NoUtilityTypesInApiLibConfig } from './no-utility-types-config';\nexport { RequiredTypeSuffixConfig, RequiredTypeSuffixEntry } from './required-type-suffix-config';\nexport {\n ApiClientPackagesEntry,\n ApiLibDependenciesConfig,\n ApiLibPathConfig,\n FrameworkFolderConfig,\n FrameworkFolderEntry,\n FrameworkPackagesConfig,\n FrameworkPackagesEntry,\n FrameworkTsconfigConfig,\n PROJECT_SCAN_MODES,\n} from './tag-truth-configs';\nexport type { ProjectScanMode } from './tag-truth-configs';\nexport { ApiRulesForMcpConfig, ApiRulesForOpenApiConfig, API_DOC_MODES } from './api-doc-rules-config';\nexport type { ApiDocMode } from './api-doc-rules-config';\n// Mode unions + their value arrays — the single source of truth shared with code-rules.\nexport {\n METHOD_LIMIT_MODES,\n FILE_LIMIT_MODES,\n RETURN_TYPE_MODES,\n INLINE_TYPE_MODES,\n MODIFIED_CODE_MODES,\n PROJECT_MODES,\n PRISMA_DTOS_MODES,\n PRISMA_CONVERTER_MODES,\n DIRECT_API_RESOLVER_MODES,\n THROW_CAUSE_MODES,\n ON_OFF_MODES,\n STRUCTURAL_MODES,\n VALIDATE_TS_MODES,\n} from './rule-configs';\nexport {\n NoClientCreationOutsideServerOrClientConfig,\n CLIENT_CREATION_SEVERITIES,\n} from './no-client-creation-config';\nexport type { ClientCreationSeverity } from './no-client-creation-config';\n// The `no-state-paths-in-templates` config, in its own module for the same reason no-client-creation is:\n// rule-configs.ts is at its file-size cap and a rule that carries real defaults belongs beside them.\nexport {\n NoStatePathsInTemplatesConfig,\n DEFAULT_TEMPLATE_DIRS,\n DEFAULT_BANNED_STATE_PATH_PREFIXES,\n} from './no-state-paths-config';\nexport type {\n MethodLimitMode,\n FileLimitMode,\n ReturnTypeMode,\n InlineTypeMode,\n ModifiedCodeMode,\n ProjectMode,\n PrismaValidateDtosMode,\n PrismaConverterMode,\n DirectApiResolverMode,\n ThrowCauseMode,\n OnOffMode,\n StructuralMode,\n ValidateTsMode,\n} from './rule-configs';\nexport { BranchStateGuardConfig, DEFAULT_MAX_COMMITS_BEHIND } from './main-sync-guard-configs';\nexport {\n GateDefinition,\n PrGateConfig,\n DEFAULT_BUILD_COMMAND,\n LandPrConfig,\n DevDeployConfig,\n DEFAULT_DEV_BRANCH_NAMESPACE,\n DEFAULT_DEV_BRANCH,\n ReviewContextEntry,\n defaultGates,\n defaultPrGateConfig,\n defaultLandPrConfig,\n defaultDevDeployConfig,\n buildPrGateConfig,\n buildLandPrConfig,\n buildDevDeployConfig,\n MERGE_MODE_AUTO,\n MERGE_MODE_NONE,\n MERGE_MODES,\n} from './pr-gate-config';\nexport {\n ChecklistDefinition,\n ReviewerAgentPolicy,\n REVIEWER_AGENTS_PLACEHOLDER,\n DEFAULT_REVIEWER_AGENT_NAME,\n toChecklist,\n normalizeChecklistDoc,\n formatFileList,\n} from './checklist-config';\nexport type { RawChecklistItem } from './checklist-config';\nexport { ChecklistValidator } from './checklist-validator';\nexport { ChecklistInstructionsService } from './checklist-instructions';\nexport {\n ReviewerInstructionsService,\n ReviewerBriefing,\n BriefedFile,\n ContextEntry,\n READ_TRUNCATION_LINES,\n ALL_DIFF_ONE_READ_LINES,\n} from './reviewer-instructions';\nexport {\n GateTokenService,\n computeGateToken,\n gateTokenMarker,\n extractGateToken,\n verifyGateToken,\n} from './gate-token';\nexport {\n SubagentProvenanceService,\n ReviewerEvidence,\n ReviewerContext,\n ExpectedReviewer,\n TranscriptScan,\n ProvenanceResult,\n PROVENANCE_OK,\n PROVENANCE_MISSING,\n PROVENANCE_SKIPPED,\n} from './subagent-provenance';\n\n\nexport {\n ReviewProvenanceService,\n ReviewProvenance,\n ReviewerTranscript,\n ReviewerPaths,\n OfferedContext,\n ProvenanceWriteRequest,\n DEFAULT_RETENTION_DAYS,\n} from './review-provenance';\nexport {\n PrSummary,\n PrContext,\n ChecklistResult,\n ChecklistVerdict,\n ChecklistOverride,\n ChecklistOverrideService,\n checklistOverrideService,\n CK_PASS,\n CK_WARN,\n CK_OVERRIDDEN,\n CK_ORANGE_FIXED,\n CK_ORANGE,\n CK_FAIL,\n CK_MISSING,\n CK_BAD_FORMAT,\n VERDICT_GREEN,\n VERDICT_YELLOW,\n VERDICT_ORANGE,\n VERDICT_RED,\n VERDICT_STATUSES,\n RequiredChecklist,\n ChecklistReviewContext,\n ReviewJsonService,\n prDirFor,\n summaryJsonPath,\n summaryJsonSchemaHint,\n} from './review-json';\n\n\n\n\n\n\n\n\n\n\n\n\nexport {\n CommandsConfig,\n buildCommandsConfig,\n DEFAULT_UPSERT_PR_COMMAND,\n DEFAULT_MERGE_COMPLETE_COMMAND,\n} from './commands-config';\nexport { StaleBinRemoval, StaleBinSweeper, staleBinSweeper } from './stale-bin-sweep';\nexport { SpecTempDirs, specTempDirs } from './spec-temp-dirs';\nexport { RepoScratchDirs, SCRATCH_DIR_NAME } from './repo-scratch-dirs';\nexport { TmpScratchSweeper, TMP_SCRATCH_RETENTION_DAYS, TMP_SCRATCH_PREFIX } from './tmp-scratch-sweep';\n\nexport * from './hook-fault-codes';\nexport * from './hook-config-diagnostics';\n"]}
|
|
@@ -11,10 +11,10 @@ One key makes that unconstructible. The four class NAMES are unchanged and still
|
|
|
11
11
|
on every decision-log line, so `grep rule=stale-main-bash-guard` keeps working; only the switch
|
|
12
12
|
merged. The four old keys are rejected by name with this destination — see `retired-config-keys.ts`.
|
|
13
13
|
|
|
14
|
-
**Code:** `
|
|
15
|
-
the rows in `
|
|
14
|
+
**Code:** `agent-workflow-rules/src/core/rules/{feature-branch,read-stale,stale-main-bash,merged-branch-bash}-guard.ts` ·
|
|
15
|
+
the rows in `agent-workflow-rules/src/core/l2-rows.ts` · the shared cache in
|
|
16
16
|
`rules-config/src/main-sync-status.ts` + `main-sync-file.ts` · the refresher in
|
|
17
|
-
`
|
|
17
|
+
`agent-workflow-rules/src/core/sync-main.ts`.
|
|
18
18
|
|
|
19
19
|
## The four classes, and why there are four
|
|
20
20
|
|
|
@@ -304,13 +304,13 @@ and the doc follows — it cannot rot into a list of things that were fixed year
|
|
|
304
304
|
|
|
305
305
|
| section | file | symbol |
|
|
306
306
|
|---|---|---|
|
|
307
|
-
| the rows + the reason→row join | `
|
|
308
|
-
| write policy | `
|
|
309
|
-
| read policy | `
|
|
310
|
-
| stale-main Bash | `
|
|
311
|
-
| the shared freshness predicate | `
|
|
312
|
-
| merged-branch Bash | `
|
|
307
|
+
| the rows + the reason→row join | `agent-workflow-rules/src/core/l2-rows.ts` | `L2_ROWS`, `l2RowForReason`, `NOT_DONE` |
|
|
308
|
+
| write policy | `agent-workflow-rules/src/core/rules/feature-branch-guard.ts` | `check` |
|
|
309
|
+
| read policy | `agent-workflow-rules/src/core/rules/read-stale-guard.ts` | `checkStaleMain`, `checkMergedBranch` |
|
|
310
|
+
| stale-main Bash | `agent-workflow-rules/src/core/rules/stale-main-bash-guard.ts` | `checkFreshness`, `bareCheckoutOfMain` |
|
|
311
|
+
| the shared freshness predicate | `agent-workflow-rules/src/core/rules/main-freshness.ts` | `containsOriginMain`, `summarize` |
|
|
312
|
+
| merged-branch Bash | `agent-workflow-rules/src/core/rules/merged-branch-bash-guard.ts` | `isFullyRecovery`, `ALLOWED_GIT_SUBCOMMANDS` |
|
|
313
313
|
| the cache | `rules-config/src/main-sync-status.ts`, `main-sync-file.ts` | `readMainSyncStatus`, `MainSyncStatusFile`, `forgeReachable` |
|
|
314
|
-
| the refresher | `
|
|
315
|
-
| command scanning | `
|
|
314
|
+
| the refresher | `agent-workflow-rules/src/core/sync-main.ts` | `refreshMainSync` |
|
|
315
|
+
| command scanning | `agent-workflow-rules/src/core/rules/content-read-scan.ts`, `shell-segment-scan.ts` | `readsStaleContent`, `classify` |
|
|
316
316
|
| the config key | `rules-config/src/main-sync-guard-configs.ts`, `sections.ts` | `BranchStateGuardConfig`, `BRANCH_STATE_GUARD_KEY` |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# webpieces guard matrix — L0 (tooling integrity)
|
|
2
2
|
|
|
3
|
-
GENERATED from `L0_FAULTS` + `L0_ALLOWLIST` in `@webpieces/
|
|
3
|
+
GENERATED from `L0_FAULTS` + `L0_ALLOWLIST` in `@webpieces/agent-workflow-rules`. Do not hand-edit —
|
|
4
4
|
a unit test locks this file byte-identical to `renderGuardMatrixDoc()`, so the table below is
|
|
5
5
|
the array the guard actually consults, not a description of it.
|
|
6
6
|
|
|
@@ -20,7 +20,7 @@ numbers from `L0_ROW_*`, both spelled in exactly one place (`core/l0-fault-codes
|
|
|
20
20
|
|---|---|---|---|---|
|
|
21
21
|
| `D` | `version-drift` | version drift — root package.json pin != installed version | sh, before the bin runs | sh |
|
|
22
22
|
| `X` | `guard-bin-missing` | guard bin missing (fresh clone / new worktree / package removed) | sh, before the bin runs | sh |
|
|
23
|
-
| `U` | `guard-pkg-undeclared` | guard bin missing AND @webpieces/
|
|
23
|
+
| `U` | `guard-pkg-undeclared` | guard bin missing AND @webpieces/agent-workflow-rules is not declared in package.json | sh, before the bin runs | sh |
|
|
24
24
|
| `K` | `guard-bin-crashed` | guard bin present but CRASHED (exit code not 0 or 2 — corrupt node_modules) | sh, before the bin runs | sh |
|
|
25
25
|
| `S` | `managed-hook-surface` | a webpieces-managed hook file, one of the harness hook registrations (.claude/settings.json, .codex/hooks.json) or the managed env entry does not match this release | the guard bin | JS |
|
|
26
26
|
| `C` | `config-missing` | webpieces.config.json missing | the guard bin | JS |
|
|
@@ -44,11 +44,11 @@ the option you pick EXACTLY as written and run nothing else on that line.
|
|
|
44
44
|
|
|
45
45
|
- **Option 1 (preferred)**: `pnpm install` ← pick this when this fault fires at all — nothing is installed in THIS tree, and a new git worktree copies no node_modules
|
|
46
46
|
|
|
47
|
-
### `U` — guard bin missing AND @webpieces/
|
|
47
|
+
### `U` — guard bin missing AND @webpieces/agent-workflow-rules is not declared in package.json
|
|
48
48
|
|
|
49
|
-
- **Option 1 (preferred)**: `git checkout main && git pull origin main` ← pick this when @webpieces/
|
|
49
|
+
- **Option 1 (preferred)**: `git checkout main && git pull origin main` ← pick this when @webpieces/agent-workflow-rules arrives WITH the umbrella, so a tree that is behind explains this without anything being mis-declared — sync first, then install
|
|
50
50
|
- **Option 2**: `pnpm install` ← pick this when the sync (or a raised catalog pin in pnpm-workspace.yaml, which is editable while the block is up) gave the installer something new to do — a BARE install with nothing changed reports "Lockfile is up to date" and leaves the tree as broken as it found it
|
|
51
|
-
- **Option 3**: `pnpm add -D @webpieces/
|
|
51
|
+
- **Option 3**: `pnpm add -D @webpieces/agent-workflow-rules` ← pick this when nothing else worked and you need this session back — it is a session unblock, NOT a fix: revert it with 'pnpm remove @webpieces/agent-workflow-rules' before committing, because a direct root dependency on it violates the umbrella rule
|
|
52
52
|
|
|
53
53
|
### `K` — guard bin present but CRASHED (exit code not 0 or 2 — corrupt node_modules)
|
|
54
54
|
|
|
@@ -56,8 +56,8 @@ the option you pick EXACTLY as written and run nothing else on that line.
|
|
|
56
56
|
|
|
57
57
|
### `S` — a webpieces-managed hook file, one of the harness hook registrations (.claude/settings.json, .codex/hooks.json) or the managed env entry does not match this release
|
|
58
58
|
|
|
59
|
-
- **Option 1 (preferred)**: `pnpm exec wp-upgrade-shim` ← pick this when this fault fires at all — it is the only cure that repairs EVERY managed surface (ai-hook.sh, each harness hook registration, the anchoring of the neighbour hook commands registered beside ours, and the Claude settings env entry), and it also deletes the retired guarantee-root.sh and any entry still naming it, and it touches no config; needs installed @webpieces/
|
|
60
|
-
- **Option 2**: `cp node_modules/@webpieces/
|
|
59
|
+
- **Option 1 (preferred)**: `pnpm exec wp-upgrade-shim` ← pick this when this fault fires at all — it is the only cure that repairs EVERY managed surface (ai-hook.sh, each harness hook registration, the anchoring of the neighbour hook commands registered beside ours, and the Claude settings env entry), and it also deletes the retired guarantee-root.sh and any entry still naming it, and it touches no config; needs installed @webpieces/agent-workflow-rules 0.4.408 or newer
|
|
60
|
+
- **Option 2**: `cp node_modules/@webpieces/agent-workflow-rules/templates/ai-hook.sh .claude/webpieces/ai-hook.sh` ← pick this when the installed @webpieces/agent-workflow-rules is OLDER than 0.4.408, so wp-upgrade-shim does not exist yet — it is PARTIAL (it repairs ai-hook.sh and NOTHING else), so upgrade @webpieces afterwards and run Option 1 to finish
|
|
61
61
|
|
|
62
62
|
### `C` — webpieces.config.json missing
|
|
63
63
|
|
|
@@ -102,10 +102,10 @@ that denied `rm -rf node_modules && pnpm install` while allowing a bare `pnpm in
|
|
|
102
102
|
| 7 | git fetch - a bare git pull and git merge are NOT on the list | ALLOW |
|
|
103
103
|
| 8 | git checkout main && git pull origin main | ALLOW |
|
|
104
104
|
| 9 | pnpm exec wp-upgrade-shim | ALLOW |
|
|
105
|
-
| 10 | cp node_modules/@webpieces/
|
|
105
|
+
| 10 | cp node_modules/@webpieces/agent-workflow-rules/templates/ai-hook.sh .claude/webpieces/ai-hook.sh | ALLOW |
|
|
106
106
|
| 11 | pnpm wp-prune-unknown-config | ALLOW |
|
|
107
107
|
| 12 | pnpm exec wp-install-ai-hooks (flags allowed, e.g. --target=project) | ALLOW |
|
|
108
|
-
| 13 | pnpm add -D @webpieces/
|
|
108
|
+
| 13 | pnpm add -D @webpieces/agent-workflow-rules (an @version and extra flags allowed) | ALLOW |
|
|
109
109
|
| 14 | read-only orientation: pwd, git status/log/diff/show/branch/rev-parse, git worktree list | ALLOW |
|
|
110
110
|
| 15 | CODEX ONLY - a read-shaped Bash command (the harness has no Read tool): cat, head, tail, less, more, bat, or sed -n '<range>p' | PASS |
|
|
111
111
|
|
|
@@ -134,5 +134,5 @@ PASS degenerates into a terminal allow — reads are unguarded during those thre
|
|
|
134
134
|
|
|
135
135
|
## Widening L0
|
|
136
136
|
|
|
137
|
-
Add an entry to `L0_ALLOWLIST` in `packages/tooling/
|
|
137
|
+
Add an entry to `L0_ALLOWLIST` in `packages/tooling/agent-workflow-rules/src/bin/shim.ts`. That array is
|
|
138
138
|
the single source for the JS allowlist, the `grep -E` inside the rendered shim, and this file.
|
|
@@ -10,14 +10,14 @@ run against the whole point. L0 has no key for the stronger version of the same
|
|
|
10
10
|
decides whether the tooling can be trusted cannot be configured by the file it has not validated yet.
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
**Code:** `packages/tooling/
|
|
14
|
-
`TreeKind`) · `packages/tooling/
|
|
13
|
+
**Code:** `packages/tooling/hook-runtime/src/core/effective-tree.ts` (`EffectiveTreeResolver`,
|
|
14
|
+
`TreeKind`) · `packages/tooling/hook-runtime/src/core/target-tree.ts` (`TargetTreeResolver`,
|
|
15
15
|
`GovernedPath` — the same question asked about a FILE) ·
|
|
16
|
-
`packages/tooling/
|
|
17
|
-
`packages/tooling/
|
|
16
|
+
`packages/tooling/agent-workflow-rules/src/core/runner.ts` (`l1LocationBlock`, the `foreign` check) ·
|
|
17
|
+
`packages/tooling/hook-runtime/src/core/excluded-paths.ts` (`filterByExcludedPaths`) ·
|
|
18
18
|
`.../force-to-root.ts` (`ForceToRootGuard`) ·
|
|
19
|
-
`packages/tooling/
|
|
20
|
-
`packages/tooling/
|
|
19
|
+
`packages/tooling/agent-workflow-rules/src/core/missing-directory.ts` (`MissingDirectoryGuard`) ·
|
|
20
|
+
`packages/tooling/agent-workflow-rules/src/core/version-sync.ts` (`VersionSyncGuard`,
|
|
21
21
|
`WebpiecesVersions`).
|
|
22
22
|
|
|
23
23
|
L1 answers four questions, and they are genuinely separate:
|
|
@@ -250,12 +250,12 @@ That resolver has three consumers — L1's K, L2's scope dimension, and `exclude
|
|
|
250
250
|
|
|
251
251
|
| section | file | symbol |
|
|
252
252
|
|---|---|---|
|
|
253
|
-
| resolver, K | `
|
|
254
|
-
| the two structural blocks, in order | `
|
|
255
|
-
| trinary-version-skew (row 8), V, R | `
|
|
256
|
-
| force-to-root (row 5) | `
|
|
257
|
-
| the directory is gone (row 7) | `
|
|
258
|
-
| the filter | `
|
|
259
|
-
| which tree owns a TARGET PATH | `
|
|
253
|
+
| resolver, K | `hook-runtime/src/core/effective-tree.ts` | `EffectiveTreeResolver`, `TreeKind` |
|
|
254
|
+
| the two structural blocks, in order | `agent-workflow-rules/src/core/runner.ts` | `l1LocationBlock` |
|
|
255
|
+
| trinary-version-skew (row 8), V, R | `agent-workflow-rules/src/core/version-sync.ts` | `VersionSyncGuard`, `WebpiecesVersions` |
|
|
256
|
+
| force-to-root (row 5) | `agent-workflow-rules/src/core/force-to-root.ts` | `ForceToRootGuard` |
|
|
257
|
+
| the directory is gone (row 7) | `agent-workflow-rules/src/core/missing-directory.ts` | `MissingDirectoryGuard` |
|
|
258
|
+
| the filter | `hook-runtime/src/core/excluded-paths.ts` | `filterByExcludedPaths` |
|
|
259
|
+
| which tree owns a TARGET PATH | `hook-runtime/src/core/target-tree.ts` | `TargetTreeResolver`, `GovernedPath` |
|
|
260
260
|
| `excludePaths` shape | `rules-config/src/exclude-hook-paths.ts`, `validate-config.ts`, `retired-config-keys.ts` | `ExcludePaths`, `validateExcludePaths` |
|
|
261
261
|
| the `.webpieces/` skip | `rules-config/src/exclude-hook-paths.ts` | `isWebpiecesStateDir` |
|