Files
dashcaddy/.gitattributes
T
Hermes 4d97a11978
CI / Test & Lint (push) Canceled after 0s
CI / Security audit (push) Canceled after 0s
fix(build): frontend build determinism across line endings (DC-119) [glm-grade=A]
The deploy host showed phantom dist drift on every git pull: committed
dist bundles could not be reproduced on DNS2. Root cause (verified with
esbuild 0.25.12 probes): the production transform uses sourcemap:'both',
whose inline map base64-embeds RAW source bytes as sourcesContent — a CRLF
working copy (Windows dev, core.autocrlf=true) vs an LF checkout produces
different dist bytes and a different sw.js cache tag.

- build.js: normalizeSource (\r\n -> \n) on every source read (bundle
  inputs + sw.js read); exported + require.main guard so tests can import
  it without triggering a build
- .gitattributes: * text=auto eol=lf (git-layer kill of the CRLF vector)
  + binary exclusions; 9 CRLF-in-index asset files renormalized
- tests/build-determinism.test.js: 3-case pin (byte-identity after
  normalization, divergence pre-normalization, CR-strip contract) importing
  the ACTUAL normalizeSource from build.js
- package.json: declare jsdom devDependency — 2 committed test files
  require('jsdom') but it was never declared, so fresh-checkout
  npm test failed (it only passed where a stray ancestor node_modules
  happened to contain it)
- dist/features.js + sw.js: canonical deterministic rebuild
  (cache tag 3354f5fd96 -> d39ab69dd4)

Verified: status 54/54, API 2858/2858 (128 suites); CRLF-sim tree and LF
tree of same HEAD produce byte-identical dist artifacts (sha256-equal).
Judge: glm-5.3 cold round 1 = A, round 2 (post-fold) = A clean, 0 blocking.
2026-08-23 16:34:49 -07:00

20 lines
600 B
Plaintext

# DC-119: normalize text file line endings at the git layer.
# The frontend build is byte-sensitive to CRLF (esbuild inline sourcemap
# embeds raw source bytes — see status/build.js DC-119 comment), and the
# Windows dev tree runs core.autocrlf=true while DNS2 checks out LF.
# eol=lf forces LF working copies for text files on ALL platforms, killing
# the phantom dist drift at the source. Binary types stay untouched.
* text=auto eol=lf
*.png binary
*.jpg binary
*.ico binary
*.woff binary
*.woff2 binary
*.ttf binary
*.eot binary
*.webp binary
*.gif binary
*.mp4 binary
*.zip binary
*.gz binary