tjhhhh: ego lite keeps its skills in its framework's Versions/<v>. After
the app updated, the skill was in the new version's folder, the old folder
was gone, and magpie still linked the old one. dccfefdf7 (#2635) linked new
imports through the app's own steady link (~/.local/share/ego/ego-skills, or
Versions/Current), but a skill brought in before then links straight to the
resolved Versions/<old> path. tjhhhh's case is that old link: an import
made since dccfefdf7 already follows the update
(TestImportedSkillFollowsAppUpdate).
followMovedSkills (skill_moved.go) runs on every read of the Library page,
under the read's link memo, which is restarted when a link is mended. It
also runs as the first step of every sync. For each library skill that is
a link:
- Target gone, and its first missing part named like a version: link the
same place under the folder's Current/current/latest link. With no such
link, use the highest version beside it that has a SKILL.md there
(1.10 after 1.9).
- Target in Versions/<v> while the bundle's Versions/Current links to
another version with the same skill: link it through Current.
Source.Dir follows. Only the link is replaced (os.Remove of the link, then
dirLink, and the old link is put back if the new one can't be made). A
folder of the library's own, a link the user deleted that isn't a version
(still shown missing), and the app's old version folder are left alone.
docs/subsystems/library.md says so.
Run (all on mote via mote-run):
- New tests on ego lite's real layout (egoLite: framework Versions/<v>,
Current, ~/.local/share/ego links): TestOldImportFollowsDeletedVersion
(0.5.1.13 deleted, then 0.6.0.12, then the next update to 0.7.0.1 by
itself, plus the agents' link through the library),
TestOldImportFollowsVersionsCurrent (old kept, through Sync()),
TestOldImportFollowsHighestVersion, TestMovedSkillsLeaveTheRest and
TestVersionLess. All pass, as do dccfefdf7's three tests.
- Broken by hand: with followMovedSkills returning false at once, the
three OldImport tests are red.
- go vet -tags nogui ./..., GOOS=linux go vet -tags nogui ./... and
GOOS=windows go vet ./...: clean. gofmt -l: nothing.
- Full go test -tags nogui -count=1 -timeout 45m ./... in a sandbox HOME:
80 ok, 3 FAIL.
- internal/library TestReadLooksAtEachFolderOnce was mine: the mend ran
before the read's memo, so each skill link was looked at twice. Fixed
(the memo starts first and restarts after a mend). The whole
internal/library package then passed (75s).
- internal/gui TestSettingsSaveKeepsWhatItDoesNotSend is red on
origin/main 3ecc02b78 and ccc791231 alike (#4514, SearchAll).
- internal/cli TestAgentFieldNameShowsIt failed once under load. It
passes alone and in a whole internal/cli run, and its message was lost
to my grep of the log (#4583).
The full ./... was not run again after the memo fix.
- At the pushed head, rebased on a51776f9c (which changed internal/library
too): go vet and the whole internal/library package ok (95s).
Not tried: tjhhhh's own machine and ego lite's real update (the layout is
the #2635 fixture, built from iomect's report). Windows junctions to a
deleted version (dirLink is the same call ImportSkill uses). An app that
renames the folder above the version is not followed: it stays missing.