Skip to content

feat(scaffold): x-altair-idempotency round-trip activation (#175)#180

Merged
tonydspaniard merged 1 commit into
masterfrom
feat/175-x-altair-idempotency-roundtrip
May 31, 2026
Merged

feat(scaffold): x-altair-idempotency round-trip activation (#175)#180
tonydspaniard merged 1 commit into
masterfrom
feat/175-x-altair-idempotency-roundtrip

Conversation

@tonydspaniard
Copy link
Copy Markdown
Member

Closes #175. Part of #171. Depends on #174.

Summary

Activates x-altair-idempotency end-to-end now that the corresponding idempotency: spec block landed in #174. With this merged, the round-trip is honest: a doc that claims x-altair-idempotency produces a spec that claims idempotency:, which scaffolds an Action that exposes the policy to the runtime middleware (#173).

Pieces

  • Forward (OpenApiEmitter): writes x-altair-idempotency: { ttl, scope } when the spec carries idempotency:. mode is server-side and intentionally not on the wire.
  • Reverse (OperationMapper): reads the extension and emits idempotency:. ttl / scope round-trip; mode defaults to optional on the reverse path.
  • Round-trip gate (OpenApiRoundtripRunner): adds x-altair-idempotency to the compared extension set. A future regression that drops the block fails openapi:roundtrip --check with a kind: extension_drift entry.
  • Docs: docs/openapi/extensions.md moves the key out of the "carried through" row into the "round-trips" row; docs/openapi/roundtrip.md adds it to the compared-set listing and drops it from the reserved-key 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 canonical createUser fixture doesn't carry an idempotency block.

Test plan

  • composer cs \xe2\x80\x94 green
  • composer stan \xe2\x80\x94 green
  • composer rector (full tree, no cache) \xe2\x80\x94 green
  • composer test \xe2\x80\x94 6292 tests (+5 new), 0 new failures
  • bin/altair manifest:generate \xe2\x80\x94 clean

Out of scope (per #171)

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.
@tonydspaniard tonydspaniard merged commit 42c3720 into master May 31, 2026
4 checks passed
@tonydspaniard tonydspaniard deleted the feat/175-x-altair-idempotency-roundtrip branch May 31, 2026 04:12
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.

x-altair-idempotency round-trip activation: forward emit + reverse import + drift gate

1 participant