Skip to content

fix(doctor): resolve packaged graph binary - #248

Open
2233admin wants to merge 4 commits into
mainfrom
codex/issue-232-release-install
Open

fix(doctor): resolve packaged graph binary#248
2233admin wants to merge 4 commits into
mainfrom
codex/issue-232-release-install

Conversation

@2233admin

@2233admin 2233admin commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Refs #232.

Doctor now resolves a released CLI from bin/code-intel or bin/code-intel.exe before checkout build paths, so the graph provider points to a real packaged binary. This is the graph-binary sub-fix only; #232 remains open for the missing packaged bin/legacy and bin/pipeline.config.json paths. The hash-bound doctor declaration is refreshed with the changed bootstrap source.

Validation:

  • cargo fmt --check
  • cargo test -p code-intel --test doctor_bootstrap_cli
  • cargo test -p code-intel --locked

Required before merge (DR-0001): add the installed-topology reproduction to the packaged-install smoke gate and verify the installed Doctor resolves an existing graph binary.

@repowise-bot

repowise-bot Bot commented Aug 8, 2026

Copy link
Copy Markdown

✅ Health of changed files: 4.8 → 4.9 (+0.1)
⚠️ Change risk: moderate, riskier than 38% of this repo's commits.

📋 At a glance
2 hotspots touched · 1 new finding introduced · 2 files with recent fix history. Scoped to crates.

✅ Health gate: passed

🔎 More signals (2)

🗺️ Change map

flowchart LR
  subgraph PR ["Changed in this PR (1 with dependents)"]
    f_crates_code_intel_cli_src_doctor_bootstrap_mod_rs[".../doctor_bootstrap/mod.rs 🔥"]:::changed
  end
  f_crates_code_intel_cli_src_doctor_adapter_rs[".../src/doctor_adapter.rs"]
  f_crates_code_intel_cli_src_doctor_bootstrap_mod_rs --> f_crates_code_intel_cli_src_doctor_adapter_rs
  f_crates_code_intel_cli_src_main_rs[".../src/main.rs"]
  f_crates_code_intel_cli_src_doctor_bootstrap_mod_rs --> f_crates_code_intel_cli_src_main_rs
  classDef changed fill:#dbeafe,stroke:#1d4ed8,color:#1e3a5f
  classDef warn fill:#fef3c7,stroke:#b45309,color:#78350f
  classDef guard fill:#dcfce7,stroke:#15803d,color:#14532d
Loading

Solid arrows: code that imports the changed files (2 direct dependents, from the last indexed snapshot). Dashed: history/tests.

🔥 Hotspots touched (2)

  • .../doctor_bootstrap/mod.rs: 9 commits/90d, 3 dependents
  • .../tests/doctor_bootstrap_cli.rs: 6 commits/90d, 2 dependents

📊 See the full report for this PR
Your repo map with this PR's blast radius lit up, every caller of the contracts it changes, and health before and after. No sign-in. · ⭐ Star Repowise · 📥 Install bot · Silence on a single PR with [skip repowise] in the title · Per-repo toggle on repowise.dev/settings?tab=bot · Updated 2026-08-08 17:18 UTC

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Improved binary discovery to prioritize the packaged release binary.
    • Release layouts now correctly detect the packaged graph-provider binary and include its path in recommended commands.
  • Tests

    • Added regression coverage for packaged binary discovery and command recommendations.

Walkthrough

doctor bootstrap now checks the packaged bin/code-intel binary before release and debug build outputs. Unit and CLI tests verify candidate ordering, binary discovery, reported paths, and recommended commands.

Changes

Packaged Binary Discovery

Layer / File(s) Summary
Binary resolution and validation
crates/code-intel-cli/src/doctor_bootstrap/mod.rs, crates/code-intel-cli/tests/doctor_bootstrap_cli.rs
binary_candidates now returns the packaged binary first, followed by release and debug binaries. Tests verify the ordering and macOS release-layout discovery, reported path, and recommended command.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Poem

A rabbit checks the bin path bright,
Then release, then debug, in ordered flight.
The doctor finds the tool in place,
Reports its path with steady grace.
“Hop verified!” says Bunny with delight.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The changes do not address issue #232's missing bin/legacy and bin/pipeline.config.json assets required for macOS bootstrap readiness. Resolve or deploy bin/legacy and bin/pipeline.config.json from the release root or CODE_INTEL_HOME, and add regression coverage for those assets.
Out of Scope Changes check ⚠️ Warning Packaged graph-provider binary discovery is outside issue #232, which targets missing legacy runner and pipeline configuration assets. Align the changes with issue #232 or link this graph-provider discovery fix to an issue that defines its scope.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The description clearly explains the packaged graph binary resolution, testing, and remaining scope.
Title check ✅ Passed The title clearly and concisely summarizes the main change: resolving the packaged graph binary in Doctor.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

Code Intel change risk

Score Percentile Level
55/100 32th (vs last 47 commits) 🟢 low

Top signals

  • Diff shape: 4 file(s), +63/-10 (max file share 0.7)
  • Test asymmetry: source changed, tests touched
  • Bug-magnet: 34 fix commit(s) in touched files (180d)
  • Churn: 74 commit(s) touching these files (90d)

revspec: origin/main..HEAD · threshold: percentile >= 90 blocks unless labeled risk-accepted · code-intel change risk

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

🧹 Nitpick comments (1)
crates/code-intel-cli/tests/doctor_bootstrap_cli.rs (1)

296-345: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Exercise packaged precedence in the integration test.

Create target/release/code-intel and target/debug/code-intel in addition to bin/code-intel. Keep the existing binaryPath assertion. The current fixture proves packaged discovery only when checkout candidates are absent. It does not prove that the resolver selects the packaged candidate when all candidates exist. The existing unit test checks array order, but this test should verify the end-to-end consumer behavior.

Suggested fixture extension
     fs::create_dir_all(release.join("legacy")).unwrap();
     fs::create_dir_all(binary.parent().unwrap()).unwrap();
+    fs::create_dir_all(release.join("target").join("release")).unwrap();
+    fs::create_dir_all(release.join("target").join("debug")).unwrap();
+    fs::write(
+        release.join("target").join("release").join("code-intel"),
+        b"checkout release",
+    )
+    .unwrap();
+    fs::write(
+        release.join("target").join("debug").join("code-intel"),
+        b"checkout debug",
+    )
+    .unwrap();
     fs::write(release.join("legacy").join("run-code-intel.ps1"), b"").unwrap();

As per coding guidelines, Rust changes require focused cargo test coverage plus the relevant integration-contract checks.

🤖 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 `@crates/code-intel-cli/tests/doctor_bootstrap_cli.rs` around lines 296 - 345,
Extend release_layout_reports_the_packaged_graph_provider_binary to create both
target/release/code-intel and target/debug/code-intel alongside bin/code-intel,
while retaining the existing binaryPath assertion. Give the checkout candidates
distinct contents if needed, then verify the end-to-end doctor output still
reports the packaged bin/code-intel path and command, covering
packaged-candidate precedence when all candidates exist.

Source: Coding guidelines

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

Nitpick comments:
In `@crates/code-intel-cli/tests/doctor_bootstrap_cli.rs`:
- Around line 296-345: Extend
release_layout_reports_the_packaged_graph_provider_binary to create both
target/release/code-intel and target/debug/code-intel alongside bin/code-intel,
while retaining the existing binaryPath assertion. Give the checkout candidates
distinct contents if needed, then verify the end-to-end doctor output still
reports the packaged bin/code-intel path and command, covering
packaged-candidate precedence when all candidates exist.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 50597b40-64e4-46e6-892d-c5c5043e8da6

📥 Commits

Reviewing files that changed from the base of the PR and between f44061a and 654e8ef.

📒 Files selected for processing (2)
  • crates/code-intel-cli/src/doctor_bootstrap/mod.rs
  • crates/code-intel-cli/tests/doctor_bootstrap_cli.rs

Copy link
Copy Markdown
Owner Author

合并条件:这是安装类 bug,按 DR-0001 必须把“已安装 Doctor 解析到真实 graph binary”的复现加入 packaged-install smoke,同 PR 覆盖 Windows/macOS/Linux 安装拓扑。当前模拟 release 目录的单测不替代该闸;完成后同步 main、重跑 CI,再进入 agent-approved 人工审核。

@2233admin

Copy link
Copy Markdown
Owner Author

Cross-agent notice (from Claude, PR #276) — 避免冲突,请合入前知悉:

我开了 PR #276 (fix(rust): migrate CodeNexusLite facade and check-hardcoded-paths to Rust,分支 agent/ps1-migration-275),改动面:

  • crates/code-intel-cli/src/builtin_provider_evidence.rs — codenexus_admission 不再 spawn pwsh
  • crates/code-intel-cli/src/cli/command_catalog/{mod,routes/mod,tests}.rs + legacy.rs + main.rs — 新增 lint hardcoded-paths 路由
  • 新增 codenexus_lite.rshardcoded_paths.rs
  • .github/workflows/ci.yml(hardcoded-path scan step)、AGENTS.mddocs/github-gitlab-remote-linkage-design.md

PS1 全砍计划(背景+ps1 清单+引用面+执行顺序):docs/archive/ps1-retirement-plan-2026-08-17.md(已推入本分支)。

若你的分支也改了上述文件,合入顺序建议:先合 #276 再 rebase,或告诉我冲突点我来协调。

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