Skip to content

fix(registry): map Presentation write refusals at the write routes' statuses - #13

Open
jm-rivera wants to merge 4 commits into
devfrom
fix/presentation-write-statuses
Open

jm-rivera wants to merge 4 commits into
devfrom
fix/presentation-write-statuses

Conversation

@jm-rivera

@jm-rivera jm-rivera commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

On presentation.write, binding_invalid, constraint_violation and resource_exhausted map at 400, frame_unavailable at 404 and release_mismatch at 503. Those are the statuses POST /api/presentation/components and PATCH /api/presentation/components/{component_id} serve, where the registry gave 422 and 409. presentation.render keeps 422 for the first two and 409 for the other three, the statuses the render routes serve.

The registry holds one status per endpoint, and the write routes served frame_unavailable at 404 or 503 by cause. The 503 cause, a frame store that fails to answer, goes out as service_unavailable in DevelopmentFinanceObservatory/apis#75, and both Presentation endpoints already map that code at 503. frame_unavailable's definition names each case it still covers: a frame never stored or published, expired, or revoked, a spec in quarantine, and a stored artifact that is missing, fails its digest check, does not decode, or holds more rows than Presentation loads.

edit_conflict maps to presentation.render at 409. The render routes read the stored revision they draw, and that read refuses edit_conflict when the component has no current revision, so the render routes already serve it. Its definition names that case.

The three registry commits sit on main, the commit dfo-apis pins today, and the branch then merges dev to settle a CHANGELOG.md conflict. DevelopmentFinanceObservatory/apis#75 pins 4f927c0, the last registry commit, so it takes none of dev's unreleased entries. Whichever of DevelopmentFinanceObservatory/apis#75 and DevelopmentFinanceObservatory/apis#72 merges second moves the pins to the spec-kit release commit.

Testing: tools/validate_registry.py validates the registry at 4f927c0 and at the merged head, and tools/tests passes 53 tests. python/spec-kit passes 259 tests, and python/dfo-spec-kit-components/tests/test_registry_consistency.py passes 3. registries/codes.json and its bundled mirror are byte-identical. In dfo-apis at this pin, just check passes apart from one order-dependent graph release test that DevelopmentFinanceObservatory/apis#65 fixes.

…tatuses

On presentation.write, binding_invalid, constraint_violation and
resource_exhausted map at 400, frame_unavailable at 404 and
release_mismatch at 503, the statuses the Presentation write routes
serve. presentation.render keeps 422 and 409.

frame_unavailable's definition names the causes it covers: a frame never
stored, expired, revoked, or whose stored artifact is missing,
quarantined, or fails its digest check. A frame store that fails to
answer is service_unavailable, which presentation.write and
presentation.render already map at 503.
The render routes read the stored revision they draw, and that read
refuses edit_conflict (409) when the component has no current revision.
edit_conflict maps to presentation.render at 409, and its definition
names that case beside a revise of a revision that is no longer current.
frame_unavailable's definition names each case Presentation refuses
with it: a frame never stored or published, expired, or revoked, a spec
in quarantine, and a stored artifact that is missing, fails its digest
check, does not decode, or holds more rows than Presentation loads.

This branch has not been deployed

No deployments
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