Files
hyperframes/scripts
Miguel Ángel 267ffc46c9 fix(studio-server): a file the drive never answers no longer holds a project's first history copy (#8187)
* fix(studio-server): a file the drive never answers no longer holds a project's first history copy

* fix(studio-server): keep history's comment share at or below its base

* fix(studio-server): a first copy that lands past its deadline is kept as the file's start

* fix(studio-server): a late first copy is adopted and kept while another file's read is stalled

* fix(studio-server): a waiting late first copy counts as baseline and rereads a few at a time

* fix(studio-server): every reread of an owed file takes a copy slot and is kept until adopted

* fix(studio-server): history pins a copy as it is filed and keeps a reference-only copy as such

* fix(studio-server): a history pin is taken and released by its owner, never across a delete

* fix(studio-server): an agent step waits at most a deadline for a file the drive never answers

* fix(studio-server): undo refuses a file whose first copy landed after an agent step rewrote it

* chore(studio-server): give the packed size budget its usual 5% headroom

Main packs to 190,094 bytes, already 0.65% over the 188,871 budget; this branch adds 1,264 bytes of its own code (no new import: dist/index.js is unchanged). The budget file's rule is 5% above measured: ceil(191,358 x 1.05) = 200,926.

* fix(studio-server): an agent step that goes ahead of a first copy owns that file's undo

* fix(studio-server): undo of a step that went ahead of a pending first copy is all or nothing

* fix(studio-server): an undo after a step that rewrote a pending file in place still refuses

A went-ahead file now clears from a step's list only when the first read after its copy lands finds the original
bytes, not when its size and times look unchanged. The list of went-ahead files is kept on disk, so a restart
before the step closes, or after it deleted the file, keeps the refusal. Parts a Studio claim cuts from a step
keep the list too.

* fix(studio-server): a step ahead of a pending file refuses undo after Cmd+Z, restarts, in older apps

Cmd+Z stops at an open step whose only write so far is a pending file. A step recovered after the process died
keeps its list of pending files. A later Studio save's receipt no longer sets the start of a file a step went ahead
of. Every earlier point names a pending file as not kept, so no restore deletes it in any app version.

* fix(studio-server): a step that went ahead of a pending file never undoes, whatever bytes land

Bytes cannot tell steps apart: a file written A, B, then A again by two steps looked untouched and cleared both. A
step's list of files it went ahead of is now never cleared, so its undo refuses after a stalled read.

* fix(studio-server): a recovered step keeps its guard through a second crash; saves keep the start

The closed window is recovered before the reopen rewrites went-ahead.json, so a crash during recovery no longer
erases its list of pending files. A copy read before a step went ahead is the file's start whatever a later save's
receipt says it replaced.

* fix(studio-server): a start keeps receipts heard before its read; reopen writes all pending files

A copy read before a step went ahead follows only the save receipts heard by the moment of its read, so an early
save's original stays the start and a later save naming the step's bytes cannot replace it. The reopen rebuilds
the list of pending files in memory and writes it once, so a crash midway keeps every file on it.

* fix(studio-server): a first copy's start follows only receipts heard by its read and keeps them

Every adopted copy follows the save receipts heard by the moment of its read, with or without a step, so a later
save writing the original back cannot move the start. A small file's read is reported before its close, which a slow
drive can hold. Bytes a save replaced in a file history has no copy of yet stay through pruning until it does.

* fix(studio-server): bytes kept for a pending first copy count as start, not undo history

The bytes a save replaced are kept only for a file still owed its first copy, and they count as start rather than
undo history, so they never fold an unrelated edit out of the budget or stay for a file that never needed them.
2026-11-21 23:28:17 +00:00
..