Run Lake (Cross-Run DuckDB)
The run lake is the cross-run analysis harness for wonton-soup. It reconciles run artifacts into DuckDB and exports stable datasets for downstream dashboards and reports.
Why It Exists
Single-run logs answer local debugging questions. The lake answers cross-run questions:
- how effects vary across providers/backends/interventions
- whether patterns persist across repeated seeds
- how metrics behave against explicitly selected references
Storage Layout
Lake root resolves via analysis.lake.db.resolve_lake_paths() and runtime_paths.resolve_artifacts_root().
- If no machine-local override is configured:
- active path:
dossiers/wonton-soup/artifacts/lake/ - checkouts under
research-registry-workspaces/resolve this to the sibling mainresearch-registry/dossiers/wonton-soup/artifacts/lake/
- active path:
- If
SPCTR_LOCAL_ARTIFACT_ROOTis set:- active path:
$SPCTR_LOCAL_ARTIFACT_ROOT/wonton-soup/artifacts/lake/
- active path:
- If
SPECTER_ARTIFACT_ROOTis set:- active local staging path:
$SPECTER_RUNTIME_ROOT/wonton-soup/artifacts/lake/whenSPECTER_RUNTIME_ROOTis set, otherwisetmp/runtime-artifacts/wonton-soup/artifacts/lake/ - remote target root:
$SPECTER_ARTIFACT_ROOT/wonton-soup/artifacts/lake/
- active local staging path:
Inside active root:
lake.duckdbexports/jobs/
Stable IDs
Lake keys are deterministic:
root_id: hash of resolved log-root pathrun_key: hash of resolved physicalrun_dirrel_run_dir: canonicalized against the shallowest enclosing known log root
This lets parent and child --logs-dir reconciles point at the same physical run without double-indexing it in runs and downstream fact tables.
Canonical Workflows
Daily Incremental Update
uv run python wonton.py postprocess
uv run python wonton.py lake reconcileUse when adding fresh runs locally.
Backfill / Repair Missing Metrics
uv run python wonton.py postprocess
uv run python wonton.py lake reconcileUse when old runs are missing postprocess-heavy fields.
Paper Analysis Workflow
LAKE_DB_PATH=/path/to/shared/lake.duckdb \
uv run python dossiers/wonton-soup/paper/build_figures.py \
--out-dir dossiers/wonton-soup/paper/artifactsUse when rebuilding the paper figures from the shared runtime lake. build_figures.py resolves LAKE_DB_PATH first, then falls back to the same shared-lake default used by the marimo notebook.
Lake jobs remain useful as optional convenience slices when you want a narrow materialized cohort, but they are not the paper’s primary evidence surface.
There is no generic lake export --format specter-viz operator path anymore. Use explicit lake jobs for optional snapshots, and lake export-parquet only for the site dashboard release.
Site Dashboard Release (Hybrid Publish Path)
uv run python wonton.py lake export-parquet \
--config dossiers/wonton-soup/analysis/lake/presets/72_site_dashboard_superset_v1.jsonUse when publishing a reproducible compiled dashboard cohort to site/dashboards/wonton-soup/data. Intentionally hybrid: release materialization is human-triggered, while CI validates and publishes static site assets.
Surface Preservation Path
Local runs write into the canonical local lake. spctr surface sync checkpoints the raw logs/artifacts and promotes the current lake snapshot to the server.
spctr surface status wonton-lake
spctr surface sync wonton-lakeUse after local experiments to cold-store logs, non-lake artifacts, and the current lake.duckdb snapshot.
On the server, the systemd timer runs:
spctr surface refresh wonton-lake --site-data-root /srv/www/site/data/wonton-soupThat refresh runs the native Wonton postprocess/reconcile path against the server-visible durable roots and can rebuild lake.duckdb plus the dashboard parquet export from the preserved raw roots.
What Reconcile Extracts
High-level extracted surfaces:
- run registry and file registry
- theorem/intervention summaries from
summary.json.gz - theorem artifact index
- graph node/edge fact tables
- MCTS trace summaries
- basin tables from basin-only or summary-backed runs
- optional postprocess outputs
- goal-outcome aggregates
- optional reference-scored K outputs
Primary implementation modules:
analysis/lake/db.pyanalysis/lake/reconcile.pyanalysis/lake/extract_basin.py
Determinism and Repro Guarantees
- DB connections enforce single-thread mode for deterministic exports.
- Exports use explicit ordering and deterministic JSON encoding.
- Reference populations must be explicit for leakage-safe K scoring.
Reference-selection guardrail ADR:
Common Failure Modes
Reconcile misses expected runs
Checks:
- confirm
--logs-dirpoints at intended run root - confirm runs have
run_status.json - check for partial/failed runs excluded by downstream filters
Export output looks stale
Checks:
- rerun
postprocessthenreconcile - confirm
lake.duckdbunder active artifact root is the one being queried
Dashboard export aborts on selected runs
Checks:
- confirm the selected runs have
summary.json(.gz)at the run root - if the error says
basin-only run, keep that run in the lake but exclude it from dashboard jobs - do not rely on implicit skipping; mixed selections now fail loudly so site cohorts cannot shrink silently
Durability drift persists
Checks:
- run
spctr surface status wonton-lake - inspect log/artifact roots from
runtime_paths - rerun
spctr surface sync wonton-lakeafter resolving root mismatch
Job-Based Materialization
For explicit dataset jobs, reference selection, and manifest provenance: