Skip to content

fix(automation): run hourly NVIDIA NIM review repair - #782

Draft
seonghobae wants to merge 186 commits into
mainfrom
fix/hourly-nvidia-nim-review-repair-main
Draft

fix(automation): run hourly NVIDIA NIM review repair#782
seonghobae wants to merge 186 commits into
mainfrom
fix/hourly-nvidia-nim-review-repair-main

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Purpose

Activate a protected one-hour Clearfolio review → RCA → realistic repair → exact-head revalidation loop while preserving the independent reviewer workflow, its credential system, and product-neutral reuse by other ContextualWisdomLab services.

Exact current identity

  • head: 9d2a82ae184a18c32339def16ea4097681108482
  • protected base main: 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba
  • state: Draft / exact-head gates green / fresh independent approval absent

Every check, review, approval, and comment anchored to an earlier head is historical only.

Hourly product caller

clearfolio-hourly-review-repair.yml runs at minute 23 of every hour and calls the central reusable scheduler with:

target_repository: ContextualWisdomLab/clearfolio
base_branch: main
max_prs: "50"
max_dispatches: "1"
retry_hours: "1"

The product caller has read-only workflow permissions, product-specific single-flight concurrency, explicit scheduler secret mapping, and no secrets: inherit or direct model credential binding. The shared scheduler remains product-neutral and can be reused by other CWL repositories without copying privileged implementation.

RCA and realistic-remediation contract

The scheduler classifies a candidate as review feedback, failed-check RCA, or merge-conflict repair. Before any edit, the worker must:

  1. bind the evidence to the exact live head and base;
  2. establish the root cause rather than restating the symptom;
  3. enumerate the smallest plausible remediation candidates;
  4. reject candidates that lack current repository-writer authority, exceed the sealed path scope, require unavailable credentials or protected-setting changes, violate dependency/stack order, cannot be verified by a focused or exact-head gate, or do not actually change the root cause;
  5. implement only the smallest candidate that passes the feasibility gate; and
  6. leave the tree unchanged when no repository edit is realistically executable inside the current authority boundary.

Queued reviews and checks remain merge blockers, but their latency is not treated as a reason to invent a patch or stop the broader loop. The next bounded eligible PR or buyer-visible product gap can still be processed.

