Repository navigation
feat(claude-config): script the deterministic audit checks and emit audit-pass-shaped findings - #3991
Conversation
Interview output for scoping changes to the claude-config audit skill: script-first engine for deterministic rows, audit-pass-shaped findings, declared session posture, plugin-declared hook coverage, and the mechanical fixes observed on a 2026-09-08 cloud run. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01My8tf3usypMrUUZodghKvD
…udit-pass-shaped findings The audit skill now runs an engine for every check that needs no reasoning and reserves the model for judgment. audit-engine.sh covers scope discovery, JSON validity, the baseline deny and ask patterns, the three narrowings, hook inventory, plugin drift, the skill-listing budget, and the env-vars cross-check, and writes a findings artifact in the audit-pass identity shape so both skills share one suppression record. Scopes it cannot read are reported as not inspectable rather than clean. check-plugin-drift.sh resolves directory-source marketplaces against the marketplace directory instead of the registry cache, and check-hook-coverage.sh resolves plugins marketplace-directory first and reports cache divergence. check-doc-citations.sh verifies every quoted upstream span against the live page; the permissions page had already moved under one of them, which is re-quoted here. Guardrails ships a hooks/coverage.json manifest so the narrowing is a lookup. The repository's own findings are applied: project settings carry the baseline Read denies, and .claude/audit-pass.md records the team decision that cloud sessions push without an ask gate. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01My8tf3usypMrUUZodghKvD
…4277l # Conflicts: # plugins/claude-config/.claude-plugin/plugin.json # plugins/claude-config/CHANGELOG.md
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Claude finished @kyle-sexton's task in 9m 32s —— View job Claude finished the code reviewRan 5 confirmed findings, posted inline:
Investigated and dropped (didn't survive verification, in the interest of transparency):
Also reviewed, no issues found: the SKILL.md / context / reference doc updates for the audit skill (checked for consistency against the engine's actual field names, severities, and exit codes — all matched), the plugin version bumps and CHANGELOGs, the new |
|
Claude finished @kyle-sexton's task in 13m 34s —— View job Security review — PR #3991
Ran Two findings are posted as inline comments on IMPORTANT — coverage-manifest claim isn't corroborated against the actual hook inventory
A directory-source marketplace declared in the audited repo's own This is largely intended narrowing behavior (documented as "narrowing 3" in A third candidate (path traversal via an unvalidated No command injection, |
…nreadable scope Bash applies redirections left to right, so `: <file 2>/dev/null` prints the open() failure before stderr is redirected. The engine's probe, the test's own root guard, and check-structure.sh redirect stderr first, so an unreadable settings.local.json no longer prefixes the JSON document with a permission-denied line. The engine suite's case 13 now runs cleanly as a non-root user, which is how CI runs it. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01My8tf3usypMrUUZodghKvD
|
Claude has reviewed this PR 1 time. The lane skips further automatic reviews after 5; deleting this comment resets the count. |
…e audit scripts The four new scripts carry the executable bit the exec-bit gate expects. The two test fixtures that spell a Windows path no longer read as a GNU regex escape to the portability lint: one carries the reviewed portability-ok marker and the other spells its backslashes as the JSON \ escape. The interview brief under docs/topics is pruned, as the contract tier requires before merge; its content lives in the design issue the pull request closes. check-plugin-drift.sh no longer exits fatally when curl is absent, since a directory-sourced marketplace needs no network; a repo-sourced one is recorded as a fetch failure instead. check-doc-citations.sh reads a final manifest row that has no trailing newline, with a test that proves it. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01My8tf3usypMrUUZodghKvD
|
Last security-reviewed head: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8799a117d9
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…nd hook inventory check-hook-coverage.sh encodes a hook's args once, so the engine sees an array and its placeholder-quoting check fires again; an unparsable directory catalog is reported as unreadable and leaves the inventory partial instead of reading as "plugin absent". The engine reads a hook command's first word the way the shell does, so a quoted path with a space resolves whole. A hook command from a personal scope, or one carrying a token-shaped value in any scope, is named by its excerpt hash in every claim and detail, so a pasted suppression stanza never carries the command. A baseline reference that parses to no pattern is reported as unparsed rather than producing no category B rows. Marketplace names are matched as fixed strings, and the drift script runs without curl. Fixing the redaction exposed a latent gap: the tab-separated inventory read folded an empty timeout field, so every hook without a timeout shifted its type into the timeout column and dropped out of category D. The read now carries a sentinel for an empty middle field. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01My8tf3usypMrUUZodghKvD
A coverage manifest is a plugin's claim about its own enforcement, not evidence of it. The engine now takes an entry only when the hook it names appears in the enumerated inventory on the event and matcher the entry declares, matched on the hook's file name so a dispatcher that runs the named guard as an argument still counts. An entry naming a hook the plugin does not register is reported and narrows nothing. An unread lever is not an unset lever. When a settings scope does not parse, the hook inventory reports its lever state unknown, and the engine refuses the narrowing and says so, which is what required-permissions.md already prescribed and the engine did not do. A debug log the engine discovered rather than was given now settles the skill-listing row only when the log names the project being audited; the debug directory also holds other sessions' logs, and a stale one carrying no warning would otherwise read as clean. CLAUDE_CODE_DEBUG_LOGS_DIR stays a file path, which the env-vars page states and doc-citations.tsv now pins. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01My8tf3usypMrUUZodghKvD
Closes #3989
Closes #3990
Summary
The
claude-config:auditskill now runs a deterministic engine for every check that needs no reasoning and reserves the model for judgment. The engine writes its findings in theaudit-passidentity shape, so the two skills share one suppression record. The drift and hook-coverage bugs found during the audit of this repository are fixed, and the repository's own audit findings are applied.Fix
scripts/audit-engine.sh(new): scope discovery, JSON validity,$schema, baseline deny and ask patterns fromrequired-permissions.md, the three narrowings, hook inventory, plugin drift, skill-listing budget from the session debug log, and the env-vars page cross-check.--tableor--json;--outwrites a findings artifact withcheck,claim,sites(anchor/v1), andfinding_id;anchorandfinding-idsubcommands give a judged finding the same identity. A scope the engine cannot read is reported as not inspectable, never clean. Reads.claude/audit-pass.mdthrough the config-cascade layers: only the team layer suppresses, personal-only entries are reported as not applied, and malformed entries never suppress. Every table finding carries a paste-readysuppress:line.required-permissions.mdcarries both as preconditions.scripts/check-doc-citations.sh+reference/doc-citations.tsv(new): verifies every quoted upstream span against the live page, including a final row with no trailing newline. The permissions page had already moved under one span; it is re-quoted. The manifest also pins the sentence stating thatCLAUDE_CODE_DEBUG_LOGS_DIRis a file path despite its name.check-plugin-drift.sh: directory-source marketplaces resolve against<path>/.claude-plugin/marketplace.json, not the registry cache; reportssource. A missing curl is no longer fatal: directory-sourced catalogs still audit and each repo-sourced one is recorded as a fetch failure.check-hook-coverage.sh: marketplace-directory-first resolution,DIVERGENCEwhen the cache copy differs, an unparsable directory catalog reported rather than read as "plugin absent",lever_state, and a widened--json(project root, hook timeout/type/args, plugin paths, divergence list).hooks/coverage.json(new): the coverage manifest that turns the narrowing into a lookup. Guardrails 0.32.23.settings-reference, and degrades the known-issues check from the API to/claude-ops:known-issuesto an unverified statement dated from the newLast verifiedcolumn; Phase 4 reports suppressed and undecided rows and persists the findings artifact;## Nextsection added. B.5 rows areinfo. A debug log the engine discovered rather than was given settles the skill-listing row only when the log names the project being audited.audit-pass:/claude-config:auditis a delegated lane. Rows append unchanged; engine rows carry thederivedtier, model rowsjudged..claude/settings.jsoncarries the baselineReaddenies;.claude/audit-pass.mdrecords the team decision that cloud sessions push without an ask gate;docs/CLOUD-SESSIONS.mdstates the playgrounds opt-out reason.Verification
scripts/affected-tests.sh --run: every selected suite passes.audit-engine.test.sh118 checks as a non-root user (114 as root, where the unreadable-file case skips),check-hook-coverage.test.sh85,check-plugin-drift.test.sh75,check-doc-citations.test.sh21,coverage-manifest.test.sh17.check-doc-citations.shlive: 33 spans checked, 0 missing.audit-engine.shon this repository: 126 rows, 15 findings, 0 errors, 0 warnings, the two ask-gate rows suppressed by the team layer.check-changelog-parity.sh --checkand--check-bump origin/main,check-contract-slice-prune.sh --check-diff origin/main,check-shell-portability.sh origin/main, andvalidate-plugins.shpass; shellcheck, shfmt, and markdownlint clean on every changed file.CLAUDE_CODE_DEBUG_LOGS_DIRis a file path, not a directory, and that sentence is now covered by the citation checker.Related
docs/topics/is pruned per the contract tier.audit-passfinding-suppression and config-cascade conventions.🤖 Generated with Claude Code
https://claude.ai/code/session_01My8tf3usypMrUUZodghKvD