Skip to content

docs(legal): say what follow-ups receive, keep and send - #46

Merged
kalaspuff merged 1 commit into
mainfrom
fctl/161-it-should-be-possible-to-configure-proje
Oct 23, 2026
Merged

kalaspuff merged 1 commit into
mainfrom
fctl/161-it-should-be-possible-to-configure-proje

Conversation

@fctl-sh

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

Copy link
Copy Markdown
Contributor

The privacy policy says what follow-ups receive, keep and send, for hyperstructure/fctl#228, which lets projects bring their agents back to the pull requests they opened: when someone who can write to the repository mentions @fctl or @agent in a comment, when a check fails, when a pull request merges or closes.

With follow-ups on in a project, app.fctl.sh:

  • receives comments and reviews on pull requests through the GitHub App's webhook (the app subscribes to Issue comment, Pull request review and Pull request review comment), and asks GitHub whether a comment's author may write to the repository;
  • keeps the comments it passes on to an agent (their text, link, and their author's GitHub login and picture), with failed checks and merges, in the session's transcript, and records each comment it passes on in the workspace's audit log, with its author's login and link;
  • sends them to the session's agent, and so to the Claude account it runs on, and posts an 👀 reaction on each comment it passes on, which everyone who can read the repository sees.

The changes:

  • Projects and sessions: the messages fctl sends agents include, where follow-ups are on, the comments that mention the agent (text, link, author's login and picture), failed checks and merges.
  • GitHub: the webhook also tells us about comments and reviews; which of them we keep and why.
  • Audit logs: each comment passed on, with its author's login and link.
  • Why we use it: a row for passing people's comments to agents and asking GitHub about their access (legitimate interests: letting the people a repository trusts direct its agents from GitHub, and nobody else).
  • GitHub (services you connect): the reaction on comments passed on.
  • Anthropic: what follow-ups pass on goes to the Claude account the session runs on.

Retention needs no change: follow-ups are part of the session's transcript, which goes with the project.

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

Where a project's follow-ups are on, app.fctl.sh receives comments on
pull requests through the GitHub App's webhook, asks GitHub whether their
authors may write to the repository, and passes those that mention an
agent, with their authors' GitHub logins and pictures, to the session that
opened the pull request, with its failed checks and its merge. The GitHub
App reacts to each comment it passes on, and the audit log records it.
@kalaspuff
kalaspuff merged commit 00cfb74 into main Oct 23, 2026
4 checks passed
@kalaspuff
kalaspuff deleted the fctl/161-it-should-be-possible-to-configure-proje branch October 23, 2026 12:25
kalaspuff pushed a commit to hyperstructure/fctl that referenced this pull request Oct 23, 2026
Projects can now bring their agents back to the pull requests they
opened (**follow-ups**): a comment that mentions the agent, a failed
check, a merge. Each reaches the session that opened the pull request in
a message from fctl, which resumes the session if it stopped, on the
Claude subscription it ran on, as a person's message would. Fixes #8, as
the session refined it: comments count only from people the repository
trusts, only when they address the agent, and only from people, not
apps.

## What it does

- **A project setting, three switches, all off** (Settings → **Pull
requests**, `fctl projects set --follow-ups comments,checks,closed` /
`all` / `none`, `ProjectSettings.follow_ups`). `fctl projects show` says
which are on. An update that leaves the field out (an older tab or CLI)
keeps what was stored.
- **Comments that address the agent**: a new comment on the
conversation, a review, or a comment on lines, that mentions `@fctl` or
`@agent` anywhere, or starts with `fctl:`, `agent:`, `fctl,` or `agent,`
(any case). Quotes (`>`), code (backticks, fenced blocks) and HTML
comments don't count, so people can quote a request or write `` `@fctl`
`` to explain it; edits don't count either. A review that addresses the
agent brings its comments on lines.
- **Only people the repository trusts**: the commenter must be a person
(GitHub's `User`, not a `[bot]`, so not fctl's own review agents, whose
findings already come back on their own path), with an
`author_association` of `OWNER`, `MEMBER` or `COLLABORATOR`, **and**
GitHub's permission endpoint must say they may write to the repository
(admin, maintain or write). A member of an organization who may only
read a public repository can't steer an agent that pushes. Everyone else
costs no GitHub call.
- **Failed checks**: after a `check_run`/`check_suite`/`status`
delivery, the lookup names the newest commit's failed checks (failed,
timed out or couldn't start, by each check's latest run, and failed or
errored statuses; cancelled runs and runs waiting for approval don't
count).
- **Merged or closed**: who merged or closed it (a merge queue's bot
counts as nobody) and into which branch.
- **Only fctl's own pull requests, to the session that opened them**,
chosen as for review findings (ADR 0041). Archived and failed sessions,
archived projects and agents that only read on GitHub get nothing.
- **How the agent hears of it**: the session gathers what comes for ten
seconds, so a review and its comments, which arrive as separate
deliveries, or checks that fail together, make one message per pull
request. The control plane writes it: who wrote what and where, quoted,
how to answer each where it was made (`gh pr comment`, or `gh api
…/comments/{id}/replies` in a thread); which checks failed, what still
runs, and how to look into them; after a merge, what may be left to do.
It says that only people who can write to the repository reach the agent
this way.
- **Failed checks don't nag**: they wait while a turn runs (the agent
may already be on them) and ten seconds more once it ends, then go only
while GitHub still says they are the newest commit's and failed. A newer
commit (the agent's or anyone's push) or a passing re-run drops them.
After **three in a row** while nobody messaged the agent, or wrote to it
on GitHub, the transcript says what failed instead, until someone does.
- **On GitHub**: an 👀 reaction on the comment once its session has it,
with a token for that repository alone, revoked right away. The
workspace's audit log records each comment passed on
(`follow_up.comment`).
- **In the app**: the transcript shows a follow-up as GitHub has it: the
commenter's avatar and login, what they wrote as Markdown (pictures as
links, since the app only loads images from where it trusts), a review's
verdict and its comments under their files, failed checks by name, a
merge, with **What fctl told the agent** a click away. Held checks show
muted, with why. A session's page says under its pull requests what
brings its agent back ("Mention @fctl or @agent on GitHub to bring the
agent back; failed checks and merges do too."). Settings say when the
instance takes no webhooks.

## Decisions worth a look

- **"Trusted users in the GitHub organization" became write access,
checked with GitHub.** The association alone would let read-only org
members of a public repository steer an agent that pushes and holds the
project's secrets. Write access is the bar the repository already sets
for changing its code.
- **Only deliveries bring agents back.** The hourly sweep that repairs
missed deliveries keeps pull requests current without waking anyone, so
turning follow-ups on, or a delivery that went missing, never wakes
sessions for what happened long ago.
- **Staleness is GitHub's word, not the sandbox's.** An earlier version
dropped failed checks when the agent had another commit checked out; a
person's push to the agent's branch makes that true too, so it now goes
by the pull request's head as GitHub reports it.
- **Merge conflicts** don't bring agents back: no delivery says when a
pull request starts to conflict with its base. It's in the roadmap.
- ADR 0043 records the reasoning.

## What instance admins need to do

Subscribe the GitHub App to **Issue comment**, **Pull request review**
and **Pull request review comment** (Permissions & events). No new
permission: the app reads and writes issues and pull requests already,
so installations accept nothing. **app.fctl.sh's app needs this change**
for comments; failed checks and merges work with the events it has.
Recent Deliveries answers `{"ok":true,"follow_ups":1}` for a comment
that reached an agent.

## Compatibility

All additive: `ProjectSettings.follow_ups`, `UserMessage.follow_up`,
`Notice.follow_up` (older clients show the message's text),
`Features.github_webhook`, and the internal `/follow-up` and
`PullRequestsSeen.follow_ups`. `FollowUpEvent` reads kinds a newer
control plane adds as `other` instead of failing the event. No
migration: the session object's `follow_ups` table is created `IF NOT
EXISTS`. Older hosts and agents take follow-ups as any message;
fake-claude answers them on its own, so their words set off none of its
behaviors.

## A bug this found on the way

GitHub's GraphQL API names an app's bot without `[bot]` (`fctl-sh`, type
`Bot`), where REST says `fctl-sh[bot]`. The webhook lookups now ask for
the author's type and spell bots as REST does; without that, failed
checks of fctl's own pull requests would never have matched. I checked
it against #225 with the sandbox's token.

## How I verified it

- **Unit tests**: `fctl_domain::follow_ups` (16 tests: addressing, with
quotes, code spans, fences, HTML comments, emails, `@fctl-sh`, team
mentions; payload parsing of the three comment events; trust and write
access; keys; grouping; every message; the cap), webhook lookups (failed
check names, bot authors), settings that keep unsent follow-ups, the
proto wire format (and an unknown kind), the CLI flag, fake-claude, and
the web helpers and component (`follow-ups.test.ts`,
`follow-up.test.tsx`). `cargo xtask check` passes.
- **End to end in `cargo xtask dev`**, against a local stand-in for
GitHub's API and a bare repository standing in for `acme/web` (not
committed; the Worker pointed at it by a local patch I reverted), with
signed deliveries:
- **Ignored, each for its reason**: a bot (`renovate[bot]`), a
`CONTRIBUTOR`, a `MEMBER` GitHub says may only read (the only one that
cost a call), a comment without a mention, `@fctl` in backticks, a
quoted request; an archived session; a project with comments off.
- **A comment** from a member who can write: one message, the agent
answered, 👀 on the comment (token for `web` alone,
`issues`/`pull_requests` write, revoked).
- **A review** with two comments on lines, sent as GitHub does (three
deliveries): one message with the comments under the review; the
comments' own deliveries added nothing.
- **Failed checks**: two deliveries made one message naming "Rust tests
and Clippy, 1 still running, 4 passed".
- **During a turn**: checks that failed while the agent worked reached
it ten seconds after the turn ended; those of a commit the agent had
already replaced were dropped.
- **A person's pushes** to the agent's branch, each failing: three
reached the agent, the fourth only left the muted note.
- **A merge**: one message ("merged into main by @ada") from two
deliveries; a comment on the merged pull request told the agent to put
changes in a new pull request from the updated main.
- **A stopped session** resumed for a comment, and its agent answered
it.
  - An older client's settings update kept the stored follow-ups.

## Screenshots

From `cargo xtask dev` with the runs above, at f66ec00. GitHub avatars
are generated stand-ins.

**Settings → Pull requests** (light, dark, 390 px):

![The Pull requests section of a project's settings,
light](https://app.fctl.sh/api/v1/published/lxGo1mv1PdSbczYSdgz1JjvmeulcV0D0eUO9GojayX3/settings-light.png)

![The Pull requests section,
dark](https://app.fctl.sh/api/v1/published/OfrM1EJ4vLIwWQWD2tXZ8V6vs2T2J8i8wgh5TSfnDQB/settings-dark.png)

![The Pull requests section on a
phone](https://app.fctl.sh/api/v1/published/MiED8UfFZ36ljSirhksGceRmCG1hHgXE2pooQENNzpm/settings-phone.png)

**A session brought back by a comment**, with what brings its agent back
under its pull request:

![A session page with a comment from GitHub in its transcript, and the
hint under its pull
request](https://app.fctl.sh/api/v1/published/Lz5SoucSuvyZhDTdo1ELITIy2sqMMCk5KJfJ2JWrS83/session-light.png)

**A review with its comments on lines** (light, dark):

![A review that requested changes, with two comments on lines,
light](https://app.fctl.sh/api/v1/published/Fjhg2R2ALG67hSdODfkglg0NmXzLNcPUhmEB1Pw12w1/fu-review-light.png)

![The same review,
dark](https://app.fctl.sh/api/v1/published/NZ4CRP1MGIWPpIF6JWMVQm19FGNvtgDSKt7l7v9WRkE/fu-review-dark.png)

**Failed checks, then a merge**, and **what fctl told the agent**,
opened:

![Two failed checks named, the agent's answer, then the
merge](https://app.fctl.sh/api/v1/published/fsOnsUWeo1dAtcuyuwCX46jJmtljM3T5lxpLCrGcZKa/fu-checks-light.png)

![A comment with What fctl told the agent
opened](https://app.fctl.sh/api/v1/published/vA8QHD27KCysvUD7bpQNi7FXjaQ1rhRBvGNlKEvcxmv/fu-told-light.png)

**Held back** after three in a row:

![A failed check shown muted, with why the agent didn't hear of
it](https://app.fctl.sh/api/v1/published/Kwb8t9wRn9ITE1foDCylEERjl6doxBCIq6K76pkA86k/fu-held-light.png)

**On a phone** (390 px):

![A comment and a review in the transcript on a
phone](https://app.fctl.sh/api/v1/published/60pT0V6zduTKSjCw4I0i5uSAjbV6UTWhVYqLVIYcFMH/fu-review-phone.png)

## Other repositories

- hyperstructure/fctl-site: the privacy policy says what follow-ups
receive, keep and send
(hyperstructure/fctl-site#46).

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

---------

Co-authored-by: fctl-sh[bot] <343971779+fctl-sh[bot]@users.noreply.github.com>
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