Evidence and write boundary

  • Failed-check RCA uses trusted, bounded, redacted exact-head evidence and a separate explicit repair_mode.
  • Ordinary review repair derives authority only from current unresolved file-scoped review threads.
  • RCA repair may add only safe current-PR changed paths.
  • .github/ and scripts/ci/ are excluded from model-derived edit authority.
  • The authoritative path inventory is sorted, NUL-delimited, SHA-256 sealed, and outside the target worktree.
  • Complete pre/post worktree verification covers tracked, untracked, ignored, symlink, file-mode, metadata-race, and out-of-scope changes.
  • Both OpenCode permission maps deny .git and .git/*; model subprocesses receive neither GitHub write credentials nor Actions OIDC request credentials.
  • Commit/push disables repository hooks and uses an explicitly reconstructed, revalidated destination URL.
  • github.token remains read-only. Mutation requires PR_REVIEW_MERGE_TOKEN, OPENCODE_APPROVE_TOKEN, or the short-lived OpenCode GitHub App token exchanged from OIDC.
  • Model execution uses NVIDIA_NIM_API_KEY; COPILOT_GITHUB_TOKEN and GitHub tokens are not model credentials.
  • The repair worker cannot approve, merge, release, weaken branch protection, or reinterpret failed checks.

Exact-head verification

For 9d2a82ae184a18c32339def16ea4097681108482:

  • Hourly NVIDIA NIM Review Repair 31259638623: success;
  • Strix Changed Path Quality CI 31259638593: success;
  • CodeQL PR: success;
  • Python Security: success;
  • SAST Semgrep: success;
  • Security Scan: success;
  • Secret Scan: success;
  • OSV-Scanner PR: success;
  • Scorecard PR: success;
  • SBOM Generation: success;
  • CodeRabbit commit status: success;
  • unresolved actionable inline threads: zero.

Both independent exact-head suites report:

  • 1,100 passed, 16 subtests passed;
  • scripts/ci/pr_review_autofix_context.py: 215/215 statements and 92/92 branches, 100%;
  • scripts/ci/pr_review_conflict_scope.py: 226/226 statements and 64/64 branches, 100%;
  • combined production coverage: 441/441 statements and 156/156 branches, 100%;
  • public docstrings: 100%;
  • compile and clean-diff contracts: success.

Current inline threads are resolved or outdated. No qualifying independent non-author formal APPROVED review is anchored to this exact head.

Activation and merge gate

Scheduled workflows execute only from protected main; therefore the production heartbeat is not active while this PR remains unmerged. Keep the PR Draft. Merge only after a fresh exact-head automated review, a qualifying independent non-author approval, zero unresolved valid findings, all required checks, and branch protection succeed without bypass. Pending, queued, cancelled, skipped-required, neutral-required, absent, stale-head, status-only, author-only, or synthetic evidence is not acceptance.

Documentation

  • docs/automation/hourly-review-repair.md
  • docs/doctoring/hourly-nvidia-nim-autofix.md
  • docs/doctoring/clearfolio-hourly-review-caller.md
  • docs/doctoring/conflict-control-evidence-isolation.md
  • CHANGELOG.md

Supersedes closed predecessor #779 only after protected merge and accepted-main verification.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 368aea14-c87a-4bad-8174-74c38f5f8248

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Clearfolio 시간별 호출자와 재사용 스케줄러를 구성했습니다. 스케줄러는 호출 워크플로의 저장소, 파일, SHA 및 체크아웃 결과를 검증합니다. 자동수정은 NVIDIA NIM, 허용 경로 목록 및 작업 트리 스냅샷을 사용합니다.

Changes

시간별 리뷰 복구 흐름

Layer / File(s) Summary
호출자와 불변 스케줄러 소스 검증
.github/workflows/clearfolio-hourly-review-repair.yml, .github/workflows/pr-review-fix-scheduler.yml, docs/automation/*, docs/doctoring/clearfolio-hourly-review-caller.md, tests/test_pr_review_fix_*
Clearfolio 호출자의 일정, 대상 저장소, 제한, 시크릿과 권한을 구성했습니다. 호출 워크플로의 소스 식별자와 체크아웃 결과를 검증합니다.
NVIDIA NIM 자동수정 경계
.github/workflows/hourly-nvidia-nim-review-repair.yml, .github/workflows/pr-review-autofix.yml, docs/doctoring/hourly-nvidia-nim-autofix.md, tests/test_pr_review_autofix_*
NVIDIA NIM 모델과 API 키를 자동수정 단계에 연결했습니다. OpenCode 권한을 제한하고 GitHub·OIDC 자격 증명을 제거합니다.
허용 경로와 충돌 수정 범위 검증
scripts/ci/pr_review_autofix_context.py, scripts/ci/pr_review_conflict_scope.py, tests/test_pr_review_conflict_scope*.py, tests/test_hourly_autofix_context_quality_gate.py
NUL 구분 허용 경로와 SHA-256 봉인을 생성합니다. 작업 트리 스냅샷과 비교해 범위 밖 변경, ignored 파일, 모드 및 심볼릭 링크 변경을 거부합니다.
계약 검증과 운영 기록
.github/workflows/hourly-nvidia-nim-review-repair.yml, tests/test_pr_review_conflict_scope_git_executable.py, CHANGELOG.md, docs/doctoring/conflict-control-evidence-isolation.md
고정 Git 실행 파일, 제어 증거 분리 및 자동화 경계를 검증합니다. 계약 테스트, 커버리지 기준, 운영 절차와 변경 사항을 기록합니다.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related issues

  • ContextualWisdomLab/four-pillars#28 — NVIDIA NIM 기반 시간별 exact-head 리뷰·복구 자동화와 공유 스케줄러 경계가 연결됩니다.
  • ContextualWisdomLab/EgressWeave#65 — NVIDIA 자격 증명 격리와 명시적 mutation 자격 증명 검증이 연결됩니다.
  • ContextualWisdomLab/life-os#119 — NVIDIA NIM 기반 OpenCode 유지보수와 bounded repair가 연결됩니다.

Possibly related PRs

Suggested labels: needs-revision, do-not-merge

Suggested reviewers: opencode-agent

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 96.92% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 시간별 NVIDIA NIM 기반 리뷰·수정 자동화라는 주요 변경을 정확히 요약합니다.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/hourly-nvidia-nim-review-repair-main

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

@seonghobae
seonghobae marked this pull request as ready for review August 5, 2026 11:46

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@opencode-agent @cwl-noema-review Independently review exact current head 63b50227caefb49abd389a8da41edcfc1d32428e against protected main at f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae. Every direct current-head workflow is successful: Hourly NVIDIA NIM Review Repair 31002522693, Python Security 31002522736, Security Scan 31002522780, CodeQL PR 31002522802, SAST Semgrep 31002522718, Secret Scan 31002522761, OSV-Scanner PR 31002523083, Scorecard PR 31002522717, and SBOM Generation 31002522776. The PR is now Ready under its documented acceptance rule.

Verify the one-hour cadence and retry floor, one-dispatch/single-flight bounds, immutable called-workflow and repository-dispatch source binding, NVIDIA_NIM_API_KEY-only OpenCode model authentication, absence of COPILOT_GITHUB_TOKEN and GitHub Models fallback, missing-secret fail-closed behavior, strict secret step scope, child-process stripping of GitHub and OIDC credentials, file-only agent permissions, exact-head/live-head/file-allowlist/syntax/conflict guards, byte-for-byte preservation of the independent reviewer workflow, and the prohibition on approval, merge, release, or protection weakening. Distinguish this current-main replacement from closed predecessor #779. Submit actionable findings or an exact-head formal review; approval still must satisfy repository independence and branch protection.

@seonghobae
seonghobae enabled auto-merge (squash) August 5, 2026 11:46

Copy link
Copy Markdown
Contributor Author

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

Review exact current head 63b50227caefb49abd389a8da41edcfc1d32428e against current protected main base f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae only. Permanent RED run 31002306348 recorded 13 expected contract failures on the test-only head. Permanent GREEN run 31002522693 passed the exact-head hourly cadence, immutable source identity, NVIDIA_NIM_API_KEY-only provider, missing-secret fail-closed guard, non-file permission denials, model-child GitHub/OIDC credential stripping, byte-identical independent reviewer boundary, compilation, and diff checks. Direct exact-head security, supply-chain, and SAST runs have also succeeded; duplicate reruns may still be queued. Verify one-dispatch/single-flight bounds, source pinning, secret step scope, absence of COPILOT_GITHUB_TOKEN and GitHub Models model authentication, same-repository/live-head guards, APA 7 doctoring, and the inability of the worker to approve, merge a PR, release, or weaken checks. Submit a formal current-head verdict; do not reuse ancestor reviews.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '== Repository and requested commits =='
git remote -v
git rev-parse HEAD
git show -s --format='HEAD %H%nparents %P%nsubject %s' HEAD
git cat-file -e '63b50227caefb49abd389a8da41edcfc1d32428e^{commit}' 2>/dev/null && \
  git show -s --format='requested-head %H%nparents %P%nsubject %s' 63b50227caefb49abd389a8da41edcfc1d32428e || true
git cat-file -e 'f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae^{commit}' 2>/dev/null && \
  git show -s --format='baseline %H%nsubject %s' f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae || true

printf '%s\n' '== Changed paths and diff summary =='
git diff --stat f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae 63b50227caefb49abd389a8da41edcfc1d32428e 2>/dev/null || \
git diff --stat HEAD^ HEAD
git diff --name-status f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae 63b50227caefb49abd389a8da41edcfc1d32428e 2>/dev/null || \
git diff --name-status HEAD^ HEAD

printf '%s\n' '== Candidate automation source =='
fd -HI -t f .github docs 2>/dev/null | sort | \
  grep -E 'hourly|review.*repair|dispatch|opencode|automation|doctoring|CHANGELOG' || true

printf '%s\n' '== Workflow and helper outlines =='
for f in \
  .github/workflows/hourly-nvidia-nim-review-repair.yml \
  .github/workflows/opencode-review-dispatch.yml
do
  if [ -f "$f" ]; then
    echo "--- $f"
    nl -ba "$f"
  fi
done

printf '%s\n' '== Security-sensitive references in tracked text files =='
rg -n -i -C 3 \
  'NVIDIA_NIM_API_KEY|COPILOT_GITHUB_TOKEN|github models|models:|mistral-nemotron|nemotron-3-nano|canonical_ref|repository_dispatch|workflow_call|concurrency|cron|GITHUB_TOKEN|GH_TOKEN|ACTIONS_ID_TOKEN_REQUEST_(TOKEN|URL)|permissions:|pull-requests:\s*write|contents:\s*write|gh pr (merge|review)|release' \
  .github docs CHANGELOG.md 2>/dev/null || true

printf '%s\n' '== Independent reviewer workflow blob comparison =='
if git cat-file -e 'f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae:.github/workflows/opencode-review-dispatch.yml' 2>/dev/null; then
  echo -n 'baseline blob: '
  git rev-parse 'f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae:.github/workflows/opencode-review-dispatch.yml'
fi
if git cat-file -e '63b50227caefb49abd389a8da41edcfc1d32428e:.github/workflows/opencode-review-dispatch.yml' 2>/dev/null; then
  echo -n 'head blob: '
  git rev-parse '63b50227caefb49abd389a8da41edcfc1d32428e:.github/workflows/opencode-review-dispatch.yml'
fi

printf '%s\n' '== Referenced workflow runs =='
for run in 31002522693 31002522736 31002522780 31002522802 31002522718 31002522761 31002523083 31002522717 31002522776; do
  gh api "repos/ContextualWisdomLab/.github/actions/runs/${run}" \
    --jq '"\(.id) \(.name) status=\(.status) conclusion=\(.conclusion) head_sha=\(.head_sha) event=\(.event)"' \
    2>&1 || true
done

Length of output: 5016


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head_sha='63b50227caefb49abd389a8da41edcfc1d32428e'
base_sha='f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae'

show_numbered() {
  file="$1"
  if [ -f "$file" ]; then
    echo "--- $file"
    awk '{ printf "%5d  %s\n", NR, $0 }' "$file"
  else
    echo "--- MISSING: $file"
  fi
}

printf '%s\n' '== Exact changed workflow diff =='
git diff --no-ext-diff --unified=80 "$base_sha" "$head_sha" -- \
  .github/workflows/hourly-nvidia-nim-review-repair.yml \
  .github/workflows/pr-review-autofix.yml \
  .github/workflows/pr-review-fix-scheduler.yml

printf '%s\n' '== Current workflow source =='
show_numbered .github/workflows/hourly-nvidia-nim-review-repair.yml
show_numbered .github/workflows/pr-review-autofix.yml
show_numbered .github/workflows/pr-review-fix-scheduler.yml

printf '%s\n' '== Contract-test source =='
for f in \
  tests/test_pr_review_autofix_nvidia_nim_contract.py \
  tests/test_pr_review_fix_hourly_contract.py \
  tests/test_pr_review_fix_scheduler_source_pin.py
do
  show_numbered "$f"
done

printf '%s\n' '== Repository-wide security-sensitive executable references =='
git grep -n -I -E \
  'NVIDIA_NIM_API_KEY|COPILOT_GITHUB_TOKEN|models\.inference\.ai|github[ _-]?models|canonical_ref|ACTIONS_ID_TOKEN_REQUEST_TOKEN|ACTIONS_ID_TOKEN_REQUEST_URL|GITHUB_TOKEN|GH_TOKEN|repository_dispatch|workflow_call|concurrency:|cron:|mistralai/mistral-nemotron|nvidia/nemotron-3-nano-30b-a3b|gh pr (merge|review)|gh release|branches/.+protection' \
  "$head_sha" -- .github ':!*.md' || true

printf '%s\n' '== Independent reviewer workflow immutable blob check =='
expected_blob='83f6830d5c21a324b4dbcd4e5c21a07968994b81'
base_blob=$(git rev-parse "$base_sha:.github/workflows/opencode-review-dispatch.yml")
head_blob=$(git rev-parse "$head_sha:.github/workflows/opencode-review-dispatch.yml")
printf 'expected=%s\nbaseline=%s\nhead=%s\n' "$expected_blob" "$base_blob" "$head_blob"
git diff --no-ext-diff --exit-code "$base_sha" "$head_sha" -- .github/workflows/opencode-review-dispatch.yml || true

printf '%s\n' '== Requested workflow runs =='
for run in 31002522693 31002522736 31002522780 31002522802 31002522718 31002522761 31002523083 31002522717 31002522776; do
  printf 'run %s: ' "$run"
  gh api "repos/ContextualWisdomLab/.github/actions/runs/${run}" \
    --jq '[.id, .name, .status, .conclusion, .head_sha, .event] | `@tsv`' 2>&1 || true
done

Length of output: 156113


🤖 web_search executed:

GitHub Actions contexts documentation job.workflow_repository job.workflow_sha job.workflow_ref job.workflow_file_path github.workflow_ref github.workflow_sha

Length of output: 13390


@seonghobae Formal review completed for 63b50227caefb49abd389a8da41edcfc1d32428e against f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae.

I found no actionable findings in the requested scope.

Verified items:

  • The scheduler runs at minute 23 of every hour.
  • The same-head retry floor is one hour.
  • The scheduler retains one dispatch per run and repository-scoped single-flight concurrency.
  • The reusable scheduler binds its source to job.workflow_repository, job.workflow_sha, job.workflow_ref, and job.workflow_file_path.
  • The scheduler validates the identity before checkout and verifies the checked-out SHA and workflow file before it runs the helper.
  • canonical_ref remains accepted and ignored.
  • The dispatch worker pins its trusted helper checkout to ${{ github.sha }}.
  • The autofix worker enables only nvidia-nim.
  • The primary model is nvidia-nim/mistralai/mistral-nemotron.
  • The helper model is nvidia-nim/nvidia/nemotron-3-nano-30b-a3b.
  • The autofix workflow contains no COPILOT_GITHUB_TOKEN, GitHub Models provider, or GitHub-token model fallback.
  • secrets.NVIDIA_NIM_API_KEY is bound only to the two OpenCode execution steps.
  • Both model steps fail closed when NVIDIA_NIM_API_KEY is absent.
  • Both OpenCode child processes remove GITHUB_TOKEN, GH_TOKEN, and Actions OIDC request credentials.
  • Global and named-agent permissions deny non-file interactions.
  • Same-repository, exact-head, live-head, file-allowlist, syntax, and conflict-marker guards remain in place.
  • .github/workflows/opencode-review-dispatch.yml is unchanged. Its baseline and head blob are both 83f6830d5c21a324b4dbcd4e5c21a07968994b81.
  • The nine listed workflow runs completed successfully for this exact head.

GitHub documents the job.workflow_* identity properties used by the reusable workflow. These properties are unavailable on GitHub Enterprise Server. This PR targets GitHub.com.

This review covers current PR #782. It does not evaluate closed predecessor #779 as the implementation source.

I do not issue approval. Approval must remain subject to the required independent reviewer and branch-protection policy.

⚠️ Action not completed

Review rate limited.

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 @cwl-noema-review @coderabbitai review

Review exact current head 63b50227caefb49abd389a8da41edcfc1d32428e only. The permanent hourly NVIDIA NIM contract and all direct current-head security/supply-chain workflows have succeeded at least once; later duplicate same-head reruns are still settling. Verify the hourly minute-23 cadence, one-hour retry floor, immutable called-workflow source identity, NVIDIA_NIM_API_KEY-only model authentication, primary/helper model routing, missing-secret fail-closed behavior, child-process token/OIDC scrubbing, complete unattended-agent permission denials, independent reviewer byte stability, exact-head/same-repository/file-allowlist/live-head safeguards, APA 7 doctoring, and the prohibition on approval, merge, release, or branch-protection changes. Submit current-head verdicts and qualifying independent approval without reusing #779 evidence.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

@seonghobae I will review PR #782 at exact head 63b50227caefb49abd389a8da41edcfc1d32428e only.

I will verify the requested scheduler, source-binding, NVIDIA NIM credential, token-scrubbing, permission, safety-guard, independent-reviewer, and documentation controls. I will not reuse #779 evidence. I will not issue approval unless the required independent approval and branch-protection conditions are satisfied.

⚠️ Action not completed

Review rate limited.

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.

@coderabbitai

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

head_expected='63b50227caefb49abd389a8da41edcfc1d32428e'
base_expected='f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae'

printf '%s\n' '== checked-out commit =='
git rev-parse HEAD
printf '%s\n' '== expected commits present =='
git cat-file -e "${head_expected}^{commit}"
git cat-file -e "${base_expected}^{commit}"

printf '%s\n' '== changed paths =='
git diff --name-status "$base_expected" "$head_expected"

printf '%s\n' '== changed workflow files =='
git diff --stat "$base_expected" "$head_expected" -- .github/workflows
fd -a -t f .github/workflows | sort

printf '%s\n' '== workflow and helper symbols =='
for f in \
  .github/workflows/hourly-nvidia-nim-review-repair.yml \
  .github/workflows/opencode-review-dispatch.yml
do
  if [ -f "$f" ]; then
    printf '\n--- %s ---\n' "$f"
    cat -n "$f"
  fi
done

printf '%s\n' '== references to hourly scheduler, dispatch, and model authentication =='
rg -n -C 3 \
  -e 'NVIDIA_NIM_API_KEY' \
  -e 'COPILOT_GITHUB_TOKEN' \
  -e 'GitHub Models|models\.github' \
  -e 'canonical_ref' \
  -e 'repository_dispatch|workflow_dispatch|concurrency|cron' \
  -e 'GITHUB_TOKEN|GH_TOKEN|ACTIONS_ID_TOKEN_REQUEST' \
  -e 'opencode|nemotron|mistral-nemotron' \
  -e 'pull-requests:\s*write|contents:\s*write|actions:\s*write' \
  .github scripts 2>/dev/null || true

Length of output: 2843


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='63b50227caefb49abd389a8da41edcfc1d32428e'
base='f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae'

printf '%s\n' '== independent reviewer workflow blob at head and base =='
git rev-parse "${head}:.github/workflows/opencode-review-dispatch.yml"
git rev-parse "${base}:.github/workflows/opencode-review-dispatch.yml"
git diff --exit-code "$base" "$head" -- .github/workflows/opencode-review-dispatch.yml \
  && echo 'independent-reviewer workflow: unchanged'

printf '%s\n' '== all workflow paths at reviewed head =='
git ls-tree -r --name-only "$head" .github/workflows | sort

for f in \
  .github/workflows/hourly-nvidia-nim-review-repair.yml \
  .github/workflows/pr-review-autofix.yml \
  .github/workflows/pr-review-fix-scheduler.yml
do
  printf '\n== %s at exact head ==\n' "$f"
  git show "${head}:${f}" | cat -n
done

printf '%s\n' '== exact workflow diffs =='
git diff --unified=80 "$base" "$head" -- \
  .github/workflows/hourly-nvidia-nim-review-repair.yml \
  .github/workflows/pr-review-autofix.yml \
  .github/workflows/pr-review-fix-scheduler.yml

printf '%s\n' '== scheduler/autofix source and credential references at exact head =='
git grep -n -I -E \
  'NVIDIA_NIM_API_KEY|COPILOT_GITHUB_TOKEN|models\.github|GitHub Models|canonical_ref|ACTIONS_ID_TOKEN_REQUEST|GITHUB_TOKEN|GH_TOKEN|repository_dispatch|workflow_call|workflow_dispatch|concurrency|cron|mistralai/mistral-nemotron|nvidia/nemotron-3-nano-30b-a3b' \
  "$head" -- .github scripts 2>/dev/null || true

printf '%s\n' '== focused contract test outlines =='
ast-grep outline tests/test_pr_review_autofix_nvidia_nim_contract.py --items all
ast-grep outline tests/test_pr_review_fix_hourly_contract.py --items all
ast-grep outline tests/test_pr_review_fix_scheduler_source_pin.py --items all

printf '%s\n' '== focused contract test assertions =='
for f in \
  tests/test_pr_review_autofix_nvidia_nim_contract.py \
  tests/test_pr_review_fix_hourly_contract.py \
  tests/test_pr_review_fix_scheduler_source_pin.py
do
  printf '\n== %s ==\n' "$f"
  git show "${head}:${f}" | sed -n '1,280p'
done

Length of output: 223866


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='63b50227caefb49abd389a8da41edcfc1d32428e'

printf '%s\n' '== scheduler helper outline =='
ast-grep outline scripts/ci/pr_review_fix_scheduler.py --items all

printf '%s\n' '== scheduler helper dispatch, bounds, and guard references =='
git show "${head}:scripts/ci/pr_review_fix_scheduler.py" |
  nl -ba |
  grep -E -C 8 \
    'max.dispatch|retry.hours|repository.dispatch|autofix|head.sha|live.head|allowed|allowlist|same.repository|pull.request|conflict|syntax|dispatch' || true

printf '%s\n' '== selected helper source =='
git show "${head}:scripts/ci/pr_review_fix_scheduler.py" | sed -n '1,920p'

printf '%s\n' '== prohibited worker operation scan =='
git show "${head}:.github/workflows/pr-review-autofix.yml" |
  nl -ba |
  grep -Ei -C 4 \
    'pulls/.*/merge|/merges|merge.pull|pulls/.*/reviews|approve|releases|branches/.*/protection|rulesets|gh pr (merge|review)|gh release|gh api.*(merge|protection|ruleset|releases)' || true

