Inline review: post findings as line-anchored comments with suggested fixes #1529

Closed
opened 2026-10-27 13:40:46 +00:00 by sam · 0 comments
Owner

Findings currently reach the operator only as a flat PR-body list (renderPRReviewSection). A real reviewer anchors each finding to the line it is about, and attaches a replacement when the fix is mechanical so it can be applied in one click. Both are missing: forge.Forge.Comment posts to the PR conversation (Issues.CreateComment), nothing creates a review comment at path+line; and ReviewFinding has no Suggestion field.

Decided (docs/prds/review-inline-comments.md):

  • New type-asserted ReviewCommentWriter{CreateReviewComment(ctx, owner, repo, number, commitID, path, line, body)}. GitHub: PullRequests.CreateComment{Body,Path,Line,Side:RIGHT,CommitID}. Gitea: no direct inline call -- submit a COMMENT-state review carrying the comments.
  • ReviewFinding gains optional Suggestion, rendered as a GitHub fenced suggestion block. ONLY on confirmed findings (a wrong one-click fix is worse than none); this reuses the h019.5 calibration rule. Single-line for v1.
  • Only line-anchored findings (Line > 0) post inline; whole-file findings stay in the body list, which remains the complete record.
  • New best-effort StagePostReviewComments AFTER StageOpenPR: read the h019.6-stashed tc.ReviewReport, resolve the head SHA via PullRequestReader.GetPullRequest (h019.8), post each finding. Failures log, never fail the task (the PR is already open; the body section is the backstop).
  • No separate opt-in flag; repo.review_enabled already gates it.

Out of scope: the blocking/parked case (no PR exists), thread resolve/dismiss (8li9 territory), multi-line suggestions.

Notes

SHIPPED for review: PR #891 (https://github.com/samcharles93/archie-core/pull/891), branch feat/q9au-inline-review-comments, commit 7d813e4d. 17 files, +954/-31. task check exit 0 (incl. 229 UI tests); three mutations of the new stage logic each fail a named test. Two PRD departures, both recorded in docs/prds/inline-review.md: the writer interface is batch (Gitea's only inline shape is one submitted review, and the set crosses NATS once), and the anchor head SHA is resolved inside each forge implementation because the stage runs in archie-agent, which holds no forge credentials. Not closing until the PR merges.

Close reason

LANDED on main: squash-merged as e0b6aa61 (PR #891), including the head-drift review fix (ReviewedHeadSHA present in main). Feature: ReviewFinding.Suggestion + Validate gate, StagePostReviewComments after StageOpenPR, forge.ReviewCommentWriter (GitHub per-comment loop with joined failures, Gitea single COMMENT-state review), workflow.Forger + forgerpc create_review_comments, reviewer prompt/tool schema. Evidence: task check exit 0 on the exact commit; three mutations of the stage logic each caught by a named test.


Imported from beads archie-core-q9au · GitHub #811 · type feature · priority P2 · created 2026-09-11 · closed 2026-09-19

Findings currently reach the operator only as a flat PR-body list (renderPRReviewSection). A real reviewer anchors each finding to the line it is about, and attaches a replacement when the fix is mechanical so it can be applied in one click. Both are missing: forge.Forge.Comment posts to the PR conversation (Issues.CreateComment), nothing creates a review comment at path+line; and ReviewFinding has no Suggestion field. Decided (docs/prds/review-inline-comments.md): - New type-asserted ReviewCommentWriter{CreateReviewComment(ctx, owner, repo, number, commitID, path, line, body)}. GitHub: PullRequests.CreateComment{Body,Path,Line,Side:RIGHT,CommitID}. Gitea: no direct inline call -- submit a COMMENT-state review carrying the comments. - ReviewFinding gains optional Suggestion, rendered as a GitHub fenced suggestion block. ONLY on confirmed findings (a wrong one-click fix is worse than none); this reuses the h019.5 calibration rule. Single-line for v1. - Only line-anchored findings (Line > 0) post inline; whole-file findings stay in the body list, which remains the complete record. - New best-effort StagePostReviewComments AFTER StageOpenPR: read the h019.6-stashed tc.ReviewReport, resolve the head SHA via PullRequestReader.GetPullRequest (h019.8), post each finding. Failures log, never fail the task (the PR is already open; the body section is the backstop). - No separate opt-in flag; repo.review_enabled already gates it. Out of scope: the blocking/parked case (no PR exists), thread resolve/dismiss (8li9 territory), multi-line suggestions. ### Notes SHIPPED for review: PR #891 (https://github.com/samcharles93/archie-core/pull/891), branch feat/q9au-inline-review-comments, commit 7d813e4d. 17 files, +954/-31. task check exit 0 (incl. 229 UI tests); three mutations of the new stage logic each fail a named test. Two PRD departures, both recorded in docs/prds/inline-review.md: the writer interface is batch (Gitea's only inline shape is one submitted review, and the set crosses NATS once), and the anchor head SHA is resolved inside each forge implementation because the stage runs in archie-agent, which holds no forge credentials. Not closing until the PR merges. ### Close reason LANDED on main: squash-merged as e0b6aa61 (PR #891), including the head-drift review fix (ReviewedHeadSHA present in main). Feature: ReviewFinding.Suggestion + Validate gate, StagePostReviewComments after StageOpenPR, forge.ReviewCommentWriter (GitHub per-comment loop with joined failures, Gitea single COMMENT-state review), workflow.Forger + forgerpc create_review_comments, reviewer prompt/tool schema. Evidence: task check exit 0 on the exact commit; three mutations of the stage logic each caught by a named test. --- _Imported from beads `archie-core-q9au` · GitHub #811 · type feature · priority P2 · created 2026-09-11 · closed 2026-09-19_
sam added the mediumfeature labels 2026-10-27 13:40:46 +00:00
sam self-assigned this 2026-10-27 13:40:46 +00:00
sam closed this issue 2026-10-27 13:40:46 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1529