RFC-027: Who acted on every record, and baselines per goal¶
- Status: Accepted (owner, 2026-11-09: "mark both as accepted and start building"); built 2026-11-09. Revision 2 the same day, after an independent review
(Fable) and the owner's answers to it. Its questions decided by the owner ("1 no, 2 run without goal is OK", 3:
"drop it"; then "2 go with recommendation, 4 agree, 5 yes"). Step 4.1 of
research/internal/PLAN_0.8.0.md. - Authors: Marko Dragoljevic
- Related: the 0.5.0 drafts it reworks (PRD-011 and RFC-012, the evidence registry; PRD-012 and RFC-013 D5/D8, the
actor and consent; not merged), RFC-026 (its jobs carry
byand set the actor; its lock table holds this RFC's commands), RFC-023 (source.byon labels and references),deploy-sheet(the reproduce block), CONCEPTS "What an agent may do" (the owner's rule of 2026-11-04)
Abstract¶
Every record a command writes says who acted: a person, or an agent and the person it acted for. A baseline belongs
to a goal on a dataset (or, for a run with no goal, to the dataset alone); promoting writes a new version beside the
old ones, never over them; the comparison that justified it is frozen into that version; a rollback is another
version. evh baselines lists them with how to reproduce each (the deploy-sheet block) and their history, and with
--json is the export a production system reads.
Problem statement¶
- Who acted is recorded by five commands only, as free text:
--byonlabel-import,sheet-import,pick,reference-manifestandreference-promote(labels keep it assource.by). A run, a promotion, a round, an unseal or a model record says nothing of who made it. The owner's rule lets an agent promote, label and run "when its operator asked for that task"; nothing records that it was an agent, or for whom. - One baseline per dataset, overwritten. Two goals on one dataset share it, and
run-promotereplaces the file ("git keeps it",promote_baseline.py:141). There is no history in the project, no rollback butgit revert, and nothing of the comparison that justified a promotion: re-runningpair-testlater reads new runs under today's rules, so the evidence drifts.
Design¶
D1. Who acted¶
_record.actor()gives{"type": "person" | "agent" | "unknown", "name": …, "for": …}(PROV'sactedOnBehalfOfasfor). It reads, in order:--bywhere a command has it (person:NAME,agent:NAME, or a bare name, read as a person);EVH_ACTORwithEVH_FOR(person:NAME, required with an agent); elseperson:<OS user>(getpass.getuser()) when stdin is a terminal andunknown:<OS user>when it is not (an agent's shell, a script, CI, a job).- The actor is a recorded claim, not an identity. Anyone can type
--byor setEVH_ACTOR; the record shows what was claimed and how (from:flag,environment,terminalorapi: a name given in an HTTP API call; a job carries it asEVH_ACTOR_FROM=api, and one started byevh jobs-startcarries what that command resolved:flag,environmentorterminal). That is the owner's rule: the harness records whose decision it was, it does not authenticate. Real identities and permissions come with a multi-user design (PRD-017's "later question"), not here. - Every record a command writes carries
actor: runs (metrics.json), baselines, references, label sets, rounds (open, retire, close), picks, dataset records (create, split, extend, unseal, lineage), model records, judged runs and verdicts. One function, called byrun_record,derived_recordand the writers that have no record builder. A label set's or reference'ssource.by(who labelled) stays as it is:actorbeside it is who ran the command (they differ when a person imports another's sheet). --bymeans who acted, on every command that writes.dataset-split's split rule,--by hash|timetoday, is renamed--split-by(owner, 2026-11-09), and the record'ssplit.byfollows (split.split_by; migrated). The inspector's and compare's--by(a breakdown field) stay: they write nothing, so they take no actor.- No consent machinery. The drafts refused an agent's promotion and made the person rerun it with
--confirm. The owner's rule is the opposite: an agent acts when its operator asked. An agent's decision carriesfor(whose decision it was) and its reason says what was asked. - A decision needs a named actor (owner, 2026-11-09):
run-promote,baseline-rollback,round-close(also when it promotes),round-retire,study-confirm(its--dry-rundecides nothing and names nobody) anddataset-unsealrefuse anunknownactor, saying how to name one (--by, orEVH_ACTORwithEVH_FOR). Runs, labels and every other record takeunknownand go ahead. An RFC-026 job has no terminal: its supervisor setsEVH_ACTOR/EVH_FORfrom the job'sby, and the API refuses a decision job withoutby. - The MCP server stays read-only. Agents promote and label through the command line or RFC-026 jobs, never
through
evh mcp; itsNOT_TOOLSreasons ("a decision: a person's") become "a decision: recorded with who acted". CONCEPTS "What an agent may do" replaces "Consent recorded by the harness itself … is 0.8.0's to design" with this section's rule.
D2. Baselines per goal, versioned¶
- A baseline is
data/baselines/<goal_id>/<dataset_id>/<n>.json,nfrom 1, written once. The current one is the highestn(compared as numbers:10after9). A rollback is a new version that names the version it restores (restores: 3) and copies its run.promoted_from,scores,buildand the rest stay as they are; new:version,goal(null for the dataset's own),actor,reason(required),replaces(the version it replaced, none for the first),evidence(D3).baseline_idgoes: a baseline is named by goal, dataset and version. - Written once, even by two promotions at once. A version is created exclusively (
O_EXCLin a files project; anINSERTthat fails on an existing key, in aBEGIN IMMEDIATEtransaction, in SQLite), and a promotion that finds itsntaken reads the new current version and computes again against it. A promotion from the terminal is not under RFC-026's locks, so the write itself must hold. evh run-promote --run R --reason "…"promotes into the run's own goal (its config'sgoal:);--goal Gnames another of the dataset's goals.round-close --promotepasses the round's goal, its--byand the round.- A baseline with no goal (owner, 2026-11-09: ad-hoc experiments need not be tied to a goal): a run whose config
names none is promoted into the dataset's own baselines,
data/baselines/_dataset/<dataset_id>/<n>.json, withgoal: null; versioned, evidenced and rolled back the same way;--no-goalputs a goal's run there too. A goal never reads them. Their readers (owner, 2026-11-09):evh baselines, the inspector's comparison (its default baseline when the arms answer no goal) anddeploy-sheet. evh baseline-rollback (--goal G | --no-goal) --dataset D --to N --reason "…"writes the next version restoring N, with its own evidence (N against what is current now).- Every reader moves to
_baselines(current(goal, dataset),versions(goal, dataset), numbers sorted as numbers, each with acurrentflag), and none keeps the old path: round-open(the round's starting run,rounds.py:131) andround-close --promote(rounds.py:286-299);- the goal axes'
reference: baseline(A6) and the catalog:catalog_build.py(its goal pages at :1215 and :2744 keep only the goal's own baselines, the "no goal" branch dropped; :990, :1909 and :4018 take the goal's current version, not the dataset list's last),catalog_adapter.baselines()(:1030, versions sorted by number); - the comparison's fallback to a promoted arm (
catalog_serve.py:499-501): the dataset's own current baseline; deploy-sheet(keyed by--config): it scans the current versions across goals for the arm's run and prints the goal and version in its block and--json;runs-list(ops/records.py; its--baselineswent:evh baselinesreplaces it), the data page (_data_page.py:50),fingerprint-migrate(fingerprint_migrate.py:169, a flat glob today),validate_tree.py(:208, :501, :1178, flat globs today),promote_baseline.py;data/baselines/README.mdand the docs that describe one baseline per dataset (UPGRADING, RUNBOOK, SCENARIO, README, GUIDE, UXS-003).pair-testreads no baseline (its B is--b, or a round's starting run): unchanged.
D3. The evidence, frozen at promotion¶
Before writing a version, run-promote computes and stores the comparison that justifies it, against the version it
replaces, on the goal's primary measure, exactly as pair-test answers it (owner, 2026-11-09):
"evidence": {
"compared_to": 3, "measure": "f1", "n": 200, "items_sha256": "…",
"verdict": {"outcome": "better", "delta": 0.021, "interval": [0.009, 0.033], "p": 0.0012, "method": "sign-flip"},
"axes": {"cost_usd_per_item": [0.0011, 0.0024]},
"round": "r3",
"computed_with": {"harness": "0.8.0", "stats_sha256": "…", "runs_a": ["…"], "runs_b": ["…"],
"reduce": "mean", "cluster": "fingerprint", "permutations": 10000, "seed": 0}
}
- Arm against arm, as
pair-testreads them.pair-testcompares arms, not single runs: it pools every run of each config on the dataset and reduces repeats per item. The evidence is that comparison between the promoted run's arm and the current version's arm; with a round (the promotion's own, or--round), aspair-test --roundreads it, a re-scored arm's latest re-score standing in for its runs.computed_withrecords the run ids pooled on each side, the reducer, the cluster field, the permutations and seed, so the verdict can be traced to its inputs. nanditems_sha256are over the items compared (the shared items, less any excluded), not the dataset's.- It is never recomputed: a later
pair-testis another question, not the evidence. - A first version has
compared_to: nulland no verdict. Two arms that are not comparable (another reference digest, scorer or item set) recordverdict: nullandnot_comparable: [the fields], and the command says so before writing. A promotion is not refused for a verdict that is "not significant" or "worse": the record and the catalog show it. Test-set looks (whether this comparison spent one) come with 4.4; until then the field is absent.
D4. evh baselines [--goal G | --no-goal] [--dataset D] [--all-versions] [--json]¶
Per goal and dataset: the current version, who promoted it and why, its evidence, how to reproduce it (the block
deploy-sheet prints for its run, one definition), and its history (each version: when, by whom, why, what it
replaced or restored). --json is the export a production system reads, on one line as every --json: deterministic (sorted, no timestamp of its
own, no harness version in a header), so two outputs with no new promotion are byte-identical; the goal's context and
decision ride along as the intended use. It replaces runs-list --baselines, which goes. The goal page shows the
same. It is a read tool of evh mcp (READ_TOOLS, JSON); baseline-rollback and baselines-migrate are in
NOT_TOOLS.
D5. Validation¶
V6 (baselines) checks each version: its run exists and its scores match; the replaces chain is contiguous (each
version replaces the one before it, a rollback included); restores names an earlier version; the evidence's
items_sha256 is the hash of the items its n counts. Records with no actor are named in a note (built
2026-11-09), not a failure: picks are an append-only list the migration does not rewrite, and a record written by
hand is not wrong for lacking one.
Migration (no backward compatibility)¶
One command, baselines-migrate (or a step of data-migrate, which the project already runs for format
changes), with --dry-run. As built it is the records step of evh migrate, one command for every 0.8.0 format:
- each
data/baselines/<dataset>_baseline.jsonmoves to<goal>/<dataset>/1.jsonunder the goal its record names, or to_dataset/<dataset>/1.jsonwithgoal: nullwhen it names none, withevidence: nullandmigrated: true("promoted before 0.8.0, evidence not recorded"),baseline_iddropped. This repository's eight: seven name a goal and move under it;smoke_v1's moves to the dataset's own baselines; - every existing record gets
actor: {"type": "unknown", "name": "before 0.8.0", "from": "migration"}: runs in every runs directory (runs*), baselines, references, label sets, rounds, dataset records, model records; label sets' and references'source.bystays. Picks are an append-only list and are not rewritten: a pick made before 0.8.0 keeps itsbyand no actor; split.bybecomessplit.split_byon every split side;- the schemas that refuse unknown keys (
additionalProperties: false: metrics, round, reference, dataset, baseline, label set, model, pick and the rest) gainactor; baseline gainsversion,goalnull,replaces,restores,evidence,migratedand losesbaseline_id; - before it is built: check whether a run's fingerprint hash covers any field the run rewrite touches (it must not
move a hash;
actoris outside the fingerprint by design, asgoalandroundare).
No reader keeps the old path or the old key.
Alternatives considered¶
- Keep one baseline per dataset and add history to it. Rejected: a goal names its datasets, and two goals on one dataset ask different questions with different primary measures, so one baseline answers one of them. (No dataset in this repository has two goals yet; a project with a noise goal and a recall goal on one capture would.)
- Recompute the evidence on demand. Rejected: it drifts with new runs and rules; promotion is when the decision was made.
- The evidence as one run against one run. Rejected (owner, 2026-11-09): every other test reads an arm, its
repeats pooled; a promotion's evidence that answered another question than
pair-testwould disagree with it. - The drafts' consent (
--confirmby a person). Rejected by the owner's rule: an agent acts when asked, and the record names whose decision it was. - Rename
source.byto the actor. Rejected: who labelled and who ran the command are two facts. - A record store with an id grammar for every kind (the drafts' RFC-017). Not needed: baselines are addressed by goal, dataset and version.
- An evidence check (the drafts' RFC-012,
evidence-check FILE): checking that a project's own citation file names baselines, runs and rounds that exist and are current. Dropped from 0.8.0 (owner, 2026-11-09): no project cites a harness id today (the podcast project'sregistry_refs.yamlcites eval reports by path, and its own script checks them), so it would only repeat that check. Added when a project cites harness ids; the versioned baselines andbaselines --jsonit would read are built here.
Testing¶
test_actor.py: every writing command records the actor, withfrom;EVH_ACTOR=agent:xwithoutEVH_FORis refused; no terminal and no actor givesunknown;--bywins over the environment;source.byandactorboth kept on a label set; a decision with anunknownactor is refused; an RFC-026 job's actor comes from itsby;dataset-split --split-by(and--byrefused there).test_baselines.py: promotion writes version n+1 and never touches n; two promotions at once both land, as n+1 and n+2, the second against the first; two goals on one dataset keep their own; a run with no goal goes to the dataset's own and no goal page shows it; version 10 is current after 9; the evidence equalspair-test's answer for the two arms at promotion (with a round, as--roundreads them) and stays when new runs arrive; not comparable records the fields; rollback restores and compares; every reader in D2 reads the right version;baselines --jsonis byte-identical twice; the migration moves this repository's baselines and writesactoron every record without moving a fingerprint hash.- All of it in both stores.
Open questions (the owner's, decided 2026-11-09)¶
- May an
unknownactor make a decision? No (D1). - A run with no goal? Promoted into the dataset's own baselines (D2), read by
baselines, the comparison anddeploy-sheet. evidence-checkin 0.8.0? Dropped (Alternatives considered).- The evidence?
pair-test's arm comparison, as a round reads it (D3). --byondataset-split? Renamed--split-by;--bymeans who acted (D1).
Decisions (ADR candidates)¶
- Every record says who acted, and for whom when an agent did; the actor is a recorded claim; the harness records, it does not ask for consent.
- A baseline belongs to a goal on a dataset (or to the dataset alone, for a run with no goal), in write-once versions; a rollback is a version.
- The comparison that justified a promotion is
pair-test's, frozen into it and never recomputed.