Skip to content

fix(opencode): include adversarial gate in fallback scope - #904

Closed
seonghobae wants to merge 16 commits into
mainfrom
fix/opencode-adversarial-fallback-scope-current-main-20260809
Closed

fix(opencode): include adversarial gate in fallback scope#904
seonghobae wants to merge 16 commits into
mainfrom
fix/opencode-adversarial-fallback-scope-current-main-20260809

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add the extracted adversarial-evidence gate and its existing test twin to the central review-process fallback scope;
  • add a permanent contract proving both exact paths remain in the bounded allowlist;
  • preserve the existing core-file classifier, 24-file cap, provider budgets, credentials, model selection, review authority, and merge policy.

Exact identity and scope repair

  • base branch and live protected tip: main@6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba;
  • previously bounded repair head: f9db98ffbff1d3073c88f76c453eb3542227fb20;
  • exact current head: 0c5e0812a578cfb11c7cb0613597f26dc5fcb20f;
  • state: Ready and mechanically mergeable.

After the bounded allowlist repair, unrelated central architecture/materializer/documentation changes entered this branch. A non-destructive forward commit now points to the exact previously bounded tree. GitHub compare reports zero changed files between f9db98ff... and the current head. No force-push, rebase, history rewrite, predecessor evidence transfer, or gate weakening was used.

Every predecessor check, review, approval, or generated merge result is historical only. Current-head evidence must regenerate.

RCA and feasibility

The symptom was CENTRAL_REVIEW_PROCESS_FALLBACK_ELIGIBLE=false when a central review-process change touched the extracted adversarial-evidence gate. The immediate cause was two missing path cases. The root cause was refactor drift: the gate moved out of an already allowlisted normalizer after the allowlist was established.

The smallest repair allowlists exactly the production module and its existing test twin. Duplicating the gate, broadening to a directory wildcard, increasing the 24-file cap, or weakening the fallback check would enlarge the trust boundary and was rejected.

Test-first contract

The bounded tree records a failing protected-main probe for the absent production path, then verifies:

  • both exact files remain in the bounded fallback allowlist;
  • both target files exist;
  • the production module still exposes adversarial_evidence_rejection_reason;
  • the modified contract test compiles;
  • provider budgets, credentials, model selection, review authority, and merge policy remain unchanged;
  • wildcard or directory-level fallback broadening is not introduced.

These RED/GREEN facts are lineage only, not current-head gate evidence.

Verification posture

The current head must regenerate every applicable exact-head quality, security, supply-chain, and semantic-review result. Pending, queued, skipped, cancelled, absent, stale, predecessor-head, local-only, author-only, status-only, synthetic, or model-only evidence is not acceptance.

Merge and operational acceptance

Merge or auto-merge only after the unchanged current head has terminal-success required gates, zero valid unresolved findings, a qualifying current-head semantic verdict, two qualifying independent non-author approvals including last-push approval, compatible live-base evidence, and ordinary expected-head branch-protection authorization. Protected-main fallback evidence must prove that changes to either exact path remain eligible without widening the trust boundary before issue #626 is operationally closed. No self-approval, administrative bypass, synthetic approval, or protection weakening is requested.

Fixes #626.


Open in Devin Review

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 55 minutes

Limit details: You’ve used the included review currently available.

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

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 44827947-0319-4d27-ab7e-f855a6fe2f67

📥 Commits

Reviewing files that changed from the base of the PR and between fce028b and 7659f00.

📒 Files selected for processing (4)
  • .github/workflows/opencode-review-dispatch.yml
  • requirements-pip-audit-ci-hashes.txt
  • tests/test_opencode_agent_contract.py
  • tests/test_pr_review_autofix_nvidia_nim_contract.py

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.

@seonghobae
seonghobae enabled auto-merge (squash) August 9, 2026 14:10

Copy link
Copy Markdown
Contributor Author

@opencode-agent review

Evaluate exact current head f9db98ffbff1d3073c88f76c453eb3542227fb20 against independently resolved live main 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. Keep source revision, current-base compatibility, deterministic checks, model judgment, and qualifying independent human approval as separate evidence channels; do not infer merge authority.

