fix(#4091): publish update-check cache via atomic temp+rename (#4313)

* test(#4091): RED — worker cache write must be rename-atomic

Structural regression guard: gsd-check-update-worker.js must not write the
shared per-package cache in place; assert temp+rename publish shape plus a
behavioral no-residue e2e.

* fix(#4091): publish update-check cache via atomic temp+rename

writeFileSync on the shared per-package cache truncates before writing, so
concurrent cross-runtime readers (statusline/banner) could see a torn or
empty record. Stage under a unique same-directory temp and rename into
place — POSIX rename(2) is atomic, so readers see the old or new record,
never a partial one. Degrade policy (#3582) unchanged: errors swallowed,
temp best-effort removed.

* refactor(#4091): hoist temp path, tighten uniqueness assertion (review)

* changeset(#4091): add fragment (pr backfill to follow)

* changeset(#4091): backfill PR 4313

---------

Co-authored-by: sim <sim@local>
This commit is contained in:
Tom Boucher
2026-09-05 09:22:10 -04:00
committed by GitHub
parent b327331747
commit d9d16551b7
3 changed files with 142 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
---
type: Fixed
pr: 4313
---
**Update-check cache is now published atomically** — the statusline update segment no longer intermittently goes blank when several runtimes (Claude Code, Codex, Cursor, ...) share one machine. (#4091)