fix(cli): media-use scripts read the host's kept record copy as the CLI does (#8119)

The media-use copy of the received-files rule now reads the host app's kept
copy of an expected project's record, as the CLI does. It adds back each kept
entry whose path still holds something, checks the folder identity for a
project found only by dev and ino, and counts every file as received when the
copy has no list, is doubted, a link, oversized, unparsable or another
project's.

In both the CLI and the copy:
- a kept copy whose identity names another folder counts every file as
  received instead of being ignored;
- a kept copy that fails its first read, for example because the app replaced
  it mid-read, is read once more before every file counts as received;
- a kept copy named both by path and by dev and ino is read once.

The docs no longer suggest that the app's next read restores a kept entry
whose file is gone.
This commit is contained in:
Michael Wang
2026-11-17 23:57:13 +00:00
committed by GitHub
parent 80bf6a9ddb
commit c27adb35ff
7 changed files with 467 additions and 54 deletions
+9 -7
View File
@@ -2906,13 +2906,15 @@ imports projects for you can tell the CLI more by pointing
`{ "project": "<path>", "files": [...] }` with `path` exactly as the state file
names it. A file that copy lists still counts as received while something is at
its path, even if the project's record no longer lists it. For a project found
only by `dev` and `ino`, the copy counts only when its `"identity"` is
`"<dev>:<ino>:<birth time in ns>"` of the project folder. A copy with
`"files": null` or `"doubted": true`, or one that is a link or cannot be read,
counts every file as received.
- A file the copy lists that is no longer at its path is not added back. A
received file that is renamed after its record entry is removed is judged by
the project's record alone until the app reads the record again.
only by `dev` and `ino`, the copy's `"identity"` must be
`"<dev>:<ino>:<birth time in ns>"` of the project folder; a copy with another
identity counts every file as received. A copy that names another project,
has `"files": null` or `"doubted": true`, or is a link, larger than 16 MB or
unreadable also counts every file as received.
- A file the copy lists that is no longer at its path is not added back. When
the app restores lost entries to a project's record, it uses the same rule, so
a received file that is renamed after its record entry is removed is judged by
the project's record alone.
A file from outside the project folder that would be copied (each file a
composition points at, and each project file that is a link to a file outside