@webpieces/rules-config 0.4.574 → 0.4.575
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webpieces/rules-config",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.575",
|
|
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",
|
|
@@ -6,7 +6,7 @@ the array the guard actually consults, not a description of it.
|
|
|
6
6
|
|
|
7
7
|
L0 is the OUTERMOST guard layer. It blocks work while `node_modules`, the committed shim, or
|
|
8
8
|
`webpieces.config.json` are in a state that makes every other guard untrustworthy. If you are
|
|
9
|
-
reading this, one of the
|
|
9
|
+
reading this, one of the faults below fired and named this file.
|
|
10
10
|
|
|
11
11
|
## The faults
|
|
12
12
|
|
|
@@ -14,12 +14,13 @@ reading this, one of the six faults below fired and named this file.
|
|
|
14
14
|
|---|---|---|---|
|
|
15
15
|
| `D` | version drift — root package.json pin != installed version | sh, before the bin runs | sh |
|
|
16
16
|
| `X` | guard bin missing (fresh clone / new worktree / package removed) | sh, before the bin runs | sh |
|
|
17
|
+
| `U` | guard bin missing AND @webpieces/ai-hook-rules is not declared in package.json | sh, before the bin runs | sh |
|
|
17
18
|
| `K` | guard bin present but CRASHED (exit code not 0 or 2 — corrupt node_modules) | sh, before the bin runs | sh |
|
|
18
19
|
| `S` | committed .claude/webpieces/ai-hook.sh != renderShim() | the guard bin | JS |
|
|
19
20
|
| `C` | webpieces.config.json missing | the guard bin | JS |
|
|
20
21
|
| `Y` | a loaded rule has no webpieces.config.json key | the guard bin | JS |
|
|
21
22
|
|
|
22
|
-
First match wins. `D`/`X`/`K` are decided in POSIX `sh` inside the committed shim, BEFORE the
|
|
23
|
+
First match wins. `D`/`X`/`U`/`K` are decided in POSIX `sh` inside the committed shim, BEFORE the
|
|
23
24
|
guard bin runs — a stale, missing or broken validator cannot be trusted to validate itself.
|
|
24
25
|
|
|
25
26
|
## The fix, per fault
|
|
@@ -37,6 +38,10 @@ the option you pick EXACTLY as written and run nothing else on that line.
|
|
|
37
38
|
|
|
38
39
|
- **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
|
|
39
40
|
|
|
41
|
+
### `U` — guard bin missing AND @webpieces/ai-hook-rules is not declared in package.json
|
|
42
|
+
|
|
43
|
+
- **Option 1 (preferred)**: `pnpm add -D @webpieces/ai-hook-rules` ← pick this when this fault fires at all — package.json asks for nothing, so pnpm install reports "Lockfile is up to date" and leaves the tree exactly as broken as it found it
|
|
44
|
+
|
|
40
45
|
### `K` — guard bin present but CRASHED (exit code not 0 or 2 — corrupt node_modules)
|
|
41
46
|
|
|
42
47
|
- **Option 1 (preferred)**: `rm -rf node_modules && pnpm install` ← pick this when this fault fires at all — a BARE pnpm install SKIPS the corrupt package, because pnpm sees the right version on disk and considers it installed; only the delete forces a rewrite
|
|
@@ -69,7 +74,7 @@ The tool is not a dimension either: "any Read" is an allowlist ENTRY, not a tool
|
|
|
69
74
|
|
|
70
75
|
## The allowlist
|
|
71
76
|
|
|
72
|
-
ONE list, consulted identically by
|
|
77
|
+
ONE list, consulted identically by every fault. A cure that cannot help a given fault also
|
|
73
78
|
cannot hurt it, and gating each entry on a fault is what produced four real defects (a stale
|
|
74
79
|
shim that denied `pnpm install` and `git pull`; faults that denied every Read; a config fault
|
|
75
80
|
that denied `rm -rf node_modules && pnpm install` while allowing a bare `pnpm install`).
|
|
@@ -84,7 +89,8 @@ that denied `rm -rf node_modules && pnpm install` while allowing a bare `pnpm in
|
|
|
84
89
|
| 6 | pnpm exec wp-upgrade-shim | ALLOW |
|
|
85
90
|
| 7 | cp node_modules/@webpieces/ai-hook-rules/templates/ai-hook.sh .claude/webpieces/ai-hook.sh | ALLOW |
|
|
86
91
|
| 8 | pnpm exec wp-install-ai-hooks (flags allowed, e.g. --target=project) | ALLOW |
|
|
87
|
-
| 9 |
|
|
92
|
+
| 9 | pnpm add -D @webpieces/ai-hook-rules (an @version and extra flags allowed) | ALLOW |
|
|
93
|
+
| 10 | read-only orientation: pwd, git status/log/diff/show/branch/rev-parse, git worktree list | ALLOW |
|
|
88
94
|
|
|
89
95
|
- **PASS** — L0 has no objection; the call falls THROUGH so the downstream guards still judge it.
|
|
90
96
|
- **ALLOW** — terminal; bypasses everything, because a cure must stay reachable even when a
|
|
@@ -100,7 +106,7 @@ a DIFFERENT command and it is rejected again — that is not the guard refusing
|
|
|
100
106
|
## Known asymmetry
|
|
101
107
|
|
|
102
108
|
Under `S`/`C`/`Y` the guard bin IS running, so a PASS really does fall through to the downstream
|
|
103
|
-
guards. Under `D`/`X`/`K` the bin is never executed, so there is nothing to fall through to and a
|
|
109
|
+
guards. Under `D`/`X`/`U`/`K` the bin is never executed, so there is nothing to fall through to and a
|
|
104
110
|
PASS degenerates into a terminal allow — reads are unguarded during those three faults.
|
|
105
111
|
|
|
106
112
|
## Widening L0
|