Repository navigation
fix(audit): keep the skills source when auditing agents only - #412
Conversation
`skillshare audit --agents` replaced sourcePath with the agents source before building auditTUIContext, so the TUI's Skills tab discovered skills inside the agents directory. The agents-only branches now read agentsSourcePath themselves and the skills source is left alone. Also from the #390 review, independent of .skillfollow: - /api/skillignore reads the source through skillsSource() like the other routes (equal in project mode today; consistency only). - scripts/windows/e2e-file-links.ps1 checked doctor output for a "Config:" line that no longer exists and could not match the ~-shortened path, so the run always aborted. It now checks status --json source.path, as e2e-skillfollow.ps1 does. - windows-test runs internal/sourcewalk; GOOS=windows vet passes and the job on this PR is the first real run. Refs #404, #407.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a6b5b8aced
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if kind == kindAgents { | ||
| skillPaths, err = collectInstalledAgentPaths(sourcePath) | ||
| skillPaths, err = collectInstalledAgentPaths(agentsSourcePath) |
There was a problem hiding this comment.
Relativize agent results against the agents source
When the skills and agents sources are separate, auditInstalled now discovers agents from agentsSourcePath but later computes each SkillName with filepath.Rel(sourcePath, ...). Thus audit agents --json can report names such as ../agents/helper.md instead of helper.md; text output also displays the skills source as the scan root, and auditFiltered repeats the same mismatch. Keep both paths for TUI tab switching, but use agentsSourcePath as the active display and relativization base when kind == kindAgents.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in the second commit. auditScanRoot picks the root per kind, and auditInstalled / auditFiltered discover, print the header, and relativize against it; the skills source is kept only for the TUI's other tab. TestAuditInstalled_AgentsKindScansAgentsSource now asserts SkillName == "helper.md" and failed with ../002/helper.md on the previous commit.
With discovery moved to the agents source, auditInstalled and auditFiltered still printed the header and computed SkillName against the skills source, so `audit agents --json` reported names such as `../agents/helper.md` when the two sources are siblings (Codex review on #412). auditScanRoot now picks the root per kind for discovery, header, and relativization; the skills source is kept only for TUI tab switching. Also drops internal/sourcewalk from windows-test again: the first run on windows-latest fails TestWalkParity, TestWalkDirParity and TestSymlinkRoot (callback paths come from the canonical root, so filepath.Rel against the test's root yields `..\..` chains). Logged on #344.
Type
Summary
The follow-ups from PR #390's review that do not depend on
.skillfollowcode, so they can land frommainnow. Each is independent and small.audit --agentsscanned the agents source as skills (skillfollow: small cleanups left after PR #390 review #407 item 5).cmdAuditoverwrotesourcePathwith the agents source, soauditTUIContext.sourcePath(documented "skills source (always)") held the agents directory and the Skills tab discovered skills there. The override is gone:auditScanRootpicks the source per kind, andauditInstalled/auditFiltereddiscover, print the header, and relativize names against that root while the skills source is kept for tab switching.TestAuditInstalled_AgentsKindScansAgentsSourcefails before the change (got [], and../002/helper.mdwith discovery alone) and passes after./api/skillignorereads the source throughs.skillsSource()(skillfollow: small cleanups left after PR #390 review #407 item 6), the accessor every other source-reading route uses, instead ofs.cfg.EffectiveSkillsSource(). The two are equal in project mode today, so this is consistency only;TestHandleGetSkillignore_ProjectModeUsesProjectSourcepins that the route serves the project source.scripts/windows/e2e-file-links.ps1isolation check was stale (Windows: verify .skillfollow step 4 on a real guest (follow --to junction, case-insensitive names) #404 runbook item). It greppeddoctoroutput forConfig:, but since feat(cli): redesign init and give every command one output style #360 doctor printsConfig ~\...with the path shortened to~, so the check could never prove the config lives under-Rootand aborted the whole run. It now readsstatus --jsonsource.path, the same checke2e-skillfollow.ps1uses on a real guest.Tried and reverted: adding
internal/sourcewalktowindows-test(#404 CI item). The first commit ran it on windows-latest andTestWalkParity,TestWalkDirParity, andTestSymlinkRootfail there: the walker hands callbacks paths under the canonical root (C:\Users\runneradmin\...) while the test passed thet.TempDir()spelling, sofilepath.Relyields..\..\..chains. Logged on #344; the package stays out of the matrix until that is fixed.Not in this PR: everything that depends on #390 (
follow/unfollow,FollowSet,.skillfollowroutes), and #410 (symlink policy), which needs a decision first.Checks run
make checkin a throwaway devcontainer-image container.GOOS=windows go vet ./internal/sourcewalk ./cmd/skillshare.e2e-skillfollow.ps1.Versioning
Bug fix plus small improvements; patch release. No
Release-Asfooter.Linked Issue
Refs #404, #407.
Checklist
make check) — for code changes