Skip to content

fix(scheduler): revalidate live merge lifecycle - #2006

Draft
seonghobae wants to merge 10 commits into
fix/scheduler-skip-central-target-inventoryfrom
fix/scheduler-draft-merge-mutation-guard
Draft

fix(scheduler): revalidate live merge lifecycle#2006
seonghobae wants to merge 10 commits into
fix/scheduler-skip-central-target-inventoryfrom
fix/scheduler-draft-merge-mutation-guard

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Root cause

Scheduler inspection filters Draft pull requests, but the irreversible enable_auto_merge and merge_pr entrypoints trusted the caller's already-fetched isDraft snapshot. --match-head-commit protects the head only; it cannot prevent a same-head Ready → Draft lifecycle race.

This bounded successor carries the corresponding valid delta from historical Draft #1231 and remains stacked after #2005.

RED → GREEN

  • Original direct-Draft RED: 2d140a84203a0df0cb86cd6b6ab31fc37bbdbda2
  • Non-force parent reconciliation: 1fbcc508
  • Corrective RED: 897c7e65
    • both mutation entrypoints cover same-head Ready → Draft, moved head, missing live PR, and exact Ready control
  • GREEN implementation: c60a8e03
    • one shared fail-closed boundary reuses the existing authoritative open-PR read
    • repository/PR, explicit live Draft state, and exact current head are revalidated immediately before the guarded mutation
    • existing mutation-actor and expected-head checks remain intact
  • Evidence binding: d739e0d8
    • doctoring and product-gap evidence now reference the reachable remote corrective RED

Verification

Fresh detached verification at exact remote head d739e0d8d6285261da0a2f530181a929f19a202d:

  • python -m py_compile scripts/ci/pr_review_merge_scheduler_core.py
  • python -m pytest tests/test_pr_review_merge_scheduler.py -q343 passed
  • GITHUB_ACTIONS=true python -W error -m pytest tests/test_pr_review_merge_scheduler.py -q343 passed
  • git diff --check fb552daf65eb8fd198b2a4d7641d6e809f5b4d6d..d739e0d8d6285261da0a2f530181a929f19a202d

The new live-mutation branches are exercised by the eight entrypoint scenarios. A standalone whole-module coverage run remains 99.04% because of inherited uncovered lines outside this delta; no 100% whole-module claim is made.

Stack and authority

  • Base: fix/scheduler-skip-central-target-inventory@9293c779b9634859acf7a311be4dba1be8b83008
  • Fast-forward ref updates only; no force push or rebase
  • No review, status, ruleset, credential, or merge protection is weakened
  • Status is Proposed / Ready for review. Ready admits reviewers; ordinary merge still requires all exact-head Checks and a qualifying independent approval

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

@seonghobae seonghobae added bug Something isn't working type: bug Defect or incorrect behavior priority: medium Normal-priority or P2 work labels Sep 7, 2026 — with ChatGPT Codex Connector
Preserve this PR's bounded RED→GREEN delta while integrating protected-main CodeQL fixes through its exact parent branch. No force update; both parent SHAs are recorded.
Preserve the Draft mutation-boundary guard while inheriting current parent fixtures and CodeQL coordinator lineage. No rebase or force update.
seonghobae added a commit that referenced this pull request Sep 8, 2026
Preserve case-insensitive repository identity while inheriting the complete current-main scheduler stack and exact fixture repairs. No rebase or force update.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

P1 — exact-head finding: both new guards read the caller's already-fetched pr dictionary only. They do not re-fetch live PR state immediately before the guarded mutation, so the documented failure scene “Ready PR becomes Draft after inspection” remains possible: a stale isDraft=false snapshot passes and the GitHub mutation still executes. Keep the initial cheap guard, but revalidate repository/PR/current head and live Draft state at the irreversible boundary using the existing bounded host-scoped runner/credential path; fail closed before auto-merge/direct merge. Add an executable race fixture that changes live state after inspection while preserving all expected-head and authorization checks.

Comment thread scripts/ci/pr_review_merge_scheduler_core.py

Copy link
Copy Markdown
Contributor Author

수리 착수: exact fb552daf65eb8fd198b2a4d7641d6e809f5b4d6d의 P1을 재확인했습니다. 현재 구현은 caller snapshot의 isDraft만 검사하므로 inspection 뒤 Ready→Draft 전환을 mutation 직전 차단하지 못합니다. 먼저 parent #2005 exact 9293c779b9634859acf7a311be4dba1be8b83008을 non-force로 흡수하고, 기존 host-scoped runner/credential 경로로 repository/PR/live head/live Draft를 양쪽 irreversible mutation 직전에 재검증하는 executable race RED를 추가한 뒤 최소 수리하겠습니다. 현재 remote owner receipt나 active exact-head model job이 보이지 않아 기존 branch single-writer를 맡습니다. Force/rebase/bypass/lifecycle toggle은 사용하지 않습니다.

