Non-blocking cleanup items surfaced during PR #281's (INC-C5, email dispatch and x402 settlement in-process) three rounds of review. None of these blocked merge; tracking them here so they don't get lost.
🤖 Generated with Claude Code
https://claude.ai/code/session_01CQbJYWWm8tf8owshm7XRp8
Non-blocking cleanup items surfaced during PR #281's (INC-C5, email dispatch and x402 settlement in-process) three rounds of review. None of these blocked merge; tracking them here so they don't get lost.
.changeset/in-process-email-and-x402-settlement.mdnames the edge-token kv key assettings:edgeToken; the real key issettings:otta-wh-token(seepackages/plugin/src/payment-secrets.ts). Fix the changeset/changelog-facing name..changeset/payment-secrets-write-only-kv.md— it may still document the oldsettings:x402FacilitatorSecretkey as live; it was renamed tosettings:x402FacilitatorApiKeyin PR [Plugin][Domain][Adapters] Email dispatch and x402 settlement in-process #281 and should be corrected if so.PaymentSecrets.x402FacilitatorSecret,x402FacilitatorSecretFromKv, and inpackages/plugin/src/admin/settings-form.ts:fieldId: "x402FacilitatorSecret"/actionId: "save-x402-facilitator-secret"all still say "Secret" even though the field now holds an API key sent as a Bearer token. The fieldId/actionId have real churn cost (pinned by a test matrix) so a rename needs care, but a reader grepping for "FacilitatorSecret" currently lands on live code, cutting against the rename's purpose.RECEIPT_REBOUNDguard exists only on the store-emdash tier: inpackages/domain/src/orders/settle-order.ts, ifdedupe(...)returnsfalsebutorderForDedupeKey(...)returnsnull, the code proceeds and settles — impossible on the SQL stores (single transaction/snapshot) but theoretically possible via two separate reads on store-emdash. Reviewers judged this unreachable today becausededupe's own implementation inpackages/store-emdash/src/emdash-payment-event-store.tsalready refuses a null read-back (returnsCAS_RETRYinstead), so the inconsistency is self-correcting in the same file — but it's fragile and worth hardening, e.g. by havingdedupehand back the bound order directly instead of a bare boolean.settings:x402FacilitatorSecretkv key is only deleted when an operator next saves the facilitator-secret admin field; an operator who provisions the new key by other means and never touches that form again leaves the orphaned old secret sitting in kv indefinitely (harmless since nothing reads it, but worth a cleanup pass or a startup migration).packages/store-postgres/test/order-flow.dialects.test.ts's new test settles two orders against the same dedupe key sequentially. The fix depends on Postgres'sINSERT ... ON CONFLICT DO NOTHINGblocking semantics under real concurrency; CLAUDE.md's "no oversell under concurrency" non-negotiable would ideally have a genuinely concurrent variant pinning this.🤖 Generated with Claude Code
https://claude.ai/code/session_01CQbJYWWm8tf8owshm7XRp8