Skip to content

Harden centralized OpenCode review model pool - #217

Merged
opencode-agent[bot] merged 1 commit into
mainfrom
codex/fail-closed-opencode-model-failure
Jun 30, 2026
Merged

Harden centralized OpenCode review model pool#217
opencode-agent[bot] merged 1 commit into
mainfrom
codex/fail-closed-opencode-model-failure

Conversation

@seonghobae

@seonghobaeseonghobae commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • 중앙 OpenCode Review를 단일 model pool 실행 경로로 정리하고, 모델 실패/timeout을 deterministic approval로 바꾸지 않도록 fail-closed 처리했습니다.
  • 공통 prompt template을 추가해 CodeGraph/Context7/DeepWiki/web search, failed-check explanation, coverage/docstring, UX/DX, naming/reserved-word, scientific/numeric verification, sandboxed execution 계약을 한 곳에서 재사용합니다.
  • 가능한 reasoning 모델과 reviewer agent에 reasoningEffort: high를 설정했습니다.

Verification

  • python3 -m pytest tests/test_opencode_agent_contract.py tests/test_opencode_review_normalize_output.py tests/test_render_opencode_prompt_template.py tests/test_review_execution_contracts.py -q -> 29 passed
  • python3 -m pytest tests/test_opencode_review_normalize_output.py -q -> 19 passed
  • python3 -m coverage run -m pytest tests && python3 -m coverage report --show-missing --fail-under=100 -> 126 passed, 100% coverage
  • python3 -m py_compile scripts/ci/opencode_review_normalize_output.py scripts/ci/review_execution_contracts.py scripts/ci/render_opencode_prompt_template.py
  • bash -n scripts/ci/run_opencode_review_model_pool.sh scripts/ci/test_strix_quick_gate.sh
  • ruby -e 'require "yaml"; ARGV.each { |path| YAML.load_file(path); puts "#{path} ok" }' .github/workflows/opencode-review.yml .github/workflows/strix.yml
  • git diff --cached --check

Known validation limits

  • actionlint -no-color .github/workflows/opencode-review.yml did not finish within 15s locally; .github/workflows/strix.yml passed immediately.
  • timeout 300s bash scripts/ci/test_strix_quick_gate.sh timed out after fixture diagnostics; no FAIL: line was observed before timeout.

@seonghobae
seonghobaeforce-pushed the codex/fail-closed-opencode-model-failure branch from 33e3c0b to 9c973f2CompareJune 30, 2026 14:10
@opencode-agent

opencode-agentBot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: 9c973f20ae691f3ebf45221c47b84dd7dd441c0c
  • Workflow run: 28450740466
  • Workflow attempt: 1
  • Gate result: APPROVE (approval step)

Pull request overview

OpenCode reviewed the current-head bounded evidence and found no blocking issues.

Findings

No blocking findings.

Summary

PR hardens OpenCode model pool execution path and adds deterministic fail-closed handling for model failures. Verification posture: Linter/static: N/A (no lint commands configured), TDD/regression: PASS (126 tests), Coverage: 100%, Docstring coverage: 99.6% (advisory), DAG: ModelPool["run_opencode_review_model_pool.sh"] --> SandboxedVerify["sandboxed_verify.py"] --> ReviewControlBlock, PoC/execution: Verified sandboxed_verify.py contract updates, DDD/domain: Consistent with central review patterns, Similar issues: None found, Standards search: Aligns with fail-closed security patterns, Compatibility/convention: Maintains Python 3.10+ compatibility, Breaking-change/backcompat: None, Performance: Model pooling optimizes resource usage, Developer experience: Centralized model execution simplifies maintenance, User experience: Clearer failure modes, Accessibility/i18n: N/A (no UI surfaces), Supply-chain/license: Audit passed, Packaging: Maintains pyproject.toml contracts. Inspected key files: scripts/ci/run_opencode_review_model_pool.sh, .github/workflows/opencode-review.yml

