Skip to content

Add gate verdict surface with fail-on-gate contract - #298

Merged
EffortlessSteven merged 4 commits into
mainfrom
feat/gate-verdict
Jun 6, 2026
Merged

EffortlessSteven merged 4 commits into
mainfrom
feat/gate-verdict

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

What

Roadmap #23 (ADR 0002): the gate verdict surface that makes intelligent-ci an actual CI gate.

  • review/gate_outcome.json (ub-review.gate_outcome.v1), written immediately after terminal_state.json, plus a gate_outcome event and one factual gate line in running-summary.md.
  • Deterministic verdict: fail iff deterministic blocking reasons exist — required [[proof.required]] requests that failed or timed out (one reason per request, id = policy identifier, receipt = review/proof_receipts.json#<id>), or required-sensor gaps in intelligent-ci (receipt = sensor status file; receipt-absent falls back to review/terminal_state.json). Every fail reason carries a resolvable receipt pointer.
  • Never-red guarantees: model/provider failures, missing model keys, and non-required gaps count only as evidence_gaps_advisory; the model-availability failed-to-review state passes with advisory gaps. Model-flagged proof requests are excluded from the verdict by lane.
  • Exit contract: --fail-on-gate <auto|true|false> (env UB_REVIEW_FAIL_ON_GATE); auto = enforce for intelligent-ci, off for review-byok. Non-zero exit happens only after every artifact is written and names review/gate_outcome.json.
  • action.yml: the build step always runs the binary with --fail-on-gate false; a final "Enforce gate outcome" step reads gate_outcome.json after posting/summary/outputs and exits red per the fail-on-gate input — so a red gate can never suppress the posted PR review. New gate-outcome-path output (renamed from the spec''s gate-outcome for output-naming consistency; ADR/roadmap amended here).

Validation

  • 258 tests pass (16 gate_outcome unit tests incl. the full mapping matrix, per-request reasons, timeout-fail, receipt-absent fallback, model-unavailability-passes); fmt/check/clippy/doc/policy-check clean.
  • Smoke: run --mode intelligent-ci --dry-run exits 0, gate_outcome.json valid, conclusion pass; review-byok exit 0 with auto enforcement off.
  • 3 independent adversarial review lenses (spec conformance, never-red invariant, regression); all 4 high findings fixed before this PR: action-step posting suppression (found by all 3 lenses), model-outage-reddens-gate, plus timeout-bypass and dangling-receipt lows.

Known gaps

  • Required proof with missing receipt / skipped_budget / skipped_profile / non_discriminating / base_patch_failed counts as skipped, not fail (dry-run must stay green; full evidence-gap policy is roadmap Guard lane model summary text #24).
  • Required-sensor gaps block only in intelligent-ci, matching existing terminal-state routing; explicit --fail-on-gate true in review-byok enforces proof failures but not sensor gaps.
  • tool_gates counts are zeroed placeholders until roadmap Guard lane model summary text #24.
  • scripts/verify-bun-review-artifacts.py coverage for the new artifact lands with the dogfood slice (Document Codex lane goal #26).

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jun 6, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@EffortlessSteven, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 38 minutes and 33 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 782a0488-392d-4f82-bfec-c9598a587cdf

📥 Commits

Reviewing files that changed from the base of the PR and between 1918afd and eb739f1.

📒 Files selected for processing (10)
  • README.md
  • action.yml
  • docs/ROADMAP.md
  • docs/adr/0002-single-gate-and-ci-audit-wizard.md
  • policy/allow.toml
  • policy/cargo-allow.toml
  • src/cli.rs
  • src/main.rs
  • tests/cli.rs
  • xtask/src/main.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/gate-verdict

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Jun 6, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.70487% with 23 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
xtask/src/main.rs 0.00% 16 Missing ⚠️
src/main.rs 98.95% 7 Missing ⚠️

📢 Thoughts on this report? Let us know!

@EffortlessSteven

Copy link
Copy Markdown
Member Author

The first run of this PR''s own gate check went red — and the receipts show the enforcement step working exactly as specified. review/gate_outcome.json from run 27049124077: conclusion fail, two required-sensor reasons with resolving receipts (cargo-allow exit 2, cargo-test exit 101). Both were pre-existing failures on main that the gate recorded but never enforced; this PR''s enforcement made them visible:

  1. cargo-allow rejects the ledger: installed release deserializes schema_version as string, ledger had integer 1 (and xtask required integer — the two consumers disagreed). Fixed: ledger now "1", xtask accepts both forms.
  2. cargo-test inside the gate runner: cache_warm_writes_base_and_rule_manifests asserts profile gh-runner but auto box detection resolves gh-runner-full on the tool-installed gate image — and its panic poisoned the shared subprocess lock, cascading into 12 phantom failures. Fixed: test pins --profile gh-runner; the lock recovers from poisoning so one failing test yields one failure receipt.

Net: the red was true, every reason was receipted, and the same artifacts diagnosed the fixes. Roadmap #26''s "deliberate broken PR proves red" got an accidental head start.

@EffortlessSteven
EffortlessSteven merged commit ef4a338 into main Jun 6, 2026
7 checks passed
@EffortlessSteven
EffortlessSteven deleted the feat/gate-verdict branch June 6, 2026 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant