Ignore checkout timestamps during source sync

This commit is contained in:
Meta Vens 2026-08-30 23:15:54 +02:00
commit e0f3f00b3a
2 changed files with 11 additions and 4 deletions

View file

@ -434,7 +434,6 @@ function comparableFields(document: ArchivedSourceDocumentRecord): Record<string
language: document.language,
title: document.title,
content: document.content,
lastModifiedAt: document.lastModifiedAt,
metadata: document.metadata ?? {},
};
}

View file

@ -25,10 +25,17 @@ async function main(): Promise<void> {
try {
const archive = new FileSourceDocumentArchiveRepository(archivePath);
const original = document("original body");
const updated = document("updated body");
const original = document("original body", "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")],
);
assertEqual(timestampOnlyPlan.changedSourceIds.length, 0, "checkout timestamp changed document identity");
assertEqual(timestampOnlyPlan.unchanged, 1, "checkout timestamp did not remain observational");
const failingPipeline = new SourceRagPipeline(
archive,
new SourceDocumentIngester(),
@ -70,12 +77,13 @@ void main().catch((error) => {
process.exitCode = 1;
});
function document(content: string): ArchivedSourceDocument {
function document(content: string, lastModifiedAt?: string): ArchivedSourceDocument {
return {
id: sourceId,
repoName: "Fixture",
path: "README.md",
content,
lastModifiedAt,
};
}