Repository navigation
feat(runs): runs export | import, a verified bundle that moves a run - #1521
Conversation
A baseline pointer under results/ goes with the ephemeral CI runner that made it (intel#94 §2.3). `runs export RUN|baseline:NAME > bundle.tgz` writes the run directory (run.json, its plan, result and the artifacts it lists) as a gzipped tar led by bundle.json (run_bundle.v1), which gives the run's address, the plan_digest and the result's sha256, and the sha256 and size of every file. The tar holds no time, owner or mode, so one run always exports to the same bytes. `runs import BUNDLE [--as NAME [--expect-previous RUN_ID]]` reads it into memory and writes nothing until it holds: only regular members at the paths bundle.json lists (no links, devices, FIFOs, directories, absolute or `..` paths, or paths equal but for case), each with its hash, under a 256 MiB cap on the unpacked stream; run.json lists exactly the files, each artifact passes its schema and carries the run's run_id, the result names the plan's digest. The run goes to <root>/<name or run_id> through a staging directory and a rename; the same run already there is a no-op, another run with the run_id or a taken directory exits 2. --as points a baseline at it through runs/baseline.py's save, with --expect-previous as a compare-and-swap (exit 4). Refs intel#94 Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
mkdocs build --strict read the three checks under runs import at depth 1 while GitHub reads them at depth 2: indent them 4 spaces, with a blank line before and after the nested list. Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
A name that differs from a saved baseline only in case, or a .baselines/ that is a link or cannot be locked, was refused by baseline.save only after the run was written, with a message that did not say so. Check them through baseline.listed before the write, and report a save that still refuses after it (a read-only store) as "run X is imported, but ..." with the import's data. Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
…h no name Export of a run whose listed file is missing, a symlink, a FIFO, behind a link out of the directory, unreadable or over the cap exits 2 with nothing on stdout; a re-signed bundle whose run.json lists no result is refused; a run with no name goes to <root>/<run_id>, and --as --json carries data.baseline. Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
verified() did not apply run_bundle.v1's caps (1000 files, a path of 1024 characters), so a run past them exported fine and no import could read its bundle. collect() now checks the manifest against the schema, as import checks it first. Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
…undle The refusal named the newest artifact with the run_id, which may be identical to the bundle's. Name the first artifact with the run_id the bundle does not hold, else the first bundle file the directory does not hold as it is. Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
runs import opened BUNDLE before looking at it, so a FIFO with no writer blocked for good. Stat it first and refuse what is not a regular file, as runs show does. Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
… zlib The tar of a run is deterministic, but the .tgz is zlib's deflate output: CPython's Windows builds use zlib-ng, which compresses to other bytes. Name bundle.json (the address and each file's sha256) as what is the same on every machine, in runs.md, the fragment and write(). Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
The case check compared a path only with another spelling, and the members were matched through a dict, so a second entry for a path silently replaced the first. Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
|
OpenCodeReview: Commit ebc628a was not reviewed. This PR has reached its review limit (6 reviews). CI at `ebc628a`: 5 still running, 16 passing, 3 skipped
To review this commit: re-request review from exai-bot in the Reviewers list. Last review (620507d): no findingsOpen threads from the bot: 1 |
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1521 +/- ##
==========================================
- Coverage 96.49% 96.47% -0.03%
==========================================
Files 535 537 +2
Lines 71587 72051 +464
Branches 12365 12438 +73
==========================================
+ Hits 69080 69511 +431
- Misses 1532 1553 +21
- Partials 975 987 +12
🚀 New features to boost your workflow:
|
CLI interface change detectedThis PR changes dokimi's user-facing CLI surface (commands and/or options): + added command `dokimi runs export`
+ argument `run`
+ option `--help/-h`
+ added command `dokimi runs import`
+ argument `bundle`
+ option `--as`
+ option `--expect-previous`
+ option `--help/-h`
+ option `--json`Updated on every push; the |
Mutation of changed linesAt ebc628a: 52 caught · 6 missed · 22 not tried in time Each row is a small deliberate break (a mutant) of a line this PR changes that every test reaching that line still passes. Add a test that fails on it or, if it cannot change behaviour, put
Not the whole picture:
Warning only: a missed break does not fail the job. Updated on every push; the full report is in the ci run summary. |
napetrov
left a comment
There was a problem hiding this comment.
Nine focused round-trip, conflict and idempotency tests passed. I also exercised two concurrent imports with verified bundles. Concurrent imports can publish duplicate run IDs under different directory names.
vchamarthi
left a comment
There was a problem hiding this comment.
@vlad-perevezentsev, could you fix the problem I found (in the line comments) and fix what the bot's thread on dokimi/docs/runs.md:381, the bot's thread on dokimi/dokimi/runs/bundle.py:88, the bot's thread on dokimi/dokimi/runs/bundle.py:100 and the bot's thread on dokimi/dokimi/runs/bundle.py:277 still point out? Then push and I'll take another look.
There's 1 optional suggestion in the line comments; take it or leave it.
What I checked on 94d84af:
- When I changed the code on purpose, the tests still passed for 5 of 12 changes, and no test pins these down yet (non-blocking):
dokimi/dokimi/commands/runs_bundle.py:103(the handled error is raised again),dokimi/dokimi/commands/runs_bundle.py:106(the handled error is raised again),dokimi/dokimi/commands/runs_bundle.py:109(the handled error is raised again) and 2 more. - The 169 changed tests pass, and fail on main as expected.
- The full test suite passes with main merged in (36,254 tests), apart from failures main has too.
- It merges cleanly onto main.
rundir writes one run record per directory, its run.json, and never lists
kind run. Import took such a bundle with exit 0, and the run then could not
be exported again ("has 2 run.json files"). It now exits 2.
Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
A run.json that lists x.json and x.json/y.json passed every check, then failed in the staging write with exit 5 "cannot write: File exists", the exit docs/runs.md keeps for a disk that cannot be written. _check_paths now refuses it with exit 2 before anything is written, also across case. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
_check_paths folded case only, so the NFC and NFD spellings of one name both passed, and macOS would write them to one file after both were checked. The key is now NFC, then casefold. docs/runs.md lists this check and the path-under-a-file check. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
The mkdir of the default runs root ran before the OSError handler of install, so a denied results/ crashed with a traceback. It now goes through the same infra exit as a run that cannot be written. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
…read collect() checked the manifest against its schema caps only, so a run with many long artifact paths exported with exit 0 and a bundle.json over the 1 MiB import reads it under, which import then refused. Export now checks the serialized size write() produces. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
…s files A re-signed bundle with a file run.json does not list, an artifact of an unknown kind, or one path listed twice had no test: each check could be dropped with the suite green, and the first lets unchecked bytes into the imported run directory. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
… out The bundle holds run.json and what it lists; the left-out line named only artifacts carrying the run_id, so a report or other file in the run directory stayed behind without a word. Export now names them on a second left-out line, and docs/runs.md says so. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
… a bundle The address is the plan digest and the result sha256 only. A bundle with run.json or another artifact edited and bundle.json re-signed imports with exit 0 and prints the same address, so comparing it proves nothing there. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
|
napetrov
left a comment
There was a problem hiding this comment.
Change class: CONTRACT (head 5f75c5e)
- Contract: changed. errors dokimi/dokimi/commands/runs_bundle.py:31; errors dokimi/dokimi/commands/runs_bundle.py:67
- Responsibility: candidate (count signal only, no file:line)
- Dependency: none
- Review depth: check the changed surface: callers, docs, tests pin new behaviour
- Coverage gaps: none
I rechecked the concurrent import finding on this revision. Two valid imports with the same run ID and different names both returned written=True and left two run.json files. Nine focused bundle tests passed, including the revised root-creation error case. The duplicate-ID issue still blocks approval.
Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
A run.v1 artifact path or run name may hold ?, <, >, ", |, * or be a device name such as CON or nul.json, which Linux and macOS write and Windows refuses. Export wrote such a run and import accepted it, then could not write it on Windows (exit 5). safe_path now refuses these characters and device names in every segment, and verified() checks the name of the run's directory with it, so export and import refuse the run (exit 2) before anything is written. Refs intel#94 Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
install() scanned the root for the bundle's run_id and then renamed the run into place with nothing held between the two. Two imports of one run under two names both found no run, and both wrote it: two run.json files for one run_id, which export then refuses. Two imports under one name made the second fail with exit 5 (Directory not empty) instead of the no-op an identical run is. install() now holds .baselines/.lock, the lock baseline saves take, from the scan to the rename, so the second import finds the first's run. A store that cannot be locked (a read-only .baselines/) now refuses the import before the run is written; it was refused only by the save after it. Refs intel#94 Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
Two imports on a fresh runner both found no results/; the one that made it second failed with exit 5 (cannot make it: File exists) and wrote no run. _import_root() now makes the default root with exist_ok, so the second goes on; a file at results/ still fails. Refs intel#94 Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
scan() finds an artifact by a name that ends in .json and JSON that
opens with its schema_version. A bundle re-signed after its run.json
was rewritten with sorted keys passed every import check, and the run
it wrote could not be listed or exported again ("has no run
directory"); a reordered artifact dropped out of the run's files the
same way.
verified() now refuses a listed file that scan() would skip, through
scan.artifact_version(), the rule scan() applies by name and first
bytes, so export and import check what runs list reads.
Refs intel#94
Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
The paragraph said every save that fails once the run is written exits 2, while the command and the exit-code table give 5 for a pointer that cannot be written. Say which is which, and pin the 5 with a test. Refs intel#94 Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
safe_path() took the device names CON, PRN, AUX, NUL, COM0-9 and LPT0-9, but Windows also reserves CONIN$, CONOUT$ and COM/LPT with a superscript digit, which run.v1 allows in an artifact path. Use the set of CPython's ntpath.isreserved (3.13), keeping COM0 and LPT0. Refs intel#94 Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
Since install() takes the lock first, no test reached the InputError branch of _point(), which docs/runs.md promises: a baseline saved meanwhile whose name differs only in case makes the save refuse once the run is written, with exit 2 and 'run ... is imported, but'. Refs intel#94 Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
@xaleryb Thanks for the commits. The three items left: the import lock is 7f3813f (both cases you describe: a second name is refused, the same name is the no-op), the Windows reserved names and characters are a9609c6 and 012a706. For --expect-address, a trusted digest of bundle.json checked at import would be a new flag; I'd propose it as a follow-up issue rather than grow this PR. |
The import writes a run into .<name>.<hex>.import under the runs root and renames it into place, but scan() walked that directory, so runs list, runs export and the run_id check of another import saw part of a run before the rename. scan() now skips such a directory at the root, as it skips .baselines; a run's own name never starts with a dot. Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
_check_paths() compared whole paths only, so Sub/a.json and sub/b.json passed. Windows and macOS write both into one directory; a later scan reads Sub/b.json, which the bundle does not list, so an identical second import exited 2 instead of being the no-op, and runs export reported the file as left out. A bundle (and a run on export) that spells one directory in two cases or two Unicode normalizations is now refused. Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
napetrov
left a comment
There was a problem hiding this comment.
Change class: CONTRACT (head c353702)
- Contract: changed. errors dokimi/dokimi/commands/runs_bundle.py:31; errors dokimi/dokimi/commands/runs_bundle.py:67
- Responsibility: candidate (count signal only, no file:line)
- Dependency: none
- Review depth: check the changed surface: callers, docs, tests pin new behaviour
- Coverage gaps: none
Nothing to fix in this pass. The bundle tests exercise round-trip export/import, schema and digest checks, duplicate imports, and baseline updates.
Checked the diff, input edges, prior feedback, and focused offline tests on Linux/Python 3.11 (213 passed in 18.84s).
Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
The bad-path contract that came in with main (intel#1492) reads the operand as a path, since its help names run.json, and failed the command as one whose path parameter is never reached. RUN is a run_id or baseline:NAME, so list it in NOT_PATHS. Refs intel#94 Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
| bytes; ``None`` when there is none.""" | ||
| for path, data in sorted(bundle.files.items()): | ||
| try: | ||
| if not stat.S_ISREG(os.lstat(directory / path).st_mode) or (directory / path).read_bytes() != data: |
There was a problem hiding this comment.
Impact: importing a small valid bundle can exhaust memory instead of refusing a differing destination artifact.
Trigger: after installing a run, replace its arms.v1.json with a multi-gigabyte sparse file beginning with zero bytes, then import the original bundle again.
Evidence: scan() skips that file after its bounded header read, but still discovers run.json, so _install() reaches this unconditional read_bytes() and allocates the entire oversized file.
Fix: Compare the lstat size with len(data) first, and bound the subsequent read to len(data) + 1 to handle growth. Add an oversized-destination regression.
Workaround: remove or repair the oversized artifact before retrying.
Not shown by a run: The proof step did not check this finding.
There was a problem hiding this comment.
This needs the installed run's arms.v1.json replaced by a multi-gigabyte file before the same bundle is imported again, and the harm is bounded: the import uses memory or fails, nothing is written or lost. I'd leave it out of this PR and open a follow-up issue: _first_difference compares the lstat size with the bundle's before reading, and reads at most len(data) + 1 bytes.
tarfile parses a PAX sparse map with int(), so a malformed one raises ValueError while the archive is read; runs import let it through as an infrastructure crash (exit 5, a traceback). It is now refused like any other archive that is not a run bundle (exit 2). Refs intel#94 Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
The test makes the run's directory 'con' first, which Windows refuses, so it fails in its setup there before export is reached. Refs intel#94 Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
napetrov
left a comment
There was a problem hiding this comment.
Change class: CONTRACT (head 620507d)
- Contract: changed. errors dokimi/dokimi/commands/runs_bundle.py:31; errors dokimi/dokimi/commands/runs_bundle.py:67
- Responsibility: candidate (count signal only, no file:line)
- Dependency: none
- Review depth: check the changed surface: callers, docs, tests pin new behaviour
- Coverage gaps: none
0 new must-fix findings. Nothing to fix in this round. The new test classifies the unreadable tar header as an input error. The Windows skip is scoped to fixture creation using the reserved con name.
Checked the diff, input edges, and focused offline Linux tests (focused: 216 passed in 19.24s). Checked bundle import/export on Linux. Windows and macOS filesystem behavior was not run. The agent-run fault-harness failure reproduces on the base.
- Fixed on head by
7f3813f0. The run-ID lock regression passes for both concurrent import cases. Earlier thread - Fixed on head by
a609097e. The malformed-header regression passes. Earlier thread - Fixed on head by
620507d0. The Windows skip is scoped to the reserved fixture name. Earlier thread
antonwolfy
left a comment
There was a problem hiding this comment.
LGTM. Export and import hold up: nothing is written until every check passes, the staging directory is invisible to scan(), and the lock covers both the run_id scan and the rename. The earlier review rounds are fixed at this head, and I found nothing new to add.
What I ran, on a Linux review host at 620507d:
make ci-local: 37 passed, 1 failed, 16 skipped. 34,046 tests passed, changed-line coverage 95% of 466 lines,mkdocs buildandpip-auditpass.- The one failure is
test_cli_fault_contract.py::test_a_bad_path_is_refused_as_the_quickstart_says[agent run]:agent runrefuses the fillerxfor--agent(expected AGENT=MODEL). It fails the same way on the PR's base, and the PR only adds aruns exportentry toNOT_PATHS. - Mutation of changed lines: 80 mutants, 70 killed, 10 survived. The survivors are the cap constants,
stdout.flush()and clauses of the case-only--aspre-check, whichbaseline.saverepeats; none decides an exit code.
Checked, no issues
- Commits: all 29 non-merge commits carry
Signed-off-by. - Path rules:
safe_pathand_check_pathsagree between export and import, andverified()applies the same checks on both sides, so an export no import would read is refused. - Atomicity:
_publishstages beside the target, andscan()skips.<name>.<hex>.importat the root only; run names start with an alphanumeric character inrun.v1, so no run name can match. - Docs and wiring:
docs/runs.mdexit codes matchruns_bundle.py, the new schema has its fixture, and the changelog fragment is present.
Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
|
xaleryb
left a comment
There was a problem hiding this comment.
Approved on ebc628a. runs export | import moves a run as a verified bundle; re-run on the head merged with main: two parallel imports of one run_id now serialise (one writes, the other refuses), a repeated import exits 0, Windows-reserved names and paths such as CON.json and arms?.json are refused, and our eight commits still hold. Full suite and gates are green. Windows smoke had not started (the hosted Windows queue was stuck); every other check passed.
Summary
The last part of #94 R3 (§2.3, "Baselines survive ephemeral CI runners", D9 (b)). A baseline pointer under
results/goes away with the CI runner that made it.runs exportwrites one run directory (#1150) as a single file, andruns importchecks that file and puts the run under the runs root of another machine. With--asit also points aruns baseline(#1184) at the run. Refs #94 R3.runs export RUN|baseline:NAMEwrites the bundle to stdout and a one-line summary to stderr.RUNis arun_idwhose artifacts include arun.json;baseline:NAMEis the run a baseline points to. The bundle holdsrun.jsonand every artifact it lists (the plan, the result and the run's own artifacts). An artifact that carries therun_idbut thatrun.jsondoes not list is left out, and stderr says so (left out: 1 artifact …).bundle.jsoncomes first (new schemarun_bundle.v1, not an artifact kind), then the run's files underrun/.bundle.jsonnames the run and its address, which per CLI API: the evaluation loop at the top level, subject and eval groups below, one enforced flag vocabulary (proposal v2.1) #94 is the plan'splan_digestplus the sha256 ofresult.v1.json, and gives the sha256 and size of every file. The tar holds no time, owner or mode, so a run always makes the same tar. The.tgzbytes come from zlib, so a different zlib build may compress them differently.bundle.jsonis the same on every machine.runs import BUNDLEreads the bundle into memory and writes nothing until every check passes ("import never trusts it blindly", CLI API: the evaluation loop at the top level, subject and eval groups below, one enforced flag vocabulary (proposal v2.1) #94):bundle.jsonfirst, then exactly the files it lists, each with its sha256 and size;..segments,\,:and the other characters Windows refuses (<>"|?*), Windows device names (CON,nul.json,CONIN$,COM¹, asntpath.isreservedlists them), segments ending in.or a space; a path listed twice; two paths that differ only in case or in Unicode normalization; two spellings of one directory (Sub/a.jsonbesidesub/b.json); a file and a path under it;run.jsonmust be a validrun.v1that lists exactly the bundle's files and no second run record, with a name (orrun_id) Windows can make a directory of;run_id, and be oneruns listfinds (a.jsonname, JSON that opens with itsschema_version), so the run can be exported again;plan_digestmust be the digest of the plan, andbundle.json's run and address must match the run's.<runs root>/<name>, or<runs root>/<run_id>for a run with no name, as run directories are named. The files are written to a staging directory beside the target, which norunscommand reads, then renamed into place. From the scan for therun_idto the rename the import holds.baselines/.lock, so of two imports of one run at once the second finds the first's run.results/is created when it is missing (a fresh runner, also when another import makes it meanwhile); aDOKIMI_RUNS_DIRthat does not exist is refused. If the same run is already there with the same files, nothing is written and the exit code is 0. An import never replaces a run: another run with the bundle'srun_idanywhere under the root, or a directory of that name that holds anything, exits 2. The error names the file that differs.--as NAME [--expect-previous RUN_ID]points the baseline throughruns/baseline.py'ssave, with the same compare-and-swap asruns baseline save. If the pointer has moved, the exit code is 4 (stale_baseline), the pointer is left as it was and the run stays imported. A bad name, a name that differs from a saved one only in case, or a.baselines/that is a link or cannot be locked exits 2 before the run is written. A pointer that cannot be written after the run is exits 5 and says the run is imported.runs/baseline.pyandruns/rundir.pyare not changed. The code is in the newdokimi/runs/bundle.pyanddokimi/commands/runs_bundle.py.commands/runs.pygets one import and one register line,cli_routes.pytwo registry lines, andcli_flags.pyregisters--asunder thebaselineconcept.Changed output
New commands only:
runs exportandruns import(--json:cli_output.v1, kindruns import). New exit-code rows are indocs/runs.md:run_id, a taken directory, a bad--as/--expect-previous--as NAME --expect-previous RUN_IDand NAME does not point to RUN_IDEvidence
tests/test_runs_bundle.py, 51 test functions. They cover:..,\, a symlink, a hard link, a FIFO, a device, a directory, a member not listed;bundle.jsonnaming another address, paths that differ only in case, a path listed twice;run_idand a taken directory are refused;bundle.jsonnot first, a listed file missing;--expect-previousexiting 4 with the run imported; bad--asand--expect-previousflags refused before writing; a case-only--as; a store that cannot be locked;bundle.jsonpast its schema caps, a run with no run directory, a run without a plan, a terminal stdout;<root>/<run_id>;--jsonfields;results/made by another import meanwhile; a run.json or artifact with reordered keys, leading whitespace or a non-.jsonname; a pointer write that fails (exit 5); a case-twin baseline saved between the write and the save (exit 2, the run imported).run_idcheck dropped, the "same run" check dropped,..allowed, theplan_digestcheck dropped, the case check dropped, the stream cap dropped. Then: no store pre-check, no catch of a latesaverefusal, theinsidecheck, theS_ISREGcheck, a plan-only count,name or run_id, the export cap, the export manifest check.runs import: a directory, a missing file, an empty file and a Windows-style path each exit 2 with a message. Bad inputs toruns export: a name that is not a run id,baseline:BAD., a missing baseline and an unknownrun_ideach exit 2 as well.mkdocs --strictrejected; a case-only--asrefused only after the write; untested export refusals; an export that no import could read (pastrun_bundle.v1's 1000-file and 1024-character caps); an error that named the wrong file; a FIFO BUNDLE that blocked; the "same bytes on every machine" claim (it depends on zlib); a duplicate path inbundle.json.make ci-local --offlineon94d84af2: 0 failed, 27 passed, 22 skipped (network, Windows smoke, matrix legs). The suite: 32692 passed, 132 skipped. Changed-line coverage is 92% of 414 lines. The uncovered lines are mostly refusal branches such as an unknown kind inrun.json, an artifact that is not a JSON object, or a rename race.256/1024/8MiB bumped by one);stdout.flush();results/'smkdir, whose deletion the next write covers by making the parent;--aspre-check, whichbaseline.saverepeats after the write;(empty)branch ofbefore:;written=Falsein the--jsondata, twofield/reprdefaults).slot ci --quick(lint, mypy, the whole suite): 0 failed, 33407 passed, 132 skipped. Mutations: the lock dropped, theexist_okdropped, the leading-schema_versioncheck dropped, the.jsonname rule dropped, the device-name stem and itsrstrip, the?character and the run-name check each fail a new test.rmdirbefore the rename exist for them, but they are tested only on Linux.Open questions
--asis explicit. CLI API: the evaluation loop at the top level, subject and eval groups below, one enforced flag vocabulary (proposal v2.1) #94'spr-checkrecipe saysruns import baseline.tgzand then usesbaseline:main. Here the recipe needsruns import baseline.tgz --as main. The bundle does not record the baseline name it was exported under, so the address depends on the run only. Should import set that name by itself?bundle.jsonincluded, passes the hash checks. Schemas,run_idandplan_digeststill have to hold. Should import take an expected address (--expect-address), from a workflow that keeps the export's output where a PR cannot write?Not in this PR
baseline:FILE|URL(CLI API: the evaluation loop at the top level, subject and eval groups below, one enforced flag vocabulary (proposal v2.1) #94 §2.3, the other half of D9 (b)).subjects runwrites a run directory so far (feat(subjects): subjects run writes a run directory with its plan and result #1494; CLI API: the evaluation loop at the top level, subject and eval groups below, one enforced flag vocabulary (proposal v2.1) #94 R2 moves the other command families to it one by one), so today only its runs can be exported..<name>.<hex>.importunder the root until it is removed. Norunscommand reads it;docs/runs.mdsays so.runs importnow takes.baselines/.lockeven without--as, so on a file system that does not lock it exits 2 asruns baseline savedoes (docs/runs.mdsays so).Checklist
pytestpasses:tests/test_runs_bundle.py(51), andtests/test_cli_output.py's leaf set takesruns importruff,mypy, and schema checks pass:make ci-local --offline(above); newrun_bundle.v1.jsonwith its fixture intests/fixtures/artifacts/docs/runs.md(new section and exit codes),docs/run-directories.md,docs/reference/cli-interface.json, changelog fragment (Added)AGENTS.md: the mutations, bad inputs and review aboveraise/exit and test names the doc, contract or issue it traces to:docs/runs.md"Moving a run" and CLI API: the evaluation loop at the top level, subject and eval groups below, one enforced flag vocabulary (proposal v2.1) #94 §2.3, cited in the messages, docstrings and test comments