Skip to content

fix(coverage): restore LLVM 19 tools on current main - #794

Closed
seonghobae wants to merge 29 commits into
mainfrom
fix/opencode-llvm-coverage-current-main
Closed

fix(coverage): restore LLVM 19 tools on current main#794
seonghobae wants to merge 29 commits into
mainfrom
fix/opencode-llvm-coverage-current-main

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Purpose

Restore the protected-current-main OpenCode Rust coverage toolchain after DiskSage PR #133 exact head b7f980d265713d5ffb84f744ce454589e3d410ea exposed the central failure failed to find llvm-tools-preview in run 31037491215, job 92413313900.

Test-first history

  • RED c8bbf698f46d6ac8ffc75e341b756feb4a1b882e: adds a permanent ordering contract requiring LLVM 19, both explicit tool paths, and executable validation before cargo-llvm-cov installation.
  • GREEN 3994d313d0fa71f17bd12c4f522bbc65a2d55f11: restores the trusted toolchain configuration and records doctoring/changelog evidence.
  • Security RED 748bc5d5d733ddea93b592bd4091ea5a8005d55c: requires all three low-privilege coverage wrappers to disable ambient system/global Git configuration before applying the bounded safe-directory overlay.
  • Security GREEN 5cf306ed278ebf11eb45317359d5992567214e0e: restores the six Git-isolation lines, preserves the LLVM 19 configuration, updates doctoring and CHANGELOG, and removes the temporary exact-head repair workflow from the final diff.
  • Exact-head evidence RED fca5600b6b51621c684a151f49b2fb30cdde46b0: requires a durable repository-owned workflow that executes the focused contracts at the literal pull-request head without package installation.
  • Exact-head evidence GREEN b2073dfbf3b35ab6443cc29065f765589d3ba39a: adds the credential-free, dependency-free focused quality job and updates authoritative doctoring and changelog evidence.
  • Full-suite RED 1635420cc696fda693daa70b8c033d14195d14e2: requires a separate exact-head, hash-locked full repository test, branch-coverage, docstring, and compilation gate.
  • Full-suite GREEN 7f12a15505c4754d1feeb33fd0148cebe6a689ba: adds the dependent approved-environment full-suite job and aligns the doctoring and changelog claims with its implemented scope.
  • Contract correction 6bd29ccd394a94b6018cb0985d0febee186124bf: makes the --require-hashes -r requirements-opencode-review-ci-hashes.txt command explicit as one audited source line so the permanent contract and executed command are identical.

Current exact-head scope

Current head: 6bd29ccd394a94b6018cb0985d0febee186124bf

The final diff is limited to:

  • .github/workflows/opencode-review-dispatch.yml
  • .github/workflows/opencode-coverage-toolchain-quality-ci.yml
  • tests/test_opencode_llvm_coverage_current_main.py
  • docs/doctoring/opencode-llvm-coverage-toolchain.md
  • CHANGELOG.md

Fresh repository CI, security, review, and approval evidence for this exact head remains required; older-head results are not reused.

Security and compatibility boundary

  • Installs Debian Trixie llvm-19 in the trusted coverage image.
  • Binds LLVM_COV=/usr/bin/llvm-cov-19 and LLVM_PROFDATA=/usr/bin/llvm-profdata-19 and verifies both executables before cargo-llvm-cov use.
  • Keeps the coverage path fail-closed when toolchain evidence is absent or incompatible.
  • Disables ambient system and global Git configuration in all three low-privilege coverage wrappers before applying only the bounded /work safe-directory overlay.
  • Keeps a dependency-free fast contract job that checks out github.event.pull_request.head.sha, refuses stale or generated merge-tree evidence, preserves no checkout credentials, discovers every focused contract test, compiles the test module, and refuses worktree mutation.
  • Adds a dependent full repository job that revalidates the same exact head, installs only requirements-opencode-review-ci-hashes.txt with --require-hashes, runs all tests under the configured 100% branch-coverage gate, enforces 100% production docstrings, and compiles all production CI modules and tests.
  • Keeps pull-request source, credentials, durable authorization, and trusted workflow source separated.

Current exact-head evidence

  • OpenCode Coverage Toolchain Quality run 31072730539: focused job passed; full repository test, 100% branch-coverage, docstring, and compilation job passed.
  • The CodeRabbit full-suite finding was addressed and resolved only after that exact-head evidence passed.
  • All additional exact-head security and review runs must still finish successfully before this draft can become ready.

Merge gate

Keep Draft until the final diff is verified against current protected main, every current-head CI/security/review gate passes, no actionable thread remains, and a qualifying independent non-author approval and branch protection permit merge without bypass. After merge, start a fresh DiskSage #133 OpenCode review on its unchanged exact current head; do not reuse the failed predecessor run or any older-head evidence.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 21 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4eef0fa4-6b41-4cbd-a217-5cd3ea78f12c

📥 Commits

Reviewing files that changed from the base of the PR and between b2073df and 6bd29cc.

📒 Files selected for processing (4)
  • .github/workflows/opencode-coverage-toolchain-quality-ci.yml
  • CHANGELOG.md
  • docs/doctoring/opencode-llvm-coverage-toolchain.md
  • tests/test_opencode_llvm_coverage_current_main.py
📝 Walkthrough

Walkthrough

OpenCode 커버리지 이미지에 LLVM 19 도구와 명시적 경로를 추가했습니다. 정확한 PR head와 격리된 Git 설정을 검증하는 읽기 전용 품질 워크플로와 회귀 테스트, 관련 문서를 추가했습니다.

