Repository navigation
docs(run-log): freeze run log v1 schema and prove --report json byte-stable - #105
Merged
Merged
Conversation
`nano replay --report json` printed through the console's text wrapper, which rewrites each LF to CRLF on Windows, so the same run produced different bytes per platform. The report now leaves through Console.emit, like the receipt, via a single encode_run_log() helper. Field names, order, indent and float formatting are unchanged; POSIX output is byte-identical to before. Adds encoding pins (line terminator, key order, float repr, wide and negative integers, ASCII escaping) and the run_log fixture inputs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Documents `nano replay --report json` as run log v1: every member, the event vocabulary, byte rules (indent, key order, ASCII, float repr, LF), the bar-time-only timestamp rule for run and replay, emission ordering, versioning policy (no in-band version field; absence of runLogVersion means v1), and how it maps onto the run receipt, which stays the canonical artifact. Adds docs/run-log.schema.json (closed objects, open event set) and golden run logs for three library strategies plus one fixture strategy reaching every replay-path event. Tests reproduce the goldens in-process, twice, with the wall clock replaced, and in subprocesses under foreign hash seeds, time zones and locales; validate them against the schema with negative controls; check the arrays equal the receipt's run arrays; and keep the documented event list equal to the VM emitters. Co-Authored-By: Claude Opus 5.5 <[email protected]>
receipts.md still called `nano replay --report json` an unversioned convenience with no stability promise. It now has its own run log v1 contract; say so, while keeping the receipt independent of it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
nano replay --report jsonis now a documented, versioned contract: run log v1.docs/run-log.md+docs/run-log.schema.json(JSON Schema 2020-12, closed objects): every member; the 14 VM events with informativedetailformats; byte rules (indent 2, emitter key order, ASCII escaping, shortest round-trip floatrepr, single LF); the timestamp rule (bar times from the input frame only — never the wall clock, in a run or a replay); emission ordering (not timestamp order); versioning (no in-band field; absence ofrunLogVersionmeans v1); and an explicit mapping onto the run receipt, which stays the canonical artifact.infer.skipped). Tests reproduce them byte for byte in process, twice in a row, with clocks replaced by absurd values, and in subprocesses under foreign hash seeds, time zones and locales. Goldens validate against the schema (17 negative controls); their arrays equal the receipt'srunarrays. A drift guard keeps the VM's event set, the schema and the doc in step.\r). It now goes through the byte stream like the receipt. No member, value or order changed; POSIX output is unchanged.docs/receipts.mdnow points at the run log contract instead of calling the report unversioned.No
to_dictshape or runtime error text changed (nano package testfixtures unaffected). Mutation checks:sort_keys, compact separators, an injected wall clock, reverting to text output and set-ordered effects each make the new tests fail.Local: full suite 3490 passed / 20 skipped / 0 failed (Windows, CPython 3.13); focused run-log/docs/receipt tests 164 passed.
Closes #10.
🤖 Generated with Claude Code