Li Liu
e3fd28c0f0
feat: omniscient audit + tightened reviewer/structurizer/analyzer prompts
...
Major changes:
1. Audit (verifyIssues) rewrite — now THE final judge instead of a severity-recalibrator:
- Inputs structured issues + Task line with PR URL (audit fetches diff itself via
`gh pr diff` + Read/Grep/Glob). Does NOT consume reviewer chat or pre-stuffed diff.
- Output schema extended: verdict (keep/rewrite/drop/new), body, evidence, reason.
- Can DELETE false positives (not just downgrade), REWRITE weak descriptions, ADD
missed issues — especially cross-file pattern repetition.
- Optional .magpie-house-rules.md picked up from cwd as authoritative repo conventions.
- New config block `audit:` with claude-opus-4-7 + max effort by default.
2. Reviewer prompts (Round 1 + Round 2):
- Add severity vocabulary at reviewer stage (was only at structurizer before).
- Add reverse rubric: do NOT report build script polish, missing comments, forward-
compat hypotheticals, style preferences, theoretical-but-impossible cases.
- Require file:line + code quote + failure scenario for every issue.
- Drop "Review EVERY file / don't stop early" — brevity over completeness.
- Round 2: drop "find what others MISSED" anti-pattern; agreeing is fine.
3. Structurizer:
- line field now REQUIRED (drop issues that can't be anchored to a hunk line).
- Description must capture WHY + FAILURE scenario + FIX (so audit has basis to verify).
- Drop "STRICT — choose LOWER" severity bias.
4. Analyzer: add 6th "建议的 review 重点" section; parseFocusAreas now matches
English + Chinese headings, with-/no-space, bold variant; handles `-` `*` `•`
`·` ①-⑳ `1.`/`1、`/`1)` bullets.
5. Convergence judge: fix parse bug (verdict swallowed by trailing punctuation);
explicit one-word verdict format constraint.
Schema additions:
- MergedIssue: verdict, body, evidence, auditReason
- MagpieConfig: audit?: ReviewerConfig
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-26 22:34:33 +00:00
Li Liu
6862947368
test: drop obsolete summaries assertion after summary-step removal
...
The per-reviewer summary step was removed in 0f03726 , dropping the
summaries field from DebateResult, but this test still asserted on it
and failed. Remove the stale assertion.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-26 14:30:06 -07:00
Li Liu
629ed8b00e
feat: add --fail-fast option to abort review/discuss on any reviewer failure
...
By default the orchestrator is resilient: a single reviewer (or context
gatherer) failure is logged and the round continues with the survivors,
aborting only when all reviewers fail.
The new --fail-fast flag flips to strict mode — any reviewer or
context-gathering failure re-throws immediately and terminates the
whole flow. Wired through the review and discuss commands via
OrchestratorOptions.failFast, with a regression test and README docs.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-26 14:30:06 -07:00
Li Liu
6bc75ca3ea
fix: single reviewer failure no longer terminates entire review session
...
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-05 13:53:05 +08:00
Li Liu
2b0e1ba711
refactor: comprehensive codebase improvements across 7 phases
...
Phase A - Quick fixes:
- Remove debug logging that leaked prompt content (qwen-code)
- Fix orchestrator session leak with try/finally cleanup
- CJK-aware token estimation for better accuracy
- Issue parser validation (line > 0, endLine >= line, non-empty fields)
- Improved similarity matching with stop words filtering and description weight
Phase B - Medium fixes:
- Add retry utility with exponential backoff for API providers
- Config validation at load time (required fields, empty API key warnings)
- GitHub PR comment deduplication (skip already-posted comments)
- Ctrl+C graceful exit for interactive comment review
Phase C - Structured logging:
- Logger class with debug/info/warn/error levels (MAGPIE_LOG_LEVEL env var)
Phase D - Type safety:
- Replace `any` types with proper types across discuss.ts, review.ts,
issue-parser.ts, commenter.ts, repo-orchestrator.ts, history-collector.ts
Phase E - Session helper extraction:
- CliSessionHelper class shared by 4 CLI providers, reducing duplication
Phase F - Split review.ts (1991 → 6 files):
- review.ts (command + action), interactive.ts, repo-review.ts,
session-cmds.ts, utils.ts, types.ts
Phase G - Tests:
- 6 new test files (retry, logger, session-helper, issue-parser-enhanced,
loader-validation, orchestrator-session)
- Fix pre-existing test failures (commenter, anthropic)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-02-25 22:46:46 +08:00
Li Liu
d3a3be9a19
feat: add dynamic focus broadcast from analyzer to reviewers
...
Add parseFocusAreas to extract suggested review focus from analyzer
output and inject them as hints into each reviewer's first-round
prompt. Focus areas are suggestions, not constraints — reviewers are
explicitly told to also flag anything else they notice.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-02-12 19:40:24 +08:00
Li Liu
eccc867e6a
feat: add issue parser with deduplication
...
Add parseReviewerOutput to extract structured issues from reviewer
JSON blocks and deduplicateIssues to merge similar issues across
multiple reviewers using Jaccard similarity on title words.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-02-12 19:27:17 +08:00
Li Liu
e0b6f53ceb
feat: add ReviewIssue, ReviewerOutput, MergedIssue types
...
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-02-12 19:21:23 +08:00
xiaofanluan
7cccacdc51
feat: add repository-wide code review with feature analysis
...
Implement full repository review mode that detects logical features/modules
and reviews them systematically with session persistence for pause/resume
capability.
Key additions:
- RepoScanner: scans codebase and estimates tokens/cost
- FeatureAnalyzer: AI-powered detection of logical modules
- FeaturePlanner: creates review execution plan
- StateManager: persists sessions for resume capability
- RepoOrchestrator: executes feature-by-feature reviews
- MarkdownReporter: generates review reports
New CLI options: --repo, --quick, --deep, --list-sessions, --session,
--export, --path, --ignore, --plan-only, --reanalyze
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-01-27 22:58:22 +08:00
Li Liu
933a2d597e
feat: add PR analyzer step before debate
2026-01-26 13:08:57 +08:00
Li Liu
3f038cef4d
feat: add debate orchestrator with round management
...
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-01-26 12:32:11 +08:00