Skip to content

fix(review): bind verified evidence in scripts/ci/opencode_review_normalize_output.py - #563

Open
seonghobae wants to merge 12 commits into
mainfrom
agent/opencode-binding-bootstrap
Open

fix(review): bind verified evidence in scripts/ci/opencode_review_normalize_output.py#563
seonghobae wants to merge 12 commits into
mainfrom
agent/opencode-binding-bootstrap

Conversation

@seonghobae

@seonghobae seonghobae commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

자동 리뷰 증거 계약

  • adversarial_validation의 각 probe는 구조화된 path·양의 line과 evidence의 정확한 path:line을 서로 결합해야 합니다.
  • source-line-sha256 receipt는 같은 current-head 줄의 실제 바이트를 증명해야 합니다.

Purpose

This pull request repairs three fail-closed review-process edge cases:

  1. A model may provide one sealed, exact structured location and receipt while omitting only the redundant path:line text in free-form evidence.
  2. A model may cite and receipt-bind exactly one current-head changed-file line while copying a different valid changed-file location into redundant structured fields.
  3. A typed GitHub check rollup may include a superseded cancelled scan-pr-queue check owned by PR Review Merge Scheduler or Required PR Review Merge Scheduler.

The normalizer restores or rebinds redundant location data only when a single current-head changed-file line is independently proven by the sealed source receipt. Ambiguous, missing, mismatched, circular, or unobserved evidence remains rejected.

Scheduler cancellation handling is ownership-aware:

  • The typed GraphQL/check-rollup path excludes a cancelled scan-pr-queue only when its workflow is one of the two trusted scheduler workflows.
  • The workflow-less REST fallback cannot prove workflow ownership, so it does not suppress a cancelled check by name alone. It retains that check as a blocker and fails closed.
  • Unrelated cancellations and all real failures, timeouts, startup failures, and action-required states remain blockers.

Fail-closed boundaries

  • missing, duplicate, mismatched, or ambiguous source receipt/location
  • unsafe, nonexistent, or unchanged path
  • invalid or out-of-range line
  • proofless, circular, negated, or unobserved evidence
  • current-head artifact provenance mismatch
  • unreceipted runtime-tool claim
  • scheduler ownership that cannot be verified
  • any non-scheduler cancellation or real failed check

Current-head verification

  • Head SHA: 604ff0f9c8fb0274f43687609e494c5b267ffbfc
  • Focused normalizer and model-pool tests: passed
  • Model-pool regression suite: passed
  • Ruff, shell syntax, pure Actions actionlint, and git diff --check: passed
  • Current-head GitHub security and compatibility checks: passed

Expected review behavior

The protected-base normalizer may repair only redundant binding drift that is uniquely proven by the current-head changed-file manifest, sealed source tree, exact line bytes, and one source-line receipt. The approval gate may ignore only a superseded scheduler cancellation whose scheduler ownership is present in typed check evidence; the workflow-less REST fallback must retain same-named cancellations because ownership is unavailable.

Summary by CodeRabbit

  • 버그 수정
    • 신뢰된 소스 기준으로 증거-소스 라인 인용 정합성을 재검증하고, 안전한 경우에만 보정이 적용되도록 개선했습니다.
    • 모호/중복/불일치 및 형식 불일치 상황은 변경하지 않고 보수적으로 처리합니다.
    • 취소된 큐 교체(대체) 점검에서 잘못된 오판을 막는 조건을 강화했습니다.
  • 테스트
    • 증거 바인딩 복구 및 검증 예외 케이스를 폭넓게 추가했습니다.
    • 테스트 실행 전후 정리/초기화를 강화했습니다.

@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 cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 4ff50eca109bb1410275e024c92fef348f278147.

  • Head SHA: 4ff50eca109bb1410275e024c92fef348f278147

  • Workflow run: 29404144238

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["CI script: opencode_review_normalize_output.py"]
  S1 --> I1["review and security gate shell path"]
  I1 --> R1["Review risk: CI script: opencode_review_normalize_output.py"]
  R1 --> V1["bash -n plus Strix self-test"]
  Evidence --> S2["Test (2 files)"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test (2 files)"]
  R2 --> V2["targeted test run"]
Loading

@opencode-agent

opencode-agent Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: 5bb40ac93c7e7e9b8ed5665d85e132a43e3f1219
  • Workflow run: 29993471451
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

OpenCode could not approve from deterministic current-head evidence because GitHub Checks have failed.

Findings

1. HIGH Current-head GitHub Checks - Fix failed required checks before approval

  • Problem: Failed same-head checks remain for 5bb40ac93c7e7e9b8ed5665d85e132a43e3f1219.
  • Root cause: The model-unavailable evidence fallback is allowed only when peer GitHub Checks are complete and clean.
  • Fix: Read and fix the failed check logs below, then rerun the current-head checks.
  • Regression test: Keep the model-unavailable fallback gated on an empty failed-check rollup.

Failed checks:

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow: opencode-review.yml"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> R1["Review risk: Workflow: opencode-review.yml"]
  R1 --> V1["actionlint plus required checks"]
  Evidence --> S2["CI script (2 files)"]
  S2 --> I2["review and security gate shell path"]
  I2 --> R2["Review risk: CI script (2 files)"]
  R2 --> V2["bash -n plus Strix self-test"]
  Evidence --> S3["Test: test_opencode_model_pool_runner.py"]
  S3 --> I3["regression suite"]
  I3 --> R3["Review risk: Test: test_opencode_model_pool_runner.py"]
  R3 --> V3["targeted test run"]
Loading

@seonghobae
seonghobae dismissed opencode-agent[bot]’s stale review July 15, 2026 09:31

Superseded automated coverage review from previous head 4ff50ec; exact current head c28eb67 restores 100% measured statement coverage.

@seonghobae seonghobae changed the title fix(review): 봉인된 probe 위치 binding 부트스트랩 fix(review): bind verified probe evidence to exact path:positive-line Jul 15, 2026
@seonghobae seonghobae changed the title fix(review): bind verified probe evidence to exact path:positive-line fix(review): bind verified evidence in scripts/ci/opencode_review_normalize_output.py Jul 15, 2026
@opencode-agent
opencode-agent Bot force-pushed the agent/opencode-binding-bootstrap branch 2 times, most recently from 681447e to 0042e90 Compare July 16, 2026 22:15

@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 cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 0042e9079990d5478294a369200101d88a2df79b.

  • Head SHA: 0042e9079990d5478294a369200101d88a2df79b

  • Workflow run: 29538997259

  • Workflow attempt: 1

Coverage evidence

Coverage evidence job did not run or did not publish coverage evidence.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["CI script: opencode_review_normalize_output.py"]
  S1 --> I1["review and security gate shell path"]
  I1 --> R1["Review risk: CI script: opencode_review_normalize_output.py"]
  R1 --> V1["bash -n plus Strix self-test"]
  Evidence --> S2["Test: test_opencode_model_pool_runner.py"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test_opencode_model_pool_runner.py"]
  R2 --> V2["targeted test run"]
Loading

@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 cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 099f538b7503288325077595a11eb1a7d8f016b4.

  • Head SHA: 099f538b7503288325077595a11eb1a7d8f016b4

  • Workflow run: 29553130324

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 3

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["CI script: opencode_review_normalize_output.py"]
  S1 --> I1["review and security gate shell path"]
  I1 --> R1["Review risk: CI script: opencode_review_normalize_output.py"]
  R1 --> V1["bash -n plus Strix self-test"]
  Evidence --> S2["Test: test_opencode_model_pool_runner.py"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test_opencode_model_pool_runner.py"]
  R2 --> V2["targeted test run"]
Loading

@opencode-agent
opencode-agent Bot force-pushed the agent/opencode-binding-bootstrap branch from 099f538 to 196c5a4 Compare July 17, 2026 08:28
@seonghobae
seonghobae dismissed stale reviews from opencode-agent[bot] and opencode-agent[bot] July 19, 2026 22:41

Current head 196c5a4 supersedes the reviewed 0042e90 coverage-failure head; dismissing only this stale review before an exact-head rerun.

@seonghobae
seonghobae enabled auto-merge (squash) July 19, 2026 22:42

@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 could not approve from deterministic current-head evidence because GitHub Checks have failed.

Findings

1. HIGH Current-head GitHub Checks - Fix failed required checks before approval

  • Problem: Failed same-head checks remain for 196c5a4c76dcbde28a374c55e975f9b45c74fc5a.
  • Root cause: The model-unavailable evidence fallback is allowed only when peer GitHub Checks are complete and clean.
  • Fix: Read and fix the failed check logs below, then rerun the current-head checks.
  • Regression test: Keep the model-unavailable fallback gated on an empty failed-check rollup.

Failed checks:

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["CI script: opencode_review_normalize_output.py"]
  S1 --> I1["review and security gate shell path"]
  I1 --> R1["Review risk: CI script: opencode_review_normalize_output.py"]
  R1 --> V1["bash -n plus Strix self-test"]
  Evidence --> S2["Test: test_opencode_model_pool_runner.py"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test_opencode_model_pool_runner.py"]
  R2 --> V2["targeted test run"]
Loading

@seonghobae
seonghobae dismissed opencode-agent[bot]’s stale review July 20, 2026 02:14

Superseded by current head 3b2255b, which adds the regression-tested REST fallback filter for the cancelled scheduler check cited by this old-head review.

@opencode-agent
opencode-agent Bot disabled auto-merge July 20, 2026 02:14
@seonghobae
seonghobae enabled auto-merge (squash) July 20, 2026 02:15

@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 cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 55219f0b317a63a5effab6e19e38fc5e2ab639cf.

  • Head SHA: 55219f0b317a63a5effab6e19e38fc5e2ab639cf

  • Workflow run: 29728911432

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow: opencode-review.yml"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> R1["Review risk: Workflow: opencode-review.yml"]
  R1 --> V1["actionlint plus required checks"]
  Evidence --> S2["CI script (2 files)"]
  S2 --> I2["review and security gate shell path"]
  I2 --> R2["Review risk: CI script (2 files)"]
  R2 --> V2["bash -n plus Strix self-test"]
  Evidence --> S3["Test: test_opencode_model_pool_runner.py"]
  S3 --> I3["regression suite"]
  I3 --> R3["Review risk: Test: test_opencode_model_pool_runner.py"]
  R3 --> V3["targeted test run"]
Loading

@opencode-agent
opencode-agent Bot disabled auto-merge July 20, 2026 08:47
@seonghobae

Copy link
Copy Markdown
Contributor Author

중복 구현 감사 결과

current HEAD 90f4c5171b6d6e4906b792100547ffef30b2cc5a의 고유 수신증명 위치 재결합은 #560 current HEAD de8391f23ca9815df22615f3be5109acf08343d4에 더 강한 신뢰 경계로 흡수되어 있습니다.

  • #563은 모델 evidence가 인용한 변경 라인의 digest를 봉인 트리에서 다시 계산해 유일한 일치 위치를 찾습니다.
  • #560은 신뢰 실행 단계가 생성하고 artifact manifest가 봉인한 source-line receipt 인덱스만 사용하며, 동일 digest 다중 위치에서는 정확히 하나의 인용만 허용합니다.
  • #560은 변조 digest, 잘못된 위치, 봉인 evidence 읽기 실패, 다중/누락 receipt를 fail-closed하고 후보 수 진단도 남깁니다.
  • 대응 회귀 6개가 통과했고 전체 749 passed, scripts/ci 6,481 statements 100%, current-head Strix/CodeQL/Trivy/OSV/dependency-review/Bandit/pip-audit/Semgrep/gitleaks가 모두 통과했습니다. code-scanning alert와 미해결 review thread는 0건입니다.

#560의 current-head OpenCode review 실행 29745643580이 현재 진행 중입니다. 기능 유실을 막기 위해 #560이 병합될 때까지 이 PR은 열어 두고, 병합 직후 중복 PR로 정리하겠습니다. 오래된 55219f0... 대상 CHANGES_REQUESTED 리뷰는 현재 결함 근거로 사용하지 않습니다.

@seonghobae
seonghobae enabled auto-merge (squash) July 20, 2026 21:20
@opencode-agent
opencode-agent Bot disabled auto-merge July 22, 2026 07:30
@seonghobae
seonghobae dismissed opencode-agent[bot]’s stale review July 22, 2026 19:50

Dismissed as stale: this review targets an older head; current-head evidence remains subject to independent review.

Copilot AI review requested due to automatic review settings July 23, 2026 08:48
@opencode-agent
opencode-agent Bot force-pushed the agent/opencode-binding-bootstrap branch from 90f4c51 to 5bb40ac Compare July 23, 2026 08:48

Copilot AI 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.

Pull request overview

Repairs fail-closed edge cases in the OpenCode review-output normalizer and approval-gate check classification so that only uniquely receipt-provable “redundant binding drift” is repaired, and a superseded cancelled scan-pr-queue check-run is ignored in the workflow-less REST fallback while preserving all other blocker semantics.

Changes:

  • Add receipt-verified citation location inference and a tightly scoped probe-evidence repair pass (repair_adversarial_probe_evidence_bindings) before adversarial validation is evaluated.
  • Extend the workflow-less commit check-runs REST fallback filter to ignore only cancelled scan-pr-queue.
  • Add model-pool tests + cache isolation fixture to cover “restore missing redundant citation”, “rebind drifted structured fields when uniquely receipted”, and “remain fail-closed when ambiguous/unverifiable”.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
scripts/ci/opencode_review_normalize_output.py Adds receipt-verified evidence rebinding/repair logic and invokes it before adversarial validation gating.
tests/test_opencode_model_pool_runner.py Adds focused tests for the new binding repair behavior and an autouse fixture to clear normalizer artifact caches between tests.
.github/workflows/opencode-review.yml Updates the REST commit check-runs fallback filter to ignore only cancelled scan-pr-queue.
scripts/ci/test_strix_quick_gate.sh Updates the workflow static-contract assertions to require the new REST fallback cancellation filter.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@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 could not approve from deterministic current-head evidence because GitHub Checks have failed.

Findings

1. HIGH Current-head GitHub Checks - Fix failed required checks before approval

  • Problem: Failed same-head checks remain for 5bb40ac93c7e7e9b8ed5665d85e132a43e3f1219.
  • Root cause: The model-unavailable evidence fallback is allowed only when peer GitHub Checks are complete and clean.
  • Fix: Read and fix the failed check logs below, then rerun the current-head checks.
  • Regression test: Keep the model-unavailable fallback gated on an empty failed-check rollup.

Failed checks:

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow: opencode-review.yml"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> R1["Review risk: Workflow: opencode-review.yml"]
  R1 --> V1["actionlint plus required checks"]
  Evidence --> S2["CI script (2 files)"]
  S2 --> I2["review and security gate shell path"]
  I2 --> R2["Review risk: CI script (2 files)"]
  R2 --> V2["bash -n plus Strix self-test"]
  Evidence --> S3["Test: test_opencode_model_pool_runner.py"]
  S3 --> I3["regression suite"]
  I3 --> R3["Review risk: Test: test_opencode_model_pool_runner.py"]
  R3 --> V3["targeted test run"]
Loading

Copilot AI 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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 25, 2026 03:32

Copilot AI 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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread scripts/ci/test_strix_quick_gate.sh Outdated
Copilot AI review requested due to automatic review settings July 26, 2026 07:22
@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b3d21d5b-eeea-4239-85bb-b32933b190ad

📥 Commits

Reviewing files that changed from the base of the PR and between 6fdfed7 and 81fdb7a.

📒 Files selected for processing (1)
  • scripts/ci/test_strix_quick_gate.sh

📝 Walkthrough

Walkthrough

Adversarial probe evidence를 검증된 source-line receipt와 current-head 소스에 맞춰 제한적으로 복구하고, 이를 valid_control() 검증 전에 적용합니다. 관련 fail-closed 테스트와 Strix fallback 검증도 추가됩니다.

Changes

Probe 증거 바인딩 복구

Layer / File(s) Summary
Receipt 기반 probe 복구 및 검증
scripts/ci/opencode_review_normalize_output.py
path:line 인용과 source-line digest를 재검증하고, 유일하게 검증된 매칭에 한해 evidence 또는 probe 위치를 보정한 뒤 valid_control()에 적용합니다.
증거 복구 fail-closed 테스트
tests/test_opencode_model_pool_runner.py
정상 복구, line drift, 모호한 receipt, 누락·불일치·malformed 입력에서의 원본 유지와 캐시 초기화를 검증합니다.

취소된 큐 체크 필터링

Layer / File(s) Summary
취소된 scan-pr-queue 체크 제외
scripts/ci/test_strix_quick_gate.sh
workflow-less REST fallback에서 cancelled 상태의 scan-pr-queue 체크를 차단 근거로 선택하는 조건이 없는지 검사합니다.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant valid_control
  participant repair_adversarial_probe_evidence_bindings
  participant trusted_execution_receipts
  participant current_changed_files
  participant SourceTree

  valid_control->>repair_adversarial_probe_evidence_bindings: value 전달
  repair_adversarial_probe_evidence_bindings->>trusted_execution_receipts: 단일 receipt 검증
  repair_adversarial_probe_evidence_bindings->>current_changed_files: 변경 파일 집합 조회
  repair_adversarial_probe_evidence_bindings->>SourceTree: source-line SHA-256 재계산
  SourceTree-->>repair_adversarial_probe_evidence_bindings: 일치하는 path와 line 반환
  repair_adversarial_probe_evidence_bindings-->>valid_control: 보정된 value 반환
  valid_control->>valid_control: adversarial_validation_error 검증
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 검증된 evidence 바인딩을 복구하는 핵심 변경을 구체적으로 잘 요약합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/opencode-binding-bootstrap

Comment @coderabbitai help to get the list of available commands.

Copilot AI 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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread scripts/ci/opencode_review_normalize_output.py

@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: 2

🧹 Nitpick comments (2)
scripts/ci/opencode_review_normalize_output.py (1)

693-792: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

per-probe 복구 로직을 별도 헬퍼로 분리 검토

로직 자체는 fail-closed 이중검증까지 견고하게 구현되어 있으나, 필터링·receipt 검증·prepend/rebind 분기·최종 재검증이 하나의 for 루프에 모두 들어있어 가독성과 단위 테스트 용이성이 떨어집니다. 개별 probe 처리를 _repair_single_probe(probe, changed_files) -> tuple[Any, bool]로 분리하면 각 분기(특히 rebind 실패/성공 경로)를 독립적으로 단위 테스트하기 쉬워집니다.

♻️ 리팩터 스케치
+def _repair_single_probe(
+    probe: Any, changed_files: frozenset[str]
+) -> tuple[Any, bool]:
+    """Return a possibly repaired probe and whether it was modified."""
+    if not isinstance(probe, dict):
+        return probe, False
+    # ... (기존 path/line/evidence 검증 및 prepend/rebind 로직을 이곳으로 이동)
+    return repaired_probe_or_original, changed_flag
+
+
 def repair_adversarial_probe_evidence_bindings(value: Any) -> dict[str, Any] | Any:
     ...
     changed_files = current_changed_files()
     repaired_probes: list[Any] = []
     changed = False
     for probe in probes:
-        # 기존의 길고 중첩된 검증/복구 로직
+        repaired_probe, probe_changed = _repair_single_probe(probe, changed_files)
+        repaired_probes.append(repaired_probe)
+        changed = changed or probe_changed
🤖 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/opencode_review_normalize_output.py` around lines 693 - 792,
Extract the per-probe filtering, receipt validation, prepend/rebind handling,
and final revalidation from repair_adversarial_probe_evidence_bindings into a
_repair_single_probe(probe, changed_files) -> tuple[Any, bool] helper. Preserve
all existing fail-closed branches and return the repaired probe plus whether it
changed; keep the outer function responsible only for iterating probes,
collecting results, and returning the updated validation structure.
tests/test_opencode_model_pool_runner.py (1)

247-351: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

rebind 분기의 최종 재검증 실패 케이스 테스트 추가 제안

현재 invalid_values는 prepend 분기(구조적 path/line이 receipt와 일치)에서 proof anchor 부재로 최종 거부되는 경우만 커버합니다("evidence": receipt 케이스). 하지만 receipt_verified_evidence_location이 구조적으로 유일한 매칭을 찾아 rebind에 성공한 뒤에도, evidence 전체에 proof anchor/observed-result 텍스트가 없으면 동일한 최종 재검증에서 거부되어야 하는 경로는 아직 테스트되지 않습니다. 이 최종 이중검증은 fail-closed 보장의 핵심이므로 rebind 경로에서도 명시적으로 검증할 가치가 있습니다.

✅ 추가 제안 테스트 케이스
        {
            "adversarial_validation": {
                "probes": [
                    {
                        "path": path,
                        "line": line,  # 구조적 line=1, receipt는 line 2를 가리켜 불일치
                        "evidence": (
                            f"{path}:2 source-line-sha256="
                            + hashlib.sha256(b"raise SystemExit(1)").hexdigest()
                        ),
                    }
                ]
            }
        },

이 경우 receipt_verified_evidence_location(path, 2)를 유일 매칭으로 반환하지만, evidence 전체에 proof anchor가 없어 최종 adversarial_evidence_rejection_reason 검사에서 거부되어 probe가 원본 그대로 유지되어야 합니다.

🤖 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_opencode_model_pool_runner.py` around lines 247 - 351, Extend
test_normalizer_probe_binding_repair_remains_fail_closed with a rebind-path case
where the probe’s structural line differs from the uniquely verified receipt
location, but the evidence lacks the required proof-anchor or observed-result
text. Assert repair_adversarial_probe_evidence_bindings returns the original
invalid mapping unchanged, covering final rejection after a successful
receipt_verified_evidence_location rebind.
🤖 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/opencode-review.yml:
- Line 6152: Update the REST fallback filter around the cancelled
“scan-pr-queue” selection so it excludes that check only when it belongs to “PR
Review Merge Scheduler” or “Required PR Review Merge Scheduler”; if scheduler
ownership cannot be verified, retain the check and fail closed. Add a regression
case proving a scheduler-owned cancelled check is excluded while a cancelled
check with the same name from a non-scheduler workflow remains a blocker.

In `@scripts/ci/test_strix_quick_gate.sh`:
- Line 1027: Update the assertion in the quick-gate test for the workflow-less
REST fallback to require the cancelled check name scan-pr-queue and workflow
name PR Review Merge Scheduler or Required PR Review Merge Scheduler, matching
collect_failed_check_evidence.sh. Add a regression assertion confirming a
cancelled scan-pr-queue check from any other workflow remains a blocker.

---

Nitpick comments:
In `@scripts/ci/opencode_review_normalize_output.py`:
- Around line 693-792: Extract the per-probe filtering, receipt validation,
prepend/rebind handling, and final revalidation from
repair_adversarial_probe_evidence_bindings into a _repair_single_probe(probe,
changed_files) -> tuple[Any, bool] helper. Preserve all existing fail-closed
branches and return the repaired probe plus whether it changed; keep the outer
function responsible only for iterating probes, collecting results, and
returning the updated validation structure.

In `@tests/test_opencode_model_pool_runner.py`:
- Around line 247-351: Extend
test_normalizer_probe_binding_repair_remains_fail_closed with a rebind-path case
where the probe’s structural line differs from the uniquely verified receipt
location, but the evidence lacks the required proof-anchor or observed-result
text. Assert repair_adversarial_probe_evidence_bindings returns the original
invalid mapping unchanged, covering final rejection after a successful
receipt_verified_evidence_location rebind.
🪄 Autofix (Beta)

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: b7488a11-378c-4e38-abe9-a49464de1006

📥 Commits

Reviewing files that changed from the base of the PR and between b613873 and 85decd5.

📒 Files selected for processing (4)
  • .github/workflows/opencode-review.yml
  • scripts/ci/opencode_review_normalize_output.py
  • scripts/ci/test_strix_quick_gate.sh
  • tests/test_opencode_model_pool_runner.py

Comment thread .github/workflows/opencode-review.yml Outdated
Comment thread scripts/ci/test_strix_quick_gate.sh Outdated
Copilot AI review requested due to automatic review settings July 26, 2026 07:34

Copilot AI 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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Copilot AI 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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread scripts/ci/test_strix_quick_gate.sh
@opencode-agent
opencode-agent Bot force-pushed the agent/opencode-binding-bootstrap branch from 604ff0f to 6fdfed7 Compare July 29, 2026 03:39

@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.

🧹 Nitpick comments (2)
scripts/ci/opencode_review_normalize_output.py (2)

688-700: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

인용된 라인마다 소스 파일을 두 번 전체 읽습니다.

adversarial_probe_location_erroradversarial_probe_source_line_digest가 각각 read_bytes()로 파일 전체를 읽으므로, 같은 파일에 대한 인용이 여러 개면 읽기 횟수가 선형으로 증가합니다. path별로 한 번만 읽고 라인 배열을 재사용하거나 digest 결과를 메모이즈하면 I/O를 줄일 수 있습니다. 정확성/fail-closed 동작에는 영향이 없으므로 선택 사항입니다.

🤖 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/opencode_review_normalize_output.py` around lines 688 - 700,
Optimize the citation loop around adversarial_probe_location_error and
adversarial_probe_source_line_digest so each path’s source data is read only
once and reused across citations, or memoize the computed line digests per path
and line. Preserve the existing matching behavior and fail-closed handling for
invalid locations or unavailable digests.

758-759: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

거절 사유 문자열을 상수로 공유하세요.
scripts/ci/adversarial_evidence.py와 테스트도 같은 문구에 묶여 있어, 여기서 리터럴 비교를 유지하면 문구 변경 시 분기가 쉽게 어긋납니다.

🤖 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/opencode_review_normalize_output.py` around lines 758 - 759, Share
the rejection-reason string through a common constant from
adversarial_evidence.py, and update the comparison in
adversarial_evidence_rejection_reason handling plus related tests to reference
that constant instead of duplicating the literal. Ensure all consumers remain
aligned when the message changes.
🤖 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.

Nitpick comments:
In `@scripts/ci/opencode_review_normalize_output.py`:
- Around line 688-700: Optimize the citation loop around
adversarial_probe_location_error and adversarial_probe_source_line_digest so
each path’s source data is read only once and reused across citations, or
memoize the computed line digests per path and line. Preserve the existing
matching behavior and fail-closed handling for invalid locations or unavailable
digests.
- Around line 758-759: Share the rejection-reason string through a common
constant from adversarial_evidence.py, and update the comparison in
adversarial_evidence_rejection_reason handling plus related tests to reference
that constant instead of duplicating the literal. Ensure all consumers remain
aligned when the message changes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bdbee8c9-2b70-4f5e-a7ec-033950f999d1

📥 Commits

Reviewing files that changed from the base of the PR and between 85decd5 and 6fdfed7.

📒 Files selected for processing (3)
  • scripts/ci/opencode_review_normalize_output.py
  • scripts/ci/test_strix_quick_gate.sh
  • tests/test_opencode_model_pool_runner.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • scripts/ci/test_strix_quick_gate.sh
  • tests/test_opencode_model_pool_runner.py

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.

2 participants