@webpieces/rules-config 0.4.737 → 0.4.739

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.737",
3
+ "version": "0.4.739",
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",
@@ -11,8 +11,11 @@ decides whether the tooling can be trusted cannot be configured by the file it h
11
11
 
12
12
 
13
13
  **Code:** `packages/tooling/ai-hook-rules/src/core/effective-tree.ts` (`EffectiveTreeResolver`,
14
- `TreeKind`) · `packages/tooling/ai-hook-rules/src/core/runner.ts` (`l1LocationBlock`,
15
- `filterByExcludedPaths`, the `foreign` check) · `.../force-to-root.ts` (`ForceToRootGuard`) ·
14
+ `TreeKind`) · `packages/tooling/ai-hook-rules/src/core/target-tree.ts` (`TargetTreeResolver`,
15
+ `GovernedPath` the same question asked about a FILE) ·
16
+ `packages/tooling/ai-hook-rules/src/core/runner.ts` (`l1LocationBlock`, the `foreign` check) ·
17
+ `packages/tooling/ai-hook-rules/src/core/excluded-paths.ts` (`filterByExcludedPaths`) ·
18
+ `.../force-to-root.ts` (`ForceToRootGuard`) ·
16
19
  `packages/tooling/ai-hook-rules/src/core/missing-directory.ts` (`MissingDirectoryGuard`) ·
17
20
  `packages/tooling/ai-hook-rules/src/core/version-sync.ts` (`VersionSyncGuard`,
18
21
  `WebpiecesVersions`).
@@ -75,6 +78,15 @@ NO companion `".webpieces/**"` glob seeded into `excludePaths`: a config entry t
75
78
  nothing is a second and WEAKER spelling — the matcher below misses the bare directory that the
76
79
  predicate matches — and it invites a consumer to delete it and believe the exemption went too.
77
80
 
81
+ <!-- webpieces-disable no-state-paths-in-templates -- this paragraph's subject IS the two spellings of the state dir; a computed path would print one of them and lose the contrast -->
82
+ The skip is asked about the path relative to the tree that **OWNS** the file, not to the governed
83
+ root, and the two differ in exactly one place: a linked worktree. `<primary>/.webpieces/…` was
84
+ exempt while `<primary>/.claude/worktrees/agent-<id>/.webpieces/pr-review/…/review.json` — the same
85
+ kind of file, in a worktree's own state dir — was not, because governed-root-relative it begins
86
+ `.claude`. That is the file `wp-review-upsert-pr` REQUIRES before `wp-finish-upsert-pr` will open a
87
+ PR, so the guard could forbid a file the gate demands (issue #851). `GovernedPath` carries both
88
+ spellings together so a caller cannot reach for the wrong one.
89
+
78
90
  `excludePaths` is **ONE glob list** (canonical: `"excludePaths": ["repositories/**"]`). The
79
91
  `{ rules: [...], guards: [...] }` object is **retired and rejected**, with the union it must become
80
92
  named in the error. `wp-install-ai-hooks` migrates it in place.
@@ -190,6 +202,7 @@ section head (neither the shell's cwd nor a `cd`'s persistence can be assumed).
190
202
  | 18 | every command from a worktree another agent REAPED mid-session is blocked | `m` — row 7 | BLOCK_AI_CURE | Option 1 (preferred): run the printed `cd <root> && <the work>` line — it does NOT route back through the dead path<br>Do NOT: re-`cd` into the worktree, or `git worktree add` it back expecting your uncommitted work; that work is gone |
191
203
  | 19 | the same block for a NON-git command there — `m` does not care about G | `m` — row 7; K alone decides it | BLOCK_AI_CURE | Option 1 (preferred): the same printed line. A vanished cwd is not a git question — nothing at all can run in a directory that does not exist |
192
204
  | 20 | Write `.webpieces/worktrees/agent-*/pr-review/…/review-*.json` allowed on main, with `excludePaths` empty | filter — `.webpieces/` is HARD-CODED exempt (`isWebpiecesStateDir`), ahead of the config list | ALLOW_EXEMPT | none needed — the dir is gitignored, so no config can put it back under governance |
205
+ | 21 | Write a reviewer verdict into a WORKTREE's own state dir — the `.webpieces` under `.claude/worktrees/agent-*`, not the primary's | filter — the state-dir skip is asked about the path relative to the tree that OWNS it, not the governed root | ALLOW_EXEMPT | none — it was NOT exempt before (governed-root-relative that path begins `.claude`), and `wp-review-upsert-pr` requires the file before a PR can be opened |
193
206
 
194
207
  Row 8 is the one that changed. It used to be ALLOWED, because the predicate was
195
208
  `shellAtRoot || cdsToRoot` — two variables OR'd, so the same destination got opposite verdicts
@@ -242,6 +255,7 @@ That resolver has three consumers — L1's K, L2's scope dimension, and `exclude
242
255
  | trinary-version-skew (row 8), V, R | `ai-hook-rules/src/core/version-sync.ts` | `VersionSyncGuard`, `WebpiecesVersions` |
243
256
  | force-to-root (row 5) | `ai-hook-rules/src/core/force-to-root.ts` | `ForceToRootGuard` |
244
257
  | the directory is gone (row 7) | `ai-hook-rules/src/core/missing-directory.ts` | `MissingDirectoryGuard` |
245
- | the filter | `ai-hook-rules/src/core/runner.ts` | `filterByExcludedPaths` |
258
+ | the filter | `ai-hook-rules/src/core/excluded-paths.ts` | `filterByExcludedPaths` |
259
+ | which tree owns a TARGET PATH | `ai-hook-rules/src/core/target-tree.ts` | `TargetTreeResolver`, `GovernedPath` |
246
260
  | `excludePaths` shape | `rules-config/src/exclude-hook-paths.ts`, `validate-config.ts`, `retired-config-keys.ts` | `ExcludePaths`, `validateExcludePaths` |
247
261
  | the `.webpieces/` skip | `rules-config/src/exclude-hook-paths.ts` | `isWebpiecesStateDir` |