Skip to content

feat: let review agents sum pull requests up in their descriptions - #336

Merged
kalaspuff merged 10 commits into
mainfrom
fctl/507-when-configuring-review-agents-for-a-pro
Oct 29, 2026
Merged

kalaspuff merged 10 commits into
mainfrom
fctl/507-when-configuring-review-agents-for-a-pro

Conversation

@fctl-sh

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

Copy link
Copy Markdown
Contributor

Summary

A project's owners can now have its review agents sum each pull request up at the end of its description before they review it in depth: how risky what it sets out to do looks, what it does, and what deserves a closer look. It's a new review agent setting, off by default: Reviews → Settings → Summary in the description, fctl review settings --description-summary on, or description_summary in the API. The agent judges the risk from what the change does and where, not from bugs it may find later. The note is a GitHub alert: a note at low and medium risk, a warning at high risk, and a caution when a serious security problem shows at first sight.

The review agent still only reads on GitHub. It hands its summary to the control plane with a new in-sandbox command, fctl review summarize summary.json, and the control plane writes the description. The control plane reads the description just before writing it and replaces only what lies between <!-- FCTL_REVIEW_SUMMARY --> and <!-- /FCTL_REVIEW_SUMMARY --> (each on a line of its own), or adds the section at the end after a blank line. Marks inside code blocks, or within a line, stay as text, and a code block the description leaves open is closed first. Each new review replaces the summary. When a review posts, fctl puts its summary back if something removed or changed it meanwhile, since fctl's own agents rewrite their descriptions as they push; those agents are now also told to keep that part. Reviews keep their summary too: the Reviews tab shows each review's risk, and a review session's page shows the summary in its transcript and its risk in the rail. ADR 0067 records the design.

I verified it with unit tests for the splicing (code blocks, CRLF line endings, missing and duplicate marks, an unclosed fence), the checks on the agent's text and the layout, and with GitHub's Markdown API, which renders the section as intended. In cargo xtask dev, the setting round-trips through the CLI and API, and fctl review summarize gets its answers from fctl-agent and the control plane up to the GitHub call. The dev stack has no GitHub App, so the description edit itself hasn't run against GitHub yet. cargo xtask check lint, test and web pass. Deploying applies D1 migration 0040. A host from before this change runs an fctl-agent that refuses the new call; its review agents are told to carry on, so their reviews get no summary until the host updates.

What it adds to a description

An example, as GitHub renders it (the real one also links the review session, the commit and the settings):


Note

Medium risk. It changes how the upload worker retries, which every sync goes through, though only for uploads that fail.

What it does. Makes the upload worker give up after five failed attempts and wait longer between them, so that a server that stays down no longer keeps the worker busy for good.

Config rename. retry_ms becomes retry_delay_ms, and existing configs keep working through an alias.

fctl review's first look at 3f2a1c9 · 3 files, +120 −4 · Review agent settings

Screenshots

At 7a26dc1, in cargo xtask dev with the review agents' settings, reviews and a review's transcript staged (the dev stack has no GitHub App). The settings with the summary turned on, which shows what it adds:

settings-light.png

The Reviews tab: the status says so, and each review shows the risk it saw (amber when high, red only when critical):

reviews-light.png

A review session's page, light and dark: the summary in the transcript as it reads on GitHub, and the first look in the rail:

session-light.png

session-dark.png

At a phone's width (390 px):

The review session's transcript at a phone's width

Related

