From 1d2c1e9b8b0a5b66d0c8870bd55e0de516e7fac3 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 13 Oct 2026 06:01:43 +0000 Subject: [PATCH] runs: build_record, record_json, done_status for hosts that write their own run record A host that makes its run-record folder itself (owner marker when the run starts) and must never prune had to copy runs.record. Three pure functions now carry what it needs: build_record (the content of run.json, exactly what record writes; run_id and started_utc only when given), record_json (its text) and done_status (the .lc-done.json status, SPEC 3.2: a crash after Cancel is cancelled). record uses them; the CLI's record is unchanged except that a crash after Cancel is cancelled, a case the CLI cannot produce. No features id (an additive helper of the Python package); hosts require the first Tools release after 0.2.0rc1. Documented in PROTOCOL.md and OPERATIONS.md, with tests, sabotage rows and a ledger row. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN --- docs/OPERATIONS.md | 1 + docs/PROTOCOL.md | 7 + docs/REGRESSION_LEDGER.md | 1 + labconstrictor_tools/runs.py | 90 ++++++++--- tests/test_run_record_builder.py | 252 +++++++++++++++++++++++++++++++ tests/test_sabotage.py | 119 ++++++++++++++- 6 files changed, 446 insertions(+), 24 deletions(-) create mode 100644 tests/test_run_record_builder.py diff --git a/docs/OPERATIONS.md b/docs/OPERATIONS.md index 2637738..7f7e369 100644 --- a/docs/OPERATIONS.md +++ b/docs/OPERATIONS.md @@ -60,6 +60,7 @@ Files that must change in the apps (the template-repository change is a later ta * `labconstrictor-tools run` without `--out` writes its results to `/results/