Agent-Review Core: config + index + learning layers#1858
Conversation
Bundle sizes [mpdx-react]Compared against 63a8a1c
|
…back/learn/learnings/approve/reject)
PR #1858 Dogfood Review: Agent-Review Engine (Reviewer Reviewing Itself)Executive summaryThe agent-review engine is a well-built, unusually well-tested piece of multi-repo review tooling: cleanly layered pure-core modules, 58 passing node:test cases, consistent CommonJS, escaped regexes, and shell-free BLOCKING1. Review command runs model-emitted bash (sed auto-fixes) via 2. Agent over-selection from trigger keywords inside the reviewer's own rule docs (sev 6, dogfood — see meta section) 3. 4. Two parallel CLI dispatchers with duplicated logic and divergent yarn wiring (sev 5, architecture) 5. Command gates engine features by grepping raw 6. 7. User-controlled 8. 9. Index path is hardcoded, ignoring IMPORTANT10. 11. Numeric CLI flags accept NaN with no validation, fail silently (sev 5, standards) 12. 13. CLI command dispatch largely untested (sev 3, testing) 14. 15. Config/learnings rule-doc paths read and injected into prompts without a path-traversal guard (sev 3, security) 16. Bad/shallow git state crashes commands with a raw error (sev 3, architecture) MINOR17. 18. Lazy 19. 20. Unvalidated 21. Empty-diff / zero-files edge uncovered for 22. 23. Language/alias support hardcoded across Dogfood / self-review meta-findingsRunning the reviewer's own engine on this PR surfaced two configuration/scoping bugs that the engine's design invites when the thing under review is the engine itself (or any repo where rule/doc prose overlaps with code-trigger vocabulary):
Both meta-findings share a theme the specialists corroborated: the engine's file-set and trigger definitions are not context-aware (they treat doc markdown like source) and its critical-path config is coarse ( What's solid
|
- content triggers skip prose (.md), the reviewer's own config/rule definition files, and package-manager artifacts (.yarn/.pnp/lockfiles) — fixes agent over-selection - scope .claude/** critical pattern to harness-integrity files; engine source is ordinary code (risk de-inflated 275->82 on this PR) - plan/impact parseArgs no longer swallow the token after a boolean flag; flag() rejects flag-as-value; NaN guards on --min-support/--max-depth/--max-nodes - review run: scope default single_feature (+ --scope), index.path from config, linesChangedFromStat reused, mode validated, --base ref validated, friendly git errors - config get <dot.path> subcommand; loadFeedback skips malformed JSONL - config.schema.json constrains rule paths; + regression tests (65 pass)
- #23 config-driven import graph: resolveImport/buildGraph/indexStore take aliases/ extensions/roots from config.index (defaults preserved); schema + tests - #4 single arg parser (engine/args.cjs) used by plan/impact/indexStore/learningsStore (no more 4 divergent parsers); review:* scripts repointed to the cli.cjs dispatcher; cli index --force - #5 command gates index/learning via 'review config get', not raw grep of config.yml - #1 auto-fix apply_all.sh now DRY-RUNS untrusted model-generated scripts; applies only with --yes - 68 tests pass
Resolve code-review.md conflict; prettier-format the review engine files. Claude-Session: https://claude.ai/code/session_01Q2jTiajZG4YmVb6ovhmn9V
Agent-Review Core: config + index + learning layers
Upgrades the
agent-reviewreviewer toward Greptile/CodeRabbit-class capabilities by extracting a clean, file-based, UI-ready review core under.claude/review/. Claude Code remains the orchestrator (no separate API billing); the debate/consensus stages are unchanged.What's included (3 phases, TDD, 51 passing tests)
Phase A — Declarative config layer
config.yml+config.schema.json(ajv-validated) +rules/*.mdprofiledial, exclusions — all migrated from the prosecode-review.mdinto declarative configloadConfig,scoreRisk,selectAgents,resolveRules,detectSpecial,plan.cjsPhase B — Persistent codebase index (impact analysis)
resolveImport,buildGraph,queryImpact,indexStore(gitignored, HEAD-keyed cache),impact.cjsPhase C — Feedback-learning loop (approval-gated)
findingSignature,mineLearnings,applyLearnings,learningsStore+review:feedback/review:learnscriptsfeedback.jsonl,learnings.yml); transients gitignoredImplementation notes
node:testrunner (yarn test:review) — 51 tests passyaml,minimatch,ajv(tooling only)docs/superpowers/lint:tsfailures in CI are pre-existing app codegen gaps (the.claude/reviewengine is outside tsconfig scope)🤖 Built with Claude Code (brainstorm → spec → plan → subagent-driven implementation).