Skip to content

fix(protocol): scope idempotency replay to mutations - #7383

Merged
bokelley merged 2 commits into
mainfrom
perth-v22
Sep 9, 2026
Merged

bokelley merged 2 commits into
mainfrom
perth-v22

Conversation

@bokelley

@bokelley bokelley commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • require durable idempotency replay for state-changing operations, while read-only tools must tolerate an optional key and may ignore it
  • define execution-arm semantics for polymorphic get_products and require an idempotency key when refine finalization can create a task or change observable state
  • update capability, migration, release, SDK guidance, schemas, and compliance storyboards to match the clarified contract

Validation

  • npm run build:schemas
  • npm run build:compliance -- --check
  • npm run test:schemas
  • node tests/composed-schema-validation.test.cjs (464 passed)
  • node tests/docs-nav-validation.test.cjs (55 passed)
  • npm run test:migrations
  • npm run test:compliance-snippets
  • npm run test:storyboard-sample-request-schema
  • required current-spec and released-3.0 storyboard matrices across all seven tenant profiles

The repository-wide npm test currently has three unrelated pre-existing failures in tests/unit/addie-router.test.ts; all task-relevant suites and mandatory push gates pass.

Release note

After merge, this correction should be backported to the 3.1.x release line so the published 3.1 contract matches existing SDK behavior.


Open workspace in Conductor

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Request changes

Request changes — 1 blocking finding.

Blocking findings

  • static/schemas/source/media-buy/get-products-request.json — The new get_products finalize conditional flips idempotency_key from optional to required on the GA-published 3.x facade. Input valid in 3.1.20 is now rejected (per the added testSchemaRejection). This is a breaking wire tightening (optional→required flip on a published field) shipped under a patch changeset and is not patch-eligible for the intended 3.1.x backport. Per repo policy, an optional↔required flip on a published field is a breaking wire change and requires a major changeset; it is also explicitly not 3.1.x patch-eligible (new normative requirement on a stable schema).

The rest of the PR — the read-replay idempotency relaxation, schema↔docs coherence, oneOf audit, changeset scope, and dist immutability — checks out as a clean, coherent loosening. Only the get_products required-key tightening blocks.

Note: this PR also touches gated paths under static/schemas/source/** with review_decision: REVIEW_REQUIRED, and the change is breaking-class — human/CODEOWNERS ratification is required regardless, but the high finding governs the outcome (request-changes).

Blocking findings

  • static/schemas/source/media-buy/get-products-request.json — get_products finalize conditional flips idempotency_key optional→required on the GA-published 3.x facade; breaking wire tightening shipped under a patch changeset and not 3.1.x patch-eligible (requires major)

@KonstantinMirin

Copy link
Copy Markdown
Collaborator

Support for this from the Prebid Sales Agent side — we'd reached the same conclusion in prebid/salesagent#2230, which has a prior-art survey if it's useful (no protocol we found keys reads; Stripe and Adyen forbid it outright).

One question on get_products: the key is optional "only when the selected execution arm is a guaranteed side-effect-free synchronous read", but the arm is chosen server-side while the buyer decides at call time whether to send a key. What should a seller do when a keyless request resolves to an arm that creates a task or changes observable state — reject with INVALID_REQUEST, or proceed unprotected? Stating the seller's obligation would close the case the buyer can't predict.

Also strong support for the 3.1.x backport — 3.1.1 is what implementers pin today.

bokelley pushed a commit that referenced this pull request Sep 9, 2026
…t_products mutation arms

When a get_products keyless request resolves to a state-changing
execution arm, the spec previously said the arm "MUST require a key"
without specifying what happens when none was provided. This left sellers
without a clear obligation.

Add an explicit sentence: the seller MUST reject with INVALID_REQUEST
before executing any effect when a state-changing arm resolves from a
keyless request. The buyer cannot predict the resolution path, so the
seller is the last gate.

Follow-up on PR #7383 in response to review comment from @KonstantinMirin.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KYpHRk8CCm1cy5RzqPFZBt
@bokelley

bokelley commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for the Prebid prior-art link — it confirms that read keys should not be portable protocol behavior.

Correction after compatibility review: the earlier follow-up was too strict and has been superseded. Requiring INVALID_REQUEST for a keyless stateful arm would still reject a request that 3.1.20 accepts, moving the same breaking tightening from schema validation to runtime.

The clarified 3.x contract is:

  • get_products keeps idempotency_key optional on every arm for wire and runtime compatibility.
  • A guaranteed side-effect-free synchronous read may ignore a supplied key.
  • Because the buyer cannot predict async/stateful routing, it SHOULD supply a key whenever the request may allocate a task, finalize a proposal, or otherwise change observable state.
  • When such a key is supplied and the seller declares adcp.idempotency.supported: true, replay protection MUST be established before the effect.
  • If the key is omitted, or the seller declares supported: false, legacy execution may proceed but the buyer has no portable at-most-once retry guarantee after an ambiguous result and must not retry blindly.

The compact 3.2 tools remove this ambiguity: mutation tools require keys and list_products is an explicit read. This preserves 3.1 compatibility and remains patch/backport eligible.


Generated by Codex

@aao-secretariat

Copy link
Copy Markdown
Contributor

Ladon cannot review this PR until merge conflicts are resolved.

@aao-secretariat
aao-secretariat Bot dismissed their stale review September 9, 2026 12:19

Superseded by a later Ladon review that rechecked and resolved its blocking findings.

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Escalate to human review

Escalate — gated paths require human/CODEOWNERS approval.

This PR modifies 11 files under static/schemas/source/**, which are under a hard, deterministic approval gate (gated_paths: true). The required review status is REVIEW_REQUIRED, not APPROVED, so decision-table row 2 fires: outcome must be escalate (no blocking findings exist, so not request-changes).

Review substance: the reviewer reports a clean pass with no findings. The prior blocker (get-products-request.json flipping idempotency_key optional→required via a finalize conditional) is resolved — the field is now optional on every arm, the schema edit is description-only, and new tests assert keyless refine-finalize is valid. Schema↔docs coherence verified across all 11 description-only schema edits; changeset scope/type correct (patch for a non-breaking normative relaxation, aligned with DR-0008); no new undiscriminated oneOf; no dist mutations. This is a net improvement over the prior request-changes.

Escalation reasons:

  • Modifies gated schema source files under static/schemas/source/** (11 files) and review_decision is REVIEW_REQUIRED, not APPROVED. Human/CODEOWNERS approval is required before merge.

Why human review

  • Modifies 11 files under static/schemas/source/** (hard approval gate) while review_decision is REVIEW_REQUIRED, not APPROVED — human/CODEOWNERS review required before merge.
  • This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/collection/create-collection-list-response.json (modified) matches static/schemas/source/**; static/schemas/source/collection/delete-collection-list-response.json (modified) matches static/schemas/source/**; static/schemas/source/collection/update-collection-list-response.json (modified) matches static/schemas/source/**; static/schemas/source/core/protocol-envelope.json (modified) matches static/schemas/source/**; static/schemas/source/governance/report-plan-adjustment-response.json (modified) matches static/schemas/source/**; static/schemas/source/governance/report-plan-outcome-response.json (modified) matches static/schemas/source/**; static/schemas/source/governance/sync-plans-response.json (modified) matches static/schemas/source/**; static/schemas/source/media-buy/get-products-request.json (modified) matches static/schemas/source/**; static/schemas/source/property/create-property-list-response.json (modified) matches static/schemas/source/**; static/schemas/source/property/delete-property-list-response.json (modified) matches static/schemas/source/**; static/schemas/source/property/update-property-list-response.json (modified) matches static/schemas/source/**) and the current GitHub review decision is 'REVIEW_REQUIRED', not APPROVED. This is a hard gate enforced in code — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

@aao-secretariat aao-secretariat Bot added the ladon/needs-human-review Ladon has escalated this PR for human review. label Sep 9, 2026
@bokelley
bokelley enabled auto-merge (squash) September 9, 2026 12:22
@bokelley
bokelley requested a review from patmmccann September 9, 2026 12:39
@bokelley
bokelley disabled auto-merge September 9, 2026 14:07
@bokelley
bokelley merged commit 245108f into main Sep 9, 2026
61 checks passed
@bokelley
bokelley deleted the perth-v22 branch September 9, 2026 14:07
bokelley added a commit that referenced this pull request Sep 9, 2026
* fix(protocol): scope idempotency replay to mutations

* fix(protocol): preserve legacy get_products key optionality

(cherry picked from commit 245108f)
bokelley added a commit that referenced this pull request Sep 9, 2026
* fix(protocol): scope idempotency replay to mutations (#7383) (#7384)

* fix(protocol): scope idempotency replay to mutations

* fix(protocol): preserve legacy get_products key optionality

(cherry picked from commit 245108f)

* Version Packages (#7385)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: aao-release-bot[bot] <280565558+aao-release-bot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
bokelley added a commit that referenced this pull request Sep 16, 2026
* fix(protocol): scope idempotency replay to mutations (#7383) (#7384)

* fix(protocol): scope idempotency replay to mutations

* fix(protocol): preserve legacy get_products key optionality

(cherry picked from commit 245108f)

* Version Packages (#7385)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix(schema): backport legacy format asset variants (#7423)

* fix(tmp): backport single-user context privacy to 3.1 (#7424)

* fix(tmp): backport single-user context privacy

* fix(tmp): close expert-reviewed context privacy gaps

* fix(tmp): backport request-aware context caching to 3.1 (#7425)

* fix(tmp): backport request-aware context caching

* fix(tmp): keep context hashes out of observability

* Version Packages (#7426)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* docs(release): correct v3.1.22 Context Match record (#7451)

* fix(compliance): backport required_tools OR-gate fixes to 3.1.x (#6774 subset + canonical_format_validate_input) (#7406)

* fix(compliance): drop get_adcp_capabilities from required_tools across 17 storyboards (OR-gate bug) (#6774)

* fix(compliance): drop get_adcp_capabilities from required_tools in billing_gate_dispatch and agent_notification_configs

required_tools uses OR semantics in the adcp-client SDK. Listing
get_adcp_capabilities alongside a capability-specific tool made the
storyboard-level gate trivially satisfied for every conformant agent,
causing billing_gate_dispatch and agent_notification_configs to run
against agents that lack sync_accounts / sync_agent_notification_configs
and fail at the first assertion instead of receiving a clean
coverage-gap skip.

Closes #6773

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Claude-Session: https://claude.ai/code/session_01M3evZsz4Y3971B5RZVxhKh

* fix(compliance): sweep remaining 15 storyboards for get_adcp_capabilities OR-gate bug

Same pattern as billing_gate_dispatch (issue #6773): required_tools uses
OR semantics, so listing get_adcp_capabilities alongside a capability-
specific tool made the gate trivially satisfied for every conformant agent.

Affected: billing_out_of_band, canonical_supported_formats, evaluator_auth,
native_localization (creative); account_timezone_{seller_fixed,buyer_selected,
seller_assigned}, budget_cap_timezone_{account,fixed,override_rejected},
geo_{region_all_values_support,region_targeting,region_exclusion_support,
place_targeting}, portfolio_routing_scope (media-buy).

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Claude-Session: https://claude.ai/code/session_01M3evZsz4Y3971B5RZVxhKh

---------

Co-authored-by: Claude <[email protected]>
(cherry picked from commit a1e72ec)

* fix(compliance): drop comply_test_controller from canonical_format_validate_input required_tools (OR-gate)

The per-storyboard gate (runner.js) admits a storyboard when any listed tool
is present, while the suite selector (comply.js) requires all of them. With
comply_test_controller in the list, every agent exposing the universal test
controller was selected for this storyboard and then failed all 17 steps on
the missing validate_input — on the hosted grader, 17 spurious failures on
each of two registered agents (#7404). Same shape as #6774.

Refs #7404 (bug 1 only).

(cherry picked from commit 40c59b1)

* fix(compliance): correct 3.1 backport changeset scope

Name only the four #6774 storyboards present on 3.1.x and keep the remaining hosted service work open.

Refs #7404 (bug 1 only).

---------

Co-authored-by: Brian O'Kelley <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: evgen <evgen@SCIS-TE-IPSUM>

* Version Packages (#7486)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix(compliance): backport creative format-kind assertions to 3.1.x (#7554)

* fix(compliance): backport governance storyboard routing to 3.1.x (#7555)

* fix(jobs): backport heartbeat timeout to 3.1.x (#7557)

* fix(release): preserve main schema discovery index

* fix(release): preserve main changelog history

* test(release): register forward-merged regressions

---------

Co-authored-by: aao-release-bot[bot] <280565558+aao-release-bot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ev <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: evgen <evgen@SCIS-TE-IPSUM>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ladon/needs-human-review Ladon has escalated this PR for human review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants