Repository navigation
fix(install): installed content is what verify says it is (CH-4) - #309
Merged
Merged
Conversation
add and verify refuse a pack shipping __pycache__ or .pyc/.pyo, and policy scripts run with PYTHONDONTWRITEBYTECODE=1. The runtime loader hashes the shared runtime's bytes before exec and compares that to its pin; the self-declared digest constant is gone. gate.py exits 2 on undecodable stdin at agent events. A test scaffolds each kind and runs the evals. .chock/bin and its drift tests need the owner's regeneration. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Jothi Mani Rajendran <250249270+jothimani-rajendran@users.noreply.github.com>
…F (CH-4) The pin is the sha256 of the LF text. A Windows text-mode write or a checkout with autocrlf turns it into CRLF, so the byte hash never matched and every call failed closed, refusing correct work. The loader now hashes the bytes with CRLF read as LF and still executes the bytes it read; a one-byte edit, with or without CRLF, still refuses. .chock/bin still needs the owner's regeneration. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Jothi Mani Rajendran <250249270+jothimani-rajendran@users.noreply.github.com>
…ne + CH-4 bytecode-off) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Jothi Mani Rajendran <250249270+jothimani-rajendran@users.noreply.github.com>
Signed-off-by: Jothi Mani Rajendran <250249270+jothimani-rajendran@users.noreply.github.com>
… not exec (CH-4) Signed-off-by: Jothi Mani Rajendran <250249270+jothimani-rajendran@users.noreply.github.com>
Signed-off-by: Jothi Mani Rajendran <250249270+jothimani-rajendran@users.noreply.github.com>
jothimani-rajendran
marked this pull request as ready for review
October 20, 2026 19:47
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
CH-4 (chock M3, M4, S1, S3):
chock addandverifyrefuse a pack that ships__pycache__or.pyc/.pyo. The pack hash still ignores bytecode.PYTHONDONTWRITEBYTECODE=1(guard, script gate, tool-call gate, eval harness), so running a gate leaves no bytecode in the pack.CHOCK_RUNTIME_DIGESTconstant is removed, so a modified file can no longer pass by keeping its own digest line.gate.pyexits 2 on stdin that is not UTF-8 at agent events, instead of reading it with replacement characters.chock new policy --kindand runschock check --only evals, and compiles the generated Python with warnings as errors. Every kind already passed on main; this pins it.Needs the owner
The loader template and
gate.pychanged, so.chock/bindrifts. Runchock sync --repo .on this branch. Until thentests/test_runner_selfcontained.py::test_vendored_gate_py_matches_sourceandtests/test_compiled_freshness.py::test_this_repo_has_compiled_what_it_declaresfail. Runtime goldens are regenerated in this PR.Checks
Full suite on Linux/py3.13: 4638 passed, 46 failed before a fix to the packaged gate; after it, the only failures are the two drift tests above plus
tests/test_properties.py, which needs a package the test environment lacks. ruff check, ruff format and the literal-duplication tool are clean.