activity-core/tests/rules
tegwick 9be4ddbdb7 feat(ACTIVITY-WP-0016-T04): producer trust-boundary guardrails + ADR-004
Add ADR-004 documenting the producer trust boundary: untrusted producers (LLM,
agent, human; erroneous and malicious), the trust-but-handle vs verify-and-mitigate
postures, error-locality and quarantine-with-provenance principles, and the concrete
activity-core mechanisms.

Implement producer-agnostic guardrails in executor.py, applied uniformly on the
happy path and the recovery path via _partition_items: structural-type -> schema ->
structural caps (_MAX_DEPTH, _MAX_STRING_LEN) -> reference allow-list -> count cap.
Each quarantine carries a reason. Closes the happy-path maxItems count cap deferred
from T03 (valid 9-item report keeps 7, quarantines 2). Reference allow-list reads
context["known_candidates"] via _allow_list_from_context; inert until a resolver
populates it. SCOPE.md updated (executor bullet + ADR list); no INTENT drift.

New tests: happy-path count cap, oversized-string guardrail, allow-list rejection.
Full suite: 218 passed, 1 skipped.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 18:10:17 +02:00
..
__init__.py feat(event-bridge): WP-0003a — domain model, rules module, event type registry 2026-05-14 22:01:15 +02:00
test_actions.py Add reuse-surface report gaps resolver 2026-06-18 17:58:00 +02:00
test_boundary.py feat(event-bridge): WP-0003a — domain model, rules module, event type registry 2026-05-14 22:01:15 +02:00
test_evaluator.py feat(WP-0003c): context adapters, first ActivityDefinition, full test suite 2026-05-14 23:24:48 +02:00
test_executor.py feat(ACTIVITY-WP-0016-T04): producer trust-boundary guardrails + ADR-004 2026-06-26 18:10:17 +02:00