activity-core/tests/rules
tegwick a70c00a789 feat(ACTIVITY-WP-0016-T03): resilient per-item report recovery with quarantine lane
When the whole-document parse + one retry still fail, report instructions now run
_resilient_report before the total-loss path. A brace/quote-aware scanner
(_extract_object_spans) recovers each recommendation object whether pretty-printed
across many lines or NDJSON one-per-line; a truncated tail gets a best-effort
_try_repair; _partition_items validates each recovered object against the T02 item
schema. Valid items survive (output_validated=True, partial=True), malformed/
over-maxItems items are quarantined with provenance (index, error, raw, reason),
capped at 20. Error locality now matches the unit of work: one bad item costs one
item, not the whole report.

Verified against the real 06-26 shape: 7 valid recommendations + a truncated tail
now recovers all 7 and quarantines the broken tail (previously the whole run was
discarded). Happy-path maxItems top-N enforcement is deferred to T04 (count caps).
Full suite: 215 passed, 1 skipped.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 17:56:28 +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-T03): resilient per-item report recovery with quarantine lane 2026-06-26 17:56:28 +02:00