You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Efficiency findings from the /simplify review of PR #390 (ai_docs/reports/274-simplify.md). The in-PR fixes covered the early Follow() exit, the dashboard update stream, and the walker's root lookup. These remain.
Items
Merge sync canonicalizes each link's parent directory per link (internal/sync/sync.gosyncMerge → sameSkillLink → skillLinkTarget, internal/sync/skillfollow.go). Every user pays this, with or without .skillfollow: roughly skills × targets × path depth lstat calls per sync, plus a discarded ResolveLinkTarget result (one extra Readlink per link). Canonicalize each target path once per followScope and reuse the resolved link.
FollowedLinksStaged / CheckFollowedLinks run git ls-files and git check-ignore once per declared link (internal/git/followed_links.go; same pattern in cmd/skillshare/doctor.go, follow_handlers.go, source_mutation.go). One ls-files -z -- <paths> plus one check-ignore --stdin -z per operation would do.
Commit and push check followed links twice: the dashboard handler_git.go paths and CLI commit.go + push.go each build two snapshots and run CheckFollowedLinks twice because StageAll re-runs it. Four git subprocesses per link where two suffice.
SameSkillLink / OwnsSourceLink build a followScope per skill per target (handler_diff_stream.go, CheckStatusMergeWithOptions), each canonicalizing the source again. Build one scope per target; use set.SourceRoot().
Follow() reads every followed target directory in full only to prove readability (follow.go around the ReadDir on the resolved target); discovery reads it again. Open + ReadDir(1) or leaving it to markMissing is enough.
Repeated snapshots: hub.go project mode builds configuredSkillFollowSet and overwrites it; init.go builds three; toggle, handlePatchSkillSource, and handleInstall build two or three per request. Thread the request/command snapshot.
FollowedUpdate.CheckClean runs git status -uall in both Prepare and Pull; possibly intentional TOCTOU protection, decide and document.
Closed with #390. The .skillfollow implementation is not being merged, so this follow-up no longer applies. If the need resurfaces against a new implementation, it will be filed fresh.
Activity
runkids commentedon Oct 5, 2026
Closed with #390. The
.skillfollowimplementation is not being merged, so this follow-up no longer applies. If the need resurfaces against a new implementation, it will be filed fresh.