docs: idempotency contract + checkout dedup error envelope#6
Merged
mastermanas805 merged 3 commits intoMay 14, 2026
Merged
Conversation
Adds a new docs/idempotency.md covering the two-layer dedup contract (explicit Idempotency-Key header, 24h TTL; body-fingerprint fallback, 120s TTL) and the X-Idempotency-Source response header. Extends llms.txt convention #7 so an agent skimming /llms.txt sees the contract. Pairs with api PR #112. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Backfills two contract surfaces the in-flight api PRs introduced but did not have a content-repo propagation step in their original briefs: - A concrete double-click curl example in docs/idempotency.md showing two back-to-back /db/new calls collapse to one resource via the fingerprint fallback, with the response headers an agent would see. - The full 409 checkout_in_flight envelope (server-side dedup guard on /api/v1/billing/checkout) in docs/limits.md alongside the existing billing-error documentation. Includes retry_after_seconds=60, agent_action copy, and the fail-open posture on Redis errors. Pairs with api PRs #111 (checkout dedup) and #112 (idempotency middleware on all create endpoints). Convention #7 in llms.txt and the top-level docs/idempotency.md from b4264fe (PR #5) cover the broader middleware story; this commit fills the worked-example + checkout-error gap so every contract change has a docs surface. docs/marketing copy only, no code change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
…checkout-dedup-2026-05-14 # Conflicts: # docs/idempotency.md
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.
Summary
Backfills documentation for two in-flight
InstaNode-dev/apiPRs whose original briefs did not include a content-repo propagation step.Pairs with
InstaNode-dev/api#111(server-side dedup on/api/v1/billing/checkout) andInstaNode-dev/api#112(Idempotency middleware on all create endpoints with body-fingerprint fallback). Stacked on top of #5, which contributed the bulk of the idempotency contract documentation.What this PR adds on top of #5
docs/idempotency.mdshowing two back-to-back/db/newcalls from the same caller collapsing into one resource via the fingerprint fallback. Includes the exactX-Idempotency-Source/X-Idempotent-Replayheaders an agent would see on each side, and a short callout that the same shape applies to/deploy/new(multipart) and/api/v1/billing/checkout.POST /api/v1/billing/checkoutconcurrent-call dedup section indocs/limits.mdwith the full 409checkout_in_flightenvelope (retry_after_seconds: 60,agent_actioncopy,request_id), placed alongside the existing400 tier_unavailablebilling-error documentation. Documents the 60s TTL on the SETNX guard, that anIdempotency-Keyis honoured on this route for a longer-window guarantee, and the fail-open posture on Redis brownouts.Coverage map
llms.txtconvention #7 (idempotency on by default)docs/idempotency.mdtwo-layer contract + headers + covered routesdocs/idempotency.mdworked double-click curl exampledocs/idempotency.mdcallout that checkout has its own SETNX guarddocs/limits.md409checkout_in_flightenvelopeWhy one PR, not two
The user's rule is "every contract change propagates". Two parallel api PRs (#111 and #112) each introduce contract surface, and #5 already handles most of #112. Bundling the remaining bits in a single docs PR keeps the propagation traceable to a single landing event.
Notes
docs/idempotency-contract-2026-05-14so the merge is clean once docs(api): document Idempotency-Key + fingerprint fallback #5 lands. After docs(api): document Idempotency-Key + fingerprint fallback #5 merges tomain, this PR's diff againstmainwill show only the 56 new lines added here.llms-full.txtis not in this repo today; the corresponding longer-form content lives indocs/idempotency.mdand is mirrored by the existing.mdroute convention documented inllms.txt.Test plan
/docs#idempotencyrenders the new "Worked example" subsection and/docs#limitsrenders the new "POST /api/v1/billing/checkout — concurrent-call dedup" subsection.https://instanode.dev/docs/idempotency.md(after deploy) and confirm the worked example is present in the.mdmirror.limits.mdmatchesinternal/handlers/billing.goin api PR #111 byte-for-byte (error,message,retry_after_seconds,agent_action).