Skip to content

fix(actions): bound agent mention dispatch envelope - #840

Open
seonghobae wants to merge 6 commits into
mainfrom
fix/agent-mention-dispatch-envelope
Open

fix(actions): bound agent mention dispatch envelope#840
seonghobae wants to merge 6 commits into
mainfrom
fix/agent-mention-dispatch-envelope

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

RCA

The organization-wide mention sweep at run 31258218169 / job 93104819883 isolated 402 HTTP 422 failures. Every failure said No more than 10 properties are allowed; 14 were supplied.

Two OpenCode repository-dispatch hops violated GitHub's maximum of ten top-level client_payload properties:

  1. agent_mention_router.py::opencode_payload() emitted 14 properties.
  2. agent-mention-opencode-dispatch.yml emitted another 14-property merge-scheduler payload.

Noema remains within the limit at nine properties.

Fix

  • Replace both OpenCode hops with the same three-property cwl.agent-invocation/v2 envelope: schema, canonical claim, and agent_invocation_key.
  • Preserve the existing canonical claim hash and artifact name, so deployed duplicate suppression remains compatible.
  • Strictly validate exact field sets, types, fixed review-only policy, digest, top-level property count, and the 65,535-character bound before durable ledger claim.
  • Add dedicated merge-scheduler-agent-review-v2 handling while retaining the schema-free legacy merge-scheduler path.
  • Bind execution to a live open PR's exact repository, number, base branch, base SHA, and head SHA at the workflow and CLI boundaries.
  • Route exact-snapshot invocations through a mutation-free review-only scheduler path.
  • Prevent stale snapshot work from cancelling newer scheduler, OpenCode, or Strix runs, including out-of-order pre-validation dispatch races.

Organization-wide validation

  • Audited all 53 repositories visible to the organization automation installation.
  • No sibling repository produces or consumes agent-mention-opencode, merge-scheduler-agent-review-v2, or the nested review_policy/v2 claim schema.
  • Every other live default-branch repository_dispatch builder is within the ten-property limit; no sibling rollout is required.

Exact-current-head verification

Current exact head: ba93f537302086ae54a919ea45c3ca96f2458415 on protected base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba.

  • Agent Mention Router Quality CI: success
  • Strix Changed Path Quality CI: success
  • CodeQL PR: success
  • Python Security: success
  • Security Scan: success
  • SAST Semgrep: success
  • Secret Scan: success
  • OSV-Scanner PR: success
  • Scorecard PR: success
  • SBOM Generation: success
  • all inline review threads: resolved/outdated
  • 1017 passed, 16 subtests passed
  • Exact Agent Mention gate: 2,181 statements / 924 branches / 100%
  • All production Python: 7,110 statements / 2,882 branches / 100%
  • Interrogate docstrings: 100%
  • Python compilation: pass
  • Five modified workflows parse as YAML
  • git diff --check: pass
  • test_strix_quick_gate: PASS

The prior independent review that reported no Critical or Important findings was anchored to predecessor head 826c6eeec7aa5a72ce69521e23c3f6a1b998fe52; it is diagnostic history only and does not transfer to current head ba93f537302086ae54a919ea45c3ca96f2458415. A fresh current-head automated review remains required. The latest CodeRabbit full-review attempt on the current head was organization-rate-limited; reviewer capacity is not a source defect and must not trigger speculative source changes. A qualifying counted independent non-author approval remains a separate governance gate.

This replaces and supersedes #826 without modifying its branch.

Summary by CodeRabbit

  • 개선 사항

    • OpenCode 리뷰 요청에 엄격한 형식·무결성·PR 스냅샷 검증을 적용했습니다.
    • PR 정보가 변경된 오래된 요청은 안전하게 차단합니다.
    • 리뷰 전용 실행에서는 자동 병합과 브랜치 변경을 수행하지 않습니다.
    • 리뷰 작업 간 실행 격리를 강화하고 대기 중인 작업을 보존합니다.
    • 기존 스케줄러 경로와의 호환성을 유지했습니다.
  • 문서

    • 새로운 요청 형식, 검증 절차 및 실행 격리 동작을 문서화했습니다.

Protected deployment status

  • Auto-merge is enabled and continues to honor all branch-protection requirements.
  • Exact-head OpenCode run 31265950492 exhausted its bounded provider pool on attempts 1 and 2 without a schema-valid real-model conclusion.
  • Both attempts failed closed: no OpenCode review was posted, Noema was not dispatched, and the merge scheduler was not invoked.
  • The code and exact-head checks are green; deployment remains intentionally blocked until a qualifying independent exact-head approval is available.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@seonghobae, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 11 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1f61e87e-74cc-4f8b-92e3-9a6a7764221b

📥 Commits

Reviewing files that changed from the base of the PR and between 6eb06cd and 04c68a9.

📒 Files selected for processing (20)
  • .github/workflows/agent-mention-opencode-dispatch.yml
  • .github/workflows/agent-mention-router-quality-ci.yml
  • .github/workflows/opencode-review-dispatch.yml
  • .github/workflows/pr-review-merge-scheduler.yml
  • .github/workflows/strix.yml
  • CHANGELOG.md
  • docs/automation/review-agent-comment-invocation.md
  • scripts/ci/agent_mention_router.py
  • scripts/ci/pr_review_merge_scheduler.py
  • scripts/ci/test_strix_quick_gate.sh
  • tests/test_agent_mention_complete_payload_binding.py
  • tests/test_agent_mention_downstream_idempotency.py
  • tests/test_agent_mention_idempotency.py
  • tests/test_agent_mention_repository_dispatch_envelope.py
  • tests/test_agent_mention_router.py
  • tests/test_agent_mention_workflow_contract.py
  • tests/test_opencode_agent_contract.py
  • tests/test_opencode_workflow_shell_syntax.py
  • tests/test_pr_review_merge_scheduler.py
  • tests/test_required_workflow_queue_contract.py
📝 Walkthrough

Walkthrough

OpenCode 호출을 v2 canonical claim envelope로 변경했습니다. Wrapper와 scheduler가 payload와 PR snapshot을 재검증합니다. 리뷰 전용 경로는 병합과 브랜치 변경을 수행하지 않습니다. OpenCode와 Strix 실행은 run ID 또는 invocation key로 격리됩니다.

Changes

OpenCode v2 호출 계약

Layer / File(s) Summary
v2 envelope 생성 및 검증
.github/workflows/agent-mention-opencode-dispatch.yml, scripts/ci/agent_mention_router.py, tests/test_agent_mention_*.py, tests/test_opencode_workflow_shell_syntax.py
라우터가 schema, canonical claim, invocation key를 포함한 v2 envelope를 생성합니다. Wrapper가 필드, 타입, 정책, hash와 크기를 검증한 뒤 scheduler JSON을 전달합니다.

