tjhhhh_84378 on Discord (11-06): ego lite updated from 0.6.2.5 to 0.6.2.7,
deleted Versions/0.6.2.5, and left its own ~/.local/share/ego/
active_version_dir naming it. The library's ego-browser, brought in since
dccfefdf7 (#2635), links to ego's ~/.local/share/ego/ego-skills ->
active_version_dir/Resources/ego-skills/ego-browser, so the whole chain led
nowhere and the skill was lost, while 0.6.2.7 had it complete.
Who owns which link: ~/.local/share/ego/ego-skills, active_version_dir and
the framework's Versions/* are ego's; magpie only reads them. magpie writes
the library's own link (library/skills/ego-browser) and the agents' links
to it. The stale pointer is ego's, but magpie lost the skill with a newer
version on disk.
557f51dbf mended a library link that points straight into Versions/<old>,
but movedVersion looked only at the link's own target: for ego-skills the
first missing part is not a version name, so nothing was found.
followMovedSkills (skill_moved.go) now, for a dangling library link whose
target isn't in a version folder, follows the links on the way as far as
they are there (linkedEnd) and asks movedVersion of where they end:
Current/current/latest when that leads to the skill, else the highest
version beside the deleted one with a SKILL.md there. The library links to
that folder, and keeps the app's steady link as the new Source.Via. Once
the steady link leads to a SKILL.md again (ego or the user mended it), the
library links through it once more and Via is cleared. ego's links are
never written. With no other version on disk the link is kept as it was
and the skill is shown missing, as before.
Old imports: a skill linked straight into Versions/<old> was already
mended by 557f51dbf; one linked through ego's link (since dccfefdf7) is
mended by this on the next read of the Library page or the next sync. No
re-import needed. Agents that read ~/.agents/skills directly still see
ego's own entry there, which is the user's/ego's and is left alone.
Tests (skill_moved_test.go), the reporter's layout: egoLite at 0.6.2.5,
brought in through ~/.agents/skills/ego-browser -> ego-skills, then 0.6.2.7
added, 0.6.2.5 deleted, active_version_dir and Versions/Current left on
0.6.2.5:
- TestSteadyLinkLeftOnDeletedVersion: Read shows it not missing, it reads
as 0.6.2.7's, active_version_dir is unchanged, Via is ego-skills; after
active_version_dir is pointed at 0.6.2.7, a Sync links through ego-skills
again with no Via.
- TestSteadyLinkLeftOnDeletedVersionNoOther: no other version, shown
missing, link left as it was.
Broken by hand:
- linkedEnd step turned off: TestSteadyLinkLeftOnDeletedVersion red
(Missing:true), i.e. red on the old code.
- the go-back-to-Via case turned off: red, still linked to 0.6.2.7.
Run (mote via mote-run): gofmt -l clean; go vet -tags nogui
./internal/library for darwin, GOOS=linux and GOOS=windows clean; go test
-tags nogui -count=1 ./internal/library ok (91s). Windows box (win-run):
SteadyLink, OldImport and ImportedSkill tests pass (junctions). Full suite
after the push, recorded on the tag's follow-up.
Not tried: the reporter's machine or a real ego lite update; the layout is
the #2635 fixture with the paths from their message. Whether ego's
Versions/Current also stayed on 0.6.2.5 isn't known; both are covered.
Reported-by: tjhhhh_84378