The promiserecord once · replay anywhere
While serving, a Tin server writes a capsule for every request that ends in a 5xx or a panic: the request bytes plus the ordered log of everything the handler asked the outside world. tin replay runs that request again from the capsule.
# production: record failures into a spool (encrypted with the key)
TIN_REPLAY_DIR=/var/spool/tin TIN_REPLAY_KEY=$(openssl rand -hex 32) ./app
# your laptop: the same request, same answers from Redis, the clock, the payment API
TIN_REPLAY_KEY=... tin replay 00001700000000000000-003-41.tcap --against app.tin- No Redis, no database, no upstream, no network: every effect is answered from the capsule.
- The build you replay against can be newer than the one that recorded: that is the point.
Deeper
Why the language can promise completeness: user code cannot reach the operating system except through the standard library. Clocks, randomness, sockets, files and databases all pass through one runtime hook, rt_effect(kind, key, body), which records when recording and answers when replaying. There is no external keyword to forget.
- A package that declares the
unsafecapability is marked not replay-safe. - Recording off costs one per-core load and a branch per effect call; on, about 110 ns per effect and one copy of the request bytes.