An unreadable subfolder in an agent's copy of a skill hid edits from the
timestamp scan, which ignored read and stat errors. So switching copy/link
mode, refreshing the skill, or removing a duplicate copy could replace the
copy and lose those edits. Shared-folder deduplication could remove
SKILL.md before failing on the unreadable subtree. changedAt and
copyIsFresh now return the scan error. The copy is kept in place for that
sync (Library.blockedSkills) and reported as a Problem naming the path.
This covers agent copies, shared-folder deduplication, project copies and
Claude Desktop copies. Other agents still sync, and a later sync tries
again once the copy can be read.
Merged onto main. #1449 added two callers of changedAt in
skill_changed.go:
- libraryHash doesn't remember a hash for a folder it couldn't wholly read.
- editState says unknown for an agent's copy it couldn't wholly read, so
an update from GitHub keeps the library's version aside.
TestEditStateUnknownForAnUnreadableCopy covers editState.
docs/subsystems/library.md keeps both new rules.
Run:
- go test -tags nogui ./internal/library/ and ./... (see the PR), go vet
for darwin, linux with nogui, and windows, and gofmt.
- With changedAt ignoring walk errors again, the four ScanError and
EditState tests go red.
- With editState ignoring the error, the new test goes red
(edited true, known true).
- Checked with Unix permissions on macOS only, not as root and not on
Windows.