Repository navigation
fix(usage): do not count kit's own negative controls as refusals - #993
Merged
sandstream merged 1 commit intoNov 23, 2026
Merged
Conversation
Every kit check with the gates wired logs two refusals from its own negative controls. kit#980 marked them; the Floor tab still counted them, so a repository nobody was refused in showed 2 refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2
|
Docker image built, scanned, and smoke-tested in CI. The PR image is local to this run and is not published. |
sandstream
deleted the
claude/web-kit-status-sync-p6fg9a-usage-controls
branch
November 23, 2026 22:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
kit#980 marked the refusals that kit's own negative controls cause (
metadata.session_id: "kit-negative-control"), so they could be told apart from an agent's. Nothing read the marker. Measured in a fresh scratch repository afterkit agent-configand onekit check --category security, with no agent activity at all:Every
kit checkadds two more. A person reading the Floor tab to see where agents were stopped (kit-researchread-where-agents-fail-vs-kit) sees refusals no agent caused.The fix
floorFromLogsleaves marked rows out ofevents,refusalsand the per-gate counts, and returns them ascontrols. Both renderers say so:--markdownkit check,kit usage --prove) are not counted."--jsongainsfloor.controls. Rows written before kit#980 carry no marker and are still counted; there is no way to tell them apart.Verification
src/usage-report.test.ts: a log of two marked rows and one real refusal gives events 1, refusals 1, controls 2. It fails without the fix.src/usage-markdown.test.ts: the line renders.kit usagein the scratch repository: 0 audited, 0 refused, and the controls line.node scripts/prepush.mjs: build, format, lint, tests of the changed files, self-audit pass.kit reviewand the new-source-file check fail locally for container reasons. Semgrep did not run (not installed here).Generated by Claude Code