BOHICA-LABS / BOHICA-LABS/vsdd-factory
bug(test-writer): wire-contract changes don't sweep all success-path mocks, causing repeated red-gate cycles
- Dominant language
- Rust
- Stars
- 2
- Forks
- 1
- Avg merge
- 6h 43m
- Merged PRs (30d)
- 29
Description
## Summary & impact
When a story changes a wire/serialization contract (e.g. adding a per-call request-id that responses must echo), test-writer updates some but not all of the success-path response mocks. The un-updated mocks produce responses that violate the new contract, so tests that *should* pass fail at the gate — triggering multiple stop-and-fix cycles before convergence.
## Conceptual breakdown
A wire-contract change has two test-side obligations: (1) add/adjust the assertion that enforces the new contract, and (2) update **every** fabricated response in the existing success-path mocks so they satisfy the new contract. test-writer reliably does (1) but does (2) only for the mocks nearest the change, missing sibling mocks scattered across the test file(s).
## Precise flaw
There is no sweep step: test-writer does not enumerate all mock/fake response constructors and verify each reflects the changed contract field. The omission is invisible until the gate runs and the stale mocks fail.
## Observed this session
A per-call request-id echo contract ("response.ID must equal request.ID") was added. Success-path mocks had to echo the new id; several did not, causing 3 separate red cycles during convergence before all mocks were brought into lockstep. (One negative-path mock correctly kept a hardcoded id because an earlier type-check fired before the id-check — so the sweep must be contract-aware, not blind find/replace.)
## Proposed fix
- Add a test-writer step: on any wire/serialization contract change, grep-sweep all mock/fake response constructors in the affected test files and update each to satisfy the new contract (respecting paths where the new field is intentionally wrong for negative tests).
- Optionally, the convergence gate could flag success-path mock responses that don't reflect a newly-added contract field.
## Repro signal
| Field | Value |
|-------|-------|
| Plugin | vsdd-factory 1.0.0-rc.21 |
| Claude Code | 2.1.190 |
| Phase | Phase-3 per-story adversarial convergence (BC-5.39.001) |
Contributor guide
Assessment
This issue has not been assessed yet.