Repository navigation
Split the shared module into acs.core and acs.client - #477
bar-capsule wants to merge 1 commit into
Conversation
acs.core holds the protocol logic with no I/O; acs.client holds configuration, network, disk and audit. The code moves verbatim and behavior is unchanged. Signed-off-by: Bar Kaduri <bar@capsule.security>
drk-ram
left a comment
There was a problem hiding this comment.
Reviewed at head c5c64d65ea8a02b64ababd123d28f4a68c77d886.
I did a function-by-function diff against the pre-split acs/_common.py (979 lines) to make sure nothing silently disappeared in the split. Everything is accounted for:
- All 29 top-level defs/classes from the old module land in either
acs.core(no I/O:_canonical,_decision,_envelope,_errors,_handshake(justmethod_evaluated),_signing) oracs.client(I/O:_audit,_handshake(the actual handshake + its disk cache),_secrets,_signing,_store,_transport,_urls), with each package listing its surface in__all__andcoreimporting nothing fromclient. scan_destructive_bash_safelyandDESTRUCTIVE_SCAN_MAX_LENcorrectly move intosrc/acs/guardian/example_guardian.pyrather than eithercoreorclient- it's policy-specific to the teaching Guardian and callsaudit_event, so it doesn't belong in the no-I/Ocorepackage. The PR description flags this as intentional and distinct from Ariel's original proposal, and the reasoning holds up.- The deletions -
install_path_for_sibling(dead now that #476 put everything on a real package path) and thedo_handshakeback-compat alias - are both called out explicitly in the PR description as answering prior review findings, and I confirmed there are no remaining callers of either (including in the test suite, which was updated to callensure_session_handshake/ the relocated_handshake_cache_path/_session_state_pathdirectly). core/_signing.pyandcore/_decision.pyare a faithful, non-semantic-changing move -verify_with_key's malformed-base64 handling andmodify_composition_violation's mutually-exclusive-shape checks read identically to before, just relocated.
One thing worth a second look by a maintainer rather than a blocker: the do_handshake alias was kept specifically "so out-of-tree adapter forks aren't broken by the rename" per its old docstring, and that guarantee is now gone. Given this is pre-1.0 reference-implementation code and the removal is an explicit, reviewed decision (not an oversight), I'm fine with it, but it's a real compatibility change worth a mention in the stack's final changelog when it lands.
Approving.
|
Closing this slice because PR #22 (the reference adapters for Claude Code, Cursor and NAT) merged into integration as 2630ec2, and that merge carries every slice in this stack. The top of the stack had the same files as PR #22's final commit, so nothing in this slice was left behind. Thanks, Bar, for cutting the adapters into pieces this size, because it made the review possible. |
Stacked on #476. Next: #478. The full stack is listed in #22.
What changed
acs.coreholds the protocol logic that does no I/O: RFC 8785, HKDF, signing and verifying with a given key, decision rules and MODIFY composition, error codes, response binding, IDs and timestamps.acs.clientholds what reads configuration or touches the network or disk: the secret, URL checks, the handshake and its cache, session state, audit records. Each package lists its public API in__all__, and core imports nothing outside core.do_handshakeand_signing_secretaliases and the unusedinstall_path_for_siblingare deleted.Ariel's findings this answers
events,hooksandresponsesmodules go with the HookSpec follow-up.install_path_for_siblingexamples/comes with the Guardian split.Where this differs from Ariel's proposal
examples/destructive_bash.py, which arrives with the Guardian split.Which issue does this implement
Part of #134
Base branch
Stacked on #476, not on
integration. It lands through #22; see the stack in #22.Type of change
I tested this
At this slice's top (
c5c64d65), withclauderemoved from PATH andACS_LIVE_CLAUDEandACS_SPEC_DIRunset: 313 passed and 3 expected skips with the NAT extra, 275 passed and 3 expected skips without it. The skips are the two opt-in live Claude Code tests and the manual Cursor procedure. CI passes on this PR, including the installed-wheel check on Python 3.11 and 3.12.Checklist
git commit -s(required by the DCO)Security
Unchanged; the code moves verbatim.