From b1263e9443f6cdeff45c9acea6e81523d87bee23 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 26 Sep 2026 23:08:52 +0000 Subject: [PATCH] fix(diagrams): keep diagram sources LF so the receipt check passes on Windows The Windows CI job failed "the repository's diagrams match their receipts" after #166 merged: with core.autocrlf, Git checked docs/diagrams/src/*.json out with CRLF line endings, so each source's sha256 differed from the receipt in docs/diagrams/diagrams.json and all thirteen diagrams read as changed. The receipts hash exact bytes, so the sources must be byte-stable across platforms: .gitattributes now pins docs/diagrams/** and the docs-site SVG copies to LF. A new test asks git which eol applies to those paths. Reproduced with a core.autocrlf=true clone (check fails before, passes after). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01GVVG2VDETWsDxMu6MBWPz2 --- .gitattributes | 6 ++++++ CHANGELOG.md | 7 +++++++ mintlify/changelog/overview.mdx | 10 ++++++++++ test/diagrams.test.js | 17 +++++++++++++++++ 4 files changed, 40 insertions(+) diff --git a/.gitattributes b/.gitattributes index bfa9acb1..c740f4eb 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,3 +7,9 @@ # Shell scripts and the Node guard must stay LF even on Windows checkouts — bash chokes on # CRLF (\r), which breaks the guard/install tests under Git Bash on windows-latest. *.sh text eol=lf + +# Diagram sources and their SVG exports are content-addressed: docs/diagrams/diagrams.json +# records each source's sha256 and the docs-site copies must be byte-identical. A Windows +# checkout (core.autocrlf) would rewrite them with CRLF and every receipt would read stale. +docs/diagrams/** text eol=lf +mintlify/images/diagrams/*.svg text eol=lf diff --git a/CHANGELOG.md b/CHANGELOG.md index f7c1f62c..7980f5e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed + +- **The diagram check passes on a Windows checkout.** With `core.autocrlf`, Git checked the + diagram sources out with CRLF line endings. Their sha256 then differed from the receipts in + `docs/diagrams/diagrams.json`, so all thirteen diagrams read as changed. `.gitattributes` now + keeps `docs/diagrams/` and the docs-site SVG copies LF on every platform. + ## [1.7.0] - 2026-09-26 ### Fixed diff --git a/mintlify/changelog/overview.mdx b/mintlify/changelog/overview.mdx index 40a2abf8..ce8e548d 100644 --- a/mintlify/changelog/overview.mdx +++ b/mintlify/changelog/overview.mdx @@ -18,6 +18,16 @@ This page is generated from `CHANGELOG.md` by `forge docs render`, and `forge do CI when it falls behind, so it cannot drift from the release notes again. {/* forge:render:changelog:begin (generated by `forge docs render` — do not edit) */} + + +**Fixed** + +- **The diagram check passes on a Windows checkout.** + +[Full notes for Unreleased →](https://github.com/CodeWithJuber/forgekit/blob/HEAD/CHANGELOG.md#unreleased) + + + **Fixed** diff --git a/test/diagrams.test.js b/test/diagrams.test.js index 5a0454df..eef03095 100644 --- a/test/diagrams.test.js +++ b/test/diagrams.test.js @@ -1,6 +1,7 @@ // The Archify diagram pipeline (scripts/diagrams.mjs): the offline receipt check, source // naming, the gallery page, and the docs-check rules for embeds and hand-written Mermaid. import assert from "node:assert/strict"; +import { execFileSync } from "node:child_process"; import { createHash } from "node:crypto"; import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; @@ -160,3 +161,19 @@ test("the repository's diagrams match their receipts and are embedded where the for (const d of manifest.diagrams) assert.ok(d.usedIn.length >= 1, `${d.id} is embedded somewhere`); }); + +test("diagram sources and SVGs check out with LF everywhere (receipts hash exact bytes)", () => { + const paths = [ + "docs/diagrams/src/core-loop.workflow.json", + "docs/diagrams/diagrams.json", + "docs/diagrams/core-loop.svg", + "mintlify/images/diagrams/system.svg", + ]; + const out = execFileSync("git", ["check-attr", "eol", "--", ...paths], { + cwd: BRAND.root, + encoding: "utf8", + }); + const lines = out.trim().split(/\r?\n/); + assert.equal(lines.length, paths.length); + for (const line of lines) assert.match(line, /: eol: lf$/, line); +});