@webpieces/rules-config 0.4.536 → 0.4.537
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.537",
|
|
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",
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# webpieces guard matrix — L0 (tooling integrity)
|
|
2
|
+
|
|
3
|
+
GENERATED from `L0_FAULTS` + `L0_ALLOWLIST` in `@webpieces/ai-hook-rules`. Do not hand-edit —
|
|
4
|
+
a unit test locks this file byte-identical to `renderGuardMatrixDoc()`, so the table below is
|
|
5
|
+
the array the guard actually consults, not a description of it.
|
|
6
|
+
|
|
7
|
+
L0 is the OUTERMOST guard layer. It blocks work while `node_modules`, the committed shim, or
|
|
8
|
+
`webpieces.config.json` are in a state that makes every other guard untrustworthy. If you are
|
|
9
|
+
reading this, one of the six faults below fired and named this file.
|
|
10
|
+
|
|
11
|
+
## The faults
|
|
12
|
+
|
|
13
|
+
| code | fault | detected by | enforced in |
|
|
14
|
+
|---|---|---|---|
|
|
15
|
+
| `D` | version drift — root package.json pin != installed version | sh, before the bin runs | sh |
|
|
16
|
+
| `X` | guard bin missing (fresh clone / new worktree / package removed) | sh, before the bin runs | sh |
|
|
17
|
+
| `K` | guard bin present but CRASHED (exit code not 0 or 2 — corrupt node_modules) | sh, before the bin runs | sh |
|
|
18
|
+
| `S` | committed .claude/webpieces/ai-hook.sh != renderShim() | the guard bin | JS |
|
|
19
|
+
| `C` | webpieces.config.json missing | the guard bin | JS |
|
|
20
|
+
| `Y` | a loaded rule has no webpieces.config.json key | the guard bin | JS |
|
|
21
|
+
|
|
22
|
+
First match wins. `D`/`X`/`K` are decided in POSIX `sh` inside the committed shim, BEFORE the
|
|
23
|
+
guard bin runs — a stale, missing or broken validator cannot be trusted to validate itself.
|
|
24
|
+
|
|
25
|
+
## The matrix
|
|
26
|
+
|
|
27
|
+
L0 has NO genuine second dimension. Every branch reduces to one question:
|
|
28
|
+
|
|
29
|
+
| # | fault | on the allowlist? | outcome |
|
|
30
|
+
|---|---|---|---|
|
|
31
|
+
| 1 | none | — | hand down to the next guard layer |
|
|
32
|
+
| 2 | any | yes | PASS or ALLOW (see the entry) |
|
|
33
|
+
| 3 | any | no | BLOCK — **only the message varies by fault** |
|
|
34
|
+
|
|
35
|
+
The tool is not a dimension either: "any Read" is an allowlist ENTRY, not a tool check.
|
|
36
|
+
|
|
37
|
+
## The allowlist
|
|
38
|
+
|
|
39
|
+
ONE list, consulted identically by all six faults. A cure that cannot help a given fault also
|
|
40
|
+
cannot hurt it, and gating each entry on a fault is what produced four real defects (a stale
|
|
41
|
+
shim that denied `pnpm install` and `git pull`; faults that denied every Read; a config fault
|
|
42
|
+
that denied `rm -rf node_modules && pnpm install` while allowing a bare `pnpm install`).
|
|
43
|
+
|
|
44
|
+
| # | allowed | outcome |
|
|
45
|
+
|---|---|---|
|
|
46
|
+
| 1 | any Read | PASS |
|
|
47
|
+
| 2 | a Write/Edit whose target is webpieces.config.json | PASS |
|
|
48
|
+
| 3 | pnpm|npm install | ALLOW |
|
|
49
|
+
| 4 | rm -rf node_modules && pnpm install - the cure for a CORRUPT node_modules | ALLOW |
|
|
50
|
+
| 5 | git pull / git fetch - merge is NOT on the list | ALLOW |
|
|
51
|
+
| 6 | pnpm exec wp-upgrade-shim | ALLOW |
|
|
52
|
+
| 7 | cp node_modules/@webpieces/ai-hook-rules/templates/ai-hook.sh .claude/webpieces/ai-hook.sh | ALLOW |
|
|
53
|
+
| 8 | pnpm exec wp-install-ai-hooks | ALLOW |
|
|
54
|
+
|
|
55
|
+
- **PASS** — L0 has no objection; the call falls THROUGH so the downstream guards still judge it.
|
|
56
|
+
- **ALLOW** — terminal; bypasses everything, because a cure must stay reachable even when a
|
|
57
|
+
downstream guard would block it.
|
|
58
|
+
|
|
59
|
+
Every Bash entry is anchored to the WHOLE command. A leading `cd <dir> &&`, a trailing `2>&1`
|
|
60
|
+
and a pipe into `tail`/`head` are tolerated; nothing else is. Appending `&& git status` makes it
|
|
61
|
+
a DIFFERENT command and it is rejected again — that is not the guard refusing its own cure.
|
|
62
|
+
|
|
63
|
+
`git merge` is deliberately NOT on this list. Main is merged ONLY through the 3-point fork merge
|
|
64
|
+
(`pnpm wp-start-update`, or `pnpm wp-start-upsert-pr` when a PR is already open).
|
|
65
|
+
|
|
66
|
+
## Known asymmetry
|
|
67
|
+
|
|
68
|
+
Under `S`/`C`/`Y` the guard bin IS running, so a PASS really does fall through to the downstream
|
|
69
|
+
guards. Under `D`/`X`/`K` the bin is never executed, so there is nothing to fall through to and a
|
|
70
|
+
PASS degenerates into a terminal allow — reads are unguarded during those three faults.
|
|
71
|
+
|
|
72
|
+
## Widening L0
|
|
73
|
+
|
|
74
|
+
Add an entry to `L0_ALLOWLIST` in `packages/tooling/ai-hook-rules/src/bin/shim.ts`. That array is
|
|
75
|
+
the single source for the JS allowlist, the `grep -E` inside the rendered shim, and this file.
|