Commit 5b95fdb
test(decisioning): unit tests for ProposalStore + lifecycle helpers + cross-store router (#538-impl)
55 new tests covering the v1.5 primitives landed in the previous commit:
- tests/test_proposal_store.py (25 tests): Protocol conformance,
state-machine guards, idempotency on commit/mark_consumed, eviction
(24h draft TTL + 7d post-expiry committed grace), cross-tenant
safety on get / get_by_media_buy_id, discard idempotency,
create_dev_proposal_store warns.
- tests/test_proposal_lifecycle.py (24 tests): enforce_proposal_expiry
(PROPOSAL_NOT_FOUND / PROPOSAL_NOT_COMMITTED / PROPOSAL_EXPIRED with
correct recovery), validate_capability_overlap (4 axes + None=no-op
+ frozenset()=deny-all + field-path-prefix override),
validate_overlap_subset_of_wire drift catch, detect_finalize_action.
- tests/test_platform_router_proposal_stores.py (6 tests): cross-store
consistency hard error, orphan-key check, mixed-version tenants,
proposal_stores= optionality.
- examples/hello_proposal_manager_v15.py: 161 effective LOC of
source (well under the design's ≤350 budget). Demonstrates the
full v1.5 surface: typed Recipe with CapabilityOverlap, finalize-
capable ProposalManager, ctx.recipes-reading DecisioningPlatform,
cross-store-checked PlatformRouter wiring.
All 3452 tests passing (55 new + 3397 baseline). ruff + mypy clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 2f77059 commit 5b95fdb
4 files changed
Lines changed: 1499 additions & 0 deletions
0 commit comments