printf '%s\n' '== operator documentation =='
for f in \
  docs/automation/hourly-review-repair.md \
  docs/doctoring/hourly-nvidia-nim-autofix.md \
  CHANGELOG.md
do
  printf '\n== %s ==\n' "$f"
  git show "${head}:${f}" | cat -n
done

Length of output: 39579


@seonghobae: Formal review verdict: request changes.

  • High — conflict resolution can push edits outside the conflict file set. In .github/workflows/pr-review-autofix.yml, the conflict path instructs OpenCode to edit only conflicted_files, but it does not enforce this instruction. After the model process at Line 524, the workflow stages all worktree changes with git add -A at Line 535 and pushes them. The normal autofix path has a file-allowlist validation step, but that step does not run when RESOLVE_CONFLICT == 'true'. A prompt is not an enforcement boundary because the model has edit: allow over the full worktree. Derive an allowed-path file from conflicted_files, reject all changed and untracked paths outside that set, and perform this check before staging or committing. Update the doctoring claim that all changed paths are rejected outside the allowlist.

I verified commit 63b50227caefb49abd389a8da41edcfc1d32428e against base f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae. I also verified the hourly 23 * * * * cadence, one-hour retry default, one-dispatch default, repository-scoped single-flight concurrency, immutable called-workflow source checks, NIM-only ordinary autofix configuration, missing-secret preflight, subprocess credential stripping, and unchanged independent reviewer blob 83f6830d5c21a324b4dbcd4e5c21a07968994b81.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

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

Please review exact head 63b50227caefb49abd389a8da41edcfc1d32428e. Direct security, dependency, SBOM, Secret Scan, Semgrep, Python Security, focused hourly-NVIDIA-NIM contract, and an earlier exact-head CodeQL run are successful; the latest CodeQL rerun remains in progress. Treat only current-head evidence as authoritative. Verify the NVIDIA-NIM-only model path, one-hour cadence/retry floor, immutable reusable-workflow source, model-process credential isolation, unchanged independent reviewer workflow, and absence of approve/merge/release/protection APIs.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact current head 63b50227caefb49abd389a8da41edcfc1d32428e. Verify the hourly cadence, one-hour same-head retry floor, immutable called-workflow source binding, NVIDIA NIM-only model authentication, strict secret scoping and child-process credential stripping, permission denials, unchanged independent review workflow, permanent contract gate, doctoring, and branch-protection boundaries. Submit an approval only if no blocking finding remains.

