Commit 788c8f2
Widen the scope rule past permissions, and move verifier worktrees out of the tree
Two defects in the review system's own instruments, found by Review 23 and left
open when that session was stopped. No production code changes.
Finding 186: the toolchain sweep's inventory counted four agent definitions where
twenty-eight resolve in a session here - four in project scope, seventeen in user
scope, seven from an enabled plugin. Seventeen of the twenty-four uncounted declare
Write or Edit where none of the four counted do. The cause was one character: a
relative .claude/agents/*.md reaches project scope only. The inventory is now
absolute-pathed and enumerates every definition kind - agents, skills, commands,
hooks - across every scope, resolves symlinks, and pins each installed plugin by
version and gitCommitSha rather than by its enabledPlugins name, which stays stable
while the marketplace re-syncs underneath it. It also records how many definitions
per scope declare a tool the repo-local set does not, which is the figure that
would have caught this.
No added reach: an agent's tools: key restricts and does not grant. The finding is
the ledger, not an exposure.
PA-19 is widened accordingly, from "a permission ledger is only as wide as the
scopes it enumerates" to the same statement about any ledger assembled from more
than one scope. Finding 162 fixed the permission half and stopped there, which is
why the identical mechanism was still sitting in the ledger next door one review
later. The entry now says outright that fixing a scope gap in one ledger owes the
same edit to every other ledger of that shape.
Finding 187: a leftover scratch worktree passed every integrity check the
adjudication stage prescribes. A worktree carries its own index, so git status in
the main checkout reports clean over one holding uncommitted edits, and both
HEAD-unchanged and generated-files-identical pass over it too. The measured harm is
not disk: the toolchain sweep greps .claude/ recursively, so a worktree under
.claude/worktrees/ is read as repository content by a later sweep - five hits become
twenty-eight, twenty-three of them from the scratch copy, one of them a line that
exists nowhere in the tracked tree. Git-ignoring the path made it invisible rather
than absent.
Worktrees now go outside the repository, created with --detach and removed with
--force, and the integrity check compares git worktree list, git branch and git
stash list against a snapshot taken before the stage, with a prune before the
retake. Each element was measured: git worktree list alone gives a false negative
after a remove that left the branch behind, and a false positive on a hand-deleted
worktree whose entry only prune clears; plain remove exits 128 on a dirty worktree,
which is exactly how a leftover arises. The .gitignore entry stays as an annotated
backstop rather than being deleted, so it does not read as dead config.
Also folded in: RI-25's ledger had drifted. Commit 64abf41 added a twelfth
third-party filter call, applied RI-25 correctly in the code, and left the count at
eleven in both files that carry it - finding 132's shape, in the ledger written one
review earlier to catch the previous instance. Corrected to twelve, all correct,
with the new call's arity verified against WooCommerce 7.9.0 source rather than
assumed.
Left for Review 24: 64abf41 itself has never been adjudicated. Its own fix session
recorded that three finding-verifier dispatches died to API-overload errors and the
evidence was produced inline instead, and it is a 201-line rewrite of the code that
has produced findings in four consecutive runs.
Documentation only - three .md files - so the phpcs/phpunit/build gate does not
apply under post-fix step 2. The suite was confirmed green at 64abf41 before this
session: 1965 tests, 4601 assertions, phpcs exit 0.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 64abf41 commit 788c8f2
3 files changed
Lines changed: 131 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
89 | 105 | | |
90 | 106 | | |
91 | 107 | | |
| |||
98 | 114 | | |
99 | 115 | | |
100 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
101 | 138 | | |
102 | 139 | | |
103 | 140 | | |
| |||
228 | 265 | | |
229 | 266 | | |
230 | 267 | | |
231 | | - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
232 | 284 | | |
233 | 285 | | |
234 | 286 | | |
| |||
239 | 291 | | |
240 | 292 | | |
241 | 293 | | |
| 294 | + | |
242 | 295 | | |
243 | 296 | | |
244 | 297 | | |
| |||
0 commit comments