feat(review): add .gittensory.yml review.pre_merge_checks (deterministic pre-merge assertions) - #1357
Merged
Merged
Conversation
…tic pre-merge assertions) (#review-pre-merge-checks)
A CodeRabbit-parity gate: a maintainer declares DETERMINISTIC content assertions that a PR must satisfy
before merge — the title/description must contain a phrase, or a label must be present, optionally gated
to a path glob:
review:
pre_merge_checks:
- name: "Migrations documented"
when_paths: ["migrations/**"]
description_contains: "migration"
- name: "Breaking changes labeled"
require_label: "breaking-change"
enforce: true # a failure HARD-BLOCKS the gate (default: advisory only)
Config-only (manifest.review, no DB migration). NO AI judgment is involved — purely title/description/label
substring + glob matching — so this can never cause an AI false-close. A failed check defaults to ADVISORY
(surfaced, never blocks); `enforce: true` makes it a hard blocker (the per-check flag IS the opt-in, like
secret_leak). Empty (default) ⇒ no finding (byte-identical).
- focus-manifest.ts: PreMergeCheck type + `preMergeChecks` on FocusManifestReviewConfig; parse (name +
>=1 assertion required, all public-safe, when_paths via a shared glob-list parser, capped at 50,
per-entry warnings) + serialize; resolveReviewPreMergeChecks(manifest) centralizes the null-manifest
default.
- review/pre-merge-checks.ts: evaluatePreMergeChecks(checks, ctx) — pure, returns one finding per failed
check (pre_merge_check_required when enforce, else pre_merge_check_failed).
- rules/advisory.ts: isConfiguredGateBlocker treats pre_merge_check_required as a hard blocker.
- processors.ts: evaluate the checks over the PR (title/body/labels/changed files) and append the findings
to the advisory BEFORE the gate evaluates; the manifest is the cached settings-resolution load.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1357 +/- ##
==========================================
+ Coverage 95.31% 95.32% +0.01%
==========================================
Files 189 190 +1
Lines 20491 20554 +63
Branches 7394 7421 +27
==========================================
+ Hits 19530 19593 +63
Misses 378 378
Partials 583 583
🚀 New features to boost your workflow:
|
8 tasks
Closed
12 tasks
This was referenced Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A CodeRabbit-parity pre-merge checks gate — the deterministic, safe interpretation. A maintainer declares content assertions a PR must satisfy before merge: the title/description must contain a phrase, or a label must be present, optionally gated to a path glob.
pre_merge_check_failedfinding that never blocks;enforce: truemakes it a hardpre_merge_check_requiredblocker (the per-check flag is the opt-in, mirroringsecret_leak).manifest.review, no DB migration / OpenAPI. Empty (default) ⇒ no finding (byte-identical).Changes
focus-manifest.ts—PreMergeChecktype +preMergeChecks; parse (name + ≥1 assertion required, all public-safe,when_pathsvia a sharedparseManifestGlobList, capped at 50, per-entry warnings) + serialize;resolveReviewPreMergeChecks(manifest)centralizes the null-manifest default.review/pre-merge-checks.ts(new) —evaluatePreMergeChecks(checks, ctx): pure; one finding per failed check, case-insensitive matching,when_pathsgating.rules/advisory.ts—isConfiguredGateBlockertreatspre_merge_check_requiredas a hard blocker.processors.ts— evaluate over the PR (title/body/labels/changed files) and append findings to the advisory before the gate evaluates; uses the already-cached manifest.No linked issue — a config-as-code review enhancement in the CodeRabbit-parity series (follows #1347
review.profile, #1350review.path_instructions, #1353review.exclude_paths).Scope
src/only — config parse + a pure evaluator + one gate-blocker code + threading; no migration/OpenAPI/bindingValidation
npm run test:ci— exit 0; 4366 tests passnpm audit --audit-level=moderate— 0 vulnerabilitiesfocus-manifest.ts,pre-merge-checks.ts,advisory.ts,processors.ts)pre_merge_check_requiredblocks,pre_merge_check_failednever blocks); integration (an enforced failing check produces a failing gate that names the check)Safety