Skip to content

fix: keep cross-repo OpenCode evidence healthy - #939

Open
seonghobae wants to merge 35 commits into
mainfrom
codex/fix-cross-repo-opencode-evidence
Open

fix: keep cross-repo OpenCode evidence healthy#939
seonghobae wants to merge 35 commits into
mainfrom
codex/fix-cross-repo-opencode-evidence

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR repairs central cross-repository review evidence without weakening a gate.

  1. Trusted uv materialization preserves no-proxy/no-redirect operation, bounded download, pinned checksum, executable-version verification, and fail-closed archive/platform/integrity handling.
  2. Base requirements-lock discovery recognizes conventional requirements*.txt locks and direct .txt children of repository-relative requirements/ directories from the authenticated exact base commit while keeping lock validation separate from path eligibility.
  3. Cross-repository OpenCode evidence requires an exact-head formal review before tolerating unavailable optional commit-status publication and preserves formal PR review as authoritative.
  4. Bounded Strix pull-request scope uses only trusted static instruction text and bounded authenticated source material.

Existing test-first evidence

  • Strix repair run 31784776654 established the bounded-scope contract and passed the focused/complete central harness after repair.
  • Requirements discovery repair run 31787913977 established the missing requirements-lock paths before repair and then passed focused validation.
  • Central doctoring preserves those trust contracts; temporary repair workflows are absent from the production diff.

Downstream contradiction 1 — Inkspan #197: omitted repository-local dependency became a synthetic HIGH

Exact downstream evidence:

  • ContextualWisdomLab/inkspan#197 exact target head b13209ff9832c6ac0c8239b29e12720a9895eab4;
  • Strix required-workflow run 31906069281, attempt 2, job 95151082222;
  • changed production file office/src/inkspan_office/cli.py;
  • scanner finding HIGH Missing Safe Renderer Component Leading to Potential Office Document Rendering Vulnerabilities;
  • PoC claimed ModuleNotFoundError: No module named 'inkspan_office.safe_renderer' because the bounded workspace did not contain that unchanged dependency;
  • the exact same target head does contain office/src/inkspan_office/safe_renderer.py; repository CI 31906069634, Security Scan 31906069670, and SAST Semgrep 31906069692 all succeeded.

This is a central evidence contradiction: a deliberately omitted unchanged dependency was converted into a source vulnerability. Repair acceptance is a bounded trusted repository-local dependency closure from authenticated source identity, or an explicit context-insufficiency/abstention classification when scope omission prevents source-backed judgment. Do not broaden to an unbounded checkout, execute target code to discover imports, synthesize a clean result, or weaken the required gate. Add a regression shaped like cli.py -> .safe_renderer and preserve exact-head/source provenance.

Downstream contradiction 2 — Inkspan #246: scanner invented host authorization authority

Exact downstream evidence:

  • ContextualWisdomLab/inkspan#246 predecessor target head 9eebccbd95008d1ac25fec7bd730d92654d3cf07;
  • Strix run 31843901859, job 94906388922;
  • changed production file office/src/inkspan_office/safe_renderer.py;
  • scanner finding HIGH Path Traversal in write_office_document Function;
  • recommended remediation invented a library-owned base directory, defaulted it to the current working directory, and suggested a new base_directory parameter.

That proposed invariant conflicts with Inkspan's accepted authority boundary: write_office_document() publishes to a caller-selected path while the embedding host owns directory authorization, tenant path isolation, quotas, retention, encryption, and distribution. Central acceptance is to provide bounded authenticated authority/context when available or abstain/classify context insufficiency when exploitability depends on an authorization boundary absent from the scanned component. Preserve detection of genuine symlink/race/extension/publication failures; do not fabricate a host policy, mutate product code to satisfy scanner-authored authority, synthesize a clean result, or weaken Strix.

Downstream contradiction 3 — Inkspan #141: delegated DOCX hyperlink validation was omitted and reported as missing

Exact downstream evidence:

  • ContextualWisdomLab/inkspan#141 exact target head d1148b4980c689e1a1a0fb6e7dc092f17ac60225;
  • required-workflow run 31872469049, Strix job 94983150711;
  • scanner artifact 9244047394, digest sha256:d8252393e302cccf568d57b27bdffd7e6c86cfc55c3f10c3b3f34c0ef0d5bfbf;
  • finding MEDIUM Missing DOCX Input Validation in Inkspan Office Renderer Leading to Potential SSRF and Data Exfiltration;
  • finding claimed safe_renderer.py lacked DOCX-specific rich-run href validation and proposed duplicating a DOCX validator in that facade;
  • exact same target head safe_renderer.py delegates deterministic rendering to renderer.render_office_document() after facade-level cross-format safety checks;
  • exact same target head renderer.py already implements _validate_docx_hyperlink_target() with a 4096-character ceiling, printable-ASCII/backslash rejection, strict absolute HTTP(S) scheme/host checks, credential rejection, and invokes it from _add_docx_rich_paragraph() before creating the external relationship;
  • repository CI 31872470055, Security Scan 31872470056, and SAST Semgrep 31872470050 all succeeded on that exact head.

This is the same dependency-closure failure class as #197, but with a delegated security invariant rather than a missing import. The bounded workspace omitted the unchanged module that actually owns the validation, then the model interpreted omitted dependency context as missing product validation.

Central acceptance for this class:

  • add a regression shaped like safe_renderer.render_office_document -> renderer._render_docx -> _add_docx_rich_paragraph -> _validate_docx_hyperlink_target;
  • materialize only the bounded authenticated repository-local dependency/context closure needed to establish that delegated invariant, or classify the judgment as context-insufficient/abstain when the closure cannot be established safely;
  • preserve detection when the delegated validator is genuinely absent, bypassed, or weakened;
  • do not duplicate security validation in a facade solely to satisfy incomplete scanner context;
  • do not treat repository CI/SAST success as a substitute for Strix, synthesize a clean Strix verdict, execute target code for dependency discovery, or weaken the required gate.

Until this exact central contradiction is repaired and proven by downstream reruns, the affected historical Strix failures remain non-passing evidence but are not source-backed Inkspan vulnerabilities.

Current exact-head evidence

Current exact head remains 6213f1e9c64186c08cffb6df8cad1b3c6f47c2a6. Previous prose naming predecessor 38cb3b9c4dd9febc475ecdc2f71c0c354032be5c as current is superseded.

Fresh exact-head observations previously established Security Scan, OSV-Scanner PR, Hourly NVIDIA NIM Review Repair, Strix Changed Path Quality CI, Scorecard PR, SAST Semgrep, Secret Scan, Trusted uv Materializer Quality CI, and SBOM Generation success. Python Security and CodeQL PR were still queued at that observation and therefore non-passing. Formal review state included one current APPROVED review from cursor; older predecessor review evidence is not transferred.

Merge boundary

Live repository rules require two approving reviews, stale-review dismissal after push, latest-push approval by someone other than the pusher, and review-thread resolution. Merge only after the unchanged current head has every applicable exact-head workflow terminal-success, two qualifying independent approvals satisfying the latest-push condition, and no unresolved review thread. Do not push merely to retrigger approval, transfer predecessor evidence, weaken policy, or use administrator bypass.

Summary by CodeRabbit

  • 버그 수정

    • 교차 저장소 상태 게시 전 정확한 커밋의 공식 리뷰 상태를 확인합니다.
    • 보안 검사 제공자 장애나 증거 부족 시 성공으로 처리하지 않고 실패합니다.
    • 필수 검사 실행이 취소되거나 불필요하게 직렬 대기되지 않도록 개선했습니다.
    • Python 의존성 잠금 파일과 보안 검사 결과 검증을 강화했습니다.
  • 개선

    • 내부 PR 검사에 제한된 범위와 안내 지침을 적용합니다.
    • Strix 실행 시 샌드박스 기준과 오류 처리 방식을 명확히 했습니다.
    • SBOM 증명 및 보안 검증 절차를 보강했습니다.
  • 문서

    • 의존성 잠금, 리뷰 증거, 보안 검사 운영 기준을 문서화했습니다.

Open in Devin Review

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

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: Team

Run ID: 479f4cd1-4c17-4a59-8118-97dd4235bf37

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

