Skip to content

feat: capture dismissal reasoning in the suppression why#24

Merged
sshanzel merged 1 commit into
mainfrom
feat/suppression-reasoning
Jun 17, 2026
Merged

feat: capture dismissal reasoning in the suppression why#24
sshanzel merged 1 commit into
mainfrom
feat/suppression-reasoning

Conversation

@sshanzel

Copy link
Copy Markdown
Owner

What changed

A waive/reject's note — the developer's actual reasoning ("console is intentional here, it's the CLI logger") — was used only to build the re-match embedding and then discarded as readable text. The suppression why was a fixed template ("the no-console rule was dismissed in <repo>") and the incident note was just "waive <findingId>". So the explorer's detail panel could never tell you why something was valid here.

Thread the verdict note into both:

  • the suppression's why (on mint — keyed/rule and first-principles paths), and
  • the dismissal incident's provenance note.

Falls back to the template when no note is supplied.

Why

Captured-at-action-time reasoning is the point: it's recorded through the existing record_outcome MCP tool (or plex verdict) — no pr-master:respond skill required; that flow is just one optional caller of the same tool. The reasoning now sticks as readable provenance.

Scope note (what this does NOT do)

This is the capture half. It does not change suppression scope — a rule waive is still repo-wide. The larger follow-up (tracked separately) is location-scoped suppression: anchor an "intentional here" dismissal to the symbol (via code-path memory) so the rule keeps firing on new instances while this one is never re-asked. This PR is a prerequisite (the reasoning) for that.

How to test

  • pnpm exec vitest run packages/engine/src/suppression.test.ts — 23 green, incl. note→why + incident-note capture and the template fallback.
  • pnpm typecheck + pnpm test:unit green; pnpm build ok.

Checklist

  • typecheck / tests / build pass
  • Test added (note→why, fallback)

🤖 Generated with Claude Code

A waive/reject's note (the developer's actual reason — "console is
intentional here, it's the CLI logger") was used only to build the
re-match embedding and then discarded as readable text: the suppression
why was a fixed template ("the no-console rule was dismissed in <repo>")
and the incident note was just "waive <findingId>". So the panel could
never tell you WHY something was valid here.

Thread the verdict `note` into both the suppression `why` (on mint) and
the incident provenance note, for the keyed (rule) and first-principles
paths. Falls back to the template when no note is given.

This is the capture half; it's recorded via the existing `record_outcome`
MCP tool (or CLI verdict) — no responder skill required. The reasoning now
sticks as readable provenance, surfaced in the explorer's detail panel.

+ suppression.test.ts: note→why + incident note, and the template fallback.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sshanzel sshanzel merged commit 010a803 into main Jun 17, 2026
1 check passed
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