Repository navigation
feat(audit): honor findings accepted with --force via --respect-accepted - #872
Conversation
install and update --force record the findings a user accepted in audit_accepted, but audit ignored that record. A skill installed with --force therefore kept failing `skillshare audit` in CI with no way to let the accepted findings pass (#869). audit --respect-accepted marks those findings as acknowledged. They stay in every output (JSON acknowledged: true, a text/TUI note, "(accepted earlier)" in Markdown, SARIF external suppressions), but they are counted in summary.accepted instead of their severity and no longer fail the audit. Without the flag nothing changes, so existing CI gates keep their behavior. A changed file or snippet produces a new key and blocks again. Tracked repositories record acceptances at the repo root with paths relative to it, so ApplyAcceptedFindings walks up from each skill to match them. The install, update and edit gates use the same function and now honor repo-wide acceptances for skills inside tracked repos too. The dashboard always honors accepted findings: the Audit page mutes them and counts them apart, the skill Audit tab collapses them, and the Dashboard attention card no longer lists a skill whose only blocking findings were accepted. The CLI JSON summary and the server summary share Result.CountOpenBySeverity so both count accepted findings the same way. The oplog records the accepted count and the log views show it.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4dbb72a02c
ℹ️ 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".
| // a skill inside it also matches those, named relative to the repo. | ||
| for parent := path.Dir(rel); parent != "."; parent = path.Dir(parent) { | ||
| if keys := store.AuditAccepted[parent]; len(keys) > 0 { | ||
| n += res.MarkAcknowledgedUnder(keys, strings.TrimPrefix(rel, parent+"/")) |
There was a problem hiding this comment.
Rebase file-scan acceptances from the containing directory
After installing a skill with --force, auditing its file directly with audit /configured/source/evil/SKILL.md --respect-accepted --format json still fails on unchanged accepted findings. ScanFile reports Finding.File as SKILL.md, but this ancestor lookup passes SKILL.md as the prefix, so MarkAcknowledgedUnder hashes SKILL.md/SKILL.md instead of the recorded SKILL.md. The same issue affects tracked agents in both CLI and dashboard audits: agents/reviewer.md becomes agents/reviewer.md/reviewer.md. For file scan targets, compute the prefix relative to their containing directory rather than including the filename.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed and fixed in 917901e. A single-file scan names findings by the file's base name, so for a file target ApplyAcceptedFindings now uses the file's own directory as the prefix. New tests cover a direct SKILL.md scan and an agent file inside a tracked repo; also checked end to end: audit <source>/evil/SKILL.md --respect-accepted exits 0 after install --force, and 1 without the flag.
Codex Review Summary: ✅ CompletedThis 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. |
A single-file scan names its findings by the file's base name, but the ancestor lookup used the file's whole path as the prefix, so it hashed SKILL.md/SKILL.md instead of the recorded SKILL.md. Auditing a skill file directly with --respect-accepted, and auditing agents inside a tracked repository in the CLI or the dashboard, still failed on unchanged accepted findings. For a file target the prefix is now the file's own directory.
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Type
proposals/only — see CONTRIBUTING.md)approvedlabel)Linked Issue
Closes #869
What changes
installandupdate --forcerecord accepted findings inaudit_accepted, butskillshare auditignored that record, so a skill installed with--forcekept failing CI.audit --respect-accepted. Accepted findings stay in every output but are marked:acknowledged: trueon the finding; counted insummary.acceptedinstead of their severity.(accepted earlier)after the message, plus an Accepted summary row.suppressionsof kindexternal.They no longer fail the audit. Without the flag nothing changes. A changed file or snippet needs a new acceptance.
install.ApplyAcceptedFindingswalks up from each skill to match them. Works for global, project (-p) andaudit agents.audit.Result.CountOpenBySeverityis used by both the CLI JSON summary and the server summary.accepted; the CLI and web log views show it.ai_docs/tests/audit_respect_accepted_runbook.md.Decisions worth a look
--forceand run after the summary, so they do not affect the exit code.Checks run (devcontainer)
make buildthenmake check: exit 0 (fmt, lint, all Go unit and integration tests)TestAudit_RespectAccepted,_Project,_Agentstsc --noEmitexit 0;vitest run886 passedwebsite:npm run buildexit 0python3 scripts/ai-context.py check: okaudit_respect_accepted_runbook.md: 7/7 passed in a fresh ssenvChecklist
make check) — for code changes