Skip to content

fix(audit): keep the skills source when auditing agents only - #412

Merged
runkids merged 2 commits into
mainfrom
runkids/main-followups-404-407
Oct 5, 2026
Merged

runkids merged 2 commits into
mainfrom
runkids/main-followups-404-407

Conversation

@runkids

@runkids runkids commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Type

  • Bug fix
  • Small improvement (docs, typo, minor refactor)
  • Feature

Summary

The follow-ups from PR #390's review that do not depend on .skillfollow code, so they can land from main now. Each is independent and small.

  • Audit TUI Skills tab under audit --agents scanned the agents source as skills (skillfollow: small cleanups left after PR #390 review #407 item 5). cmdAudit overwrote sourcePath with the agents source, so auditTUIContext.sourcePath (documented "skills source (always)") held the agents directory and the Skills tab discovered skills there. The override is gone: auditScanRoot picks the source per kind, and auditInstalled / auditFiltered discover, print the header, and relativize names against that root while the skills source is kept for tab switching. TestAuditInstalled_AgentsKindScansAgentsSource fails before the change (got [], and ../002/helper.md with discovery alone) and passes after.
  • /api/skillignore reads the source through s.skillsSource() (skillfollow: small cleanups left after PR #390 review #407 item 6), the accessor every other source-reading route uses, instead of s.cfg.EffectiveSkillsSource(). The two are equal in project mode today, so this is consistency only; TestHandleGetSkillignore_ProjectModeUsesProjectSource pins that the route serves the project source.
  • scripts/windows/e2e-file-links.ps1 isolation check was stale (Windows: verify .skillfollow step 4 on a real guest (follow --to junction, case-insensitive names) #404 runbook item). It grepped doctor output for Config:, but since feat(cli): redesign init and give every command one output style #360 doctor prints Config ~\... with the path shortened to ~, so the check could never prove the config lives under -Root and aborted the whole run. It now reads status --json source.path, the same check e2e-skillfollow.ps1 uses on a real guest.

Tried and reverted: adding internal/sourcewalk to windows-test (#404 CI item). The first commit ran it on windows-latest and TestWalkParity, TestWalkDirParity, and TestSymlinkRoot fail there: the walker hands callbacks paths under the canonical root (C:\Users\runneradmin\...) while the test passed the t.TempDir() spelling, so filepath.Rel yields ..\..\.. 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, .skillfollow routes), and #410 (symlink policy), which needs a decision first.

Checks run

  • make check in a throwaway devcontainer-image container.
  • GOOS=windows go vet ./internal/sourcewalk ./cmd/skillshare.
  • The PowerShell change is not executed here (no Windows guest); it mirrors the verified check in e2e-skillfollow.ps1.

Versioning

Bug fix plus small improvements; patch release. No Release-As footer.

Linked Issue

Refs #404, #407.

Checklist

  • I've read CONTRIBUTING.md
  • Tests included and passing (make check) — for code changes
  • No unrelated changes in the diff
  • Scope is focused — one concern per PR

`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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-05T03:16:48.208076Z a6b5b8a PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread cmd/skillshare/audit.go Outdated
Comment on lines +535 to +536
if kind == kindAgents {
skillPaths, err = collectInstalledAgentPaths(sourcePath)
skillPaths, err = collectInstalledAgentPaths(agentsSourcePath)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@runkids
runkids merged commit d1371db into main Oct 5, 2026
8 checks passed
@runkids
runkids deleted the runkids/main-followups-404-407 branch October 5, 2026 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant