Skip to content

fix(opencode-review): discover multi-line run: blocks in safe_pytest_command - #949

Merged
seonghobae merged 23 commits into
mainfrom
fix/safe-pytest-command-multiline-run-blocks
Aug 29, 2026
Merged

seonghobae merged 23 commits into
mainfrom
fix/safe-pytest-command-multiline-run-blocks

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Current repair

Safe pytest discovery now recognizes multiline GitHub Actions run: | / run: > blocks while preserving the bounded runner grammar and shell=False execution. The first execution target must still be pytest; file operands, -c, --, earlier modules, shell control syntax, and unrecognized executables fail closed.

Exact identity

  • Head: 811c0321f661b85c9270a85f36fc20fc0da13b42
  • Base: main@55a8b576725451dfe0a21a57d36a2f1a41619b24
  • Merge tree: c9efc974e0b112082895a425e81b124f4fde70d5
  • Changed paths: exactly four—the parser, its regression suite, and two decision/doctoring documents.

Main convergence

The predecessor branch had drifted into a tree that deleted protected main's exact-artifact SBOM workflows, verifier, doctoring, and tests and replaced unrelated shared architecture/changelog content. The current non-forced merge commit uses protected main as the tree authority and overlays only this PR's four owned paths. No attestation, release, scheduler, Strix, shared architecture, or unrelated changelog source is deleted or rewritten.

Verification

  • Focused: 42 passed.
  • Full central suite: 1325 passed, 16 subtests passed.
  • Ruff, compileall, and git diff --check origin/main HEAD: passed.
  • Remote PR diff: four intended paths, mergeable.
  • Unresolved review threads: zero.

The previous CHANGES_REQUESTED review targets the superseded head and is not current-head authority. Fresh exact-head protected checks and a substantive formal verdict remain required before merge.


Open in Devin Review

Summary by CodeRabbit

  • 새 기능

    • GitHub Actions의 여러 줄 run 블록에서도 안전한 pytest 명령을 개별적으로 탐지합니다.
    • pytest 및 Coverage 명령의 다양한 플래그 형식을 지원합니다.
  • 보안 개선

    • 비pytest 실행, 파일 실행 대상, 셸 주입 및 위험한 명령을 계속 차단합니다.
    • 잘못된 실행 대상이 pytest로 오인되지 않도록 검증을 강화했습니다.
  • 문서 및 테스트

    • 관련 보안 정책, 제한 사항, 롤아웃 계획을 문서화했습니다.
    • 다중 줄 명령과 악성 입력에 대한 회귀 테스트를 추가했습니다.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 34b61ebb-167a-4cfd-a6c8-da726856c08f

📝 Walkthrough

Walkthrough

safe_pytest_command가 단일 행과 run: |/run: > 블록의 물리적 행에서 pytest 명령을 탐색합니다. Python 및 Coverage의 -m pytest 호출은 중간 플래그를 허용합니다. 안전성 규칙, 실행 경로, 관련 아키텍처를 문서화하고 테스트합니다.

Changes

pytest 명령 탐색 확장

Layer / File(s) Summary
명령 추출 및 호출 인식
scripts/ci/safe_pytest_command.py
run: 단일 명령과 블록 스칼라의 각 비공백 물리적 행을 후보로 추출합니다. Python 및 Coverage의 첫 모듈 대상이 pytest인 호출을 인식합니다.
안전성 검증 및 회귀 테스트
scripts/ci/safe_pytest_command.py, tests/test_safe_pytest_command.py
셸 제어문자, 비pytest 실행 파일과 모듈, 파일 대상, 잘못된 인용을 거부합니다. 명령 실행, shell=False, 경로 처리와 CLI 오류를 검증합니다.
pytest 실행 대상 보안 규칙
docs/doctoring/safe-pytest-first-module-target.md, docs/automation/safe-pytest-command-multiline-run-blocks.md, CHANGELOG.md
첫 모듈 대상이 pytest여야 한다는 규칙과 멀티라인 탐색, 중간 플래그 허용, 보안 근거 및 적대적 사례를 기록합니다.
제어면 아키텍처 문서화
ARCHITECTURE.md, CLAUDE.md, docs/automation/safe-pytest-command-multiline-run-blocks.md
제어면 구성, 데이터 흐름, 신뢰 경계, pytest 검증 흐름과 관련 문서 연결을 추가합니다.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Mergeability Score: 🔵 Low · up to 0ed17

The PR expands safe pytest discovery to recognize commands inside YAML block scalars while preserving the existing execution restrictions, restoring configured coverage and docstring checks. It is mergeable with owner awareness of a bounded test-isolation issue that may retain a temporary executable path across tests, plus minor documentation follow-up.

Sequence Diagram(s)

sequenceDiagram
  participant Workflow as GitHub Actions workflow
  participant Discover as discover_commands
  participant Extractor as _iter_run_command_lines
  participant Validator as _is_pytest_argv
  Workflow->>Discover: workflow text 전달
  Discover->>Extractor: run 항목 탐색
  Extractor-->>Discover: 단일 행 및 블록의 물리적 명령 행
  Discover->>Validator: argv 안전성 검증
  Validator-->>Discover: 인식된 pytest 명령
Loading

Suggested reviewers: opencode-agent

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 95.65% which is sufficient. The required threshold is 80.00%.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 safe_pytest_command의 멀티라인 run 블록 탐색이라는 주요 변경 사항을 정확하고 간결하게 설명합니다.
✨ 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 fix/safe-pytest-command-multiline-run-blocks

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.

coderabbitai[bot]

This comment was marked as resolved.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Review follow-up on current head.

CodeRabbit's first-module finding is valid and fixed: `python attacker.py -m pytest` and `coverage run attacker.py -m pytest` are now rejected. The first `-m`/`--module` after recognized flags must be pytest (or `python -m coverage run … -m pytest`). Reality tests cover those attacker shapes. The 2026-08-13 session-log citation was replaced with a permanent PR/test reference.

coderabbitai[bot]

This comment was marked as resolved.

@opencode-agent
opencode-agent Bot disabled auto-merge August 13, 2026 07:08
@seonghobae
seonghobae enabled auto-merge (squash) August 13, 2026 08:43
@opencode-agent
opencode-agent Bot disabled auto-merge August 13, 2026 09:11
@seonghobae
seonghobae enabled auto-merge (squash) August 13, 2026 09:38
@seonghobae

Copy link
Copy Markdown
Contributor Author

@opencode-agent @cwl-noema-review Review-only request for exact current head 0ed17015; do not mutate or merge. Re-evaluate multiline run: discovery and first-module pytest restriction. Independent current-head approval is required for the two-approval gate.

@opencode-agent
opencode-agent Bot disabled auto-merge August 13, 2026 10:02
@seonghobae
seonghobae enabled auto-merge (squash) August 13, 2026 10:44
@opencode-agent
opencode-agent Bot disabled auto-merge August 13, 2026 11:23
@seonghobae
seonghobae enabled auto-merge (squash) August 13, 2026 15:32
@opencode-agent
opencode-agent Bot disabled auto-merge August 13, 2026 23:41
@seonghobae
seonghobae enabled auto-merge (squash) August 13, 2026 23:52
@opencode-agent
opencode-agent Bot disabled auto-merge August 13, 2026 23:53
@seonghobae
seonghobae enabled auto-merge (squash) August 14, 2026 00:16
@opencode-agent
opencode-agent Bot disabled auto-merge August 14, 2026 00:32
@seonghobae
seonghobae enabled auto-merge (squash) August 14, 2026 00:41
@seonghobae
seonghobae marked this pull request as draft August 14, 2026 09:07
auto-merge was automatically disabled August 14, 2026 09:07

Pull request was converted to draft

Copy link
Copy Markdown
Contributor Author

Returned to Draft because the exact current tree mixes the safe multi-line pytest-command discovery repair with an unrelated trusted-uv materializer branch.

The bounded buyer-facing fix is strong: offer lines from YAML literal/folded run blocks to the existing narrow parser one at a time, continue rejecting shell control/non-pytest programs, and tolerate safe runner flags before -m pytest. Head f564761dc7cac7b67e0233bd3da4d84b52f0057a additionally changes materialize_base_python_requirements.py and its tests plus broad governance files.

Rebuild from protected main retaining only safe_pytest_command.py, its adversarial behavior tests, the automation/doctoring documents, directly attributable governance/changelog evidence, and no materializer changes. Resolve the claimed pre-existing main failures rather than accepting them in the merge contract, then reacquire exact-head coverage/docstring/security/supply-chain and independent-review evidence.

@seonghobae
seonghobae marked this pull request as ready for review August 14, 2026 09:18
@seonghobae
seonghobae enabled auto-merge (squash) August 14, 2026 09:18

@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 f564761dc7cac7b67e0233bd3da4d84b52f0057a.
  • 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["Changed file (4 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (4 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Docs (2 files)"]
  S2 --> I2["operator or user guidance"]
  I2 --> R2["Review risk: Docs (2 files)"]
  R2 --> V2["docs review"]
  Evidence --> S3["CI script (2 files)"]
  S3 --> I3["review and security gate shell path"]
  I3 --> R3["Review risk: CI script (2 files)"]
  R3 --> V3["bash -n plus Strix self-test"]
  Evidence --> S4["Test (2 files)"]
  S4 --> I4["regression suite"]
  I4 --> R4["Review risk: Test (2 files)"]
  R4 --> V4["targeted test run"]
Loading

@opencode-agent

opencode-agent Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

@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 73636bbc5d79f05845ac12a43e6cc5d80f3ea54e.
  • 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["Docs (2 files)"]
  S1 --> I1["operator or user guidance"]
  I1 --> R1["Review risk: Docs (2 files)"]
  R1 --> V1["docs review"]
  Evidence --> S2["CI script: safe_pytest_command.py"]
  S2 --> I2["review and security gate shell path"]
  I2 --> R2["Review risk: CI script: safe_pytest_command.py"]
  R2 --> V2["bash -n plus Strix self-test"]
  Evidence --> S3["Test: test_safe_pytest_command.py"]
  S3 --> I3["regression suite"]
  I3 --> R3["Review risk: Test: test_safe_pytest_command.py"]
  R3 --> V3["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 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 73636bbc5d79f05845ac12a43e6cc5d80f3ea54e.
  • 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["Docs (2 files)"]
  S1 --> I1["operator or user guidance"]
  I1 --> R1["Review risk: Docs (2 files)"]
  R1 --> V1["docs review"]
  Evidence --> S2["CI script: safe_pytest_command.py"]
  S2 --> I2["review and security gate shell path"]
  I2 --> R2["Review risk: CI script: safe_pytest_command.py"]
  R2 --> V2["bash -n plus Strix self-test"]
  Evidence --> S3["Test: test_safe_pytest_command.py"]
  S3 --> I3["regression suite"]
  I3 --> R3["Review risk: Test: test_safe_pytest_command.py"]
  R3 --> V3["targeted test run"]
Loading

opencode-agent[bot]

This comment was marked as resolved.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode reviewed the current-head evidence but found unresolved reviewer or review-agent threads before approval.

Findings

1. HIGH .github/workflows/opencode-review.yml:1 - Unresolved reviewer thread blocks automated approval

  • Problem: OpenCode reached an APPROVE control result, but the approval step found unresolved, non-outdated human or review-agent thread evidence on the current pull request.
  • Root cause: Reviewer and review-agent feedback can arrive after bounded model evidence is prepared, so the approval step must re-query GitHub immediately before publishing an approval.
  • Fix: Address or resolve the listed reviewer thread(s), then re-run OpenCode on the current head.
  • Regression test: Keep the approval gate querying reviewThreads(first: 100) after model output and before create_pull_review APPROVE, including bot review agents other than OpenCode itself.

Review thread evidence

Latest unresolved reviewer thread evidence

docs/doctoring/safe-pytest-first-module-target.md line 36

  • Latest reviewer comment: @opencode-agent at 2026-08-22T05:24:00Z

  • Comment URL: #949 (comment)

  • Comment excerpt: ### P1 Make the security-standard attribution independently verifiable / - Location: 'docs/doctoring/safe-pytest-first-module-target.md:36' / - Problem: The document presents the first-module-target behavior as preventing a CWE-88 risk and cites OWASP, but the trusted review evidence contains only the bare external URL and no authoritative source content or verification result. This leaves a material security rationale unsupported. / - Root cause: The documentation relies on an external standards attribution without including a pinned/local excerpt or independently trusted source evi

  • Result: REQUEST_CHANGES

  • Reason: unresolved reviewer or review-agent thread(s) were present before approval.

  • Head SHA: 75c6dbdfde34ac7e729e83f44aa0261e76f475d4

  • Workflow run: 32553294848

  • Workflow attempt: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Docs (2 files)"]
  S1 --> I1["operator or user guidance"]
  I1 --> R1["Review risk: Docs (2 files)"]
  R1 --> V1["docs review"]
  Evidence --> S2["CI script: safe_pytest_command.py"]
  S2 --> I2["review and security gate shell path"]
  I2 --> R2["Review risk: CI script: safe_pytest_command.py"]
  R2 --> V2["bash -n plus Strix self-test"]
  Evidence --> S3["Test: test_safe_pytest_command.py"]
  S3 --> I3["regression suite"]
  I3 --> R3["Review risk: Test: test_safe_pytest_command.py"]
  R3 --> V3["targeted test run"]
Loading

@opencode-agent opencode-agent Bot added merge: urgent-review Central or critical pull request requiring immediate review attention priority: medium Normal-priority or P2 work status: needs-update Pull-request branch is behind its current base type: bug Defect or incorrect behavior labels Aug 22, 2026
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

An error occurred during the review process. Please try again later.


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.

@coderabbitai

coderabbitai Bot commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6e0c4a08-31b1-40b4-a21a-48b77753c9b3

📝 Walkthrough

Walkthrough

safe_pytest_command.py가 GitHub Actions의 단일 run: 명령과 멀티라인 블록에서 안전한 pytest 명령을 탐색하도록 변경되었습니다. Python 및 Coverage 실행 플래그와 첫 모듈 대상 검증을 추가했습니다. 관련 보안 규칙, 회귀 테스트, RFC 문서를 추가했습니다.

Changes

pytest 명령 탐색 확장

Layer / File(s) Summary
명령 추출 및 호출 인식
scripts/ci/safe_pytest_command.py
run: |와 run: > 블록의 각 물리적 명령줄을 개별 후보로 추출합니다. Python 및 Coverage의 실행 플래그와 값 인자를 처리합니다. 첫 모듈 대상이 pytest인 호출만 인식합니다.
안전성 검증 및 회귀 테스트
tests/test_safe_pytest_command.py, scripts/ci/safe_pytest_command.py
비pytest 명령, 셸 제어문자, 잘못된 인용, 잘린 플래그 값, 위험한 실행 대상을 거부합니다. 실행 방식, 작업 디렉터리, 가상환경 PATH, CLI 성공·오류 경로를 검증합니다.
pytest 실행 대상 보안 규칙
docs/doctoring/safe-pytest-first-module-target.md, docs/automation/safe-pytest-command-multiline-run-blocks.md
첫 모듈 대상이 pytest여야 한다는 규칙과 허용·거부되는 Python 및 Coverage 명령 형태를 문서화합니다. shell=False와 기존 보안 경계를 명시합니다.
제어면 아키텍처 문서화
docs/automation/safe-pytest-command-multiline-run-blocks.md
멀티라인 탐색 방식, 기존 false negative 재현, 적대적 테스트 계획, 적용 후속 작업을 RFC로 기록합니다.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: 🔵 Low · up to c6d07

The parser currently misses valid multiline YAML commands that use explicit indentation indicators, so some eligible pytest runs may be skipped; this is a bounded discovery correctness issue, and the PR is otherwise mergeable with owner follow-up to support those headers and add regression coverage.

Sequence Diagram(s)

sequenceDiagram
  participant WorkflowFile as GitHub Actions workflow
  participant DiscoverCommands as discover_commands
  participant RunIterator as _iter_run_command_lines
  participant PytestMatcher as _is_pytest_argv
  WorkflowFile->>DiscoverCommands: 워크플로 텍스트 전달
  DiscoverCommands->>RunIterator: run 명령 후보 추출
  RunIterator-->>DiscoverCommands: 물리적 명령줄 반환
  DiscoverCommands->>PytestMatcher: argv 안전성 검증
  PytestMatcher-->>DiscoverCommands: 검증된 pytest 명령 반환
Loading
🚥 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 제목은 safe_pytest_command의 다중 줄 run: 블록 탐색 수정이라는 주요 변경 사항을 정확하고 간결하게 설명합니다.
Docstring Coverage ✅ Passed Docstring coverage is 95.65% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 46 functions across 3 files. (2 skipped: 2 …
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 95.65% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 46 functions across 3 files. (2 skipped: 2 unsupported.)

✨ 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 fix/safe-pytest-command-multiline-run-blocks

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.

@opencode-agent opencode-agent Bot added priority: critical Immediate blocker, P0, urgent deadlock, or critical incident and removed priority: medium Normal-priority or P2 work labels Aug 22, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@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 afadc7670b9e5ba0f5f3d316c48ebfeb92e52d6e.
  • 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["Docs: safe-pytest-command-multiline-run-blocks.md (2 files)"]
  S1 --> I1["operator or user guidance"]
  I1 --> R1["Review risk: Docs: safe-pytest-command-multiline-run-blocks.md (2 files)"]
  R1 --> V1["docs review"]
  Evidence --> S2["CI script: safe_pytest_command.py"]
  S2 --> I2["review and security gate shell path"]
  I2 --> R2["Review risk: CI script: safe_pytest_command.py"]
  R2 --> V2["bash -n plus Strix self-test"]
  Evidence --> S3["Test: test_safe_pytest_command.py"]
  S3 --> I3["regression suite"]
  I3 --> R3["Review risk: Test: test_safe_pytest_command.py"]
  R3 --> V3["targeted test run"]
Loading

@seonghobae
seonghobae merged commit 7347867 into main Aug 29, 2026
39 of 45 checks passed
@seonghobae
seonghobae deleted the fix/safe-pytest-command-multiline-run-blocks branch August 29, 2026 13:11
seonghobae pushed a commit that referenced this pull request Aug 31, 2026
…finding

contextual-orchestrator#950 (cited by this PR as "the upstream half of this
bug, not yet merged") was closed as redundant/superseded. The fix actually
merged as contextual-orchestrator#949 ("fix(discovery): route OpenRouter by
model evidence", 8cd99f139915131ba0239bce12a5d6a5fd85394e); .github#1477
already advances ORCHESTRATOR_PIN_SHA to that commit. Corrects every stale
#950 reference in the PR's own docstrings and docs/product-technical-gap-
baseline.md, and folds in two things only visible from #949's actual diff:

- #949 also added DiscoveredModel.spend_admitted (default True, False for a
  priced OpenRouter row when openrouter_paid_inference_available() cannot
  confirm usable credit). orchestrator/free never considers priced rows, so
  it was never exposed to this, but orchestrator/auto (real, reachable via
  CONTEXTUAL_ORCHESTRATOR_POOL=auto, no other code change needed) does
  consider priced rows and had no spend_admitted check anywhere in this
  repo's pipeline. _routable_discovered_models() now excludes a
  spend_admitted=False row the same way it excludes evidence_only=True,
  with regression coverage including an end-to-end auto-pool composition.

- A fresh Devin Review red finding on this PR argued the OpenRouter
  evidence_only exemption could let private/--require-zdr review content
  reach ZDR-forbidden routes. Traced end to end: build_zdr_prioritized_
  catalog() independently re-applies is_zdr_model()'s real OpenRouter ZDR-
  feed check as its own admission gate whenever require_zdr=True, entirely
  independent of evidence_only. Confirmed false alarm with a regression
  test proving a non-ZDR-attested OpenRouter row is excluded from a
  require_zdr=True catalog even while every discovered OpenRouter row still
  carries the evidence_only=True bug signature; documented in the gap
  baseline and replied/resolved on the GitHub review thread.

docs/product-technical-gap-baseline.md gets a new 2026-08-31 correction
subsection recording all of the above. Full suite: 2098 passed, 1 skipped,
21 subtests passed; 100% coverage on scripts/ci/; 100% docstring coverage.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Gs7KmNvH75nxz1sL8mKjw
seonghobae pushed a commit that referenced this pull request Sep 2, 2026
Devin Review (this PR, scripts/ci/contextual_orchestrator_review_launcher.py
lines 129-169) flagged that the docstrings describe
#1477 (the ORCHESTRATOR_PIN_SHA bump to
contextual-orchestrator#949's merge commit) as still pending. Verified: #1477
merged on 2026-08-31 -- before this PR's original evidence_only/spend_admitted
fix even landed -- and `git merge-base --is-ancestor
8cd99f139915131ba0239bce12a5d6a5fd85394e 045d17da5e2aea56a97e241ee158ab1628d78660`
against contextual-orchestrator confirms the current pin already descends from
#949's fix commit. The "not yet pinned" / "once #1477 merges" framing was
therefore stale runtime history that would mislead future maintenance into
thinking the pin bump was still outstanding.

Updates both affected docstrings in the launcher module and the two
docstrings in tests/test_contextual_orchestrator_review_runtime_preflight.py
that repeated the same stale framing. Docs-only: no behavior change, no
assertion changed. docs/product-technical-gap-baseline.md's own #1477
references are left untouched -- they are dated, explicitly time-qualified
("open as of this correction") historical entries in this repo's append-only
decision log, not living claims about current state, so rewriting them would
falsify the audit trail rather than correct it.

Verified: `python -m pytest tests/test_contextual_orchestrator_review_runtime_preflight.py
tests/test_contextual_orchestrator_review_sidecar_contract.py -q` -- 95 passed;
`interrogate scripts/ci/contextual_orchestrator_review_launcher.py` -- 100%.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Gs7KmNvH75nxz1sL8mKjw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge: urgent-review Central or critical pull request requiring immediate review attention priority: critical Immediate blocker, P0, urgent deadlock, or critical incident status: needs-update Pull-request branch is behind its current base type: bug Defect or incorrect behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant