activity-core/src/activity_core
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
..
context_resolvers feat(STATE-WP-0064): wire consistency_sweep_remote_all state-hub query 2026-06-21 20:19:22 +02:00
rules feat(ACTIVITY-WP-0016-T04): producer trust-boundary guardrails + ADR-004 2026-06-26 18:10:17 +02:00
__init__.py Add project scaffold: contracts, schemas, docker-compose, workplans 2026-03-04 22:45:40 +01:00
activities.py Add reuse-surface report gaps resolver 2026-06-18 17:58:00 +02:00
api.py Add admin sync hot reload path 2026-06-19 01:54:13 +02:00
db.py feat(db): init Alembic (async) + SQLAlchemy declarative base — T08 2026-03-26 21:45:40 +00:00
definition_parser.py feat(WP-0003b): parser, workflow wiring, triggers, webhooks 2026-05-14 23:02:33 +02:00
event_router.py feat(WP-0004): railiance deployment & service ops 2026-05-15 00:04:39 +02:00
event_type_registry.py Deploy activity-core on railiance01 2026-05-22 13:49:46 +02:00
issue_sink.py fix(issue-sink): stringify triggering_event_id before JSON encode 2026-06-19 00:15:03 +02:00
llm_client.py Pass instruction depth config to llm-connect 2026-05-19 20:55:35 +02:00
models.py feat(ACTIVITY-WP-0014): explicit run-miss recovery policies (T02, T04) 2026-06-23 14:15:45 +02:00
ops_evidence_sinks.py feat(ACTIVITY-WP-0014): idempotency-keyed State Hub writes (T05, in-repo part) 2026-06-23 21:38:46 +02:00
orm.py feat(WP-0003b): parser, workflow wiring, triggers, webhooks 2026-05-14 23:02:33 +02:00
report_sinks.py feat(ACTIVITY-WP-0014): idempotency-keyed State Hub writes (T05, in-repo part) 2026-06-23 21:38:46 +02:00
schedule_health.py feat(ACTIVITY-WP-0014): idempotency-keyed State Hub writes (T05, in-repo part) 2026-06-23 21:38:46 +02:00
schedule_manager.py feat(ACTIVITY-WP-0014): explicit run-miss recovery policies (T02, T04) 2026-06-23 14:15:45 +02:00
seed.py feat(db): add dev seed script for ActivityDefinition — T12 2026-03-26 21:53:59 +00:00
state_hub_write.py feat(ACTIVITY-WP-0014): idempotency-keyed State Hub writes (T05, in-repo part) 2026-06-23 21:38:46 +02:00
sync_activity_definitions.py Fix ActivityDefinition sync for daily triage canary 2026-05-19 20:13:23 +02:00
sync_schedules.py Add admin sync hot reload path 2026-06-19 01:54:13 +02:00
sync_service.py Add admin sync hot reload path 2026-06-19 01:54:13 +02:00
template_engine.py feat(activities): resolve_context stub + evaluate_templates — T15/T16 2026-03-26 22:06:09 +00:00
webhook_receiver.py feat(WP-0003b): parser, workflow wiring, triggers, webhooks 2026-05-14 23:02:33 +02:00
worker.py Add admin sync hot reload path 2026-06-19 01:54:13 +02:00
workflows.py Align activity-core scope boundaries 2026-06-18 15:11:48 +02:00