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
30 changes: 30 additions & 0 deletions devtools/command_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,36 @@ def to_dict(self) -> dict[str, object]:
"devtools workspace verify-worktree /realm/worktrees/lane-x --json --strict",
),
),
CommandSpec(
"workspace merge-gate",
"workspace",
"Structural pre-merge safety check: fresh local-verification receipt + no late review comments.",
"devtools.merge_gate",
use_when=(
"Immediately before squash-merging any PR in a merge train, replacing coordinator memory "
"(grace-period comment polling, remembering to run the broader local test suite CI skips "
'per-PR) with a check that fails closed. `record <PR> --command "..."` requires the current '
"checkout to already be the PR's exact head commit with a clean tree (it refuses otherwise), "
"runs a local verification "
"command, and persists a receipt flagging commands that look like they skip tests (e.g. "
"`verify --quick`). `check <PR>` polls review comments across a real grace window (default "
"3x20s, covering CodeRabbit's 30-60s late-arrival window) and BLOCKs unless a receipt exists "
"for the CURRENT head sha within a freshness window with exit_code 0, and no review comment's "
"created_at is newer than the head commit's timestamp unless explicitly `ack`'d for that exact "
"head sha. Motivated by two 2026-08-01 incidents: PR #3502 merged before CodeRabbit's findings "
"posted, and PR #3517 nearly merged with a 43-test regression no CI check or review comment "
"ever flagged -- plus review findings on this tool itself (recording from an unrelated "
"checkout, a --quick example that would have missed its own motivating regression, a single "
"comment snapshot instead of a grace-period poll, and no way to triage a false-positive late "
"comment without an empty commit)."
),
examples=(
'devtools workspace merge-gate record 3517 --command "devtools verify"',
"devtools workspace merge-gate check 3517",
Comment on lines +705 to +707

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Demonstrate a test-running verification command

Operators following this documented example record devtools verify --quick, which explicitly runs no tests and is not the required verification baseline. Consequently the gate's standard workflow can report OK for exactly the test regression it is meant to prevent; use the default devtools verify or an explicit affected-test command in the example and enforce or record the required verification profile.

AGENTS.md reference: AGENTS.md:L341-L343

Useful? React with 👍 / 👎.

"devtools workspace merge-gate check 3517 --json --max-age-s 7200 --poll-rounds 1",
'devtools workspace merge-gate ack 3517 123456789 --reason "already fixed upstream, false positive"',
),
),
CommandSpec(
"workspace merge-conductor",
"workspace",
Expand Down
Loading