Skip to content

LBA REQ 085

github-actions[bot] edited this page Nov 19, 2026 · 2 revisions

LBA-REQ-085: The byte-reproducible extension package (the reviewed .vsix equals the shipped .vsix)

Status

Proven

Area

Packaging / boundary (ADR-0066 -- the byte-reproducible extension package)

Statement

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.

Rationale

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).

Acceptance Criteria

  • scripts/normalize-vsix.mjs is 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 package runs vsce package and 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 .vsix with a stable sha256.
  • test/normalize-vsix.mjs (run by npm 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-normalizer proves offline: the package + test scripts 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.

Verification

Historical statement (no longer implemented)

Supersession

Change Guidance

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).

TestID

T-085

CodeRef

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

RTM Status

Proven

Clone this wiki locally