@seonghobae seonghobae changed the title fix(scheduler): reject draft merge mutations fix(scheduler): revalidate live merge lifecycle Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Exact-head repair receipt

  • Prior fix(scheduler): revalidate live merge lifecycle #2006 head fb552daf65eb8fd198b2a4d7641d6e809f5b4d6d and repaired parent fix(scheduler): filter central review workflow authority #2005 9293c779b9634859acf7a311be4dba1be8b83008 were preserved as the two parents of non-force reconciliation commit 1fbcc508.
  • Corrective RED 897c7e65 proves stale lifecycle/head/missing-authority races at both mutation entrypoints.
  • GREEN exact head c60a8e03 revalidates live open/Draft/head authority immediately before guarded merge/auto-merge.
  • Fresh detached exact-head evidence: py_compile PASS; scheduler suite 343 passed; GITHUB_ACTIONS=true -W error 343 passed; git diff --check PASS.
  • P1 thread reply is resolved. Hosted exact-head Checks and independent review remain required, so this PR stays Draft/Proposed and is not merged or auto-merged.

The child #2007 must non-force absorb this exact repaired head before its own evidence can be current; no predecessor is closed or treated as replaced.

Copy link
Copy Markdown
Contributor Author

Exact-head follow-up: evidence-link audit found that the first GREEN tree still named the local-only corrective RED SHA. Documentation-only commit d739e0d8 replaces both references with reachable remote RED 897c7e65. The branch was fast-forwarded with force=false. Fresh detached verification at new exact head d739e0d8d6285261da0a2f530181a929f19a202d: py_compile PASS; normal scheduler suite 343 passed; GITHUB_ACTIONS=true -W error 343 passed; git diff --check PASS. Earlier c60a8e03… evidence remains valid for its exact implementation head but is not current-head hosted authority. PR remains Draft/Proposed pending fresh hosted Checks and independent review.

seonghobae added a commit that referenced this pull request Sep 8, 2026
@seonghobae
seonghobae marked this pull request as ready for review September 8, 2026 07:03
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-08T07:08:49.073371Z d739e0d Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copy link
Copy Markdown
Contributor Author

Ready-for-review admission restored at unchanged exact head d739e0d8d6285261da0a2f530181a929f19a202d. Before transition: Runtime Quality 34194765793, SAST 34194765673, and Python Security 34194765652 were terminal GREEN; no unresolved source thread or active model job remained. Security Scan and CodeQL are still queued, and no qualifying independent approval exists. Ready is review admission only: no auto-merge, merge, bypass, or predecessor evidence transfer was performed.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode reviewed the current-head product diff. Coverage is a separate gate.

Changed files

  • CHANGELOG.md — repository behavior
  • docs/doctoring/draft-merge-mutation-boundary.md — operator or user guidance
  • docs/product-technical-gap-baseline.md — operator or user guidance
  • scripts/ci/pr_review_merge_scheduler_core.py — review and security gate shell path
  • tests/test_pr_review_merge_scheduler.py — regression suite

Changed behavior

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Repository file: CHANGELOG.md"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Repository file: CHANGELOG.md"]
  R1 --> V1["required checks"]
  Evidence --> S2["Docs: draft-merge-mutation-boundary.md (2 files)"]
  S2 --> I2["operator or user guidance"]
  I2 --> R2["Review risk: Docs: draft-merge-mutation-boundary.md (2 files)"]
  R2 --> V2["docs review"]
  Evidence --> S3["CI script: pr_review_merge_scheduler_core.py"]
  S3 --> I3["review and security gate shell path"]
  I3 --> R3["Review risk: CI script: pr_review_merge_scheduler_core.py"]
  R3 --> V3["bash -n plus Strix self-test"]
  Evidence --> S4["Test: test_pr_review_merge_scheduler.py"]
  S4 --> I4["regression suite"]
  I4 --> R4["Review risk: Test: test_pr_review_merge_scheduler.py"]
  R4 --> V4["targeted test run"]
Loading

Findings

No source-backed product finding is synthesized from the coverage gate. A coverage miss belongs in the status comment.

  • Head SHA: d739e0d8d6285261da0a2f530181a929f19a202d
  • Workflow run: 34198514532
  • Workflow attempt: 1
  • Coverage gate: failure

Review outcome

Coverage is a gate, not the review. This body reviews the changed product files.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Repository file: CHANGELOG.md"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Repository file: CHANGELOG.md"]
  R1 --> V1["required checks"]
  Evidence --> S2["Docs: draft-merge-mutation-boundary.md (2 files)"]
  S2 --> I2["operator or user guidance"]
  I2 --> R2["Review risk: Docs: draft-merge-mutation-boundary.md (2 files)"]
  R2 --> V2["docs review"]
  Evidence --> S3["CI script: pr_review_merge_scheduler_core.py"]
  S3 --> I3["review and security gate shell path"]
  I3 --> R3["Review risk: CI script: pr_review_merge_scheduler_core.py"]
  R3 --> V3["bash -n plus Strix self-test"]
  Evidence --> S4["Test: test_pr_review_merge_scheduler.py"]
  S4 --> I4["regression suite"]
  I4 --> R4["Review risk: Test: test_pr_review_merge_scheduler.py"]
  R4 --> V4["targeted test run"]
