java-security 0.2.0: reach the write path through the script gate - #98
Merged
Merged
Conversation
Switches the policy from hook.script on [commit] to a hook.gate of kind script on [commit, tool_use], the kind chock 0.9.3 introduced and this catalog adopted. The construct is now refused as the agent writes it, on every vendor the write fragment reaches, and at the turn's end -- not only at the commit that carries it. implementations/java-security-gate.py replaces java-security-pre-commit.py: it reads the writes from the runner's stdin payload instead of from git, and refuses on a deny, on an ask (a gate has no terminal), on an unreadable selection and on any failure inside the engine, exactly as before. The artifact becomes hook, so the two-line rule text gives way to the gate message, which names the eight constructs and the selection contract. 25 of the 28 eval cases gain the staged-files form `chock check --only evals` replays against the compiled gate, selection file included where the case is about one. tools/check_java_security.py drives the gate over its stdin protocol; tools/check_effects.py feeds a script gate the same way. Needs an engine carrying the script-gate eval replay and the address-free ambient line (the fix after chock 0.9.3), adopted by this catalog. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
Collaborator
Author
|
CI status: the Generated by Claude Code |
6 tasks
jothimani-rajendran
marked this pull request as ready for review
September 22, 2026 16:20
jothimani-rajendran
changed the base branch from
adopt/framework-v0.10.0
to
main
September 22, 2026 16:20
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
java-securityswitches fromhook.scripton[commit]to ahook.gateof kindscripton[commit, tool_use], the kind chock 0.9.3 introduced and 0.10.0 made replayable. An adopter now sees the eight constructs refused as the agent writes them, on every vendor the write fragment reaches, and again at the turn's end, not only at the commit that carries them.implementations/java-security-gate.pyreplacesjava-security-pre-commit.py. It reads the writes from the runner's stdin payload instead of from git and refuses on a deny, on an ask (a gate has no terminal), on an unreadable selection and on any failure inside the engine, exactly as before.hook; the two-line rule text gives way to the gate message, which names the eight constructs and the selection contract. Version 0.2.0 with a changelog entry.chock check --only evalsreplays against the compiled gate, selection file included where the case is about one. The remaining three (tc-025, tc-027, tc-028) are about agent behaviour, not a write, and stay agent-mode material.tools/check_java_security.pydrives the gate over its stdin protocol (83 checks: 44 rule cases, 8 flow cases, the gate protocol, the setup page).tools/check_effects.pyfeeds a script gate the same way.skills/configure-java-security/SKILL.mdno longer describes its own wiring; the commit hook and tool-use door come fromchock sync, the ambient line fromINDEX.md.Built on the chock v0.10.0 adoption (#97, merged); the diff against
mainis only the policy change.Residuals, unchanged by this PR: INT-3 verb-first warnings on both ids; the setup page footer still mentions
chock-security setup apply; the rule engine lives in chock-java-security until that repo is retired.Definition of done
chock checkclean (0 errors) here and in a staged adopter built asci.ymldoeschock check --only evalsgreen: java-security 25/25 executed, score 1.00chock sync --repo . --checkcleanpython tools/gen_policy_docs.py --checkandpython tools/check_readme.pypassenforced-at-commitand the tool-use door, both exit non-zero on a denyIf this touches
implementations/java-security-gate.pyis 54 lines🤖 Generated with Claude Code