Skip to content

feat(control): put review summaries first, and hide them once addressed - #226

Merged
kalaspuff merged 4 commits into
mainfrom
fctl/152-the-review-agents-comment-about-finding
Oct 23, 2026
Merged

kalaspuff merged 4 commits into
mainfrom
fctl/152-the-review-agents-comment-about-finding

Conversation

@fctl-sh

@fctl-sh fctl-sh Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Review agents posted their summary ("fctl reviewed 484c057 and found 1 issue.") as the review's own text. GitHub's mobile app shows a review's text below its comments, so the summary came after the findings it sums up. And once later commits fixed those findings, the summary still said they were there.

What changed

  • The summary comes first. It's now a comment of its own on the pull request, posted just before one review that holds the findings on their lines and has no text of its own. GitHub lists items in the order they were posted, so the summary sits above the findings on the web and in the apps. Findings on lines the diff doesn't show still go in the summary. When none goes on its lines, there is no review, just the summary.
  • Later reviews say how an earlier summary's issues stand. When a later review marks an earlier review's findings fixed, or someone resolved their threads, it puts a line atop that review's summary:
    • all addressed: "Addressed as of 4d5e6f7. Later commits fixed the issue this review found." The summary is then hidden as outdated (GitHub's "This comment was marked as outdated", which anyone can unfold);
    • some addressed: "Partly addressed as of 4d5e6f7. Later commits fixed 1 of the 3 issues this review found.", and the summary stays shown;
    • threads people resolved count too: "…and the other was marked resolved."
  • How it tells which findings a summary sums up. Every comment fctl posts for a review now ends with a hidden note naming the review session, before the existing <!-- fctl review --> mark, for example <!-- fctl review: {"session":"ses_…","found":2} -->. A summary's note also counts the issues found, and how many later reviews last found fixed or resolved, so a summary is edited only when that changes.
  • Failures leave no strays. If GitHub refuses the review's lines (422), the summary is edited to hold all the findings. If the review fails otherwise, the summary is deleted, so the agent's next submission doesn't leave a second one.
  • The link fctl keeps for a review now points to the summary: the check's "The review", fctl review, and the session page's "View on GitHub".
  • fctl review submit and the review session's page say findings on lines the diff doesn't show went in "the review's summary", no longer "the review's text" (fctl's own review agent pointed this out here).
  • Docs: the architecture's Review agents section and ADR 0040 (a new decision bullet, and a consequence: two items, so two notifications).

Decisions worth a look

  • Two items instead of one. A review can't order its own parts, and GitHub's mobile app puts its text last. Two reviews would show two "reviewed these changes" events. So: a comment, then the review. People watching the pull request get two notifications per review with findings.
  • "Stale" means GitHub's Hide → Outdated (minimizeComment, OUTDATED). GitHub's dismissal is for approvals and change requests only, and fctl's reviews are comments.
  • A summary that holds findings in its own text is never hidden. Those findings have no thread that tells whether they were fixed. Its line still counts the ones that do.
  • No new permission. GitHub's comment endpoints accept the review token's pull_requests: write (they answer X-Accepted-GitHub-Permissions: issues=write; pull_requests=write). Hiding uses the same token; if GitHub refused it, the summary would still say it's addressed, and the control plane logs why. A COMMENT review with comments and an empty body is something GitHub takes (reviewdog posts them that way).
  • Reviews posted before this change keep their summary in the review, and later reviews leave it alone.

Overlap with #225

#225 (findings to the agent that opened the pull request) changes the same block of crate::reviews::post, plus fctl_domain::reviews, github.rs and the architecture doc, so whichever merges second needs a rebase. They fit together: the review is still posted by post_review, now after the summary, so #225 can take its id from there. PostedReview.url, which #225 passes on, becomes the summary's link.

How I verified it

  • Unit tests (fctl_domain::reviews: 3 new, 3 updated, 16 in all): what's posted (the summary's and findings' notes, the review's empty text, no review when every finding is in the text), the posting query and the summaries in GitHub's answer (only the app's own, with a note that counts issues), standings by thread (fixed, reopened, resolved by someone, other reviews' threads, never more than found), every status line, restating (only on change, once, back to as-posted when reopened), and an agent's text that holds fctl's marks. cargo xtask check passes.
  • End to end in cargo xtask dev, against a local stand-in for GitHub's API: a throwaway Node server and a bare repository, with the Worker pointed at it by a local patch. None of it is committed. Reviews were started with fctl review start, with fake-claude as the agent:
    1. First review: POST …/issues/12/comments (the summary), then POST …/pulls/12/reviews (a COMMENT review with empty text and the finding on app.js line 4). Both carry the session's note, and the check's "The review" links to the summary.
    2. Next commit: the finding was marked fixed and its thread resolved. The summary was restated ("Addressed as of a005f64. Later commits fixed the issue this review found.") and hidden as outdated. The check passed, and nothing new was posted.
    3. GitHub refused the review's lines (422): the summary was edited to hold the finding in its text, and later reviews left it shown.
    4. GitHub failed the review (502): the summary was deleted. fctl-agent reminded the agent, and its second submission posted one summary and one review.
    5. A thread resolved by hand: the next review restated that summary ("The issue this review found was marked resolved.") and hid it.
    6. After a fix commit (e64b8e0), the Worker was rebuilt and step 2 run again with the same result.
  • GraphQL names checked against GitHub's schema by introspection: updateIssueComment, minimizeComment with OUTDATED, and that IssueComment is Minimizable.

Screenshots

At 6a8608f. The GitHub ones are mocks, not GitHub itself: the comments' text is what this branch posts, rendered by GitHub's own Markdown API, in a page made to look like GitHub. The data is made up.

GitHub Mobile, as in the report. Before, the summary is the review's text, under its "1 comment". After, the summary is a comment of its own above the review:

Before After
Before: "fctl-sh[bot] reviewed these changes", "1 comment", then the summary below After: the summary first, then "fctl-sh[bot] reviewed these changes" with "1 comment"

Once a later commit fixed the issue (web): the summary is hidden as outdated, and shown again it says what happened:

The summary hidden as outdated, and shown again with "Addressed as of 4d5e6f7. Later commits fixed the issue this review found." above it

The review session's page, for a review whose finding went in its summary (from cargo xtask dev, review session #3 above). Before, then after in both themes:

Before: "1 in the review's text, on lines the diff doesn't show"
After: "1 in the review's summary, on lines the diff doesn't show", light
After, dark

fctl review submit, as the agent sees it:

 ✓ Posted 1 finding on GitHub: https://github.com/acme/web/pull/12#issuecomment-128
-  1 finding on lines the diff doesn't show went in the review's text.
+  1 finding on lines the diff doesn't show went in the review's summary.

Session: https://app.fctl.sh/s/ses_01M5K0XKKMG58QSHW55CJ3R59Y

fctl-sh Bot added 2 commits October 23, 2026 00:25
A review's summary ("fctl reviewed abc1234 and found 2 issues") was the
review's own text, which GitHub's mobile apps show below the review's
comments: after the findings it sums up. It is now a comment of its own,
posted before one review that holds the findings on their lines and no
text of its own, so it comes first everywhere.

Each later review then says atop the earlier summaries how the issues
they found stand (fixed by later commits, or resolved by someone), and
hides a summary as outdated once all its issues are addressed. It tells
a summary's findings by the review session that posted both, which fctl
notes out of sight in every comment it posts for a review.
…marks

A later review split an earlier summary at the first status mark it
found, which the agent's own text could hold. It splits there only once
the summary's note says a later review wrote a line atop it.
@fctl-sh
fctl-sh Bot requested a review from kalaspuff as a code owner October 23, 2026 00:35

@fctl-sh fctl-sh Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fctl reviewed e64b8e0 and found 1 issue.

On lines the diff doesn't show:

  • CLI and web still say findings went in the review's text · Low severity · crates/fctl/src/cmd/review.rs line 525: Findings on lines the diff doesn't show now go in the summary comment, since the review is posted with no text of its own. fctl review submit here and ReviewPostedNotice in web/src/components/review.tsx (line 56) still say "in the review's text".

Reviewed by fctl · Review agent settings

fctl-sh Bot added 2 commits October 23, 2026 00:38
The CLI and the session page said they went in the review's text, which
fctl's reviews no longer have: their summary holds them.
@fctl-sh

fctl-sh Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Fixed in 6a8608f, as the review found: fctl review submit now prints "… went in the review's summary." and the review session's page says "1 in the review's summary, on lines the diff doesn't show". The description shows both, before and after.

@kalaspuff
kalaspuff merged commit 3d9001d into main Oct 23, 2026
10 of 11 checks passed
@kalaspuff
kalaspuff deleted the fctl/152-the-review-agents-comment-about-finding branch October 23, 2026 06:33
fctl-sh Bot added a commit that referenced this pull request Oct 23, 2026
#226 posts a review's summary as a comment before the review that holds
its findings on their lines. The findings fctl passes on to the session
that opened the pull request now link that summary, and say that findings
on lines the diff doesn't show are in it; the review's id, for finding each
comment, comes from the review posted after the summary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant