Repository navigation
Conversation
….json (#319) The Claude stage hook runs a copy of stage_permissions.py from a temporary code-cycle-policy-* directory. The triage validator and the permission view derived their script paths from __file__, so the hook expected the copy's directory and refused the commands the runtime had advertised. StagePolicy now records runtime_dir when built in the runtime process, and the hook resolves both paths from policy.json.
Code Cycle initial review — PR #320[CCR-20261023-001] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2Verdict: APPROVED for head Summary and scopeReviewed the accumulated diff The change fixes #319: the stage hook runs a copy of Checked beyond the diff:
FindingsNone. Security triage
Executed verification
Unverified
CICI policy: Residual risk
|
Closes #319
Diagnosis
'python3' is not in the review stage's command table).stage_permissions.pyin acode-cycle-policy-*-style directory. Before the change the advertised commands were refused and the copy's directory was accepted; after it the behaviour is reversed. The cycle for ci: finish required checks fast for non-code changes without weakening validation #236 (PR ci(validate): finish required checks fast for non-code changes #318) showed the same refusals in production._triage_validator_path()andStagePolicy.permissions_commandderived the script directory fromPath(__file__). In the runtime process that is the installed runtime; in the hook process it is the temporary copy.policy.jsonasruntime_dir. The hook reads it instead of deriving it._triage_validator_path()becameStagePolicy.triage_validator_path, so the prompt, theallowedToolspatterns and the hook all use one source.Work units
WU-1StagePolicy.runtime_diris set in the runtime and carried inpolicy.json; the validator path and the permissions command derive from itscripts/stage_permissions.py,tests/test_stage_permissions.py,docs/host-permissions.mdtest_a_copied_hook_allows_the_commands_the_runtime_advertises,test_the_runtime_paths_survive_the_policy_filepython3 -m unittest discover -s tests(1767 tests, OK),python3 scripts/validate-package.py(VALID)Verification
Agent-reported, run locally on this branch:
python3 -m unittest discover -s tests: exit 0, 1767 tests.python3 scripts/validate-package.py: exit 0, VALID.python3 -m unittest: exit 0, 0 tests (no discovery at the root).The tests share no user-global state with CI: they use temporary directories and no Git identity.
Documentation
docs/host-permissions.mdnow states that the runtime resolves both script paths once and carries them inpolicy.json; the hook never derives them from its own location.