Corrections, readiness and validation
Parent issue: #551
Blocker issue: #627, #628, #629
The review-screen paths. A responder corrects fields, and the screen needs to know which templates are ready to generate and what blocks the rest. All of these read or write the incident document, no new storage.
Scope
PATCH /api/v1/extract/{extract_id}: a JSON merge patch shaped like the contract. Apply it to the incident document (a null value deletes a field), validate the result, write it back, append the change to the corrections audit trail, and rerun promote. Return the full completed extraction. Handle not-found, a locked extraction after submission, and an invalid value.
GET /api/v1/extract/{extract_id}/readiness: for every active template, compare its fields against the contract and report which templates are ready and which fields block the rest. Pure lookup, no model call.
POST /api/v1/extract/{extract_id}/validate: the single-template version of readiness, plus human-readable warnings.
- Tests for a correction, a delete, a lock and an invalid value, and for readiness and validate with a ready and a blocked template.
Contract reference
contracts/path/extraction.yaml (edit and validate)
contracts/schemas/extraction-record.yaml
Corrections, readiness and validation
Parent issue: #551
Blocker issue: #627, #628, #629
The review-screen paths. A responder corrects fields, and the screen needs to know which templates are ready to generate and what blocks the rest. All of these read or write the incident document, no new storage.
Scope
PATCH /api/v1/extract/{extract_id}: a JSON merge patch shaped like the contract. Apply it to the incident document (a null value deletes a field), validate the result, write it back, append the change to the corrections audit trail, and rerun promote. Return the full completed extraction. Handle not-found, a locked extraction after submission, and an invalid value.GET /api/v1/extract/{extract_id}/readiness: for every active template, compare its fields against the contract and report which templates are ready and which fields block the rest. Pure lookup, no model call.POST /api/v1/extract/{extract_id}/validate: the single-template version of readiness, plus human-readable warnings.Contract reference
contracts/path/extraction.yaml(edit and validate)contracts/schemas/extraction-record.yaml