Loading

@opencode-agent

opencode-agent Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

Coverage evidence did not pass, so approval is blocked. The formal pull-request review is the source-backed diff review, not this status comment.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode reviewed the current-head product diff. Coverage is a separate gate.

Changed files

  • CHANGELOG.md — repository behavior
  • docs/doctoring/draft-merge-mutation-boundary.md — operator or user guidance
  • docs/product-technical-gap-baseline.md — operator or user guidance
  • scripts/ci/pr_review_merge_scheduler_core.py — review and security gate shell path
  • tests/test_pr_review_merge_scheduler.py — regression suite

Changed behavior

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Repository file: CHANGELOG.md"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Repository file: CHANGELOG.md"]
  R1 --> V1["required checks"]
  Evidence --> S2["Docs: draft-merge-mutation-boundary.md (2 files)"]
  S2 --> I2["operator or user guidance"]
  I2 --> R2["Review risk: Docs: draft-merge-mutation-boundary.md (2 files)"]
  R2 --> V2["docs review"]
  Evidence --> S3["CI script: pr_review_merge_scheduler_core.py"]
  S3 --> I3["review and security gate shell path"]
  I3 --> R3["Review risk: CI script: pr_review_merge_scheduler_core.py"]
  R3 --> V3["bash -n plus Strix self-test"]
  Evidence --> S4["Test: test_pr_review_merge_scheduler.py"]
  S4 --> I4["regression suite"]
  I4 --> R4["Review risk: Test: test_pr_review_merge_scheduler.py"]
  R4 --> V4["targeted test run"]
Loading

Findings

No source-backed product finding is synthesized from the coverage gate. A coverage miss belongs in the status comment.

  • Head SHA: d739e0d8d6285261da0a2f530181a929f19a202d
  • Workflow run: 34202258714
  • Workflow attempt: 1
  • Coverage gate: failure

Review outcome

Coverage is a gate, not the review. This body reviews the changed product files.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Repository file: CHANGELOG.md"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Repository file: CHANGELOG.md"]
  R1 --> V1["required checks"]
  Evidence --> S2["Docs: draft-merge-mutation-boundary.md (2 files)"]
  S2 --> I2["operator or user guidance"]
  I2 --> R2["Review risk: Docs: draft-merge-mutation-boundary.md (2 files)"]
  R2 --> V2["docs review"]
  Evidence --> S3["CI script: pr_review_merge_scheduler_core.py"]
  S3 --> I3["review and security gate shell path"]
  I3 --> R3["Review risk: CI script: pr_review_merge_scheduler_core.py"]
  R3 --> V3["bash -n plus Strix self-test"]
  Evidence --> S4["Test: test_pr_review_merge_scheduler.py"]
  S4 --> I4["regression suite"]
  I4 --> R4["Review risk: Test: test_pr_review_merge_scheduler.py"]
  R4 --> V4["targeted test run"]
Loading

Copy link
Copy Markdown
Contributor Author

Non-force parent reconciliation completed after the #2005 base advanced.

The live Ready/Draft/head mutation guard and the complete current inventory/CodeQL prerequisite delta are both preserved. Git Data publication used an exact tree and force:false; no force push or rebase was used.

Detached combined verification before publication:

  • GITHUB_ACTIONS=true python -W error -m pytest tests/test_pr_review_merge_scheduler.py tests/test_pr2005_central_inventory_boundary.py tests/test_codeql_pr_workflow_contract.py tests/test_codeql_scan_dispatch_workflow_contract.py -q393 passed
  • python -m py_compile scripts/ci/pr_review_merge_scheduler_core.py → PASS
  • git diff --check d739e0d8…..76928650… equivalent tree → PASS

#2006 remains Draft/Proposed. All predecessor Checks are stale; fresh exact-head hosted Checks and a qualifying independent approval remain mandatory before Ready admission or ordinary merge.

Copy link
Copy Markdown
Contributor Author

Exact-head hosted RCA for 76928650e5894b6cfd0ea189d5e608a0c9b5d61d: Runtime Quality, Python Security, SAST, and Security are GREEN. CodeQL run 34250629946 failed both language shards only after DISPATCH_OUTCOME=success, VERDICT_STATE=pending.

This is the protected-handler convergence gap owned by #2040, not a regression in #2006's lifecycle guard or the restack. The exact repaired handler is still Proposed and is not protected-main authority. No blind rerun or status synthesis was used; #2006 remains Draft until a fresh exact-head CodeQL generation can consume protected handler evidence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: medium Normal-priority or P2 work type: bug Defect or incorrect behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant