Provenance core: run identity, replayable seeds, distribution payloads
TheYuchen
2efd890
Phase 0 of the evidence-workbench rework. Every run now gets a
server-stamped provenance envelope (run_id, seed_mode, root_seed,
app_version) in both the eager and SSE routes; the SSE stream opens
with a run_meta event. Every run draws a root seed even when the
caller doesn't pin one, so any historical run is replayable later by
sending its recorded seed back.
Per-node seeds derive from sha256(root_seed, node_id) — independent
of execution order and of unrelated graph edits, keeping A/B
comparisons honest. Sampled fidelity accepts the seed
(seed_simulator) and reports a structured distribution payload:
binomial successes/shots, Wilson 95% CI, top-16 outcome histogram.
Cache semantics: seed-pinned runs live in a salted cache namespace
and may cache stochastic steps (reproducible by construction); fresh
runs keep today's namespace and the nondeterministic bypass.
Precomputed disk-cache responses are never served for pinned runs.
19 new unit tests (seed derivation, Wilson edges, salted…