Changes

OpenCode 커버리지 품질 계약

Layer / File(s) Summary
LLVM 19 툴체인 계약
.github/workflows/opencode-review-dispatch.yml, tests/test_opencode_llvm_coverage_current_main.py, docs/doctoring/opencode-llvm-coverage-toolchain.md, CHANGELOG.md
커버리지 이미지에 llvm-19를 설치하고 LLVM_COV, LLVM_PROFDATA를 고정된 실행 파일로 설정합니다. 이미지 빌드 전 실행 가능 여부를 검증합니다.
정확한 PR head 품질 검증
.github/workflows/opencode-coverage-toolchain-quality-ci.yml, tests/test_opencode_llvm_coverage_current_main.py, CHANGELOG.md
PR head SHA 체크아웃, 자격 증명 미저장, Git 설정 격리, 오프라인 계약 테스트 실행, 컴파일 및 작업 트리 검사를 추가합니다.

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

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 제목은 현재 main에서 LLVM 19 도구를 복구하는 핵심 변경을 정확하고 간결하게 설명합니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/opencode-llvm-coverage-current-main

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

Copy link
Copy Markdown
Contributor Author

Current-head scope review found an unrelated security regression in the final diff. The PR says it is limited to restoring the four LLVM-toolchain lines, its contract test, doctoring, and changelog, but .github/workflows/opencode-review-dispatch.yml also removes GIT_CONFIG_NOSYSTEM=1 and GIT_CONFIG_GLOBAL=/dev/null from three privileged container invocations. Restore all six Git-configuration-isolation lines before marking Ready. Add a permanent regression proving every affected invocation retains both variables, preserve the LLVM 19 fix, rerun exact-head quality/security checks, and keep this PR Draft until the repaired head is reviewed.

Copy link
Copy Markdown
Contributor Author

@opencode-agent address

Address only the verified scope regression above: restore GIT_CONFIG_NOSYSTEM=1 and GIT_CONFIG_GLOBAL=/dev/null in all three affected invocations, add the ordering/presence regression beside the LLVM contract, preserve the LLVM 19 changes, and run the exact-head focused and security gates. Do not alter reviewer credentials, model routing, workflow permissions, or unrelated files.

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

Current-head review found one valid security regression that must be fixed before this draft can become ready.

The LLVM 19 repair is directionally correct, but the same workflow diff removes GIT_CONFIG_NOSYSTEM=1 and GIT_CONFIG_GLOBAL=/dev/null from all three low-privilege coverage execution wrappers (run_and_capture, run_r_package_testthat, and run_and_capture_advisory). Protected base f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae includes both variables in each wrapper. Their removal re-enables ambient system/global Git configuration inside PR-controlled test processes and is unrelated to the LLVM toolchain fix.

Please repair test-first on the exact current branch:

  1. Add a permanent contract test that enumerates the three sandbox wrappers and requires both Git-isolation variables before GIT_CONFIG_COUNT=1.
  2. Restore both variables in all three wrappers without changing the LLVM 19 additions.
  3. Re-run the exact-head quality/security workflows and keep the PR in draft until all current-head reviews and independent approval are satisfied.

Do not resolve this finding using coverage exclusions, weaker checks, or by removing the safe-directory-only Git configuration.

Copy link
Copy Markdown
Contributor Author

@opencode-agent address

Re-evaluate exact current head 8323b7855dae96c8613f4f192b907f5c05bf6553. Fix only the verified security regression already covered by the failing contract: restore GIT_CONFIG_NOSYSTEM=1 and GIT_CONFIG_GLOBAL=/dev/null before GIT_CONFIG_COUNT=1 in run_and_capture, run_r_package_testthat, and run_and_capture_advisory; preserve the LLVM 19 package/tool bindings; update the existing doctoring and CHANGELOG wording to record preserved ambient-Git isolation; run the focused exact-head contract and repository security/quality gates; and do not add any branch-writer, one-shot repair workflow, credential change, permission expansion, model-routing change, or unrelated file modification.

@seonghobae
seonghobae marked this pull request as ready for review August 6, 2026 04:42
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='6bd29ccd394a94b6018cb0985d0febee186124bf'
base='f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae'

echo '== Checked-out commit =='
git rev-parse HEAD
git show -s --format='commit=%H%nparents=%P%nsubject=%s' HEAD

echo '== Exact base-to-head changed files =='
git diff --name-status "$base" "$head"
echo '== Diff stat =='
git diff --stat "$base" "$head"

echo '== Relevant file outlines =='
ast-grep outline .github/workflows/opencode-review-dispatch.yml --items all || true
ast-grep outline tests/test_opencode_llvm_coverage_current_main.py --items all || true

echo '== LLVM / Git isolation / coverage invocation contexts =='
rg -n -C 12 -e 'llvm-19|LLVM_COV|LLVM_PROFDATA|cargo-llvm-cov|run_and_capture|run_r_package_testthat|run_and_capture_advisory|GIT_CONFIG_(NOSYSTEM|GLOBAL|COUNT|KEY_|VALUE_)' .github/workflows/opencode-review-dispatch.yml

echo '== Quality workflow =='
cat -n .github/workflows/opencode-coverage-toolchain-quality-ci.yml

echo '== Contract tests =='
cat -n tests/test_opencode_llvm_coverage_current_main.py

echo '== Documentation and changelog diff =='
git diff --no-ext-diff --unified=80 "$base" "$head" -- CHANGELOG.md docs/doctoring/opencode-llvm-coverage-toolchain.md

