Reference

Architecture

4-pass pipeline, Drupal-specific RAG corpus 1968 chunks, AST-aware mechanical findings.

2026-05-27

Pipeline (4 passes)

PassCo robiCzasOutput
Pass 0 · MechanicalPHPCS + custom PHP-Parser logic analyzer (8 Drupal-idiom detectors)~2 secDeterministic findings (no LLM)
Pass 1 · TriageLLM klasyfikuje risk level + wybiera files for deep review~5 sec{risk: low|medium|high, files_for_deep_review: [...]}
Pass 2 · Deep reviewRAG retrieval (5 best chunks per file) + LLM review per file~10-30 secFindings z TRACE methodology
Pass 2.5 · Propose-verify (optional)SGCR-style alternative suggestions z RAG verification (anti-hallu)+30-60 secAdditional vetted findings
Pass 3 · AggregateDedupe, severity ranking, format markdown/JSON~1 secFinal review output

RAG corpus (1968 chunks)

SourceChunksWhy
api.drupal.org core docs~800Hook signatures, service interfaces, deprecation guidance
Drupal coding standards~150PHP style, naming conventions, file headers
Top-200 contrib modules (sample)~400Real-world patterns (paragraphs, webform, pathauto, etc.)
OWASP cheatsheets~200Generic web security context (SQLi, XSS, CSRF)
Drupal core security commits~250Historical bugs + fixes (for pattern matching)
Hook + #[Hook] migration patterns~70D11.1+ OOP refactor guidance
Custom (user-ingested via UI)opt-inYour codebase, style guides, internal docs

Drupal idiom detectors (Pass 0)

Benchmarks (honest)

TestRecallPrecisionNotes
Controlled benchmark (10 obvious bugs)100%n=48 synthetic cases across 12 modules
Curated Drupal contrib MRs (n=30)18.7%14.5%115 inline maintainer comments as ground truth
Blind Drupal core MR (z propose-verify)17.6%30%Verified by core maintainers
Realistic ceiling 25-30% recall — 60-70% maintainer comments to subjective discussions niemożliwe do automatycznego matchowania. Model jest complementem maintainer review, nie replacementem. Bonus: znajduje rzeczy które maintainer przegapił (DI violations, deprecations, race conditions).

Stack

Full architecture: docs/ARCHITECTURE.md on GitHub

Edit on GitHub