Skip to content

java-security 0.2.0: reach the write path through the script gate - #98

Merged
jothimani-rajendran merged 2 commits into
mainfrom
claude/java-security-script-gate
Sep 22, 2026
Merged

jothimani-rajendran merged 2 commits into
mainfrom
claude/java-security-script-gate

Conversation

@jothimani-rajendran

@jothimani-rajendran jothimani-rajendran commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

What

java-security switches from hook.script on [commit] to a hook.gate of kind script on [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.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; 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.
  • 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. 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.py drives the gate over its stdin protocol (83 checks: 44 rule cases, 8 flow cases, the gate protocol, the setup page). tools/check_effects.py feeds a script gate the same way.
  • skills/configure-java-security/SKILL.md no longer describes its own wiring; the commit hook and tool-use door come from chock sync, the ambient line from INDEX.md.
  • Registry, README rows, policy docs and adoption transcript regenerated.

Built on the chock v0.10.0 adoption (#97, merged); the diff against main is 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 check clean (0 errors) here and in a staged adopter built as ci.yml does
  • chock check --only evals green: java-security 25/25 executed, score 1.00
  • chock sync --repo . --check clean
  • python tools/gen_policy_docs.py --check and python tools/check_readme.py pass
  • The policy claims only what it can do — enforced-at-commit and the tool-use door, both exit non-zero on a deny
  • At least one authored eval case that could have failed — 25 authored cases replay against the gate

If this touches implementations/

  • I understand this script becomes a git hook that runs on every commit in an adopter's repository, and a guard consulted before their agent runs a command
  • The script is read in full by a reviewer, not just the diff — java-security-gate.py is 54 lines

🤖 Generated with Claude Code

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>

Copy link
Copy Markdown
Collaborator Author

CI status: the policies check on this PR shares #97's blocker: the framework checkout fetches refs/tags/v0.10.0, which is not on open-coder-ai/chock yet. Not this diff's failure. Once the tag exists I will re-run the failed job here; locally, against an engine built from the 0.10.0 merge commit, chock check is clean and the java-security evals replay 25/25.


Generated by Claude Code

@jothimani-rajendran
jothimani-rajendran marked this pull request as ready for review September 22, 2026 16:20
@jothimani-rajendran
jothimani-rajendran changed the base branch from adopt/framework-v0.10.0 to main September 22, 2026 16:20
@jothimani-rajendran
jothimani-rajendran merged commit 9a376d3 into main Sep 22, 2026
13 checks passed
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.

2 participants