@coderabbitai

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

head='63b50227caefb49abd389a8da41edcfc1d32428e'
base='f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae'
expected_blob='83f6830d5c21a324b4dbcd4e5c21a07968994b81'

git cat-file -e "${head}^{commit}"
git cat-file -e "${base}^{commit}"

printf '%s\n' '== reviewed commits =='
git show -s --format='head=%H%nbase=%P%nsubject=%s' "$head"
git show -s --format='baseline=%H%nsubject=%s' "$base"

printf '%s\n' '== changed paths =='
git diff --name-status "$base" "$head"

printf '%s\n' '== scheduler and autofix workflow at exact head =='
for path in \
  .github/workflows/hourly-nvidia-nim-review-repair.yml \
  .github/workflows/pr-review-fix-scheduler.yml \
  .github/workflows/pr-review-autofix.yml \
  scripts/ci/pr_review_fix_scheduler.py \
  docs/automation/hourly-review-repair.md \
  docs/doctoring/hourly-nvidia-nim-autofix.md
do
  printf '\n--- %s ---\n' "$path"
  git show "${head}:${path}" | nl -ba
done

printf '%s\n' '== independent reviewer blob =='
printf 'expected=%s\n' "$expected_blob"
printf 'base=%s\n' "$(git rev-parse "${base}:.github/workflows/opencode-review-dispatch.yml")"
printf 'head=%s\n' "$(git rev-parse "${head}:.github/workflows/opencode-review-dispatch.yml")"
git diff --exit-code "$base" "$head" -- .github/workflows/opencode-review-dispatch.yml

printf '%s\n' '== security-sensitive references at exact head =='
git grep -n -I -E \
  'NVIDIA_NIM_API_KEY|COPILOT_GITHUB_TOKEN|models\.github|GitHub Models|mistralai/mistral-nemotron|nvidia/nemotron-3-nano-30b-a3b|23 \* \* \* \*|retry.hours|canonical_ref|job\.workflow_(repository|sha|ref|file_path)|GITHUB_TOKEN|GH_TOKEN|ACTIONS_ID_TOKEN_REQUEST_(TOKEN|URL)|gh pr (merge|review)|pulls/.*/(merge|reviews)|releases|branches/.+protection|rulesets|git add -A|conflicted_files' \
  "$head" -- .github scripts docs ':!*.md' || true

printf '%s\n' '== current-head workflow runs =='
for run in 31002522693 31002522736 31002522780 31002522802 31002522718 31002522761 31002523083 31002522717 31002522776; do
  gh api "repos/ContextualWisdomLab/.github/actions/runs/${run}" \
    --jq '[.id, .name, .status, .conclusion, .head_sha, .event] | `@tsv`' \
    2>&1 || true
done

Length of output: 3363


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='63b50227caefb49abd389a8da41edcfc1d32428e'
base='f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae'
expected_blob='83f6830d5c21a324b4dbcd4e5c21a07968994b81'

show_file() {
  path="$1"
  printf '\n--- %s ---\n' "$path"
  git show "${head}:${path}" | awk '{ printf "%5d  %s\n", NR, $0 }'
}

printf '%s\n' '== exact-head workflow and helper source =='
for path in \
  .github/workflows/hourly-nvidia-nim-review-repair.yml \
  .github/workflows/pr-review-fix-scheduler.yml \
  .github/workflows/pr-review-autofix.yml \
  scripts/ci/pr_review_fix_scheduler.py \
  docs/automation/hourly-review-repair.md \
  docs/doctoring/hourly-nvidia-nim-autofix.md
do
  show_file "$path"
done

printf '%s\n' '== independent reviewer blob comparison =='
printf 'expected=%s\n' "$expected_blob"
printf 'base=%s\n' "$(git rev-parse "${base}:.github/workflows/opencode-review-dispatch.yml")"
printf 'head=%s\n' "$(git rev-parse "${head}:.github/workflows/opencode-review-dispatch.yml")"
if git diff --quiet "$base" "$head" -- .github/workflows/opencode-review-dispatch.yml; then
  printf '%s\n' 'workflow_unchanged=true'
else
  printf '%s\n' 'workflow_unchanged=false'
fi

printf '%s\n' '== focused security controls at exact head =='
git grep -n -I -E \
  'NVIDIA_NIM_API_KEY|COPILOT_GITHUB_TOKEN|models\.github|GitHub Models|mistralai/mistral-nemotron|nvidia/nemotron-3-nano-30b-a3b|23 \* \* \* \*|retry.hours|canonical_ref|job\.workflow_(repository|sha|ref|file_path)|GITHUB_TOKEN|GH_TOKEN|ACTIONS_ID_TOKEN_REQUEST_(TOKEN|URL)|gh pr (merge|review)|pulls/.*/(merge|reviews)|releases|branches/.+protection|rulesets|git add -A|conflicted_files' \
  "$head" -- .github scripts docs ':!*.md' || true

printf '%s\n' '== specified workflow-run metadata =='
for run in 31002522693 31002522736 31002522780 31002522802 31002522718 31002522761 31002523083 31002522717 31002522776; do
  printf 'run=%s ' "$run"
  gh api "repos/ContextualWisdomLab/.github/actions/runs/${run}" \
    --jq '[.name, .status, .conclusion, .head_sha, .event] | `@tsv`' \
    2>&1 || true
done

Length of output: 166782


@seonghobae Formal review verdict: request changes.

High — Conflict resolution does not enforce its file boundary

In .github/workflows/pr-review-autofix.yml, the conflict path records conflicted_files at Line 472. It instructs OpenCode to edit only those files at Lines 493-507. This is a prompt constraint only.

The OpenCode agent has edit: allow for the full PR worktree. After model execution, the workflow stages every worktree change with git add -A at Line 535. The conflict path does not validate changed or untracked paths against conflicted_files before it commits and pushes at Lines 558-559.

An unrelated model edit can therefore be committed during conflict resolution.

Before git add -A, derive a normalized allowed-path file from conflicted_files. Reject every changed or untracked path that is not in that file. Keep the conflict-marker, Python syntax, and live-head checks after this path validation. Update docs/doctoring/hourly-nvidia-nim-autofix.md at Lines 133-138 because its statement that the workflow rejects all paths outside the allowlist is not true for conflict resolution.

I verified the following controls at exact head 63b50227caefb49abd389a8da41edcfc1d32428e:

  • The scheduler uses 23 * * * *.
  • The retry floor defaults to one hour.
  • The dispatch limit defaults to one.
  • Repository-scoped scheduler concurrency is present.
  • The reusable scheduler validates and checks out job.workflow_repository, job.workflow_sha, job.workflow_ref, and job.workflow_file_path.
  • The autofix worker checks out trusted helper source at ${{ github.sha }}.
  • The autofix OpenCode configuration enables only nvidia-nim.
  • The primary model is nvidia-nim/mistralai/mistral-nemotron.
  • The helper model is nvidia-nim/nvidia/nemotron-3-nano-30b-a3b.
  • secrets.NVIDIA_NIM_API_KEY is bound only to the two OpenCode execution steps.
  • Both OpenCode steps fail closed when the NVIDIA secret is absent.
  • Both OpenCode child processes remove GITHUB_TOKEN, GH_TOKEN, and Actions OIDC request credentials.
  • Both permission maps deny the required non-file interactions.
  • .github/workflows/opencode-review-dispatch.yml is unchanged at blob 83f6830d5c21a324b4dbcd4e5c21a07968994b81.
  • The listed hourly contract, security, CodeQL, Semgrep, secret scan, OSV, Scorecard, and SBOM runs completed successfully for this exact head.

I found no separate approve, merge, release, or branch-protection operation in the reviewed scheduler or autofix worker. I do not approve this PR while the conflict-resolution file-boundary issue remains.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@opencode-agent Please independently review exact current head 63b50227caefb49abd389a8da41edcfc1d32428e after current-head checks complete. Confirm the repair worker uses only NVIDIA_NIM_API_KEY for model authentication, strips GitHub and OIDC credentials from child processes, cannot approve/merge/release, binds trusted workflow source immutably, preserves one-dispatch single-flight limits, and satisfies 100% coverage/docstring and doctoring contracts. Submit APPROVE only if no blocker remains.

Copy link
Copy Markdown
Contributor Author

@cwl-noema-review Please perform a second independent exact-head review of 63b50227caefb49abd389a8da41edcfc1d32428e after current checks complete. Verify the NVIDIA NIM-only write-capable OpenCode boundary, immutable source receipt, credential isolation, denied non-file interactions, hourly bounded scheduler semantics, unchanged independent reviewer credentials, APA 7 doctoring, and fail-closed missing-secret/provider behavior. Submit APPROVE only if no actionable finding remains.

@coderabbitai

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

head='63b50227caefb49abd389a8da41edcfc1d32428e'
base='f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae'
reviewer_blob='83f6830d5c21a324b4dbcd4e5c21a07968994b81'

git cat-file -e "${head}^{commit}"
git cat-file -e "${base}^{commit}"

printf '%s\n' '== exact commits =='
git show -s --format='head %H%nsubject %s' "$head"
git show -s --format='base %H%nsubject %s' "$base"

printf '%s\n' '== changed paths =='
git diff --name-status "$base" "$head"

printf '%s\n' '== reviewer workflow blob stability =='
printf 'expected %s\n' "$reviewer_blob"
printf 'base     %s\n' "$(git rev-parse "$base:.github/workflows/opencode-review-dispatch.yml")"
printf 'head     %s\n' "$(git rev-parse "$head:.github/workflows/opencode-review-dispatch.yml")"
git diff --exit-code "$base" "$head" -- .github/workflows/opencode-review-dispatch.yml || true

printf '%s\n' '== hourly scheduler and source binding =='
git show "$head:.github/workflows/hourly-nvidia-nim-review-repair.yml" | nl -ba
git show "$head:.github/workflows/pr-review-fix-scheduler.yml" | nl -ba

printf '%s\n' '== autofix model steps, permission maps, and conflict handling =='
git show "$head:.github/workflows/pr-review-autofix.yml" | nl -ba | \
  grep -E -C 12 \
  'NVIDIA_NIM_API_KEY|COPILOT_GITHUB_TOKEN|GitHub Models|models\.github|mistral-nemotron|nemotron-3-nano|GITHUB_TOKEN|GH_TOKEN|ACTIONS_ID_TOKEN_REQUEST|permission|conflicted_files|RESOLVE_CONFLICT|git add|git commit|git push|merge|approve|release|protection' || true

printf '%s\n' '== scheduler helper safeguards =='
git show "$head:scripts/ci/pr_review_fix_scheduler.py" | nl -ba | \
  grep -E -C 8 \
  'retry|dispatch|concurrency|same.repository|head.sha|live.head|allowlist|allowed|conflict|syntax' || true

printf '%s\n' '== focused contract tests and operator documentation =='
for path in \
  tests/test_pr_review_autofix_nvidia_nim_contract.py \
  tests/test_pr_review_fix_hourly_contract.py \
  tests/test_pr_review_fix_scheduler_source_pin.py \
  docs/automation/hourly-review-repair.md \
  docs/doctoring/hourly-nvidia-nim-autofix.md
do
  printf '\n--- %s ---\n' "$path"
  git show "$head:$path" | nl -ba
done

printf '%s\n' '== exact-head workflow run status =='
for run in 31002522693 31002522736 31002522780 31002522802 31002522718 31002522761 31002523083 31002522717 31002522776; do
  gh api "repos/ContextualWisdomLab/.github/actions/runs/$run" \
    --jq '[.id,.name,.status,.conclusion,.head_sha] | `@tsv`' 2>&1 || true
done

Length of output: 3741


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='63b50227caefb49abd389a8da41edcfc1d32428e'

numbered_show() {
  local path="$1"
  printf '\n--- %s ---\n' "$path"
  git show "${head}:${path}" | awk '{printf "%5d  %s\n", NR, $0}'
}

printf '%s\n' '== hourly scheduler =='
numbered_show '.github/workflows/hourly-nvidia-nim-review-repair.yml'

printf '%s\n' '== reusable scheduler workflow =='
numbered_show '.github/workflows/pr-review-fix-scheduler.yml'

printf '%s\n' '== autofix workflow: credential, permissions, conflict and staging controls =='
git show "${head}:.github/workflows/pr-review-autofix.yml" |
  awk '{printf "%5d  %s\n", NR, $0}' |
  grep -E -C 15 \
    'NVIDIA_NIM_API_KEY|COPILOT_GITHUB_TOKEN|GitHub Models|models\.github|mistral-nemotron|nemotron-3-nano|GITHUB_TOKEN|GH_TOKEN|ACTIONS_ID_TOKEN_REQUEST|permissions:|conflicted_files|RESOLVE_CONFLICT|git add|git commit|git push|merge|approve|release|protection' || true

printf '%s\n' '== conflict branch in full context =='
git show "${head}:.github/workflows/pr-review-autofix.yml" |
  awk '{printf "%5d  %s\n", NR, $0}' |
  sed -n '430,570p'

printf '%s\n' '== scheduler helper guard references =='
git show "${head}:scripts/ci/pr_review_fix_scheduler.py" |
  awk '{printf "%5d  %s\n", NR, $0}' |
  grep -E -C 8 \
    'retry|dispatch|concurrency|same.repository|head.sha|live.head|allowlist|allowed|conflict|syntax' || true

printf '%s\n' '== focused contracts: relevant assertions =='
for path in \
  tests/test_pr_review_autofix_nvidia_nim_contract.py \
  tests/test_pr_review_fix_hourly_contract.py \
  tests/test_pr_review_fix_scheduler_source_pin.py
do
  printf '\n--- %s ---\n' "$path"
  git show "${head}:${path}" |
    awk '{printf "%5d  %s\n", NR, $0}' |
    grep -E -C 4 \
      'conflict|allowlist|NVIDIA|COPILOT|GitHub Models|credential|permission|cron|retry|workflow_(repository|sha|ref|file_path)|checkout|dispatch|approve|merge|release|protection' || true
done

printf '%s\n' '== doctoring: safeguards and stated claims =='
git show "${head}:docs/doctoring/hourly-nvidia-nim-autofix.md" |
  awk '{printf "%5d  %s\n", NR, $0}' |
  grep -E -C 4 \
    'allowlist|conflict|NVIDIA|credential|GitHub|permission|approval|merge|release|protection|APA' || true

printf '%s\n' '== exact-head workflow runs =='
for run in 31002522693 31002522736 31002522780 31002522802 31002522718 31002522761 31002523083 31002522717 31002522776; do
  printf 'run %s: ' "$run"
  gh api "repos/ContextualWisdomLab/.github/actions/runs/${run}" \
    --jq '[.id,.name,.status,.conclusion,.head_sha] | `@tsv`' 2>&1 || true
done

Length of output: 86050


@seonghobae Formal review verdict: request changes.

I reviewed exact head 63b50227caefb49abd389a8da41edcfc1d32428e.

I verified the requested hourly cadence, one-hour retry floor, one-dispatch bound, repository-scoped concurrency, immutable called-workflow source binding, NVIDIA NIM-only provider configuration, model routing, NVIDIA secret scope, missing-secret failure, child-process GitHub/OIDC credential stripping, permission denials, exact-head checkout, and unchanged reviewer workflow blob 83f6830d5c21a324b4dbcd4e5c21a07968994b81.

The permanent contract gate and all nine listed direct workflows completed successfully for this exact head.

One blocking finding remains:

  • High — conflict resolution does not enforce the conflict-file boundary. In .github/workflows/pr-review-autofix.yml, the conflict prompt restricts the agent to conflicted_files at Lines 493-507. The workflow does not enforce that restriction. The conflict path skips Validate changed files, then runs git add -A at Line 535 and pushes the result. The OpenCode agent has edit: allow for the worktree. It can therefore modify a non-conflicted path, and the workflow will stage and push that modification.
    Snapshot the worktree immediately after git merge and before OpenCode runs. After OpenCode exits, reject model-caused changes and untracked paths outside conflicted_files before staging. Preserve expected non-conflict changes that git merge produced. Add a focused contract test. Update docs/doctoring/hourly-nvidia-nim-autofix.md Lines 133-138 because the current claim that the workflow rejects all paths outside the allowlist does not apply to conflict resolution.

I cannot approve while this write-capable path remains unbounded.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

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

Review exact current head 63b50227caefb49abd389a8da41edcfc1d32428e only. Verify hourly minute-23 cadence, one-hour same-head retry floor, immutable called-workflow source binding, NVIDIA NIM-only model authentication through NVIDIA_NIM_API_KEY, child-process GitHub/OIDC credential removal, complete file-only permission denials, reviewer workflow byte preservation, and absence of approval, merge, release, or branch-protection authority in the repair worker.

@seonghobae
seonghobae marked this pull request as draft August 5, 2026 11:53
auto-merge was automatically disabled August 5, 2026 11:53

Pull request was converted to draft

@coderabbitai

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

head='63b50227caefb49abd389a8da41edcfc1d32428e'
base='f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae'
reviewer_blob='83f6830d5c21a324b4dbcd4e5c21a07968994b81'

git cat-file -e "${head}^{commit}"
git cat-file -e "${base}^{commit}"

printf '%s\n' '== Commits =='
printf 'checked_out='; git rev-parse HEAD
git show -s --format='head=%H%nbase-parent=%P%nsubject=%s' "$head"
git show -s --format='baseline=%H%nsubject=%s' "$base"

printf '%s\n' '== Changed paths =='
git diff --name-status "$base" "$head"

printf '%s\n' '== Independent reviewer workflow identity =='
printf 'expected=%s\n' "$reviewer_blob"
printf 'base=%s\n' "$(git rev-parse "$base:.github/workflows/opencode-review-dispatch.yml")"
printf 'head=%s\n' "$(git rev-parse "$head:.github/workflows/opencode-review-dispatch.yml")"
git diff --quiet "$base" "$head" -- .github/workflows/opencode-review-dispatch.yml &&
  printf '%s\n' 'reviewer_workflow_unchanged=true'

