Skip to main content

build-a-durable-idempotency-store

Build a durable idempotency store with scoped keys, request identity, atomic claims, outcome receipts, expiry, conflict handling, and recovery. Use when retried operations must not repeat side effects.

来源信息

仓库
protosphinx/sphinxstack
最近来源活动
2026年7月29日 13:55
检测到的 SKILL.md 语言
英语
星标
2
分支
0

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
2 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
build-a-durable-idempotency-store
category
code
description
Build a durable idempotency store with scoped keys, request identity, atomic claims, outcome receipts, expiry, conflict handling, and recovery. Use when retried operations must not repeat side effects.
# build-a-durable-idempotency-store ## When to use - Use for payments, provisioning, messages, imports, or consequential mutation. - Do not reuse keys across tenants, operations, or semantically different requests. ## Procedure 1. Define tenant, operation, key, request fingerprint, scope, and retention. 2. Atomically create pending ownership or return the existing state. 3. Reject key reuse with a different request fingerprint. 4. Record durable completed outcome before releasing ownership. 5. Handle crash, timeout, lease recovery, unknown external outcome, and manual reconciliation. 6. Encrypt sensitive results and bound storage, expiry, and abuse. 7. Test concurrency, duplicate, mismatch, crash windows, expiry, and disaster recovery. ## Failure plan - Keep ambiguous external outcomes pending until reconciled rather than repeat them. ## Worked example A payment timeout retains an indeterminate receipt and checks the provider before any retry. ## Done - An idempotency implementation records scope, fingerprint, states, atomicity, outcomes, retention, security, and reconciliation - Concurrent, mismatch, crash, timeout, external-unknown, expiry, tenant, and restore tests verify exactly-one effect
在 GitHub 查看