Skip to content

ci: benchmark regression gate on every PR - #92

Merged
ksek87 merged 4 commits into
mainfrom
claude/ci-benchmark-gate
Jun 13, 2026
Merged

ci: benchmark regression gate on every PR#92
ksek87 merged 4 commits into
mainfrom
claude/ci-benchmark-gate

Conversation

@ksek87

@ksek87 ksek87 commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a benchmark CI job that runs after tests pass and blocks the PR if detection quality regresses
  • Three gates enforced on every push and pull request:
    1. Representative fixture (bench/mcptox_representative.json, 44 tools) — fn must be 0 (full recall on the canonical attack set)
    2. Combined fixture (representative + bench/clean_tools.json, 64 tools) — precision ≥ 0.90, recall = 1.0 (catches new false positives on clean tools)
    3. Actual dataset (bench/mcptox_actual.json, 485 tools) — fp must be 0 (no false positives on the real-world dataset)
  • Comprehensive documentation update syncing all counts and features to the actual codebase state (AC needles 161→188, signals 21→28, injection categories 8→10, --from-config usage examples, v0.13 benchmark column, missing signals in signal table, API key prefixes in credential_reference)
  • Three Claude Code skills added to .claude/commands/:
    • /docs-update — three-phase repeatable process: extract ground-truth counts from source, audit docs in parallel, apply fixes file-by-file
    • /add-signal — end-to-end checklist for adding a new signal: all 7 required sites in src/fuzzer/mod.rs, AC needle placement, benchmark before/after, corpus record, CHANGELOG entry
    • /release-prep — release checklist: version validation, CHANGELOG promotion, Cargo.toml bump, bench/README.md version column, full local CI suite, commit/tag/push, release.yml verification

Current numbers (as of main after merging #89#91)

  • Representative: precision 1.000, recall 1.000, F1 1.000 — 0 FN
  • Combined: precision 1.000, recall 1.000 — 0 FP, 0 FN
  • Actual: precision 1.000 — 0 FP, recall 0.907

Test plan

  • CI benchmark job passes (all three gate checks green)
  • CI fmt, clippy, test, build jobs all pass
  • fuzzd benchmark --schema bench/mcptox_representative.json --output json returns fn: 0
  • fuzzd benchmark --schema bench/mcptox_actual.json --output json returns fp: 0
  • /docs-update, /add-signal, /release-prep skills listed and invocable in Claude Code

https://claude.ai/code/session_014T1x8ZiDbJcVvkZBfP91nk

claude added 4 commits June 13, 2026 18:21
Three checks run after the test suite passes:
- Representative fixture: fn must be 0 (recall = 1.0)
- Combined representative+clean: precision >= 0.90, recall = 1.0
- Actual dataset: fp must be 0 (no new false positives)

Uses the JSON output mode added in v0.7.0; python3 is available
on ubuntu-latest without any extra setup step.

https://claude.ai/code/session_014T1x8ZiDbJcVvkZBfP91nk
- README.md: update detection pass count (4→5), AC needle count (161→188),
  signal count (21→28); add 5 missing signals to table (protocol_violation,
  unexpected_tool_sequence, runtime_credential_access, unexpected_network_call,
  annotation_deception); update credential_reference to mention API key prefixes;
  update injection payload category count (8→10) to include SSRF and ReDoS;
  add --from-config examples to Quick Start and Usage sections; add config.rs
  to architecture diagram; fix fuzzer module counts (28 signals, 188 patterns,
  37 response patterns, 10 payload categories); add config-file audit to roadmap
  as shipped

- bench/README.md: add v0.13 column to version table; update AC pattern count
  (161→188) in section header and Pass 1 description; add API key prefixes to
  credential_reference signal row

- CHANGELOG.md: add benchmark regression CI gate entry (#92)

- CONTRIBUTING.md: require ./bench/run.sh before every PR; document the three
  CI gate checks enforced by the benchmark job

https://claude.ai/code/session_014T1x8ZiDbJcVvkZBfP91nk
Automates the documentation gap-finding and update process:
- Phase 0 extracts ground-truth counts from source (signals, AC needles,
  response patterns, payload categories, corpus records)
- Phase 1 audits README.md, bench/README.md, CONTRIBUTING.md, CHANGELOG.md
  against those counts in parallel
- Phase 2 applies fixes file-by-file with explicit checklists for each file

Invoke with /docs-update after any release or significant feature merge.

https://claude.ai/code/session_014T1x8ZiDbJcVvkZBfP91nk
/add-signal — guides adding a new detection signal end-to-end:
  7 required sites in src/fuzzer/mod.rs (enum, ALL, as_str, rule_id,
  description, tags, Display), AC needle placement in description.rs or
  response.rs, benchmark before/after, corpus record, CHANGELOG entry,
  and a final checklist that mirrors the CI gates

/release-prep — guides cutting a release:
  version validation, CHANGELOG promotion, Cargo.toml bump, bench/README.md
  version column, README version references, full local CI suite, commit/tag/push,
  and release.yml verification checklist

https://claude.ai/code/session_014T1x8ZiDbJcVvkZBfP91nk
@ksek87
ksek87 merged commit 8cacd08 into main Jun 13, 2026
10 checks passed
@ksek87
ksek87 deleted the claude/ci-benchmark-gate branch June 13, 2026 18:40
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.

2 participants