提出可机器验证的恢复协议,解决工作流中断后状态不一致问题
Resume Means Resume: A Machine-Checked Conformance Contract for Checkpoint, Interrupt, and Resume Semantics in Workflow Persistence Layers
- 定义六项可验证的恢复属性和执行约束
- 实测五框架均违反自身声明,仅一个修复全部缺陷
- 适合构建可靠分布式系统的开发者参考
一个能持久化执行状态以支持中断、崩溃后恢复的框架,必须明确定义恢复意味着什么。五个广泛使用的代理工作流框架对此回答不同,且均未提供可机器验证的契约,实测行为甚至违背其声明的片段。本文提出RESUME CONTRACT,包含六项对持久化API的性质要求(前缀续接、效果精确一次、分支确定性、检查点有效性、消费唯一性、恢复确定性),以及分支意图和活性义务。使用TLA+模型对参考语义进行穷尽验证,在740万状态范围内无变化;参考合取式经由TLAPS证明在无限规模下成立(196个证明义务)。通过39个故障矩阵单元和两个配套模块,实现分离模型所需独立性。采用确定性、无需LLM的测试套件在固定版本上测量。实测显示:LangGraph 1.2.9持久记录第二个恢复值且从不使用,静默保存无效模式,并在真实SIGKILL后重执行已记录任务——中断时精确一次,崩溃时至少一次,仅一种接口满足。CrewAI 1.15.2重执行已完成带效应的方法,与声明相悖;pydantic-graph 1.x无法在节点中段崩溃后恢复;无任何两框架具有相同符合性配置。消费唯一性在串行下成立,但在并发交付下失败:k个进程同时恢复一个挂起中断,导致被保护效应触发k次,40个单元中有36个达到饱和率1.0,失败跨主机传播。REMIT是一个参考序化器,其用Verus验证的恢复核心与发布可执行文件行级一致,修复了分支与有效性单元。跨进程单元在读路径修复:可选门控机制在共享存储中标记消费,仅允许一个竞争者执行,其余拒绝,确保单次处理。
原文摘要 · Abstract (English)
A framework that persists execution state so a run can be interrupted, survive a crash, and continue must decide what a resume means for effects that already happened. Five widely deployed agent workflow frameworks answer differently, none exposes a machine-checkable contract, and measured behavior violates even the fragments they state. The RESUME CONTRACT states six properties over the persistence API (prefix continuation, effect exactly-once, fork determinism, checkpoint validity, consume-once, recovery determinism), plus fork-intent and liveness obligations. A TLA+ model checks a reference semantics exhaustively, unchanged at scaled bounds (7.4 million states), and the reference conjunction is additionally TLAPS-proved unbounded (196 obligations); a 39-cell fault matrix and two companion modules yield the separating models independence requires. A deterministic, LLM-free harness measures them at pinned releases. LangGraph 1.2.9 durably records a second resume value and never consults it, persists schema-invalid state silently, and re-executes durably recorded work after a real SIGKILL: exactly-once across interrupts, at-least-once across crashes, on one API. CrewAI 1.15.2 re-executes completed effect-bearing methods against its written claim; pydantic-graph 1.x cannot resume after a mid-node crash; no two probed frameworks share a conformance profile. Consume-once holds sequentially and fails under concurrent delivery: k processes resuming one parked interrupt fire the gated effect k times, saturation 1.0 in 36 of 40 cells, and the failure crosses hosts. REMIT, a reference sequencer whose Verus-verified recovery core is line-identical to the shipped executable, repairs the fork and validity cells. The cross-process cell is repaired at the read path: an opt-in gate claims consumption in the shared store, serving one racer and refusing the rest before any node executes.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。