@pugi/plugin-quad-review
v0.1.0-alpha.2
Published
Pugi quad-review plugin - extends triple-review with a Historical Lens fourth reviewer that scans past closed PRs for confirmed regression patterns.
Downloads
295
Maintainers
Readme
@pugi/plugin-quad-review
Pugi quad-review plugin - 4-model consensus gate with a Historical Lens reviewer that surfaces "this pattern caused a real production bug in PR#X before, the current diff brings it back" findings.
Part of the Pugi 1.0 soft fork sprint (see ADR-0081).
Status
Production-ready. 55 specs, deterministic rubric, isolated from
@pugi/plugin-triple-review per ADR-0081 plugin-isolation rule.
When to use
Strictly stronger gate than triple-review. Reserve for production-critical
pushes; for inner-loop reviews use @pugi/plugin-triple-review.
| Scenario | Recommended gate |
| --------------------------------------- | ------------------------ |
| DB migrations / schema changes | /quad-review |
| Auth boundary touches | /quad-review |
| Payments / billing | /quad-review |
| Secrets handling | /quad-review |
| RLS / authorisation rule changes | /quad-review |
| Inner-loop refactor | /triple-review |
| Docs-only PR | /triple-review |
| Architectural change with security | /quad-review |
Reviewers (all 4 by default)
- Pugi ensemble (open-weight Qwen3-Coder + Kimi + DeepSeek via Anvil)
- Gemini Pro (Google direct)
- Claude Sonnet (Anthropic direct, fresh eyes)
- Historical Lens - new fourth reviewer. Scans past closed PRs touching
the same files, surfaces lines from past PR review comments that match
the regression-keyword filter, runs a risky-pattern grep on added diff
lines, then asks the subagent to flag
[REGRESSED]patterns that cite a realPR#<digits>from the corpus.
Extended rubric
In precedence order (highest first):
- Historical Lens ANY
[REGRESSED](with realPR#<digits>citation) -> BLOCK (overrides everything) - Any reviewer
[P0]-> BLOCK = 2 of 4 reviewers
[P1]-> BLOCK- exactly 1 reviewer
[P1]-> WARN - otherwise -> PASS
See ~/.claude/skills/quad-review/SKILL.md
for the operator-facing spec.
Override semantics (two-tier)
Plain BLOCK (P0 / P1) is bypassed by EITHER:
--break-glassflag on the slash command, OR- Sentinel file
.pugi/quad-review-overrideexists (any contents)
[REGRESSED] BLOCK is strictly stronger - it requires both signals:
--break-glass --confirm-regressed-override, OR- Sentinel file
.pugi/quad-review-overridewhose body is exactlyCONFIRM-REGRESSED-OVERRIDE
Every override event is journaled to .pugi/quad-review-overrides.jsonl so
audit can replay it.
Hook surface
command.execute.before- intercepts/quad-review, fans out to the 4 reviewers, gathers historical corpus, runs the deterministic rubric, persists the verdict, surfaces a TUI block back to the user.
Install
pnpm add @pugi/plugin-quad-reviewUsage
// pugi.config.ts
export default {
plugin: ['@pugi/plugin-quad-review'],
};Options
Every knob is optional; defaults match the /quad-review skill spec.
import quadReview from '@pugi/plugin-quad-review';
quadReview(input, {
command: 'quad-review',
diffBaseRef: 'origin/main',
maxDiffBytes: 200_000,
historicalPrLimit: 5,
changedFileLimit: 10,
historicalKeywordRegex: /regress|broke|fix later|TODO|HACK|XXX|known issue|reverted|rollback/i,
riskyPatternRegex: /mutex|race|deadlock|leak|eval\(|exec\(|drop table|truncate|unsafe|nosec|skip[- ]auth/i,
historicalSubagentType: 'code-reviewer',
logDir: '.pugi/quad-review-log',
overrideSentinel: '.pugi/quad-review-override',
overrideLogFile: '.pugi/quad-review-overrides.jsonl',
});Plugin isolation (ADR-0081)
@pugi/plugin-quad-review does NOT import from @pugi/plugin-triple-review
or any other @pugi/plugin-*. The shared diff-capture, prompt, parser, and
filter logic is duplicated by design so each plugin can be upgraded
independently. The duplication is documented at the top of every duplicated
file.
License
MIT. See LICENSE.
