The dashboard check reimplemented the CLI's per-repo check but fetched
without the HTTPS token and ignored git status errors. Private tracked
repos could fail in the dashboard while `skillshare check` worked, and a
repo whose status could not be read showed as up to date. Both check
endpoints now call check.ParallelCheckRepos, the same code the CLI uses.
The JSON and SSE response shape does not change.
Batch uninstall treated a failed dirty check as clean and moved the
repo to trash. Without force, that item now fails with the git error
instead. This is stricter than the CLI, which only warns and continues.
Batch target updates ignored metadata save failures and still reported
success, so an override could silently disappear on the next reload.
They now return 500.
Every API request reloads the skills and agents metadata stores and
swaps the server's pointers under s.mu, but several handlers read or
wrote the stores outside that lock: listing, skill detail, check, the
update stream, and the hash refresh after setting targets. Concurrent
requests could race on the pointer or on the stores' maps, which the
race detector reported hundreds of times under load and which can
crash the server with a concurrent map access.
Store access now always happens under s.mu. Reads return a copy of
the entry so it can be used after unlocking, and target handlers hash
files outside the lock and only write the result under it.
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
Add ProjectSources struct to ProjectConfig with optional skills, agents,
and extras fields. When set, project-mode commands resolve source paths
from these values instead of hardcoded .skillshare/{skills,agents,extras}/.
Config example:
sources:
skills: ./docs/skills
agents: ./docs/agents
Three EffectiveXxxSource(projectRoot) methods provide the central
resolution logic with fallback to defaults. The projectRuntime gateway
and server layer route through these methods, so most commands get
custom source support automatically.
Closes#153
All call sites that looked up metadata entries using filepath.Base()
now use store.GetByPath(relPath) which handles both full-path keys
and legacy basename+group keys transparently.
Also fixes makeInstallOpts() to set SourceDir from updateContext,
preventing nested skill updates from writing metadata to wrong dir.
Replace every remaining call to the old per-skill metadata API
(ReadMeta, RefreshMetaHashes, config.LoadRegistry) with the centralized
MetadataStore across 10 files:
Server handlers:
- handler_check.go: use s.skillsStore.Get() instead of ReadMeta
- handler_check_stream.go: same pattern as handler_check.go
- handler_skills_batch.go: use s.skillsStore.RefreshHashes() + Save()
CLI commands:
- check.go: load store once in collectCheckItems, use MetadataEntry
- doctor.go: load store once in checkSkillIntegrity
- list.go: load store once in buildSkillEntries (replaces parallel ReadMeta)
- uninstall.go: use skillsStore for display/dry-run/finalize
- uninstall_project.go: same pattern, remove config.LoadRegistry
- update_batch.go: pruneRegistry now uses MetadataStore
Hub:
- hub/index.go: load store once in BuildIndex
The only remaining ReadMeta call is in a test file
(search_batch_meta_roundtrip_test.go) which tests the shim itself.
Addresses P1 and P2 from code review on the RWMutex commit:
P1 — Stream handlers now snapshot config under RLock before streaming:
- handleDiffStream: clone Targets map to prevent concurrent map panic
- handleCheckStream, handleAuditStream: snapshot source/projectRoot
- handleUpdateStream: snapshot source (per-item Lock already correct)
P2 — All read handlers now use narrow snapshot instead of defer RUnlock:
- RLock → copy needed fields to locals → RUnlock → do work with locals
- Prevents slow I/O (git fetch, version check, audit scan) from blocking
the auto-reload middleware's exclusive Lock on concurrent requests
Other changes:
- computeTargetDiff takes source parameter (no more s.cfg.Source access)
- Add cloneTargets() helper for safe map copying
- Add writeOpsLogTo/writeAuditLogTo for lock-free oplog writes
Replace sequential POST loops and blocking useQuery calls with
Server-Sent Events for real-time progress feedback on Update, Check,
and Diff operations. Extract shared helpers to reduce duplication:
- initSSE() in middleware.go consolidates SSE preamble across 4 handlers
- createSSEStream() in client.ts unifies EventSource lifecycle management
- StreamProgressBar component replaces 3 near-identical progress bars
- handleDiff now delegates to computeTargetDiff (eliminates ~150 lines)
- Paginate audit results (20 cards + 10 findings per card) to prevent
DOM overload with large skill counts