Docs / Concepts / Reproducibility
Reproducibility
SwarmLabRE makes three claims, from the strongest to the weakest: a recorded run replays to byte-identical files, a live run is pinned and recorded but not repeatable, and the containers can be run again against recorded model answers.
A recorded run replays to byte-identical files#
swarmlabre replay RUN rebuilds a finished run offline, with no model, no Docker and no network, and compares every output with the SHA-256 in the run's manifest.json: report.json, report.md, report.html, board.json, iocs.csv, iocs.stix.json, iocs.misp.json and detection.yar.
Replaying the recorded demo run prints the checks below. The command exits 0 only when every one of them is identical.
swarmlabre replay demo/sfaef16e6, from its checks block. Hover a word for its file.Show as a table
| File | Rebuilt | Recorded copy |
|---|---|---|
board.json | identical | identical |
detection.yar | identical | identical |
iocs.csv | identical | identical |
iocs.misp.json | identical | identical |
iocs.stix.json | identical | identical |
report.html | identical | identical |
report.json | identical | identical |
report.md | identical | identical |
Five more checks sit beside the files. board compares the rebuilt board.jsonl with the recorded one. summary compares the Reporter's summary, its lint result and its assessment with the recorded ones. record compares the rebuilt swarm.json with its hash in the manifest. sample checks that the kept sample is the one the manifest names, and inputs_untouched checks that no recorded input file changed after the run ended. The bundle_outputs column is the copy of each output a bundle carries under out/: the player serves and the demo embeds those files, so they are checked as well as the rebuilt ones. A bundle is copied without following links.
What the replay re-runs#
| Step | Re-run | From |
|---|---|---|
| The board's evidence checks: bytes at an offset, ATT&CK id and name, call citations, duplicates and caps | yes, at the full level because the sample is kept | inputs.jsonl: every post, resolution and spot check in the order the board received it, with the clock value it saw |
| The Reporter's summary, the lint and the assessment | yes | the Reporter's recorded text in swarm.json |
| Verdict and confidence caps, YARA rules and their matching, IOC grouping and defanging, STIX and MISP ids, the HTML page | yes | the board, the layout and the prepared files of the run |
| What the model said and what the tools printed | no, recorded | model-trace.jsonl.gz (every exchange, whole) and the agents' tool results inside the board inputs |
With no sample kept (keep_sample = false, or --no-sample), the replay is at the downstream level: the board is taken from the record, and the result says so. It never reports more than it checked.
What the replay does not do#
Nothing signs manifest.json. Someone who edits a file and recomputes its hash and the manifest's gets a replay that agrees. The hashes catch an accidental change and an edit that left the manifest alone. A rebuild that differs in even one byte, or a recorded file edited afterwards, makes replay exit 1.
What makes the rebuild repeatable#
- The build reads no wall clock. One clock module is pinned to the run's end time.
- All times are UTC, so the local time zone has no effect.
- Nothing is random: STIX and MISP ids are
uuid5over the run id and the content. - Keys are sorted, and nothing depends on dict or set order.
The test suite replays under different time zones and PYTHONHASHSEED values and expects the same hashes. The golden cases pin the bytes of 11 recorded runs.
A live run is pinned and recorded but can differ#
Six agents share one model, so the order of their requests, the server's batching and the tool timings differ between runs. The gate overwrites temperature and seed in every request, whatever the agent's client asked for. That removes the sampling noise the client controls and nothing else. Two live runs on the same sample can differ, for example in which agent posts first and so in the finding numbers.
Two live runs can differ, so a live run promises no identical results. Everything needed to reproduce its results offline is on disk.
Whether the model server honours seed at all is measured. Before a run, the same short question is asked twice with one seed, and swarm.json and manifest.json record seed_support as honoured, ignored or unknown.
Replaying the agents against recorded model answers#
swarmlabre run SAMPLE --replay RUN starts the containers as usual and answers every model request from the recorded trace. A reply is served only to a request whose body has the same SHA-256 as the recorded one. Any other request gets an error and is counted as replay_diverged in the result. The run reuses the recorded run's task key (nonce.key): the per-task marker the agents echo back is an HMAC of that key, so the conversations repeat word for word. It needs Docker and the two images.
On the second demo sample, which has a dispute, a resolution, a round 2 and a duplicate reject, the measurement was 0 unrecorded requests and the same findings, ids, evidence levels, statuses and rejects. Repeated eleven times, the count was 0 six times and 4 five times. Which agent posts first decides the finding numbers, and the containers' timing is not controlled, so a replay through the containers can diverge, and replay_diverged says so. The offline replay above is not affected.
This is a new run, so its files differ from the recording in the run id and the times. The byte-identical claim belongs to the offline replay. With a real model's tool use, timing-dependent tool output can also make a request differ from the recorded one.
Files of a run#
| File | Content | Hashed in the manifest |
|---|---|---|
swarm.json | the run record | yes |
board.jsonl | the board's decisions | yes |
inputs.jsonl | the board's inputs, in order | yes |
model-trace.jsonl.gz | every model exchange: the request is kept as its hash and the reply whole, at most 64 MiB | yes |
layout.json, events.jsonl, detection.json | the map, the event log and the stored YARA rules | yes |
manifest.json | tool version, sample hash, model and sampling, image ids, ATT&CK version, report format and the hashes above | no |
out/* | the outputs | named by hash in manifest.json |
Everything in a run folder that came from a sample, a tool or a model is untrusted text. It is capped, never executed and shown only as text.