Skip to content

test: specify extract_batch contract - #28

Merged
laynepenney merged 2 commits into
sprint-39from
agent/extract-batch-spec
Jul 13, 2026
Merged

test: specify extract_batch contract#28
laynepenney merged 2 commits into
sprint-39from
agent/extract-batch-spec

Conversation

@laynepenney

@laynepenney laynepenney commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary

  • Specify the Python extract_batch contract before implementation.
  • Add Atlas's SHA-pinned real Ministral-3B failure fixture pack from config#480.
  • Lock structured BatchUnit input, injected inference, per-unit attribution, strict shaping and validation, fallback, and the output count invariant.

Contract covered

  • BatchUnit(id, text, capabilities?) input and source_unit_id output attribution
  • provider-neutral injected infer seam with no recall or MLX dependency
  • exact output cardinality and ordered per-unit terminal slots
  • failure reasons unparseable, schema_invalid, dropped, and merged
  • outer Markdown fence and JSON-aware // comment stripping
  • narrow shape coercion and unknown-key removal
  • capability-scoped entity_refs: coerce with entities in scope, drop for recall's set
  • explicit temporal prompt/schema normalization to raw and resolved
  • standard call default plus per-unit capability overrides

Real fixture provenance

Copied verbatim from synapt-dev/config config#480, merged at 43c4687:

design/results/extract-batch-limits-2026-07-13/fixtures/extract-batch-real-failures-v1.json

SHA-256: 9b183f18ab5116cfb1f5ee67d0e99cd5af3fb7f7b99d649b1d58821f9e7489f1

The pack covers 21 raw responses, 25 malformed leaves, 10 dropped source occurrences, 2 unknown-key leaves, 3 temporal conflict cases, and 1 explicitly contract-derived scalar entity_refs case.

Verification

  • python3 -m compileall -q tests/python/test_extract_batch.py: pass
  • python3 -m pytest -q tests/python --ignore=tests/python/test_extract_batch.py: 307 passed
  • python3 -m pytest -q tests/python/test_extract_batch.py: expected TDD red at _strip_output_hygiene() NotImplementedError in the landed batch skeleton (1 passed, then implementation gap)
  • git diff --check: pass

Boundary: OSS extraction reliability only. No identity, org, evaluation, training, repair-product, or premium implementation logic.

Reviewers: Opus for the pinned contract seam; Apollo for the implementation contract-read.

@laynepenney
laynepenney force-pushed the agent/extract-batch-spec branch from bffb984 to e7ea622 Compare July 13, 2026 12:17
@laynepenney
laynepenney merged commit 58d9903 into sprint-39 Jul 13, 2026
7 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant