Agents In Use
What’s new todayLast update
108 use cases added today

How to find bugs with TLA+

An agent-swarm contributor used AI to generate TLA+ specifications and explain them, then turned counterexamples into failing tests and fixes.

Source published news.ycombinator.comUnspecified AI agent
OUR ADAPTATION

Suggested prompt

Suggested prompt written by Agents In Use, not the source author. Replace bracketed inputs and review tool permissions first.

Inspect [repository] for critical stateful components suitable for TLA+ models. Model [selected components] from the code, find counterexamples, and generate failing tests in a test-only diff. Fix verified failures, retain counterexamples, and add [daily spec-sync workflow].

Evidence at a glance

Sourced account
Source author
tarasyarema
Original account
Read the source ↗
Published
Source link checked
Reported result
The author reports fixing issues using model counterexamples and failing tests, plus an AI-proposed heartbeat simplification from 1.3 million states to roughly 4,000.
Human involvement
The contributor selected model targets and worked through the counterexamples and fixes; the source does not detail independent review.

A linked account supports attribution. It does not mean we independently reproduced its result.

Report an issue with this caseOpen correction email

Opens your email app with the case link included. Nothing is sent automatically.

How the agent did it

  1. Inspected the codebase and modeled selected critical parts.
  2. Found counterexamples and generated failing tests in a test-only PR.
  3. Fixed the issues and saved counterexamples in the repository.

An agent-swarm contributor described trying formal verification after seeing another developer's account of using it to fix codebase issues. They had wanted to use TLA+ for years but struggled with its syntax for non-trivial problems. AI generation of specifications, together with explanations of their reasoning, helped them work with the approach.

The reported sequence began by inspecting the codebase for critical parts that could be modeled. They selected an initial group and built models from the main implementation. Next came finding counterexamples and generating failing tests for them, with test-only changes separated into a pull request. They then worked through the failures, fixed the issues, and retained counterexamples in the repository as references.

The author also reported a daily workflow to check specification updates and keep the models synchronized. For a heartbeat system they had wanted to refactor, the AI proposed a simplification from 1.3 million states to roughly 4,000. The source presents this as a proposed simplification, without detailing a completed deployment of that refactor. It does not identify the agent product used.

Who it's for: Developers investigating concurrency or state-machine bugs with executable formal models and regression tests.

Prompt
Suggested prompt (written by Agents In Use, not the author's)

Source: Hacker News · tarasyarema

Frequently asked questions

What sequence did the contributor describe?

They inspected critical code, modeled selected parts, found counterexamples, generated failing tests, then fixed each issue and added the counterexamples to the repository.

How were specifications kept synchronized?

The author says they added a daily workflow to check for updates to the specification so it stayed in sync with the code.

More details

Remaining steps

  1. Added a daily workflow to check specification updates.

About this account

AI generated formal specifications, explained their reasoning, and proposed a simpler heartbeat model; the agent product is not named.

Platform: Hacker News. Attribution: https://news.ycombinator.com/item?id=49894643. Prompt: Suggested (written by Agents In Use, not the author's). Sourced by the Agents In Use pipeline.

Credit: tarasyarema on Hacker News

Source published

Added to Agents In Use

Source checked

Tools and topics

AI agent · TLA+ · GitHub

TLA+ · Formal verification

Editorial completeness: 100/100. Measures documented fields, not agent performance or verified outcomes.