Task
Replace hand-maintained frontend API type mirrors with a deterministic generated contract from the backend's versioned OpenAPI schema.
Rationale
The audit found a live drift risk: the React client maintains TypeScript DTOs separately from FastAPI schemas. That is especially dangerous while #92 introduces versioned snapshot/query responses and #95 adds evidence-bearing proof responses. A backend contract change can otherwise compile on one side while silently misrendering or dropping evidence on the other.
References
Implementation Notes
- Choose one deterministic generator and pin its version.
- Generate into an explicit frontend-owned location or generate in CI; do not hand-edit generated output.
- Preserve runtime validation for untrusted responses where appropriate; generated TypeScript types alone are not runtime validation.
- Add a CI check that fails when the generated contract differs from the backend schema.
Acceptance Criteria
Priority
P2 - Medium · Phase 0/Phase 1 reliability.
Risks and Dependencies
Coordinate with #92, #95, and #108. Do not block the security fix or the first evidence pipeline on a broad client rewrite; keep the first change limited to the contracts consumed by the proof workflow.
Task
Replace hand-maintained frontend API type mirrors with a deterministic generated contract from the backend's versioned OpenAPI schema.
Rationale
The audit found a live drift risk: the React client maintains TypeScript DTOs separately from FastAPI schemas. That is especially dangerous while #92 introduces versioned snapshot/query responses and #95 adds evidence-bearing proof responses. A backend contract change can otherwise compile on one side while silently misrendering or dropping evidence on the other.
References
apps/frontend/src/shared/services/api/types.ts.Implementation Notes
Acceptance Criteria
Priority
P2 - Medium · Phase 0/Phase 1 reliability.
Risks and Dependencies
Coordinate with #92, #95, and #108. Do not block the security fix or the first evidence pipeline on a broad client rewrite; keep the first change limited to the contracts consumed by the proof workflow.