-
Notifications
You must be signed in to change notification settings - Fork 0
ci(opencode-review): provision LLVM coverage tools #755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4e4b99a
c28a16f
2cd3e13
575aa55
3a31af0
6610317
5495d08
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # OpenCode LLVM coverage toolchain decision | ||
|
|
||
| ## Decision | ||
|
|
||
| The central OpenCode coverage image installs Debian Trixie's `llvm-19` package and explicitly exports: | ||
|
|
||
| ```text | ||
| LLVM_COV=/usr/bin/llvm-cov-19 | ||
| LLVM_PROFDATA=/usr/bin/llvm-profdata-19 | ||
| ``` | ||
|
|
||
| The image build fails unless both paths are executable. This is required because the image uses Debian-packaged `rustc` rather than a rustup-managed toolchain, so `llvm-tools-preview` is not an available installation path. | ||
|
|
||
| ## Evidence and compatibility boundary | ||
|
|
||
| `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. | ||
|
Comment on lines
+16
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ 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:
💡 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:
Debian 패키지 고정 주장을 실제 설치 방식에 맞추세요.
🤖 Prompt for AI AgentsSource: MCP tools |
||
|
|
||
| ## Security and reproducibility contract | ||
|
|
||
| - Pull-request content cannot select another LLVM package or executable path. | ||
| - The coverage image definition remains default-branch controlled and is built from immutable workflow source. | ||
| - `LLVM_COV` and `LLVM_PROFDATA` are set together; partial configuration is rejected. | ||
| - Missing executables fail the image build before any pull-request coverage measurement starts. | ||
| - The image digest, workflow commit SHA, pull-request head SHA, and coverage artifacts remain independently addressable evidence. | ||
| - CPU coverage is a correctness gate. GPU execution and parity tests remain separate domain-specific gates and are not represented by LLVM host coverage alone. | ||
|
|
||
| This design does not claim formal compliance with a software supply-chain standard. It establishes a narrow, auditable compatibility boundary for deterministic Rust coverage execution. | ||
|
|
||
| ## Regression contract | ||
|
|
||
| The central workflow contract test must continue to prove that: | ||
|
|
||
| 1. `llvm-19` is installed in the coverage image; | ||
| 2. `LLVM_COV` names `/usr/bin/llvm-cov-19`; | ||
| 3. `LLVM_PROFDATA` names `/usr/bin/llvm-profdata-19`; | ||
| 4. the image build checks both paths before installing or invoking `cargo-llvm-cov`; and | ||
| 5. the OpenCode approval path remains fail-closed when Rust coverage cannot run. | ||
|
|
||
| ## References | ||
|
|
||
| Debian Project. (2026). *Details of package llvm-19 in trixie*. https://packages.debian.org/trixie/amd64/llvm-19 | ||
|
|
||
| Taiki Endo. (2026). *cargo-llvm-cov: Cargo subcommand to easily use LLVM source-based code coverage* [Computer software]. GitHub. https://github.com/taiki-e/cargo-llvm-cov | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
Repository: ContextualWisdomLab/.github
Length of output: 20474
🏁 Script executed:
Repository: ContextualWisdomLab/.github
Length of output: 17230
🏁 Script executed:
Repository: ContextualWisdomLab/.github
Length of output: 274
🏁 Script executed:
Repository: 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