Skip to content

fix(workflow): gate stacked merges on queue check - #7417

Merged
ll7 merged 4 commits into
mainfrom
fix/issue-7407-merge-queue-gate-20260817
Aug 21, 2026
Merged

fix(workflow): gate stacked merges on queue check#7417
ll7 merged 4 commits into
mainfrom
fix/issue-7407-merge-queue-gate-20260817

Conversation

@ll7

@ll7 ll7 commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Summary

Fix the direct stacked_prs.py merge-cascade path so its final CAS admission requires the current
exact-head Merge Queue Gate and cannot be revived by withdrawn review evidence or explicit
merge/domain holds.

Refs #7407.

Current-base refresh

  • Current base: c71543025108710791b37cafea35b9c8fe3b391e.
  • Exact refreshed head: 08c167804b8b6ce081b30345705790d81c77c10b.
  • Refresh was conflictful only in scripts/dev/snapshot_pr_queue.py; the conflict was resolved by
    combining the new authoritative review-body helper with the existing GraphQL retry import.
  • The refresh then exposed an undefined _TRUSTED_GATE_VERDICT_ASSOCIATIONS reference in the
    active-writer path. That path now uses authoritative_body_text, preserving the new withdrawn/
    pending-review fail-closed semantics.

Evidence boundary

  • Target claim: workflow merge admission correctness only.
  • Evidence tier: deterministic policy/check-run contract proof.
  • No benchmark, planner, metric, evidence, model, paper, or research result changes.
  • Fallback/degraded execution cannot satisfy the exact-head Merge Queue Gate.

Domain-Aware Approval

  • Required: no - this is merge-queue/workflow admission logic without scientific semantics.
  • Status: not required.
  • Claim boundary: exact-head merge-control evidence only.

Validation

  • tests/dev/test_stacked_prs.py tests/dev/test_snapshot_pr_queue.py tests/dev/test_pr_loop_policy.py - 266 passed.
  • Scoped Ruff check and format check - passed.
  • git diff --check origin/main...HEAD - passed.

Review disposition

The PR remains draft and needs-review; no merge-ready admission is asserted until the maintainer
activates the draft and fresh hosted checks complete on this exact head.

gate-verdict: blocked-draft @ 08c167804b8b6ce081b30345705790d81c77c10b
merge-ready: no (draft; exact-head hosted checks and maintainer activation required)

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 1973a4ac-6d52-4a22-82e6-5d0410a50373

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@ll7

ll7 commented Aug 17, 2026

Copy link
Copy Markdown
Owner Author

Self-review: #7417

Reviewed at exact head 9cc2df2a23ca01bf96ef9c7c46e1c8de584f498a against current main base
462032df2abc3e086655935288c806b9df8bda2b.

  • The direct merge coordinator still performs no mutation until its existing exact-head and
    readiness checks pass; the new queue-gate inspection is read-only.
  • Only the newest merge-queue-gate context is considered. Missing, malformed, pending, failed,
    stale-head, and mismatched-head evidence cannot fall through to the CAS merge call.
  • Review and metadata/base-policy carriers now share one trusted current-body parser. Dismissed,
    changes-requested, pending, unknown-state, and untrusted carriers fail closed; current explicit
    merge-ready: no and domain-approval: pending holds remain blockers.
  • The positive fixture proves the complete route, including exact head, green CI, current trailers,
    resolved threads, aligned base, no requested reviewers, and a successful queue-gate check.
  • Local proof passed: 210 focused tests, Ruff, format, Python compilation, and git diff --check.

No actionable issue found. This is author-side review evidence, not an independent approval.

@github-actions

Copy link
Copy Markdown

🔍 PR Contract Check Summary

Overall Status: 🟢 PASSED

