From b8e377278a5017c4e0aeb702a5ba539cf9fbbae8 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 30 Aug 2026 23:21:47 +0200 Subject: [PATCH] Canonicalize source checkout line endings --- packages/rag/src/source-document-archive.ts | 6 +++++- scripts/smoke-source-rag-commit-boundary.ts | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/rag/src/source-document-archive.ts b/packages/rag/src/source-document-archive.ts index cc58fd9..cb1d049 100644 --- a/packages/rag/src/source-document-archive.ts +++ b/packages/rag/src/source-document-archive.ts @@ -433,11 +433,15 @@ function comparableFields(document: ArchivedSourceDocumentRecord): Record { try { const archive = new FileSourceDocumentArchiveRepository(archivePath); - const original = document("original body", "2026-06-03T00:00:00.000Z"); + const original = document("original\r\nbody", "2026-06-03T00:00:00.000Z"); const updated = document("updated body", "2026-08-30T00:00:00.000Z"); await archive.syncRepoDocuments("Fixture", [original]); const timestampOnlyPlan = await archive.planRepoDocuments( "Fixture", - [document("original body", "2026-08-30T00:00:00.000Z")], + [document("original\nbody", "2026-08-30T00:00:00.000Z")], ); - assertEqual(timestampOnlyPlan.changedSourceIds.length, 0, "checkout timestamp changed document identity"); - assertEqual(timestampOnlyPlan.unchanged, 1, "checkout timestamp did not remain observational"); + assertEqual(timestampOnlyPlan.changedSourceIds.length, 0, "checkout metadata changed document identity"); + assertEqual(timestampOnlyPlan.unchanged, 1, "checkout timestamp and line endings did not remain observational"); const failingPipeline = new SourceRagPipeline( archive,