스케줄러 dispatch 검증

Layer / File(s) Summary
v2 이벤트와 PR snapshot 검증
.github/workflows/pr-review-merge-scheduler.yml, scripts/ci/pr_review_merge_scheduler.py, tests/test_agent_mention_repository_dispatch_envelope.py, tests/test_required_workflow_queue_contract.py
Scheduler가 v2 및 legacy 이벤트를 구분합니다. v2 claim과 live PR의 repository, branch, head SHA와 base SHA를 비교합니다. 검증된 기대값을 Python scheduler에 전달합니다.

스냅샷 보호 리뷰

Layer / File(s) Summary
review-only inspection 및 guarded dispatch
scripts/ci/pr_review_merge_scheduler.py, tests/test_pr_review_merge_scheduler.py
PR 상태, 리뷰, 체크, mergeability, branch freshness와 활성 실행을 검사하는 snapshot-guarded 판단 경로를 추가했습니다. snapshot이 변경되면 dispatch와 취소를 중단합니다. 이 경로는 merge, auto-merge와 branch update를 수행하지 않습니다.

실행 격리와 품질 계약

Layer / File(s) Summary
concurrency 및 검증 범위 갱신
.github/workflows/opencode-review-dispatch.yml, .github/workflows/strix.yml, .github/workflows/agent-mention-router-quality-ci.yml, scripts/ci/test_strix_quick_gate.sh, tests/test_opencode_agent_contract.py, tests/test_required_workflow_queue_contract.py, CHANGELOG.md, docs/automation/review-agent-comment-invocation.md
OpenCode와 Strix repository dispatch가 github.run_id 또는 sender·repository·PR 조합으로 격리됩니다. Scheduler v2 실행은 invocation key를 사용합니다. 품질 workflow, 문서와 관련 계약 테스트를 갱신했습니다.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related issues

  • ContextualWisdomLab/four-pillars#28: PR review scheduler, exact head/base 검증과 OpenCode dispatch를 함께 변경하는 점이 관련됩니다.

Possibly related PRs

Suggested reviewers: opencode-agent

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 77.46% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 에이전트 멘션 디스패치 봉투를 제한하는 이번 변경의 핵심 목적을 정확하고 간결하게 설명합니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/agent-mention-dispatch-envelope

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.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review the exact current head 826c6eeec7aa5a72ce69521e23c3f6a1b998fe52. Focus on the end-to-end repository_dispatch contract, strict snapshot binding, durable-ledger ordering, and stale-event concurrency/cancellation races.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

expected='826c6eeec7aa5a72ce69521e23c3f6a1b998fe52'
actual="$(git rev-parse HEAD)"
printf 'HEAD=%s\nEXPECTED=%s\n' "$actual" "$expected"
git diff-tree --no-commit-id --name-status -r "$expected"
printf '\n--- Python and workflow outlines ---\n'
git diff-tree --no-commit-id --name-only -r "$expected" |
  while IFS= read -r file; do
    case "$file" in
      *.py)
        printf '\n### %s\n' "$file"
        ast-grep outline "$file" --items all --type function,class 2>/dev/null || true
        ;;
      *.yml|*.yaml)
        printf '\n### %s\n' "$file"
        nl -ba "$file" | sed -n '1,260p'
        ;;
    esac
  done

printf '\n--- Relevant contract and concurrency references ---\n'
rg -n -C 4 -g '*.py' -g '*.yml' -g '*.yaml' \
  '(opencode_payload|agent-mention-opencode|merge-scheduler-agent-review-v2|cwl\.agent-invocation/v2|repository_dispatch|client_payload|agent_invocation_key|review_policy|concurrency:|cancel-in-progress|ledger|claim)' .

Length of output: 2376


🏁 Script executed:

#!/bin/bash
set -euo pipefail

commit='826c6eeec7aa5a72ce69521e23c3f6a1b998fe52'
base="${commit}^"

printf '%s\n' '--- Changed implementation diffs ---'
git diff --unified=80 "$base" "$commit" -- \
  .github/workflows/agent-mention-opencode-dispatch.yml \
  .github/workflows/agent-mention-router-quality-ci.yml \
  .github/workflows/opencode-review-dispatch.yml \
  .github/workflows/pr-review-merge-scheduler.yml \
  .github/workflows/strix.yml \
  scripts/ci/agent_mention_router.py \
  scripts/ci/pr_review_merge_scheduler.py

printf '%s\n' '--- Complete changed workflows ---'
for file in \
  .github/workflows/agent-mention-opencode-dispatch.yml \
  .github/workflows/agent-mention-router-quality-ci.yml \
  .github/workflows/opencode-review-dispatch.yml \
  .github/workflows/pr-review-merge-scheduler.yml \
  .github/workflows/strix.yml
do
  printf '\n### %s\n' "$file"
  sed -n '1,420p' "$file"
done

printf '%s\n' '--- Contract-related source definitions and test assertions ---'
grep -nE -C 8 \
  '^(def |class )|opencode_payload|agent_invocation_key|review_policy|repository_dispatch|client_payload|ledger|claim|snapshot|cancel|concurrency|merge-scheduler-agent-review-v2' \
  scripts/ci/agent_mention_router.py \
  scripts/ci/pr_review_merge_scheduler.py \
  tests/test_agent_mention_complete_payload_binding.py \
  tests/test_agent_mention_downstream_idempotency.py \
  tests/test_agent_mention_idempotency.py \
  tests/test_agent_mention_repository_dispatch_envelope.py \
  tests/test_agent_mention_router.py \
  tests/test_opencode_agent_contract.py \
  tests/test_pr_review_merge_scheduler.py \
  tests/test_required_workflow_queue_contract.py || true

Length of output: 202196


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- Python definitions and key references ---'
grep -nE \
  '^(def |class )|AGENT.*(SCHEMA|CLAIM|PAYLOAD)|opencode_payload|validate_.*(payload|claim|invocation|snapshot)|claim_.*(ledger|key)|ledger.*claim|dispatch_(opencode|strix)|active_.*run|force_cancel|inspect_snapshot_bound|validate_expected_pr_snapshot|expected_(head|base)|agent_invocation_key' \
  scripts/ci/agent_mention_router.py \
  scripts/ci/pr_review_merge_scheduler.py || true

printf '%s\n' '--- Workflow section markers ---'
for file in \
  .github/workflows/agent-mention-opencode-dispatch.yml \
  .github/workflows/agent-mention-router-quality-ci.yml \
  .github/workflows/opencode-review-dispatch.yml \
  .github/workflows/pr-review-merge-scheduler.yml \
  .github/workflows/strix.yml
do
  printf '\n### %s\n' "$file"
  grep -nE \
    '^(name:|on:|concurrency:|permissions:|  [A-Za-z0-9_-]+:|      - name:)|repository_dispatch|merge-scheduler-agent-review-v2|cwl\.agent-invocation/v2|client_payload|agent_invocation_key|claim|ledger|concurrency|cancel-in-progress|expected-(head|base)|TARGET_' \
    "$file" || true
