Skip to content

feat(audit): honor findings accepted with --force via --respect-accepted - #872

Merged
runkids merged 2 commits into
mainfrom
runkids/audit-respect-accepted
Nov 12, 2026
Merged

runkids merged 2 commits into
mainfrom
runkids/audit-respect-accepted

Conversation

@runkids

@runkids runkids commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Type

  • Bug fix
  • Small improvement (docs, typo, minor refactor)
  • Feature proposal (proposals/ only — see CONTRIBUTING.md)
  • Approved feature or large change (the linked issue has the approved label)

Linked Issue

Closes #869

What changes

install and update --force record accepted findings in audit_accepted, but skillshare audit ignored that record, so a skill installed with --force kept failing CI.

  • CLI: new opt-in audit --respect-accepted. Accepted findings stay in every output but are marked:
    • JSON: acknowledged: true on the finding; counted in summary.accepted instead of their severity.
    • Text/TUI: an "accepted earlier with --force" note.
    • Markdown: (accepted earlier) after the message, plus an Accepted summary row.
    • SARIF: suppressions of kind external.
      They no longer fail the audit. Without the flag nothing changes. A changed file or snippet needs a new acceptance.
  • Tracked repos: acceptances are recorded at the repo root, so install.ApplyAcceptedFindings walks up from each skill to match them. Works for global, project (-p) and audit agents.
  • Dashboard (always honors acceptances):
    • Audit page: accepted findings muted and sorted last; an Accepted count; a Show accepted filter.
    • Skill Audit tab: accepted findings collapsed by default; the tab count and Security box count open findings only.
    • Dashboard attention card: a skill whose only blocking findings were accepted is no longer listed; a footer notes the accepted count.
  • Shared counting: audit.Result.CountOpenBySeverity is used by both the CLI JSON summary and the server summary.
  • Oplog: records accepted; the CLI and web log views show it.
  • Docs and other surfaces: docs in English plus ja/ko/zh-Hans/zh-Hant, the built-in skill reference, completions for 5 shells, i18n for 11 locales.
  • E2E runbook: ai_docs/tests/audit_respect_accepted_runbook.md.

Decisions worth a look

  • Risk score unchanged: risk score, risk label and per-category counts still include accepted findings. They describe the content; acceptance only changes whether it blocks.
  • Install/update/edit gates also change: these gates already honored per-skill acceptances. Through the shared ancestor walk they now also honor repo-wide acceptances for skills inside tracked repos.
  • Cross-skill findings can't be accepted: they are not recorded by --force and run after the summary, so they do not affect the exit code.

Checks run (devcontainer)

  • make build then make check: exit 0 (fmt, lint, all Go unit and integration tests)
  • New integration tests: TestAudit_RespectAccepted, _Project, _Agents
  • UI: tsc --noEmit exit 0; vitest run 886 passed
  • website: npm run build exit 0
  • python3 scripts/ai-context.py check: ok
  • mdproof runbook audit_respect_accepted_runbook.md: 7/7 passed in a fresh ssenv
  • Dashboard: Audit page, skill Audit tab and Dashboard card checked in the browser with screenshots

Checklist

  • I've read CONTRIBUTING.md, including its AI-assisted contributions section
  • I've reviewed every line of the diff and can explain it
  • Tests included and passing (make check) — for code changes
  • No unrelated changes in the diff
  • Scope is focused — one concern per PR

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.

@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: 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".

Comment thread internal/install/audit_accept.go Outdated
// 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+"/"))

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

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.

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T03:12:10.629558Z 917901e Manual request
ℹ️ 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.

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.
@runkids

runkids commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 917901e993

ℹ️ 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".

@runkids
runkids merged commit 9dbcd92 into main Nov 12, 2026
9 checks passed
@runkids
runkids deleted the runkids/audit-respect-accepted branch November 12, 2026 03:15
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.

audit: exit code and JSON ignore findings accepted with --force (audit_accepted)

1 participant