How SAAX Preserves Transaction Outcomes After Worker Failure
How SAAX Preserves Transaction Outcomes After Worker Failure
SAAX 如何在工作节点故障后保留交易结果
December 1, 2026. The hard problem in autonomous commerce is not building the agent. It is answering, after a crash, one question with certainty: what actually happened to this transaction? This article explains the durable-record architecture that makes the answer authoritative — and the difference between storing a result and being able to prove it.
2026 年 12 月 1 日。自主商业领域最棘手的问题并非构建智能体本身,而是在系统崩溃后,能够确切地回答一个问题:这笔交易到底发生了什么?本文将阐述一种持久化记录架构,它能使上述问题的答案具有权威性,并解释“存储结果”与“证明结果”之间的本质区别。
The failure that defines the design An agent establishes a commitment, authorizes execution, and dispatches a merchant operation. The merchant executes. The response is lost. The worker dies. The next worker (or the same worker, restarted) has three apparent options: re-execute (risk double payment), fail closed (lose the paid result), or recover the original outcome. Only the third is acceptable, and only a durable, authoritative record can make it trustworthy.
定义设计的故障场景 智能体建立承诺、授权执行并分发商户操作。商户执行了操作,但响应丢失,且工作节点崩溃。下一个工作节点(或重启后的原节点)面临三种显而易见的选择:重新执行(存在重复支付风险)、关闭失败(丢失已支付的结果)或恢复原始结果。只有第三种选择是可接受的,而唯有持久且权威的记录才能使其值得信赖。
The layers of the record A transaction outcome survives worker failure when each layer is durable and independently verifiable:
- Commitment intent (write-ahead). Before execution, the intended operation is durably recorded — principal, terms, operation key. Even a crash immediately after authorization leaves a record of what was intended.
- Merchant-execution journal. The actual MCP invocation is recorded: tool, request, merchant response, settlement reference, response hash. If the process dies after the merchant executed, the journal proves it.
- Settlement reference. Where settlement applies, the reference is bound to the commitment, nonempty, and stable across recovery attempts.
- Durable result. The authoritative result — original merchant response when retained, canonical reconstruction otherwise — is retrievable and integrity-checked.
- Recovery decision. On resume, the system reads the durable facts (not the checkpoint) and decides: executed → retrieve; not executed → retry; ambiguous → fail closed and reconcile.
记录的层级 当每一层记录都是持久且可独立验证时,交易结果便能在工作节点故障中幸存:
- 承诺意图(预写): 在执行前,预期的操作会被持久化记录,包括主体、条款和操作键。即使在授权后立即崩溃,也能留下关于预期内容的记录。
- 商户执行日志: 记录实际的 MCP 调用,包括工具、请求、商户响应、结算参考和响应哈希。如果进程在商户执行后死亡,日志即为证明。
- 结算参考: 在适用结算的情况下,该参考绑定于承诺,且在多次恢复尝试中保持非空且稳定。
- 持久化结果: 权威结果(保留原始商户响应,否则进行规范化重构)是可检索且经过完整性校验的。
- 恢复决策: 系统恢复时,读取持久化事实(而非检查点)并做出决策:已执行则检索;未执行则重试;状态模糊则关闭失败并进行对账。
The critical architectural rule: a framework checkpoint is not a durable transaction record. Checkpoints manage execution state; they do not prove what the merchant did. Recovery authority comes from the durable record, which lives outside the worker, outside the process, and outside the orchestration framework.
关键的架构准则:框架检查点并非持久化交易记录。检查点用于管理执行状态,无法证明商户实际的操作。恢复的权威性源于持久化记录,它独立于工作节点、进程以及编排框架之外。
Source integrity: original vs canonical
When the original merchant response was durably retained, retrieval returns it with its hash verified, labeled merchant_mcp_original. When the original response was unavailable, recovery reconstructs a canonical result only from authoritative durable facts — commitment, intent, settlement, journal — and labels it canonical_recovery. It is never presented as the original merchant response, and recovery never claims byte-identical retrieval of content it does not possess. This distinction is what lets a consumer decide how much to trust a recovered result.
源完整性:原始与规范
当原始商户响应被持久保留时,检索结果将返回并附带已验证的哈希值,标记为 merchant_mcp_original。当原始响应不可用时,恢复过程仅根据权威的持久化事实(承诺、意图、结算、日志)重构规范结果,并标记为 canonical_recovery。它绝不会被伪装成原始商户响应,恢复过程也从不声称能实现其未拥有的内容的字节级精确还原。这种区分让消费者能够决定对恢复结果的信任程度。
The financial-effect guarantee The point of the architecture is not merely to recover — it is to recover without repeating the money-move. In locally verified scenarios:
- Repeated resume → one simulated financial effect.
- Lost response after execution → journal read, original result returned, no re-execution.
- Checkpoint lost after settlement → authoritative state recovered, no second effect.
- Bounded concurrent resume → zero duplicate simulated financial effects (measured by an independent effect counter, not by counting commitments or results).
财务影响保证 该架构的目的不仅是恢复,而是要在不重复资金变动的前提下进行恢复。在本地验证场景中:
- 重复恢复 → 仅产生一次模拟财务影响。
- 执行后响应丢失 → 读取日志,返回原始结果,不进行重复执行。
- 结算后检查点丢失 → 恢复权威状态,不产生第二次影响。
- 受限的并发恢复 → 零重复的模拟财务影响(通过独立的财务影响计数器衡量,而非通过计算承诺或结果的数量)。
What this means for your architecture Persist intent before you act — a write-ahead record makes every later state reconcilable. Journal execution at the boundary — the merchant call itself, not just its result. Answer recovery from durable facts, not from framework state. Distinguish original from reconstructed everywhere a result is consumed. Measure financial effects independently of success responses — that is the only honest way to prove duplicate prevention.
这对您的架构意味着什么 在行动前持久化意图——预写记录使后续的每一个状态都可对账。在边界处记录执行日志——记录商户调用本身,而不仅仅是结果。从持久化事实而非框架状态中获取恢复答案。在消费结果的每一个环节区分原始结果与重构结果。独立于成功响应来衡量财务影响——这是证明防止重复操作唯一诚实的方法。