Skip to content

Ship tested rules files for 18 stacks, with a test harness - #22

Merged
ziadantar90 merged 27 commits into
developmentfrom
claude/project-thread-ixtjul
Nov 2, 2026
Merged

ziadantar90 merged 27 commits into
developmentfrom
claude/project-thread-ixtjul

Conversation

@ziadantar90

@ziadantar90 ziadantar90 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Ziad · project thread

What

PullPicket now ships production-grade rules files instead of three short examples. Each file has sample pull requests that test it.

  • Standard and quality bar. docs/rules-files.md defines the file layout and how a good rule is written. A file ships only when, on a large model at default settings and in each of three runs, every planted CRITICAL is caught at CRITICAL, at least 80% of planted WARNINGs are caught, and no clean sample gets a CRITICAL or WARNING comment. Small-model scores are published per stack instead of held to the same bar (Ziad's call).
  • Test harness. tools/Invoke-RulesEval.ps1 (functions in tools/RulesEval.ps1) uses the engine's own functions to build the exact prompt the pipeline sends. It calls Anthropic, OpenAI or Azure OpenAI, or scores saved answers (-Provider manual, -Rescore), and reports caught, underrated, missed and noise per stack and run. It exits 1 on a failure.
  • Samples. 54 samples under evals/<stack>/<sample>/, each a before//after/ tree plus an expect.json. Every stack has a clean sample. ai-code-review/tests/RulesEval.Tests.ps1 checks every sample and the scoring logic. No model is called in CI.
  • Rules files. Next.js, NestJS and Terraform are rewritten. New: React/Vite, Angular, Vue, Node/Express, ASP.NET Core, Spring Boot, Go, Django, FastAPI, C++, Rust, Bicep, Kubernetes/Helm, Dockerfiles/Compose and SQL migrations.
  • Base prompt. Three noise and severity rules: drop comments that conclude the code is fine, cap comments that depend on code outside the diff at SUGGESTION, and use the severity a repository rule names.
  • Docs. docs/rules-results.md publishes the per-stack scores. README, CHANGELOG and CONTRIBUTING are updated.

Results (3 runs per sample, 2 Nov 2026)

Model Stack runs passing the bar
Claude Opus 5.5 (large) 53 of 54
Claude Haiku 5.5 (small) 23 of 54

The one large-model miss was a latest image tag rated SUGGESTION instead of WARNING in one run. The small model catches most bugs but adds noise on clean Terraform, Bicep, Django, Next.js and C++ samples, and rates SQL migration and Terraform criticals lower. The docs recommend a mid-sized or large model. Full table: docs/rules-results.md.

Checks run locally

  • Pester: 239 passed, 0 failed.
  • PSScriptAnalyzer with the CI settings: no findings.
  • gitleaks over full history: no leaks.

🤖 Generated with Claude Code

https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn

claude added 21 commits November 2, 2026 04:50
docs/rules-files.md sets the layout and the quality bar for shipped rules
files. tools/Invoke-RulesEval.ps1 builds the exact prompt the pipeline sends
for each sample change under evals/, asks a model (Anthropic, OpenAI, Azure
OpenAI, or manual answers), and scores caught, missed and noisy comments.
Pester checks that every sample is well formed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn
@ziadantar90 ziadantar90 self-assigned this Nov 2, 2026
The samples contain made-up credentials on purpose. gitleaks flagged a role
definition GUID in the Bicep clean sample as a generic API key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn
Retry rate limits and overloads, fall back to tool_choice auto for models
that refuse a forced tool, accept answers nested or sent as a JSON string,
count an unparseable answer against the stack instead of stopping the run,
save every answer, add -Rescore, alsoAt locations and an all-runs summary.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn
Model runs against the rules samples showed reviewers posting WARNING
comments that conclude the code is fine, posting questions about code
outside the diff as WARNING, and lowering the severity a repository rule
names. Three rules now cover these cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn
Opus found real bugs in four clean samples (a stale error state, a
same-wallet transfer and lock order, a PATCH that erased a field, a rate
limiter that grew without bound); those samples are fixed or replaced.
Some expectations now accept a second fair line or a lower severity where
the planted bug could not be judged from the diff alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn
Shipped rules files must pass on a large model in three runs. Scores for a
large and a small model are published per stack in docs/rules-results.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8A4vxmHJ5PCcJknu3yJHn
Signed-off-by: Claude <noreply@anthropic.com>
@ziadantar90
ziadantar90 marked this pull request as ready for review November 2, 2026 16:08
@ziadantar90
ziadantar90 merged commit f1118bf into development Nov 2, 2026
6 checks passed
@ziadantar90
ziadantar90 deleted the claude/project-thread-ixtjul branch November 2, 2026 19:25
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