Keep an experiment's data¶
An experiment is reproducible when someone else can find its source data, its outputs and the code that produced them, and recompute every published figure. Tool stores do not keep them for us: Langfuse kept evaluation scores for about 90 days, and the per-case scores of the August 2026 short-reply measure were lost before the JEI expert asked for them (IX-6520). Keep the data yourself, as files, and link them from the experiment's documents.
What to keep¶
| Zone | Content | Sent outside Rose? |
|---|---|---|
tables/ |
Per-case and per-run data needed to recompute the results: ids, scores, counts, arms, dates. Clients by label, no visitor text, no email or name | Yes, with the results |
private/ |
The same rows with client names or message text, and any source table that holds them | Never; staff only |
raw/ |
Tool outputs and source files as written (rose-eval --json, logs, exports, the archives they came in) |
Never; staff only |
manifest.json |
Protocol path and sha256, git commit, and for each table its zone, file, sha256, row count, columns and Iceberg table; each raw file with its sha256 | No: it names private tables and raw files. The results file's citation lists the shareable tables |
All four zones go to the bucket, which is staff only: a laptop is not a backup, and the data
must outlive the tools that produced it. The zone says what may leave Rose: only tables/
(and CSVs regenerated from it) goes to an expert or a client.
Store tables as Parquet. Also register them as Iceberg tables when they will be queried across experiments or updated over time; Parquet alone is enough for a one-off result.
Naming and layout¶
One name everywhere: the experiment id YYYY-MM-DD-<slug>, dated the day the protocol was
written (2026-11-26-e9-resolution-reponses-courtes). It is the folder name, the bucket prefix
and the Iceberg namespace; a table has the same name as its Parquet file
(scores_par_cas.parquet is the Iceberg table <id>.scores_par_cas). The same layout is used
locally and in the bucket:
~/rose-experiments/ gs://rose-experiments/experiments/
<id>/ <id>/
manifest.json manifest.json
tables/<table>.parquet tables/<table>.parquet
iceberg/<table>/ iceberg/<table>/
private/<table>.parquet private/<table>.parquet
raw/ raw/
catalog.db (none: readers use each table's metadata file)
The link runs both ways between the data and the repository:
- the manifest names the protocol and results files in the repository, with their sha256;
- the results file names the experiment id and its bucket path (
xd showprints the block).
Laptop or bucket¶
| Copy | Use it | Holds |
|---|---|---|
Laptop (~/rose-experiments/<id>/) |
While the experiment runs: protocol, runs, loading, computing | Everything; may be ahead of the bucket |
Bucket (gs://rose-experiments/experiments/<id>/) |
Once pushed: it is the reference copy. Results files cite it, others query it and regenerate CSVs from it | Everything: every zone, Iceberg copies of the shareable tables, manifest |
An experiment is published when it is pushed. After a push, change a table only by loading it
again locally, then push again: the bucket must never differ from what the results file cites.
Without --cloud, every command reads the laptop copy; with --cloud, the bucket.
Steps¶
- Write the protocol before any run, in the repository: question, arms, data, measures,
criterion. Record it with
init, which stores its sha256 and the git commit. - Run, writing tool outputs to
raw/(forrose-eval,--json > raw/<run>.json). Check after the first run that every case has its scores; stop if not. - Load each output into a table with
add: shareable columns intotables/, content intoprivate/with--private. - Compute from the Parquet files only (DuckDB or a short script committed next to the results), never from the tool's own summary.
- Link: paste the output of
showinto the results document. It names each file, its row count and sha256, so a reader can check they have the same data. - Verify with
verifybefore sending results anywhere.
The commands, from the repository root:
xd() { uv run --no-project --with duckdb --with gcsfs --with 'pyiceberg[sql-sqlite,pyarrow]' python -I .agents/skills/rose-data-experiments/scripts/experiment_data.py "$@"; }
xd init 2026-11-26-e9-resolution-reponses-courtes --protocol research-papers/.../E9-protocole.md --results research-papers/.../E9-resultats.md
xd add 2026-11-26-e9-resolution-reponses-courtes scores_par_cas scores.csv --description "one row per run and case"
xd show 2026-11-26-e9-resolution-reponses-courtes
xd verify 2026-11-26-e9-resolution-reponses-courtes
Query with DuckDB¶
xd sql runs a DuckDB query with every experiment table as a view named "<id>".<table>, the
same name as the Iceberg table:
xd sql 'SELECT bras, avg(context_sufficiency) FROM "2026-11-26-e9-resolution-reponses-courtes".scores_par_cas GROUP BY bras'
xd sql '<query>' --cloud # the Parquet files in the bucket
xd sql '<query>' --cloud --iceberg # the Iceberg tables in the bucket
xd sql '<query>' --cloud --csv out.csv
DuckDB reads the bucket directly through gcsfs, which uses the Google login; the same works in
any Python session:
import duckdb, gcsfs
con = duckdb.connect()
con.register_filesystem(gcsfs.GCSFileSystem())
con.sql("INSTALL iceberg; LOAD iceberg")
con.sql("SELECT count(*) FROM read_parquet('gs://rose-experiments/experiments/<id>/tables/<table>.parquet')")
con.sql("SELECT count(*) FROM iceberg_scan('<cloud metadata path from manifest.json>')")
DuckDB's own GCS access (the duckdb command-line tool, or any session without gcsfs) goes
through Google's S3-compatible API, which needs an HMAC key. A read-only one exists: service
account rose-experiments-reader (Storage Object Viewer on this bucket only), key stored in
Secret Manager as ROSE_EXPERIMENTS_HMAC. Install it once per machine:
After that, plain DuckDB reads the bucket with no setup:
SELECT count(*) FROM read_parquet('gs://rose-experiments/experiments/<id>/tables/<table>.parquet');
SELECT count(*) FROM iceberg_scan('<cloud metadata path from manifest.json>');
DuckDB keeps the secret unencrypted in ~/.duckdb/stored_secrets/ (readable by your user
only). The key can read the bucket and nothing else; writes go through xd push with your own
login. To rotate it: gcloud storage hmac create rose-experiments-reader@inboundx.iam.gserviceaccount.com,
add the new key as a version of ROSE_EXPERIMENTS_HMAC, deactivate and delete the old key,
then run xd duckdb-secret again on each machine.
Copy to Google Cloud Storage¶
Experiment data goes to gs://rose-experiments (project inboundx, EU, public access
prevented, uniform access, 7-day soft delete). Once the results are final, push the
experiment:
push first checks every table against its recorded sha256 and row count. It then copies
tables/, private/ and raw/ to gs://rose-experiments/experiments/<id>/, builds the
shareable tables' Iceberg copies in that folder's iceberg/, and writes a published
manifest.json there that names every table with its zone and bucket location, and every raw
file with its sha256: no local path. A table pushed before and removed since is reported for
removal by hand. Private tables are Parquet only: xd sql --cloud reads them, --iceberg skips
them. The read-only HMAC key below reads every zone, so it stays with staff.
Iceberg metadata stores absolute file paths, so a local Iceberg table cannot be copied to the
bucket as files; push rebuilds it there from the Parquet file instead. Readers need no
catalog: DuckDB's iceberg_scan on the metadata file named in the manifest is enough.
Find an experiment¶
xd list --cloud # every experiment in the bucket, with its repo files and tables
xd find "<text>" --cloud # match on id, protocol or results path, table, column or description
grep -rn "<id>" research-papers docs # from the data to the repository files that cite it
Without --cloud, both commands read the local copies.
Regenerate a CSV¶
The tables hold the same rows as the CSV they were loaded from, so a CSV can be rebuilt at any time, from the laptop or from the bucket:
xd csv <experiment> <table> out.csv # local Parquet
xd csv <experiment> <table> out.csv --cloud # Parquet in the bucket
xd csv <experiment> <table> out.csv --cloud --from iceberg # Iceberg table in the bucket
Values are identical; only formatting can differ (timestamps written 2026-11-26 22:12:17,
whole numbers read as decimals written 0.0).
Agents¶
The rose-data-experiments
skill runs these steps.