Copy link
Copy Markdown
Contributor Author

Exact-current-head review request for f9db98ffbff1d3073c88f76c453eb3542227fb20 over protected main@6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba.

Review the bounded two-file refactor-drift repair: add exactly scripts/ci/opencode_review_adversarial_evidence.py and its existing test twin to the central review-process fallback scope; keep the core classifier, 24-file cap, provider/runtime budgets, credentials, model selection, review authority, and merge policy unchanged; reject wildcard/directory broadening or fallback weakening. The modified contract compiles, both allowlisted files exist, the production module still exposes adversarial_evidence_rejection_reason, and direct 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 formal review or inline thread exists.

Keep the exact head unchanged. Do not synthesize author approval, broaden the fallback directory or file cap, duplicate the adversarial gate, alter provider/credential/review/merge authority, update the branch, merge, release, or bypass protection.

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

@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"
head="f9db98ffbff1d3073c88f76c453eb3542227fb20"
base="6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba"

printf '%s\n' '== checked-out revision and ancestry =='
git rev-parse HEAD
git cat-file -e "${head}^{commit}"
git cat-file -e "${base}^{commit}"
git merge-base --is-ancestor "$base" "$head" && echo "base_is_ancestor_of_head=true" || echo "base_is_ancestor_of_head=false"

printf '%s\n' '== changed paths and patch =='
git diff --name-status "$base" "$head"
git diff --check "$base" "$head"
git diff --find-renames --find-copies --unified=80 "$base" "$head" -- \
  scripts/ci/opencode_review_adversarial_evidence.py \
  scripts/ci/test_opencode_review_adversarial_evidence.py \
  scripts/ci/opencode_review_process.py \
  scripts/ci/test_opencode_review_process.py

printf '%s\n' '== relevant file locations =='
fd -t f -a 'opencode_review.*(process|adversarial).*\.py$|test_opencode_review.*(process|adversarial).*\.py$' scripts/ci 2>/dev/null || true

printf '%s\n' '== relevant fallback and adversarial-gate references =='
rg -n -C 5 \
  'CENTRAL_REVIEW_PROCESS_FALLBACK|adversarial_evidence_rejection_reason|fallback|allowlist|allowlisted|24' \
  scripts/ci \
  -g '*opencode*review*.py' || true

printf '%s\n' '== pull request metadata, reviews, review threads, and exact-head check suites =='
gh pr view 904 --repo "$repo" --json number,headRefOid,baseRefOid,mergeStateStatus,reviewDecision,reviews,statusCheckRollup
gh api "repos/${repo}/pulls/904/comments?per_page=100" --paginate \
  --jq '.[] | {id, user: .user.login, commit_id, path, line, body, created_at}' || true
gh api "repos/${repo}/commits/${head}/check-suites?per_page=100" --paginate \
  --jq '.check_suites[] | {app: .app.slug, name: .app.name, status, conclusion, head_sha, created_at, updated_at}' || true

Length of output: 25543


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="ContextualWisdomLab/.github"
head="f9db98ffbff1d3073c88f76c453eb3542227fb20"
base="6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba"

printf '%s\n' '== complete pull request patch =='
git diff --check "$base" "$head"
git diff --unified=100 "$base" "$head" -- \
  .github/workflows/opencode-review-dispatch.yml \
  tests/test_opencode_agent_contract.py

printf '%s\n' '== changed-line function and assertion context =='
ast-grep outline tests/test_opencode_agent_contract.py --items all --type function --view expanded || true
rg -n -C 12 \
  'CENTRAL_REVIEW_PROCESS_FALLBACK|adversarial_evidence|fallback|allowlist|allowlisted|24|provider|credential|model|merge' \
  tests/test_opencode_agent_contract.py \
  .github/workflows/opencode-review-dispatch.yml

printf '%s\n' '== exact current-head review thread state =='
gh api graphql -F owner="ContextualWisdomLab" -F name=".github" -F number=904 -f query='
query($owner: String!, $name: String!, $number: Int!) {
  repository(owner: $owner, name: $name) {
    pullRequest(number: $number) {
      reviewThreads(first: 100) {
        nodes {
          isResolved
          isOutdated
          path
          line
          comments(first: 10) {
            nodes { author { login } body commit { oid } }
          }
        }
      }
    }
  }
}' --jq '.data.repository.pullRequest.reviewThreads.nodes'

