Review quality: PR context and deduplication hash fix #53

Closed
opened 2026-07-18 03:25:28 +00:00 by coding-agent-marvin8 · 1 comment
coding-agent-marvin8 commented 2026-07-18 03:25:28 +00:00 (Migrated from codeberg.org)

Agents currently receive only the diff (and optionally full file contents). Without the PR title and description, they lack the intent behind the change, causing false positives. Additionally, the deduplication hash currently uses only path:line, permanently suppressing comments even when the code at that line changes in a subsequent push.

This is a quality-of-life improvement that:

  1. Fetches PR title and description metadata and includes it in every agent's prompt
  2. Fixes the dedup hash to include diff-hunk content so comments re-trigger when code changes
Agents currently receive only the diff (and optionally full file contents). Without the PR title and description, they lack the intent behind the change, causing false positives. Additionally, the deduplication hash currently uses only path:line, permanently suppressing comments even when the code at that line changes in a subsequent push. This is a quality-of-life improvement that: 1. Fetches PR title and description metadata and includes it in every agent's prompt 2. Fixes the dedup hash to include diff-hunk content so comments re-trigger when code changes
coding-agent-marvin8 commented 2026-07-18 03:25:36 +00:00 (Migrated from codeberg.org)

Plan summary:

  1. PR title/description: Add PRInfo dataclass in forgejo.py, refactor get_pr_head_sha()get_pr(), thread pr_info through Router.review()BaseAgent.review(), prepend a markdown header block above the diff in each agent's prompt. Error handling: if PR fetch fails, log warning and continue without context.

  2. Dedup hash: Add _hunk_text() to diff.py for Hunk serialization. Update _content_hash(), build_marker(), append_marker(), is_duplicate() in comments.py to accept hunk_content: str. Add _find_hunk_for_line() to main.py, wire hunk content through _resolve_positions().

Both changes are surgical — no new files, no new abstractions. Full TDD throughout.

Spec: .superpowers/specs/2026-07-18-review-quality-design.md
Plan: .superpowers/plans/2026-07-18-review-quality.md

**Plan summary:** 1. **PR title/description:** Add `PRInfo` dataclass in `forgejo.py`, refactor `get_pr_head_sha()` → `get_pr()`, thread `pr_info` through `Router.review()` → `BaseAgent.review()`, prepend a markdown header block above the diff in each agent's prompt. Error handling: if PR fetch fails, log warning and continue without context. 2. **Dedup hash:** Add `_hunk_text()` to `diff.py` for Hunk serialization. Update `_content_hash()`, `build_marker()`, `append_marker()`, `is_duplicate()` in `comments.py` to accept `hunk_content: str`. Add `_find_hunk_for_line()` to `main.py`, wire hunk content through `_resolve_positions()`. Both changes are surgical — no new files, no new abstractions. Full TDD throughout. Spec: `.superpowers/specs/2026-07-18-review-quality-design.md` Plan: `.superpowers/plans/2026-07-18-review-quality.md`
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
marvin8/wuming#53
No description provided.