Repository navigation
Description
Outcome
Finish the semantic-precision renewal program by aligning tests, fixtures, and verification tooling with the renewed substrate and surface contracts.
Problem or opportunity
The source, schema, lib/storage, and surface renewal slices are progressively replacing weak payload plumbing with explicit typed contracts. The remaining endgame risk is verification drift: tests, fixtures, showcase scaffolding, and devtools helpers can keep encoding the older loose shapes even after the production code is renewed.
If that drift is not addressed deliberately, future refactors will keep paying a hidden compatibility tax in test helpers and verification tooling.
Expected scope
Likely modules include:
tests/infra/- selected
tests/unit/fixtures and contract suites - selected
devtools/verification and rendering helpers - selected showcase/quality references where verification surfaces still assume legacy payload shapes
Strengthened execution scope
Before implementation, the current helper survey found a concrete drift pattern: tests/infra/storage_records.py uses one loose dict[str, object] alias both for JSON metadata and for Pydantic model payloads, while tests/infra/archive_scenarios.py still allows raw content-block dictionaries in authored scenario fixtures.
This issue should therefore land a stricter vertical slice rather than only adding coverage:
- Split test-helper JSON metadata contracts from internal record-construction payloads.
- Reject non-JSON provider metadata, attachment metadata, and content-block payload fragments in shared storage builders instead of silently dropping or stringifying arbitrary Python objects.
- Replace raw archive-scenario content-block dictionaries with a typed scenario content-block fixture API.
- Add regression tests proving legacy loose shapes fail loudly at the fixture boundary.
- Register a focused validation lane for verification-substrate contracts so these helper invariants stay runnable through
devtools run-validation-lanes.
Constraints and invariants
- Keep the work focused on verification alignment, not unrelated product behavior changes.
- Prefer deleting brittle compatibility scaffolding rather than preserving two fixture shapes.
- The tranche should land after the remaining source/lib/surface renewal slices it depends on.
- Production archive semantics and user-facing CLI/MCP output must stay unchanged; this is a verification substrate renewal.
Acceptance criteria
- Test fixtures and helper builders reflect the renewed typed contracts directly.
- Verification/devtools helpers no longer compensate for obsolete loose payload shapes.
- Storage-record helpers distinguish JSON metadata from internal model payload dictionaries.
- Archive scenarios use typed content-block fixtures and reject raw dictionary blocks.
- Invalid non-JSON metadata/content-block inputs fail with actionable context.
- A focused validation lane covers the renewed verification-substrate helper contracts.
- The tranche lands as a coherent PR with
devtools verifygreen.
Verification plan
Run focused infra/devtools tests first, then devtools render-all --check, then devtools verify before merge.
Non-goals or explicitly deferred work
- Broad new feature work in tests or devtools.
- Reintroducing compatibility layers solely to preserve older helper shapes.
Ref #315
Activity
Sinity commentedon Apr 23, 2026
Execution started on
feature/refactor/verification-substrate-contracts.Strengthened target before implementation:
I will keep production behavior unchanged and verify with focused infra/devtools tests plus
devtools verifybefore PR.refactor(test): harden verification fixture contracts (#374)
Sinity commentedon Apr 23, 2026
Completed in PR #374 and squash-merged as
1856ad086d5b5576e69321dfe66e159e610bc395.What landed:
ScenarioContentBlocknow provides typed authored content-block fixtures for archive scenarios, and raw dictionary content blocks fail at seed time.tests/infra/storage_records.py.verification-substrate-contractsto validation lanes and declared operation metadata for fixture seeding/building.docs/test-quality-workflows.mdanddocs/verification-catalog.md.Verification before merge:
devtools run-validation-lanes --lane verification-substrate-contracts: 13 passeddevtools render-all --check: passeddevtools verify: all checks passeddevtools verify --quick: passedGitHub automation remained pending, but there were no inline review threads and local verification was clean.
refactor(test): harden verification fixture contracts (#374)