done

Length of output: 73580


🏁 Script executed:

#!/bin/bash
set -euo pipefail

show() {
  file="$1"
  start="$2"
  end="$3"
  printf '\n### %s:%s-%s\n' "$file" "$start" "$end"
  sed -n "${start},${end}p" "$file"
}

show scripts/ci/agent_mention_router.py 220 490
show .github/workflows/agent-mention-opencode-dispatch.yml 1 290
show .github/workflows/pr-review-merge-scheduler.yml 86 680
show scripts/ci/pr_review_merge_scheduler.py 1840 2205
show scripts/ci/pr_review_merge_scheduler.py 2281 2535
show scripts/ci/pr_review_merge_scheduler.py 3946 4115
show .github/workflows/strix.yml 66 370

Length of output: 101297


@seonghobae I reviewed commit 826c6eeec7aa5a72ce69521e23c3f6a1b998fe52.

I found no Critical or Important findings in the requested scope.

The review verified these controls:

  • The OpenCode producer and both OpenCode dispatch hops use the three-field cwl.agent-invocation/v2 envelope.
  • The first OpenCode hop validates the exact envelope, exact claim fields, field types, fixed review-only policy, canonical digest, property limit, and size limit before it creates the durable artifact claim.
  • The durable artifact claim occurs before the scheduler dispatch.
  • The scheduler validates the v2 contract again and rejects versioned payloads on the legacy merge-scheduler event.
  • The scheduler validates a live open PR with the exact target repository, PR number, base branch, base SHA, and head SHA.
  • The scheduler CLI re-fetches and revalidates the expected snapshot before inspection.
  • The snapshot-bound path uses the review-only scheduler path. It does not perform cleanup, branch updates, merge actions, or auto-merge actions.
  • Snapshot-guarded OpenCode and Strix dispatches do not cancel a different-head run. They return snapshot_changed.
  • Repository-dispatch Strix runs use run-ID-scoped concurrency. They cannot cancel newer work before live metadata validation rejects stale events.
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (4)
tests/test_agent_mention_repository_dispatch_envelope.py (1)

194-203: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

wrapper의 정책 검증과 형식 검증을 다루는 변이를 추가하세요.

현재 변이 목록은 envelope 키, claim 키, bool 타입, digest, schema만 다룹니다. wrapper의 expected_policy 검사와 정규식 검사(repository, head_sha, base_branch, actor)는 이 파일에서 실행 검증되지 않습니다.

정책 위반 변이는 digest도 함께 갱신해야 해당 분기에 도달합니다. 그렇지 않으면 digest 불일치로 먼저 거부되어 정책 분기를 검증하지 못합니다.

♻️ 제안 변이 추가
         "altered-bound-field",
         "unsupported-schema",
+        "policy-violating-claim",
     ],
 )

정책 변이 처리 분기 예시:

elif mutation == "policy-violating-claim":
    payload["claim"]["update_branches"] = True
    payload["agent_invocation_key"] = hashlib.sha256(
        json.dumps(
            payload["claim"],
            ensure_ascii=True,
            separators=(",", ":"),
            sort_keys=True,
        ).encode("utf-8")
    ).hexdigest()

INVOCATION_KEYPAYLOAD_SCHEMA는 이미 payload에서 읽으므로 추가 변경은 필요하지 않습니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/test_agent_mention_repository_dispatch_envelope.py` around lines 194 -
203, 변이 테스트 목록과 해당 mutation 처리 로직에 expected_policy 위반 변이 및 repository, head_sha,
base_branch, actor 정규식 위반 변이를 추가하세요. policy-violating-claim은 claim 변경 후 payload의
agent_invocation_key도 동일한 정규화·정렬 방식으로 다시 계산해 digest 검증을 통과한 뒤 정책 분기에 도달하게 하며, 각
형식 변이는 해당 필드만 유효하지 않은 값으로 바꾸고 나머지 검증 조건은 유지하세요.
.github/workflows/strix.yml (1)

72-78: 🚀 Performance & Scalability | 🔵 Trivial

repository_dispatch 실행에 대한 동시 실행 상한이 사라집니다.

github.run_id는 dispatch마다 고유하므로 각 실행이 별도 그룹을 가집니다. cancel-in-progress도 해당 이벤트에서 비활성화됩니다. 결과적으로 같은 PR에 대한 Strix 실행이 직렬화되지 않고, 각 실행은 최대 120분 예산을 사용합니다. 중복 억제는 scheduler의 same-head 판정에만 남습니다. 이 트레이드오프는 stale dispatch의 취소를 막기 위한 의도적 선택입니다. Actions 동시 실행 사용량을 관찰하십시오.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/strix.yml around lines 72 - 78, Update the
repository_dispatch concurrency configuration in the workflow’s group expression
to avoid using the unique github.run_id as the group key, so dispatches for the
same target remain serialized and subject to the intended concurrency limit.
Preserve the stale-dispatch protection only if it does not remove same-PR
serialization, and keep cancel-in-progress disabled for repository_dispatch.
.github/workflows/opencode-review-dispatch.yml (1)

15-18: 🚀 Performance & Scalability | 🔵 Trivial

run-id 단위 격리는 PR별 동시 실행 상한을 제거합니다.

이전 그룹은 target repository와 PR 번호를 사용했으므로 같은 PR의 실행이 직렬화되었습니다. 이제 모든 dispatch가 고유 그룹을 가지며 취소도 하지 않습니다. 중복 억제는 scheduler의 active_opencode_run_refs same-head 판정에만 의존합니다. 해당 판정이 지연되거나 실패하면 동일 PR에 대해 최대 325분 예산의 리뷰 job이 병렬로 누적될 수 있습니다.

Actions 동시 실행 사용량과 큐 대기 시간을 모니터링하십시오. 필요하면 조직 수준 러너 상한이나 dispatch 발행 측 rate limit을 함께 두십시오.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/opencode-review-dispatch.yml around lines 15 - 18, Restore
PR-level concurrency grouping in the workflow by deriving group from the target
repository and PR number, while preserving cancel-in-progress behavior that
prevents stale runs from cancelling newer valid work. Update the group
expression near the repository_dispatch configuration and keep duplicate
suppression from depending solely on scheduler active_opencode_run_refs
same-head checks.
scripts/ci/pr_review_merge_scheduler.py (1)

2329-2335: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

승인된 head에서도 "no OpenCode approval" 사유가 출력됩니다.

이 분기는 current_head_approved 확인(2342번 줄)보다 먼저 실행됩니다. 현재 head가 이미 승인된 상태에서 base가 앞서 있으면, 결정 사유가 "current head has no OpenCode approval"로 기록됩니다. 결정 자체는 wait로 올바르지만 운영자가 보는 사유가 실제 상태와 다릅니다. 사유 문자열을 승인 상태에 맞게 분기하십시오.

♻️ 제안 수정
     behind_by = branch_outdated_by_base(pr, merge_state)
     if behind_by and trigger_reviews:
+        approval_state = (
+            "current head is approved"
+            if current_head_approved
+            else "current head has no OpenCode approval"
+        )
         return Decision(
             number,
             "wait",
-            "current head has no OpenCode approval; snapshot-bound review cannot update an outdated branch",
+            f"{approval_state}; snapshot-bound review cannot update an outdated branch",
         )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/ci/pr_review_merge_scheduler.py` around lines 2329 - 2335, Update the
decision-reason selection in the behind_by and trigger_reviews branch to account
for current_head_approved before reporting the missing-approval message.
Preserve the existing wait decision, but use an approval-consistent reason when
the head is already approved and retain the current no-approval reason
otherwise; reuse the current_head_approved check rather than duplicating
approval logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/agent-mention-router-quality-ci.yml:
- Line 23: quality job의 변경 감시 목록이 테스트 파일만 포함하고 소스 모듈을 누락하고 있습니다. 해당 workflow의
paths 목록에 pr_review_fix_scheduler.py 소스 경로를 추가하거나, 테스트 파일 항목을 제거해 소스 변경 시에도 job이
실행되도록 정리하십시오.
- Around line 17-18: quality job의 coverage 및 interrogate 게이트 대상에
pr_review_merge_scheduler.py가 빠져 있습니다. 기존 agent_mention_router.py와
agent_mention_sweep.py를 유지하면서 두 게이트의 검사 대상에
scripts/ci/pr_review_merge_scheduler.py를 추가하고, 해당 파일에도 100% 기준이 적용되도록 수정하십시오.

In `@tests/test_agent_mention_repository_dispatch_envelope.py`:
- Line 138: Remove the unnecessary f-string prefix from the assertion containing
PAYLOAD_SCHEMA, change the doubled braces to the required literal GitHub
expression braces, and use a double-quoted string so the embedded single quotes
need no escaping.

---

Nitpick comments:
In @.github/workflows/opencode-review-dispatch.yml:
- Around line 15-18: Restore PR-level concurrency grouping in the workflow by
deriving group from the target repository and PR number, while preserving
cancel-in-progress behavior that prevents stale runs from cancelling newer valid
work. Update the group expression near the repository_dispatch configuration and
keep duplicate suppression from depending solely on scheduler
active_opencode_run_refs same-head checks.

In @.github/workflows/strix.yml:
- Around line 72-78: Update the repository_dispatch concurrency configuration in
the workflow’s group expression to avoid using the unique github.run_id as the
group key, so dispatches for the same target remain serialized and subject to
the intended concurrency limit. Preserve the stale-dispatch protection only if
it does not remove same-PR serialization, and keep cancel-in-progress disabled
for repository_dispatch.

In `@scripts/ci/pr_review_merge_scheduler.py`:
- Around line 2329-2335: Update the decision-reason selection in the behind_by
and trigger_reviews branch to account for current_head_approved before reporting
the missing-approval message. Preserve the existing wait decision, but use an
approval-consistent reason when the head is already approved and retain the
current no-approval reason otherwise; reuse the current_head_approved check
rather than duplicating approval logic.

In `@tests/test_agent_mention_repository_dispatch_envelope.py`:
- Around line 194-203: 변이 테스트 목록과 해당 mutation 처리 로직에 expected_policy 위반 변이 및
repository, head_sha, base_branch, actor 정규식 위반 변이를 추가하세요.
policy-violating-claim은 claim 변경 후 payload의 agent_invocation_key도 동일한 정규화·정렬
방식으로 다시 계산해 digest 검증을 통과한 뒤 정책 분기에 도달하게 하며, 각 형식 변이는 해당 필드만 유효하지 않은 값으로 바꾸고 나머지
검증 조건은 유지하세요.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6d598337-0ae6-4383-8542-9d9f4d1a5ccb

📥 Commits

Reviewing files that changed from the base of the PR and between 6eb06cd and 826c6ee.

📒 Files selected for processing (19)
  • .github/workflows/agent-mention-opencode-dispatch.yml
  • .github/workflows/agent-mention-router-quality-ci.yml
  • .github/workflows/opencode-review-dispatch.yml
  • .github/workflows/pr-review-merge-scheduler.yml
  • .github/workflows/strix.yml
  • CHANGELOG.md
  • docs/automation/review-agent-comment-invocation.md
  • scripts/ci/agent_mention_router.py
  • scripts/ci/pr_review_merge_scheduler.py
  • scripts/ci/test_strix_quick_gate.sh
  • tests/test_agent_mention_complete_payload_binding.py
  • tests/test_agent_mention_downstream_idempotency.py
  • tests/test_agent_mention_idempotency.py
  • tests/test_agent_mention_repository_dispatch_envelope.py
  • tests/test_agent_mention_router.py
  • tests/test_opencode_agent_contract.py
  • tests/test_opencode_workflow_shell_syntax.py
  • tests/test_pr_review_merge_scheduler.py
  • tests/test_required_workflow_queue_contract.py

Comment thread .github/workflows/agent-mention-router-quality-ci.yml
Comment thread .github/workflows/agent-mention-router-quality-ci.yml
Comment thread tests/test_agent_mention_repository_dispatch_envelope.py Outdated

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please perform one fresh full review of unchanged exact head ba93f537302086ae54a919ea45c3ca96f2458415 against protected base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. The only prior formal CodeRabbit review is anchored to predecessor head 826c6eeec7aa5a72ce69521e23c3f6a1b998fe52; do not transfer it. Focus on the end-to-end cwl.agent-invocation/v2 dispatch envelope, exact live-PR snapshot binding, durable-ledger-before-forward ordering, review-only mutation denial, and stale-event concurrency/cancellation behavior. Current exact-head machine gates are green and all existing inline threads are resolved, but neither fact substitutes for a current-head review or the separately required counted independent human approval. If organization review capacity is unavailable, report that capacity condition once; no retry is requested by this comment.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

@seonghobae I will perform a fresh full review of head ba93f537302086ae54a919ea45c3ca96f2458415 against base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba.

The review will not transfer conclusions from the predecessor-head review. It will examine the v2 dispatch envelope, live-PR snapshot binding, ledger-before-forward ordering, review-only mutation denial, and stale-event concurrency and cancellation behavior.

⚠️ Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 4 minutes.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review the unchanged exact head ba93f537302086ae54a919ea45c3ca96f2458415 against protected-base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. Re-evaluate the complete current v2 dispatch-envelope and snapshot-binding diff; do not transfer predecessor-head review conclusions.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

@seonghobae I will perform a fresh full review of head ba93f537302086ae54a919ea45c3ca96f2458415 against base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba.

I will evaluate the current cwl.agent-invocation/v2 dispatch-envelope and snapshot-binding diff independently. I will not transfer conclusions from the predecessor-head review.

⚠️ Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 26 minutes.

@seonghobae
seonghobae enabled auto-merge (squash) August 8, 2026 18:42

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please perform one fresh full review of unchanged exact head ba93f537302086ae54a919ea45c3ca96f2458415 against protected base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. The last recorded organization cooldown for this exact head was 26 minutes and has elapsed. Treat this strictly as current-head automated review evidence: do not infer counted independent human approval from it. Focus on the v2 three-property dispatch envelope, canonical claim/digest validation, live PR snapshot binding, review-only scheduler path, and the concurrency isolation tradeoff. Report only findings that remain valid on this exact head; do not revive predecessor-head comments.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

@seonghobae I will perform a fresh full review of head ba93f537302086ae54a919ea45c3ca96f2458415 against base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba.

I will evaluate only findings valid on this exact head. I will not transfer predecessor-head conclusions or treat this automated review as human approval.

⚠️ Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 6 minutes.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please complete one fresh full automated review of unchanged exact head ba93f537302086ae54a919ea45c3ca96f2458415 against protected base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. Revalidation now shows every exposed exact-head machine workflow is terminal-success and all inline threads are resolved/outdated. The last current-head invocation (5227663264) acknowledged the request more than eight hours ago but never produced a completed formal/current-head review; treat that as abandoned reviewer execution, not a source defect. Focus only on the current v2 three-property dispatch envelope, canonical claim/digest and policy validation, live-PR snapshot binding, durable-ledger-before-forward ordering, review-only mutation denial, and concurrency isolation tradeoffs. Do not transfer predecessor-head conclusions, and do not treat this automated review as the separately required counted human approval. If capacity is unavailable, report the capacity state once without suggesting source changes.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='ba93f537302086ae54a919ea45c3ca96f2458415'
base='6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba'

printf '%s\n' '--- Exact revision check ---'
printf 'HEAD=%s\n' "$(git rev-parse HEAD)"
printf 'REQUESTED_HEAD=%s\nREQUESTED_BASE=%s\n' "$head" "$base"
git cat-file -e "${head}^{commit}"
git cat-file -e "${base}^{commit}"
git merge-base --is-ancestor "$base" "$head"
printf 'BASE_IS_ANCESTOR=true\n'

printf '%s\n' '--- Base-to-head changed files ---'
git diff --name-status "$base" "$head"

printf '%s\n' '--- Relevant Python outlines ---'
for f in scripts/ci/agent_mention_router.py scripts/ci/pr_review_merge_scheduler.py; do
  if [ -f "$f" ]; then
    printf '\n### %s\n' "$f"
    ast-grep outline "$f" --items all --type function,class --view expanded || true
  fi
done

printf '%s\n' '--- Relevant workflow anchors ---'
for f in \
  .github/workflows/agent-mention-opencode-dispatch.yml \
  .github/workflows/opencode-review-dispatch.yml \
  .github/workflows/pr-review-merge-scheduler.yml \
  .github/workflows/strix.yml
do
  if [ -f "$f" ]; then
    printf '\n### %s\n' "$f"
    rg -n -C 3 \
      'repository_dispatch|client_payload|cwl\.agent-invocation/v2|merge-scheduler-agent-review-v2|concurrency:|cancel-in-progress|artifact|claim|expected-(head|base)|TARGET_|auto-merge|update-branch' \
      "$f" || true
  fi
done

Length of output: 122178


🏁 Script executed:

#!/bin/bash
set -euo pipefail

base='6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba'
head='ba93f537302086ae54a919ea45c3ca96f2458415'

printf '%s\n' '--- Focused base-to-head implementation diff ---'
git diff --unified=35 "$base" "$head" -- \
  scripts/ci/agent_mention_router.py \
  scripts/ci/pr_review_merge_scheduler.py \
  .github/workflows/agent-mention-opencode-dispatch.yml \
  .github/workflows/pr-review-merge-scheduler.yml \
  .github/workflows/opencode-review-dispatch.yml \
  .github/workflows/strix.yml

printf '%s\n' '--- Router invocation payload implementation ---'
sed -n '220,455p' scripts/ci/agent_mention_router.py

printf '%s\n' '--- Scheduler dispatch and snapshot-bound inspection ---'
sed -n '1840,2215p' scripts/ci/pr_review_merge_scheduler.py
sed -n '2281,2715p' scripts/ci/pr_review_merge_scheduler.py
sed -n '3940,4135p' scripts/ci/pr_review_merge_scheduler.py

printf '%s\n' '--- Wrapper ledger forwarding step ---'
sed -n '30,285p' .github/workflows/agent-mention-opencode-dispatch.yml

printf '%s\n' '--- Scheduler targeted-dispatch validation and invocation ---'
sed -n '225,690p' .github/workflows/pr-review-merge-scheduler.yml

printf '%s\n' '--- Current-head contract-test anchors ---'
rg -n -C 4 \
  'three|property|envelope|canonical|invocation|ledger|snapshot|expected_(head|base)|review-only|snapshot_changed|cancel|concurrency|merge-scheduler-agent-review-v2' \
  tests/test_agent_mention_repository_dispatch_envelope.py \
  tests/test_opencode_workflow_shell_syntax.py \
  tests/test_pr_review_merge_scheduler.py \
  tests/test_required_workflow_queue_contract.py \
  tests/test_opencode_agent_contract.py

Length of output: 166339


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- Dispatch and active-run implementation ---'
sed -n '1840,2210p' scripts/ci/pr_review_merge_scheduler.py

printf '%s\n' '--- Snapshot-bound inspection implementation ---'
sed -n '2281,2495p' scripts/ci/pr_review_merge_scheduler.py

printf '%s\n' '--- Router claim and payload implementation ---'
sed -n '220,425p' scripts/ci/agent_mention_router.py

printf '%s\n' '--- Changed lines only: requested implementation surfaces ---'
git diff --unified=8 \
  6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba \
  ba93f537302086ae54a919ea45c3ca96f2458415 -- \
  scripts/ci/pr_review_merge_scheduler.py \
  scripts/ci/agent_mention_router.py \
  .github/workflows/agent-mention-opencode-dispatch.yml \
  .github/workflows/pr-review-merge-scheduler.yml \
  .github/workflows/opencode-review-dispatch.yml \
  .github/workflows/strix.yml \
  | rg -n -C 6 '^\+|^-\s|^@@|snapshot_guarded|snapshot_changed|active_.*run|force_cancel|dispatch_(opencode|strix)|opencode_payload|OPENCODE_INVOCATION_SCHEMA|concurrency|cancel-in-progress|upload-artifact|dispatches|expected-(head|base)'

printf '%s\n' '--- Workflow syntax parser checks available in repository tests ---'
rg -n -C 2 \
  'agent_mention_repository_dispatch_envelope|test_opencode_workflow_shell_syntax|test_pr_review_merge_scheduler|test_required_workflow_queue_contract' \
  .github/workflows/agent-mention-router-quality-ci.yml

Length of output: 102232


@seonghobae I completed a fresh review of exact head ba93f537302086ae54a919ea45c3ca96f2458415 against protected base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba.

I found no Critical or Important findings in the requested scope.

I verified the following current-head controls:

  • The OpenCode producer emits the three-property cwl.agent-invocation/v2 envelope.
  • The wrapper and scheduler validate the envelope fields, claim fields, types, fixed review-only policy, canonical claim digest, property count, and payload size.
  • The wrapper creates the durable artifact-ledger claim before it forwards the scheduler dispatch.
  • The scheduler rejects versioned payloads on the legacy merge-scheduler event.
  • The scheduler binds the request to the exact live repository, PR number, base branch, base SHA, and head SHA.
  • The CLI validates the expected snapshot, re-fetches the PR, and validates the snapshot again before inspection.
  • The snapshot-bound path does not clean up reviews, update branches, enable or disable auto-merge, or merge.
  • Snapshot-guarded OpenCode and Strix dispatches do not cancel a different-head run. They return snapshot_changed.
  • The OpenCode and Strix repository_dispatch concurrency settings prevent a delayed stale event from canceling newer valid work before live metadata validation.

This review is current-head automated review evidence only. It does not represent counted independent human approval.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please perform one fresh full automated review of unchanged exact head ba93f537302086ae54a919ea45c3ca96f2458415 against protected base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. The immediately preceding current-head retry was rate-limited and reported the next included review would be available in 6 minutes; that cooldown has long elapsed. Revalidate the current head before starting and do not transfer predecessor-head review conclusions. Focus on the strict three-key cwl.agent-invocation/v2 envelope, canonical claim/digest/policy validation, live-PR snapshot binding, durable-ledger-before-forward ordering, review-only mutation denial, and concurrency isolation. If organization capacity is still unavailable, report that capacity state once; do not suggest speculative source changes. This automated review is not a substitute for the separately required counted independent human approval.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

@seonghobae I will perform a fresh full automated review of exact head ba93f537302086ae54a919ea45c3ca96f2458415 against protected base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba.

I will revalidate the revisions before review. I will assess only the current diff. I will not transfer predecessor-head conclusions. The review will cover the v2 envelope, claim and policy validation, snapshot binding, ledger ordering, review-only behavior, and concurrency isolation.

✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/agent-mention-router-quality-ci.yml (1)

119-134: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

pr_review_fix_scheduler.py를 품질 게이트에 추가하십시오.

이 파일은 트리거 경로에는 있지만 coverage include 목록과 interrogate 대상에는 없습니다. 두 목록에 추가하십시오. 트리거 경로 수를 검사하는 workflow.count(...) == 2 단언은 수정하지 않아도 됩니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/agent-mention-router-quality-ci.yml around lines 119 -
134, Update the quality-gate configuration around the coverage include list and
the interrogate command to add scripts/ci/pr_review_fix_scheduler.py to both.
Leave the workflow.count(...) == 2 assertion unchanged.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/ci/test_strix_quick_gate.sh`:
- Around line 516-524: Remove the queue: max assertion from the test block
around workflow concurrency checks in test_strix_quick_gate.sh, including its
associated “preserves pending runs” assertion, so the test no longer requires
the unsupported concurrency key. Keep the valid group and cancel-in-progress
assertions unchanged.

---

Nitpick comments:
In @.github/workflows/agent-mention-router-quality-ci.yml:
- Around line 119-134: Update the quality-gate configuration around the coverage
include list and the interrogate command to add
scripts/ci/pr_review_fix_scheduler.py to both. Leave the workflow.count(...) ==
2 assertion unchanged.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8e9557e7-d484-432d-a1c7-e10bcc74f0a5

📥 Commits

Reviewing files that changed from the base of the PR and between 6eb06cd and ba93f53.

📒 Files selected for processing (20)
  • .github/workflows/agent-mention-opencode-dispatch.yml
  • .github/workflows/agent-mention-router-quality-ci.yml
  • .github/workflows/opencode-review-dispatch.yml
  • .github/workflows/pr-review-merge-scheduler.yml
  • .github/workflows/strix.yml
  • CHANGELOG.md
  • docs/automation/review-agent-comment-invocation.md
  • scripts/ci/agent_mention_router.py
  • scripts/ci/pr_review_merge_scheduler.py
  • scripts/ci/test_strix_quick_gate.sh
  • tests/test_agent_mention_complete_payload_binding.py
  • tests/test_agent_mention_downstream_idempotency.py
  • tests/test_agent_mention_idempotency.py
  • tests/test_agent_mention_repository_dispatch_envelope.py
  • tests/test_agent_mention_router.py
  • tests/test_agent_mention_workflow_contract.py
  • tests/test_opencode_agent_contract.py
  • tests/test_opencode_workflow_shell_syntax.py
  • tests/test_pr_review_merge_scheduler.py
  • tests/test_required_workflow_queue_contract.py

Comment thread scripts/ci/test_strix_quick_gate.sh
@opencode-agent
opencode-agent Bot disabled auto-merge August 9, 2026 05:09

Copy link
Copy Markdown
Contributor Author

RCA on the current CodeRabbit queue: max finding: the finding is not valid against current GitHub Actions semantics. GitHub's current official concurrency documentation explicitly supports queue: max, which allows up to 100 pending jobs/runs in a concurrency group; the documented incompatibility is combining queue: max with cancel-in-progress: true. This workflow deliberately uses cancel-in-progress: false, so retaining queue: max is valid and preserves the intended bounded pending queue. Removing it would restore the single-pending replacement behavior this control is meant to avoid.

Primary docs:

No source change is made for that finding. Separately, the valid current-head quality-gate finding was addressed in descendant commit 04c68a997b658019a1df9958a6bfe88ec72f792c: scripts/ci/pr_review_fix_scheduler.py is now included in both 100% branch-coverage measurement and the 100% interrogate docstring gate. All predecessor-head check/review evidence is stale after that commit; exact-head gates must rerun.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact current head 04c68a997b658019a1df9958a6bfe88ec72f792c against protected base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. The only source change since your prior current-head review adds scripts/ci/pr_review_fix_scheduler.py to the Agent Mention Router Quality CI 100% branch-coverage and 100% interrogate targets. The prior queue: max finding was revalidated against current GitHub Actions primary documentation and rejected without source change because queue: max is supported with cancel-in-progress: false; the review thread is resolved with that RCA recorded. Treat all predecessor-head review/check evidence as stale.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base='6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba'
head='04c68a997b658019a1df9958a6bfe88ec72f792c'

printf '%s\n' '--- Revision verification ---'
printf 'checked_out=%s\nrequested_head=%s\nrequested_base=%s\n' \
  "$(git rev-parse HEAD)" "$head" "$base"
git cat-file -e "${base}^{commit}"
git cat-file -e "${head}^{commit}"
git merge-base --is-ancestor "$base" "$head"
printf 'base_is_ancestor=true\n'

printf '%s\n' '--- Base-to-head changed files ---'
git diff --name-status "$base" "$head"

printf '%s\n' '--- Descendant change from previous reviewed head ---'
git diff --unified=80 \
  ba93f537302086ae54a919ea45c3ca96f2458415 "$head" -- \
  .github/workflows/agent-mention-router-quality-ci.yml

printf '%s\n' '--- Changed workflow outline and relevant sections ---'
nl -ba .github/workflows/agent-mention-router-quality-ci.yml | sed -n '1,360p'

printf '%s\n' '--- Quality-gate contract references ---'
rg -n -C 5 \
  'pr_review_fix_scheduler\.py|pr_review_merge_scheduler\.py|coverage|interrogate|agent-mention-router-quality-ci' \
  .github/workflows/agent-mention-router-quality-ci.yml \
  tests \
  scripts/ci \
  -g '*.py' -g '*.yml' -g '*.yaml' -g '*.sh' \
  || true

printf '%s\n' '--- Target script outline ---'
ast-grep outline scripts/ci/pr_review_fix_scheduler.py \
  --items all --type function,class --view expanded 2>/dev/null || true

Length of output: 7220


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- Complete quality workflow ---'
sed -n '1,300p' .github/workflows/agent-mention-router-quality-ci.yml

printf '%s\n' '--- Workflow target lines ---'
grep -n -E -C 4 \
  'agent-mention-coveragerc|include =|pr_review_(fix|merge)_scheduler\.py|interrogate|coverage (run|report)' \
  .github/workflows/agent-mention-router-quality-ci.yml

printf '%s\n' '--- Locate and inspect fix-scheduler coverage tests ---'
find tests -maxdepth 1 -type f -name 'test_pr_review_fix_scheduler*.py' -print \
  -exec sed -n '1,360p' {} \;

printf '%s\n' '--- References to exclusion or coverage configuration ---'
grep -RInE -C 3 \
  'pr_review_fix_scheduler|# pragma: no cover|omit[[:space:]]*=|exclude_lines|interrogate' \
  .github/workflows tests scripts/ci \
  --include='*.py' --include='*.yml' --include='*.yaml' \
  || true

printf '%s\n' '--- Fix scheduler structure ---'
grep -nE '^(class |def |if __name__)' scripts/ci/pr_review_fix_scheduler.py
sed -n '1,260p' scripts/ci/pr_review_fix_scheduler.py

Length of output: 75062


@seonghobae I reviewed exact head 04c68a997b658019a1df9958a6bfe88ec72f792c against protected base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba.

I found no Critical or Important findings.

I confirmed that the quality workflow now:

  • Includes scripts/ci/pr_review_fix_scheduler.py in branch coverage with branch = True and fail_under = 100.
  • Includes scripts/ci/pr_review_fix_scheduler.py in the interrogate --fail-under=100 command.
  • Triggers on fix-scheduler and fix-scheduler coverage-test changes for both pull_request and push.
  • Does not exclude the fix scheduler from the configured coverage report.

This result applies only to the exact reviewed head. It does not reuse predecessor-head review or check evidence.


✏️ Learnings added
Learnt from: seonghobae
URL: https://github.com/ContextualWisdomLab/.github/pull/840

Timestamp: 2026-08-09T06:08:06.646Z
Learning: GitHub Actions supports `queue: max` in a concurrency group. In `.github/workflows/opencode-review-dispatch.yml`, `queue: max` is intentional and valid with `cancel-in-progress: false`; it preserves a bounded pending queue and must not be reported as unsupported on that basis.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please perform a fresh full review of exact current head 04c68a997b658019a1df9958a6bfe88ec72f792c against protected base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. Re-fetch both identities before reviewing and do not reuse predecessor-head findings as current evidence. The exact-head Agent Mention Router Quality CI, Strix, CodeQL, Python Security, Security Scan, Semgrep, Secret Scan, OSV, Scorecard, and SBOM runs are terminal-success. Review the complete base-to-head diff, including the quality-surface follow-up, and report only current source-backed findings. Do not treat queue: max as unsupported absent contrary current GitHub documentation/runtime evidence; its removal would reintroduce the pending-run replacement failure this PR addresses.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base='6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba'
head='04c68a997b658019a1df9958a6bfe88ec72f792c'

printf '%s\n' '--- Revision identity ---'
printf 'checked_out=%s\nrequested_head=%s\nrequested_base=%s\n' \
  "$(git rev-parse HEAD)" "$head" "$base"
git cat-file -e "${base}^{commit}"
git cat-file -e "${head}^{commit}"
git merge-base --is-ancestor "$base" "$head"
printf 'base_is_ancestor=true\n'

printf '%s\n' '--- Complete base-to-head file list ---'
git diff --name-status "$base" "$head"

printf '%s\n' '--- Changed source and test outlines ---'
git diff --name-only "$base" "$head" |
  while IFS= read -r file; do
    case "$file" in
      *.py)
        printf '\n### %s\n' "$file"
        ast-grep outline "$file" --items all --type function,class --view expanded 2>/dev/null || true
        ;;
    esac
  done

printf '%s\n' '--- Focused contract locations ---'
rg -n -C 3 \
  'cwl\.agent-invocation/v2|client_payload|merge-scheduler-agent-review-v2|agent_invocation_key|canonical|snapshot_guarded|snapshot_changed|dispatch_(opencode|strix)|active_.*run|force_cancel|concurrency:|cancel-in-progress|queue: max|upload-artifact|expected-(head|base)|auto-merge|update-branch|pr_review_fix_scheduler\.py|interrogate|coverage' \
  .github/workflows scripts/ci tests \
  -g '*.py' -g '*.yml' -g '*.yaml' -g '*.sh'

Length of output: 201856


🏁 Script executed:

#!/bin/bash
set -euo pipefail

base='6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba'
head='04c68a997b658019a1df9958a6bfe88ec72f792c'

printf '%s\n' '--- Changed files ---'
git diff --name-status "$base" "$head"

printf '%s\n' '--- Focused implementation diff ---'
git diff --unified=20 "$base" "$head" -- \
  .github/workflows/agent-mention-opencode-dispatch.yml \
  .github/workflows/agent-mention-router-quality-ci.yml \
  .github/workflows/opencode-review-dispatch.yml \
  .github/workflows/pr-review-merge-scheduler.yml \
  .github/workflows/strix.yml \
  scripts/ci/agent_mention_router.py \
  scripts/ci/pr_review_merge_scheduler.py \
  tests/test_agent_mention_complete_payload_binding.py \
  tests/test_agent_mention_downstream_idempotency.py \
  tests/test_agent_mention_idempotency.py \
  tests/test_agent_mention_repository_dispatch_envelope.py \
  tests/test_agent_mention_router.py \
  tests/test_opencode_agent_contract.py \
  tests/test_opencode_workflow_shell_syntax.py \
  tests/test_pr_review_merge_scheduler.py \
  tests/test_required_workflow_queue_contract.py \
  tests/test_agent_mention_workflow_contract.py

printf '%s\n' '--- Wrapper: validation, ledger, forwarding ---'
sed -n '30,310p' .github/workflows/agent-mention-opencode-dispatch.yml

printf '%s\n' '--- Scheduler workflow: concurrency, validation, execution arguments ---'
sed -n '1,90p' .github/workflows/pr-review-merge-scheduler.yml
sed -n '210,620p' .github/workflows/pr-review-merge-scheduler.yml

printf '%s\n' '--- Scheduler implementation: dispatch and snapshot paths ---'
rg -n -C 12 \
  '^def (dispatch_opencode_review|dispatch_strix_evidence|validate_expected_pr_snapshot|inspect_pr|main)\b|snapshot_guarded|snapshot_changed|active_.*run|force_cancel|expected_(head|base)|enable_auto_merge|update_branches' \
  scripts/ci/pr_review_merge_scheduler.py

printf '%s\n' '--- Quality workflow follow-up ---'
sed -n '1,260p' .github/workflows/agent-mention-router-quality-ci.yml

Length of output: 118779


🏁 Script executed:

#!/bin/bash
set -euo pipefail

base='6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba'
head='04c68a997b658019a1df9958a6bfe88ec72f792c'

printf '%s\n' '--- Exact changed-file summary ---'
git diff --stat "$base" "$head"
git diff --name-status "$base" "$head"

printf '%s\n' '--- Snapshot-bound review implementation ---'
sed -n '2200,2505p' scripts/ci/pr_review_merge_scheduler.py

printf '%s\n' '--- Scheduler workflow concurrency and inspection invocation ---'
sed -n '85,145p' .github/workflows/pr-review-merge-scheduler.yml
sed -n '600,760p' .github/workflows/pr-review-merge-scheduler.yml

printf '%s\n' '--- OpenCode and Strix repository-dispatch concurrency ---'
sed -n '1,85p' .github/workflows/opencode-review-dispatch.yml
sed -n '1,120p' .github/workflows/strix.yml

printf '%s\n' '--- Current-head regression tests for review-only and stale-event boundaries ---'
rg -n -C 4 \
  'snapshot_bound|snapshot_guarded|snapshot_changed|no.*mutation|cleanup|enable_auto_merge|update_branch|force_cancel|different-head|different_head|run-id|queue: max|expected_base_sha|expected_head_sha' \
  tests/test_pr_review_merge_scheduler.py \
  tests/test_agent_mention_repository_dispatch_envelope.py \
  tests/test_opencode_workflow_shell_syntax.py \
  tests/test_required_workflow_queue_contract.py \
  tests/test_opencode_agent_contract.py

Length of output: 129521


@seonghobae I completed a fresh review of exact head 04c68a997b658019a1df9958a6bfe88ec72f792c against protected base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba.

I verified both revision identities before the review. The base commit is an ancestor of the reviewed head.

I found no Critical or Important source-backed findings.

I verified these current-head controls:

  • The OpenCode producer, wrapper, and scheduler use the strict three-key cwl.agent-invocation/v2 envelope.
  • The wrapper and scheduler validate exact envelope fields, claim fields, types, fixed review-only policy, canonical SHA-256 claim digest, property count, and payload size.
  • The wrapper uploads the durable artifact-ledger claim before it forwards the scheduler dispatch.
  • The scheduler rejects versioned payloads on the legacy merge-scheduler event.
  • The scheduler validates the exact live target repository, PR number, base branch, base SHA, and head SHA.
  • The scheduler re-fetches and validates the expected snapshot before inspection.
  • The snapshot-bound path only dispatches review evidence. It does not clean up reviews, update branches, enable or disable auto-merge, or merge.
  • Snapshot-guarded OpenCode and Strix dispatches do not cancel a different-head run. They return snapshot_changed.
  • OpenCode dispatch concurrency retains pending work with cancel-in-progress: false and queue: max.
  • Strix repository-dispatch runs use run-ID-scoped concurrency. They cannot cancel newer valid evidence before live metadata validation.
  • The quality workflow includes scripts/ci/pr_review_fix_scheduler.py in both the 100% branch-coverage target and the 100% interrogate target.

This is automated current-head review evidence only. It is not counted independent human approval.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@cwl-noema-review Please review the exact current head 04c68a997b658019a1df9958a6bfe88ec72f792c. Treat predecessor-head reviews/checks as historical only. Focus on the versioned cwl.agent-invocation/v2 repository-dispatch envelope, exact source/live-base snapshot binding, replay/idempotency, concurrency isolation, least-privilege credential boundaries, and whether the original HTTP 422 top-level-property failure is closed without creating a stale-dispatch cancellation or merge-authority regression.

Copy link
Copy Markdown
Contributor Author

Current-head review clarification for 04c68a997b658019a1df9958a6bfe88ec72f792c: the prior CodeRabbit claim that GitHub Actions concurrency supports only group and cancel-in-progress is stale/incorrect against current official GitHub documentation. GitHub now documents optional queue with single (default) or max; queue: max permits up to 100 pending runs and is invalid only when combined with cancel-in-progress: true. This PR's queued review paths use non-cancelling semantics, so do not remove queue: max merely to satisfy that predecessor finding. Treat current official workflow syntax and limits documentation as authority. The one commit after ba93f537... only adds pr_review_fix_scheduler.py to the existing quality coverage/interrogate gate.

@coderabbitai review
@cwl-noema-review @opencode-agent Review only exact current head 04c68a997b658019a1df9958a6bfe88ec72f792c, including the current documented queue: max semantics. Review only; do not modify, merge, retarget, or change credentials/rulesets.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

@seonghobae I will perform a fresh full review of exact head 04c68a997b658019a1df9958a6bfe88ec72f792c against protected base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba.

I will review only the current base-to-head diff. I will not modify, merge, retarget, or change credentials or rulesets.

I will assess the v2 envelope, snapshot binding, replay and idempotency controls, concurrency isolation, credential boundaries, and the queue: max configuration under current GitHub Actions semantics.

⚠️ Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 11 minutes.

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