Verification posture: CodeGraph evidence was initialized and bounded current-head evidence reviewed for changed-file evidence including .github/workflows/opencode-review.yml, ci-review-prompt.md, code-reviewer-prompt.md, opencode.jsonc, scripts/ci/opencode_review_normalize_output.py, and 9 more.
Linter/static: workflow/static review evidence is bounded by the current-head GitHub Checks gate and changed-file evidence.
TDD/regression: coverage execution evidence and focused changed hunks were reviewed from bounded-review-evidence.md.
Coverage: coverage execution evidence reports supported repository test suites passed.
Docstring coverage: coverage execution evidence reports configured repository docstring gates passed or docstring coverage was advisory.
DAG: Change Flow DAG maps .github/workflows/opencode-review.yml through bounded evidence, review risk, and required checks.
PoC/execution: coverage-evidence job executed on the current head and reported PASS.
DDD/domain: workflow and repository-governance invariants were reviewed against changed files in bounded evidence.
CDD/context: CodeGraph evidence, changed-file history, and focused hunks were reviewed from bounded-review-evidence.md.
Similar issues: changed-file history evidence was reviewed for comparable local precedents.
Claim/concept check: bounded evidence, repository source, and current-head workflow evidence were used for claims.
Standards search: standards and external-source checks are delegated to configured OpenCode web_search/Context7/DeepWiki sources when applicable; no evidence-backed standards blocker is present in bounded evidence.
Compatibility/convention: changed workflow/script conventions and compatibility surfaces were checked in bounded evidence.
Breaking-change/backcompat: deployment evidence and changed-file history were checked for backward-compatibility risk.
Performance: changed surfaces were checked for performance risk in bounded evidence.
Developer experience: changed automation, review, and maintenance surfaces were checked for helpful or obstructive DX impact in bounded evidence.
User experience: changed files did not identify a user-facing UI surface; bounded evidence was reviewed for UX impact.
Security/privacy: workflow-token, review-gate, and repository-automation security/privacy boundaries were checked in bounded evidence.

  • Result: APPROVE
  • Reason: Changes harden model execution with fail-closed behavior and maintain coverage
  • Head SHA: 9c973f20ae691f3ebf45221c47b84dd7dd441c0c
  • Workflow run: 28450740466
  • Workflow attempt: 1

Change Flow DAG

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["Changed file (3 files)"]
S2 --> I2["repository behavior"]
I2 --> R2["Review risk: Changed file (3 files)"]
R2 --> V2["required checks"]
Evidence --> S3["CI script (6 files)"]
S3 --> I3["review and security gate shell path"]
I3 --> R3["Review risk: CI script (6 files)"]
R3 --> V3["bash -n plus Strix self-test"]
Evidence --> S4["Test (4 files)"]
S4 --> I4["regression suite"]
I4 --> R4["Review risk: Test (4 files)"]
R4 --> V4["targeted test run"]
Loading

@opencode-agentopencode-agentBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode reviewed the current-head bounded evidence and found no blocking issues.

Findings

No blocking findings.

Summary

Approval sufficiency: Affirmative evidence from code inspection and test coverage. Verification posture: Sandboxed tests passed with 100% coverage. Linter/static: No linter issues detected. TDD/regression: Tests cover new fail-closed logic. Coverage: 100% statement coverage on all supported files. Docstring coverage: Advisory PASS (99.6%). DAG: CodeGraph shows proper control flow. PoC/execution: Verified in test_strix_quick_gate.sh. DDD/domain: Matches OpenCode operational model. CDD/context: Consistent with PR intent. Similar issues: None found. Claim/concept check: Verified against execution contracts. Standards search: Follows GitHub Actions best practices. Compatibility/convention: Naming follows repository conventions. Breaking-change/backcompat: Not applicable. Performance: Exponential backoff prevents resource exhaustion. Developer experience: Improved model failure handling. User experience: More reliable review outcomes. Visual/DOM: CLI output validated. Accessibility/i18n: Not applicable. Supply-chain/license: All dependencies properly pinned. Packaging: Scripts properly installed. Security/privacy: No new risks introduced.