Worth confirming

  • Decision: It's off by default, for new projects and existing ones: it edits descriptions that other people own, so owners turn it on.
  • Decision: The note has a look of its own, as you asked: "Medium risk.", "What it does." and the highlight's topic lead their paragraphs in bold, as in fctl's findings, rather than "Medium Risk" and "Overview" on lines of their own. A last line fctl writes itself says which commit it describes, the files and lines changed, and links the review and its settings.
  • Decision: A Markdown parser (pulldown-cmark) reads the agent's text as GitHub will, and only text, inline code and emphasis pass. Lists, headings, code blocks, tables, images, HTML, links (link definitions and bare addresses included), @-mentions and email addresses are refused; GitHub's own references such as Hosts keep sandboxes of deleted sessions and retry their uplinks #12 still link. The summary is kept short: a paragraph for the risk, two at most for what it does, and an optional highlight. That way it reads at a glance, can't break out of its note, and a pull request that steers the agent can't have fctl link people elsewhere or notify them from the description.
  • Decision: Every review rewrites the summary, a review someone asks for again on the same commit included. A summary someone deletes comes back when the review posts and with the next commit's review; to stop it, owners turn the setting off.
  • Assumption: "Update the existing one if there's been new comments since the last review" meant new commits. Reviews run for each new commit (or when someone asks), and only a review refreshes the summary; new comments alone don't.

fctl session

fctl-sh Bot added 5 commits October 29, 2026 17:15
Where a project's owners turn it on, a review agent first sums the pull
request up (how risky it looks, what it does, what deserves a closer
look) with fctl review summarize, and the control plane puts it at the
end of the description between fctl's marks, in place of an earlier
review's, leaving the rest as it is. As the review posts, fctl puts it
back where something took it out meanwhile.
@fctl-review

This comment has been minimized.

Comment thread crates/fctl-domain/src/reviews.rs Resolved
Comment thread crates/fctl-domain/src/reviews.rs Resolved
…nks and mentions

A code span that one line opened and the next closed hid HTML and images
from the check of each line, as did one that ran from a highlight's topic
into its text, which share a paragraph. fctl now checks each paragraph as
the note lays it out, and refuses links and @-mentions outside code, so
that a pull request that steers the review agent can't have fctl's app
link people elsewhere or notify them from its description.
@fctl-review

This comment has been minimized.

Comment thread crates/fctl-domain/src/reviews.rs Resolved
Comment thread crates/fctl-domain/src/reviews.rs Resolved
Comment thread crates/fctl-domain/src/reviews.rs Resolved
Comment thread crates/fctl-domain/src/reviews.rs Resolved
fctl-sh Bot added 2 commits October 29, 2026 17:49
…does

Checking each line by hand missed what GitHub reads otherwise: escaped
backticks, which open no code span, runs of backticks of another length,
which close none, link definitions, which link words anywhere in the
description, and list markers before a tab, while it refused #12 at a
line's start as a heading. pulldown-cmark now reads the summary's
paragraphs together and lets only text, inline code and emphasis pass,
refusing words in brackets that a definition would link, addresses,
@-mentions and email addresses in its text.
…ring-review-agents-for-a-pro

# Conflicts:
#	crates/fctl-proto/src/event.rs
#	docs/cli.md
#	docs/llms.txt
#	web/src/gen/Notice.ts
kalaspuff pushed a commit to hyperstructure/fctl-site that referenced this pull request Oct 29, 2026
## Summary

The privacy policy now says what app.fctl.sh keeps and posts when a
project's review agents sum pull requests up in their descriptions, a
new setting in hyperstructure/fctl: whether the setting is on, the
summary each review put in the description (how risky the pull request
looked, why, what it does and what deserved a closer look), and that
review agents may write that summary at the end of a pull request's
description on GitHub. Merge it with the fctl change; the `updated` date
is already today's.

- hyperstructure/fctl#336

[fctl session](https://app.fctl.sh/s/ses_01M648ZXW9H2DW0A36A3AQSE10)

---------

Co-authored-by: fctl-sh[bot] <fctl-sh[bot]@users.noreply.github.com>
@kalaspuff
kalaspuff merged commit 60e721d into main Oct 29, 2026
10 checks passed
@kalaspuff
kalaspuff deleted the fctl/507-when-configuring-review-agents-for-a-pro branch October 29, 2026 19:08
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