ci(opencode-review): provision LLVM coverage tools - #755
Conversation
📝 WalkthroughWalkthroughOpenCode 커버리지 이미지가 LLVM 19 도구를 설치하고 명시적 실행 파일 경로를 사용하도록 변경되었습니다. 이미지 빌드 전 도구 검증과 회귀 테스트가 추가되었습니다. Strix CI Python 의존성과 고정 해시도 갱신되었습니다. ChangesOpenCode LLVM 커버리지 툴체인
Strix CI 의존성 갱신
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
OpenCode cannot approve yet because required coverage evidence did not pass.
Review outcome
1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence
-
Problem: The required coverage-evidence job result was
failure, so OpenCode cannot establish approval sufficiency for this head. -
Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.
-
Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports
successwith required evidence or explicit no-source not-applicable evidence. -
Regression test: Keep the approval branch checking
needs.coverage-evidence.result == successbefore posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present. -
Result: REQUEST_CHANGES
-
Reason: coverage-evidence result was
failure, so required test/docstring evidence was not proven for current head2cd3e131f468f391cd3f464ef04f9a175d6efa34. -
Head SHA:
2cd3e131f468f391cd3f464ef04f9a175d6efa34 -
Workflow run: 30954113024
-
Workflow attempt: 1
Coverage evidence
Coverage Decision
- Result: FAIL
- Test evidence: not proven passing
- Docstring evidence: not proven passing when configured
- Failure count: 1
Changed-File Evidence Map
flowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Workflow: opencode-review-dispatch.yml"]
S1 --> I1["GitHub Actions review job"]
I1 --> R1["Review risk: Workflow: opencode-review-dispatch.yml"]
R1 --> V1["actionlint plus required checks"]
Evidence --> S2["Test: test_opencode_agent_contract.py"]
S2 --> I2["regression suite"]
I2 --> R2["Review risk: Test: test_opencode_agent_contract.py"]
R2 --> V2["targeted test run"]
OpenCode Review Overview
Pull request overviewOpenCode cannot approve yet because required coverage evidence did not pass. Review outcome1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence
Coverage evidenceCoverage Decision
Changed-File Evidence Mapflowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Workflow: opencode-review-dispatch.yml"]
S1 --> I1["GitHub Actions review job"]
I1 --> R1["Review risk: Workflow: opencode-review-dispatch.yml"]
R1 --> V1["actionlint plus required checks"]
Evidence --> S2["Docs: opencode-llvm-coverage-toolchain.md"]
S2 --> I2["operator or user guidance"]
I2 --> R2["Review risk: Docs: opencode-llvm-coverage-toolchain.md"]
R2 --> V2["docs review"]
Evidence --> S3["Test: test_opencode_agent_contract.py"]
S3 --> I3["regression suite"]
I3 --> R3["Review risk: Test: test_opencode_agent_contract.py"]
R3 --> V3["targeted test run"]
|
There was a problem hiding this comment.
Pull request overview
OpenCode cannot approve yet because required coverage evidence did not pass.
Review outcome
1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence
-
Problem: The required coverage-evidence job result was
failure, so OpenCode cannot establish approval sufficiency for this head. -
Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.
-
Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports
successwith required evidence or explicit no-source not-applicable evidence. -
Regression test: Keep the approval branch checking
needs.coverage-evidence.result == successbefore posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present. -
Result: REQUEST_CHANGES
-
Reason: coverage-evidence result was
failure, so required test/docstring evidence was not proven for current head575aa558164f371d606fb5340f2bfb4f0ed30fb7. -
Head SHA:
575aa558164f371d606fb5340f2bfb4f0ed30fb7 -
Workflow run: 30962349512
-
Workflow attempt: 1
Coverage evidence
Coverage Decision
- Result: FAIL
- Test evidence: not proven passing
- Docstring evidence: not proven passing when configured
- Failure count: 1
Changed-File Evidence Map
flowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Workflow: opencode-review-dispatch.yml"]
S1 --> I1["GitHub Actions review job"]
I1 --> R1["Review risk: Workflow: opencode-review-dispatch.yml"]
R1 --> V1["actionlint plus required checks"]
Evidence --> S2["Docs: opencode-llvm-coverage-toolchain.md"]
S2 --> I2["operator or user guidance"]
I2 --> R2["Review risk: Docs: opencode-llvm-coverage-toolchain.md"]
R2 --> V2["docs review"]
Evidence --> S3["Test: test_opencode_agent_contract.py"]
S3 --> I3["regression suite"]
I3 --> R3["Review risk: Test: test_opencode_agent_contract.py"]
R3 --> V3["targeted test run"]
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/opencode-review-dispatch.yml:
- Around line 655-663: Pin the llvm-19 and rustc APT inputs in the Docker build
using compatible exact package versions or an immutable Debian snapshot, and
retain the executable checks for LLVM_COV and LLVM_PROFDATA. In
docs/doctoring/opencode-llvm-coverage-toolchain.md lines 16-18, document the
implemented pinning mechanism and versions; if the build remains unpinned,
remove the “pinned” and exact-version claims instead.
In `@docs/doctoring/opencode-llvm-coverage-toolchain.md`:
- Around line 16-18: Update the documentation around the LLVM 19 package
installation to match the workflow’s actual behavior: either remove the “pinned
Debian image repositories” claim and change the package version to
1:19.1.7-3+b1, or implement exact package-version installation together with an
immutable Debian snapshot in both the workflow and this document. Keep
executable-path checks only as path validation, not package-version
verification.
In `@tests/test_opencode_agent_contract.py`:
- Around line 2734-2743: Update
test_opencode_coverage_image_provisions_compatible_llvm_tools to extract and
inspect only the Dockerfile generated by the coverage-evidence job rather than
the entire workflow. Keep the LLVM tool assertions scoped to that Dockerfile,
and add an ordering assertion that the executable checks for LLVM_COV and
LLVM_PROFDATA occur before cargo-llvm-cov.tar.gz installation. Run the complete
test suite.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 4d430ec3-574e-49fc-b043-87dc19c64815
📒 Files selected for processing (5)
.github/workflows/opencode-review-dispatch.ymldocs/doctoring/opencode-llvm-coverage-toolchain.mdrequirements-strix-ci-hashes.txtrequirements-strix-ci.txttests/test_opencode_agent_contract.py
| llvm-19 \ | ||
| rustc \ | ||
| util-linux \ | ||
| vulkan-tools \ | ||
| xz-utils \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
| ENV LLVM_COV=/usr/bin/llvm-cov-19 | ||
| ENV LLVM_PROFDATA=/usr/bin/llvm-profdata-19 | ||
| RUN test -x "$LLVM_COV" && test -x "$LLVM_PROFDATA" |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- workflow excerpt ---'
sed -n '625,675p' .github/workflows/opencode-review-dispatch.yml
printf '%s\n' '--- documentation excerpt ---'
sed -n '1,40p' docs/doctoring/opencode-llvm-coverage-toolchain.md
printf '%s\n' '--- related package/source references ---'
rg -n -C 3 'llvm-19|llvm-toolchain-19|rustc|snapshot|LLVM_COV|LLVM_PROFDATA|pinned' \
.github/workflows/opencode-review-dispatch.yml \
docs/doctoring/opencode-llvm-coverage-toolchain.mdRepository: ContextualWisdomLab/.github
Length of output: 20474
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- all APT and image-repository controls in workflow ---'
rg -n -C 4 'apt-get|sources.list|snapshot.debian|deb\.debian|llvm-19|rustc|FROM .*python' \
.github/workflows/opencode-review-dispatch.yml
printf '%s\n' '--- package pinning syntax in repository ---'
rg -n -S 'apt-get install.*=|llvm-toolchain-19|snapshot\.debian\.org|apt_preferences|/etc/apt/preferences|snapshot\.debian' \
.github docs scripts tests 2>/dev/null || true
printf '%s\n' '--- relevant workflow contract tests ---'
rg -n -C 5 'llvm-19|LLVM_COV|LLVM_PROFDATA|coverage image|Dockerfile|apt-get install' \
tests .github 2>/dev/null | head -n 300Repository: ContextualWisdomLab/.github
Length of output: 17230
🏁 Script executed:
#!/bin/bash
set -eu
python3 - <<'PY'
from pathlib import Path
import re
workflow = Path(".github/workflows/opencode-review-dispatch.yml").read_text()
doc = Path("docs/doctoring/opencode-llvm-coverage-toolchain.md").read_text()
dockerfile = workflow.split("cat >\"$coverage_build_dir/Dockerfile\" <<'DOCKERFILE\n", 1)[1].split("\n DOCKERFILE", 1)[0]
packages = re.findall(r"(?m)^\s{14}([a-z0-9][a-z0-9+.-]*)(?:\s*\\)?$", dockerfile)
apt_lines = [line.strip() for line in dockerfile.splitlines() if "apt-get" in line or "snapshot.debian" in line or "sources.list" in line or "preferences" in line]
print("packages:", packages)
print("version-pinned packages:", [p for p in packages if "=" in p])
print("APT repository/pinning lines:", apt_lines)
print("base image pinned by digest:", bool(re.search(r"^FROM .+@sha256:[0-9a-f]{64}$", dockerfile, re.M)))
print("documentation claims pinned repositories:", "pinned Debian image repositories" in doc)
print("documentation claims exact package version:", "19.1.7-3+b1" in doc)
PYRepository: ContextualWisdomLab/.github
Length of output: 274
🏁 Script executed:
#!/bin/bash
set -eu
python3 - <<'PY'
from pathlib import Path
import re
workflow = Path(".github/workflows/opencode-review-dispatch.yml").read_text()
doc = Path("docs/doctoring/opencode-llvm-coverage-toolchain.md").read_text()
start = workflow.index("cat >")
start = workflow.index("\n", start) + 1
end = workflow.index("\n", workflow.index("DOCKERFILE", start))
dockerfile = "\n".join(
line[10:] if line.startswith(" ") else line
for line in workflow[start:end].splitlines()
)
packages = re.findall(r"(?m)^\s{2,}([a-z0-9][a-z0-9+.-]*)(?:\s*\\)?$", dockerfile)
apt_lines = [
line.strip()
for line in dockerfile.splitlines()
if any(token in line for token in (
"apt-get", "snapshot.debian", "sources.list", "preferences"
))
]
print("packages:", packages)
print("version-pinned packages:", [p for p in packages if "=" in p])
print("APT repository/pinning lines:", apt_lines)
print(
"base image pinned by digest:",
bool(re.search(r"^FROM .+@sha256:[0-9a-f]{64}$", dockerfile, re.M)),
)
print("documentation claims pinned repositories:", "pinned Debian image repositories" in doc)
print("documentation claims exact package version:", "19.1.7-3+b1" in doc)
PYRepository: ContextualWisdomLab/.github
Length of output: 701
APT 패키지 고정을 구현과 문서에서 일치시키세요.
FROM 이미지 digest는 고정되어 있지만, apt-get update는 llvm-19와 rustc의 버전 또는 Debian 저장소 snapshot을 고정하지 않습니다. 따라서 재빌드마다 Rust/LLVM 도구체인과 coverage 결과가 달라질 수 있습니다.
.github/workflows/opencode-review-dispatch.yml#L655-L663: 호환되는 exact package version 또는 immutable Debian snapshot을 적용하세요.docs/doctoring/opencode-llvm-coverage-toolchain.md#L16-L18: 실제 고정 방식을 문서화하세요. 고정하지 않으면pinned및 exact version 주장을 제거하세요.
📍 Affects 2 files
.github/workflows/opencode-review-dispatch.yml#L655-L663(this comment)docs/doctoring/opencode-llvm-coverage-toolchain.md#L16-L18
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/opencode-review-dispatch.yml around lines 655 - 663, Pin
the llvm-19 and rustc APT inputs in the Docker build using compatible exact
package versions or an immutable Debian snapshot, and retain the executable
checks for LLVM_COV and LLVM_PROFDATA. In
docs/doctoring/opencode-llvm-coverage-toolchain.md lines 16-18, document the
implemented pinning mechanism and versions; if the build remains unpinned,
remove the “pinned” and exact-version claims instead.
| `cargo-llvm-cov` documents `LLVM_COV` and `LLVM_PROFDATA` as the overrides to use when a Rust toolchain is installed outside rustup. It also requires the selected tools to be compatible with the LLVM version used by `rustc`. Its published compatibility table maps Rust 1.82–1.95 to LLVM 19–22. The central image therefore selects LLVM 19 as the lowest compatible family for its supported Rust range and keeps the two binary paths explicit rather than relying on an unversioned system default. | ||
|
|
||
| Debian Trixie publishes `llvm-19` from the `llvm-toolchain-19` source package. The package version currently documented for amd64 is 19.1.7-3+b1. The workflow installs the package from the pinned Debian image repositories and verifies the exact versioned executable paths during image construction. |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -eu
echo '--- candidate files ---'
git ls-files | rg '(^|/)(docs/doctoring/opencode-llvm-coverage-toolchain\.md|.*workflow.*|.*docker.*|.*container.*|.*\.ya?ml$)' | head -200
echo '--- references to llvm-19, apt installation, and package pinning ---'
rg -n -C 4 'llvm-19|apt-get install|apt-cache policy|snapshot\.debian|deb\.debian|pinned|19\.1\.7|LLVM_COV|LLVM_PROFDATA' . \
-g '*.md' -g '*.yml' -g '*.yaml' -g 'Dockerfile*' -g '*.sh' || true
echo '--- target document ---'
target='docs/doctoring/opencode-llvm-coverage-toolchain.md'
if [ -f "$target" ]; then
cat -n "$target"
fiRepository: ContextualWisdomLab/.github
Length of output: 38896
🏁 Script executed:
#!/bin/bash
set -eu
echo '--- workflow structure ---'
ast-grep outline .github/workflows/opencode-review.yml
echo '--- workflow coverage-related commands ---'
rg -n -C 8 'coverage|docker|apt|rustc|cargo-llvm|LLVM|llvm|Dockerfile|debian' \
.github/workflows/opencode-review.yml
echo '--- contract test references ---'
rg -n -C 10 'coverage|docker|apt|rustc|cargo-llvm|LLVM|llvm|Dockerfile|debian|opencode-llvm' \
tests/test_opencode_docker_evidence_contract.py \
tests/test_opencode_workflow_shell_syntax.py \
scripts/ci/test_strix_quick_gate.sh
echo '--- all tracked files containing coverage image/build markers ---'
rg -l 'cargo-llvm-cov|LLVM_COV|LLVM_PROFDATA|llvm-cov-19|llvm-profdata-19|coverage image|coverage_build' . \
-g '!docs/doctoring/opencode-llvm-coverage-toolchain.md' | sortRepository: ContextualWisdomLab/.github
Length of output: 50384
🏁 Script executed:
#!/bin/bash
set -eu
workflow='.github/workflows/opencode-review-dispatch.yml'
echo '--- package and LLVM commands in the actual dispatch workflow ---'
rg -n -C 12 'apt-get|apt-cache|llvm|rustc|cargo-llvm|LLVM|Dockerfile|coverage_build|coverage image' "$workflow" || true
echo '--- coverage step names and run blocks ---'
rg -n '^(\s+name:|\s+run:|\s+env:|\s+uses:)' "$workflow" | \
awk '$1+0 >= 450 && $1+0 <= 850 {print}' || true
echo '--- nearby coverage implementation ---'
python3 - <<'PY'
from pathlib import Path
p = Path(".github/workflows/opencode-review-dispatch.yml")
lines = p.read_text(encoding="utf-8").splitlines()
for i, line in enumerate(lines, 1):
low = line.lower()
if any(x in low for x in ("materialize pull request merge tree", "coverage", "cargo-llvm", "llvm_cov", "llvm-profdata", "llvm-cov", "apt-get")):
start = max(1, i - 20)
end = min(len(lines), i + 45)
print(f"\n--- lines {start}-{end} (match at {i}) ---")
for n in range(start, end + 1):
print(f"{n:5}: {lines[n-1]}")
PYRepository: ContextualWisdomLab/.github
Length of output: 50384
🏁 Script executed:
#!/bin/bash
set -eu
echo '--- exact LLVM/package matches in tracked files ---'
git grep -n -E 'apt(-get)?[[:space:]]+install|cargo-llvm-cov|LLVM_COV|LLVM_PROFDATA|llvm-cov-19|llvm-profdata-19|llvm-19|llvm-toolchain-19|19\.1\.7-3' -- \
':!scripts/ci/test_strix_quick_gate.sh' \
':!scripts/ci/run_opencode_review_model_pool.sh' \
':!scripts/ci/emit_opencode_failed_check_fallback_findings.sh' \
':!docs/org-required-workflow-rollout.md' \
':!PR_GOVERNANCE_AUDIT.md' || true
echo '--- workflow section boundaries ---'
grep -n -E '^ [A-Za-z0-9_.-]+:|^ - name:|^ - id:' \
.github/workflows/opencode-review-dispatch.yml | \
grep -E 'coverage|Coverage|Rust|rust|LLVM|Docker|docker|Materialize|Install|Build|toolchain' || true
echo '--- only exact package-related lines from the dispatch workflow ---'
grep -n -E 'apt(-get)?[[:space:]]+install|cargo-llvm-cov|LLVM_COV|LLVM_PROFDATA|llvm-cov-19|llvm-profdata-19|llvm-19|llvm-toolchain-19|19\.1\.7-3' \
.github/workflows/opencode-review-dispatch.yml || true
echo '--- files containing exact package installation command ---'
git grep -l -E 'apt(-get)?[[:space:]]+install[[:space:]].*llvm|apt(-get)?[[:space:]]+install' -- \
':!scripts/ci/test_strix_quick_gate.sh' \
':!scripts/ci/run_opencode_review_model_pool.sh' \
':!scripts/ci/emit_opencode_failed_check_fallback_findings.sh' \
':!docs/org-required-workflow-rollout.md' \
':!PR_GOVERNANCE_AUDIT.md' || trueRepository: ContextualWisdomLab/.github
Length of output: 6863
🏁 Script executed:
#!/bin/bash
set -eu
file='.github/workflows/opencode-review-dispatch.yml'
sed -n '600,685p' "$file"
echo '--- test assertions around the coverage image ---'
sed -n '2700,2770p' tests/test_opencode_agent_contract.py
echo '--- image source and repository configuration references ---'
grep -n -E 'FROM |sources\.list|debian|snapshot|deb |apt-get update|apt-get install|apt-mark|policy|version' "$file" | \
awk '$1+0 >= 580 && $1+0 <= 700 {print}'Repository: ContextualWisdomLab/.github
Length of output: 7795
🌐 Web query:
Debian Trixie amd64 llvm-19 package version 1:19.1.7-3+b1 packages.debian.org
💡 Result:
The package llvm-19 version 1:19.1.7-3+b1 for the amd64 architecture is a valid and available package in the Debian Trixie (testing) repository [1][2]. This version is part of the llvm-toolchain-19 source package (specifically built from version 1:19.1.7-3) [2][3]. The "+b1" suffix indicates that it is a binary-only upload (rebuild) generated by the Debian buildd system for the amd64 architecture [1][2]. Key technical details for llvm-19 (amd64) include: - Source Package: llvm-toolchain-19 (version 1:19.1.7-3) [2] - Version: 1:19.1.7-3+b1 [1][2] - Architecture: amd64 [1][2] - Dependencies: Requires packages such as llvm-19-runtime (= 1:19.1.7-3+b1) and llvm-19-linker-tools (= 1:19.1.7-3+b1), along with various standard system libraries like libc6, libstdc++6, and libzstd1 [2]. You can find the official details and download links for this package and its associated libraries (such as libllvm19 and llvm-19-dev, which share the same versioning) on the Debian Packages website [1][4][5].
Citations:
- 1: https://packages.debian.org/trixie/llvm-19
- 2: https://piuparts.debian.org/trixie2next/pass/llvm-19_1:19.1.7-3+b1.log
- 3: https://tracker.debian.org/pkg/llvm-toolchain-19
- 4: https://packages.debian.org/en/trixie/libllvm19
- 5: https://packages.debian.org/trixie/llvm-19-dev
Debian 패키지 고정 주장을 실제 설치 방식에 맞추세요.
apt-get install llvm-19는 버전 1:19.1.7-3+b1 또는 immutable Debian snapshot을 고정하지 않습니다. 실행 파일 경로 검사는 패키지 버전을 검증하지 않습니다. 고정을 요구하지 않으면 line 18의 “pinned Debian image repositories”를 제거하고, 패키지 표기를 1:19.1.7-3+b1로 수정하세요. 고정이 요구사항이면 workflow와 문서에 exact package version 및 immutable snapshot을 함께 반영하세요.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/doctoring/opencode-llvm-coverage-toolchain.md` around lines 16 - 18,
Update the documentation around the LLVM 19 package installation to match the
workflow’s actual behavior: either remove the “pinned Debian image repositories”
claim and change the package version to 1:19.1.7-3+b1, or implement exact
package-version installation together with an immutable Debian snapshot in both
the workflow and this document. Keep executable-path checks only as path
validation, not package-version verification.
Source: MCP tools
| def test_opencode_coverage_image_provisions_compatible_llvm_tools(): | ||
| """Keep Rust coverage independent of a rustup-managed toolchain.""" | ||
| workflow = Path( | ||
| ".github/workflows/opencode-review-dispatch.yml" | ||
| ).read_text(encoding="utf-8") | ||
|
|
||
| assert " llvm-19 " + chr(92) in workflow | ||
| assert "ENV LLVM_COV=/usr/bin/llvm-cov-19" in workflow | ||
| assert "ENV LLVM_PROFDATA=/usr/bin/llvm-profdata-19" in workflow | ||
| assert 'RUN test -x "$LLVM_COV" && test -x "$LLVM_PROFDATA"' in workflow |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- target test ---'
sed -n '2700,2770p' tests/test_opencode_agent_contract.py
printf '%s\n' '--- workflow coverage job markers ---'
rg -n -A120 -B10 'coverage-evidence:|opencode-review-target:|Dockerfile|llvm-19|LLVM_COV|LLVM_PROFDATA|cargo-llvm-cov' \
.github/workflows/opencode-review-dispatch.yml
printf '%s\n' '--- related contract-test references ---'
rg -n -A20 -B10 'opencode_coverage_image|coverage-evidence|cargo-llvm-cov|LLVM_COV|LLVM_PROFDATA' \
tests/test_opencode_agent_contract.pyRepository: ContextualWisdomLab/.github
Length of output: 50383
🏁 Script executed:
#!/bin/bash
set -eu
python3 - <<'PY'
from pathlib import Path
workflow_path = Path(".github/workflows/opencode-review-dispatch.yml")
workflow = workflow_path.read_text(encoding="utf-8")
start_marker = " coverage-evidence:\n"
end_marker = "\n opencode-review-target:"
print("coverage_start_present:", start_marker in workflow)
coverage_start = workflow.index(start_marker)
coverage_end = workflow.index(end_marker, coverage_start)
coverage_job = workflow[coverage_start:coverage_end]
print("coverage_job_length:", len(coverage_job))
docker_start_marker = 'cat >"$coverage_build_dir/Dockerfile" <<\\'DOCKERFILE\\''
docker_end_marker = "\n DOCKERFILE"
print("docker_start_present_in_coverage_job:", docker_start_marker in coverage_job)
print("docker_end_present_in_coverage_job:", docker_end_marker in coverage_job)
dockerfile_start = coverage_job.index(docker_start_marker)
dockerfile_end = coverage_job.index(docker_end_marker, dockerfile_start)
dockerfile = coverage_job[dockerfile_start:dockerfile_end]
needles = [
" llvm-19 " + chr(92),
"ENV LLVM_COV=/usr/bin/llvm-cov-19",
"ENV LLVM_PROFDATA=/usr/bin/llvm-profdata-19",
'RUN test -x "$LLVM_COV" && test -x "$LLVM_PROFDATA"',
"cargo-llvm-cov.tar.gz",
]
for needle in needles:
print(repr(needle), "in_workflow=", needle in workflow,
"in_coverage_job=", needle in coverage_job,
"in_dockerfile=", needle in dockerfile)
for needle in [
'RUN test -x "$LLVM_COV"',
"cargo-llvm-cov.tar.gz",
]:
print("dockerfile_index", repr(needle), dockerfile.find(needle))
print("dockerfile_excerpt:")
print(dockerfile)
PYRepository: ContextualWisdomLab/.github
Length of output: 376
🏁 Script executed:
#!/bin/bash
set -eu
python3 - <<'PY'
from pathlib import Path
workflow = Path(".github/workflows/opencode-review-dispatch.yml").read_text(encoding="utf-8")
test = Path("tests/test_opencode_agent_contract.py").read_text(encoding="utf-8")
coverage_start = workflow.index(" coverage-evidence:\n")
coverage_end = workflow.index("\n opencode-review-target:", coverage_start)
coverage_job = workflow[coverage_start:coverage_end]
docker_start_marker = 'cat >"$coverage_build_dir/Dockerfile" <<\\'DOCKERFILE\''
docker_end_marker = "\n DOCKERFILE"
docker_start = coverage_job.index(docker_start_marker)
docker_end = coverage_job.index(docker_end_marker, docker_start)
dockerfile = coverage_job[docker_start:docker_end]
print("workflow_lines:", workflow.count("\n") + 1)
print("test_lines:", test.count("\n") + 1)
print("coverage_job_lines:", coverage_job.count("\n") + 1)
print("dockerfile_lines:", dockerfile.count("\n") + 1)
for name, text in [
("workflow", workflow),
("coverage_job", coverage_job),
("dockerfile", dockerfile),
]:
print(f"\n[{name}]")
for needle in [
" llvm-19 " + chr(92),
"ENV LLVM_COV=/usr/bin/llvm-cov-19",
"ENV LLVM_PROFDATA=/usr/bin/llvm-profdata-19",
'RUN test -x "$LLVM_COV" && test -x "$LLVM_PROFDATA"',
"cargo-llvm-cov.tar.gz",
]:
print(repr(needle), text.find(needle))
check_pos = dockerfile.find('RUN test -x "$LLVM_COV"')
install_pos = dockerfile.find("cargo-llvm-cov.tar.gz")
print("\ncheck_before_install:", 0 <= check_pos < install_pos)
PY
printf '%s\n' '--- exact test function ---'
sed -n '2725,2755p' tests/test_opencode_agent_contract.py
printf '%s\n' '--- exact coverage job ---'
sed -n '/^ coverage-evidence:/,/^ opencode-review-target:/p' \
.github/workflows/opencode-review-dispatch.ymlRepository: ContextualWisdomLab/.github
Length of output: 375
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- test ---'
sed -n '2725,2755p' tests/test_opencode_agent_contract.py
printf '%s\n' '--- workflow relevant lines ---'
rg -n -A100 -B5 'coverage-evidence:|opencode-review-target:|cat >.*Dockerfile|llvm-19|LLVM_COV|LLVM_PROFDATA|cargo-llvm-cov' .github/workflows/opencode-review-dispatch.ymlRepository: ContextualWisdomLab/.github
Length of output: 25532
🏁 Script executed:
#!/bin/bash
set -eu
python3 - <<'PY'
from pathlib import Path
workflow = Path(".github/workflows/opencode-review-dispatch.yml").read_text(
encoding="utf-8"
)
coverage_start = workflow.index(" coverage-evidence:\n")
coverage_end = workflow.index("\n opencode-review-target:", coverage_start)
coverage_job = workflow[coverage_start:coverage_end]
docker_start_marker = """cat >"$coverage_build_dir/Dockerfile" <<'DOCKERFILE'"""
docker_end_marker = "\n DOCKERFILE"
docker_start = coverage_job.index(docker_start_marker)
docker_end = coverage_job.index(docker_end_marker, docker_start)
dockerfile = coverage_job[docker_start:docker_end]
needles = [
" llvm-19 " + chr(92),
"ENV LLVM_COV=/usr/bin/llvm-cov-19",
"ENV LLVM_PROFDATA=/usr/bin/llvm-profdata-19",
'RUN test -x "$LLVM_COV" && test -x "$LLVM_PROFDATA"',
]
for label, text in [
("workflow", workflow),
("coverage_job", coverage_job),
("dockerfile", dockerfile),
]:
print(label)
for needle in needles:
print(" ", repr(needle), "count=", text.count(needle))
check_index = dockerfile.index('RUN test -x "$LLVM_COV"')
install_index = dockerfile.index("cargo-llvm-cov.tar.gz")
print("dockerfile_bounds_valid:", docker_start < docker_end)
print("check_before_cargo_llvm_cov_archive:", check_index < install_index)
print("dockerfile_start_line:",
coverage_start + coverage_job[:docker_start].count("\n") + 1)
print("dockerfile_end_line:",
coverage_start + coverage_job[:docker_end].count("\n") + 1)
PYRepository: ContextualWisdomLab/.github
Length of output: 947
🏁 Script executed:
#!/bin/bash
set -eu
python3 - <<'PY'
from pathlib import Path
workflow = Path(".github/workflows/opencode-review-dispatch.yml").read_text(
encoding="utf-8"
)
coverage_start = workflow.index(" coverage-evidence:\n")
coverage_end = workflow.index("\n opencode-review-target:", coverage_start)
coverage_job = workflow[coverage_start:coverage_end]
docker_start_marker = """cat >"$coverage_build_dir/Dockerfile" <<'DOCKERFILE"""
docker_end_marker = "\n DOCKERFILE"
docker_start = coverage_job.index(docker_start_marker)
docker_end = coverage_job.index(docker_end_marker, docker_start)
dockerfile = coverage_job[docker_start:docker_end]
needles = [
" llvm-19 " + chr(92),
"ENV LLVM_COV=/usr/bin/llvm-cov-19",
"ENV LLVM_PROFDATA=/usr/bin/llvm-profdata-19",
'RUN test -x "$LLVM_COV" && test -x "$LLVM_PROFDATA"',
]
for label, text in [
("workflow", workflow),
("coverage_job", coverage_job),
("dockerfile", dockerfile),
]:
print(label)
for needle in needles:
print(" ", repr(needle), "count=", text.count(needle))
check_index = dockerfile.index('RUN test -x "$LLVM_COV"')
install_index = dockerfile.index("cargo-llvm-cov.tar.gz")
print("dockerfile_bounds_valid:", docker_start < docker_end)
print("check_before_cargo_llvm_cov_archive:", check_index < install_index)
print("dockerfile_start_line:",
coverage_start + coverage_job[:docker_start].count("\n") + 1)
print("dockerfile_end_line:",
coverage_start + coverage_job[:docker_end].count("\n") + 1)
PYRepository: ContextualWisdomLab/.github
Length of output: 947
coverage-evidence의 Dockerfile 범위를 검증하세요.
전체 workflow 대신 coverage-evidence job에서 생성한 Dockerfile만 검사하세요. RUN test -x "$LLVM_COV"가 cargo-llvm-cov.tar.gz 설치보다 먼저 실행되는지도 assertion으로 고정하세요. 전체 테스트 스위트를 실행하세요.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tests/test_opencode_agent_contract.py` around lines 2734 - 2743, Update
test_opencode_coverage_image_provisions_compatible_llvm_tools to extract and
inspect only the Dockerfile generated by the coverage-evidence job rather than
the entire workflow. Keep the LLVM tool assertions scoped to that Dockerfile,
and add an ordering assertion that the executable checks for LLVM_COV and
LLVM_PROFDATA occur before cargo-llvm-cov.tar.gz installation. Run the complete
test suite.
Source: Coding guidelines
dc81bb8
into
fix/opencode-coverage-failure-diagnostics
Summary
coverage-evidenceimage so Debian-packaged Rust can executecargo llvm-covllvm-19and bindsLLVM_COVandLLVM_PROFDATAto the versioned LLVM 19 binariesdocs/doctoring/opencode-llvm-coverage-toolchain.mdwith APA 7th referencesEvidence
DiskSage PR #125 exact head
928f10920316110dfa716d1245033c1ae2609854passed JavaScript/TypeScript coverage at 100%, but the central OpenCode coverage job failed before Rust measurement because the Debian-packaged Rust toolchain did not provide rustup'sllvm-tools-preview. The observed failure was.githubworkflow run30938581958, job92132391213.The official
cargo-llvm-covdocumentation requires non-rustup toolchains to set bothLLVM_COVandLLVM_PROFDATA; its published compatibility table maps Rust 1.82–1.95 to LLVM 19–22. Debian Trixie publishes LLVM 19 and the versioned/usr/bin/llvm-cov-19and/usr/bin/llvm-profdata-19executables.Safety
Current stack
This PR targets
fix/opencode-coverage-failure-diagnosticsso it inherits the remediated Strix lock and exact setup-failure diagnostics before landing. Its exact current head is575aa558164f371d606fb5340f2bfb4f0ed30fb7.Required before merge
Summary by CodeRabbit
개선 사항
문서
테스트