printf '%s\n' '== Exact-head workflow source =='
for path in \
  .github/workflows/hourly-nvidia-nim-review-repair.yml \
  .github/workflows/pr-review-fix-scheduler.yml \
  .github/workflows/pr-review-autofix.yml \
  scripts/ci/pr_review_fix_scheduler.py \
  docs/doctoring/hourly-nvidia-nim-autofix.md
do
  printf '\n--- %s ---\n' "$path"
  git show "${head}:${path}" | nl -ba
done

printf '%s\n' '== Sensitive control references =='
git grep -n -I -E \
  '23 \* \* \* \*|retry.hours|canonical_ref|workflow_(repository|sha|ref|file_path)|NVIDIA_NIM_API_KEY|COPILOT_GITHUB_TOKEN|GitHub Models|models\.github|mistralai/mistral-nemotron|nvidia/nemotron-3-nano-30b-a3b|GITHUB_TOKEN|GH_TOKEN|ACTIONS_ID_TOKEN_REQUEST_(TOKEN|URL)|permissions:|repository_dispatch|concurrency:|conflicted_files|RESOLVE_CONFLICT|git add -A|gh pr (merge|review)|gh release|pulls/.*/(merge|reviews)|branches/.+protection|rulesets' \
  "$head" -- .github scripts docs ':!*.md' || true

printf '%s\n' '== Exact-head workflow runs =='
for run in 31002522693 31002522736 31002522780 31002522802 31002522718 31002522761 31002523083 31002522717 31002522776; do
  printf 'run=%s ' "$run"
  gh api "repos/ContextualWisdomLab/.github/actions/runs/${run}" \
    --jq '[.name,.status,.conclusion,.head_sha,.event] | `@tsv`' 2>&1 || true
done

Length of output: 3707


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='63b50227caefb49abd389a8da41edcfc1d32428e'
base='f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae'

numbered_show() {
  path="$1"
  printf '\n--- %s ---\n' "$path"
  git show "${head}:${path}" | awk '{ printf "%5d  %s\n", NR, $0 }'
}

printf '%s\n' '== Exact-head workflow source =='
for path in \
  .github/workflows/hourly-nvidia-nim-review-repair.yml \
  .github/workflows/pr-review-fix-scheduler.yml \
  .github/workflows/pr-review-autofix.yml \
  scripts/ci/pr_review_fix_scheduler.py \
  docs/doctoring/hourly-nvidia-nim-autofix.md
do
  numbered_show "$path"
done

printf '%s\n' '== Autofix conflict branch, complete context =='
git show "${head}:.github/workflows/pr-review-autofix.yml" |
  awk '{ printf "%5d  %s\n", NR, $0 }' |
  sed -n '430,575p'

printf '%s\n' '== Scheduler dispatch and retry controls =='
git show "${head}:scripts/ci/pr_review_fix_scheduler.py" |
  awk '{ printf "%5d  %s\n", NR, $0 }' |
  grep -E -C 8 'retry|dispatch|concurrency|same.repository|head.sha|live.head|allowlist|allowed|conflict|syntax' || true

printf '%s\n' '== Sensitive control references at exact head =='
git grep -n -I -E \
  '23 \* \* \* \*|retry.hours|canonical_ref|workflow_(repository|sha|ref|file_path)|NVIDIA_NIM_API_KEY|COPILOT_GITHUB_TOKEN|GitHub Models|models\.github|mistralai/mistral-nemotron|nvidia/nemotron-3-nano-30b-a3b|GITHUB_TOKEN|GH_TOKEN|ACTIONS_ID_TOKEN_REQUEST_(TOKEN|URL)|permissions:|repository_dispatch|concurrency:|conflicted_files|RESOLVE_CONFLICT|git add -A|gh pr (merge|review)|gh release|pulls/.*/(merge|reviews)|branches/.+protection|rulesets' \
  "$head" -- .github scripts docs ':!*.md' || true

printf '%s\n' '== Relevant exact-head contract assertions =='
for path in \
  tests/test_pr_review_autofix_nvidia_nim_contract.py \
  tests/test_pr_review_fix_hourly_contract.py \
  tests/test_pr_review_fix_scheduler_source_pin.py
do
  printf '\n--- %s ---\n' "$path"
  git show "${head}:${path}" |
    awk '{ printf "%5d  %s\n", NR, $0 }' |
    grep -E -C 4 'conflict|allowlist|NVIDIA|COPILOT|GitHub Models|credential|permission|cron|retry|workflow_(repository|sha|ref|file_path)|checkout|dispatch|approve|merge|release|protection' || true
done

printf '%s\n' '== Exact-head workflow run metadata =='
for run in 31002522693 31002522736 31002522780 31002522802 31002522718 31002522761 31002523083 31002522717 31002522776; do
  printf 'run=%s ' "$run"
  gh api "repos/ContextualWisdomLab/.github/actions/runs/${run}" \
    --jq '[.name,.status,.conclusion,.head_sha,.event] | `@tsv`' 2>&1 || true
done

Length of output: 245059


@seonghobae Formal review verdict: request changes.

I reviewed only commit 63b50227caefb49abd389a8da41edcfc1d32428e.

High — Conflict resolution does not enforce its file boundary

In .github/workflows/pr-review-autofix.yml, the conflict path records conflicted_files at Line 472. It tells OpenCode to edit only those paths at Lines 493-507. This restriction is only in the prompt.

The OpenCode agent has edit: allow for the PR worktree. After OpenCode exits, the workflow runs git add -A at Line 535 and pushes the merge commit at Lines 558-559. It does not reject changed or untracked paths outside conflicted_files.

An OpenCode conflict-resolution run can therefore modify an unrelated path, and the workflow can stage and push that modification.

Before git add -A, create an allowed-path list from conflicted_files. Compare model-caused changed and untracked paths against this list. Do not reject legitimate non-conflict changes made by git merge before OpenCode runs. A pre-OpenCode worktree snapshot can distinguish merge changes from model changes. Add a focused contract test. Update docs/doctoring/hourly-nvidia-nim-autofix.md Lines 133-138 because the stated file-allowlist enforcement does not apply to the conflict path.

I verified these controls at the requested commit:

  • The scheduler uses 23 * * * *.
  • The same-head retry default is one hour.
  • The dispatch limit is one.
  • The scheduler uses repository-scoped single-flight concurrency.
  • The scheduler validates job.workflow_repository, job.workflow_sha, job.workflow_ref, and job.workflow_file_path before checkout.
  • The scheduler checks out the validated SHA and verifies the checked-out commit and workflow file.
  • canonical_ref remains accepted and is not consumed.
  • The worker checks out trusted helper source at ${{ github.sha }}.
  • The OpenCode configuration enables only nvidia-nim.
  • The primary model is nvidia-nim/mistralai/mistral-nemotron.
  • The helper model is nvidia-nim/nvidia/nemotron-3-nano-30b-a3b.
  • secrets.NVIDIA_NIM_API_KEY is bound only to the two OpenCode execution steps.
  • Both OpenCode steps fail if NVIDIA_NIM_API_KEY is empty.
  • Both OpenCode child processes remove GITHUB_TOKEN, GH_TOKEN, and Actions OIDC request credentials.
  • Both permission maps deny the required non-file interactions.
  • .github/workflows/opencode-review-dispatch.yml is unchanged at blob 83f6830d5c21a324b4dbcd4e5c21a07968994b81.
  • I found no approval, PR-merge, release, or branch-protection operation in the reviewed scheduler or autofix worker.
  • The nine listed workflow runs completed successfully for this exact commit.

I cannot approve while the conflict-resolution write path remains unbounded.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

/oc Refetch and abort without writing unless PR #782 is still Draft on branch fix/hourly-nvidia-nim-review-repair-main, based on protected main 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba, at exact head f45992a03c9d2ecffe5d1158b16a8fa668df223e. Also require the exact current blobs scripts/ci/pr_review_fix_scheduler.py=5ffc13682c787246d45f9abe0a6e71a994ec04a1, .github/workflows/pr-review-autofix.yml=17df4ab6e5054092b7596ae6412a0d008a5f9e49, and scripts/ci/pr_review_autofix_context.py=a664c0b31ccbb65868dbbdd287e815859bdad7ad.

RCA: exact-head Hourly NVIDIA NIM Review Repair and Strix runs fail after the intentional RED commit f45992a… with 4 failed, 1084 passed, 16 subtests passed. The four failures prove the real scheduler still stops at source-backed failed-check CHANGES_REQUESTED reviews instead of dispatching a distinct RCA worker mode: needs_rca_repair is absent, dispatch_autofix has no repair_mode, and the worker does not collect redacted exact-head failed-check evidence before deriving a separately sealed edit scope. Provider exhaustion and missing independent approval must remain external waits, not invented source patches.