echo '== PR metadata, commits, and checks =='
gh pr view 794 --repo ContextualWisdomLab/.github \
  --json number,state,isDraft,headRefOid,baseRefOid,changedFiles,mergeable,reviewDecision,statusCheckRollup,reviews \
  --jq '{number,state,isDraft,headRefOid,baseRefOid,changedFiles,mergeable,reviewDecision,checks:[.statusCheckRollup[]|{name,conclusion,status,detailsUrl}],reviews:[.reviews[]|{author:.author.login,state,commit:.commit.oid}]}'

echo '== Open review threads =='
gh api graphql -F owner='ContextualWisdomLab' -F name='.github' -F number=794 -f query='
query($owner: String!, $name: String!, $number: Int!) {
  repository(owner: $owner, name: $name) {
    pullRequest(number: $number) {
      reviewThreads(first: 100) {
        nodes {
          isResolved
          isOutdated
          comments(first: 1) { nodes { author { login } body path line originalLine } }
        }
      }
    }
  }
}' --jq '.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false) | {isOutdated,comment:.comments.nodes[0]}'

Length of output: 81757


@seonghobae Formal review complete for exact head 6bd29ccd394a94b6018cb0985d0febee186124bf against f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae.

I found no blocking issue.

Verified items:

  • The final diff contains five files.
  • The coverage image installs llvm-19.
  • LLVM_COV and LLVM_PROFDATA bind to the versioned LLVM 19 executables.
  • The image validates both executables before it installs cargo-llvm-cov.
  • Rust coverage remains fail-closed when the required toolchain is unavailable.
  • run_and_capture, run_r_package_testthat, and run_and_capture_advisory each disable system and global Git configuration before the bounded /work safe-directory overlay.
  • The permanent contract verifies the required Git-isolation presence, uniqueness, and ordering.
  • The new quality workflow uses exact PR-head checkout, persist-credentials: false, read-only permissions, SHA-pinned actions, and stale/merge-tree refusal.
  • The focused job is dependency-free. The dependent full-repository job uses hash-locked tooling and runs test, coverage, docstring, and compilation gates.
  • Current-head quality and security checks are successful.
  • No unresolved review thread was returned.

This is a review verdict only. I did not approve the PR. GitHub still reports that an independent qualifying approval is required.

⚠️ 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

Exact-head review request for 6bd29ccd394a94b6018cb0985d0febee186124bf after all direct CI, security, supply-chain, 100% repository coverage/docstring, and inline-thread gates passed. Please inspect only this head against protected main; predecessor, status-only, skipped, queued, cancelled, or rate-limited evidence does not transfer.

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

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='6bd29ccd394a94b6018cb0985d0febee186124bf'
base='f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae'
repo='ContextualWisdomLab/.github'

echo '== Exact checked-out commit =='
git rev-parse HEAD
git show -s --format='commit=%H%nparents=%P%nsubject=%s' HEAD
test "$(git rev-parse HEAD)" = "$head"

echo '== Exact base-to-head files and stat =='
git diff --name-status "$base" "$head"
git diff --stat "$base" "$head"

echo '== Complete exact diff =='
git diff --no-ext-diff --check "$base" "$head"
git diff --no-ext-diff --unified=30 "$base" "$head" -- \
  .github/workflows/opencode-review-dispatch.yml \
  .github/workflows/opencode-coverage-toolchain-quality-ci.yml \
  tests/test_opencode_llvm_coverage_current_main.py \
  docs/doctoring/opencode-llvm-coverage-toolchain.md \
  CHANGELOG.md

echo '== Workflow and test structure =='
ast-grep outline .github/workflows/opencode-review-dispatch.yml --items all || true
ast-grep outline .github/workflows/opencode-coverage-toolchain-quality-ci.yml --items all || true
ast-grep outline tests/test_opencode_llvm_coverage_current_main.py --items all || true

echo '== LLVM and Git-isolation contexts =='
rg -n -C 14 \
  -e 'llvm-19|LLVM_COV|LLVM_PROFDATA|cargo-llvm-cov' \
  -e 'run_and_capture|run_r_package_testthat|run_and_capture_advisory' \
  -e 'GIT_CONFIG_(NOSYSTEM|GLOBAL|COUNT|KEY_|VALUE_)' \
  .github/workflows/opencode-review-dispatch.yml

echo '== Quality workflow =='
cat -n .github/workflows/opencode-coverage-toolchain-quality-ci.yml

echo '== Contract tests =='
cat -n tests/test_opencode_llvm_coverage_current_main.py

echo '== Pull request metadata and checks =='
gh pr view 794 --repo "$repo" \
  --json number,state,isDraft,headRefOid,baseRefOid,changedFiles,mergeable,reviewDecision,statusCheckRollup \
  --jq '{number,state,isDraft,headRefOid,baseRefOid,changedFiles,mergeable,reviewDecision,checks:[.statusCheckRollup[]|{name,conclusion,status,workflowName,detailsUrl}]}'

echo '== Unresolved review threads =='
gh api graphql -F owner='ContextualWisdomLab' -F name='.github' -F number=794 -f query='
query($owner: String!, $name: String!, $number: Int!) {
  repository(owner: $owner, name: $name) {
    pullRequest(number: $number) {
      reviewThreads(first: 100) {
        nodes {
          isResolved
          isOutdated
          comments(first: 1) {
            nodes { author { login } body path line originalLine }
          }
        }
      }
    }
  }
}' --jq '.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false) | {isOutdated,comment:.comments.nodes[0]}'

Length of output: 103163


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo='ContextualWisdomLab/.github'
head='6bd29ccd394a94b6018cb0985d0febee186124bf'

echo '== Direct exact-head workflow evidence =='
for run_id in \
  31073129139 \
  31073129046 \
  31073129110 \
  31073129051 \
  31073129121 \
  31073129432 \
  31073129097 \
  31073129034 \
  31073129330
do
  gh run view "$run_id" --repo "$repo" \
    --json databaseId,workflowName,event,status,conclusion,headSha,headBranch,jobs \
    --jq '{databaseId,workflowName,event,status,conclusion,headSha,headBranch,jobs:[.jobs[]|{name,status,conclusion}]}'
done

echo '== Enforce exact head and successful required quality jobs =='
quality="$(gh run view 31073129139 --repo "$repo" --json headSha,conclusion,jobs)"
jq -e --arg head "$head" '
  .headSha == $head
  and .conclusion == "success"
  and ([.jobs[] | select(
    (.name == "Exact-head toolchain contract" or .name == "Full repository test, coverage, and docstring gate")
    and .conclusion == "success"
  )] | length == 2)
' <<<"$quality"

echo '== Enforce exact head and successful direct security runs =='
for run_id in 31073129046 31073129110 31073129051 31073129121 31073129432 31073129097 31073129034 31073129330; do
  gh run view "$run_id" --repo "$repo" --json headSha,conclusion \
    --jq --arg head "$head" '.headSha == $head and .conclusion == "success"'
done

Length of output: 6074


@seonghobae Formal review complete for exact head 6bd29ccd394a94b6018cb0985d0febee186124bf against protected main base f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae.

I found no blocking issue.

Verified items:

  • The exact diff contains five files. It has no whitespace errors.
  • The coverage image installs llvm-19.
  • LLVM_COV and LLVM_PROFDATA bind to the versioned LLVM 19 executables.
  • The image validates both executables before it installs cargo-llvm-cov.
  • The Rust coverage path remains fail-closed when the required toolchain is unavailable.
  • run_and_capture, run_r_package_testthat, and run_and_capture_advisory each set GIT_CONFIG_NOSYSTEM=1 and GIT_CONFIG_GLOBAL=/dev/null before GIT_CONFIG_COUNT=1.
  • The permanent contract checks presence, uniqueness, and ordering of the Git-isolation assignments.
  • The quality workflow uses the exact pull-request head SHA, disables checkout credentials, uses read-only repository permissions, and rejects stale or merge-tree evidence.
  • The focused job has no package-install step. The dependent job uses hash-locked requirements and runs the complete test, coverage, docstring, and compilation gates.
  • Direct workflow metadata identifies 6bd29ccd394a94b6018cb0985d0febee186124bf for the quality, CodeQL, Python Security, Semgrep, Secret Scan, OSV, Scorecard, SBOM, and Strix runs. Each selected run completed successfully.
  • No unresolved review thread was returned.

This is a review verdict only. I did not approve, merge, update, or otherwise modify the pull request. The pull request still requires any repository-mandated independent approval and branch-protection checks.

⚠️ 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 review

Perform an independent formal review of exact current head 6bd29ccd394a94b6018cb0985d0febee186124bf against protected main f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae. Recompute current-head test, branch-coverage, docstring, workflow, and security evidence; verify the Debian LLVM 19 installation, explicit LLVM_COV=/usr/bin/llvm-cov-19 and LLVM_PROFDATA=/usr/bin/llvm-profdata-19 bindings, executable validation before cargo-llvm-cov, all three low-privilege Git-configuration isolation boundaries, and the credential-free exact-head quality workflow with the dependent hash-locked full suite. Do not reuse predecessor-head verdicts. Submit a formal exact-head verdict only; do not modify reviewer credentials, workflow permissions, model routing, or unrelated files.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Review exact current head 6bd29ccd394a94b6018cb0985d0febee186124bf only. Recheck the five-file final diff after the full-suite contract correction, including LLVM 19 tool bindings, fail-closed executable validation, all three ambient-Git isolation boundaries, exact-head credential-free checkout, hash-locked full repository tests, 100% configured branch coverage, docstrings, and compilation. Do not reuse older-head findings.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo='ContextualWisdomLab/.github'
head='6bd29ccd394a94b6018cb0985d0febee186124bf'
base='f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae'

echo '== exact checkout =='
git rev-parse HEAD
test "$(git rev-parse HEAD)" = "$head"
git show -s --format='commit=%H%nparents=%P%nsubject=%s' "$head"

echo '== exact changed files and whitespace =='
git diff --name-status "$base" "$head"
git diff --check "$base" "$head"

echo '== complete scoped diff =='
git diff --no-ext-diff --unified=50 "$base" "$head" -- \
  .github/workflows/opencode-review-dispatch.yml \
  .github/workflows/opencode-coverage-toolchain-quality-ci.yml \
  tests/test_opencode_llvm_coverage_current_main.py \
  docs/doctoring/opencode-llvm-coverage-toolchain.md \
  CHANGELOG.md

echo '== workflow and contract outlines =='
ast-grep outline .github/workflows/opencode-review-dispatch.yml --items all || true
ast-grep outline .github/workflows/opencode-coverage-toolchain-quality-ci.yml --items all || true
ast-grep outline tests/test_opencode_llvm_coverage_current_main.py --items all || true

