Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ Startup validates configuration without opening the credential or contacting the
| `inbox_events` | Required event cursor; optional limit and wait_ms 0–4000; one bounded incoming-event page. |
| `wait_for_messages` | Required event cursor; optional limit 1–100 and wait_seconds 1–50, default 20/25. One new-message event page or quiet timeout over a call-owned persistent stream. |
| `review_execution_read` | No fields; stored execution configuration and revision, without provider work. |
| `review_lane_diagnostic` | Required channel; provider-free [per-PR lane diagnostics](review-lane-diagnostics.md) with retained source timestamps/completeness, local holds and exact parent blockers. Not fresh admission or a dispatch promise. |
| `review_scheduling_read` | No fields; stored project scheduling settings, revision and paused queued PRs, without provider work. |
| `review_scheduling_configure` | Required idempotency_key/expected_revision/automatic_hosted; optional automatic_cli preserves its existing value when omitted. Project management capability configures [default-off automatic scheduling](review-scheduling.md), including authorization for later provider work within existing review limits. |
| `review_pull_scheduling_read` | Required pull_number; reads the per-PR automatic scheduling pause and revision. |
Expand Down
2 changes: 2 additions & 0 deletions docs/provider-observations.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ CI reads bind explicit source and selected commit identities, recheck passing ca