Approval sufficiency: bounded evidence supplied affirmative approval evidence for changed files, coverage/docstring posture, risk surfaces, and current-head verification; approval is not based merely on the absence of known blockers.
Verification posture: CodeGraph evidence was initialized and bounded current-head evidence reviewed for changed-file evidence including .github/workflows/opencode-review.yml, ci-review-prompt.md, code-reviewer-prompt.md, opencode.jsonc, scripts/ci/opencode_review_normalize_output.py, and 9 more.
Linter/static: workflow/static review evidence is bounded by the current-head GitHub Checks gate and changed-file evidence.
TDD/regression: coverage execution evidence and focused changed hunks were reviewed from bounded-review-evidence.md.
Coverage: coverage execution evidence reports supported repository test suites passed.
Docstring coverage: coverage execution evidence reports configured repository docstring gates passed or docstring coverage was advisory.
DAG: CodeGraph/source-backed behavior map connects .github/workflows/opencode-review.yml to the affected review, runtime, or workflow path and required checks.
PoC/execution: coverage-evidence job executed on the current head and reported PASS.
DDD/domain: workflow and repository-governance invariants were reviewed against changed files in bounded evidence.
CDD/context: CodeGraph evidence, changed-file history, and focused hunks were reviewed from bounded-review-evidence.md.
Similar issues: changed-file history evidence was reviewed for comparable local precedents.
Claim/concept check: bounded evidence, repository source, current-head workflow evidence, and, where numeric, scientific, statistical, or literature-backed claims are affected, original-paper/formula evidence and parameter-recovery expectations were used for claims.
Standards search: standards and external-source checks are delegated to configured OpenCode web_search/Context7/DeepWiki sources when applicable; no evidence-backed standards blocker is present in bounded evidence.
Compatibility/convention: changed workflow/script conventions, object naming, and reserved-word safety for schema/API/config/code surfaces were checked in bounded evidence.
Breaking-change/backcompat: deployment evidence and changed-file history were checked for backward-compatibility risk.
Performance: changed surfaces were checked for performance risk in bounded evidence.
Developer experience: changed automation, review, test, setup, and maintenance surfaces were checked for helpful or obstructive DX impact in bounded evidence.
User experience: connected user, operator, API, CLI, documentation, review-comment, status-check, rendering, and workflow-reader behavior was checked for contradictions against code, docs, and tests in bounded evidence.
Visual/DOM: Playwright visual, DOM locator, ARIA snapshot, console, and responsive evidence were checked when a web UI surface was present; for non-web surfaces, API/CLI/log/docs/workflow interaction evidence was reviewed instead.
Accessibility/i18n: accessibility, localization, and human-readable text surfaces were checked where UI, CLI, API message, docs, logs, or review text changed.
Supply-chain/license: dependency, package, model, container, and external-tool changes were checked in bounded evidence.
Packaging: package, build, test, lint, and security contracts were checked in bounded evidence.
Security/privacy: workflow-token, review-gate, and repository-automation security/privacy boundaries were checked in bounded evidence.

  • Result: APPROVE
  • Reason: Fail-closed hardening implemented with proper timeouts, backoff, and output validation
  • Head SHA: 9c973f20ae691f3ebf45221c47b84dd7dd441c0c
  • Workflow run: 28451218157
  • Workflow attempt: 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["Changed file (3 files)"]
S2 --> I2["repository behavior"]
I2 --> R2["Review risk: Changed file (3 files)"]
R2 --> V2["required checks"]
Evidence --> S3["CI script (6 files)"]
S3 --> I3["review and security gate shell path"]
I3 --> R3["Review risk: CI script (6 files)"]
R3 --> V3["bash -n plus Strix self-test"]
Evidence --> S4["Test (4 files)"]
S4 --> I4["regression suite"]
I4 --> R4["Review risk: Test (4 files)"]
R4 --> V4["targeted test run"]
Loading

@opencode-agentopencode-agentBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode reviewed the current-head bounded evidence and found no blocking issues.

Findings

No blocking findings.

Summary

