Repository navigation
test: v8 golden files and v7 migration checks (#391) - #456
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn
Adds tests/golden/: six v7 files written by minigraf 2.0.3 (one checkpoint, several checkpoints, indexes rebuilt on open, a crash-left WAL, an already-checkpointed WAL, same-transaction multi-values), each with a JSON manifest of its CRC32, tx_count and hand-written expected query results. tests/golden_corpus_test.rs opens a copy of every file and checks its manifest after open, after a checkpoint and reopen, and after one more write. Queries v2.x is known to get wrong (#371) carry min_reader = 3. The generator is a standalone crate pinned to minigraf =2.0.3, outside the workspace. Golden files are never regenerated, only added: a new golden-corpus job in policy.yml fails a PR that modifies one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn
test: golden-file compatibility corpus for format v7 (#391)
# Conflicts: # CHANGELOG.md # CLAUDE.md # README.md # docs/TEST_COVERAGE.md
The golden harness now reads as v3 (READER = 3, format 8): each v7 file must carry a v8 meta page after its first open and give the same results when the migrated copy is reopened, and the #371 queries skipped on v2.x run and pass. Adds seven v8 golden files written by the v3 branch at 23aa57c (format frozen) through tests/golden/gen/v8: one checkpoint, seven copy-on-write checkpoints, a crash-left v2 WAL, an already-checkpointed v2 WAL, same-transaction multi-values, v7_multi_checkpoint migrated in place, and long values at the size limits. A WAL whose entries are all checkpointed already stays after a checkpoint on v3 as on v2.x, since the checkpoint has nothing to do; manifests mark that shape with "stale_wal": true. Closes #391 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Closes #391. This is PR B of 2; PR A (#455) added the v7 corpus to
main. Spec:docs/superpowers/specs/2026-10-06-golden-file-corpus-design.md.The first commit merges
mainintov3to bring in #455. The only conflicts were in the CHANGELOG, test counts and TEST_COVERAGE, and v3's text was kept with the golden-corpus entries added.What
Harness on v3 (
READER = 3,MAX_FORMAT = 8):The bug: same-transaction multi-valued facts read back as ONE value, differing between EAVT and AEVT; a batched retract can leave retracted values visible #371 queries, which are skipped on v2.x, now run and pass.
Seven v8 golden files, written by
tests/golden/gen/v8, which is pinned by git rev tov3at23aa57c(format frozen after feat(storage): v8 hardening, measurements and docs (PR 5 of 5) #452):v8_basicv8_multi_checkpointv8_pending_walv8_stale_walv8_multivaluev8_migrated_from_v7v7_multi_checkpointmigrated in place (deterministic: two runs gave the same bytes)v8_large_valuesDocs: golden README, spec notes, CHANGELOG, ROADMAP, TEST_COVERAGE, and test counts (1238).
Finding
On v3, as on v2.x, a WAL whose entries are all already in the file stays after a checkpoint. Replay counts no new entries, so
do_checkpointreturns early. The data is correct, and the next write that gets checkpointed removes the WAL. Manifests mark this shape with"stale_wal": true, and the harness does not require the WAL to be gone for them. Deleting such a WAL at checkpoint would be a small engine change. It is left out of this test PR.Testing
cargo test: 1229 passed, 9 ignored.🤖 Generated with Claude Code
https://claude.ai/code/session_015GgLEs8YozJjYhwPEYgTUn