diff --git a/docs/agents/prioritize.md b/docs/agents/prioritize.md index ceb5bcb398..b6b141490d 100644 --- a/docs/agents/prioritize.md +++ b/docs/agents/prioritize.md @@ -12,7 +12,7 @@ Scores a GitHub issue using the RICE framework (Reach, Impact, Confidence, Effor Triggered on a schedule (the prioritize scheduler polls the project board for unscored issues) or on-demand via `/fs-prioritize`. -The prioritize agent fetches the issue and all its context, then evaluates it across the four RICE dimensions. It can invoke customer-research skills to gather additional signal about reach and impact. The output is a structured JSON result with per-dimension scores and written reasoning. The post-script always publishes the RICE reasoning comment; when a project number is supplied, it also updates the project board. +The prioritize agent fetches the issue and all its context, then evaluates it across the four RICE dimensions. It can invoke customer-research skills to gather additional signal about reach and impact. The output is a structured JSON result with per-dimension scores and written reasoning. The post-script always publishes the RICE reasoning comment; when a project number is supplied, it also updates the project board. Every run posts a new reasoning comment. On GitHub, the bot's own earlier reasoning comments on the issue are then minimized as outdated: they collapse, and a reader can still expand them. ## How it helps diff --git a/docs/agents/review.md b/docs/agents/review.md index bc4e9d6696..da142907cb 100644 --- a/docs/agents/review.md +++ b/docs/agents/review.md @@ -15,7 +15,10 @@ The review agent is triggered when a PR is opened or updated, subject to the syn 1. **Pre-script** validates inputs and fetches PR metadata. 2. **Sandbox** — the agent runs the `pr-review` orchestrator skill. The orchestrator triages the change, then dispatches specialized sub-agents in parallel — each covering a distinct review dimension (correctness, security, intent & coherence, style & conventions, docs currency, and optionally cross-repo contracts). Sub-agents run concurrently and return structured findings. The orchestrator collects, deduplicates, and synthesizes findings across dimensions, runs PR-level checks (scope authorization, protected paths), and produces a structured JSON review result. The agent cannot push files, edit code, or push — it is strictly read-only. 3. **Validation loop** — the output is checked against a schema, with up to 2 retry iterations if the output is malformed. -4. **Post-script** posts the review on the PR. Findings that include a file path and a line in the change diff are also posted as inline comments on that line (GitHub review comments; GitLab merge-request discussions). Findings that cannot be positioned — file-level notes, lines outside the diff, or a GitLab diff version whose `head_sha` no longer matches the reviewed commit — stay in the review comment, and on GitLab as general MR notes. Every run posts a new review comment at the end of the thread. Once the review comment is posted, a failure to submit the forge's native review (GitHub PR review or GitLab approval) is logged as a warning and does not fail the run — the review comment is the authoritative record of the verdict. +4. **Post-script** posts the review on the PR. + - **Inline findings.** Findings that include a file path and a line in the change diff are also posted as inline comments on that line (GitHub review comments; GitLab merge-request discussions). Findings that cannot be positioned — file-level notes, lines outside the diff, or a GitLab diff version whose `head_sha` no longer matches the reviewed commit — stay in the review comment, and on GitLab as general MR notes. + - **Re-runs.** Every run posts a new review comment at the end of the thread. On GitHub, the bot's own earlier review comments are then minimized as outdated: they collapse, and a reader can still expand them. A new risk-assessment comment does the same to the earlier risk-assessment comments. A request-changes review stays visible until a later review replaces it; stale-head and failure notices minimize nothing. Minimizing is best effort: if it fails, the run logs a warning and the earlier comments stay visible. GitLab cannot minimize comments, so earlier results stay visible there. + - **Native review.** Once the review comment is posted, a failure to submit the forge's native review (GitHub PR review or GitLab approval) is logged as a warning and does not fail the run — the review comment is the authoritative record of the verdict. If a prior review exists (e.g., re-review after fixes), it is injected into the sandbox so the agent can assess whether previous findings were addressed. @@ -38,7 +41,7 @@ write or higher. The `/fs-review` command does not accept arguments and always forces a review. The review agent also runs automatically on a same-repository PR when it is opened, when its effective diff changes on a synchronize event, or when it is moved out of draft by a user with triage-level repository permission or higher. On GitHub, a fork PR is reviewed automatically under the same rules (a bot author is checked like any other author), through the managed `fullsend-fork-pr.yaml` workflow (see [Fork pull requests](../guides/getting-started/repo-management.md#fork-pull-requests)); the `ready-for-review` label does not start a fork PR review. Dependabot PRs are not reviewed automatically. On either, someone with triage access or higher (or an OWNERS approver or reviewer) can comment `/fs-review`. -For GitHub `pull_request` synchronize events (and `pull_request_target` from shims that have not been upgraded), the review is skipped when the complete effective diff matches the previous app-verified approved review. The guard posts a new PR-visible `fullsend:review-skip` status comment for each skip, linking the previous approved review, and never edits an earlier skip note in place on that publish path; a later full review supersedes each skip note once, in place, naming the commit that superseded it. GitLab diff metadata uses the same normalized model, but the GitLab poller does not consume this marker yet and continues to review synchronized merge requests. +For GitHub `pull_request` synchronize events (and `pull_request_target` from shims that have not been upgraded), the review is skipped when the complete effective diff matches the previous app-verified approved review. For each skip, the guard posts a new PR-visible `fullsend:review-skip` status comment that links the previous approved review, and minimizes the bot's earlier skip notes as outdated. A later full review edits each skip note once, in place, to name the commit that superseded it. GitLab diff metadata uses the same normalized model, but the GitLab poller does not consume this marker yet and continues to review synchronized merge requests. The deduplication check runs before final Bash/CEL stage selection, so CEL-selected review routes participate as well. File modes are part of the compared effective diff identity, so executable-bit changes cannot be hidden by an otherwise identical textual patch. The guard fails open and runs the review when there is no prior diff hash, the prior review cannot be verified, a required hash/head or base/head tree-mode API call fails, the file listing is incomplete or truncated, or any file has no representable patch (for example, a binary or rename-only change). diff --git a/docs/agents/triage.md b/docs/agents/triage.md index abac121a61..8a255d7f59 100644 --- a/docs/agents/triage.md +++ b/docs/agents/triage.md @@ -12,7 +12,7 @@ Inspects a GitHub issue, assesses information sufficiency, asks clarifying quest The triage agent is triggered when a new issue is opened or when an existing issue is updated. On GitLab, opening an issue also dispatches triage when the issue author has Developer access or higher (see [Commands](#commands)). The webhook fast path starts this dispatch, and events-mode cron polling backstops it when a webhook delivery is missed. It fetches the issue content — title, body, labels, comments — and reads repository context (architecture docs, existing issues, PRs) to understand the landscape. It then decides whether the issue has enough information to act on, or whether clarification is needed. -The agent runs in a read-only sandbox. It cannot modify issues, push code, or interact with external services. Its only output is a structured JSON triage result consumed by the post-script, which applies labels and posts a summary comment. +The agent runs in a read-only sandbox. It cannot modify issues, push code, or interact with external services. Its only output is a structured JSON triage result consumed by the post-script, which applies labels and posts a summary comment. Every run posts a new comment at the end of the thread. On GitHub, the bot's own earlier triage results on the issue are then minimized as outdated: they collapse, and a reader can still expand them. Minimizing is best effort; if it fails, the earlier results stay visible. GitLab and Jira cannot minimize comments, so earlier results stay visible there. ## How it helps diff --git a/docs/guides/dev/behaviour-drivers.md b/docs/guides/dev/behaviour-drivers.md index f3fac49d7b..27c689aa34 100644 --- a/docs/guides/dev/behaviour-drivers.md +++ b/docs/guides/dev/behaviour-drivers.md @@ -119,7 +119,10 @@ Each stub error is a `*drivers.NotImplementedError` (package `pkg/behaviourtest/ 1. Implement `scm.Driver` in `pkg/behaviourtest/drivers/scm//`. Also implement the optional `scm.PullRequestHeadSHAReader` interface (`GetPullRequestHeadSHA`). Dummy-agent fixtures that use the - `` placeholder need it. + `` placeholder need it. If your forge can minimize + comments, also implement `scm.CommentMinimizedReader` + (`ListCommentMinimizedStates`). The minimized-comment assertion steps + require it. 2. Register the driver in `behaviourtest.RunSuite` when `BEHAVIOUR_SCM=`. 3. Document the env var value here. 4. Add `@skip:` tags on scenarios that cannot run until the driver is complete. diff --git a/docs/guides/dev/behaviour-testing.md b/docs/guides/dev/behaviour-testing.md index 35c0cdf289..bbed9055cb 100644 --- a/docs/guides/dev/behaviour-testing.md +++ b/docs/guides/dev/behaviour-testing.md @@ -429,6 +429,8 @@ once `the pull request head branch matches` has found it. | `the last comment on the issue contains ""` | The last (newest) comment on the issue contains the text | | `the last comment on the issue containing "" contains ""` | The newest comment on the issue carrying the marker (an agent's result marker) contains the text | | `a comment on the issue other than the last contains ""` | Some comment before the last on the issue contains the text | +| `the pull request has visible comments containing ""` | Exactly comments on the pull request contain the text and are not minimized (issue form: `the issue has visible comments containing ""`). Requires an SCM driver that implements the optional `scm.CommentMinimizedReader`. The GitHub driver does. | +| `every comment on the pull request containing "" other than the last is minimized` | At least two comments on the pull request contain the text, all of them except the newest are minimized, and the newest is not. This is what an agent re-run leaves behind (issue form: `every comment on the issue containing ...`). Requires `scm.CommentMinimizedReader`. | | `the pull request body contains ""` | The PR body contains the text. `` expands, so `"Closes #"` checks the closing reference | | `an issue with label "