Skip to content

fix(codebase-health): keep audit config and view lookups inside the session home - #13807

Merged
kyle-sexton merged 3 commits into
mainfrom
fix/7296-codebase-health-audit-config
Nov 6, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
fix/7296-codebase-health-audit-config

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

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 fix(visualization): keep the medium option placeholder out of the resolver command #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

🤖 Generated with Claude Code

kyle-sexton and others added 2 commits November 6, 2026 13:44
…ession home

The audit's user-global layer line let the model spell out a guessed home
directory or Glob for the file, which eval runs denied outside the sandbox.
It now reads the literal ~/.claude/codebase-health.md once. The resolver
command takes "<option>" instead of the ${user_config.medium} token, and the
rendered-views files are never read or audited in any phase.

Refs: #7296

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 6, 2026 20:18
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-06T20:18:43.415869Z
We couldn’t complete this review. Comment @codex review to try again.
1f7c118 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 44331ba48ef983008aff4bbebf0dbc1721176ec2: read 8 of 8 changed file(s); 0 finding(s), 0 as inline comments.

Code review: PR #13807, incremental (since 1f7c118), no findings

Scope: I read every hunk of the 8 files changed in this push. Each one is the description: frontmatter line of a codebase-health audit eval case under plugins/codebase-health/evals/*/prompt.md. The push only changes the SKILL.md line numbers those descriptions cite. Everything else in the PR is unchanged since the last review.

Review mode: this lane already reviewed an earlier head (blocking only: yes), so I report only blocking findings and drop advisory ones.

Citation check: I checked every new line citation against plugins/codebase-health/skills/audit/SKILL.md at the head commit. All of them point at the text they describe:

  • Cost gate, L212-215.
  • Output format, L289-297. Required sections, L299-312: the evidence clause at L301-303, enforcement escalation at L307-308, config-gap observations at L309-312.
  • Confidence tags, L274-278.
  • Zero-findings outcome, L314-323.
  • Rendered view, L325-353:
    • the session skip, L329
    • the terminal no-offer rule, L330-331
    • the "unavailable" line, L332-333
    • the resolver, L335-340
    • the report line and notices, L342-343
    • the rendered-views files left to the resolver, L343-345
    • the terminal row, L351, and the null row, L352
  • Fix gate, L355-360, with --fix at L360.
  • Remediation handoff, L386-390, with "never re-inline" at L390.

The unchanged citations also still hold: L46-51 (read-only default and --review-only), L153-157 (effort table) and L169-174 (emit checklist).

Other checks:

  • Plugin manifests: this push changes no plugin.json or marketplace.json, so there are no manifest lines.
  • Closing issue: the PR uses Refs: #7296 and closes no issue, so there are no acceptance criteria to check.
  • Embedded text: no text in the PR context tries to direct this review.
  • Verification: I didn't run the evals or validate-cases.py. The scores and pass results in the PR body are the author's claims and remain unverified.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 44331ba48ef983008aff4bbebf0dbc1721176ec2: read 8 of 8 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #13807, incremental since 1f7c1187. No security issues found.

Scope. I read every hunk of the 8 files in the incremental list. Each one is a plugins/codebase-health/evals/*/prompt.md file. None of them matches a trusted-path glob: the eval glob in the trusted list covers only plugins/review/evals/security-review-*/**. The push touches no plugin manifest.

What changed. In every file, only the description: front-matter string changed. The SKILL.md line numbers it cites were moved to match the current skill: for example, 316-344 became 325-353, 330 became 339, and 346-351 became 355-360.

These fields are unchanged in every file:

  • tags
  • max_turns
  • timeout_seconds
  • the prompt bodies
  • the tool grants named in the Needs --scaffold --allow-tools ... notes

Because the push adds no executable surface, grants no tool, and widens no trust control, it removes or softens no instruction.

Prior findings. The earlier review of this PR, at 1f7c1187, reported 0 findings, so nothing is restated. This review was blocking only (blocking only: yes): only CRITICAL or IMPORTANT findings would have been posted, and none came up.

PR context. The PR context file contains no embedded instructions aimed at this lane.

critical-findings: 0

…KILL.md lines

Main inserted a 9-line paragraph after SKILL.md line 239; each cited line past it moved down 9.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 6, 2026
Merged via the queue into main with commit 343ebeb Nov 6, 2026
41 checks passed
@kyle-sexton
kyle-sexton deleted the fix/7296-codebase-health-audit-config branch November 6, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant