Skip to content

fix(security): make get_products retry-safe - #6115

Draft
bokelley wants to merge 2 commits into
mainfrom
security-wave-12-get-products-idempotency
Draft

fix(security): make get_products retry-safe#6115
bokelley wants to merge 2 commits into
mainfrom
security-wave-12-get-products-idempotency

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

What changed

  • classify polymorphic get_products as state-mutating and require a caller-owned idempotency key across schemas, manifests, MCP/V5/V6 routes, Addie, evaluation tools, docs, examples, and compliance fixtures
  • enforce schema-first validation, exact replay/conflict behavior, advisory-success caching, current-context echoing, durable proposal finalization, and per-proposal distributed serialization
  • make task-augmented retries recover successful operations before handler re-entry, including cache-publication failures, with recovery receipts retained for the full replay window
  • reject mixed finalize/refine requests before cache reservation or mutation and preserve INVALID_REQUEST field mapping through V6
  • add compliance scenarios and regression coverage for async task replay, overlapping finalization sets, caller key propagation, task recovery, persistence reload, and V5/V6 parity

Why

get_products is polymorphic: wholesale discovery is read-like, but async execution, refinement, and proposal finalization can create tasks, persist session state, hold inventory, and create insertion orders. Treating the whole task as read-only allowed ambiguous retries to repeat those side effects.

Impact

Callers must now send a valid idempotency_key on every get_products request and reuse it only for exact retries. Existing 3.1 behavior remains documented as a compatibility grace period only for guaranteed side-effect-free synchronous reads.

Validation

  • security, JavaScript protocol, and Node.js testing expert reviews: clean
  • 664 focused server unit tests
  • 3 targeted V6 tenant route tests
  • TypeScript no-emit check
  • Semgrep: 0 findings
  • schema and compliance builds
  • 55 simple examples, 139 composed-schema examples, and storyboard lint suites
  • changeset protocol-scope check and Changesets status
  • git diff --check

Root package.json, package-lock.json, and immutable versioned dist artifacts are intentionally unchanged.

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.

1 participant