Skip to content

Re-pin the vendored Spec to 7dbae0c (byte rules, goldens, t13, records encoding) - #195

Merged
guijacquemet merged 3 commits into
mainfrom
claude/spec-repin-7dbae0c
Nov 7, 2026
Merged

guijacquemet merged 3 commits into
mainfrom
claude/spec-repin-7dbae0c

Conversation

@guijacquemet

Copy link
Copy Markdown
Contributor

What

Re-pins tests/spec_fixtures/ to MorphoBricks-Spec 7dbae0c (its PR 9 merged): fixtures, docs/experiment-v1.md and tools/audit/refval.py, with PIN.toml updated (commit, fixtures tree, the two blob IDs). Files were taken with git archive / git show from a worktree at that commit.

New in the pin:

  • section 11: byte rules of the derived experiment_design.csv, and golden files fixtures/expected/ for v13, v33, v34;
  • section 9.3: the byte form of one section digest;
  • section 10: t13, a changed image_count alone does not reopen a confirmation (a new confirmed_on beside it is R_CONFIRMED_ON_CHANGED);
  • section 4.6: the encoding of morphobricks.records.jsonl.

Agreement with the Spec

  • Reader and reference validator: 0 differences on every fixture and mutation. The oracle no longer differs from us on image_count, so test_spec_transitions.py drops its "set every image_count to 1" workaround and compares the pairs as they are (13 transitions now).
  • Section digests: new tests/test_spec_encoding.py checks section_digests equals the oracle's on every valid and transition fixture, and that a section with no tables is the SHA-256 of the empty bytes. The writer already matched; no change needed.
  • Records file: byte-exact test of the file written by a publication (keys in code point order, LF after each line, non-ASCII unescaped), and refusal of a torn last line, a non-object line, a blank line and invalid UTF-8 before anything is written.
  • Fix found by the new test: read_records split the file with str.splitlines(), which also cuts at U+2028 and U+0085. A record holding such a character (written unescaped, as the Spec requires) was then refused as "not JSON". Lines now end at LF only.
  • Test helper spec_pin.catalogue no longer reads the golden-file rows of the fixtures README as fixtures.
  • The goldens are not compared with anything here: no code derives experiment_design.csv from a description yet. That is Stage 1 PR 10, the next PR, which will compare against them byte for byte.

Tests

Regression for the defect: test_non_ascii_text_is_written_unescaped_and_read_back_whole fails on the old code (RecordsFileError: ... holds a line that is not JSON), passes now. Before the helper and count updates, the re-pinned fixtures also failed test_the_catalogue_lists_every_file_and_nothing_else[valid] and test_the_fixture_counts_are_the_catalogue_s (13 transitions); both are fixed here.

python tools/check.py: 3911 passed, 4 skipped, code rules clean. The 4 skips are environment ones (case-insensitive file system and file-mode tests, unrelated to this change). No Spec test is skipped (the gate holds them to it).



Generated by Claude Code

Fixtures (goldens in expected/, t13), experiment-v1.md and refval at
MorphoBricks-Spec 7dbae0c. Reader and reference validator agree on all
fixtures and mutations; the oracle no longer differs on image_count. New
byte-level tests for section digests (9.3) and morphobricks.records.jsonl
(4.6). read_records split at U+2028/U+0085 as well as LF; now LF only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm

# Conflicts:
#	CHANGELOG.md
@guijacquemet
guijacquemet merged commit 2602560 into main Nov 7, 2026
7 checks passed
@guijacquemet
guijacquemet deleted the claude/spec-repin-7dbae0c branch November 7, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants