Skip to content

devStudio 1.0.182

Choose a tag to compare

@github-actions github-actions released this 04 Sep 00:38
· 5 commits to main since this release
fef93bb
Stop the file library losing files while it publishes them (#55)

Saving a library file published it in two steps: move the current file aside to
a .bak, then move the new one into place. Between those the file did not exist
at its own name. It also did that work inside the published folder — the same
folder copied wholesale into every agent workspace before a session starts.

The standards sync then rewrote all of its files on every run, and it runs on a
timer and again before each session, so that window was opening constantly.

In one operator's log this cost 342 failed stagings: 300 were half-written
working files being copied into workspaces as though they were reference
material, and 42 were real standards files that never arrived at all. Those
sessions ran without the standards they were meant to have, and the only thing
that said so was a warning nobody reads.

File.Replace looked like the answer and is not: a test reproducing the race
still found the file missing on roughly half of all reads, and checking
File.Exists alongside the directory listing showed it genuinely unlinked rather
than merely missed by enumeration — File.Replace is itself a two-step rename.
An overwriting File.Move holds the name throughout; measured over ten thousand
concurrent reads it never went missing once. It can fail outright when a reader
has the file open, which is the right trade: a visible, retryable failure beats
a file that silently is not there. It retries briefly.

So: staging moved to a sibling folder, so the published folder only ever holds
real files and no reader needs to know the convention; publishing is a single
overwriting move, with a copy-based backup so the published file is never taken
away to make one; and the sync skips files whose bytes have not changed —
compared by content rather than timestamps, because a fresh checkout rewrites
mtimes without changing anything. That last one was the amplifier.

"Nothing to import" now distinguishes an empty folder from one that simply has
not changed, which previously read as though the standards had gone missing.


Claude-Session: https://claude.ai/code/session_01JwMfdZjqLyrBMgVab8P8b6

Co-authored-by: Matt Ratcliffe <m.ratcliffe@htrak.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>