From 8eaade3b3bfd7634df14199612c3a69b47e2f0b4 Mon Sep 17 00:00:00 2001 From: Wayne Sun Date: Thu, 19 Nov 2026 14:28:59 -0500 Subject: [PATCH] docs(adr): add ADR 0171, review fork PRs through /fs-review for now Assisted-by: Claude (author), Gemini (advisor, prose review) Signed-off-by: Wayne Sun --- ...-until-the-poll-and-trigger-are-decided.md | 108 ++++++++++++++++++ docs/architecture.md | 2 +- 2 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 docs/ADRs/0171-review-fork-prs-through-fs-review-until-the-poll-and-trigger-are-decided.md diff --git a/docs/ADRs/0171-review-fork-prs-through-fs-review-until-the-poll-and-trigger-are-decided.md b/docs/ADRs/0171-review-fork-prs-through-fs-review-until-the-poll-and-trigger-are-decided.md new file mode 100644 index 0000000000..6cba54afb2 --- /dev/null +++ b/docs/ADRs/0171-review-fork-prs-through-fs-review-until-the-poll-and-trigger-are-decided.md @@ -0,0 +1,108 @@ +--- +title: "171. Review fork PRs through /fs-review until the poll and its trigger are decided" +status: Accepted +relates_to: + - security-threat-model + - platform-nativeness + - code-review +topics: + - workflows + - security + - polling + - dispatch + - pull-request-target +--- + +# 171. Review fork PRs through /fs-review until the poll and its trigger are decided + +Date: 2026-11-19 + +## Status + +Accepted + +Follows up the open question that +[ADR 0164](0164-run-the-shim-on-pull-request-for-same-repo-prs.md) left on +automatic review for fork PRs. + +## Context + +[ADR 0164](0164-run-the-shim-on-pull-request-for-same-repo-prs.md) moves the +shim from `pull_request_target` to `pull_request` before GitHub blocks +`pull_request_target` by default on 2026-12-02. A fork's `pull_request` run +gets a read-only token, no secrets and no OIDC token, so it cannot review the +PR or start a run that does. Fork PRs are reviewed only when someone +authorized comments `/fs-review`. That comment fires `issue_comment`, which +runs the default-branch workflow, and dispatch authorizes the commenter +([ADR 0054](0054-require-authorization-on-all-agent-dispatch-paths.md)), so no +fork-controlled run is involved. In the 30 days to 2026-11-12, 105 of 166 +human PRs in `fullsend-ai/fullsend` came from forks, and 87 of those authors +had triage access or higher. + +Getting automatic review back takes two parts, and neither is ready: + +- **A poll.** No event a fork can cause may safely start a privileged run, so + default-branch code has to list open fork PRs, authorize each author and skip + commits already reviewed. That work belongs to entity-source discovery + ([ADR 0098](0098-entity-first-harness-evaluation.md), + [ADR 0149](0149-coalesce-entity-source-discovery-queries.md)), which is + not built yet ([#8418](https://github.com/fullsend-ai/fullsend/issues/8418)). + A fork-PR input on `fullsend poll` today would be an interim driver with its + own caller workflow, to be replaced later. +- **A wake-up with a bounded wait.** GitHub's Actions schedule cannot provide + one. Across 400 runs each of three public repositories with a five-minute + schedule, the median gap was 6.3 minutes and the longest 39 minutes, and + about 4 in 10 slots did not run. A new test repository got no scheduled run + for more than three hours. A bounded wake-up needs something outside the + user repository: a webhook receiver, an operator's timer, or a fullsend + platform timer. Fullsend runs none of these today, and putting them in the + mint, the service that holds the App keys, was rejected in review. + +This ADR aims to fix what fork PRs get after 2026-12-02 without building an +interim poll or a new hosted trigger that later decisions would replace. + +## Options + +| Option | What fork PRs get | Why not chosen | +|---|---|---| +| **A. `/fs-review` only, automatic review deferred** | A review when someone authorized comments | **Chosen** | +| B. A best-effort poll in the user repository on the Actions schedule | Automatic review with no bound on the wait | An interim poll driver and caller workflow ahead of entity-source discovery, for a wait GitHub does not bound | +| C. B, started by a webhook route and a timer in the mint | Automatic review within minutes | Adds an internet-facing route and timer to the service that holds every App key | +| D. B, started by a separate webhook service or a fullsend platform timer | Automatic review within minutes | No such service exists or is decided; too much to build and run before 2026-12-02 | +| E. Keep `pull_request_target`, or use `workflow_run`, for forks | Automatic review | Ruled out by ADR 0164 | + +## Decision + +We keep `/fs-review` as the only way to review a fork PR, and defer automatic +review of fork PRs until both parts can be decided on their own terms. + +1. **Review path.** A fork PR is reviewed when someone authorized for + `/fs-review` comments it, as ADR 0164 rule 3 defines: a person, not a bot, + with triage access or higher, or an OWNERS approver or reviewer when that + provider is on. A fork author with that access may comment on their own PR. +2. **Nothing new now.** Fullsend adds no fork PR poll, no poll caller + workflow, no webhook route and no timer for fork PRs. +3. **When to revisit.** A new ADR restores automatic review once + entity-source discovery can declare a fork PR source, and once a place + outside the user repository to run a bounded wake-up is decided. Each can + be its own ADR. + +## Forge scope + +- **GitHub:** applies. +- **GitLab:** unchanged. The GitLab poller keeps skipping pushes to fork merge + requests because it cannot tell who pushed (see the + [review agent](../agents/review.md)). +- **Forgejo:** unaffected; Forgejo has no fullsend dispatch today. + +## Consequences + +- From 2026-12-02, fork PRs get no automatic review or retro, including PRs from + maintainers working in forks. +- Each push someone wants reviewed needs a `/fs-review` comment, and a missed + comment lets a fork PR merge without a fullsend review. +- Fork authors with read access only depend on a maintainer to comment, as + they did before ADR 0164. +- Fullsend's trust boundary and the mint stay unchanged. +- The later ADRs can build on entity-source discovery directly, with no + interim driver to retire. diff --git a/docs/architecture.md b/docs/architecture.md index 66d9bcb657..c4f4541984 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -55,7 +55,7 @@ sole supported installation model - Event-source routing for status notifications: the notification destination for run-status comments and reactions is dynamically determined by event provenance — a Jira-triggered run posts status to Jira, a GitHub-triggered run posts to GitHub — rather than being hardwired to the code-output forge. Status notifications route through `tracker.Client`; reactions are an optional `tracker.Reactor` capability (Jira Cloud supports comment reactions but not issue reactions, so `Reactor` is not implemented for Jira currently) ([ADR 0093](ADRs/0093-tracker-routed-status-notifications.md)). - Installation model: the CLI installs per repository only (`fullsend github setup `, `fullsend admin install ` (deprecated), `fullsend repos install`); per-org CLI installation was removed ([ADR 0044](ADRs/0044-deprecate-per-org-installation-mode.md)). The concrete layers of the ordered layer stack (vendor-binary, secrets, inference, and the per-org workflows layer) were removed along with per-org mode; `internal/layers` keeps only the `Layer` interface and shared helpers, and the CLI no longer orchestrates a layer stack ([ADR 0006](ADRs/0006-ordered-layer-model.md)). - Dispatch: each repository's `.github/workflows/fullsend.yaml` shim calls the upstream `reusable-dispatch.yml` via `workflow_call`; that workflow mints OIDC tokens exchanged at a central token mint (GCP Cloud Function or Cloudflare Worker) for scoped GitHub App installation tokens per agent role. App PEM secrets are stored in Secret Manager (GCF mint), Worker secrets (CF mint), or the local filesystem (standalone mint), not the config repo ([ADR 0008](ADRs/0008-workflow-dispatch-for-cross-repo-dispatch.md)). -- Shim workflow security: the shim's PR events run on `pull_request`, so the shim runs from the PR's own copy and forwards the repository's secrets. Its dispatch job therefore runs only for same-repo PRs (head repository id equals the base repository id), whose authors already have write access; fork and Dependabot PRs get no automatic run and are reviewed when someone authorized for `/fs-review` (triage access or higher, or an OWNERS approver or reviewer) comments it. `reusable-dispatch.yml` refuses those PRs again (a fork cannot edit the upstream copy; a vendored copy runs from the PR, so vendored installs rely on GitHub not sending secrets to fork PR runs), takes the base side for every checkout (base SHA, or the default branch where a checkout used the event default), runs no PR code, and still accepts `pull_request_target` from shims that have not upgraded, with a warning. The mint accepts only OIDC tokens whose `job_workflow_ref` names an allowed workflow host repository ([ADR 0164](ADRs/0164-run-the-shim-on-pull-request-for-same-repo-prs.md), superseding the `pull_request_target` shim of [ADR 0009](ADRs/0009-pull-request-target-in-shim-workflows.md)). +- Shim workflow security: the shim's PR events run on `pull_request`, so the shim runs from the PR's own copy and forwards the repository's secrets. Its dispatch job therefore runs only for same-repo PRs (head repository id equals the base repository id), whose authors already have write access; fork and Dependabot PRs get no automatic run and are reviewed when someone authorized for `/fs-review` (triage access or higher, or an OWNERS approver or reviewer) comments it; automatic review of fork PRs is deferred ([ADR 0171](ADRs/0171-review-fork-prs-through-fs-review-until-the-poll-and-trigger-are-decided.md)). `reusable-dispatch.yml` refuses those PRs again (a fork cannot edit the upstream copy; a vendored copy runs from the PR, so vendored installs rely on GitHub not sending secrets to fork PR runs), takes the base side for every checkout (base SHA, or the default branch where a checkout used the event default), runs no PR code, and still accepts `pull_request_target` from shims that have not upgraded, with a warning. The mint accepts only OIDC tokens whose `job_workflow_ref` names an allowed workflow host repository ([ADR 0164](ADRs/0164-run-the-shim-on-pull-request-for-same-repo-prs.md), superseding the `pull_request_target` shim of [ADR 0009](ADRs/0009-pull-request-target-in-shim-workflows.md)). - Installer scaffold: per-repo installs deploy content from an embedded scaffold (`internal/scaffold/`), keeping deployable files as real files under version control rather than Go string constants. The per-org dispatch, repo-maintenance, and enrollment-reconciliation scaffolds were removed with the rest of per-org mode ([ADR 0044](ADRs/0044-deprecate-per-org-installation-mode.md)). - Reusable workflows: each repository's `fullsend.yaml` shim calls the upstream `reusable-dispatch.yml` (`fullsend-ai/fullsend/.github/workflows/reusable-dispatch.yml`), which runs every agent stage as an inline job; the only standalone stage workflow is `reusable-prioritize.yml`, called by the explicit prioritize thin caller. The per-org thin stage callers and `reusable-{code,fix,review,retro,triage}.yml` were removed with per-org mode (the per-org architecture described in the linked ADRs is historical and deprecated). Infrastructure patches ship once upstream and propagate to all repositories without re-install ([ADR 0031](ADRs/0031-reusable-workflows-for-action-installed-distribution.md)). **Vendoring** (`vendor: true` in `repos.yaml` for `repos install`, `--vendor` for `github setup`; [ADR 0047](ADRs/0047-vendored-installs-with-vendor-flag.md)) commits workflows and agent content at install time; layered installs (default) fetch upstream at runtime. - Event-driven stage dispatch: eliminate `workflow_dispatch` + `gh workflow run` fan-out from the (now removed per-org) `dispatch.yml` in favor of synchronous `workflow_call` so the dispatched run stays linked to the caller ([ADR 0041](ADRs/0041-synchronous-workflow-call-event-dispatch.md)).