Implement the smallest secure GREEN vertical slice, test-first, without weakening any review, credential, path, check, or branch-protection boundary:

  1. In scripts/ci/pr_review_fix_scheduler.py, add a beginner-readable needs_rca_repair(pr) that examines only the latest formal OpenCode CHANGES_REQUESTED review bound to the exact current head. Return RCA=true only for explicit failed-check evidence markers such as failed check/failed-check/coverage-evidence/Strix failed. Fail closed for model/provider exhaustion, inability to establish approval sufficiency, missing independent approval, merge conflicts, stale reviews, drafts, and external heads. Integrate it after ordinary file-scoped autofix classification and before conflict handling. Prefetch comments for RCA candidates, preserve one-dispatch and one-hour same-head bounds, and pass repair_mode="rca"; ordinary repair remains review.

  2. Extend dispatch_autofix with a validated repair_mode argument (only review or rca) and bind it into the exact-head repository-dispatch payload. Do not change resolve_conflict semantics.

  3. Add a bounded trusted scripts/ci/collect_failed_check_evidence.sh and focused tests. It must accept one output path; require validated GH_REPOSITORY, positive PR_NUMBER, and exact 40-hex HEAD_SHA; query only check runs attached to that exact commit; include only terminal failure/error/timed-out/startup-failure evidence; exclude queued, pending, cancelled, skipped, neutral, action-required, absent, stale-head, or successful evidence; fetch only exact matching Actions job logs when a validated job URL is available; redact through the existing trusted scripts/ci/redact_sensitive_log.py; bound check count, per-log lines, total bytes, URLs, and diagnostics; emit metadata-only evidence when logs are unavailable; never execute target code; write a regular mode-0600 file atomically; and fail closed on malformed identities or unsafe output paths. Do not import the large collector from another unmerged branch wholesale.

  4. In .github/workflows/pr-review-autofix.yml, bind and validate REPAIR_MODE from the dispatch payload. For RCA mode only, collect the exact-head failed-check evidence into $RUNNER_TEMP/pr-review-autofix-failed-check-evidence.md before model execution, using only the read credential. Pass literal --repair-mode "$REPAIR_MODE" and --failed-check-evidence to the trusted context builder. Ensure GitHub/OIDC credentials remain removed from the OpenCode child process. Do not expose the evidence collector, token, or unrestricted logs to target-controlled execution.

  5. Extend scripts/ci/pr_review_autofix_context.py with strict --repair-mode and --failed-check-evidence contracts. Quote failed-check evidence as untrusted Markdown. Keep edit authorization separately sealed in the existing NUL list and SHA-256 receipt. In RCA mode, authorize only safe regular PR-changed paths and active file-scoped review paths; reject .git, absolute/traversal/control paths, symlinks, duplicates, newline/NUL/backtick ambiguity, and paths outside the exact current PR. It is acceptable—and required—to leave the allowlist empty when no safe repository edit is realistically attributable to the failure.

  6. Update the focused quality workflow, operator/doctoring documentation, and CHANGELOG only as necessary to cover the new production files, RCA evidence/data flow, failure/rollback semantics, privacy/redaction boundary, and exact one-hour behavior. Preserve NVIDIA NIM models and NVIDIA_NIM_API_KEY; never introduce COPILOT_GITHUB_TOKEN, GitHub Models, secrets: inherit, github.token mutation authority, self-approval, merge, release, or protected-setting mutation.

Verification: first run the four currently failing tests in tests/test_pr_review_fix_hourly_contract.py; add realistic positive/negative tests for classification, dispatch payload, exact-head filtering, log redaction, bounded evidence, unsafe paths, empty safe scope, and external-wait abstention; then run the focused scheduler/context/collector suites, Bash syntax, Python compilation, actionlint/YAML checks, the complete central suite, exact 100% production statement and branch coverage for changed Python helpers, public callable docstrings, and git diff --check. Commit ordinary descendant commits only; no amend/rebase/force-push. Do not mark Ready, approve, merge, release, or resolve unrelated threads. If head/base/blob state moves, any test fails, the required path scope cannot be kept bounded, or another writer becomes active, leave the branch unchanged and report exact evidence.

Copy link
Copy Markdown
Contributor Author

@coderabbitai autofix

Apply the remaining exact-current-head RCA scheduler repairs directly to branch fix/hourly-nvidia-nim-review-repair-main; do not open a stacked PR or add a one-shot writer.

  1. In .github/workflows/pr-review-autofix.yml, bind REPAIR_MODE to ${{ github.event.client_payload.repair_mode || 'review' }}, validate review|rca|conflict, pass --repair-mode "$REPAIR_MODE" and an explicit --failed-check-evidence path to the trusted context collector, and ensure RCA mode collects redacted exact-head failed-check evidence before model editing while the separately sealed allowed-path inventory remains authoritative.
  2. In tests/test_pr_review_fix_scheduler.py, update the predecessor skip-message expectation to the current bounded review/RCA/conflict wording and add/adjust tests needed for the new scheduler paths without weakening assertions.
  3. Add focused tests that cover every new branch in scripts/ci/pr_review_autofix_context.py, restoring production statement and branch coverage to 100% rather than lowering the threshold.
  4. Remove the three-line “Compatibility evidence” comment from .github/workflows/pr-review-fix-scheduler.yml. It is synthetic grep evidence and is not a realistic security control.
  5. Update the stale assertion in scripts/ci/test_strix_quick_gate.sh to require the active app-token fallback:
    GH_TOKEN: ${{ secrets.PR_REVIEW_MERGE_TOKEN || secrets.OPENCODE_APPROVE_TOKEN || steps.scheduler_app_token.outputs.token }}
    and explicitly forbid the old ... || github.token mutation fallback.

Run the focused RCA contracts first, then the complete Hourly NVIDIA NIM and Strix suites, preserving 100% production statement/branch/docstring gates. Keep the PR Draft and do not merge.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Autofix skipped. No unresolved CodeRabbit review comments with fix instructions found.

Copy link
Copy Markdown
Contributor Author

/oc Refetch and abort without writing unless PR #782 is still Draft, open, mergeable, based on protected main 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba, and at exact head 1546f2cbfa15b631ecca4be41872cfffd97134e4. Require these current blobs before mutation: scripts/ci/pr_review_fix_scheduler.py=0a4263e19d3423f79689b235a9641472c7e1c6ab, scripts/ci/pr_review_autofix_context.py=a3e0e8846b1a1f5363daf12412c5b826f82b493a, .github/workflows/pr-review-autofix.yml=17df4ab6e5054092b7596ae6412a0d008a5f9e49, .github/workflows/hourly-nvidia-nim-review-repair.yml=4d6498efc6ee34d0cca6b4d95cc52cb1d96fc22a, and tests/test_pr_review_fix_scheduler.py=a0ea3fe608a7dca87b2238e2185446aa881c0891.

RCA on exact-head runs 31258615764 and 31258615774: the scheduler’s failed-check classifier and dispatch payload are now implemented, but the runtime vertical slice is incomplete. Both exact-head suites report two deterministic contract failures and coverage below policy: (1) .github/workflows/pr-review-autofix.yml still has no REPAIR_MODE, no trusted failed-check collection step, and no --repair-mode "$REPAIR_MODE" / --failed-check-evidence arguments; (2) tests/test_pr_review_fix_scheduler.py retains the predecessor exact-string expectation for the old skip reason; (3) pr_review_autofix_context.py added untested RCA branches and internally invokes a sibling collector that does not exist on this branch, leaving 25 statements and four partial branches uncovered. This is source/configuration RED evidence, not an external review/runner wait.

Implement only the remaining secure GREEN slice. Preserve the already-green needs_rca_repair, exact-head classification, dispatch mode, one-dispatch bound, one-hour retry floor, and external-wait abstention unless a focused regression proves a defect.

  1. Add scripts/ci/collect_failed_check_evidence.sh as a trusted, bounded, shell-only collector with focused tests. It must accept exactly one output path; validate GH_REPOSITORY, positive PR_NUMBER, and 40-hex HEAD_SHA; query check runs only for that exact commit; include only terminal failure, error, timed_out, or startup_failure evidence; never treat cancelled, skipped, neutral, action-required, pending, queued, absent, stale-head, or success as failed evidence; fetch only validated matching Actions job logs; pass every log through the existing trusted redact_sensitive_log.py; cap number of checks, lines per log, aggregate bytes, and diagnostic text; use metadata-only evidence when logs are inaccessible; never execute target code; create the output atomically as a regular mode-0600 file; fail closed on unsafe paths or malformed GitHub identities.

  2. In .github/workflows/pr-review-autofix.yml, bind REPAIR_MODE from github.event.client_payload.repair_mode || 'review'; accept exactly review, rca, or conflict; require consistency with RESOLVE_CONFLICT. In RCA mode, collect exact-head failed-check evidence before preparing model context, under the read credential only, at $RUNNER_TEMP/pr-review-autofix-failed-check-evidence.md. Invoke the trusted context builder with literal --repair-mode "$REPAIR_MODE" and, for RCA only, --failed-check-evidence "$RUNNER_TEMP/pr-review-autofix-failed-check-evidence.md". Preserve the current OIDC/OpenCode App exchange, stripped child-process credentials, NVIDIA NIM models/key, sealed path authorization, worktree verification, explicit push destination, and no approve/merge/release behavior.

  3. In scripts/ci/pr_review_autofix_context.py, make --repair-mode {review,rca,conflict} explicit and mandatory from the trusted dispatch; add an optional --failed-check-evidence that is required only for RCA and forbidden otherwise. Validate it as a bounded regular non-symlink file under the trusted runner temp boundary; quote it as untrusted Markdown. Do not infer authority solely from review prose. Cross-check that RCA still has an exact-head OpenCode failed-check change request; otherwise fail closed. Keep edit scope in the separately sealed NUL inventory. RCA may add only safe current-PR changed files plus active file-scoped thread paths, excluding control-plane paths, removed files, symlinks, absolute/traversal/control-character/backtick paths, duplicates, and anything not in the live exact-current PR. An empty safe scope is valid and must result in no edit.

  4. Update the stale positive assertion in tests/test_pr_review_fix_scheduler.py to the current intentional skip reason rather than reverting the new RCA classification. Extend dispatch mocks to tolerate/verify repair_mode without globally weakening negative tests.

  5. Add realistic positive and negative tests for exact-head filtering, terminal-failure classification, cancelled/skipped/pending exclusion, redaction, byte/line bounds, unsafe output paths, unavailable logs, explicit mode/evidence consistency, empty safe scope, control-path exclusion, and external approval/provider exhaustion abstention. Cover every new production branch. Update .github/workflows/hourly-nvidia-nim-review-repair.yml path triggers, pytest coverage targets, interrogate inputs, Bash syntax, and compile list for the new collector/tests. Update doctoring and CHANGELOG only for the final implemented data/authority flow, failure/rollback semantics, and privacy boundary.

Verification order: run the two current exact failures first; then all focused scheduler/context/collector tests; bash -n; Python compilation; workflow YAML/action checks; exact 100% statement and branch coverage for changed Python production helpers; public callable docstrings 100%; the complete central suite and Strix quick gate; git diff --check. Commit ordinary descendant commits only, with no amend/rebase/force-push. Do not mark Ready, approve, merge, release, alter reviewer credentials, use COPILOT_GITHUB_TOKEN, introduce GitHub Models, weaken checks, or change protected settings. If head/base/blob state moves, another writer is active, or any requirement cannot be satisfied inside the sealed authority boundary, leave the branch unchanged and report exact evidence.

Copy link
Copy Markdown
Contributor Author

@opencode-agent address

Execute the bounded exact-head GREEN repair specified in the immediately preceding maintainer instruction, issue comment 5226241383, only if PR #782 is still Draft at exact head 1546f2cbfa15b631ecca4be41872cfffd97134e4 with every stated base and blob guard unchanged. That instruction contains the authoritative RCA, permitted files, secure failed-check evidence contract, test-first order, and abort conditions. Do not broaden scope, approve, mark Ready, merge, release, rebase, force-push, change reviewer credentials, or reuse predecessor-head evidence. If any guard moved, leave the tree unchanged and report the live mismatch.

Copy link
Copy Markdown
Contributor Author

Exact-current-head review request for 471c6491ff3383be2e4ec778272df8d9dbf16260 over protected base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba.

The hourly scheduler now performs exact-head failed-check classification, trusted redacted evidence collection, RCA, materially distinct remediation enumeration, feasibility checks against actual writer authority/credential/path/dependency/verifiability boundaries, minimal reversible repair, and exact-head revalidation. All current-head Checks are successful and active inline threads are resolved.

Review this unchanged head read-only. Preserve independent reviewer identities and the existing credential chain; do not update the branch, synthesize approval, or bypass protection.

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

@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 review request for 471c6491ff3383be2e4ec778272df8d9dbf16260 over protected base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba.

The hourly RCA and remediation-feasibility runtime is complete. Exact-head Hourly NVIDIA NIM and Strix gates succeed; 1,108 tests plus 16 subtests pass; both production helpers have 100% statement and branch coverage and 100% docstrings; security, CodeQL, Semgrep, OSV, Scorecard, Secret Scan, and SBOM succeed; unresolved inline threads are zero.

Review read-only. Preserve reviewer identities and the existing credential chain. Do not update the branch, synthesize author approval, or bypass protection.

@coderabbitai

coderabbitai Bot commented Aug 8, 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='782'
expected_head='471c6491ff3383be2e4ec778272df8d9dbf16260'
expected_base='6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba'

echo '== Live pull request identity =='
pr_json="$(gh api "repos/${repo}/pulls/${pr}")"
printf '%s\n' "$pr_json" | jq '{
  number, state, draft,
  head_sha: .head.sha, head_ref: .head.ref,
  base_sha: .base.sha, base_ref: .base.ref,
  mergeable, mergeable_state
}'
head_sha="$(printf '%s\n' "$pr_json" | jq -r '.head.sha')"
base_sha="$(printf '%s\n' "$pr_json" | jq -r '.base.sha')"
printf 'expected_head=%s\nlive_head=%s\nexpected_base=%s\nlive_base=%s\n' \
  "$expected_head" "$head_sha" "$expected_base" "$base_sha"

if [ "$head_sha" != "$expected_head" ] || [ "$base_sha" != "$expected_base" ]; then
  echo 'STOP: live pull request identity differs from the requested review identity.'
  exit 0
fi

echo '== Commit, changed paths, and whitespace =='
git show -s --format='head=%H%nparents=%P%nsubject=%s' "$head_sha"
git diff --check "$base_sha" "$head_sha"
git diff --stat "$base_sha" "$head_sha"
git diff --name-status "$base_sha" "$head_sha"

echo '== Exact-head check runs that are nonterminal or unsuccessful =='
gh api "repos/${repo}/commits/${head_sha}/check-runs?per_page=100" --paginate \
  --jq '.check_runs[]
    | select(.status != "completed" or
      (.conclusion != "success" and .conclusion != "neutral" and .conclusion != "skipped"))
    | [.name, .status, (.conclusion // "null"), .app.slug, .details_url] | `@tsv`' \
  | sort || true

echo '== Exact-head actions runs =='
gh api "repos/${repo}/actions/runs?head_sha=${head_sha}&per_page=100" --paginate \
  --jq '.workflow_runs[]
    | [.id, .name, .status, (.conclusion // "null"), .event, .html_url] | `@tsv`' \
  | sort -n

echo '== Unresolved review threads =='
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
          comments(first:1) { nodes { author { login } path originalLine } }
        }
      }
    }
  }
}' \
  --jq '
    [.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false)] as $items |
    "unresolved_count=\($items|length)",
    ($items[] | [.comments.nodes[0].author.login, (.comments.nodes[0].path // ""), (.comments.nodes[0].originalLine|tostring)] | `@tsv`)
  '

echo '== Candidate source maps =='
for f in \
  scripts/ci/pr_review_fix_scheduler.py \
  scripts/ci/pr_review_autofix_context.py \
  scripts/ci/collect_failed_check_evidence.sh \
  .github/workflows/pr-review-autofix.yml \
  .github/workflows/pr-review-fix-scheduler.yml \
  .github/workflows/hourly-nvidia-nim-review-repair.yml \
  docs/automation/hourly-review-repair.md \
  CHANGELOG.md
do
  if [ -f "$f" ]; then
    echo "--- $f"
    nl -ba "$f"
  fi
done

echo '== Changed test and script candidates =='
fd -HI -t f . tests scripts 2>/dev/null \
  | grep -E '(pr_review_fix_scheduler|pr_review_autofix_context|failed_check|hourly.*repair|strix)' \
  | sort

echo '== Security-sensitive and RCA flow references =='
git grep -n -I -E \
  'needs_rca_repair|repair_mode|failed-check-evidence|collect_failed_check_evidence|\
MUTATION_CREDENTIAL_AVAILABLE|NVIDIA_NIM_API_KEY|COPILOT_GITHUB_TOKEN|\
GITHUB_TOKEN|GH_TOKEN|ACTIONS_ID_TOKEN_REQUEST_(TOKEN|URL)|\
repository_dispatch|workflow_(repository|sha|ref|file_path)|\
gh pr (merge|review)|gh release|branches/.+protection' \
  "$head_sha" -- .github/workflows scripts/ci tests docs CHANGELOG.md || true

echo '== Independent reviewer workflow identity =='
printf 'base_blob='
git rev-parse "${base_sha}:.github/workflows/opencode-review-dispatch.yml"
printf 'head_blob='
git rev-parse "${head_sha}:.github/workflows/opencode-review-dispatch.yml"
if git diff --no-ext-diff --quiet "$base_sha" "$head_sha" -- \
  .github/workflows/opencode-review-dispatch.yml; then
  echo 'reviewer_workflow_diff=none'
else
  echo 'reviewer_workflow_diff=present'
fi

Length of output: 4888


@seonghobae I could not complete the requested exact-head review.

The live head changed before inspection completed:

  • Requested head: 471c6491ff3383be2e4ec778272df8d9dbf16260
  • Live head: 9d2a82ae184a18c32339def16ea4097681108482
  • Base: 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba

The PR remains Draft and open. GitHub reports mergeable: true and mergeable_state: blocked.

Please request a new review for the live head. I did not modify, approve, merge, release, or change protection.

You are interacting with an AI system.

Comment thread CHANGELOG.md

- Added an APA 7 doctoring record for conflict-control evidence isolation, including the Strix-reported trust-boundary failure, test-first remediation, canonical-path rule, operator contract, rollback, MITRE CWE-22, and current GitHub Actions secure-use guidance.
- Added operator and APA 7 doctoring records for the hourly cadence, immutable source identity, NVIDIA NIM provider and secret boundary, high-reasoning Mistral Small 4 writer, model-process credential isolation, modular MSA ownership, product-specific caller activation, verification contract, and rollback.
- Added the DiskSage caller doctoring record covering the unbounded-loop RCA, remediation-feasibility gate, non-cancelling single-flight policy, two-hour retry rationale, explicit credential boundary, standalone/MSA compatibility, verification contract, rollback, and APA 7th primary references.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants