[GH-ISSUE #545] CRLF-smudged clones corrupt built artifacts and fail validation on untouched packages — pin LF via .gitattributes #277

Closed
opened 2026-10-20 17:26:02 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @kolacheee on GitHub (Aug 24, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/545

Originally assigned to: @kolacheee on GitHub.

Windows contributors with the Git-for-Windows default core.autocrlf=true (set in the SYSTEM gitconfig, so per-repo settings don't help a fresh clone) get CRLF-smudged working copies of this repo, and that has now caused a real shipped defect plus recurring false validation failures:

  1. A broken commit shipped. Pixelforge 0.11.0's artifact was built while a single source file (packages/pixelforge/src/20-world.js) sat CRLF on disk: the built client.js, the manifest's bytes/sha256, and the committed zip all described a file 3,280 bytes larger than the LF blob git stores — three things disagreeing inside one commit, on every platform. validate-catalog enforces exactly this invariant but only walks catalog.packages, and INCOMPLETE_PACKAGE_IDS holds pixelforge out of every catalog, so the check never reached it. Caught and fixed in PR #544 review (commit 62d1c6c4).
  2. Raw-tree validation fails on untouched packages. On a CRLF-smudged clone, validate-package-locales.mjs and validate-catalog.mjs both fail on beholder purely from CRLF-inflated on-disk sizes — a contributor sees red on a package they never touched and learns to distrust the checks.
  3. Builds are raw-byte concatenations. The package build scripts concatenate src/*.js byte-for-byte, so a CRLF tree silently inflates every built client.js (~2% for pixelforge) and poisons the manifest hashes.

Suggested fix: a root .gitattributes pinning text files to LF (* text=auto eol=lf plus explicit rules for the binary artifact/asset extensions), which makes checkouts LF regardless of the contributor's autocrlf setting. Optionally a second layer: have validate-catalog (or a sibling check) verify source-blob vs on-disk byte equality for all packages including catalog-excluded ones, so the class of bug in (1) cannot ship again even from an unpinned tree.

Evidence and exact numbers are in PR #544's review threads (the manifest-consistency finding).

Originally created by @kolacheee on GitHub (Aug 24, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/545 Originally assigned to: @kolacheee on GitHub. Windows contributors with the Git-for-Windows default `core.autocrlf=true` (set in the SYSTEM gitconfig, so per-repo settings don't help a fresh clone) get CRLF-smudged working copies of this repo, and that has now caused a real shipped defect plus recurring false validation failures: 1. **A broken commit shipped.** Pixelforge 0.11.0's artifact was built while a single source file (`packages/pixelforge/src/20-world.js`) sat CRLF on disk: the built `client.js`, the manifest's `bytes`/`sha256`, and the committed zip all described a file 3,280 bytes larger than the LF blob git stores — three things disagreeing inside one commit, on every platform. `validate-catalog` enforces exactly this invariant but only walks `catalog.packages`, and `INCOMPLETE_PACKAGE_IDS` holds pixelforge out of every catalog, so the check never reached it. Caught and fixed in PR #544 review (commit `62d1c6c4`). 2. **Raw-tree validation fails on untouched packages.** On a CRLF-smudged clone, `validate-package-locales.mjs` and `validate-catalog.mjs` both fail on `beholder` purely from CRLF-inflated on-disk sizes — a contributor sees red on a package they never touched and learns to distrust the checks. 3. **Builds are raw-byte concatenations.** The package build scripts concatenate `src/*.js` byte-for-byte, so a CRLF tree silently inflates every built `client.js` (~2% for pixelforge) and poisons the manifest hashes. Suggested fix: a root `.gitattributes` pinning text files to LF (`* text=auto eol=lf` plus explicit rules for the binary artifact/asset extensions), which makes checkouts LF regardless of the contributor's autocrlf setting. Optionally a second layer: have `validate-catalog` (or a sibling check) verify source-blob vs on-disk byte equality for *all* packages including catalog-excluded ones, so the class of bug in (1) cannot ship again even from an unpinned tree. Evidence and exact numbers are in PR #544's review threads (the manifest-consistency finding).
Author
Owner

@kolacheee commented on GitHub (Aug 24, 2026):

Claiming this — working it on fix/545-lf-pinning off staging (root .gitattributes LF pin + an all-packages manifest/artifact byte check that covers catalog-excluded ids).

<!-- gh-comment-id:5397107029 --> @kolacheee commented on GitHub (Aug 24, 2026): Claiming this — working it on `fix/545-lf-pinning` off `staging` (root `.gitattributes` LF pin + an all-packages manifest/artifact byte check that covers catalog-excluded ids).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#277
No description provided.