Repository navigation
LBA REQ 085
Proven
Packaging / boundary (ADR-0066 -- the byte-reproducible extension package)
The system shall pin every entry timestamp in the packaged .vsix to a fixed constant so that
repackaging the same committed source yields a byte-identical artifact, so a fail-closed gate proves a reviewed
.vsix sha256 can equal the shipped .vsix sha256.
the release-review chain binds a specific artifact by its vsixSha256 -- the reviewer signs a visual
PASS over a candidate's hash (LBA-REQ-068/069) and the composite release-decision (LBA-REQ-071) blocks publishing
unless the tagged candidate's hash matches the reviewed one. That binding assumed the .vsix is a pure function
of the committed source, but vsce package (yazl) stamps every entry's mtime with the package wall-clock time
(new Date()) and does not honor SOURCE_DATE_EPOCH, so two builds of the same commit differ by ~72 timestamp
bytes -- identical names/order/compression/content, different sha256. The reviewed hash could therefore never be
proven equal to the shipped hash except by hand-carrying one build (as the v1.0.0 ship did).
-
scripts/normalize-vsix.mjsis pure Node with no dependencies and walks the zip structure (End-of-Central-Directory -> each central-directory record -> the local file header it points to), patching ONLY the 2-byte DOS mod-time + 2-byte DOS mod-date fields to a fixed constant (1980-01-01) and leaving every other byte -- entry names, order, compression, content, CRCs -- untouched. -
npm run packagerunsvsce packageand then the normalizer, so the shipped artifact is always normalized; because the output depends only on the committed content (never the build time), building the same committed source twice yields a byte-identical.vsixwith a stable sha256. -
test/normalize-vsix.mjs(run bynpm test) builds two zips with identical content but different entry timestamps and proves they normalize to byte-identical output, that normalization is idempotent, that the timestamp is pinned to the epoch, and that a non-zip buffer fails closed (no silent no-op). - The gate
reproducible-vsix-normalizerproves offline: thepackage+testscripts still invoke the normalizer (the wiring cannot silently regress), and a hand-built stored-entry zip re-proves synchronously that two same-content zips with different timestamps normalize byte-identical + epoch-pinned.
the normalizer + test live at scripts/normalize-vsix.mjs + test/normalize-vsix.mjs; the gate
reproducible-vsix-normalizer is in verify-local-gates. The reviewed==shipped follow-on is REALIZED:
scripts/verify-published-vsix.mjs (+ test/verify-published-vsix.mjs, gate reviewed-vsix-matches-shipped)
asserts the CI-built .vsix sha256 equals the reviewed vsixSha256, wired into extension-release.yml after
packaging. Authored under the singular-requirement directive (one shall).
scripts/normalize-vsix.mjs; test/normalize-vsix.mjs; scripts/verify-published-vsix.mjs; test/verify-published-vsix.mjs; .github/workflows/extension-release.yml; package.json; experiments/verify-local-gates.mjs
Proven