Skip to main content
One SQLite file holds every answer, each judgment’s latest table, the run history and logged traffic. WAL mode: batch runs and judge() callers can use it at the same time.

Where it lives

In order:
  1. HUNCH_STORE, if set.
  2. The nearest .hunch/store.sqlite in the spec’s folder or any folder above it.
  3. Otherwise a new .hunch/store.sqlite at the root of the git repository, or in the spec’s folder outside a repository.
A new store is announced on stderr:
Seeing it for a project you have run before means every answer will be asked again; set HUNCH_STORE to the existing store. Keep .hunch/ out of git: about 80 MB per 100,000 rows, and it holds your rows’ text.

The answer cache

answers is content-addressed: each answer is keyed by a hash of exactly what was asked.
  • Same row, question and model anywhere (batch, judge(), server): cache hit.
  • New key: a change to instructions, criteria, option order, model, or any state column’s text.
  • Not in the key: act, gold, escalate, tests, where, the spec’s name and source.
Answer shapes:
noul is p(yes).

Judgment tables

hunch run writes one table per judgment, named after it, replaced in one transaction; a failed run leaves the previous table. Columns: the answer columns, plus: Under --model, the table name gets the engine as a suffix (intent__deepseek_deepseek_flash), leaving the spec’s own table untouched.

Runs and lineage

  • spec_hash covers what the judgment asks, not on_change or source; on_change: freeze compares it with the last complete run’s.
  • status is complete, or failed: <error>.
  • shash: hash of the row’s state. new_rows_only reuses an answer only when row id and shash both match.
  • /v1/drift and the runs page read label mixes from _hunch_row_answers.

Traffic

judge(..., log=True) and judge(..., shadow=...) keep each row in traffic (judgment, rhash, row, n, first_at, last_at), redacted by the live spec’s rules; a repeat increments n. --traffic exports it to .hunch/traffic/<judgment>.csv and runs on that.

Querying it

Plain SQLite. Which engine answered each row of the triage example, and when:
From Python, hunch.results returns a judgment’s table as a list of dicts.