You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
revert: remove git_diff injection for broad review rules
The git_diff_output feature on ReviewTask (REVIEW-REQ-004.11,
REVIEW-REQ-005.7) added complexity without sufficient benefit.
Removes the field, helper functions, spec requirements, and tests.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: specs/deepwork/review/REVIEW-REQ-004-rule-matching-and-strategies.md
+1-10Lines changed: 1 addition & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ After discovering review rules (REVIEW-REQ-002) and changed files (REVIEW-REQ-00
19
19
### REVIEW-REQ-004.2: Review Task Data Model
20
20
21
21
1. Each review task MUST be represented as a `ReviewTask` dataclass.
22
-
2. The `ReviewTask` MUST contain: `rule_name` (str), `files_to_review` (list[str] — paths relative to repo root), `instructions` (str), `agent_name` (str | None), `source_location` (str — formatted as `"path:line"`), `additional_files` (list[str] — unchanged matching files, relative to repo root), `all_changed_filenames` (list[str] | None), `git_diff_output` (str | None — pre-fetched diff for broad rules, see REVIEW-REQ-004.11).
22
+
2. The `ReviewTask` MUST contain: `rule_name` (str), `files_to_review` (list[str] — paths relative to repo root), `instructions` (str), `agent_name` (str | None), `source_location` (str — formatted as `"path:line"`), `additional_files` (list[str] — unchanged matching files, relative to repo root), `all_changed_filenames` (list[str] | None).
23
23
3.`files_to_review` MUST always contain at least one file path.
24
24
4.`source_location` MUST be formatted as `"{relative_path}:{line_number}"` where the path is relative to the project root (e.g., `"src/.deepreview:5"`).
25
25
@@ -71,12 +71,3 @@ After discovering review rules (REVIEW-REQ-002) and changed files (REVIEW-REQ-00
71
71
1. Rules with the same name defined in different `.deepreview` files MUST produce independent `ReviewTask` objects. The system MUST NOT merge or combine matched files across rules from different source directories.
72
72
2. When two `.deepreview` files in different directories define a rule with the same name and the same strategy, and changed files match both rules, the system MUST create separate `ReviewTask` objects — one per directory — each containing only the files that matched within its own `source_dir`.
73
73
3. This isolation is a consequence of REVIEW-REQ-004.1.2 (files outside `source_dir` do not match) but is stated explicitly because `.deepreview` files can be templated or symlinked across directories, making same-name rules a common scenario.
74
-
75
-
### REVIEW-REQ-004.11: Git Diff Injection for Broad Rules
76
-
77
-
1. When a rule has strategy `"all_changed_files"` or `"matches_together"` AND its `include` patterns contain `**/*`, the system MUST run `git diff <merge-base>..HEAD` and attach the output to the resulting `ReviewTask` as `git_diff_output`.
78
-
2. The git diff MUST be computed at most once per unique `source_dir` per `match_files_to_rules` invocation, even if multiple rules with the same `source_dir` qualify for injection.
79
-
3. If the git diff command fails or produces empty output, `git_diff_output` MUST be `None`.
80
-
4. Rules with strategy `"individual"` MUST NOT receive `git_diff_output`, regardless of their include patterns.
81
-
5. The `ReviewTask` dataclass MUST include a `git_diff_output: str | None` field defaulting to `None`.
82
-
6. When a rule's `source_dir` is a subdirectory of the project root, the git diff MUST be scoped to that subdirectory (via `-- <relpath>` pathspec). When `source_dir` equals the project root, the diff MUST cover the entire repository.
Copy file name to clipboardExpand all lines: specs/deepwork/review/REVIEW-REQ-005-instruction-generation.md
-7Lines changed: 0 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,13 +16,6 @@ For each `ReviewTask`, the system generates a self-contained markdown instructio
16
16
6. When the task has `additional_files` (unchanged matching files), the file MUST contain an "Unchanged Matching Files" section listing those file paths.
17
17
7. When the task has `all_changed_filenames`, the file MUST contain an "All Changed Files" section listing every changed filename for context.
18
18
19
-
### REVIEW-REQ-005.7: Git Diff Section
20
-
21
-
1. When a `ReviewTask` has a non-null `git_diff_output`, the instruction file MUST contain a section headed `## Output from \`git diff main..HEAD\` for you to review (sorted by filepath)`.
22
-
2. The diff output MUST be rendered inside a fenced code block with the `diff` language tag.
23
-
3. This section MUST appear after the "Files to Review" section and before the "All Changed Files" section.
24
-
4. When `git_diff_output` is `None`, this section MUST be omitted.
25
-
26
19
### REVIEW-REQ-005.2: File Path Formatting
27
20
28
21
1. File paths in the "Files to Review" section MUST be prefixed with `@` to trigger Claude Code's file-reading behavior (e.g., `@src/app.py`).
0 commit comments