🔶 Agent 现在能够交付可靠的分布式系统
英文标题:🔶 Agent can now ship reliable distributed systems
Antithesis 宣布向 AI Agent 开放 Multiverse Debugger,使 Agent 能够对大规模分布式系统进行构建、调试、测试与发布验证。该工具提供位级一致的确定性复现,以及精确到纳秒的时间回溯和“时间分支”能力,让 Agent 可自行检查失败执行、验证假设并测试修复方案。文章以 etcd 线性一致性漏洞和 HashiCorp Raft 漏洞为例,说明传统代码审查难以发现的时序问题可被 Antithesis 捕获和调查。Release 64 用户可通过 `antithesis-debug` skill、Snouty CLI 或 `/command` API 使用这一可编程调试能力,并将其接入自动化测试与修复工作流。
189.5 KB
3.5 MB
3.5 MB
2.3 KB
12.0 KB
44.0 KB
160.4 KB
中文
如果只要说一句“Claude,帮我构建一个新的云平台;不要犯任何错误”,事情真的能成功呢???是的,我们还记得 Boris 曾说这不可能:
也许 Claude 单独做不到,但 Claude + Antithesis 可以。从今天起,Agent 可以借助 Antithesis 构建、调试和测试大规模系统——从初始代码到经过完整验证的发布版本。这还包括使用时间旅行来解决你发现的任何 Bug。
每当你在 Antithesis 中发现一个 Bug,我们的确定性环境都会为实际发生的确切场景提供完美的、逐位一致的复现。更重要的是,我们的环境提供了一台名为 Multiverse Debugger 的时间机器,让你能够回退到该 Bug 历史中的任意时刻,精确到纳秒。一旦回到那个时刻,你就可以通过打开一个完全确定性的终端来“分支时间”,并运行任何想要的命令:获取系统转储、查询系统状态、提取文件,或尝试与原始历史不同的操作,观察会发生什么。你可以借此精确找出问题出错的时点,在无需再次复现 Bug 的情况下检验其可能成因的假设,或者仅仅提取那一条你此前不知道需要记录的关键信息。
Antithesis 的人类用户已经可以手动使用这一功能一段时间,它也是我们最受喜爱的能力之一。今天,我们让 Agent 也能够轻松使用它。这意味着,你可以更加有信心地交付由 Agent 编写的软件,因为它已经针对真实世界中将面对的条件进行了测试。
和你一样,我们也淹没在代码审查之中。Agent 编写代码的速度,比我们检查代码的速度更快。让另一个 Agent 审查 diff 会有帮助,但我们还需要证据来证明系统在实际运行时行为正确。
一个很好的例子是我们在 etcd 中发现的一个 Bug。该项目已经拥有成熟的测试套件,其中包括用于查找线性一致性违规的检查器。如果一次写入已经完成,随后你请求最新值,就不应该得到更旧的值。遗憾的是,一个 Bug 恰好让它做出了这种错误行为。这个 Bug 此前已经造成生产环境故障,但没有人知道原因。
该 Bug 需要一组隐蔽的条件才会出现:在 leader 卡住时恰好发生暂停;随后另外两个节点选举出新的 leader 并继续接受写入;然后旧 leader 恢复运行,却仍然认为自己掌握控制权。但问题在于,当你以大规模运行真实系统时,这类情况 一直 都会发生。然而,无论是人类还是 Agent,都极难在代码编写阶段或代码审查过程中注意到这种 Bug。Antithesis 能够可靠地捕获它们(这个 Bug 就是它捕获的),但接下来该怎么办?
在 Antithesis 中运行测试会暴露触发该 Bug 的事件序列,而确定性回放让我们能够回去调查。但在今天之前,这项调查需要由人工操作调试器,再将信息传回给 Agent。通过此次发布,Agent 可以自行完成这一过程:回到失败执行,检查发生了什么,并着手修复。随后,它可以在 Antithesis 中运行修改后的代码,验证修复是否经得起检验。
以下是 Claude 针对我们在 HashiCorp 的 Raft 实现中发现的一个 Bug 完成这一工作的示例:
(该回放基于原始屏幕录制重新构建。)
以下动画说明了 Claude 如何恰好通过时间旅行追踪这个问题:
视频/嵌入内容:Claude 使用时间旅行调查 HashiCorp Raft Bug 的动画说明
我们希望这项工作发生在 PR 进入审查队列之前。Agent 应当已经调查过失败情况并测试过修复方案,审查者可以直接查看这些结果。这比审查尚未达到生产就绪状态的代码更能有效利用人类的时间。
最终,我们相信,这将使我们能够闭合这一循环:让 Agent 在高风险场景中以难以想象的速度交付可靠、严肃的软件系统。不过,这将是我们下一次公告的主题。
要从今天开始使用,请安装(或更新)我们的 agent skills,然后让你的 Agent 针对 Antithesis 测试中失败的属性断言进行处理。(如果你尚未使用 Antithesis 并希望了解更多信息,请联系我们!)antithesis-debug skill 介绍了如何使用 Multiverse Debugger,其他 skills 则覆盖了这一闭环的其余部分。
你也可以手动使用 Multiverse Debugger:通过 Snouty CLI 的 snouty runs exec 命令,或使用任意 HTTP 客户端调用 /command API 端点。无论通过哪种方式调用,Multiverse Debugging API 都接受你希望运行的 Bash 命令或脚本、希望开始调试的时刻(例如某项断言失败的时刻),以及一个正在进行的运行 ID。它会返回在多宇宙新分支中运行该命令的输出——因此,你可以运行重启节点或编辑磁盘文件等破坏性命令,同时不会失去复现原始 Bug 的能力。
现在,多宇宙调试已经可编程,你和你的 Agent 可以轻松将其与其他 Antithesis 功能串联,构建工作流。例如,你可以通过 CLI 中的 snouty runs search,或 Event set API,查找属性违规,然后在运行过程中直接跳转至对应问题的调试环节。
这只是一个更大闭环中的一步:你和你的 Agent 可以运行脚本,从测试运行中获取诊断输出;使用这些输出调查失败并修复问题;然后启动新的测试运行,以验证修复是否生效。
如果你正在使用 Release 64,今天就可以尝试 Agent 驱动的调试。如果你或你的 Agent 使用它发现了棘手的 Bug,我们很期待听到你的故事。
English / 原文
What if saying âClaude, build me a new cloud platform; make no mistakesâ actually worked??? Yes, we remember when Boris said it wouldnât:
Well maybe Claude canât, but Claude + Antithesis can. Starting today, agents can build, debug, and test large-scale systems with Antithesisâfrom initial code to fully validated releases. That includes using time travel to solve any bug that youâve found.
Whenever you find a bug in Antithesis, our deterministic environment gives you a perfect, bit-for-bit repro of the exact scenario that happened. Whatâs more, our environment gives you a time machine, called the Multiverse Debugger, that lets you rewind to any moment in the history of that bug, down to the nanosecond. Once youâre there, you can âbranch timeâ by opening a fully deterministic terminal and running any commands you want: get a dump of your system, query its state, extract files, or try something different from the original history to see what happens instead. You can do things like find out exactly when something went wrong, test hypotheses about what might be causing a bug without having to find it again, or just extract that one key piece of information you didnât know you needed to log.
Human users of Antithesis have had manual access to this feature for a while, and itâs one of our most beloved capabilities. Today, weâre making it available for easy use by your agents. This gives you agent-written software you can ship with confidence, tested against the conditions it will face in the real world.
Like you, weâre drowning in code review. Agents can author code faster than we can check it. Having another agent review the diff helps, but we also need evidence that the system behaves correctly when actually run.
A great example is a bug we found in etcd. The project already has a sophisticated test suite, including a checker that looks for linearizability violations. If a write completes and you then ask for the latest value, you shouldnât get an older value back. Unfortunately, there was a bug that made it do exactly that. This bug had already caused production outages, but nobody knew what caused it.
The bug required a sneaky set of circumstances to manifest: a well-timed pause while the leader was stuck; then two other nodes electing a new leader and continuing to accept writes, then the old leader resuming and still thinking it was in charge. But the thing is, when you run real systems at scale, this sort of thing happens all the time. Yet itâs devilishly hard for humans or agents to notice this kind of bug when itâs authored, or in code review. Antithesis reliably catches them (it caught this one), but what then?
Running the tests in Antithesis exposes the sequence of events that trigger this bug, and deterministic replay lets us go back and investigate. But until today that investigation needed a person to operate the debugger and pass information back to the agent. With this release, the agent can do that itself: return to the failing execution, inspect what happened, and work on a fix. It can then run the changed code in Antithesis to check whether the fix holds up.
Hereâs an example of Claude doing just that with a bug we found in HashiCorpâs Raft implementation:
(This replay is rebuilt from the original screen recording.)
And hereâs an animated explanation of exactly how Claude is using time travel to hunt the issue:
We want that work to happen before a PR lands in someoneâs review queue. The agent should have already investigated failures and tested its fixes, with the results there for the reviewer to inspect. Thatâs a much better use of a humanâs time than reviewing code that isnât ready for production.
Ultimately, we believe that this will enable us to close the loop and have agents ship reliable, serious software systems in high-stakes situations, at unimaginable speeds, but thatâs a topic for our next announcement.
To get started today, install (or update) our agent skills and point your agent at a failing property in your Antithesis tests. (If youâre not using Antithesis yet and want to learn more, get in touch!) The antithesis-debug skill covers how to use the Multiverse Debugger, while our other skills cover the rest of the loop.
You can also manually use the Multiverse Debugger: either through the Snouty CLIâs snouty runs exec command or by calling the /command API endpoint with any HTTP client. However you call it, the Multiverse Debugging API accepts the Bash command or script you want to run, the moment you want to debug from (for example, the moment that an assertion failed), and the ID of an in-progress run. It returns the output of your command, run in a new branch of the multiverseâso you can run destructive commands, like restarting a node or editing a file on disk, without losing your ability to reproduce the original bug.
Now that multiverse debugging is programmable, you and your agents can easily chain it with other Antithesis features to build workflows. For example, you can use snouty runs search in the CLI or the Event set API to find property violations, then jump straight into debugging them during a run.
This is only one step in a bigger loop: you and your agents can run scripts to get diagnostic outputs from your test runs, use that output to investigate the failure and fix it, then launch a new test run to validate it worked.
If youâre on Release 64, you can try agentic debugging today. If you or your agents use it to find a tricky bug, weâd love to hear about it.