Files
magpie/docs
yetone df2b819c67 library: Antigravity and Crush get copies of skills on Windows (#6610, #5107)
On Windows without the right to make a symlink, magpie links a skill with
a junction. Go 1.23+ lists a junction as ModeIrregular, neither a folder
nor a symlink, and Antigravity (the app and agy: customizations'
discoverInSubDirsFiltered) and Crush (internal/skills on fastwalk, which
follows only a ModeSymlink) keep only folders and symlinks, so a
junctioned skill never showed in them. dsh, pi and the other Node, Bun,
Rust and Python agents follow a junction.

Checked against the real apps on xiaomi-gpu (Windows 11) in a sandbox
USERPROFILE: Antigravity 2.30.0's language_server.exe (--standalone)
GetAllSkills lists a skill in a folder and one behind a symlink, not one
behind a junction. crush v0.101.0's `crush run` request to a local
capture server listed the folder and the symlink, not the junction. On
macOS agy 1.5.8 (ACP session/new, available_commands_update) takes a
symlink that leads out of ~/.gemini/config, so #6610's "confined to the
folder" filter doesn't touch magpie's links there.

- junctionBlind (agy, antigravity, crush) and skipsJunctions: on Windows
  these targets have Copy, so they get marked copies, made again when
  the library's changes, and the Library page shows "Only ever takes
  copies" for them. A junction an older magpie made becomes a copy.
- inShared: a link in ~/.agents/skills is no skill to them, so Crush,
  which reads that folder too, gets its own copy.
- A project's .agents/skills entry that one of them reads is a copy
  (syncFolder's per-entry flag); one no such agent reads is a link again.
- takeEdits takes an edit made in a project's copy into the library, as
  one in an agent's copy is, so a copy a user edits isn't undone by the
  next sync (Project.Copy's copies too, which were made again over an
  edit before).
- behind lists these agents' stale copies.

Run:
- go vet ./internal/library, GOOS=windows and GOOS=linux go vet, gofmt -l:
  clean (mote).
- go test -count=1 ./internal/library: ok on mote (macOS) 107.9s and on
  xiaomi-gpu (Windows 11) 440.0s, at this change on 0caa09b3d.
- go test -run JunctionBlind ./internal/library: ok on mote and on the
  Windows box (-v: all four new tests PASS, TestJunctionIsALink too).
- After rebasing on be7d22edd: go test ./internal/library on mote, ok.

Broken by hand:
- Without `t.Copy = skipsJunctions(a.ID)`, the inShared check and the
  project per-entry copy: TestJunctionBlindAgentsGetCopies,
  ...AgentSkipsSharedLink and ...ProjectCopies red on mote; on Windows
  TestJunctionBlindJunctionBecomesCopy red (both entries stay junctions,
  Lstat mode 2684354563 attrs, not a dir).
- Without the project loop in takeEdits: TestJunctionBlindProjectCopies
  red, the user's edit replaced by the library's.

Not tried: magpie's own binary syncing a real Antigravity on Windows end
to end (the apps were checked against a folder, a symlink and a junction
made by hand; magpie's copy is a plain folder, which the test checks a Go
ReadDir sees as one). Antigravity and Crush on Linux (symlinks there,
which both take). The full go test ./... suite.
2026-11-14 15:05:21 +08:00
..