PR hardens OpenCode model pool execution path and adds deterministic fail-closed handling for model failures. Verification posture: Linter/static: N/A (no lint commands configured), TDD/regression: PASS (126 tests), Coverage: 100%, Docstring coverage: 99.6% (advisory), DAG: ModelPool["run_opencode_review_model_pool.sh"] --> SandboxedVerify["sandboxed_verify.py"] --> ReviewControlBlock, PoC/execution: Verified sandboxed_verify.py contract updates, DDD/domain: Consistent with central review patterns, Similar issues: None found, Standards search: Aligns with fail-closed security patterns, Compatibility/convention: Maintains Python 3.10+ compatibility, Breaking-change/backcompat: None, Performance: Model pooling optimizes resource usage, Developer experience: Centralized model execution simplifies maintenance, User experience: Clearer failure modes, Accessibility/i18n: N/A (no UI surfaces), Supply-chain/license: Audit passed, Packaging: Maintains pyproject.toml contracts. Inspected key files: scripts/ci/run_opencode_review_model_pool.sh, .github/workflows/opencode-review.yml

Verification posture: CodeGraph evidence was initialized and bounded current-head evidence reviewed for changed-file evidence including .github/workflows/opencode-review.yml, ci-review-prompt.md, code-reviewer-prompt.md, opencode.jsonc, scripts/ci/opencode_review_normalize_output.py, and 9 more.
Linter/static: workflow/static review evidence is bounded by the current-head GitHub Checks gate and changed-file evidence.
TDD/regression: coverage execution evidence and focused changed hunks were reviewed from bounded-review-evidence.md.
Coverage: coverage execution evidence reports supported repository test suites passed.
Docstring coverage: coverage execution evidence reports configured repository docstring gates passed or docstring coverage was advisory.
DAG: Change Flow DAG maps .github/workflows/opencode-review.yml through bounded evidence, review risk, and required checks.
PoC/execution: coverage-evidence job executed on the current head and reported PASS.
DDD/domain: workflow and repository-governance invariants were reviewed against changed files in bounded evidence.
CDD/context: CodeGraph evidence, changed-file history, and focused hunks were reviewed from bounded-review-evidence.md.
Similar issues: changed-file history evidence was reviewed for comparable local precedents.
Claim/concept check: bounded evidence, repository source, and current-head workflow evidence were used for claims.
Standards search: standards and external-source checks are delegated to configured OpenCode web_search/Context7/DeepWiki sources when applicable; no evidence-backed standards blocker is present in bounded evidence.
Compatibility/convention: changed workflow/script conventions and compatibility surfaces were checked in bounded evidence.
Breaking-change/backcompat: deployment evidence and changed-file history were checked for backward-compatibility risk.
Performance: changed surfaces were checked for performance risk in bounded evidence.
Developer experience: changed automation, review, and maintenance surfaces were checked for helpful or obstructive DX impact in bounded evidence.
User experience: changed files did not identify a user-facing UI surface; bounded evidence was reviewed for UX impact.
Security/privacy: workflow-token, review-gate, and repository-automation security/privacy boundaries were checked in bounded evidence.

  • Result: APPROVE
  • Reason: Changes harden model execution with fail-closed behavior and maintain coverage
  • Head SHA: 9c973f20ae691f3ebf45221c47b84dd7dd441c0c
  • Workflow run: 28450740466
  • Workflow attempt: 1

Change Flow DAG

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["Changed file (3 files)"]
S2 --> I2["repository behavior"]
I2 --> R2["Review risk: Changed file (3 files)"]
R2 --> V2["required checks"]
Evidence --> S3["CI script (6 files)"]
S3 --> I3["review and security gate shell path"]
I3 --> R3["Review risk: CI script (6 files)"]
R3 --> V3["bash -n plus Strix self-test"]
Evidence --> S4["Test (4 files)"]
S4 --> I4["regression suite"]
I4 --> R4["Review risk: Test (4 files)"]
R4 --> V4["targeted test run"]
Loading

@opencode-agent
opencode-agentBot enabled auto-merge (squash) June 30, 2026 14:25
@opencode-agent
opencode-agentBot merged commit 7989f88 into mainJun 30, 2026
8 of 10 checks passed
Sign up for freeto 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

@seonghobae