Add idempotency-key replay oracle - #51
Merged
Merged
Conversation
…ed body-id extraction
… replayCount after fetch
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
src/agent/oracles/idempotency.jsreplays committed POST/PUT requests that carry an idempotency key header and firesIDEMPOTENCY_VIOLATION(auto-assert, high) when the replay returns a distinct non-null resource idsrc/browser/network.jsnow captures three idempotency key header names alongside auth headers;x-request-idexcluded (correlation header, not an idempotency key)tryExtractCreatedIdmoved from an unexported local incrossLayer.jsto an export insrc/perception/resourceId.js— shared by both oraclessrc/index.jswith a per-armmaxReplaysPerRuncounter; disabled in passive mode viaapplyPassivePatchTest plan
IDEMPOTENCY_VIOLATIONCOMMITTED_STATUSES) → silentenabled: false→ silent, no fetch issuedx-idempotency-keyand customkeyHeadersvariants → fire correctlymaxReplaysPerRun: 1with two qualifying captures → fires only oncereplayCountref persists across step calls; network errors do not consume a slotx-request-id-only request → silent (correlation header, not a dedup key)Known gaps
Cached-response masking (server returns first response verbatim, second row still created), server-rotated key patterns, and 204 responses are silent by design; documented in source and DECISION_LOG 020.