InstallOptions.Force carried two meanings: "overwrite what is already
there" and "proceed despite audit findings". Update paths set Force
unconditionally to overwrite a staged temp dir, so they had to leave it
off to keep the audit gate alive -- which swallowed the caller's --force
and made the gate impossible to override from either the CLI or the web
UI.
Split the audit intent into InstallOptions.AuditOverride and route every
gate through it alone. Entry points translate --force explicitly, so a
missed one degrades to "force has no effect" rather than "audit is
bypassed". Scan failures stay fail-closed regardless: accepting known
findings is not the same as being unable to learn any.
This also closes two paths that bypassed the gate outright, since both
inherited Force for overwrite reasons alone: install --json and grouped
batch updates.
In the web UI, Force Retry now appears only on failures force can
actually resolve -- a permission-denied unlink previously offered a
button that could never succeed -- and CLI-only flag hints are stripped
from messages rendered there.
Behaviour change: a --force at install time no longer exempts later
updates from the audit gate; it is a one-off decision per command.
When tracked repo metadata is committed but the gitignored clone dirs are
absent on a fresh machine, `update --all` silently reported zero work: the
batch path skipped missing repos with no message, and the web UI's
update-all paths only listed repos present on disk.
Missing tracked repos are now detected and surfaced everywhere:
- CLI: a warning block (human output) plus an aggregated
`missing_tracked_repos` summary (names + one-shot rehydrate hint) in JSON;
the per-item error is concise. Fixed for both global and project modes,
and batch and single-target paths.
- Server: GET /api/update/missing-tracked-repos and the update-all/stream
summaries report them; POST /api/update/rehydrate re-clones them from
metadata (mirrors bare `skillshare install`).
- UI: the Update page shows a warning banner listing missing repos with a
Rehydrate button; strings added to all 11 locales.
Closes#212
P2-1: handleUninstallRepo and handleBatchUninstall used s.cfg.Source for
gitignore removal, but project-mode installs write to .skillshare/.gitignore
with a "skills/" prefix. Add gitignoreDir() helper that returns the correct
base directory per mode, and prefix entries in project mode.
P2-2: Registry prune used filepath.Base(repoName) to derive the legacy group,
causing sibling nested repos (e.g., org/_team-skills vs dept/_team-skills) to
collide on the same basename. Now uses exact Group match for nested repos and
restricts legacy basename matching to top-level repos only.
Tests added (15 new):
- resolveTrackedRepo: auto _ prefix, nested, already-prefixed, not-found,
basename fallback
- Registry prune: full-path Group, nested members by prefix, sibling isolation
- Project-mode gitignore: single + batch uninstall
- updateSingle: basename fallback, not-found, regular skill priority
- cleanEmptyParents: multi-level, stops at non-empty, stops at boundary
P1: updateSingle now uses resolveTrackedRepo (shared with uninstall)
to find nested tracked repos like org/_team-skills instead of only
probing root-level _name/name.
P2: handleUninstallRepo now prunes registry entries belonging to the
uninstalled repo and runs ReconcileGlobalSkills/ReconcileProjectSkills,
matching the cleanup that handleUninstallBatch already does.
Extracted resolveTrackedRepo as a Server method to deduplicate the
nested path resolution logic between uninstall and update handlers.
Return auditRiskScore and auditRiskLabel in update results so the
dashboard can show security posture after both tracked-repo and
regular-skill updates. auditGateTrackedRepo now returns the audit
result alongside the blocked indicator.
- cmd/skillshare/update_test.go: table-driven test covering all
isSecurityError keywords (security audit, post-update audit,
rolled back, rollback failed) and negative cases
- internal/server/handler_update_test.go: three tests for
auditGateTrackedRepo: rollback failure warning on HIGH findings,
rollback failure warning on scan error, and clean repo returns nil