Use reviews ci-wait or MCP wait_for_ci to wait quietly for required CI on up to twenty PRs in the bound project. Every target supplies its PR number and full expected head SHA. Each pull_number must be unique within the batch and within the inclusive range 1–2147483647; an optional full base SHA pins the base immediately. Otherwise the watch pins the first freshly observed base. A later comparison change returns superseded, rather than crediting results for different code. Fresh supersession is retained for that subscriber until delivery, even if a later refresh fails or observes the original source again. Once this subscription has a fresh observed head/base mismatch, a newer CI refresh request does not keep that superseded comparison waiting; older cached observations cannot supply this decision.
The underlying POST /api/v1/projects/{project_id}/reviews/ci/watch API requires bearer-based project read access and a configured GitHub observation capability. A read-only browser session is insufficient: its project read grant does not permit this POST route. The watch remains a bounded read, not a durable mutation, and does not request reviews or rerun CI.
fc reviews ci-wait --target 42:FULL_HEAD_SHA --target 43:FULL_HEAD_SHA:FULL_BASE_SHA --wait-seconds 300The default gate comes from the repository's final merge branch, represented by GitHub's default branch. For a stacked PR targeting an unprotected feature branch, this selects the final branch's required contexts while checking the PR's actual head/base or verified test merge. It does not claim the PR was tested against the final branch. Optional preview and deploy workflows do not join the required gate unless that gate requires them; explicit workflow selection below supplies early attention only. The ordinary stored CI assessment continues to describe its selected PR base; the watch reports its distinct gate_ref explicitly.
By default, one call returns when any target passes, fails, closes or is superseded, or when a verified empty gate returns unconfigured. Missing results and unknown requirements remain pending with an explicit reason; neither becomes a pass. A proven failure of an applicable required check ends the watch as failed even when another required check is missing; the result retains both failure and unproven counts. A changed or otherwise unproven comparison cannot establish failure. The exception is positively bound head CI under non-strict required-check authority: a proven merge-base mismatch can keep its merge state unproven while an independently proven failed required check still produces failed, even when another required check is missing. This grants no failure credit to other unproven comparisons. Results include actual observed comparison, gate, CI commit, counts and bounded required-check details. Current workflow, attempt and check identities follow the existing CI proof rules. The outer state identifies the wake condition and can be passed while other targets remain pending. CLI/MCP add all_targets_passed, which is true only for a nonempty batch where every target passed; inspect targets for individual outcomes. Passing CI does not authorize merging or imply review completion.
To continue observing after a passed or failed target, copy its observation_key into that target's optional after_observation_key to wait quietly for changed proof. Keys are omitted until a validated observation is available. Keep the original head/base pins. If the initial request omitted base_sha, send the returned observed_base_sha as base_sha on the next watch alongside the observation key; copying only the original target would allow the new subscription to pin a newer base:
fc reviews ci-wait --target 42:FULL_HEAD_SHA:FULL_BASE_SHA --after-observation 42:OBSERVATION_KEY --wait-seconds 300Repeat --after-observation PR:KEY for each selected baseline. MCP wait_for_ci accepts after_observation_key in the corresponding target object alongside pull_number, head_sha and optional base_sha. An identical fresh passed or failed result preserves the freshly observed target state, counts, check identities, observation time and key, and adds waiting_for_change:true. Its unchanged verdict no longer wakes the call, so the outer state stays pending unless another target wakes it. Changed terminal proof or selected workflow failure attention wakes normally. Closure, source supersession and an unconfigured gate always wake. A newer CI-only hint does not erase fresh closure; a PR metadata hint can represent reopening and requires a fresh source observation. At quiet expiry, an unchanged passed target still reports state:passed with waiting_for_change:true; all_targets_passed can therefore be true while the outer state is pending and timed_out:true. Those are observed passing facts, not a guarantee that CI remains passed afterward.
This is one bounded wait for terminal results, not a continuous readiness subscription. A newly pending check does not itself wake the call or retain a passing target state. While the call remains attached, the shared observer continues until changed terminal proof, selected attention or timeout. A pending-then-pass cycle whose final relevant proof is identical to the supplied baseline stays quiet; no transition history or edge latch is retained. A new relevant run, check or attempt identity changes the key. Return, timeout or cancellation releases the subscription; a later metadata edit still needs a fresh assessment before relying on CI.
This per-call baseline neither reruns CI nor supplies a passing result. Observation keys change with relevant comparison, required context/check/status identities or outcomes, and explicitly selected workflow/job proof, not timestamps or refresh generations. Omitting a baseline retains the default any-terminal behavior.
For early repair attention while the required gate is pending, optionally select stable workflow IDs per target. API callers must send exactly one recognized X-FC-CI-Watch header, such as X-FC-CI-Watch: change-v3, when selecting workflows; requests containing failure_workflow_ids without it are rejected. MCP/API target failure_workflow_ids is an array of 1–16 unique positive integers when supplied; CLI repeats --failure-workflow PR:ID for the corresponding --target, in any argument order. Obtain IDs from the repository’s GitHub workflow/run metadata. An aggregate gate name cannot identify its owning workflow before a check exists.
fc reviews ci-wait --target 42:FULL_HEAD_SHA:FULL_BASE_SHA --failure-workflow 42:123456 --wait-seconds 300A proven failed job in an explicitly selected workflow supplies an eligible attention wake result; the target stays state:pending with its required-gate counts and checks unchanged, and all_targets_passed:false. In a batch, the first target in request order with an eligible wake result determines the outer state. A prior target may therefore produce outer passed even when a later target has workflow failures; inspect every target. workflow_failures contains at most one failed job per selected workflow, at most sixteen rows, bound to the exact applicable CI commit, workflow, run and current numbered attempt. A newer completed run that explicitly skips the same uniquely named job does not demonstrate that an earlier execution was repaired. Attention can retain that earlier failure only through a complete chain of such skips for the same workflow event and commit, with a final workflow-run recheck. Missing jobs, ambiguous duplicate names, pending or cancelled execution block that fallback. A newer substantive result supersedes the earlier result, and a rerun always uses its current attempt; failed jobs from an old attempt cannot reappear after a repair. This optional attention does not carry old success into the required gate. Each row supplies workflow_id, run_id, run_attempt, job_id, check_run_id, name and conclusion; no job bodies or logs are fetched. This selection adds neither required-gate membership nor a dependency-graph assertion. An already terminal gate, closed PR or superseded source returns its normal result without extra attention.
A positively bound, stable ci_merge_base_mismatch can also supply repair attention for explicitly selected workflows on the same pinned PR head. Such a target adds workflow_attention_basis: head_only_current_comparison_unproven. Its required gate keeps the mismatch reason, zero check counts, empty checks and no selected CI commit. The failed workflow/run/attempt/job identities are real same-head observations, but the run's base or test-merge comparison is unknown; the surrounding mismatch's PR/live-base hashes are not the run's base. This neither declares current-comparison CI failed nor credits it as passed. It uses the same skipped-job inheritance and final run recheck above, not a scan of unrelated historical failures. A metadata-only green run with absent jobs supplies no proof that earlier failed jobs were repaired. Ordinary waits, other unproven comparisons and old-client selections add no same-head collection.
Current clients with explicit workflow selections request X-FC-CI-Workflow-Details: 3 alongside X-FC-CI-Watch: change-v3. The workflow-details version opts into the historical attention below, the same-head attention above and existing applicable-comparison details. Version 2 retains proven same-head attention but receives no historical rows. Version 1 keeps its original latest-run details and receives no head-only failures or wakeups. Projection happens for each subscriber before choosing attention or comparing change keys, even when subscriptions share one observer; adding a newly capable subscriber requests fresh proof even when its workflow IDs are already selected. Pending applicable targets can include at most sixteen workflow_observations, restricted to that caller’s selected workflow IDs and the applicable comparison. Each row states basis: latest_run_only and supplies the newest workflow/run/attempt/status/conclusion when known; an absent run supplies no invented identity. These details reuse the collected Actions inventory, add no provider reads and change neither observation keys nor wake/gate behavior. When proven failure attention identifies an earlier execution through the skipped-job rule above, the target omits the whole optional workflow_observations group to avoid conflicting run identities; workflow_failures still supplies the exact failed execution. An empty failure list does not certify that an earlier module failure was repaired; job execution or successful optional job collection cannot be inferred from these run details. Missing details, including from an older server, remain unknown.
A selected advanced-attention mode requires provider support at admission; an adapter cannot silently downgrade head-only or historical selectors to ordinary workflow observation. Unsupported modes are rejected before registering a watcher or consuming shared watch capacity.
A selected workflow can also expose one earlier failed job with per-row basis: historical_same_head_failure_supersession_unproven. This applies only to the pinned PR head, including the head-only mismatch case. It uses current numbered attempts already read by the existing bounded skipped-job walk; it adds no historical or attempt requests and changes none of that walk’s stopping conditions. For example, GitHub may publish a skipped literal Build and Test (${{ matrix.module }} / ${{ matrix.partition }}) after earlier expanded module jobs failed. FireController does not infer matrix identity from that template or claim that the older failure still applies to the latest jobs. The row retains the real workflow/run/attempt/job/check identities, while latest-job coverage or supersession and the run’s base comparison remain unknown. A newer exact-name substantive result, including success, pending or cancellation, suppresses that historical candidate; duplicate names supply no association. Malformed, missing or unread attempts cannot add history collection. A final same-head run-inventory recheck is mandatory before exposing historical rows, even when this is the only attention; a moved or failed recheck discards them while preserving independently proven attention and the required gate. All optional work shares the existing forty-second provider budget and thirty-two-attempt bound. Historical attention gives no current failure or success credit and does not reinterpret a metadata-only green run as source validation.
For historical attention, CLI/MCP diagnostics lead with the confirmed job failure on the pinned head. “Supersession unproven” means newer runs have not established whether they reran or replaced that failed job; it does not cast doubt on the original failure. It also does not establish failure of the latest comparison or change the required-gate result.
Known attention also supports after_observation_key: retain the same head/base pins and workflow selection. Identical attention stays quiet with waiting_for_change:true, preserving the pending target and failure rows; changed proof, including a new failed attempt, wakes the wait. A collection failure or no matching current run supplies no early claim and never erases or upgrades the required-gate result. Absence of workflow_failures is not a certificate that no jobs failed.
Selected workflows use the existing shared observer and current numbered-attempt reads. Overlapping subscriptions for a PR have a combined limit of sixteen explicitly selected attention workflow IDs. Required and optional attention collection together retain at most thirty-two numbered attempts within the same forty-second provider budget. Selected workflows receive their latest-run attempt reads before older skipped-run history uses the remaining budget. Attempts already collected for required CI are reused, and older-run inspection stops as soon as no skipped job remains eligible. Optional collection failures stop further optional fanout and retain normal provider-account backoff without erasing proven gate facts or earlier validated attention. Older-run proof is local to that observation, with no new persisted schema or per-job polling.
CLI and MCP pending targets add a plain diagnostic and phase: not_observed means the controller has not finished a fresh observation for this watch; refreshing means newer facts are requested and older counts are informational; checks_pending and checks_unproven describe collected GitHub check facts. observation_unproven covers a collection whose CI result could not be established. Zero counts before observation do not establish an empty gate. The original observed_at dates collected facts when present. A returned response ends this call's subscriptions, so it does not promise a next scheduled check or completion ETA. A pending commit status can keep a required context pending even when its separate check run succeeded; diagnostics identify one actual context and retained status/check IDs without implying a workflow-run association. Known test-merge refusals reuse the existing CI comparison recovery guidance. Requested and observed PR base SHAs are not relabeled as the stale merge parent or live branch tip.
Pass only the targets you still want to observe into a subsequent wait, including passed targets with their baseline when awaiting later changes. Waits default to 300 seconds and support 0–900 seconds. Zero does not wait for collection and does not reuse cached observations to settle a new subscription. It normally returns pending targets with no observed facts (not_observed in client diagnostics); only a fresh observation that completes during this call can appear. Use a positive wait to allow time for fresh CI facts. A quiet expiry returns timed_out:true and the real target states; it does not create a durable operation to poll. After identity verification, the client fits the forwarded wait inside its remaining caller deadline, preserving a five-second response margin; the requested duration is an upper bound. A positive HTTP wait starts at handler entry, so scoped authentication and body parsing consume that same selected duration instead of starting another full wait afterward. The final fresh authorization read retains its ordinary bounded response allowance. Connection establishment before handler entry and response delivery still consume client headroom, and any earlier caller deadline or cancellation remains authoritative. A locally canceled client context or expired response deadline reports an interrupted CI wait without claiming a CI failure or changed comparison. Only a returned superseded result establishes observed comparison movement. The interruption diagnostic does not identify who canceled the calling context. Local cancellation or expiry is never automatically retried. Cancellation or return releases this call's temporary subscriptions. Configure a capable MCP host using the long-wait guidance; a service wait does not itself promise idle-chat wakeup.
Local CI-watch connection failures and interruptions can include details.transport: a bounded phase (not_started, connecting, tls_handshake, sending_request, awaiting_response or response_started), total read/reconnect elapsed milliseconds, the wait requested at the client read boundary (after any host/setup adjustment), the final attempt’s effective wait and attempt count. These are local transport observations, not server or GitHub progress. response_started means at least one response byte arrived; it does not establish complete headers, a status code or a valid CI result. The diagnostic contains no addresses, headers, credentials or raw errors. It changes neither stable error codes nor retry and deadline behavior. Server refusals and successful responses retain their existing shapes.
After a temporary connection or gateway failure, or explicit service shutdown, positive CLI/MCP waits reconnect only when every target supplies an explicit base SHA, using the same pins within the original result-wait budget. This repeats only the read-only watch, never a review request. A batch with any implicit base does not reconnect: that base was pinned inside the lost server subscription and cannot safely be recovered by a new call. Verify the original comparison and supply explicit base pins before starting another bounded wait. If recovery cannot complete, the diagnostic retains the pins and safe reason. The interruption does not establish failed GitHub CI. A ci_watch_response_limit refusal asks the caller to watch fewer targets per call, preserving the original comparison pins. Other refused CI waits retain a safe reason identifying the boundary: ci_watch_scope_read, ci_watch_binding_read, ci_watch_capacity, ci_watch_observer_unavailable or ci_watch_canceled. These distinguish local reads, subscription capacity, observer availability and request cancellation; they do not establish a SQLite cause, provider failure or deployment. Only the bounded transport failures and explicit shutdown covered by the client wait contract reconnect; other refusals retain their source pins and request ID without broad automatic retry. The service separately absorbs refused local read admission within its existing wait budget.
The API is POST /api/v1/projects/{project_id}/reviews/ci/watch with body {"targets":[{"pull_number":42,"head_sha":"FULL_HEAD_SHA"}]} and optional Prefer: wait=N. Current wait clients send X-FC-CI-Watch: change-v3 for passed and failed baselines and the exact optional merge_base_mismatch identities introduced by change-v2. Existing change-v1 and change-v2 callers retain failure/attention-only baselines: an unchanged pass still wakes them. Version 1 keeps its earlier mismatch response shape. Request targets use the existing after_observation_key and failure_workflow_ids; passed rearming adds no JSON field or user flag. Despite using POST for the bounded target list, this requires project read access and has no idempotency key or durable mutation. PRs need not be enrolled in the Delivery queue. The project must have a configured GitHub observation capability. A watch never requests reviews, spends review allowance, reruns CI or changes branches, jobs, notes or queue membership.
Deploy support for change-v3 before installing clients that request it. A new-client/older-server pairing that cannot honor the requested capability fails with an explicit unsupported-capability refusal; the client does not silently fall back to failure-only behavior or polling. Already-running MCP sessions retain their loaded client and schemas until a host-supported reconnect; they are not forcibly restarted. An installed current bound CLI can use the new behavior without changing that MCP session. Verify the executable actually running through the client release guidance.
Overlapping watches share the existing observation workers and provider-account limits. A new subscriber requires a collection started after its registration, without withholding an already fresh verdict from another subscriber. A subscriber that returns or cancels leaves no freshness demand behind. An in-flight collection stops when no remaining subscriber, CI hint or due fallback check needs it, without replacing previously completed observations. Actual CI hints still request shared fresh proof. The observer supports optional trusted GitHub hints with five-second event coalescing. SHA-only CI hints received during a collection are reconciled with its selected CI commit before publishing the verdict. This holds at most thirty-two distinct unmatched commit hints per active collection; overflow conservatively requires a refresh, and completion or cancellation releases those hints. This slice does not register a signed webhook endpoint; active watches use the shared sixty-second fallback. These are scheduling intervals, not completion deadlines: provider time, account backoff and worker capacity still apply. No per-wait provider polling loop is started. Subscriptions are process-local and bounded; a service restart ends the HTTP subscription, while a capable client's original positive wait can reconnect when every base pin is explicit. A replacement observer never supplies results for a subscription owned by its stopped predecessor.