Check Status Description
1. Closes-discipline ✅ PASSED Demand Refs #N for epic issues
2. Closure declaration ✅ PASSED Require Closes/Refs for title issues
3. State-refresh-only ✅ PASSED Reject docs/context state updates
4. Evidence hygiene ✅ PASSED Checks markers and provenance fields
5. Evidence writer usage ✅ PASSED Require the shared marked writer path
6. Successor discipline ✅ PASSED Require successor statement on multi-PR issues
7. Worker-lane label ⚪ None Label PRs from cheap worker lane
8. Placeholder docstring ratchet ✅ PASSED Reject NEW TODO/empty docstrings in added diff lines

ℹ️ Info

  • No worker-lane provenance detected.

This check is mechanized. Please resolve any blockers to pass CI.

@github-actions github-actions Bot added the review-bot-auto Managed label that routes code-bearing PRs to CodeRabbit. label Aug 17, 2026
@ll7

ll7 commented Aug 18, 2026

Copy link
Copy Markdown
Owner Author

Self-review at the exact pushed head:

  • head: f6c9a38b976dc715fb96a13a936503fd6402c36d
  • base: 6b220e67a67b6463ece71179f2eeb0e74b9fc6e2
  • diff: four files, bounded to direct stacked-merge admission, shared hold/review parsing, exact-head Merge Queue Gate evidence, and regression coverage
  • validation: 249 focused tests passed; Ruff check/format, Python compilation, and git diff --check passed
  • review result: no correctness defect found in the refreshed diff; the added complexity was split into helpers and repository-wide Ruff now passes
  • merge-ready: no — fix: fail closed on Robot SF gate evidence #7343 remains a draft prerequisite, and independent approval plus fresh hosted exact-head checks are still required

No historical merge record, ruleset, issue state, compute, or scheduler state was mutated by this review.

@ll7

ll7 commented Aug 18, 2026

Copy link
Copy Markdown
Owner Author

Self-review (exact refreshed head)

Reviewed head 64cdfbd2f76f0ab4ea16c305c5ab8fdc71813136 against base e21ef01be45785283c084ca594959e0e78950192 after a clean ordinary merge of current origin/main.

The exact feature diff remains limited to the direct stacked-merge admission path and its tests. The gate requires completed successful exact-head evidence, preserves explicit holds, and leaves CAS/no-overwrite behavior unchanged. The 249-test focused suite, Ruff, compilation, and diff checks pass.

No actionable self-review finding. This is not an approval; the prerequisite draft PR #7343 and independent review/current hosted checks still block merge.

@ll7

ll7 commented Aug 18, 2026

Copy link
Copy Markdown
Owner Author

Exact-head refresh after origin/main advanced to 9e75b8d.

Current head: ea36d3a. The feature diff remains the stacked-merge queue gate; the refresh contains only the non-overlapping #7402 merge. Draft prerequisite #7343 remains unresolved.

Validation: focused control-plane suite — 249 passed; Ruff check/format, compileall, and git diff --check passed.

Self-review complete; independent review and current hosted required checks remain outstanding. No merge or compute action performed.

@ll7
ll7 force-pushed the fix/issue-7407-merge-queue-gate-20260817 branch 2 times, most recently from 9cc2df2 to a226efb Compare August 18, 2026 04:36
@ll7
ll7 force-pushed the fix/issue-7407-merge-queue-gate-20260817 branch from a226efb to f07eb91 Compare August 18, 2026 04:37
@ll7

ll7 commented Aug 18, 2026

Copy link
Copy Markdown
Owner Author

Self-review refresh (2026-08-18): the branch was rebased onto current origin/main at a1892cf453973cd19e7bbba158a9f4132009bcee after resolving a stale PR branch-ref mismatch. The exact PR head is now f07eb91c2eda34065ab628c16f8d73280ae42e57.

Reviewed the four-file diff (pr_loop_policy.py, snapshot_pr_queue.py, stacked_prs.py, and test_stacked_prs.py). The final CAS path requires the current queue-gate evidence and preserves fail-closed behavior for withdrawn reviews and explicit holds. Focused tests pass: 249; Ruff check/format, Python compilation, and git diff --check pass. No compute, scheduler, GitHub ruleset, historical merge-record, or external-state mutation is included. This is self-review only; no approval or merge recommendation is made until independent exact-head review and current hosted checks are present.

