[AAASM-2641] ♻️ (python-sdk): Align _core exports + native tests to the thin shim#80
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
ddaa6c3 to
407ba1e
Compare
c0972d1 to
e195734
Compare
🤖 Claude Code — review resultCI: ✅ green (23 pass / 4 skip; unit + integration across macОS & Ubuntu, SonarCloud, codecov, benchmarks, PEP 561). Scope vs AAASM-2641: ✅ complete — Python-side alignment to the thin shim.
Notes: the Story line "preserve the Verdict: ✅ Ready to approve & merge after #79 (rebase onto |
…orts The thin pyo3 shim (AAASM-2640) no longer exposes the synchronous policy round-trip. Remove PolicyResult and PolicyTimeoutError from the lazy export map, the optional-core __all__ list, and the TYPE_CHECKING block; RuntimeClient and GovernanceEvent remain the native _core surface.
Drop the fake PolicyResult/PolicyTimeoutError from the stub _core module and assert they are no longer in agent_assembly.__all__, while RuntimeClient and GovernanceEvent still are.
The thin shim no longer exposes a synchronous policy round-trip. Remove the query_policy timeout test and the query_policy call in the concurrency/deadlock test; send_event and close still exercise the delegation to aa-sdk-client. The mock runtime server keeps modelling the full wire protocol.
The native _core module now exposes only RuntimeClient and GovernanceEvent. Drop PolicyResult from the README import example, fix the architecture overview (two symbols; RuntimeClient is a thin shim over aa-sdk-client that ships events), and remove the stale PolicyTimeoutError note from the exceptions reference.
GovernanceEvent deserializes its argument as an aa_core::AuditEntry, but
the FFI benchmark passed an ad-hoc {event_type, agent_id, ...} dict that
is not a valid AuditEntry, so the benchmark errored whenever the native
module was actually built (it is skipped in CI, which hid the bug). Use a
valid AuditEntry payload so the benchmark exercises the real FFI path.
e195734 to
06037b5
Compare
|



Description
Python-side alignment to the thin pyo3 shim (Story AAASM-2561). Stacked on #79 (AAASM-2640), which delegates the native
RuntimeClienttoaa-sdk-clientand removes the native synchronousquery_policyround-trip.agent_assembly/__init__.py: dropPolicyResult/PolicyTimeoutErrorfrom the lazy export map, the optional-core__all__list, and theTYPE_CHECKINGblock. The native_coresurface is nowRuntimeClient+GovernanceEvent.test/unit/test_init_exports.py: stub_coreexposes onlyRuntimeClient/GovernanceEvent; assert the dropped symbols are not inagent_assembly.__all__.test/integration/test_native_core_runtime.py(opt-in,AAASM_RUN_NATIVE_CORE_TESTS=1): remove thequery_policytimeout test and thequery_policycall in the concurrency test;send_event/closestill exercise the delegation. The mock runtime server keeps modelling the full wire protocol._coresymbols;RuntimeClientis a thin shim that ships events), and the exceptions reference no longer mention the removed symbols. (ADR0001-hook-architecture.mdis left as a historical record.)Type of Change
Breaking Changes
agent_assembly.PolicyResultandagent_assembly.PolicyTimeoutError(native_coresymbols) are removed. They had no pure-Python callers; documented policy checks use the httpx gateway client.Related Issues
Testing
uv sync+pytestgreen (418 passed, 10 skipped — native + optional-framework tests skip in a pure-Python install).ruff/mypyintroduce no new findings vsmaster(changes only remove code + edit Markdown).Checklist