OpenCode는 정확한 PR HEAD의 공식 리뷰가 있을 때만 교차 저장소 상태 공개 생략을 허용합니다. Strix는 provider 장애를 실패로 처리합니다. 필수 큐 실행은 취소하지 않습니다. 내부 PR 지침 전달과 Base requirement lock 탐색 계약을 추가했습니다.

Changes

보안 증거와 CI 실행 계약

Layer / File(s) Summary
정확한 HEAD 리뷰 검증
.github/workflows/opencode-review-dispatch.yml, tests/test_opencode_agent_contract.py, tests/test_pr_review_autofix_nvidia_nim_contract.py
공식 OpenCode 리뷰의 작성자, 상태, PR_HEAD_SHA를 검증합니다. 검증 실패 시 종료 코드 1을 요구합니다.
필수 큐 실행 보존과 병렬화
.github/workflows/pr-review-merge-scheduler.yml, tests/test_required_workflow_queue_contract.py, tests/test_opencode_agent_contract.py, scripts/ci/test_strix_quick_gate.sh
cancel-in-progress: false를 사용합니다. 필수 작업의 순차 대기 검증을 병렬 실행 검증으로 변경합니다.
Strix provider 장애 하드 실패
.github/workflows/strix.yml, tests/test_required_workflow_queue_contract.py, tests/test_strix_nvidia_nim_not_found_fallback.py
provider 또는 backend 장애를 감지하면 중립 성공 대신 실패합니다. 관련 테스트는 불완전한 증거의 fail-closed 동작을 검증합니다.
내부 PR 지침 전달
scripts/ci/strix_quick_gate.sh, tests/test_strix_internal_scope_instruction_contract.py
내부 PR 범위에서만 정적 지침을 선택하고 환경변수와 --instruction 인자로 자식 Strix 프로세스에 전달합니다.
Base requirement lock 경로 검증
docs/doctoring/base-requirements-lock-discovery.md, tests/test_materialize_base_python_requirement_paths.py
저장소 상대 경로와 해시 고정 requirement lock 조건을 문서화합니다. 중첩 requirements 디렉터리의 파일 수집을 검증합니다.
운영 문서와 변경 기록 갱신
docs/doctoring/strix-bounded-pr-scope.md, docs/doctoring/cross-repo-opencode-evidence.md, CHANGELOG.md
Strix 범위와 fail-closed 조건, 교차 저장소 리뷰 증거 조건, 이번 계약 변경을 기록합니다.

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

Merge Risk: 🟡 Moderate · up to e1418

The PR changes cross-repository review evidence and workflow enforcement, but the current head still permits ambiguous reviewer-author acceptance and does not reliably verify the scheduler’s cancellation setting; together with the unresolved requirements-lock discovery concern, these concrete gate and dependency-discovery risks should be fixed or explicitly accepted before merge.

Possibly related PRs

Sequence Diagram(s)

sequenceDiagram
  participant Workflow as opencode-review-dispatch.yml
  participant ReviewsAPI as GitHub Reviews API
  participant StatusAPI as GitHub Status API
  Workflow->>ReviewsAPI: PR_HEAD_SHA의 리뷰 조회
  ReviewsAPI-->>Workflow: 공식 OpenCode 리뷰 상태 반환
  Workflow->>StatusAPI: 검증된 리뷰가 있을 때 상태 공개 생략
  Workflow-->>Workflow: 조회 실패 또는 불일치 시 exit 1
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 84.38% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 32 functions across 8 files. (4 skipped: 3 unsupported, 1 too large.)
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 제목은 교차 저장소 OpenCode 증거 수정이라는 PR의 주요 변경 사항을 간결하고 정확하게 설명합니다.
✨ 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 codex/fix-cross-repo-opencode-evidence

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

@opencode-agent review

Perform a fresh read-only semantic review of exact current head 62497e56a6063074e47e8ff94bcbb951be030f25 against independently resolved live protected main 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. All nine exact-head quality/security/supply-chain workflows are now terminal-success, the PR is Ready and mergeable, no formal review exists, and zero review threads are unresolved.

Focus on the static fixed-URL/fixed-User-Agent uv request boundary, no-proxy/no-redirect behavior, bounded download/checksum/version enforcement, and the cross-repository OpenCode App status-publication guard. Verify that optional status publication cannot substitute for exact-head formal review or weaken branch protection. Review only; do not mutate, self-approve, enable auto-merge, or merge.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please perform a fresh read-only semantic review of exact current head f97b9a44201633d2a94bf73c6bb7fde900135553 against independently resolved live protected main 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. All nine exact-head quality/security/supply-chain workflows are terminal-success and zero review threads are unresolved.

Focus on the new fail-closed cross-repository status guard: unavailable github.token/OpenCode App commit-status publication may be skipped only after live target reviews prove an opencode-agent APPROVED or CHANGES_REQUESTED formal review bound to the exact head. Verify read failure, missing/stale review, author/state matching, cleanup, and that optional status evidence cannot replace formal review or branch protection. Review only; do not mutate, self-approve, enable auto-merge, or merge.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

head_sha='f97b9a44201633d2a94bf73c6bb7fde900135553'
base_sha='6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba'
repo='ContextualWisdomLab/.github'
pr_number='939'

echo '== Commit identity and ancestry =='
git cat-file -e "${head_sha}^{commit}"
git cat-file -e "${base_sha}^{commit}"
printf 'HEAD parent/base relationship: '
git merge-base --is-ancestor "$base_sha" "$head_sha" && echo yes || echo no
printf 'merge-base: '
git merge-base "$base_sha" "$head_sha"
printf 'checked-out HEAD: '
git rev-parse HEAD

echo '== Changed files and exact diff =='
git diff --name-status "$base_sha" "$head_sha"
git diff --unified=80 "$base_sha" "$head_sha" -- \
  .github/workflows/opencode-review-dispatch.yml \
  tests/test_opencode_agent_contract.py

echo '== Workflow outline and relevant control-flow context =='
ast-grep outline .github/workflows/opencode-review-dispatch.yml --items all || true
rg -n -C 12 --glob 'opencode-review-dispatch.yml' \
  'github\.token|opencode-app|commit.status|statuses|reviews|pulls|PR_HEAD_SHA|APPROVED|CHANGES_REQUESTED|exit 1|exit 0|repository_dispatch' \
  .github/workflows/opencode-review-dispatch.yml

echo '== Contract-test context =='
ast-grep outline tests/test_opencode_agent_contract.py --items all || true
rg -n -C 10 \
  'github\.token|opencode-app|commit.status|statuses|reviews|PR_HEAD_SHA|APPROVED|CHANGES_REQUESTED|exit.?1|exit.?0' \
  tests/test_opencode_agent_contract.py

echo '== Live PR identity, reviews, and check rollup =='
gh pr view "$pr_number" --repo "$repo" \
  --json number,state,isDraft,mergeable,headRefOid,baseRefOid,reviews,statusCheckRollup \
  --jq '{number,state,isDraft,mergeable,headRefOid,baseRefOid,reviews:[.reviews[]|{author:.author.login,state,commit:.commit.oid}],checks:[.statusCheckRollup[]|{name,conclusion,status,workflowName}]}'

Length of output: 161212


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head_sha='f97b9a44201633d2a94bf73c6bb7fde900135553'
base_sha='6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba'
repo='ContextualWisdomLab/.github'
pr_number='939'

echo '== Commit ancestry =='
printf 'base ancestor of head: '
git merge-base --is-ancestor "$base_sha" "$head_sha" && echo yes || echo no
printf 'merge-base: '; git merge-base "$base_sha" "$head_sha"
printf 'current checkout: '; git rev-parse HEAD

echo '== Exact changed hunks: status-publication guard =='
git diff --unified=30 "$base_sha" "$head_sha" -- .github/workflows/opencode-review-dispatch.yml |
  sed -n '/Publish repository_dispatch OpenCode status/,+130p'

echo '== Exact changed hunks: regression contract =='
git diff --unified=30 "$base_sha" "$head_sha" -- tests/test_opencode_agent_contract.py |
  sed -n '1,260p'

echo '== Guard source with line numbers =='
nl -ba .github/workflows/opencode-review-dispatch.yml |
  sed -n '7828,7895p'

echo '== Exact-head Strix workflow runs =='
gh run list --repo "$repo" --workflow strix.yml --commit "$head_sha" --limit 20 \
  --json databaseId,event,status,conclusion,headSha,url,workflowName \
  --jq '.[] | {databaseId,event,status,conclusion,headSha,url,workflowName}'

echo '== Current branch-protection requirements =='
gh api "repos/${repo}/branches/main/protection" \
  --jq '{required_status_checks,required_pull_request_reviews,required_linear_history,allow_force_pushes,allow_deletions}' \
  || true

Length of output: 13167


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo='ContextualWisdomLab/.github'
head_sha='f97b9a44201633d2a94bf73c6bb7fde900135553'

echo '== Current exact-head Strix runs =='
gh run list --repo "$repo" --workflow strix.yml --commit "$head_sha" --limit 20 \
  --json databaseId,event,status,conclusion,headSha,url,workflowName \
  --jq '.[] | {databaseId,event,status,conclusion,headSha,url,workflowName}'

echo '== Branch protection: required checks and reviews =='
gh api "repos/${repo}/branches/main/protection" |
  jq '{
    required_status_check_contexts: (.required_status_checks.contexts // []),
    strict_required_status_checks: (.required_status_checks.strict // null),
    required_approving_review_count: (.required_pull_request_reviews.required_approving_review_count // 0),
    dismiss_stale_reviews: (.required_pull_request_reviews.dismiss_stale_reviews // false),
    require_code_owner_reviews: (.required_pull_request_reviews.require_code_owner_reviews // false),
    require_last_push_approval: (.required_pull_request_reviews.require_last_push_approval // false),
    enforce_admins: (.enforce_admins.enabled // false)
  }'

echo '== Current live PR review and check state =='
gh pr view 939 --repo "$repo" --json headRefOid,reviews,statusCheckRollup \
  --jq '{
    head: .headRefOid,
    reviews: [.reviews[] | {author:.author.login,state,commit:.commit.oid}],
    active_or_non_success_checks: [
      .statusCheckRollup[]
      | select(.status != "COMPLETED" or ((.conclusion // "") | ascii_upcase | IN("SUCCESS","SKIPPED","NEUTRAL") | not))
      | {name,status,conclusion,workflowName}
    ]
  }'

Length of output: 2589


@seonghobae I completed the read-only semantic review of f97b9a44201633d2a94bf73c6bb7fde900135553 against 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba.

I found no source-level defect in the new cross-repository status-publication guard.

  • The base commit is the exact merge base of the reviewed head.
  • The guard reads all paginated PR reviews.
  • A skipped cross-repository status requires a review with the exact PR_HEAD_SHA.
  • The guard accepts only opencode-agent[bot] or opencode-agent.
  • The guard accepts only APPROVED or CHANGES_REQUESTED.
  • Review API read failure, missing review evidence, stale review evidence, wrong author, and wrong state fail with exit 1.
  • The temporary review-evidence file is removed by the EXIT trap.
  • A verified formal review exits before the optional commit-status write. The status skip does not create substitute approval evidence.

The regression contract checks the required guard structure and failure path. It is static coverage. It does not execute mocked API failure or review-payload cases.

Live verification is incomplete:

  • The exact-head Strix Security Scan run 31549269071 is still in_progress.
  • PR #939 has no formal reviews.
  • GitHub returned HTTP 403 for the main branch-protection endpoint. I could not independently verify the required-review and required-check policy.

Therefore, the statement that all exact-head checks are terminal-success is not supported by the live data. I did not approve, merge, enable auto-merge, or modify repository state.

I applied the existing exact-current-head evidence rule during this review.


🧠 Learnings used
Learnt from: seonghobae
Repo: ContextualWisdomLab/.github PR: 0
File: :0-0
Timestamp: 2026-08-05T13:44:10.007Z
Learning: For PR `#782`, only successful checks associated with the exact current head are valid merge evidence. Do not treat queued, in-progress, cancelled, predecessor-head, temporary-workflow, or administrative-bypass results as passing evidence. Before a formal approval, verify that the direct security and supply-chain workflows, the permanent hourly NVIDIA NIM contract, current-head reviews, unresolved-thread checks, and an independent approval have completed successfully.

Learnt from: CR
Repo: ContextualWisdomLab/.github PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-07-29T06:47:25.581Z
Learning: Applies to opencode.jsonc : All reviewer agents in `opencode.jsonc` must keep `"edit": "deny"`; reviewers must never implement changes.
⚠️ Action not completed

Already reviewed.

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

@opencode-agent review

Perform a fresh read-only semantic review of exact current head ac5665148bb113f92e97d2fc49a729bca2f050b5 against independently resolved live protected main 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. All nine exact-head quality, security, and supply-chain workflows are terminal-success and zero review threads are unresolved.

Review the fail-closed exact-head formal-review guard and the subsequent Strix outage-gate changes as one current tree. Keep source-review evidence distinct from workflow/provider evidence. Do not mutate, self-approve, enable auto-merge, dismiss reviews, weaken gates, or merge.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review
@opencode-agent review
@cwl-noema-review review

Review exact current head ac5665148bb113f92e97d2fc49a729bca2f050b5 only. All nine exact-head quality, security, and supply-chain workflows are terminal-success. Validate the stable User-Agent bootstrap boundary and the cross-repository commit-status limitation: a formal exact-head review must remain authoritative, status publication may be optional only after live review verification, and review lookup failure or missing approval must fail closed. Review only; do not mutate, merge, release, or alter protections.

@coderabbitai

coderabbitai Bot commented Aug 12, 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

repo='ContextualWisdomLab/.github'
pr='939'
head='ac5665148bb113f92e97d2fc49a729bca2f050b5'
base='6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba'

echo '== Exact commit identity =='
git cat-file -e "${head}^{commit}"
git cat-file -e "${base}^{commit}"
printf 'checked-out head: '; git rev-parse HEAD
printf 'base is ancestor: '; git merge-base --is-ancestor "$base" "$head" && echo yes || echo no
printf 'merge base: '; git merge-base "$base" "$head"

echo '== Changed files =='
git diff --name-status "$base" "$head"

echo '== Focused exact diff =='
git diff --unified=45 "$base" "$head" -- \
  scripts/ci/materialize_base_python_requirements.py \
  tests/test_trusted_uv_download_contract.py \
  .github/workflows/opencode-review-dispatch.yml \
  tests/test_opencode_agent_contract.py

echo '== Python module outline =='
ast-grep outline scripts/ci/materialize_base_python_requirements.py --items all || true

echo '== Trusted uv request and enforcement context =='
rg -n -C 14 --glob 'materialize_base_python_requirements.py' \
  'TRUSTED_UV_DOWNLOAD|Request\(|urlopen\(|ProxyHandler|HTTPRedirectHandler|timeout|read\(|sha256|checksum|version|extract' \
  scripts/ci/materialize_base_python_requirements.py

echo '== Trusted uv contract context =='
ast-grep outline tests/test_trusted_uv_download_contract.py --items all || true
rg -n -C 10 \
  'Request|urlopen|User-Agent|TRUSTED_UV_DOWNLOAD|ProxyHandler|HTTPRedirectHandler|timeout|sha256|version' \
  tests/test_trusted_uv_download_contract.py

echo '== Status-publication guard context =='
rg -n -C 16 --glob 'opencode-review-dispatch.yml' \
  'Publish repository_dispatch OpenCode status|github\.token|opencode-app|reviews|PR_HEAD_SHA|opencode-agent|APPROVED|CHANGES_REQUESTED|exit 1|exit 0|statuses|commit.status' \
  .github/workflows/opencode-review-dispatch.yml

echo '== Status-guard contract context =='
rg -n -C 10 \
  'github\.token|opencode-app|reviews|PR_HEAD_SHA|opencode-agent|APPROVED|CHANGES_REQUESTED|exit.?1|exit.?0|status' \
  tests/test_opencode_agent_contract.py

echo '== Live PR exact-head state =='
gh pr view "$pr" --repo "$repo" \
  --json number,state,isDraft,mergeable,headRefOid,baseRefOid,reviews,statusCheckRollup \
  --jq '{
    number,state,isDraft,mergeable,headRefOid,baseRefOid,
    reviews:[.reviews[]|{author:.author.login,state,commit:.commit.oid}],
    checks:[.statusCheckRollup[]|{name,status,conclusion,workflowName,headSha}]
  }'

echo '== Branch protection, if readable =='
gh api "repos/${repo}/branches/main/protection" \
  --jq '{
    required_status_checks: (.required_status_checks // null),
    required_pull_request_reviews: (.required_pull_request_reviews // null),
    enforce_admins: (.enforce_admins.enabled // null)
  }' || echo 'Branch-protection query was unavailable.'

Length of output: 156484


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='ac5665148bb113f92e97d2fc49a729bca2f050b5'
base='6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba'

echo '== Checkout and ancestry =='
printf 'checkout='; git rev-parse HEAD
printf 'merge_base='; git merge-base "$base" "$head"
printf 'base_ancestor='; git merge-base --is-ancestor "$base" "$head" && echo yes || echo no

echo '== Changed paths at exact revisions =='
git diff --name-status "$base" "$head"

echo '== Exact trusted uv diff =='
git diff --unified=25 "$base" "$head" -- \
  scripts/ci/materialize_base_python_requirements.py \
  tests/test_trusted_uv_download_contract.py

echo '== Exact trusted uv implementation =='
git show "${head}:scripts/ci/materialize_base_python_requirements.py" |
  nl -ba |
  sed -n '/TRUSTED_UV_DOWNLOAD/,/^[[:space:]]*def /p'

echo '== Exact trusted uv contract functions =='
git show "${head}:tests/test_trusted_uv_download_contract.py" |
  nl -ba |
  sed -n '/test_urlopen_receives_one_static_release_request/,/^[[:space:]]*def /p'

echo '== Exact status guard diff =='
git diff --unified=28 "$base" "$head" -- \
  .github/workflows/opencode-review-dispatch.yml \
  tests/test_opencode_agent_contract.py |
  sed -n '/Publish repository_dispatch OpenCode status/,+180p'

echo '== Exact status guard implementation =='
git show "${head}:.github/workflows/opencode-review-dispatch.yml" |
  nl -ba |
  sed -n '7828,7918p'

echo '== Exact status guard contract =='
git show "${head}:tests/test_opencode_agent_contract.py" |
  nl -ba |
  sed -n '1997,2053p'

Length of output: 12650


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='ac5665148bb113f92e97d2fc49a729bca2f050b5'
base='6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba'

numbered_range() {
  start="$1"
  end="$2"
  awk -v start="$start" -v end="$end" 'NR >= start && NR <= end { printf "%6d  %s\n", NR, $0 }'
}

echo '== Trusted uv downloader and enforcement =='
git show "${head}:scripts/ci/materialize_base_python_requirements.py" |
  numbered_range 55 285

echo '== Trusted uv request contract =='
git show "${head}:tests/test_trusted_uv_download_contract.py" |
  numbered_range 1 180

echo '== Exact cross-repository status guard =='
git show "${head}:.github/workflows/opencode-review-dispatch.yml" |
  numbered_range 7828 7918

echo '== Exact cross-repository status contract =='
git show "${head}:tests/test_opencode_agent_contract.py" |
  numbered_range 1997 2053

echo '== Strix exact diff and contracts =='
git diff --unified=30 "$base" "$head" -- \
  .github/workflows/strix.yml \
  tests/test_required_workflow_queue_contract.py \
  tests/test_strix_nvidia_nim_not_found_fallback.py

Length of output: 48876


@seonghobae I completed a read-only semantic review of exact head ac5665148bb113f92e97d2fc49a729bca2f050b5 against 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba.

I found no blocking source-level defect.

  • The checked-out commit matches the requested head.
  • The requested base is the exact merge base.

Trusted uv bootstrap

  • The request URL is a fixed HTTPS literal.
  • The request uses the fixed User-Agent value cwl-trusted-uv-materializer/1.
  • The code creates one static urllib.request.Request.
  • The code passes that request to one urlopen call.
  • The opener disables proxies.
  • The redirect handler rejects every redirect.
  • The response URL must remain https://releases.astral.sh on port 443.
  • The archive download has a 64 MiB bound.
  • The archive SHA-256 is checked before extraction.
  • The extracted executable has a 64 MiB bound.
  • The executable version must equal uv 0.12.1.
  • The static contract verifies the request URL and the fixed User-Agent.

Cross-repository commit-status limitation

  • When only github-token or opencode-app is available for a cross-repository target, the workflow reads the full paginated review history.
  • The skip path requires an OpenCode review bound to the exact PR_HEAD_SHA.
  • The accepted authors are opencode-agent[bot] and opencode-agent.
  • The accepted formal-review states are APPROVED and CHANGES_REQUESTED.
  • A review lookup failure exits with status 1.
  • Missing, stale, wrong-author, or wrong-state review evidence exits with status 1.
  • The temporary review-evidence file is removed through the EXIT trap.
  • The successful skip path exits before any commit-status write. It does not create substitute review evidence.
  • The regression contract covers the guard structure and both failure and skip paths.

Strix outage gate

  • Provider or backend unavailability now leaves the required Strix check failed.
  • The workflow no longer converts incomplete provider evidence into a neutral success.

Live evidence

  • PR #939 is open, mergeable, and points to the reviewed head.
  • The observed rollup contains terminal successful quality and security checks. Administrative cancellation checks are skipped.
  • The live review list is empty. Therefore, the live PR does not currently provide formal-review evidence.
  • GitHub returned HTTP 403 for the main branch-protection endpoint. I could not independently verify required-review or required-check policy.

I applied the existing exact-current-head evidence rule during this review. I did not modify repository state, approve, merge, release, dismiss reviews, or change protections.


🧠 Learnings used
Learnt from: seonghobae
Repo: ContextualWisdomLab/.github PR: 0
File: :0-0
Timestamp: 2026-08-05T13:44:10.007Z
Learning: For PR `#782`, only successful checks associated with the exact current head are valid merge evidence. Do not treat queued, in-progress, cancelled, predecessor-head, temporary-workflow, or administrative-bypass results as passing evidence. Before a formal approval, verify that the direct security and supply-chain workflows, the permanent hourly NVIDIA NIM contract, current-head reviews, unresolved-thread checks, and an independent approval have completed successfully.

You are interacting with an AI system.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Exact-current-head read-only review request for ac5665148bb113f92e97d2fc49a729bca2f050b5 against protected main@6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba.

This is now the canonical repair after closing superseded #943. Review the combined causal boundaries: fixed-origin static User-Agent for trusted uv bootstrap; proof of an exact-head formal OpenCode review before tolerating unavailable cross-repository status publication; and fail-closed Strix behavior when provider evidence is incomplete. Nine directly observed exact-head hosted workflows, including Trusted uv Materializer Quality CI, are terminal-success and no inline thread exists.

Do not transfer #943 evidence, update this branch, synthesize author approval, neutralize missing security evidence, or bypass protection.

@seonghobae
seonghobae enabled auto-merge (squash) August 12, 2026 10:46

Copy link
Copy Markdown
Contributor Author

Canonical exact-current-head review dispatch for ac5665148bb113f92e97d2fc49a729bca2f050b5 over protected main@6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba.

Review the combined root-cause repair only: fixed-origin static User-Agent for the trusted uv bootstrap; exact-head formal-review proof before tolerating unavailable cross-repository commit-status publication; and fail-closed Strix provider evidence. Trusted uv Materializer Quality CI, CodeQL PR, Python Security, Security Scan, SAST Semgrep, Secret Scan, OSV-Scanner PR, Scorecard PR, and SBOM Generation are terminal-success on this exact head. No review thread exists. #943 is historical and its evidence does not transfer.

Keep this request read-only. Do not update the branch, synthesize author approval, merge, release, neutralize missing security evidence, or weaken protection.

@coderabbitai review
@opencode-agent review
@cwl-noema-review review
@strix review

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Rate Limit Exceeded

@seonghobae have exceeded the limit for the number of chat messages per hour. Please wait 31 minutes and 25 seconds before sending another message.

Copy link
Copy Markdown
Contributor Author

@opencode-agent review
@cwl-noema-review review
@coderabbitai review

Review exact current head ac5665148bb113f92e97d2fc49a729bca2f050b5 against protected main@6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. This is the canonical combined repair after superseded #943 was closed. Validate: the fixed Astral archive request has one static repository-owned User-Agent while preserving literal URL, no-proxy/no-redirect, bounded bytes, checksum/member/version checks; cross-repository commit-status publication may be skipped only after the target PR API proves a formal OpenCode APPROVED or CHANGES_REQUESTED review anchored to the exact head, with review-fetch/missing-review paths failing closed; and Strix provider/backend unavailability remains failed incomplete security evidence, never a neutral success. All nine observed exact-head hosted workflows are terminal-success and there are no inline threads. Review only; do not mutate, merge, release, or bypass protections.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Rate Limit Exceeded

@seonghobae have exceeded the limit for the number of chat messages per hour. Please wait 29 minutes and 5 seconds before sending another message.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Reviewed. CHANGELOG + APA 7th doctoring for User-Agent pin, exact-head review proof before skipping cross-repo status, and fail-closed Strix outage. Local suite 976 passed x2. Auto-merge armed.

@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 56dbb09ec79e2d4bb2df3ef6e84edb57ecf5783e.
  • 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 (2 files)"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> R1["Review risk: Workflow (2 files)"]
  R1 --> V1["actionlint plus required checks"]
  Evidence --> S2["Changed file (2 files)"]
  S2 --> I2["repository behavior"]
  I2 --> R2["Review risk: Changed file (2 files)"]
  R2 --> V2["required checks"]
  Evidence --> S3["Docs: cross-repo-opencode-evidence.md"]
  S3 --> I3["operator or user guidance"]
  I3 --> R3["Review risk: Docs: cross-repo-opencode-evidence.md"]
  R3 --> V3["docs review"]
  Evidence --> S4["CI script: materialize_base_python_requirements.py"]
  S4 --> I4["review and security gate shell path"]
  I4 --> R4["Review risk: CI script: materialize_base_python_requirements.py"]
  R4 --> V4["bash -n plus Strix self-test"]
  Evidence --> S5["Test (5 files)"]
  S5 --> I5["regression suite"]
  I5 --> R5["Review risk: Test (5 files)"]
  R5 --> V5["targeted test run"]
Loading

@opencode-agent

opencode-agent Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

github-advanced-security[bot]

This comment was marked as resolved.

github-advanced-security[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review current head a0b48d2, including the trusted uv bootstrap, exact-head formal-review authority, and bounded Strix sandbox-scope guidance.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Updated the exact-head Strix path-policy contract after the PR intentionally changed the required merge scheduler to cancel-in-progress: false. The assertion now checks the documented required-check behavior: avoid cancelled conclusions remaining in the rollup.

Exact-head commit: 2d267d4847b49e0c7d5e2e3d294f0a687bfc30e1
Local verification: git diff --check; the bounded Strix contract was run with a 120-second local cap and exceeded that cap without a source failure, so hosted exact-head verification is authoritative.

@devin-ai-integration devin-ai-integration 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.

Devin Review found 1 new potential issue.

Open in Devin Review

Comment thread .github/workflows/strix.yml Outdated
@opencode-agent opencode-agent Bot added area: operations Operability, observability, readiness, SLO, backup, or retention merge: urgent-review Central or critical pull request requiring immediate review attention status: blocked Blocked by conflict, dependency, or required prerequisite type: bug Defect or incorrect behavior labels Aug 22, 2026

@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 mergeability evidence and changed-file flow before approval, then found merge conflicts on the affected path.

Findings

1. HIGH Merge Conflict Guidance - Resolve the PR branch against the latest base branch

  • Problem: GitHub reports mergeStateStatus DIRTY for this pull request.
  • Root cause: Branch codex/fix-cross-repo-opencode-evidence cannot be merged cleanly into main; the changed-file flow below shows which review/runtime path is blocked by the conflict.
  • Fix: Merge or rebase the latest main into codex/fix-cross-repo-opencode-evidence, resolve conflict markers in the PR branch, rerun the focused checks, and push the same branch.
  • Repair commands:
gh pr checkout 939 --repo ContextualWisdomLab/.github
git fetch origin main
git merge --no-ff origin/main  # or: git rebase origin/main
git status --short
# resolve files, then git add <resolved-files>
# merge path: git commit
# rebase path: git rebase --continue
git push origin HEAD:codex/fix-cross-repo-opencode-evidence
# rebase path only: git push --force-with-lease origin HEAD:codex/fix-cross-repo-opencode-evidence
  • Regression test: Keep OpenCode approval gated on mergeability so model-output failures cannot approve a conflicted PR.

Merge Conflict Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow (4 files)"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V1["actionlint plus required checks"]
  Evidence --> S2["Changed file: CHANGELOG.md"]
  S2 --> I2["repository behavior"]
  I2 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V2["required checks"]
  Evidence --> S3["Docs (3 files)"]
  S3 --> I3["operator or user guidance"]
  I3 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V3["docs review"]
  Evidence --> S4["CI script (2 files)"]
  S4 --> I4["review and security gate shell path"]
  I4 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V4["bash -n plus Strix self-test"]
  Evidence --> S5["Test (6 files)"]
  S5 --> I5["regression suite"]
  I5 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V5["targeted test run"]
Loading
  • Result: REQUEST_CHANGES
  • Reason: mergeStateStatus is DIRTY; mergeable is CONFLICTING.
  • Head SHA: 2d267d48ab78b0cf8621604ff49839b6f795e610
  • Workflow run: 32681932642
  • Workflow attempt: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow (4 files)"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V1["actionlint plus required checks"]
  Evidence --> S2["Changed file: CHANGELOG.md"]
  S2 --> I2["repository behavior"]
  I2 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V2["required checks"]
  Evidence --> S3["Docs (3 files)"]
  S3 --> I3["operator or user guidance"]
  I3 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V3["docs review"]
  Evidence --> S4["CI script (2 files)"]
  S4 --> I4["review and security gate shell path"]
  I4 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V4["bash -n plus Strix self-test"]
  Evidence --> S5["Test (6 files)"]
  S5 --> I5["regression suite"]
  I5 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V5["targeted test run"]
Loading

Copy link
Copy Markdown
Contributor Author

Fresh downstream reproduction for this PR’s bounded Strix dependency/context-closure boundary — ScopeWeave required Strix run 32819824316, job/check 97715410727, exact target head ContextualWisdomLab/scopeweave@5f9dc371fb3ba7150a8f1e3693bc64794e50ebee (PR #602). The trusted workflow source was protected .github@8fd471a31399a914d9cb22a840f4a4c68e010ea6, and the job did explicitly fetch the exact ScopeWeave PR head before scanning. The fallback penetration test nevertheless stated that the scan workspace lacked server/server.mjs, so it could not fully execute backend/security analysis and reported 0 vulnerabilities from incomplete context. Protected ScopeWeave develop@2c328875e00e86537df3e965170be80532571cad does contain server/server.mjs (the Hono server entry point), proving omission by bounded PR materialization rather than source absence. The workflow correctly failed closed overall (STRIX_PROVIDER_UNAVAILABLE) after NVIDIA NIM 429s and an openai-direct/gpt-5.4 404; those provider failures are separate from this deterministic scope contradiction.

Please use this as another RED acceptance fixture for the same class already documented here from Inkspan: a changed-file-only scan must not convert an omitted unchanged runtime dependency into authoritative source judgment. Smallest acceptable outcome remains bounded authenticated repository-local dependency/context closure sufficient to execute/validate the changed surface, or an explicit context-insufficient/abstain non-passing state. Preserve exact-head provenance, fail-closed behavior, and bounded scope; do not synthesize a clean result or broaden to an unbounded checkout. After owner repair integrates, rerun the unchanged ScopeWeave #602 head (or its then-current descendant) and require the Strix evidence to include the runtime dependency context before treating the scan as authoritative.

Copy link
Copy Markdown
Contributor Author

Triage (2026-09-02): base history is orphaned, not a resolvable merge conflict

This PR's base commit 0156282022134484ea9d7541d5ba0730ba14fd96 is not an ancestor of current main:

$ git merge-base --is-ancestor 0156282022134484ea9d7541d5ba0730ba14fd96 origin/main && echo yes || echo no
no
$ git merge origin/main --no-edit
fatal: refusing to merge unrelated histories

origin/main now has multiple historical roots (a restructuring/history-splice happened after this branch was cut from an older main), so there is no common ancestor for an ordinary 3-way merge — not a normal content conflict fixable by the usual merge-main-and-resolve recipe. Forcing --allow-unrelated-histories would diff every shared file against an empty tree and manufacture spurious conflicts across the whole tree.

Given this PR's own scope is already large (cross-repo OpenCode evidence handling, trusted uv materialization, requirements-lock discovery, bounded Strix scope, plus three separate downstream Inkspan contradiction writeups), and it explicitly documents dependency ordering against #933 and #1009, I'm not attempting a mechanical rebuild here — that's exactly the kind of large design decision step 4 says to flag rather than guess through.

Next action (needs a human/design call): this needs to be re-cut from current main by whoever owns the cross-repo evidence-healthy contract, re-verifying each of the three downstream contradiction fixes against current main state (they may already be partially addressed — worth checking before reimplementing). Not closing or force-merging; leaving for dedicated-owner triage per this PR's own stated boundary.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Retraction — the "main history splice" diagnosis was wrong.

An earlier comment on this PR claimed main's history was spliced onto new roots around 2026-08-20/21, that this PR's base predates the boundary, and that an ordinary merge would fail with fatal: refusing to merge unrelated histories requiring a from-scratch re-implementation. That diagnosis is incorrect — please disregard it entirely.

Root cause: the analysis was run from a shallow git clone in the analysis sandbox (git rev-parse --is-shallow-repository → true). A shallow clone's truncation boundary commits look exactly like disjoint history roots, and git merge from inside a shallow checkout genuinely does throw fatal: refusing to merge unrelated histories even when the real, full history is perfectly linear and connected. After git fetch --unshallow, origin/main has exactly one root commit, and this PR's base is a completely normal ancestor of current main.

This PR should be triaged the ordinary way: fetch a full (non-shallow) clone, git fetch origin main && git merge origin/main --no-edit, resolve any real content conflicts, run the repo's gates, and push. There is no history-splice blocker and no need to abandon or re-implement this PR's work.

Apologies for the incorrect guidance. See #1722 for the corrected writeup.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Merge-conflict triage: main has already independently shipped an equivalent/superset mechanism for part of this PR's scope

Attempted the standard git fetch origin main && git merge --no-edit repair in a scratch clone. mergeable_state is dirty: 22 conflict blocks across 7 files (.github/workflows/opencode-review.yml x3, .github/workflows/strix.yml x2, CHANGELOG.md x1, scripts/ci/strix_quick_gate.sh x3, tests/test_pr_review_autofix_nvidia_nim_contract.py x1, tests/test_required_workflow_queue_contract.py x1, tests/test_strix_nvidia_nim_not_found_fallback.py x11).

Sampled the strix.yml conflicts first since that file governs the exact security-gate classification this repo treats as most sensitive. Finding:

  • This branch's version classifies only backend_unavailable_signal (rate limits, quota, connection/warm-up) as retryable-infrastructure, with a single non-retrying attempt.
  • origin/main's current version has a materially more advanced, already-shipped mechanism: a bounded retry loop (strix_gate_attempt, linear backoff, 3-attempt cap) that classifies both backend_unavailable_signal and a new model_behavior_error_signal (agents\.ModelBehaviorError / pydantic_ai\.ModelBehaviorError / strix\.ModelBehaviorError) as retryable, scoped correctly around any pre-existing "allowing pipeline continuation" marker so an earlier exempted finding can't mask a later real outage.
  • Confirmed via git show origin/main:scripts/ci/strix_quick_gate.sh | grep -n is_model_behavior_error that main already has an is_model_behavior_error() helper (used at two call sites) — i.e., main has already independently solved the exact ModelBehaviorError: Tool <x> not found in agent strix problem this PR (and sibling #933) are each separately trying to add, via a different, already-integrated implementation.

This is architecture-level divergence, not a text collision: reconciling requires deciding whether this PR's own retry/classification contribution is now redundant with main's already-shipped version, needs to be composed with it, or whether main's version should absorb anything this PR still adds beyond it (e.g. this PR's requirements-lock discovery and the three documented Inkspan #197/#246/#141 downstream-evidence-contradiction fixes, which are unrelated to the Strix retry mechanism and may still be this PR's real remaining contribution). Guessing a text-level resolution on a required security gate risks silently dropping either side's fail-closed behavior.

Per this repo's own standard for this exact situation (see #1279, #1280, #1382, and today's #1198): aborting the merge cleanly, not pushing a guessed resolution, and leaving this for the dedicated owner or a design-aware pass that can decide how #939, #933, and #1009 (which this PR's own body already flags as needing "dependency-first" reconciliation with each other) compose against main's current state. No changes pushed to this branch.

Related note left on #933 (already merge-conflict-repaired this session): its own is_model_tool_protocol_error addition may be similarly redundant with main's is_model_behavior_error — flagging there too rather than unwinding an already-green, test-passing merge on my own judgment.

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01BV96rXhqoR3tYZ9AeAVur4


Generated by Claude Code

Resolved 7 conflicting files against current main.

- CHANGELOG.md: kept both sides' distinct additions.
- opencode-review.yml: took main's evolved job-level concurrency design
  (needs: chains, ubuntu-24.04, permissions block, the documented
  cancel-in-progress deadlock fix from 2026-09-03) over this branch's much
  older, unscoped runs-on: ubuntu-latest jobs with no dependency chain.
- strix.yml: took main's more complete backend/model-behavior-error
  classifier (checks both backend_unavailable_signal and
  model_behavior_error_signal, excludes reported_vulnerability_signal, scopes
  classification to the tail after any 'allowing pipeline continuation'
  marker) over this branch's simpler, narrower classifier.
- strix_quick_gate.sh: merged additively -- kept both this branch's
  STRIX_CHILD_INSTRUCTION (PR-scope instruction) support AND main's
  STRIX_SCAN_WORKING_DIR isolation (keeps scanner state out of the untrusted
  scan target); both features are independent and compose.
- test_pr_review_autofix_nvidia_nim_contract.py: recomputed
  REVIEW_DISPATCH_BLOB_SHA against the post-merge opencode-review-dispatch.yml
  (auto-merged cleanly; verified matching main's job/step topology first).
- test_required_workflow_queue_contract.py: took main's assertions matching
  the merged strix.yml classifier; separately found and removed one HEAD-only
  test (test_opencode_bootstrap_required_checks_do_not_serialize_runner_waits)
  asserting "needs: not in jobs" -- a design main has since deliberately
  reversed (the documented concurrency-deadlock fix requires the needs: chain).
- test_strix_nvidia_nim_not_found_fallback.py: took main's fully-updated
  version entire, since every conflict hunk here tested the same superseded
  classifier logic resolved above, and a method-name diff confirmed HEAD's 3
  unique tests either test a superseded model-routing scheme or assert the
  literal opposite of the merged classifier's intended behavior.

Independently confirmed (via a from-scratch git worktree of unmodified
origin/main) that scripts/ci/test_strix_quick_gate.sh has 10 pre-existing,
unrelated FAILs from #1803's facade/core scheduler split leaving several
assertions pointed at the now-98-line facade file instead of
pr_review_merge_scheduler_core.py -- identical FAIL set on this merged tree
and on clean main, confirming this PR neither causes nor worsens it. Flagged
separately for a dedicated fix.

Verified post-merge: coverage run -m pytest tests -q (2780 passed, 1 skipped,
21 subtests), coverage report --fail-under=100 (100%), interrogate (100%).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@seonghobae

Copy link
Copy Markdown
Contributor Author

Resolved the merge conflict against current `main` (previous CHANGES_REQUESTED was `mergeStateStatus: DIRTY` only). New head `4e3bfba5` merges cleanly — 7 files had real content conflicts.

Key decisions: took main's evolved `opencode-review.yml` job-level concurrency design (needs: chains, the documented 2026-09-03 deadlock fix) and main's more complete Strix backend/model-behavior-error classifier over this branch's much older, superseded versions of both. Merged `strix_quick_gate.sh` additively — this branch's `STRIX_CHILD_INSTRUCTION` (PR-scope instruction) support and main's `STRIX_SCAN_WORKING_DIR` isolation are independent features that both needed to survive. Found and removed one stale HEAD-only test asserting a `needs:`-chain design main has since deliberately reversed for the documented concurrency fix, and took main's fully-updated version of `test_strix_nvidia_nim_not_found_fallback.py` since every conflict there tested the same superseded classifier logic.

Also found, independently confirmed (against a from-scratch clean `origin/main` worktree), and separately flagged (not fixed here — out of this PR's scope): `scripts/ci/test_strix_quick_gate.sh` has 10 pre-existing FAILs left over from the #1803 facade/core scheduler split, with several assertions still pointed at the now-thin `pr_review_merge_scheduler.py` facade instead of `pr_review_merge_scheduler_core.py`. Identical FAIL set on this merged tree and on clean main — confirms this PR neither causes nor worsens it.

Post-merge verification: `coverage run -m pytest tests -q` → 2780 passed, 1 skipped, 21 subtests; `coverage report --fail-under=100` → 100%; `interrogate` → 100%.

🤖 Generated with Claude Code

Copy link
Copy Markdown
Contributor Author

Fresh downstream coverage-evidence owner-path evidence from ContextualWisdomLab/nonnest2#84:

  • current consumer head: d75babd1fd7814a045f8538d8e9e4a16872d03fb on master@807f80c6a0b1f1d362eb9f398264de298bdd6b1c;
  • current protected-base semantic diff is limited to .jules/sentinel.md, R/icci.R, R/vuongtest.R, tests/testthat/test-input-validation.R;
  • historical OpenCode coverage failures occurred on heads 727f62b7497b8b14f62a8e9049ca3a9baa4d4028, 19607c6087284ec787af47490650a4140650215a, and 3d8848c97db6a2d132dbcb01923b401bbd6821f9 before the current head;
  • repository-owned R-CMD-check on predecessor 19607c... succeeded, while the central coverage sandbox failed before executing the suite because package imports such as CompQuadForm, mvtnorm, lavaan, and sandwich were unavailable. That predecessor result is historical only; it demonstrates the environment/closure failure class, not current-head GREEN.

Owner acceptance for the central lane: reproduce with an R package whose declared package imports are not present in the source-only review sandbox; classify missing unchanged dependency/runtime closure separately from a source test failure; materialize only a bounded authenticated dependency environment or emit a typed non-passing/deferred evidence state that cannot be mistaken for product test failure. Keep exact-head binding and fail closed—do not synthesize PASS from repository CI, install mutable sibling source, broaden network access, or weaken the approval prerequisite. After protected integration, rerun unchanged nonnest2#84 exact head (or its then-current descendant) and require actual test collection/execution plus the configured coverage/docstring contract before OpenCode approval.

seonghobae commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Fleet read-only evidence for the central workflow owner; no .github source/ref/PR-state was modified by this fleet writer.

Fresh cross-repository observation shows a broad required-check queue, so this is now a work-conservation/runner-admission acceptance item rather than a lane-local wait:

  • html4tree#594@e7722b203ff9cbfc5217f7cd4ff2ef12d8295ba1: CI 33835519645, Security 33835519718, SAST 33835519620, OSV 33835520315, Scorecard 33835519614 all remain queued.
  • nonnest2#123@389e346ee4e166d57c92bba8a024d331fb67dacd: R-CMD-check 33837262379, Security 33837262360, OSV 33837262650, Scorecard 33837262390 queued; SAST 33837262403 pending.
  • pg-erd-cloud#1073@7132575d1b776baa9993f432476a467d0e641934: CI 33837426021, Security 33837425996, SAST 33837426012, OSV 33837426274, Scorecard 33837425986 all queued.
  • xtrmLLMBatchPython#294@c5911436b6703217108089e68bd09e96e68ff59b: eleven pull-request workflows are simultaneously queued, including CI 33837774494, Security 33837774658, SAST 33837774709, OSV 33837775296, Scorecard 33837774563, plus both A2Z Compliance Check 33837774472 and A2Z Compliance Check (legacy) 33837774649.

The xtrm specimen also exposes a concrete duplicate-trigger candidate rather than just aggregate queue pressure: protected develop contains .github/workflows/a2z-compliance.yml (name A2Z Compliance Check, PR+push+weekly) and .github/workflows/validate-compliance.yml (name A2Z Compliance Check (legacy), PR+push+daily). The legacy workflow invokes validate_tasks.sh; repository A2Z documentation still says that script is integrated into CI, so deletion without moving that contract would be wrong. Treat this as a consolidation finding: preserve the script's valid enforcement/receipt semantics in one canonical/thin-caller path, then remove the duplicate legacy trigger rather than running both on every PR.

This does not by itself prove that the organization-wide 60-job ceiling is the cause. Please diagnose central admission/runner/concurrency telemetry before changing workflow semantics. Exact owner acceptance:

  1. distinguish GitHub-hosted concurrency/account ceiling, self-hosted runner starvation, reusable-workflow serialization, environment/concurrency-group blocking, and Actions service delay from source failures;
  2. if central workflow fan-out or redundant trigger topology is consuming the ceiling, add a deterministic regression for one logical PR/head causing only the intended central jobs and remove duplicate trigger paths at the canonical reusable owner rather than in consumers;
  3. keep cancel-in-progress semantics per workflow correctness: do not reintroduce cancellation where a CANCELLED required conclusion poisons the same-head rollup, but use safe cancellation/deduplication for non-required superseded work where it cannot leave a false required failure;
  4. prove RED→GREEN with queue/admission evidence on at least the exact heads above, then immutable .github release/consumer SHA propagation if reusable workflow behavior changes;
  5. no no-op retrigger, gate weakening, synthetic PASS, or consumer-local workaround.

Current #939 head observed by fleet is 4e3bfba5c87a70575ac64accbfe0b88ff6cac949; the PR body still contains older prose naming 6213f1e... as current in one section, so owner should keep exact-head traceability code-current while repairing the queue path.

Copy link
Copy Markdown
Contributor Author

Fresh downstream exact-head evidence to feed the central review/re-dispatch owner path:

  • consumer: ContextualWisdomLab/aFIPC#160@ba1a5e14c5080f74c02f5ea7917abd21b6f4c93b
  • historical exact-head Strix run/job: 33091065111 / 98583703578
  • central workflow source used by that run: .github@17052a7ca3c16db90932a4d6036b43165ddee418
  • failure class: the run selected direct provider/model fallbacks (nvidia_nim/..., openrouter/free, openai-direct/gpt-5.4); observed provider outcomes were NVIDIA 429/404, OpenRouter 502, and OpenAI 429 insufficient quota, so no authoritative Strix vulnerability evidence was produced.

Current .github/main is already materially newer and its Strix smoke contract now requires exactly contextual-orchestrator/orchestrator/free, with zero direct provider/model fallback. Therefore the remaining downstream problem is evidence regeneration, not an aFIPC source workaround.

Owner acceptance:

  1. Re-dispatch/reconcile Strix and any coupled model-backed required review for the unchanged aFIPC exact head through the current canonical central workflow; do not require a consumer no-op commit/push.
  2. Preserve orchestrator/free + gateway-only routing; no NVIDIA/OpenRouter/OpenAI direct selectors, paid fallback, provider/group/model hard-code, or consumer secrets.
  3. If the gateway/capability is unavailable, keep the required check fail-closed with typed infrastructure/capability evidence and route that defect to contextual-orchestrator; never synthesize PASS/neutral evidence.
  4. Preserve exact-head/source provenance and all actual security findings. A fresh terminal result must identify the current central workflow/source identity and the unchanged consumer head.
  5. Do not weaken required reviews/checks or treat the old provider-fallback failure as an aFIPC vulnerability.

I left .github source/refs/PR state untouched under its dedicated writer lease and moved the writable aFIPC PR back to Draft until current-head central evidence exists.

Copy link
Copy Markdown
Contributor Author

Fleet read-only owner-path evidence — do not treat this as a leaf-source failure.

Downstream target: ContextualWisdomLab/newsdom-api#791@10b85cce7b12b6c11d4a9817cba200fb1918e841, protected base develop@e06b1f3fb10903569124af011da213951e6e2473.

After a real source/test/docs descendant, every newly materialized exact-head hosted gate remained non-terminal on a fresh reread: tests 33908836843 queued, codeql 33908836910 queued, ClusterFuzzLite 33908836854 queued, container-image 33908836836 queued, Security Scan 33908836822 queued, SAST 33908837011 pending, CodeQL PR 33908836983 queued, Scorecards 33908836920 queued. The consumer PR remains Draft and no predecessor GREEN is being transferred.

Owner RED: an authenticated, mergeable consumer exact head can materialize all required runs yet obtain no terminal exact-head build/security evidence, so repository-local source correctness cannot advance to protected merge/release evidence.

Owner GREEN acceptance: on the unchanged target SHA above, central scheduling/materialization must progress through runner assignment and exact checkout to terminal results (or a typed fail-closed infrastructure conclusion identifying the causal control-plane limitation). Preserve required checks and exact-head provenance; do not solve this with leaf no-op commits, blind reruns, gate weakening, synthetic PASS, or provider/model fallback. If the current central branch has intervened, adopt it and prove the repair with the same immutable downstream SHA before claiming the queue class fixed.

Copy link
Copy Markdown
Contributor Author

Blocked on a policy contradiction, not a merge mechanic — not resolving it unilaterally

This PR is dirty against main. I resolved the mechanical parts of a sibling PR today and started on this one, then stopped: one of the five conflicts is a direct, deliberate disagreement about the same setting, and picking either side silently discards a decision someone made on purpose.

The contradiction

.github/workflows/pr-review-merge-scheduler.yml, concurrency:

value stated reason
this PR cancel-in-progress: false "scan-pr-queue is a required check. Cancelling an in-flight same-head run leaves a CANCELLED required conclusion that stays in the rollup after a later success, so the PR looks failed with zero failed jobs."
main (current) cancel-in-progress: ${{ github.event_name == 'pull_request_target' || github.event_name == 'pull_request_review' || github.event_name == 'repository_dispatch' }} "scheduler cancels stale PR/review/manual queue scans instead of accumulating merge/update attempts"

Both sides carry contract tests asserting their version — scripts/ci/test_strix_quick_gate.sh and tests/test_required_workflow_queue_contract.py::test_merge_scheduler_does_not_cancel_required_queue_scans here, and the mirrored assertions on main. So this is not drift; each was written to be enforced.

Both failure modes are real, and today's measurements confirm both

This is what stopped me, because the day's evidence supports each side:

  • This PR's concern is confirmed, not theoretical. FAILED_CHECK_CONCLUSIONS (scripts/ci/pr_review_merge_scheduler_core.py:343) counts CANCELLED alongside FAILURE. So a cancelled required check genuinely does block the scheduler, and genuinely does produce "red PR, zero failed jobs" — I verified exactly that shape on fix: retry Strix provider tool protocol failures #933 today: 22 check runs, 20 cancelled, 2 skipped, zero failure, rollup success, and an automated triage pass read it as a real CI failure.
  • main's direction fights the larger problem. The org is at ~55/60 running jobs, and 62% of cancelled jobs had not been assigned a runner — so their cancellation costs nothing real while their accumulation costs queue depth. Under the review livelock, not cancelling is expensive.

main's version carries no comment acknowledging the cancelled-conclusion failure mode — I checked the whole file. So I cannot tell whether that tradeoff was accepted deliberately or simply not known when the conditional landed. That distinction decides the resolution, and I do not have it.

Why I am not just picking one

Resolving toward main re-opens a false-red mode that this PR exists to close, on a required check, across every repository. Resolving toward this PR re-opens unbounded scan accumulation into a queue that is already saturated. Neither is a merge conflict in the ordinary sense — the text overlap is incidental to a genuine design disagreement, and a clean-looking resolution would bury it.

The likely correct answer is neither as written: cancel to protect the queue and stop a cancelled required conclusion from persisting as a false red. That is a change to the gate's semantics, not a conflict resolution.

What would unblock this

A direction on one question: was the cancelled-conclusion cost accepted when the conditional landed on main, or overlooked? If accepted, I will resolve toward main and close this PR's concern as knowingly traded away. If overlooked, the two need reconciling as their own change and this PR should rebase behind it.

The other four conflicts here are mechanical and I will take them with whichever direction is chosen — including a REVIEW_DISPATCH_BLOB_SHA pin where, as on #1187, neither side is correct and the value must be recomputed from the merged workflow.

One methodology note

I picked this PR because it measured as small: 5 conflicts, 76 conflicted lines, zero unresolved review threads. Line count turned out to be a poor proxy for difficulty — the smallest hunk in the set was the one carrying a policy decision, while a 2,900-line conflict elsewhere was mostly mechanical. Worth remembering when triaging conflicts by size.


Generated by Claude Code

seonghobae and others added 2 commits September 6, 2026 02:13
Five conflicts. Main's side taken throughout, because this branch's central
change — `cancel-in-progress: false` on the merge scheduler — is against a file
main has since rewritten and a design main deliberately replaced:

  merge-base 07d9ec2 (2026-09-04)
  main's delta to .github/workflows/pr-review-merge-scheduler.yml: +36 / -785
  the conditional came from 26cfc33, "ci(scheduler): stop required-check
  completion fanout" (#1840)

This branch's rationale — a CANCELLED required `scan-pr-queue` stays red in the
rollup after a later same-head success — is real, but #1840 is main's answer to
that class and it is the newer one. The matching pins in
`scripts/ci/test_strix_quick_gate.sh` and `tests/test_opencode_agent_contract.py`
follow the same choice.

`tests/test_required_workflow_queue_contract.py` also went to main's side: this
branch's `test_close_empty_pr_metadata_lookup_retries_and_fails_open` reads
`.github/workflows/close-empty-pr.yml`, which main deleted after moving that
cleanup into the scheduler's existing metadata-only job — the exact change
main's replacement test records.

REVIEW_DISPATCH_BLOB_SHA recomputed against the merged dispatch workflow:
c03c5ae…

Two repairs the conflict markers did not surface:

- `tests/test_opencode_agent_contract.py` — four assertions referencing
  `concurrency_match` auto-merged in from this branch while the block that
  defined that name went to main's side, leaving undefined names (caught by
  `ruff --select F821`). Main's version of that test ends before them, so they
  were removed with it.

- `tests/test_required_workflow_queue_contract.py` — the automatic merge built a
  chimera of `test_merge_scheduler_uses_native_auto_merge_after_required_checks`:
  main's `def` line with this branch's body asserting `cancel-in-progress:
  false`. The branch does not contain that test at all (it renamed it), so no
  conflict was raised. Restored main's function verbatim.

Verified against this branch's unmerged head, comparing failure names rather
than counts — which mattered here, since a first pass showed 1 failed on both
sides while having swapped which test failed:

  unmerged head   1 failed, 2780 passed
  after merge     0 failed, 2897 passed
  introduced: 0   fixed: 1
    (test_opencode_bootstrap_required_checks_do_not_serialize_runner_waits)

coverage 100%, interrogate 100%, `ruff check --select F821` clean, zero
conflict markers.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@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 0db992904dd4be91e1faae01bab3a6ff8ba01e3d.
  • 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-dispatch.yml"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> R1["Review risk: Workflow: opencode-review-dispatch.yml"]
  R1 --> V1["actionlint plus required checks"]
  Evidence --> S2["Workflow: strix.yml"]
  S2 --> I2["GitHub Actions review job"]
  I2 --> R2["Review risk: Workflow: strix.yml"]
  R2 --> V2["actionlint plus required checks"]
  Evidence --> S3["Repository file: CHANGELOG.md"]
  S3 --> I3["repository behavior"]
  I3 --> R3["Review risk: Repository file: CHANGELOG.md"]
  R3 --> V3["required checks"]
  Evidence --> S4["Docs: base-requirements-lock-discovery.md (3 files)"]
  S4 --> I4["operator or user guidance"]
  I4 --> R4["Review risk: Docs: base-requirements-lock-discovery.md (3 files)"]
  R4 --> V4["docs review"]
  Evidence --> S5["CI script: strix_quick_gate.sh"]
  S5 --> I5["review and security gate shell path"]
  I5 --> R5["Review risk: CI script: strix_quick_gate.sh"]
  R5 --> V5["bash -n plus Strix self-test"]
  Evidence --> S6["CI script: test_strix_quick_gate.sh"]
  S6 --> I6["review and security gate shell path"]
  I6 --> R6["Review risk: CI script: test_strix_quick_gate.sh"]
  R6 --> V6["bash -n plus Strix self-test"]
  Evidence --> S7["Test: test_materialize_base_python_requirement_paths.py (4 files)"]
  S7 --> I7["regression suite"]
  I7 --> R7["Review risk: Test: test_materialize_base_python_requirement_paths.py (4 files)"]
  R7 --> V7["targeted test run"]
Loading

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

Labels

area: operations Operability, observability, readiness, SLO, backup, or retention merge: urgent-review Central or critical pull request requiring immediate review attention priority: critical Immediate blocker, P0, urgent deadlock, or critical incident status: blocked Blocked by conflict, dependency, or required prerequisite type: bug Defect or incorrect behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants