Skip to content

fix(review): Rust coverage toolchain, offline crate cache, and foreign-interpreter base-lock tolerance - #650

Open
seonghobae wants to merge 9 commits into
mainfrom
claude/fast-mlsirm-pr-review-mt2e1z
Open

fix(review): Rust coverage toolchain, offline crate cache, and foreign-interpreter base-lock tolerance#650
seonghobae wants to merge 9 commits into
mainfrom
claude/fast-mlsirm-pr-review-mt2e1z

Conversation

@seonghobae

@seonghobae seonghobae commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Problem

Two coverage-sandbox provisioning defects block PR reviews:

  1. Rust coverage is unconditionally failing. When a PR changes Cargo.toml/Cargo.lock/*.rs, run_rust_test_coverage invokes cargo llvm-cov and fails in the offline sandbox with failed to find llvm-tools-preview. Live example: fast-mlsirm#196 (run 30452664727). Behind it: the distribution cargo (1.75) cannot parse version-4 Cargo.lock files, and the --network=none sandbox cannot download crates.
  2. Foreign-interpreter base locks abort the trusted image build (regression from fix(review): materialize base coverage locks by content, not exact filename (org-backlog root cause) #657's content-based lock discovery). In this repository the discovery selects requirements-strix-ci-hashes.txt (Python 3.13 target), whose litellm==1.89.2 pin has no Python 3.14 distribution — the image build dies and every PR's coverage-evidence fails deterministically (run 30502974830).

Fix (fail-closed offline design unchanged)

  1. Pinned rustup toolchain in the trusted image — sha256-pinned rustup-init 1.28.2 provisions Rust 1.94.1 with llvm-tools-preview under /usr/local/rustup, symlinked into /usr/local/bin. No mutable sh.rustup.rs installer.
  2. Offline crate cache — the online materialize step runs cargo fetch --locked for every tracked manifest with a sibling Cargo.lock (root and nested workspaces). The fetch runs from a runner-owned temporary HOME/CARGO_HOME with a neutral working directory, so PR-tree cargo configuration (including external credential providers) is never loaded on the authenticated runner; only the content-addressed registry/ and git/ caches are copied into the tree-local sandbox CARGO_HOME.
  3. Deterministic offline resolutionensure_rust_toolchain exports CARGO_NET_OFFLINE=true, RUSTUP_TOOLCHAIN=1.94.1, and RUSTUP_AUTO_INSTALL=0, and probes rustc --version so a missing pinned toolchain fails fast as an image-provisioning error instead of an impossible offline download.
  4. Best-effort base-lock materialization — a base lock that cannot install on the sandbox interpreter logs a warning and is skipped instead of killing the trusted image build. Materialization is provisioning, not evidence: the offline test run remains the fail-closed gate and still surfaces genuinely missing dependencies.

Verification

  • pytest tests677 passed on this head (contract tests for the dispatch workflow included)
  • Workflow YAML parses; the sandbox-runtime contract (docker run … --network=none, no apt-get at runtime, pinned cargo-llvm-cov retained) is unchanged
  • fast-mlsirm mlsirm-core measures 100% line coverage under cargo llvm-cov --workspace --all-features, so fast-mlsirm#196 approves once this lands
  • CodeRabbit security findings (PR-tree CARGO_HOME isolation; rustup auto-install) addressed in 2efd782 and confirmed by the reviewer

Note: required reviews execute the base branch's workflow, so this PR cannot heal its own coverage-evidence — defect 2 keeps the check red until this lands on main (maintainer decision needed, see the report on #657).

Developer experience: Rust-touching PRs across the org regain a passable coverage-evidence lane, and repos with multi-interpreter tool locks (starting with this one) stop failing coverage at image build.

User experience: no user-facing behavior change; coverage verdicts become meaningful instead of unconditionally failing on provisioning defects.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ERVynrYEjd2TwYvusVpA9f

Summary by CodeRabbit

  • 개선 사항
    • Rust 의존성을 잠금 파일 기준으로 사전 다운로드해 오프라인 빌드 환경의 재현성을 높였습니다.
    • 네트워크가 차단된 환경에서 누락된 Rust 툴체인을 자동 설치하지 않으며, 검증 실패 시 즉시 중단합니다.
    • 호환되지 않는 잠금 파일 기반 Python 패키지는 경고 후 계속 처리됩니다.
  • 모델 업데이트
    • 무료 모델 후보에 nemotron-3-ultra-freedeepseek-v4-flash-free가 추가되었습니다.

@coderabbitai

coderabbitai Bot commented Jul 29, 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: 16 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: af86143a-8c60-46db-9856-ffbe8df5d9af

📥 Commits

Reviewing files that changed from the base of the PR and between 6b24d84 and 1c64ae0.

📒 Files selected for processing (1)
  • .github/workflows/opencode-review-dispatch.yml
📝 Walkthrough

Walkthrough

커버리지 워크플로가 잠긴 Rust 의존성을 격리된 환경에서 프리패치하고, Rust 1.94.1의 오프라인 실행을 검증하도록 변경되었습니다. trusted 이미지의 Python 잠금 설치는 best-effort로 전환되었으며, free-tier 모델 후보 두 개가 추가되었습니다.

Changes

오프라인 Rust 커버리지 실행

Layer / File(s) Summary
고정 Rust 툴체인 이미지
.github/workflows/opencode-review-dispatch.yml
SHA256 검증된 rustup-init으로 Rust 1.94.1과 llvm-tools-preview를 설치하고 RUSTUP_HOME 및 cargo 경로를 고정합니다.
잠긴 의존성 사전 다운로드
.github/workflows/opencode-review-dispatch.yml
중첩된 Cargo.toml을 수집하고 Cargo.lock이 있는 디렉터리에서 격리된 HOME/CARGO_HOME으로 cargo fetch --locked를 실행한 뒤 registry/git/ 캐시만 복사합니다.
설치 및 오프라인 런타임 검증
.github/workflows/opencode-review-dispatch.yml
base-lock Python 패키지 설치 실패는 경고 후 진행하고, RUSTUP_AUTO_INSTALL=0 환경에서 pinned Rust 1.94.1 확인 실패 시 작업을 중단합니다.

Free-tier 모델 후보 업데이트

Layer / File(s) Summary
Free-tier 모델 설정
.github/workflows/opencode-review-dispatch.yml
nemotron-3-ultra-freedeepseek-v4-flash-free를 모델 설정 및 OPENCODE_MODEL_CANDIDATES에 추가합니다.

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

Sequence Diagram(s)

sequenceDiagram
  participant MergeTree
  participant PrefetchEnv
  participant Sandbox
  participant OfflineRun

  MergeTree->>PrefetchEnv: Cargo.toml 및 Cargo.lock 검색
  PrefetchEnv->>PrefetchEnv: cargo fetch --locked 실행
  PrefetchEnv->>Sandbox: registry 및 git 캐시 복사
  Sandbox->>OfflineRun: Rust 1.94.1 확인 및 오프라인 실행
  OfflineRun-->>Sandbox: rustc 확인 실패 시 FAIL
Loading

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 Rust 커버리지 툴체인, 오프라인 크레이트 캐시, 외부 인터프리터 base-lock 허용 변경을 정확히 요약합니다.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/fast-mlsirm-pr-review-mt2e1z

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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 306-307: Update the prefetch flow around the prefetch_cargo fetch
invocation to use a runner-owned temporary CARGO_HOME and HOME rather than any
PR-tree configuration. After fetching, copy only the resulting registry/ and
git/ directories into the coverage cache, excluding config.toml, credentials,
and other configuration files.
- Around line 1502-1512: Update the coverage sandbox setup near the
RUSTUP_TOOLCHAIN export to disable rustup auto-installation with
RUSTUP_AUTO_INSTALL=0, then add a prerequisite rustc --version check so
execution fails immediately when toolchain 1.94.1 is unavailable in the image.
🪄 Autofix (Beta)

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: cf8ee212-d182-4124-a674-5934ea7723de

📥 Commits

Reviewing files that changed from the base of the PR and between 5472a38 and 5c5d0e1.

📒 Files selected for processing (1)
  • .github/workflows/opencode-review-dispatch.yml

Comment thread .github/workflows/opencode-review-dispatch.yml Outdated
Comment thread .github/workflows/opencode-review-dispatch.yml
claude added 2 commits July 29, 2026 13:34
…ustup auto-install

Address the two CodeRabbit findings on the offline Rust coverage lane:

1. The locked crate prefetch now runs from a runner-owned temporary HOME
   and CARGO_HOME with a neutral working directory, so cargo can never
   load pull-request-controlled configuration (including an external
   credential-provider executable committed to the merge tree) on the
   authenticated online runner. Only the content-addressed registry/ and
   git/ caches are copied into the tree-local sandbox CARGO_HOME;
   config.toml and credential files are never propagated.

2. ensure_rust_toolchain exports RUSTUP_AUTO_INSTALL=0 and probes
   rustc --version before measuring, so a missing pinned 1.94.1
   toolchain fails fast as an image-provisioning error instead of a
   rustup download attempt the network-isolated sandbox cannot satisfy.

Verified: workflow YAML parses; pytest tests — 674 passed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ERVynrYEjd2TwYvusVpA9f

Copy link
Copy Markdown
Contributor Author

@coderabbitai review


Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

@seonghobae I’ll review the changes in #650.

✅ Action performed

Review finished.

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.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Review outcome

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

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

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

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

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

  • Result: REQUEST_CHANGES

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

  • Head SHA: 2a77129279623e762687fff4d81b63ad29c92d25

  • Workflow run: 30502974830

  • Workflow attempt: 1

Coverage evidence

Coverage evidence job did not run or did not publish coverage evidence.

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"]
Loading

@opencode-agent

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: 2a77129279623e762687fff4d81b63ad29c92d25
  • Workflow run: 30502974830
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

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

Review outcome

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

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

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

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

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

  • Result: REQUEST_CHANGES

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

  • Head SHA: 2a77129279623e762687fff4d81b63ad29c92d25

  • Workflow run: 30502974830

  • Workflow attempt: 1

Coverage evidence

Coverage evidence job did not run or did not publish coverage evidence.

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"]
Loading

…mage build

The content-based base-lock discovery (#657) now materializes every
fully hash-pinned requirements*.txt at the PR base — including tool
locks compiled for a different interpreter. In ContextualWisdomLab/.github
itself that selects requirements-strix-ci-hashes.txt (Python 3.13
target), whose litellm==1.89.2 pin has no Python 3.14 distribution, so
the trusted coverage image build aborts and every PR's coverage-evidence
fails deterministically (observed on run 30502974830).

Make the per-lock install best-effort: a lock that cannot install on
the sandbox interpreter logs a warning and is skipped instead of
killing the image build. Materialization is provisioning, not evidence
— the offline test run remains the fail-closed gate and still surfaces
any genuinely missing dependency for the measured suite, matching the
crate-prefetch failure semantics elsewhere in this workflow.

Verified: workflow YAML parses; pytest tests — 677 passed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ERVynrYEjd2TwYvusVpA9f
@seonghobae seonghobae changed the title fix(review): Rust coverage toolchain and offline crate cache for the sandbox fix(review): Rust coverage toolchain, offline crate cache, and foreign-interpreter base-lock tolerance Jul 30, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 309-333: Update the cargo prefetch subshell in the
prefetch_manifest loop to pass RUSTUP_HOME alongside HOME and CARGO_HOME, using
the existing RUSTUP_HOME value or the default $HOME/.rustup. Preserve reuse of
the runner’s installed rustup toolchain while keeping the temporary cargo cache
behavior unchanged.
🪄 Autofix (Beta)

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: f1dad142-4e9b-48fa-a6e9-5a798c45cc1a

📥 Commits

Reviewing files that changed from the base of the PR and between 5c5d0e1 and 6b24d84.

📒 Files selected for processing (1)
  • .github/workflows/opencode-review-dispatch.yml

Comment thread .github/workflows/opencode-review-dispatch.yml
…lated prefetch env

Redirecting HOME to a runner-owned temporary directory isolates cargo
from pull-request-controlled configuration, but rustup resolves its
toolchain store from RUSTUP_HOME (default $HOME/.rustup) — with HOME
overridden, `rustup run 1.94.1 cargo` would look in the empty temporary
directory, fail on every manifest, and silently degrade the offline
crate cache to nothing. Resolve the runner's rustup home before the
override and pass it into the prefetch subshell; the temporary cargo
cache behavior is unchanged and rustup's toolchain store is
runner-owned, never pull-request content.

Reported by CodeRabbit on #650.

Verified: workflow YAML parses; pytest tests — 677 passed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ERVynrYEjd2TwYvusVpA9f
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