Skills installed from a non-default branch record that branch in metadata,
but the grouped update path (update --all) cloned the remote default branch,
so the skills were either downgraded or reported as removed upstream and
pruned. The web UI update and check handlers had the same gap, comparing
against the remote HEAD instead of the installed branch.
Group batch updates and web UI checks by URL+branch, pass the branch through
to the clone, and resolve remote tree hashes for that branch as well.
Refs #268
- DiscoveredResource gains RepoRelPath and Targets fields
- AgentKind.Discover populates RepoRelPath via findTrackedRepoRelPath
- AgentCheckResult gains RepoPath and dirty status for tracked repos
- InferTrackedKind auto-detects pure-agent repos for --track install
- TrackedRepoResult reports AgentCount and Agents list
Three bugs introduced during centralized metadata migration:
1. Batch agent installs via UI wrote metadata to skills/.metadata.json
instead of agents/.metadata.json because handleInstallBatch hard-coded
SourceDir to s.cfg.Source. Override SourceDir with agentsSource() when
body.Kind is agent.
2. CheckAgents used LoadMetadataOrNew which silently converts parse
failures into an empty store, making all tracked agents appear local
and suppressing drift/update diagnostics. Switch to LoadMetadata and
surface corruption as status=error with the parse error message.
3. findMetaEntry only climbed 3 parent directories when searching for
.metadata.json, but --into supports arbitrary nesting depth. Raise
the ceiling to 10 (root sentinel still terminates early).
Production code no longer reads or writes .skillshare-meta.json sidecars:
- InstallAgentFromDiscovery: write to centralized store via WriteMetaToStore
- agent_check.go: read from centralized store passed as parameter
- handler_skills.go: read agents from s.agentsStore
- audit.go: readMetaFileHashes reads from parent .metadata.json
- analyzer_metadata.go: extract findMetaEntry to deduplicate walk logic
- uninstall_agents.go: remove entry from centralized store on uninstall
- batchUpdateAgents: pass store to reinstallAgent, remove dead field
- Replace LoadMetadata+nil guard with LoadMetadataOrNew across 6 files
When extras has an entry named 'agents' whose target paths overlap with
the resolved agent target paths from targets.yaml, the extras targets
are skipped with a warning — the agents sync system takes priority.
Detection uses dual conditions: extras name == 'agents' AND resolved
path overlap. Non-'agents' extras targeting agent paths are unaffected.
Agents source must exist with actual files; empty/missing source means
no overlap (extras sync normally).
Also fixes:
- CheckAgents now recurses into subdirectories via resource.AgentKind
- update agents resolves nested agent names via filepath.Base
- filterAgentCheckResults matches both full path and basename
Add RepoURL field to AgentCheckResult. Add EnrichAgentResultsWithRemote()
that batches remote HEAD hash checks via ParallelCheckURLs and marks
agents as 'update_available' when remote has newer commits than the
installed version.
- Set source.Branch in project install path
- Sync branch in project reconcile
- Add Branch to checkRepoResult and RepoCheckOutput for JSON/display
- Read current branch from tracked repos in check
Ref: #90
- Add GetRemoteRefHash/WithAuth/WithEnv to internal/git/info.go:
uses git ls-remote with refs/heads/<branch> when branch is set,
falls back to HEAD when branch is empty
- Add Branch field to URLCheckInput and URLCheckOutput in check/parallel.go;
ParallelCheckURLs dispatches to GetRemoteRefHashWithAuth when Branch is set
- check.go: group skills by RepoURL@branch composite key so skills on
different branches of the same repo are checked against the correct ref;
urlHashMap keyed by same composite key for correct broadcast
- install_config.go (InstallFromConfig): propagate SkillEntryDTO.Branch
into Source.Branch for both plain and tracked skill phases so registry
rebuild (install --from-config) respects the recorded branch
Previously `skillshare check` compared repo-level commit hashes, causing
all skills from a registry repo to show "update_available" whenever any
commit was pushed — even if the individual skill's files were unchanged.
Now each skill records its git tree hash (subdir-level SHA) at install
time. During check, a three-tier comparison is used:
1. Fast path: commit hash matches → up_to_date (zero extra cost)
2. Tree hash path: blobless fetch (~150KB) + batch ls-tree → per-skill
comparison; unchanged subdirs stay up_to_date
3. Fallback: no tree hash (old installs) → commit comparison (unchanged)
Also fixes pterm progress bar printing twice when it auto-stops at 100%.
- Return early with error status when git.IsDirty fails instead of
silently ignoring the error, which could mask real issues
- Add TestParallelCheckRepos_NilCallback for nil callback with real inputs
- Add index alignment assertions to TestParallelCheckRepos_CallbackCount
Introduce internal/check package with ParallelCheckRepos that checks
multiple tracked repos concurrently using an 8-worker semaphore pattern
(matching audit/parallel.go). Each repo is checked for dirty state and
behind count via internal/git. Includes types for future URL-based
remote hash probing.