Skip to content

I0824 — Bench persists local runs and keeps a latest projection

Write every run to .ai/local/benchmarks/runs/<run-id>.json and .ai/local/benchmarks/latest.json atomically, and append one line per run to history.jsonl.

DONE wave 2 · p0 · implementation profile · runs alone

Part of M004 — Performance is executable evidence, and the hot path does no canonical work twice.

Objective

Write every run to .ai/local/benchmarks/runs/<run-id>.json and .ai/local/benchmarks/latest.json atomically, and append one line per run to history.jsonl.

Why

Evidence that lives only in a terminal is lost with the terminal.

Current state

Nothing is persisted.

Desired state

Local evidence under .ai/local/, ignored by git, never a baseline; latest.json is a convenience projection of the newest run.

Scope

  • lib/bench.sh
  • docs/SCHEMAS.md
  • test/cases/80_bench_persistence.sh

Out of scope

  • Committing local runs

Dependencies

What waits on this

Acceptance criteria

  • Interrupting a run leaves no partial latest.json
  • Case 80 proves the files and the schema version

Validation

  • bash test/run.sh 80_bench_persistence

Evidence required

  • bench_persisted

Evidence

coverstypecommandresultat commit
bench_persistedtestbash test/run.sh 80_bench_persistencecase 80 runs bench twice and asserts one document per run under .ai/local/benchmarks/runs, latest.json byte-identical to the newest run, history.jsonl with one parsable line per run in order, every document carrying schema majordomus/benchmark-result/v1 with commit, dirty flag, environment and profile, no temporary file surviving a save; a run killed mid-way leaves no run document, no latest.json and no history line because the save is one tmp+mv at the end; a run changes nothing tracked and --no-save writes nothingnext

Risk

history.jsonl is append-only; a corrupt line is reported by validation, never silently skipped.

Timeline

started
2026-09-05T03:47:33Z
verified
2026-09-05T03:47:33Z
completed
2026-09-05T03:47:33Z

Those three fields, the evidence above and the state of the dependencies are all the status is made of. There is no status field to disagree with them.

Canonical record: .ai/repo/project/issues/I0824.yaml. Read it back with majordomus plan show I0824.