Repository navigation
feat(api): the contract declares each operation's error statuses and headers (#1333) - #1336
Merged
Merged
Conversation
…headers (#1333) openapi.public.json declared no header parameters and only 2XX/default responses, so a generated client could not see the retry contract or a single documented status. Both are now derived from the handler source. - er-api-spec operations/errors.rs walks each handler and, transitively, the local helpers it calls (guard, upload_scope_any, idempotency_key, accepted_response …), collecting the StatusCode constants it constructs and the header names it reads or sets. A handler taking Principal declares 401. It over-approximates — a helper's every status counts — the safe direction for a contract. - Each error status references one shared components.responses.Error{n} with the {detail} body, so the contract states each once (+15% size, not +82%); Idempotency-Key is an optional header parameter on records/ingest and imports, Idempotent-Replayed a 2XX response header. - 140 of 142 public operations now declare 401 (the two probes do not); ingest declares 401/402/403/404/409/413/422/500/501/503. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
The marketing preview was removed because this PR is closed or merged. |
athvin
temporarily deployed
to
marketing-preview
November 28, 2026 01:26 — with
GitHub Actions
Inactive
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1333
er-api-specderives each operation's error statuses and request/response headers from its handler source (transitively through local helpers);openapi.rsemits them as sharedcomponents.responses.Error{n}references and header parameters/headers. The regenerated contracts andschema.d.ts; a note inapi-contract/references/launch-readiness.md.#1333, the follow-up #523 (E13) named before closing: a client generated from the contract could not see
Idempotency-Key,Idempotent-Replayed, or any status besides2XX/default.Proof
errors::tests::statuses_and_headers_follow_local_helpers: a fixture handler's statuses come through a helper (guard→ 403), its own body (413) and itsPrincipal(401); 202 is not an error; the request and response headers are found through helpers; an unauthenticated handler has none.the_delivery_contract_declares_its_headers_and_error_statuses: in the public document, ingest takesIdempotency-Key, its 2XX carriesIdempotent-Replayed, and 401/402/403/404/409/413/422 each reference a shared response whose body requiresdetail;/healthzhas no 401.make checkexit 0;make frontendgreen (vitest 1139, Playwright 1113).Risk & rollback
Additive to the contract: new responses and an optional header parameter; no request or success shape changes.
git revert <merge-sha>.Post-merge ledger
Closed by: agent · session
Claude Code:24d16c2e-fec6-49d8-9797-060338df4848onbrians-MacBook-Pro· 2026-11-28T05:25:09Zmainis green with this change on it — the merge SHA, and the runthat proves it. A later head SHA with this commit as an ancestor counts;
a cancelled run with zero jobs does not: — b4d5b3d, rust 46093104097 + frontend 46093103992 success
imagesbuilt, or correctly never ran because nothing that goes intoan image changed: — success, run 46093104013
deployconverged — proved by a line the running process emitted, notby the image digest and not by the workflow conclusion: — run 46093433872 success; the live process serves the new contract:
https://dupezero.com/api/openapihas 13 sharedcomponents.responses(none before)deploy,drift,kind's nightly leg) is green, or knowingly red for a reason that is notthis change: — infra, devcontainer, marketing preview all success on b4d5b3d
Donethrough the automation rather than byhand, and the issue closed: — OpenAPI declares request/response headers and the documented error statuses #1333 CLOSED by feat(api): the contract declares each operation's error statuses and headers (#1333) #1336 via automation
(a skill, a reference, memory) — or nothing new was learned: — inline error bodies nearly doubled the contract; shared
components.responseskeep it to +15%Specific to this change
components.responses, read from https://dupezero.com/api/openapier-cost-roll— this deploy (46093433872) leftkubectl -n ci get cronjob er-cost-rollpresent (age 24m) through its cutoverContext — plan, discoveries, measurements, files
Plan
Discoveries
components.responsesexists for exactly this, and brings it to +15%.Principalextractor's own rejection, invisible in any handler body; it is derived from the signature instead.Measurements
Files
🤖 Generated with Claude Code