echo '== LLVM and Git-isolation contexts =='
rg -n -C 16 \
  -e 'llvm-19|LLVM_COV|LLVM_PROFDATA|cargo-llvm-cov' \
  -e 'run_and_capture|run_r_package_testthat|run_and_capture_advisory' \
  -e 'GIT_CONFIG_(NOSYSTEM|GLOBAL|COUNT|KEY_|VALUE_)' \
  .github/workflows/opencode-review-dispatch.yml

echo '== quality workflow =='
cat -n .github/workflows/opencode-coverage-toolchain-quality-ci.yml

echo '== contract test =='
cat -n tests/test_opencode_llvm_coverage_current_main.py

echo '== PR metadata, checks, and threads =='
gh pr view 794 --repo "$repo" \
  --json state,isDraft,headRefOid,baseRefOid,changedFiles,mergeable,reviewDecision,statusCheckRollup \
  --jq '{state,isDraft,headRefOid,baseRefOid,changedFiles,mergeable,reviewDecision,checks:[.statusCheckRollup[]|{name,conclusion,status,workflowName,detailsUrl}]}'

gh api graphql -F owner='ContextualWisdomLab' -F name='.github' -F number=794 -f query='
query($owner: String!, $name: String!, $number: Int!) {
  repository(owner: $owner, name: $name) {
    pullRequest(number: $number) {
      reviewThreads(first: 100) {
        nodes {
          isResolved
          isOutdated
          comments(first: 1) { nodes { author { login } body path line originalLine } }
        }
      }
    }
  }
}' --jq '.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false) | {isOutdated,comment:.comments.nodes[0]}'

echo '== successful exact-head quality and security workflow runs =='
gh run list --repo "$repo" --commit "$head" --limit 100 \
  --json databaseId,workflowName,status,conclusion,headSha,event \
  --jq '.[] | {databaseId,workflowName,status,conclusion,headSha,event}'

Length of output: 116339


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo='ContextualWisdomLab/.github'
head='6bd29ccd394a94b6018cb0985d0febee186124bf'

echo '== locate quality configuration and hash lock =='
fd -a '^(pyproject\.toml|requirements-opencode-review-ci-hashes\.txt)$' .

echo '== coverage and pytest configuration =='
rg -n -C 12 \
  -e '^\[tool\.(coverage|pytest)' \
  -e 'branch\s*=|fail_under|addopts|--cov' \
  pyproject.toml

echo '== hash-lock validation =='
awk '
  /^[[:space:]]*`#/` || /^[[:space:]]*$/ { next }
  { requirements += 1; if ($0 ~ /--hash=sha256:/) hashed += 1 }
  END {
    printf("requirements=%d hashed_lines=%d\n", requirements, hashed)
    exit !(requirements > 0 && hashed == requirements)
  }
' requirements-opencode-review-ci-hashes.txt
sed -n '1,120p' requirements-opencode-review-ci-hashes.txt

echo '== exact-head quality job conclusions =='
gh run view 31073129139 --repo "$repo" \
  --json headSha,status,conclusion,event,jobs \
  --jq --arg head "$head" '
    .headSha == $head
    and .status == "completed"
    and .conclusion == "success"
    and ([.jobs[] | select(
      (.name == "Exact-head toolchain contract" or .name == "Full repository test, coverage, and docstring gate")
      and .status == "completed"
      and .conclusion == "success"
    )] | length == 2)
  '

gh run view 31073129139 --repo "$repo" \
  --json headSha,status,conclusion,event,jobs \
  --jq '{headSha,status,conclusion,event,jobs:[.jobs[]|{name,status,conclusion}]}'

Length of output: 2539


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo='ContextualWisdomLab/.github'
head='6bd29ccd394a94b6018cb0985d0febee186124bf'

echo '== hash-lock sample and logical-block validation =='
sed -n '1,100p' requirements-opencode-review-ci-hashes.txt

python3 - <<'PY'
from pathlib import Path

path = Path("requirements-opencode-review-ci-hashes.txt")
blocks: list[str] = []
current = ""
for raw in path.read_text(encoding="utf-8").splitlines():
    line = raw.strip()
    if not line or line.startswith("#"):
        continue
    current = f"{current} {line}".strip()
    if not line.endswith("\\"):
        blocks.append(current)
        current = ""
if current:
    raise SystemExit("unterminated requirement continuation")

missing_hashes = [
    block for block in blocks
    if not block.startswith(("-", "--")) and "--hash=sha256:" not in block
]
print(f"logical_requirement_blocks={len(blocks)}")
print(f"blocks_missing_sha256_hashes={len(missing_hashes)}")
for block in missing_hashes:
    print(block)
if not blocks or missing_hashes:
    raise SystemExit(1)
PY

echo '== exact-head quality workflow run =='
gh run view 31073129139 --repo "$repo" \
  --json headSha,status,conclusion,event,jobs \
  --jq '{headSha,status,conclusion,event,jobs:[.jobs[]|{name,status,conclusion}]}'

gh run view 31073129139 --repo "$repo" \
  --json headSha,status,conclusion,jobs \
  --jq --arg head "$head" '
    .headSha == $head
    and .status == "completed"
    and .conclusion == "success"
    and ([.jobs[] | select(
      (.name == "Exact-head toolchain contract" or .name == "Full repository test, coverage, and docstring gate")
      and .status == "completed"
      and .conclusion == "success"
    )] | length == 2)
  '

Length of output: 10500


@seonghobae: Formal review complete for exact head 6bd29ccd394a94b6018cb0985d0febee186124bf against base f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae.

I found no blocking issue.

Verified items:

  • The final diff contains five files and has no whitespace errors.
  • The coverage image installs llvm-19.
  • LLVM_COV and LLVM_PROFDATA use /usr/bin/llvm-cov-19 and /usr/bin/llvm-profdata-19.
  • The image validates both executables before it downloads and installs cargo-llvm-cov.
  • The Rust coverage path remains fail-closed if required coverage tooling is unavailable.
  • run_and_capture, run_r_package_testthat, and run_and_capture_advisory each set GIT_CONFIG_NOSYSTEM=1 and GIT_CONFIG_GLOBAL=/dev/null before GIT_CONFIG_COUNT=1 and the bounded /work safe-directory overlay.
  • The permanent contract checks the required LLVM ordering and Git-isolation ordering and uniqueness.
  • Both quality jobs check out github.event.pull_request.head.sha, use persist-credentials: false, and reject stale or merge-tree evidence.
  • The focused contract job installs no packages.
  • The dependent full-repository job uses --require-hashes. All 16 logical requirements blocks contain SHA-256 hashes.
  • pyproject.toml configures branch coverage and fail_under = 100. The workflow runs tests, coverage reporting, 100% production docstrings, and compilation.
  • Exact-head run 31073129139 completed successfully. Both quality jobs completed successfully for this head.
  • No unresolved review thread was returned.

This is a review verdict only. I did not approve, merge, update, or modify the pull request. GitHub currently reports that review is still required.

⚠️ 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

Closing as superseded by the dependency-ordered repair in #759. This exact head (6bd29ccd394a94b6018cb0985d0febee186124bf) is green for its own five-file quality slice, and its resolved CodeRabbit finding remains addressed, but its production workflow change provisions and verifies LLVM only at image-build time. The permanent RED contract now anchored in #759 additionally requires explicit LLVM path propagation into the isolated runtime and a second fail-closed executable check before the first cargo llvm-cov invocation. Keeping both PRs open would create competing central-control-plane implementations and duplicate branch writers. No approval or check evidence from this PR transfers to #759; #759 must implement and re-earn all exact-head gates independently.

@seonghobae seonghobae closed this Aug 6, 2026
auto-merge was automatically disabled August 6, 2026 14:37

Pull request was closed

Copy link
Copy Markdown
Contributor Author

Reopening because protected main remains at workflow source f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae without the verified LLVM 19 coverage repair, and DiskSage #137 exact head 9ceb01be3c96f04bf7400e8d50a3c3ba0902ee51 reproduced the same central coverage-evidence failure in run 31112258152. The current PR head remains 6bd29ccd394a94b6018cb0985d0febee186124bf; no predecessor-head evidence is being substituted. Re-run exact-head CI/security/review gates after reopening, then merge only with qualifying independent non-author approval and branch protection.

@seonghobae seonghobae reopened this Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

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

Recompute formal review evidence for exact reopened head 6bd29ccd394a94b6018cb0985d0febee186124bf against protected base f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae. Do not reuse predecessor-head or pre-reopen verdicts. Verify LLVM 19 provisioning and explicit LLVM_COV/LLVM_PROFDATA bindings, pre-install executable validation, all three low-privilege Git-configuration isolation boundaries, exact-head checkout, hash-locked full repository tests, 100% branch coverage and production docstrings, compilation, immutable action pins, and zero unresolved valid findings. Submit only a current-head formal verdict; independent non-author approval and branch protection remain mandatory.

@coderabbitai

coderabbitai Bot commented Aug 6, 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='6bd29ccd394a94b6018cb0985d0febee186124bf'
base='f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae'

echo '== Exact checkout and commit identity =='
git rev-parse HEAD
test "$(git rev-parse HEAD)" = "$head"
git show -s --format='commit=%H%nparents=%P%nsubject=%s' "$head"

echo '== Exact base-to-head scope and whitespace =='
git diff --name-status "$base" "$head"
git diff --stat "$base" "$head"
git diff --check "$base" "$head"

echo '== Complete reviewed diff =='
git diff --no-ext-diff --unified=35 "$base" "$head" -- \
  .github/workflows/opencode-review-dispatch.yml \
  .github/workflows/opencode-coverage-toolchain-quality-ci.yml \
  tests/test_opencode_llvm_coverage_current_main.py \
  docs/doctoring/opencode-llvm-coverage-toolchain.md \
  CHANGELOG.md

echo '== Workflow and test outlines =='
ast-grep outline .github/workflows/opencode-review-dispatch.yml --items all || true
ast-grep outline .github/workflows/opencode-coverage-toolchain-quality-ci.yml --items all || true
ast-grep outline tests/test_opencode_llvm_coverage_current_main.py --items all || true

echo '== LLVM provisioning and Git-isolation contexts =='
rg -n -C 18 \
  -e 'llvm-19|LLVM_COV|LLVM_PROFDATA|cargo-llvm-cov' \
  -e 'run_and_capture|run_r_package_testthat|run_and_capture_advisory' \
  -e 'GIT_CONFIG_(NOSYSTEM|GLOBAL|COUNT|KEY_|VALUE_)' \
  .github/workflows/opencode-review-dispatch.yml

echo '== Exact-head quality workflow =='
cat -n .github/workflows/opencode-coverage-toolchain-quality-ci.yml

echo '== Permanent contract tests =='
cat -n tests/test_opencode_llvm_coverage_current_main.py

