revu-ai 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,30 @@
2
2
 
3
3
  All notable changes to `revu-ai` are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this project's pre-1.0 versioning treats minor bumps as breaking-change boundaries.
4
4
 
5
+ ## 0.4.2
6
+
7
+ ### Added
8
+
9
+ - **System prompt now states rule-file precedence explicitly.** Operators occasionally
10
+ need a rule to override a system-prompt default (e.g. broaden scope past the diff for a
11
+ full-repo audit). A new "Precedence" section at the top of the prompt tells the agent
12
+ that when the rule file contradicts the system prompt, the rule file wins. System-prompt
13
+ defaults apply only where the rule is silent.
14
+
15
+ ### Fixed
16
+
17
+ - **Findings must be caused by or required by the diff, not pre-existing issues elsewhere
18
+ in the repo.** Without an explicit scope constraint, agents would walk the broader
19
+ codebase via `Read`/`Grep` looking for instances of a rule's anti-pattern and file
20
+ findings against files the PR never touched — turning every enforcement of a
21
+ sufficiently-general rule (e.g. "no direct REST in components") into a review of the
22
+ whole repo. The new constraint allows findings on out-of-diff files when the diff
23
+ caused or invalidated them (a signature change that breaks an out-of-diff caller, a
24
+ contract the diff broke for pre-existing code, etc.), but pre-existing unrelated code
25
+ is out of scope. The test agents are given: "would this finding still apply if the diff
26
+ were reverted?". Out-of-diff `Read`/`Grep` for verification continues to be allowed.
27
+ Rule files may broaden this scope explicitly under the new precedence rule.
28
+
5
29
  ## 0.4.1
6
30
 
7
31
  ### Fixed
@@ -5,6 +5,10 @@ export function buildSystemPrompt(args) {
5
5
  return `You are a focused code reviewer for the rule "${args.ruleId}".
6
6
 
7
7
  You evaluate the changes ONLY through the lens of the rules in the <rules> block below. If the changes are unrelated to those rules, you must STILL call \`mcp__revu__report_review_summary\` to sign off — see the REQUIRED section at the bottom.
8
+
9
+ # Precedence
10
+
11
+ When the rule file in the <rules> block below contradicts something in this system prompt, the rule file wins. Operators author rule files knowing how reviews work in their codebase; treat the rule's own scope, severity guidance, and inspection instructions as authoritative whenever they're explicit. The system-prompt defaults apply only where the rule is silent.
8
12
  ${fileScopeBlock}
9
13
  # How to inspect the changes
10
14
 
@@ -62,6 +66,7 @@ Do the summary call LAST, then stop.
62
66
 
63
67
  - Do NOT modify any files.
64
68
  - Do NOT report findings outside the scope of the <rules> below.
69
+ - Every finding must be *caused by* the diff or *required as a consequence of it*. The PR is the lens, not the codebase. Most of the time that means the finding lives on a line the diff touches; occasionally it means an untouched file that the diff just broke, an out-of-diff call site that needs updating to match a signature change, or pre-existing code whose contract the diff has now invalidated. The test is "would this finding still apply if the diff were reverted?" — if yes, it's a pre-existing issue, not a finding for this review. You may \`Read\`/\`Grep\` out-of-diff files to verify either an in-diff finding or a downstream impact; you may not file findings about unrelated pre-existing code. (A rule file may explicitly broaden this scope — see precedence note above.)
65
70
  - Do NOT include a final assistant-text summary — put your sign-off in the \`report_review_summary\` tool call instead. The runner doesn't read your text output.
66
71
  - Do NOT delegate to subagents (no \`task\` / \`Task\` tool, no agent dispatch). Run every \`git\`, \`Read\`, \`Grep\`, \`Glob\` call yourself in this session — subagent calls run silently to the runner's progress log, give the impression of a stuck agent, and cost extra tokens for no review benefit. The single rule scope is small enough to review directly.
67
72
  - Do NOT skip the \`report_review_summary\` call. Even when you find nothing and the rule is irrelevant, the call is required.
@@ -1 +1 @@
1
- {"version":3,"file":"review-system.js","sourceRoot":"","sources":["../../src/prompts/review-system.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,iBAAiB,CAAC,IAOjC;IACC,MAAM,WAAW,GAAG,cAAc,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACtD,MAAM,UAAU,GAAG,wBAAwB,CAAC,IAAI,CAAC,CAAC;IAClD,MAAM,cAAc,GAAG,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAE/D,OAAO,iDAAiD,IAAI,CAAC,MAAM;;;EAGnE,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M,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;QACnC,OAAO;;oDAEyC,CAAC;IACnD,CAAC;IACD,OAAO;;wDAE+C,CAAC;AACzD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "revu-ai",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Parallel AI code review — pluggable agent harnesses (Claude Code, opencode); pick any provider/model",
5
5
  "type": "module",
6
6
  "bin": {