Repository navigation
Freeze released run-report directories and read them with the current readers (#271) - #314
Merged
Merged
Conversation
… readers (#271) The first half of the Run envelope family of the persisted-contracts D rows. tests/fixtures/persisted/envelope/<release>/ holds the run directories v0.1.2, v0.2.0 and v0.3.0 wrote through their own run and board run with report recording on (freeze.py, a fake codex and kimi, the release venv with its phoenix extra): envelope.json, result.json, trace.otlp.json and, from v0.1.3 on, the run-dir sentinel. index.json holds what each release's own CLI printed for report list and report show; the release's own schema is frozen beside it. Scenarios: completed, no change (patch digest of the empty string), route failure, gate passed and failed (pipeline, since route drops a rejected gate), a compete team, a file trace, a Phoenix export error, a trace error, breaker and multiple degradations, a board block, the skeleton a SIGKILL leaves, a SIGINT's finalized crash, and a trace-only run with no envelope. tests/test_frozen_envelope.py: - HEAD's schema accepts every released envelope (and so does the release's own); load_envelope returns the stored document unchanged; - report show and report list print what the release printed, byte for byte, and each shown field matches the raw values; a run without an envelope is refused with the release's message; - the TUI Reports tab and the dashboard REPORT pane list every released run newest first and show the release's own report text on selection; - retention ownership over released dirs, through RunReporter.start and the Supervisor's trace-only sweep: a sentinel, or for v0.1.2 an envelope with syncmill's kind naming its own directory, makes a run dir removable; a v0.1.2 trace-only dir is never removed; one-predicate probes (renamed, kind changed or removed, not an object, torn, foreign result.json) are kept; a custom trace.dir is never swept. Preflight blocks appear only as disabled; the released preflight records are the second half. No src change. 25 injected reader mutations fail these tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Implementation review round 1 found two regressions the envelope tests let through: - a retention sweep that removed the current run's directory passed, because the tracer recreated it at finalization. The current run now holds a marker written before the sweep, and the reporter and both Supervisor tests assert its bytes survive. - a listing sorted by finished_at passed, because every released run finished before the next began. The cross-release listing adds a test-made long run (a released envelope started before all of them, finished after all of them) that the two orders place apart. Also: load_envelope reads a copy of the fixtures, not the fixtures themselves, and every helper enumerates the scenarios a release froze (including any completed-N run freeze.py adds to break name order). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#271) Implementation review round 2: the TUI Reports tab and the dashboard REPORT pane were checked only over released runs, whose creation and completion orders agree, so a view that re-sorted by finished_at passed. Both now include the test-made long run (created before every released run, finished after them) and expect it last. Schema validation now passes a format checker. jsonschema checks `date` and similar formats always, `date-time` only with the optional rfc3339-validator, which this environment does not install. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
) Review of PR #314 (agy, SHIP with minors): - RELEASES came from a literal, so a release directory freeze.py adds later would be skipped. It is now read from the fixture directories, as the other frozen families do, and a test requires the three present releases so discovery cannot hide a missing one. - index.json records the git blob id of the release's schema, but nothing compared it with the frozen copy. Each release now checks the file's blob id against it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #271. This is the first half of the Run envelope family. The issue stays open: this family's preflight records and the Memory backends and TUI jobs families remain.
What
tests/fixtures/persisted/envelope/<release>/holds the run directories that v0.1.2, v0.2.0 and v0.3.0 wrote through their ownsyncmill runandboard runwith report recording on.freeze.pybeside them used each release's worktree and venv (with itsphoenixextra) and fakecodexandkimibinaries:runs/<run-id>/:envelope.json,result.json,trace.otlp.jsonand, from v0.1.3 on, the.syncmill-run-dirsentinel, copied byte for byte.index.json: scenario → run id, plus what the release's own CLI printed forreport listand for eachreport show.run-envelope.schema.json: the release's own schema, with its git blob id.Scenarios, each in all three releases:
patch_digestis the sha256 of the empty string, not nullagent_id"none",exit_code-1-s pipeline, because route drops a rejected gate reporttests/test_frozen_envelope.py(189 cases). Expected values come from the raw fixture bytes, from the release's own output inindex.json, or from literals:Schema: HEAD's
contracts/run-envelope.schema.jsonaccepts every released envelope, with a format checker. So does the release's own schema.load_envelopereturns the stored document unchanged.report show:report list:created_at;A test-made long run (created before every released run, finished after them) tells creation order apart from completion order.
The TUI Reports tab and the dashboard REPORT pane:
Retention ownership over released directories, through
RunReporter.startand the Supervisor's trace-only sweep:kindand names its own directory.kindchanged,kindremoved, not an object, torn, a foreignresult.json).trace.diris never swept.docs/architecture/persisted-contracts.md: the Run envelope row names these. Not covered:disabled. The released preflight records are the second half.trace.otlp.json, which is tracegraph's reader to test.report listalso lists a foreign directory holding any nonempty JSON-objectenvelope.json. This is recorded as observed and left unchanged.No
src/change. No current reader misread a released run directory.Verification
suite-runis CLEAN,ruff check .is clean andgit diff --check main...HEADpasses.report.py,supervisor.py,tui.py,dashboard.pyand the schema. Each is injected exactly once and restored from a byte copy, and each fails a test with an assertion. They cover:trace.dirguard, and the current-run exclusion in both callers;finished_at) and a TUI or dashboard re-sort;schema_versionstrictness and a closedtraceBlock. Every release writes version 1 and only declared trace fields.🤖 Generated with Claude Code