Length of output: 201742


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head="f9db98ffbff1d3073c88f76c453eb3542227fb20"
base="6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba"
workflow=".github/workflows/opencode-review-dispatch.yml"
test_file="tests/test_opencode_agent_contract.py"

printf '%s\n' '== patch statistics =='
git diff --stat "$base" "$head" -- "$workflow" "$test_file"
git diff --numstat "$base" "$head" -- "$workflow" "$test_file"

printf '%s\n' '== exact modified hunks =='
git diff --unified=12 "$base" "$head" -- "$workflow" "$test_file"

printf '%s\n' '== base/head central fallback scope excerpts =='
for revision in "$base" "$head"; do
  echo "--- $revision $workflow ---"
  git show "${revision}:${workflow}" |
    grep -n -E -C 18 'central_review_process_fallback_scope|CENTRAL_REVIEW_PROCESS_FALLBACK|opencode_review_adversarial_evidence|adversarial_evidence\.py|changed_count' |
    head -n 260 || true
done

printf '%s\n' '== base/head contract-test excerpts =='
for revision in "$base" "$head"; do
  echo "--- $revision $test_file ---"
  git show "${revision}:${test_file}" |
    grep -n -E -C 18 'central_review_process|fallback.*scope|adversarial_evidence|allowlist|allowlisted' |
    head -n 320 || true
done

Length of output: 60360


@seonghobae

Finding

P2 — Make the regression test reject allowlist broadening

Line 1795 in tests/test_opencode_agent_contract.py checks only that the two new literals occur inside fallback_changed_file_allowed().

This test still passes if a later change adds a broad entry such as ContextualWisdomLab/.github:scripts/ci/*.py, scripts/ci/*, or another directory-wide pattern. That would violate the stated bounded two-path trust boundary.

Extend the contract to reject wildcard or directory entries for the adversarial-evidence paths. The contract should prove that only these exact entries authorize this repair:

  • scripts/ci/adversarial_evidence.py
  • tests/test_adversarial_evidence.py

Review evidence

  • The checked-out revision is the requested head: f9db98ffbff1d3073c88f76c453eb3542227fb20.
  • main@6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba is an ancestor of that head.
  • The patch changes only .github/workflows/opencode-review-dispatch.yml and tests/test_opencode_agent_contract.py.
  • The workflow adds the two intended exact allowlist entries.
  • The patch does not change the 24-file cap, the core-file classifier, budgets, credentials, provider and model configuration, or merge policy.
  • The exact-head review-thread query returned no threads.
  • GitHub still reports REVIEW_REQUIRED and BLOCKED. No submitted independent review exists. Third-party check suites are queued. Therefore, this review does not provide approval or merge authority.

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

Keep installer tests on the documented linux x86_64 path, record the
control-plane fallback architecture, and cite NIST SP 800-53 SA-11 plus
OWASP testing so the extracted gate cannot leave the core review path.
Materialize a base Python lock only when every package line is an exact
SHA-256 pin or a two-token relative -r/--requirement include of a
candidate lock path. A lone --require-hashes directive, ./dotted paths,
and -r other-hashes.txt no longer enter the trusted build context.
@seonghobae

Copy link
Copy Markdown
Contributor Author

@opencode-agent review

Re-evaluate exact current head 9bcf1287a0af0ba59907a349829fee80c727ac96. 리뷰 확인 for the bounded-include increment; do not treat Checks wait as a blocker.

@opencode-agent

opencode-agent Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

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

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

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

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

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

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

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

  • Result: REQUEST_CHANGES

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

  • Head SHA: 5cf43f700595d9b8c433e96ede3957b6586d7add

  • Workflow run: 31955196111

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

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

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow: opencode-review-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["Test: test_opencode_agent_contract.py"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test_opencode_agent_contract.py"]
  R2 --> V2["targeted test run"]
Loading

@seonghobae
seonghobae marked this pull request as draft August 14, 2026 08:47
auto-merge was automatically disabled August 14, 2026 08:47

Pull request was converted to draft

Copy link
Copy Markdown
Contributor Author

Returned to Draft because the exact tree is broader than the two-path fallback-scope repair.

The valid product fix is narrow: add the extracted adversarial-evidence module and its existing test twin to the bounded OpenCode review-process allowlist, retain the 24-file cap, and prove both exact paths remain covered. Head 9bcf1287a0af0ba59907a349829fee80c727ac96 also carries unrelated trusted-uv materializer source/tests and broad governance files.

Rebuild from protected main retaining only the dispatch workflow change, the exact allowlist regression in test_opencode_agent_contract.py, bounded doctoring/changelog evidence, and any directly necessary governance reference. Preserve materializer work in its authoritative PR, then reacquire exact-head checks and independent review.

@seonghobae
seonghobae marked this pull request as ready for review August 14, 2026 13:20

Copy link
Copy Markdown
Contributor Author

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

Review only exact current head 9bcf1287a0af0ba59907a349829fee80c727ac96 against live protected main@6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. Nine pre-Ready exact-head hosted workflows are terminal-success; the only prior Strix Changed Path Quality run was cancelled and is not acceptance, so the Ready transition must reacquire that evidence. No review thread exists. Verify the exact two-path bounded fallback-scope repair read-only; do not broaden the 24-file trust boundary, mutate source, synthesize approval, weaken protection, or merge.

@seonghobae
seonghobae enabled auto-merge (squash) August 14, 2026 13:21
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Rate Limit Exceeded

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

@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 9bcf1287a0af0ba59907a349829fee80c727ac96.
  • 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["Changed file (4 files)"]
  S2 --> I2["repository behavior"]
  I2 --> R2["Review risk: Changed file (4 files)"]
  R2 --> V2["required checks"]
  Evidence --> S3["Docs: opencode-adversarial-fallback-scope.md"]
  S3 --> I3["operator or user guidance"]
  I3 --> R3["Review risk: Docs: opencode-adversarial-fallback-scope.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 (2 files)"]
  S5 --> I5["regression suite"]
  I5 --> R5["Review risk: Test (2 files)"]
  R5 --> V5["targeted test run"]
Loading

@opencode-agent
opencode-agent Bot disabled auto-merge August 14, 2026 17:59

@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 9bcf1287a0af0ba59907a349829fee80c727ac96.
  • 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["Changed file (4 files)"]
  S2 --> I2["repository behavior"]
  I2 --> R2["Review risk: Changed file (4 files)"]
  R2 --> V2["required checks"]
  Evidence --> S3["Docs: opencode-adversarial-fallback-scope.md"]
  S3 --> I3["operator or user guidance"]
  I3 --> R3["Review risk: Docs: opencode-adversarial-fallback-scope.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 (2 files)"]
  S5 --> I5["regression suite"]
  I5 --> R5["Review risk: Test (2 files)"]
  R5 --> V5["targeted test run"]
Loading

@seonghobae
seonghobae enabled auto-merge (squash) August 15, 2026 12:55

Copy link
Copy Markdown
Contributor Author

Exact-current-head read-only review request for 0c5e0812a578cfb11c7cb0613597f26dc5fcb20f over protected base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba.

A non-destructive forward commit restored the exact previously bounded two-file adversarial-fallback repair; GitHub compare reports zero changed files from f9db98ffbff1d3073c88f76c453eb3542227fb20. Recheck that exactly scripts/ci/adversarial_evidence.py and its existing test twin are added to the central review-process fallback allowlist, with no wildcard/directory broadening, 24-file cap increase, provider/credential/model/review-authority change, or merge-policy weakening. Treat all predecessor checks/reviews as historical. Do not mutate or merge the branch.

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

@coderabbitai

coderabbitai Bot commented Aug 15, 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="904"
head="0c5e0812a578cfb11c7cb0613597f26dc5fcb20f"
base="6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba"
previous="f9db98ffbff1d3073c88f76c453eb3542227fb20"
workflow=".github/workflows/opencode-review-dispatch.yml"
contract="tests/test_opencode_agent_contract.py"

printf '%s\n' '== revision identity and ancestry =='
printf 'checkout='; git rev-parse HEAD
git cat-file -e "${head}^{commit}"
git cat-file -e "${base}^{commit}"
git cat-file -e "${previous}^{commit}"
git merge-base --is-ancestor "$base" "$head" && echo 'base_is_ancestor=true' || echo 'base_is_ancestor=false'
git diff --quiet "$previous" "$head" && echo 'previous_tree_equals_head=true' || echo 'previous_tree_equals_head=false'

printf '%s\n' '== complete current-head change set =='
git diff --check "$base" "$head"
git diff --name-status "$base" "$head"
git diff --stat "$base" "$head"
git diff --unified=40 "$base" "$head"

printf '%s\n' '== fallback scope and contract context at current head =='
git show "${head}:${workflow}" | grep -n -E -C 24 \
  'central_review_process_fallback_scope|CENTRAL_REVIEW_PROCESS_FALLBACK|adversarial_evidence|changed_count|24' || true
git show "${head}:${contract}" | grep -n -E -C 24 \
  'fallback_changed_file_allowed|CENTRAL_REVIEW_PROCESS_FALLBACK|adversarial_evidence|allowlist|wildcard|directory' || true

printf '%s\n' '== direct searches for broad fallback entries =='
git show "${head}:${workflow}" | grep -n -E \
  'scripts/ci/(\*|[^[:space:]"]*/\*)|tests/(\*|[^[:space:]"]*/\*)|adversarial_evidence' || true
git show "${head}:${contract}" | grep -n -E \
  'scripts/ci/(\*|[^[:space:]"]*/\*)|tests/(\*|[^[:space:]"]*/\*)|adversarial_evidence' || true

printf '%s\n' '== target file existence and public symbol =='
git cat-file -e "${head}:scripts/ci/adversarial_evidence.py" && echo 'production_file_exists=true'
git cat-file -e "${head}:tests/test_adversarial_evidence.py" && echo 'test_twin_exists=true'
git show "${head}:scripts/ci/adversarial_evidence.py" | grep -n -E \
  '^(def |class )adversarial_evidence_rejection_reason\b|adversarial_evidence_rejection_reason' || true

printf '%s\n' '== PR metadata, reviews, and exact-head checks =='
gh pr view "$pr" --repo "$repo" \
  --json headRefOid,baseRefOid,isDraft,mergeStateStatus,reviewDecision,reviews,statusCheckRollup
gh api "repos/${repo}/commits/${head}/check-suites?per_page=100" --paginate \
  --jq '.check_suites[] | {app: .app.slug, status, conclusion, head_sha, created_at, updated_at}'
gh api graphql -F owner="ContextualWisdomLab" -F name=".github" -F number="$pr" -f query='
query($owner: String!, $name: String!, $number: Int!) {
  repository(owner: $owner, name: $name) {
    pullRequest(number: $number) {
      reviewThreads(first: 100) {
        nodes {
          isResolved
          isOutdated
          path
          line
          comments(first: 10) {
            nodes { author { login } body commit { oid } }
          }
        }
      }
    }
  }
}' --jq '.data.repository.pullRequest.reviewThreads.nodes'

Length of output: 163334


@seonghobae

Finding

P2 — Make the allowlist contract reject wildcard and directory authorization

Line 1795 in tests/test_opencode_agent_contract.py verifies only that both exact path literals occur in fallback_changed_file_allowed().

The test still passes if a later change adds an entry such as:

  • ContextualWisdomLab/.github:scripts/ci/*.py
  • ContextualWisdomLab/.github:tests/*
  • ContextualWisdomLab/.github:scripts/ci/adversarial_*

Such an entry would authorize the two target paths while widening the fallback trust boundary.

Extend the contract so it proves that the allowlist segment has no wildcard or directory-level entry that can match either:

  • scripts/ci/adversarial_evidence.py
  • tests/test_adversarial_evidence.py

Review evidence

  • The checked-out revision is 0c5e0812a578cfb11c7cb0613597f26dc5fcb20f.
  • main@6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba is an ancestor of this head.
  • The current tree equals the stated bounded tree at f9db98ffbff1d3073c88f76c453eb3542227fb20.
  • The diff changes only .github/workflows/opencode-review-dispatch.yml and tests/test_opencode_agent_contract.py.
  • The workflow adds exactly the requested production path and test-twin path.
  • The workflow retains the 24-file cap.
  • The diff does not modify provider budgets, credentials, model selection, review authority, or merge policy.
  • Both target files exist. scripts/ci/adversarial_evidence.py still exposes adversarial_evidence_rejection_reason.
  • No current wildcard or directory allowlist entry was found.
  • The current-head checks are queued or cancelled. Predecessor reviews apply to 9bcf1287a0af0ba59907a349829fee80c727ac96, not this head.
  • No review threads were returned.

I did not mutate or merge the branch.

You are interacting with an AI system.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

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

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

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

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

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

  • Result: REQUEST_CHANGES

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

  • Head SHA: 5cf43f700595d9b8c433e96ede3957b6586d7add

  • Workflow run: 31955196111

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

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

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow: opencode-review-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["Test: test_opencode_agent_contract.py"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test_opencode_agent_contract.py"]
  R2 --> V2["targeted test run"]
Loading

@opencode-agent
opencode-agent Bot disabled auto-merge August 16, 2026 20:43
@seonghobae
seonghobae enabled auto-merge (squash) August 16, 2026 23:09
@opencode-agent
opencode-agent Bot disabled auto-merge August 16, 2026 23:19
@seonghobae
seonghobae enabled auto-merge (squash) August 17, 2026 00:40
@seonghobae
seonghobae enabled auto-merge (squash) August 20, 2026 06:58
@seonghobae
seonghobae dismissed stale reviews from opencode-agent[bot], opencode-agent[bot], and opencode-agent[bot] August 20, 2026 09:42

Dismiss stale review: review commit 9bcf128 is not current PR head 40565c9; current-head review is required.

@opencode-agent
opencode-agent Bot disabled auto-merge August 20, 2026 10:45
@seonghobae

Copy link
Copy Markdown
Contributor Author

@opencode-agent please review current PR HEAD 2b47a9e and re-run the failing hourly cadence/conflict-scope gate. Report only exact-head findings.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Current HEAD 2b47a9ee5f49f9e1dbc1fccbaefd7e6c236fb616 fixes the hosted failure: the immutable reviewer-workflow snapshot expected the pre-merge blob (83f683...) even though this PR intentionally adds the adversarial fallback paths. The assertion now matches the current exact workflow blob eec88e70.... Evidence: focused contract tests 23 passed, OpenCode contract tests 41 passed, and git diff --check passed.

@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: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@seonghobae

Copy link
Copy Markdown
Contributor Author

Exact-head lock repair pushed as 7659f00 from aab6eb3. Updated the hashed pip audit runtime from pip 26.1.2 to pip 26.2.1 with exact hashes. The same lock has passed local pip-audit in this maintenance loop; hosted checks and exact-head approval must be re-evaluated. No bypass or force push was used.

@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 requirements-pip-audit-ci-hashes.txt
@opencode-agent opencode-agent Bot added area: accessibility Accessibility and assistive-technology support merge: urgent-review Central or critical pull request requiring immediate review attention priority: medium Normal-priority or P2 work status: blocked Blocked by conflict, dependency, or required prerequisite type: bug Defect or incorrect behavior priority: critical Immediate blocker, P0, urgent deadlock, or critical incident and removed priority: medium Normal-priority or P2 work labels Aug 22, 2026
@seonghobae

Copy link
Copy Markdown
Contributor Author

Superseded by clean protected-main replacement #1273. The replacement preserves the source-backed fallback-scope fix while excluding this branch’s unrelated pip-lock and materializer history. Issue #626 remains linked to #1273 and will close only after protected integration.

@seonghobae seonghobae closed this Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: accessibility Accessibility and assistive-technology support 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.

Central review-process fallback allowlist drift: adversarial_evidence.py missing since #555 extraction

1 participant