echo '== Coverage, docstring, and hash-lock configuration =='
fd -a '^(pyproject\.toml|requirements-opencode-review-ci-hashes\.txt)$' .
rg -n -C 10 -e '^\[tool\.(coverage|pytest)' -e 'branch\s*=|fail_under|addopts|--cov' pyproject.toml
python3 - <<'PY'
from pathlib import Path
p = Path("requirements-opencode-review-ci-hashes.txt")
blocks, current = [], ""
for raw in p.read_text(encoding="utf-8").splitlines():
    line = raw.strip()
    if not line or line.startswith("#"):
        continue
    current = f"{current} {line}".strip()
    if not line.endswith("\\"):
        blocks.append(current)
        current = ""
if current:
    raise SystemExit("unterminated requirement continuation")
missing = [b for b in blocks if not b.startswith(("-", "--")) and "--hash=sha256:" not in b]
print(f"logical_requirement_blocks={len(blocks)}")
print(f"blocks_missing_sha256_hashes={len(missing)}")
if not blocks or missing:
    raise SystemExit(1)
PY

echo '== PR state, exact head, and check rollup =='
gh pr view 794 --repo "$repo" \
  --json state,isDraft,headRefOid,baseRefOid,changedFiles,mergeable,reviewDecision,statusCheckRollup \
  --jq '{state,isDraft,headRefOid,baseRefOid,changedFiles,mergeable,reviewDecision,checks:[.statusCheckRollup[]|{name,workflowName,status,conclusion,detailsUrl}]}'

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

echo '== Unresolved review threads =='
gh api graphql -F owner='ContextualWisdomLab' -F name='.github' -F number=794 -f query='
query($owner: String!, $name: String!, $number: Int!) {
  repository(owner: $owner, name: $name) {
    pullRequest(number: $number) {
      reviewThreads(first: 100) {
        nodes {
          isResolved
          isOutdated
          comments(first: 1) {
            nodes { author { login } body path line originalLine }
          }
        }
      }
    }
  }
}' --jq '.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false) | {isOutdated,comment:.comments.nodes[0]}'

Length of output: 139783


@seonghobae Formal source review is complete for exact head 6bd29ccd394a94b6018cb0985d0febee186124bf against base f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae.

I found no source-level blocking issue.

Verified items:

  • The exact diff changes five files. It has no whitespace errors.
  • The coverage image installs llvm-19.
  • LLVM_COV is /usr/bin/llvm-cov-19.
  • LLVM_PROFDATA is /usr/bin/llvm-profdata-19.
  • The image validates both executables before it installs cargo-llvm-cov.
  • All three low-privilege wrappers disable system and global Git configuration before the single /work safe-directory overlay.
  • The permanent contract verifies LLVM ordering and Git-isolation presence, uniqueness, and ordering.
  • Both quality jobs use exact-head checkout, persist-credentials: false, stale-head refusal, and immutable action SHAs.
  • The first quality job is dependency-free.
  • The dependent full-repository job uses --require-hashes, test execution, configured 100% branch coverage, 100% production docstrings, and compilation.
  • The hash-lock file has 16 logical requirement blocks. Each block has a SHA-256 hash.
  • No unresolved review thread was returned.

I cannot submit a passing current-head CI and security verdict yet. The reopened-head workflow set was still incomplete during this review. The current quality full-suite job, CodeQL, OSV, Semgrep, Security Scan, Python Security, Scorecard, Strix, and Required OpenCode Review runs were queued or in progress.

GitHub also reports REVIEW_REQUIRED. An independent non-author approval and all required completed branch-protection checks remain necessary.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

Superseded by dependency-ordered central PR #759.

The complete exact head of this PR, 6bd29ccd394a94b6018cb0985d0febee186124bf, was integrated as the second parent of #759 commit 894c6597a0abf3bdef47c485cf063a0a900ab25f. All valid production and evidence surfaces were preserved on #759 exact head 3768d410d8184032c48cd3078150d2ec44289bc5, including:

  • .github/workflows/opencode-review-dispatch.yml;
  • .github/workflows/opencode-coverage-toolchain-quality-ci.yml;
  • tests/test_opencode_llvm_coverage_current_main.py;
  • docs/doctoring/opencode-llvm-coverage-toolchain.md; and
  • the corresponding CHANGELOG evidence.

#759 also retains the broader coverage-diagnostics, materializer, security-boundary, and downstream dependency work that must land before contextual-orchestrator #96 and Inkspan #65. It remains Draft pending fresh exact-head CI, security, review, and independent approval. No checks, reviews, or approval from this predecessor head are being transferred.

Closing this PR removes the duplicate merge path and prevents competing branch writers while preserving its valid changes in the authoritative branch.

@seonghobae seonghobae closed this Aug 6, 2026
auto-merge was automatically disabled August 6, 2026 16:18

Pull request was closed

@seonghobae seonghobae reopened this Aug 6, 2026
@seonghobae
seonghobae enabled auto-merge (squash) August 6, 2026 18:04

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #759. Exact head 6bd29ccd394a94b6018cb0985d0febee186124bf is a strict ancestor of #759 exact head 87dda3b20254a334eddcb507ba6c91a74dd8b11c (compare_commits: ahead_by=132, behind_by=0), so every valid change from this PR is already preserved in the active central-control-plane branch. Keeping both PRs open creates a competing merge path and stale evidence surface. Continue the LLVM runtime-boundary repair and exact-head acceptance on #759 only.

@seonghobae seonghobae closed this Aug 6, 2026
auto-merge was automatically disabled August 6, 2026 18:30

Pull request was closed

@seonghobae seonghobae reopened this Aug 6, 2026
@seonghobae
seonghobae enabled auto-merge (squash) August 6, 2026 21:04

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #759. Exact head 6bd29ccd394a94b6018cb0985d0febee186124bf is an ancestor of #759 exact head 87dda3b20254a334eddcb507ba6c91a74dd8b11c (ahead_by=132, behind_by=0, merge base equals #794 head), so #759 already preserves this PR's complete reviewed tree and carries the stricter permanent LLVM isolated-runtime contract plus the remaining central coverage work. Keeping both PRs open creates a duplicate merge/review path. No check, review, or approval from #794 transfers as acceptance evidence for #759's later exact head.

@seonghobae seonghobae closed this Aug 6, 2026
auto-merge was automatically disabled August 6, 2026 22:06

Pull request was closed

Copy link
Copy Markdown
Contributor Author

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

Please re-evaluate the exact live head only. Verify LLVM 19 and explicit tool paths, executable preflight, all three low-privilege Git configuration isolation wrappers, dependency-free exact-head contract, hash-locked full repository suite, 100% branch coverage and public docstrings, compilation, and zero unresolved threads. Review only; do not update the branch, approve through a non-independent identity, merge, release, or alter protections.

@coderabbitai

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

echo '== Live pull request metadata =='
gh pr view 794 --repo "$repo" \
  --json number,state,isDraft,headRefOid,baseRefOid,changedFiles,mergeable,reviewDecision,statusCheckRollup \
  --jq '{number,state,isDraft,headRefOid,baseRefOid,changedFiles,mergeable,reviewDecision,checks:[.statusCheckRollup[]|{name,workflowName,status,conclusion,detailsUrl}]}'

echo '== Checked-out commit =='
git rev-parse HEAD
git show -s --format='commit=%H%nparents=%P%nsubject=%s' HEAD

head="$(gh pr view 794 --repo "$repo" --json headRefOid --jq .headRefOid)"
base="$(gh pr view 794 --repo "$repo" --json baseRefOid --jq .baseRefOid)"
test "$(git rev-parse HEAD)" = "$head"

echo '== Exact base-to-live-head scope =='
git diff --name-status "$base" "$head"
git diff --stat "$base" "$head"
git diff --check "$base" "$head"

echo '== LLVM and Git-isolation contexts =='
rg -n -C 16 \
  -e 'llvm-19|LLVM_COV|LLVM_PROFDATA|cargo-llvm-cov' \
  -e 'run_and_capture|run_r_package_testthat|run_and_capture_advisory' \
  -e 'GIT_CONFIG_(NOSYSTEM|GLOBAL|COUNT|KEY_|VALUE_)' \
  .github/workflows/opencode-review-dispatch.yml || true

echo '== Quality workflow =='
cat -n .github/workflows/opencode-coverage-toolchain-quality-ci.yml 2>/dev/null || true

echo '== Contract test outline and content =='
ast-grep outline tests/test_opencode_llvm_coverage_current_main.py --items all 2>/dev/null || true
cat -n tests/test_opencode_llvm_coverage_current_main.py 2>/dev/null || true

echo '== Quality configuration and lock file =='
fd -a '^(pyproject\.toml|requirements-opencode-review-ci-hashes\.txt)$' .
rg -n -C 10 -e '^\[tool\.(coverage|pytest)' -e 'branch\s*=|fail_under|addopts|--cov' pyproject.toml 2>/dev/null || true

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

echo '== Unresolved review threads =='
gh api graphql -F owner='ContextualWisdomLab' -F name='.github' -F number=794 -f query='
query($owner: String!, $name: String!, $number: Int!) {
  repository(owner: $owner, name: $name) {
    pullRequest(number: $number) {
      reviewThreads(first: 100) {
        nodes {
          isResolved
          isOutdated
          comments(first: 1) {
            nodes { author { login } body path line originalLine }
          }
        }
      }
    }
  }
}' --jq '.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false) | {isOutdated,comment:.comments.nodes[0]}'

Length of output: 145325


@seonghobae Formal review complete for live head 6bd29ccd394a94b6018cb0985d0febee186124bf against f070c504c1cb06891b800d7ab0cf6ac7d3cf8eae.

I found one blocking issue.

  • .github/workflows/opencode-review-dispatch.yml validates LLVM_COV and LLVM_PROFDATA only while it builds the image. ensure_rust_toolchain() checks cargo and cargo-llvm-cov, but it does not check test -x "$LLVM_COV" and test -x "$LLVM_PROFDATA" before Lines 1813-1817 invoke cargo llvm-cov.
  • The three coverage wrappers construct the isolated runtime environment. The workflow must validate the versioned LLVM paths again at this execution boundary. It must fail before coverage starts if either executable is unavailable.
  • The permanent contract must require this runtime preflight and its ordering before the first cargo llvm-cov invocation.

Other verified items:

  • The exact diff changes five files. It has no whitespace errors.
  • The image installs llvm-19.
  • The image binds LLVM_COV=/usr/bin/llvm-cov-19 and LLVM_PROFDATA=/usr/bin/llvm-profdata-19.
  • All three low-privilege wrappers disable system and global Git configuration before the /work safe-directory overlay.
  • The quality workflow uses exact-head checkout and persist-credentials: false.
  • The fast contract job has no dependency installation.
  • The dependent full-suite job uses --require-hashes. It runs the configured 100% branch-coverage, docstring, and compilation gates.
  • Successful quality and direct security workflow runs exist for this exact head.
  • No unresolved review thread was returned.

The pull request is closed. I did not approve, modify, merge, release, or change protections.

You are interacting with an AI system.

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.

1 participant