From 286aadefc4ba52e199bf992e338fba810bf537e3 Mon Sep 17 00:00:00 2001 From: Lucas Winther Date: Mon, 17 Aug 2026 21:55:03 +0200 Subject: [PATCH] chore: ignore half-written snapshots MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every snapshot is written to a sibling `.tmp-*` and renamed into place, so a run killed mid-write leaves one behind. `refresh.yml` commits the whole snapshots/ directory, which would pin that truncated page in git forever — and the point of the atomic write was that a crash leaves nothing a reader can mistake for a page. Co-Authored-By: Claude Opus 5 (1M context) --- .gitignore | 6 ++++++ snapshots/README.md | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index ad0f893..3f2fb09 100644 --- a/.gitignore +++ b/.gitignore @@ -126,3 +126,9 @@ public/ # but this file changes on every cycle, and committing it would mean a commit # per run saying nothing changed. snapshots/*.state.json + +# Half-written snapshots. Every snapshot is written to a sibling temp file and +# renamed into place, so a run killed mid-write leaves one of these behind — and +# the refresh workflow commits the whole snapshots/ directory, which would +# otherwise pin a truncated page in git forever. +snapshots/*.tmp-* diff --git a/snapshots/README.md b/snapshots/README.md index f0dbea4..adc9ccc 100644 --- a/snapshots/README.md +++ b/snapshots/README.md @@ -17,7 +17,8 @@ localStorage keys). Every file is written to a sibling `.tmp-*` and renamed into place, body before metadata, so an interrupted run leaves a stray temp file rather than a truncated snapshot or metadata describing -bytes that were never stored. +bytes that were never stored. Those temp files are gitignored: `refresh.yml` commits the whole +directory, so otherwise a run killed mid-write would pin a half-page in git forever. Three reasons this is committed rather than cached: