Skip to content

docs(test): pin the vendored vectors to their merged upstream commit - #111

Merged
Andste82 merged 1 commit into
mainfrom
docs/92-repin-vendored-vectors
Aug 9, 2026
Merged

Andste82 merged 1 commit into
mainfrom
docs/92-repin-vendored-vectors

Conversation

@Andste82

@Andste82 Andste82 commented Aug 9, 2026

Copy link
Copy Markdown
Member

The finding (#92)

test/shared/README.md pinned assets/test_vectors.json to commit 37e06a829178 on corelib-c-cpp's poc/omit-all-default-sequences branch, with a note to "re-pin to the merged SHA once that lands". It landed, and two further commits (c56ccf5d4f88, f30244e3f29e) have touched the file upstream since. The vendored bytes were never wrong — assets/test_vectors.json is byte-identical to upstream main (md5 f542c66bfa6aecb3636282ec6e802a1b) — but the record named a branch that no longer exists and a SHA that is no longer the file's upstream state, so nobody re-syncing had anything valid to diff against.

CORELIB_PLAN §8 makes test_vectors.json a file "generated by and copied from corelib-c-cpp (the authoritative source)"; the provenance record is what makes that copy checkable.

The fix

  • Re-pin the vectors row at f30244e3f29e (2026-07-28) — the last merged commit touching the file upstream — and drop the provisional note.
  • Record each vendored file's md5 alongside its pin (both JSON-reader rows too; those pins were already correct at e149c218cdbb), so verifying a checkout needs neither the network nor a guess.
  • Rewrite the "Re-sync commands" tail: how to obtain the merged SHA to pin, how to recompute the checksums, and the one command that verifies an existing tree.

The regression test

test_vectors cannot notice any of this — it replays whatever bytes are on disk, pinned or not. New test/test_vendored_provenance.sh, wired into CTest beside the other document-level checks (test_ci_workflows, test_readme_structure, same SKIP_RETURN_CODE 77 convention). It reads the provenance tables and re-hashes the files, failing on:

  1. a "Pinned at" cell that is not a bare merged commit — this is the defect above, and it fails on main today;
  2. a recorded checksum that no longer matches the vendored file (a re-sync that refreshed a copy without re-pinning its row);
  3. a vendored file with no provenance row, or a table shrunk below the three files this repo vendors;
  4. a row that names no upstream source, or names a file that does not exist.

Verified by mutation: on main the check reports 4 failures (the branch pin + three missing checksums); appending a byte to sofab_test_json.c reports the md5 mismatch; deleting a table row reports the uncovered file; a tree without test/shared/README.md skips.

Suite

Full ctest green in Debug and Release (6/6, CXXFLAGS per the repo's GCC-15 note). README's "Build & test" test list documents the new check.

Closes #92

`test/shared/README.md` pinned `assets/test_vectors.json` to commit
`37e06a829178` on `corelib-c-cpp`'s `poc/omit-all-default-sequences`
branch, with a note to re-pin "once that lands". It landed — and two
further commits have touched the file since — so the record named a
branch that no longer exists and a SHA that is no longer the file's
upstream state. The bytes on disk were never wrong (they are identical
to upstream `main`), but nobody re-syncing could tell: there was no
merged SHA to diff against.

CORELIB_PLAN §8 makes `test_vectors.json` a copy of `corelib-c-cpp`, the
authoritative source; the provenance record is the only thing that makes
that copy checkable. Re-pin the row at `f30244e3f29e` (2026-07-28), the
last merged commit touching the file upstream, and record every vendored
file's `md5` next to its pin so verifying a checkout needs neither the
network nor a guess.

`test_vectors` cannot notice any of this — it replays whatever bytes are
on disk — so add `test_vendored_provenance`, wired into CTest next to the
other document-level checks. It reads the provenance tables and fails on
a pin that is not a bare merged commit (the defect above), on a recorded
checksum that no longer matches the file (a re-sync that skipped the
table), and on a vendored file with no row at all. It skips (77) in a
tree that vendored only the header.

Closes #92
@Andste82
Andste82 merged commit fe0df0a into main Aug 9, 2026
9 checks passed
@Andste82
Andste82 deleted the docs/92-repin-vendored-vectors branch August 9, 2026 09:27
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.

8: test/shared/README.md pins the vendored vectors to an unmerged poc branch

1 participant