CodeRabbit decoding recognizes closed generated envelopes and presentation variants while retaining original bodies and identities. Publication attribution, exact comparison, provider run identity, finished acknowledgment and counted finding inventory remain separate checks. Inline, outside-diff, duplicate and additional findings retain their own source references. Additional-only summaries support at most one bare `<br>` as the first visible, nonempty, non-Markdown-quoted line after each `<dd>` inside balanced definition-list wrappers at the same details and HTML blockquote depths, and a standalone heading around exact Review info metadata. Repeated breaks, mid-body breaks and breaks outside the matching definition body remain unsupported; hidden or Markdown-quoted examples cannot supply wrapper boundaries or restart a body. Neither presentation form can hide unknown findings or supply comparison authority by itself. Supported count omission for positive and marked-empty publications follows the [native source contract](review-execution.md#hosted-source-adoption). Malformed or contradictory count metadata remains refused; omission by itself never establishes a clean review. Baseline-qualified historical annotation exclusion retains original comment/review identities, bodies and positions. Positive comparison proof requires an independently bound pre-POST baseline and authenticated current standing metadata; conflicting comparison metadata remains refused. Quoted prompts and examples cannot supply authoritative metadata. An authenticated foreign Bot report whose entire current body contains no case-insensitive `coderabbit` mention is not an inferred request authority merely because it was edited. This current-source policy does not prove its original body or require a pre-trigger copy; bot-looking prose or login names do not replace the source-owned actor kind. Visible competing review commands still close attribution regardless of author. Edited posting-actor, human and other actor-kind comments, and Bot comments with provider mentions even in quoted or hidden text, retain the conservative edit barrier. Baseline-qualified projections and old finding annotation proof preserve their separate source-binding checks without rewriting either capture.

A markerless submitted review may instead contain exactly one positive, counted Additional comments category followed directly by the existing `h6`-wrapped Review info and generated status footer. The complete provider collections must prove there are no attached inline roots or in-window orphan roots. The original submitted review, unique fresh run, configured provider actor, exact head, explicit full comparison, counted selected-file inventory and unique later finished acknowledgment retain their ordinary checks. Every additional finding must decode completely and name a selected file; category/group counts, source text and its unverified qualification remain intact. Actionable-count declarations, mixed or unknown categories, empty inventories, competing submissions or commands and ambiguous acknowledgments cannot use this path. This parser support preserves positive findings and does not itself finalize adjudication, change round accounting, or grant clean/taper credit. The existing runtime proof pipeline remains responsible for completion.

A closed unquoted Follow-up Comments envelope may carry positive outside-diff findings without a count header. Its generated badge, explicit matching title, severity, range, reviewed-head source location and fingerprint must agree. The source location establishes finding coordinates only; it never supplies base or effective-parent proof. Empty, ambiguous or unsupported envelopes remain incomplete.

A generated Review info block can report files whose changes were unavailable. Retain that bounded limitation separately from finding-inventory completeness; a complete captured result does not imply every selected file was reviewed. Original findings and completion accounting remain unchanged.
Expand Down
4 changes: 2 additions & 2 deletions docs/review-execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ The trusted one-pass recovery path reads the original admitted attempt and capab

Hosted preflight must journal its fixed non-review allowance query separately from the eventual review trigger. The preparing attempt binds the original operation, capability, actors and exact source anchor before any query POST. Only the caller that newly creates that intent may make its one post; an existing or uncertain intent requires observation-based recovery and never permits blind reposting. Retain the exact returned or recovered query comment even if preparation later stops. A query grants no review admission or coverage. New query intents recheck current authorization, configuration, policy and source identity; retained query reads and response recording preserve already-issued work. Preparing may perform this journaled non-review metadata query, but may not post a review or spend its allowance before review admission. The query journal, one-pass query observer, immutable availability retention and final hosted guard are implemented components. The concrete hosted driver and configured daemon call them.

A separate pure allowance-query helper generates the fixed documented `@coderabbitai rate limit` command with an operation/attempt/head marker. Its resolver recognizes the observed availability and cooldown reply grammars in a complete, unambiguous comment window. Availability retains only the original query/response identities and times, without numeric capacity or billing proof. Cooldown retains a conservative retry-not-before time with one reported unit (second or minute) of rounding margin. Neither observation grants review permission or reserves provider quota. Edited competing comments close attribution even when their current bodies removed or hid the command. Unknown replies stay unproven. The pure resolver performs no I/O. A separate one-pass runtime component journals query intent before its one fixed metadata post and recovers an uncertain response without reposting. It saves and reference-checks immutable query source before interpretation. A trusted retention bridge records one proven available observation against the confirmed query and exact source, while preserving the original response time. Final hosted verification combines that record with authorization, policy, reservations, channel-specific target/predecessor evidence and the exact unposted review intent in one SQL snapshot; stale responses cannot become fresh merely because they were fetched again. The concrete driver and daemon compose bounded preflight observation, one-use dispatch and scheduled restart recovery. See CodeRabbit's [review commands](https://docs.coderabbit.ai/reference/review-commands).
A separate pure allowance-query helper generates the fixed documented `@coderabbitai rate limit` command with an operation/attempt/head marker. Its resolver recognizes the observed availability and cooldown reply grammars in a complete, unambiguous comment window. Availability retains only the original query/response identities and times, without numeric capacity or billing proof. Cooldown retains a conservative retry-not-before time with one reported unit (second or minute) of rounding margin. Neither observation grants review permission or reserves provider quota. Edited competing comments close attribution even when their current bodies removed or hid the command. Unknown replies stay unproven. The pure resolver performs no I/O. A separate one-pass runtime component journals query intent before its one fixed metadata post and recovers an uncertain response without reposting. It saves and reference-checks immutable query source before interpretation. A trusted retention bridge records one proven available observation against the confirmed query and exact source, while preserving the original response time. Final hosted verification combines that record with authorization, policy, reservations, channel-specific target evidence and exact predecessor source identity and the exact unposted review intent in one SQL snapshot; stale responses cannot become fresh merely because they were fetched again. The concrete driver and daemon compose bounded preflight observation, one-use dispatch and scheduled restart recovery. See CodeRabbit's [review commands](https://docs.coderabbit.ai/reference/review-commands).

The operator explicitly selects `commit_status` or `check_run` for hosted progress. Commit statuses require the provider bot's stable numeric identity and the `CodeRabbit` context; check runs require the configured GitHub App ID, exact candidate and `CodeRabbit` check name. The complete selected collection shares a 15-second budget. Validate collection completeness, row identities and duplicates before selection; validate activity timestamps and lifecycle details only for the configured provider signal. Timestamps on another actor’s status or another App’s check cannot establish or block CodeRabbit activity. Selected provider signals retain strict timestamp and lifecycle validation. A trusted pending signal holds dispatch. Complete scoped absence means only that no activity was observed for that candidate; it allows a first review without fabricating a previous status. Unknown states, partial pages and conflicting identities remain unproven. A terminal status, including a successful “review skipped” status, establishes no review coverage. Check-run observation retains any trusted nonterminal run without guessing creation order from IDs or nullable timestamps. These observations do not establish account-wide or other-head idleness. See GitHub's [commit status](https://docs.github.com/en/rest/commits/statuses) and [check-run](https://docs.github.com/en/rest/checks/runs) APIs.

Expand Down Expand Up @@ -222,7 +222,7 @@ Trusted initial publication builds a channel-specific native run from the retain

A missing current PR projection leaves successfully retained CLI evidence in the authoritative ledger without changing a completed execution to uncertain or keeping its reservation. It does not recreate browser facts or finalize the source. Other publication failures remain recoverable failures; a failed retention never becomes a completed capture.

Hosted publication does not confer CLI comparison credit. The shared channel-explicit comparison check keeps current-comparison coverage separate from pending evidence. Each invocation selects `cli` or `hosted`; pending evidence and coverage never cross that channel boundary. Coverage requires a completed native attempt and complete finalized capture for the exact current repository, PR, candidate, base and effective parent, with every finding decided and accepted findings carrying fix proof. Pending completed native evidence is checked across all heads of the selected PR: missing captures, unfinished decisions/finalization and accepted findings without proof block another spend. A ready capture cannot hide another pending capture. The final local action guard repeats this check in its authorization snapshot. Imported history never becomes native execution credit. Repository renames preserve coverage when stable identity and Git objects still match. Hosted captures additionally require their retained command/trigger identity and complete publication metadata; they never fabricate a reviewed-file list. The indexed lookup examines at most 100 completed operations in the selected channel for the selected PR before loading evidence; excess history produces an explicit capacity hold instead of an unbounded scan or another provider spend. This predicate does not establish aggregate policy sufficiency, CI success or merge readiness. The concrete CLI driver supplies fresh source observations, selects only CLI comparison credit for its target and predecessors, and repeats local authorization before its one-use process action. Hosted comparison support alone enables no hosted dispatch.
Hosted publication does not confer CLI comparison credit. The shared channel-explicit comparison check keeps current-comparison coverage separate from pending evidence. Each invocation selects `cli` or `hosted`; pending evidence and coverage never cross that channel boundary. Coverage requires a completed native attempt and complete finalized capture for the exact current repository, PR, candidate, base and effective parent, with every finding decided and accepted findings carrying fix proof. Pending completed native evidence is checked across all heads of the selected PR: missing captures, unfinished decisions/finalization and accepted findings without proof block another spend. A ready capture cannot hide another pending capture. The final local action guard repeats this check in its authorization snapshot. Imported history never becomes native execution credit. Repository renames preserve coverage when stable identity and Git objects still match. Hosted captures additionally require their retained command/trigger identity and complete publication metadata; they never fabricate a reviewed-file list. The indexed lookup examines at most 100 completed operations in the selected channel for the selected PR before loading evidence; excess history produces an explicit capacity hold instead of an unbounded scan or another provider spend. This predicate does not establish aggregate policy sufficiency, CI success or merge readiness. The concrete CLI driver supplies fresh source observations, checks CLI comparison credit only for its target and verifies predecessor source identities without requiring their review completion, and repeats local authorization before its one-use process action. Hosted comparison support alone enables no hosted dispatch.

New attempts, run evidence, findings, decisions, effective fix proofs and observation freshness are native durable records. Source finalization freezes source counts and identities. Adjudication/fix corrections append guarded evidence; they preserve earlier values and never replace finding text to reuse an old count. Public checkpoint publication is a separate recoverable external action.

Expand Down
19 changes: 19 additions & 0 deletions docs/review-lane-diagnostics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Review lane diagnostics

The read-only lane diagnostic explains each configured PR's local evidence and dependency state using the latest retained source frame for the selected channel. It never starts or resumes selection, refreshes GitHub, contacts a review provider, changes allowance or adjudicates a result.

Use `fc reviews scheduling diagnostics --channel cli` or `hosted`, MCP `review_lane_diagnostic` with the explicit `channel`, or `GET /api/v1/projects/{project_id}/reviews/lanes/{channel}/diagnostics`. Project read access suffices. The response contains at most the configured 100 PRs in queue order. It returns no provider bodies or credentials.

## Reading the result

The scope is always `retained_source_local_policy`. `evaluated_at` is the time of this local read; `source_checked_at`, each candidate's `source_observed_at`, and `source_configuration_revision` describe retained acquisition, not a fresh provider check. `source_complete` means that acquisition covered the configured queue with no global source error. It does not establish current GitHub heads or dispatch eligibility. Unknown suffixes remain `unknown` with `source_not_observed`; a changed configuration or repository invalidates the frame for all current candidates. Missing or damaged evidence never becomes an empty healthy lane.

Each observed candidate has `local_state` and `local_reason`. `locally_ready` means only that the shared local evaluator found no evidence, source-obligation, route, PR-pause, round or actual-parent hold in that retained comparison. It is not a preview of the next automatic selection. Provider limits, active operations, automatic-intent suppression, authorization, current source and transactional admission still apply. `lane_reason` separately reports a configured project/channel pause, disabled channel or global storage/identity hold.

A `predecessor_unfinished` row identifies `blocking_pull_number` and the concrete source-identity `blocking_reason`, such as a missing, moved, cyclic or unavailable parent. Ancestor findings, review rounds and PR pauses do not hold a child's review. The diagnostic shares the ordinary selector's source-chain checks and target-local obligation checks; it does not grant dispatch or merge permission. A local hold on the candidate itself remains its primary reason.

For a lane audit, combine this diagnostic with current operation/scheduling/round reads and current published source observations. Do not use `locally_ready` to force a review or declare a lane healthy. A stale or incomplete frame means eligibility remains unestablished and calls for an authorized ordinary source/selection workflow, not a new review merely to obtain diagnostics.

## Validation boundary

Focused synthetic tests cover retained pending evidence, independent and stacked review progression, actual-parent source holds with exact blocker identity, incomplete/missing/configuration-changed/repository-changed source, malformed retained frames, revoked read access, strict bound client responses, read-only MCP discovery, CLI parsing and unchanged durable selection state. A 100-row shared completed-ancestor case passes the bounded read deadline normally and under the race detector. Each candidate's local facts stay within the current read transaction; ancestor traversal reads source identity rather than ancestor review sufficiency. Local proof does not establish deployed service support, current live admission or provider throughput.
Loading
Loading