feat(scaffold): x-altair-idempotency round-trip activation (#175)#180
Merged
Merged
Conversation
Activates the x-altair-idempotency OpenAPI extension end-to-end now that the corresponding idempotency: spec block landed in #174: Forward (spec:emit-openapi) - OpenApiEmitter writes x-altair-idempotency: { ttl, scope } when the spec carries an idempotency: block. - `mode` is intentionally excluded — it's a server-side enforcement concern (optional vs required header), not a wire contract. Reverse (openapi:import) - OperationMapper reads x-altair-idempotency and emits an equivalent idempotency: block on the imported spec. - ttl and scope round-trip verbatim; mode defaults to 'optional' on the reverse path since the source did not carry it. Round-trip gate (openapi:roundtrip) - OpenApiRoundtripRunner adds x-altair-idempotency to the compared extension set. A regression that drops the block would now produce a `kind: extension_drift` entry in the receipt and fail openapi:roundtrip --check. Docs - docs/openapi/extensions.md moves x-altair-idempotency out of the "carried through" row into the "round-trips" row. - docs/openapi/roundtrip.md adds x-altair-idempotency to the compared-set listing and removes it from the reserved-key limitation footnote. Tests (+5) - OpenApiIdempotencyRoundtripTest covers the forward emit, the reverse import (including the mode-defaults-to-optional rule), and the round-trip pipeline producing a clean receipt. Existing snapshot tests stay byte-for-byte identical because the createUser fixture doesn't carry an idempotency block. Out of scope (per #171) - Package doc + benchmark variant — #176. Part of #171. Closes #175.
This was referenced May 31, 2026
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 #175. Part of #171. Depends on #174.
Summary
Activates
x-altair-idempotencyend-to-end now that the correspondingidempotency:spec block landed in #174. With this merged, the round-trip is honest: a doc that claimsx-altair-idempotencyproduces a spec that claimsidempotency:, which scaffolds an Action that exposes the policy to the runtime middleware (#173).Pieces
OpenApiEmitter): writesx-altair-idempotency: { ttl, scope }when the spec carriesidempotency:.modeis server-side and intentionally not on the wire.OperationMapper): reads the extension and emitsidempotency:.ttl/scoperound-trip;modedefaults tooptionalon the reverse path.OpenApiRoundtripRunner): addsx-altair-idempotencyto the compared extension set. A future regression that drops the block failsopenapi:roundtrip --checkwith akind: extension_driftentry.docs/openapi/extensions.mdmoves the key out of the "carried through" row into the "round-trips" row;docs/openapi/roundtrip.mdadds it to the compared-set listing and drops it from the reserved-key footnote.Tests (+5)
OpenApiIdempotencyRoundtripTestcovers the forward emit, the reverse import (including the mode-defaults-to-optional rule), and the round-trip pipeline producing a clean receipt. Existing snapshot tests stay byte-for-byte identical because the canonicalcreateUserfixture doesn't carry an idempotency block.Test plan
composer cs\xe2\x80\x94 greencomposer stan\xe2\x80\x94 greencomposer rector(full tree, no cache) \xe2\x80\x94 greencomposer test\xe2\x80\x94 6292 tests (+5 new), 0 new failuresbin/altair manifest:generate\xe2\x80\x94 cleanOut of scope (per #171)