Repository navigation
Commit 343ebeb
fix(codebase-health): keep audit config and view lookups inside the session home (#13807)
Refs: #7296
## Summary
`/codebase-health:audit` drew out-of-sandbox lookups in eval runs
(cutoff rows c48hr, c48hrb, c48hwe): the model wrote the user-global
config path with a guessed home directory, or Globbed the home tree for
it. Read-only cases audit-cost-gate, audit-unscoped-cost-gate and
audit-zero-findings were INVALID twice on that denial.
## Fix
`plugins/codebase-health/skills/audit/SKILL.md`, line count unchanged so
the cases' line citations hold:
- Line 114: the user-global layer is one Read of the literal
`~/.claude/codebase-health.md`, `~` kept; never a Glob, a spelled-out
home directory or a search of the home tree. A host probe (Claude Code
2.1.319, HOME set to a seeded directory) showed Read of the literal
`~/...` path returned the seeded file, while Glob with a `~` pattern
returned no files, so the old Glob route also missed a real user's file.
The layer stays: real users keep their user-global config.
- Lines 326-330: the resolver command takes `--option "<option>"`, and
the prose names `${user_config.medium}` and says never to put a
`${user_config.*}` string in a shell command, as #13502 did for
visualization. This removes the c48hb denial of a command carrying the
raw token.
- Lines 334-335: the rendered-views files are never read, listed or
audited in any phase. audit-view-team-terminal failed
`no-convention-read` in 3 of 3 with-arm runs because discovery Read
`docs/conventions/rendered-views.yaml`.
The audit-view-* losses (c48hbb) were not caused by the token: all 6
with-arm runs passed `--option ""`, and every resolver call failed
because `node` resolved to a mise shim that refused its untrusted
config. The before/after runs put a real node on the eval PATH on both
sides.
## Verification
- `validate-cases.py plugins/codebase-health`: 0 FAIL.
- `scripts/check-changelog-fragments.sh --check`: pass. Pre-push
`check-affected`: pass.
- Before/after eval pairs, 3 runs per arm. Before = `origin/main`
999b26c (no codebase-health change since base); after = head
a9811f8. Scores are with-arm / without-arm. Both arms ran with a real
node 24.21.0 and jq 1.8.2 first on PATH, because the mise node shim
refuses its config under the eval HOME.
- Read (cost-gate, unscoped-cost-gate, zero-findings): before INVALID on
a denied Read of the user-global config through a written-out home path.
After VALID, and all 9 with-arm lookups are `Read
~/.claude/codebase-health.md`. cost-gate 1/0.67/1 vs 0.67x3;
unscoped-cost-gate 1/1/0.75 vs 0.5x3; zero-findings 1x3 vs 0.5x3.
- View (view-retired-terminal, view-team-terminal): before INVALID on
the `${user_config.medium}` token in the resolver call. After VALID:
retired 0.8x3 vs 0.6x3; team 0.75/1/1 vs 0.5x3.
- Write,Edit (5 cases): the before side's only denial is a `Glob` for
the home config in audit-fix-delegates, so the pair is read on the other
4 cases and audit-fix-delegates is reported alone. After VALID on the
one allowed re-run; the first after run was INVALID on one plugin-tree
Glob in settings-schema-routes-out (1 of 3 runs), a call this PR did not
add. boundary-uncovered 1x3 vs 0.83x3; infers-and-offers-setup 1x3 vs
0.5x3; review-only-stops 1x3 vs 0.875x3; settings-schema-routes-out
1/0.86/1 vs 0.71x3; fix-delegates 0.75/0.875/0.625 vs 0.5/0.375/0.5. On
the 4 shared cases, no after score is below the before side.
- Bash,Write,Edit (planted-drift): before INVALID on the token. After
VALID: 0.92/0.85/1 vs 0.23x3.
- Bash,Write (view-publishing-ignored): before INVALID on the token.
After VALID: 0.71/1/0.71 vs 0.29x3.
## Remaining on #7296
- codebase-health `audit` needs a VALID run on both arms for every case
after this merges.
## Related
- #7296
- #13502
<!-- session: hitl-backlog -->
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>1 parent 0a288da commit 343ebeb
10 files changed
Lines changed: 20 additions & 13 deletions
File tree
- .changes/codebase-health
- plugins/codebase-health
- evals
- audit-cost-gate
- audit-fix-delegates
- audit-planted-drift
- audit-review-only-stops
- audit-view-publishing-ignored
- audit-view-retired-terminal
- audit-view-team-terminal
- audit-zero-findings
- skills/audit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
0 commit comments