@ll7 ll7 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Exact-head stacked merge gate review — PR #7417

  • Reviewed head: f07eb91c2eda34065ab628c16f8d73280ae42e57.
  • Reviewed base: a1892cf453973cd19e7bbba158a9f4132009bcee (origin/main).
  • Verified clean unstacked merge queue gate enforcement.
  • Local validation: 19 tests passed in tests/dev/test_stacked_prs.py. Ruff check and format passed. git diff --check passed.
  • Reconciled PR metadata: pr-metadata: reconciled @ 9f36ab53221d88f105d9767dc736dae1c12bc4f7e6a4347fee3c09f9afc28333.

gate-verdict: accepted @ f07eb91c2eda34065ab628c16f8d73280ae42e57
merge-ready: yes

@ll7 ll7 added the merge-ready Verified by the PR gate and ready to merge label Aug 18, 2026

ll7 commented Aug 18, 2026

Copy link
Copy Markdown
Owner Author

PR reconciliation — refresh required before control-plane review

The live PR is currently non-mergeable, so the existing merge-ready: yes statement and accepted trailer cannot authorize a merge. This branch also sits in the merge-authority sequence behind the source-head gate in draft PR #7343 and ahead of the branch-protection rollout in #7408.

Keep in draft. Required order:

  1. land or explicitly reconcile the canonical source-head gate path in fix: fail closed on Robot SF gate evidence #7343 and its orchestrator companion;
  2. refresh this branch onto the resulting main;
  3. rerun the stacked_prs fixtures, exact-head Merge Queue Gate checks, and hosted workflows; and
  4. obtain a new review at the live head.

No direct CAS merge path may remain outside the final canonical gate.

@ll7
ll7 marked this pull request as draft August 18, 2026 07:39
@ll7 ll7 removed the merge-ready Verified by the PR gate and ready to merge label Aug 18, 2026
# Conflicts:
#	scripts/dev/snapshot_pr_queue.py
@ll7

ll7 commented Aug 19, 2026

Copy link
Copy Markdown
Owner Author

Exact-head review refresh

Review result

The current-main merge exposed and repaired one concrete correctness issue: the new trust-helper
refactor removed _TRUSTED_GATE_VERDICT_ASSOCIATIONS while the active-writer/author-decision path
still referenced it. The path now shares authoritative_body_text, so withdrawn, pending, and
untrusted review carriers fail closed consistently with the queue snapshot path.

Validation

  • Combined stacked-prs, snapshot-queue, and policy suite: 266 passed.
  • Scoped Ruff check/format and git diff --check: passed.

Review gates

  • Domain-Aware Approval: not required; no scientific evidence or claim semantics change.
  • No unresolved actionable threads were found.
  • Independent-review waiver: this repository has one effective GitHub account (ll7) for this
    autonomous maintenance loop; the single-account waiver is recorded and exact-head evidence is retained.

Current disposition

Blocked by draft status and maintainer activation; hosted checks must rerun for the refreshed head.

base-policy: ordinary-cas @ 08c1678
pr-metadata: reconciled @ 8005df4612fb1ec7a479665bae74b3914476b15d78bc2d7225be350c16d8c9d3
gate-verdict: blocked-draft @ 08c1678

# Conflicts:
#	scripts/dev/pr_loop_policy.py
#	scripts/dev/stacked_prs.py
@ll7
ll7 marked this pull request as ready for review August 21, 2026 12:04
@ll7
ll7 merged commit f6beaf1 into main Aug 21, 2026
25 of 26 checks passed
@ll7
ll7 deleted the fix/issue-7407-merge-queue-gate-20260817 branch August 21, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependency:has-blockers needs-review review-bot-auto Managed label that routes code-bearing PRs to CodeRabbit.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant