Files
hyperframes/packages
Michael Wang 6a7b4df7c8 fix(cli): add lists files from a received config's registry as received (#7820)
* fix(cli): add lists files from a received config's registry as received

When a project's hyperframes.json is listed in .hyperframes/received-files.json
and names a registry other than the public one, add now lists every file it is
about to write in that record before writing any of them. This covers every
caller of addToProject: add by name, by tag, several names, and Studio.

The decision reads the config the install uses, so a byte-order mark or another
spelling of the file on disk is handled the same way. A person's own config, the
public registry and a record that cannot be read are left as they are.

* fix(cli): list received files as they are written, under a shared lock

add now lists each file in the received-files record just before it writes
it, using the write-time decision, so a file kept because the person edited it
during the download is never listed. When an install fails, it takes back the
entries it listed but never wrote.

Changes to the record take .hyperframes/received-files.json.lock, created
exclusively. A writer retries for about 2 s, takes over a lock older than
about 10 s, and always releases it. A writer that cannot take the lock in time
fails with a clear error instead of writing past it.

* fix(cli): an unreadable config counts as received; a failed install keeps what is on disk

add now counts an install as received when hyperframes.json exists but cannot be
read or parsed, since that config is not proven to be the person's own. When an
install fails, it takes back only the entries it listed whose files are not on
disk; files that landed stay listed.

* fix(cli): the received-files lock resolves the project folder as the installer does

The record's lock and write resolved the project folder with fs.realpathSync,
while the containment check resolves targets with the native realpath. The two
can spell the same folder differently: a Windows short name or a folder typed
in another letter case. The target then looked outside the project and the
change was refused. The record now resolves the folder with the installer's
realProjectRoot, so the root and target compare in one spelling.

The failed-install tests now fail the write by stubbing it, which works on every
platform, instead of a read-only folder, which Windows ignores.
2026-11-15 09:10:08 +00:00
..
2026-11-14 21:38:34 -05:00
2026-11-14 21:38:34 -05:00
2026-11-14 21:38:34 -05:00
2026-11-14 21:38:34 -05:00
2026-11-14 21:38:34 -05:00