diff --git a/python/spec-kit/CHANGELOG.md b/python/spec-kit/CHANGELOG.md index c7a8ec0..4594047 100644 --- a/python/spec-kit/CHANGELOG.md +++ b/python/spec-kit/CHANGELOG.md @@ -74,6 +74,16 @@ and this package adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 `https://raw.githubusercontent.com/DevelopmentFinanceObservatory/spec-kit/main/`, with each file's path unchanged. The previous prefix named a private repository and did not resolve. +- On `presentation.write`, codes `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 for the first two and 409 for the + rest. `frame_unavailable` covers a frame that is not held in a state + Presentation can load, and its definition names each case. A frame store + that fails to answer is `service_unavailable`. +- Code `edit_conflict` maps to `presentation.render` at 409, for a render + of a component that has no current revision, and its definition names + that case. - Codes `identity_quarantined` (500), `service_unavailable` (503) and `internal_error` (500) map to `datasets.description` at the statuses they have on `datasets.snapshot`. diff --git a/python/spec-kit/src/dfo_spec_kit/registry/codes.json b/python/spec-kit/src/dfo_spec_kit/registry/codes.json index 179d71e..07c411d 100644 --- a/python/spec-kit/src/dfo_spec_kit/registry/codes.json +++ b/python/spec-kit/src/dfo_spec_kit/registry/codes.json @@ -180,7 +180,7 @@ { "endpoint": "presentation.write", "channel": "problem_details", - "http_status": 422 + "http_status": 400 }, { "endpoint": "presentation.render", @@ -557,7 +557,7 @@ { "endpoint": "presentation.write", "channel": "problem_details", - "http_status": 422 + "http_status": 400 }, { "endpoint": "presentation.render", @@ -905,7 +905,7 @@ { "code": "edit_conflict", "classification": "refusal", - "definition": "A revise_component request targets a revision that is no longer the component's current one.", + "definition": "The component's current revision is not the one the request reads or targets: a revise_component request names a revision that is no longer current, or the component has no current revision.", "owning_contract": "presentation", "owner": "platform", "introduced_in": "v1", @@ -914,6 +914,11 @@ "endpoint": "presentation.write", "channel": "problem_details", "http_status": 409 + }, + { + "endpoint": "presentation.render", + "channel": "problem_details", + "http_status": 409 } ], "lifecycle": "active" @@ -1447,7 +1452,7 @@ { "code": "frame_unavailable", "classification": "refusal", - "definition": "The frame the intent's frame_ref names cannot be read at request time.", + "definition": "The frame a request names is not held in a state Presentation can load: it was never stored or published, it has expired or been revoked, its spec is quarantined, or its stored artifact is missing, fails its digest check, does not decode, or holds more rows than Presentation loads.", "owning_contract": "presentation", "owner": "platform", "introduced_in": "v1", @@ -1455,7 +1460,7 @@ { "endpoint": "presentation.write", "channel": "problem_details", - "http_status": 409 + "http_status": 404 }, { "endpoint": "presentation.render", @@ -3107,7 +3112,7 @@ { "endpoint": "presentation.write", "channel": "problem_details", - "http_status": 409 + "http_status": 503 }, { "endpoint": "presentation.render", @@ -3318,7 +3323,7 @@ { "endpoint": "presentation.write", "channel": "problem_details", - "http_status": 409 + "http_status": 400 }, { "endpoint": "presentation.render", diff --git a/registries/codes.json b/registries/codes.json index 179d71e..07c411d 100644 --- a/registries/codes.json +++ b/registries/codes.json @@ -180,7 +180,7 @@ { "endpoint": "presentation.write", "channel": "problem_details", - "http_status": 422 + "http_status": 400 }, { "endpoint": "presentation.render", @@ -557,7 +557,7 @@ { "endpoint": "presentation.write", "channel": "problem_details", - "http_status": 422 + "http_status": 400 }, { "endpoint": "presentation.render", @@ -905,7 +905,7 @@ { "code": "edit_conflict", "classification": "refusal", - "definition": "A revise_component request targets a revision that is no longer the component's current one.", + "definition": "The component's current revision is not the one the request reads or targets: a revise_component request names a revision that is no longer current, or the component has no current revision.", "owning_contract": "presentation", "owner": "platform", "introduced_in": "v1", @@ -914,6 +914,11 @@ "endpoint": "presentation.write", "channel": "problem_details", "http_status": 409 + }, + { + "endpoint": "presentation.render", + "channel": "problem_details", + "http_status": 409 } ], "lifecycle": "active" @@ -1447,7 +1452,7 @@ { "code": "frame_unavailable", "classification": "refusal", - "definition": "The frame the intent's frame_ref names cannot be read at request time.", + "definition": "The frame a request names is not held in a state Presentation can load: it was never stored or published, it has expired or been revoked, its spec is quarantined, or its stored artifact is missing, fails its digest check, does not decode, or holds more rows than Presentation loads.", "owning_contract": "presentation", "owner": "platform", "introduced_in": "v1", @@ -1455,7 +1460,7 @@ { "endpoint": "presentation.write", "channel": "problem_details", - "http_status": 409 + "http_status": 404 }, { "endpoint": "presentation.render", @@ -3107,7 +3112,7 @@ { "endpoint": "presentation.write", "channel": "problem_details", - "http_status": 409 + "http_status": 503 }, { "endpoint": "presentation.render", @@ -3318,7 +3323,7 @@ { "endpoint": "presentation.write", "channel": "problem_details", - "http_status": 409 + "http_status": 400 }, { "endpoint": "presentation.render",