Skip to main content

Record tool calls at an app's nondeterminism boundary; replay them deterministically with every internal variable observable

Project description

flight-recorder

tests

Record what the outside world told your code — every database answer, HTTP response, clock read and random draw — as one small JSONL file per request: a tape. Replay that file against your real code later: same inputs, same execution, bit for bit, with every internal variable observable. When a replay diverges, the report names the first difference instead of leaving you to guess.

A program's execution is fully determined by its code plus its nondeterministic inputs. Record just those, per call — one cheap line — and that line is the execution, compressed. Feed the answers back and the real code re-runs the original execution exactly: no network, no database, no waiting for the bug to happen again.

The cardinal rule: instrument, never duplicate. Nothing here evaluates a query, reimplements a client, or knows what any value means. Recording is a transparent proxy; replay feeds the recorded answers back and verifies the questions still match.

Read the guide

The full walkthrough — declare the boundary, record, replay, edit the tape to visit worlds that never happened, invariants, semantic spans — in Python, Node and .NET, one tab away. Slides — Testing as Simulation.

The tape is a standard

The recording format is a frozen, documented wire contract: spec/tape-v1.md. Implementations are welcome — only record and replay must be native to a runtime; everything that analyzes a tape works on any tape. Conformance is not the prose: it is spec/fixtures/ plus the checker in spec/validate.py (mirrored in JS, .NET, Go, and Java). Every implementation must validate every fixture, and every fixture must have been produced by an implementation. This repo ships five implementations — Python, Node, .NET, Go, and Java — reading and writing the same tapes.

Why

flight-recorder pushes the heavy lifting from human to AI, and from AI to code. As AI takes on most of the development, scenario testing and debugging become the bottleneck, and the work left to the human is the tedious kind. Recording at the nondeterminism boundary gives the agent the missing instruments: it re-runs the exact request against the real code and watches any variable as the bug happens — root cause by lookup, not by guess; fixes proven by replay; regressions caught by a directory of files. What is left to the human is the decisions.

License

Apache-2.0 — see LICENSE and NOTICE. Relicensed from MIT deliberately, before any outside contribution existed: the tape spec is meant to be implemented by others, and Apache-2.0's explicit patent grant is what makes "implement this freely" a promise rather than a mood.

© 2026 Xavier Grehant

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xag_flight_recorder-0.8.0.tar.gz (119.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xag_flight_recorder-0.8.0-py3-none-any.whl (70.1 kB view details)

Uploaded Python 3

File details

Details for the file xag_flight_recorder-0.8.0.tar.gz.

File metadata

  • Download URL: xag_flight_recorder-0.8.0.tar.gz
  • Upload date:
  • Size: 119.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for xag_flight_recorder-0.8.0.tar.gz
Algorithm Hash digest
SHA256 ac408d73c6f39501dd5c9d4b958b70441ff6fe58ef725d4a65cf10330ac1e245
MD5 a68c8dc373d55926e30880ac259d0384
BLAKE2b-256 ac41c45ce67a6349e0f1045961d4a4473db418a72d42baf9569da38de5c93988

See more details on using hashes here.

File details

Details for the file xag_flight_recorder-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: xag_flight_recorder-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 70.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for xag_flight_recorder-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f25f7ac4a06ce0f987344771a427c7a4f4746328982ef8f27356385df0b3b079
MD5 b9cabea2f7790753c444d65129165de6
BLAKE2b-256 8e08502efa61b6afe5ee97badbd17c75cd2a2b111d8c33147ba258558362d1d5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page