Skip to content

fix(capability): reject bin forwarder manifests, fall back to CODE_INTEL_HOME (#218) - #227

Closed
2233admin wants to merge 1 commit into
mainfrom
fix/discover-manifest-root-218
Closed

fix(capability): reject bin forwarder manifests, fall back to CODE_INTEL_HOME (#218)#227
2233admin wants to merge 1 commit into
mainfrom
fix/discover-manifest-root-218

Conversation

@2233admin

Copy link
Copy Markdown
Owner

Closes #218

Problem

On Windows v0.7.0, a fresh install fails at the doctor node:

[FAIL] <repo>
  Outcome: domain_failed
  Cause: doctor - doctor diagnosis: bootstrap readiness failed; manifest reconciliation failed

The installer copies orchestration/integrations.json to <bin>/orchestration/ as a forwarder, but discover_manifest (exe ancestor walk) prefers that copy and root_for_manifest treats <bin> as the repository root — every relative entrypoint resolves under <bin> and is missing (~40 integration ... entrypoint missing errors).

Fix

  • capability.rs: new is_repo_like / manifest_root; auto-discovered manifests must resolve to a real checkout (pipeline.config.json / Cargo.toml / .git), else discovery falls through to CODE_INTEL_HOME. manifest_root_from is the pure env-injected variant so unit tests don't race on process env.
  • orchestration.rs: root_for_manifest distinguishes explicit --manifest (honored as-is; keeps doctor_envelope behavior) from auto-discovery (requires checkout).
  • doctor_adapter.rs / capability_inventory.rs: pipeline_root uses the shared manifest_root.
  • bootstrap.py: installer subprocess now runs with CODE_INTEL_HOME pinned to the release root — a caller shell's MSYS-style /d/... value is no longer written verbatim to the user registry as C:\d\....

Test-suite hardening (same PR, developer-machine flakiness)

  • file_gate/walk.rs: tolerate directories vanishing mid-walk (NotFound) — parallel race between sentrux cycle checks and tool_path temp dirs.
  • internalization_record: fixture git clears core.excludesFile so a user global ignore (e.g. *.bin) can't block git add binary.bin.
  • native_code_evidence: legacy pwsh facade clears PIPELINE_VARS so a shell CODE_INTEL_HOME pointing at an installed release's stale manifest can't poison the run.
  • snapshot_identity: builds the shallow repo via a .git/shallow boundary instead of file:// clone (fails under Windows 8.3 short temp names).

Verification

  • cargo test: 3794 passed / 0 failed
  • code-intel doctor bootstrap passes with the bin forwarder present (and without CODE_INTEL_INTEGRATIONS_MANIFEST)
  • orchestrate --action Validate clean on the forwarder copy (was ~40 errors)
  • code-intel repin clean; legacy/tools/check-hardcoded-paths.ps1 OK

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 24 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

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: 921c44da-9ea6-486e-b59f-39ad54c2b977

📥 Commits

Reviewing files that changed from the base of the PR and between a73a5b9 and cea9338.

📒 Files selected for processing (98)
  • crates/code-intel-cli/tests/snapshot_identity.rs
  • orchestration/internalization/git.json
  • orchestration/retirements/e02-recommender/compatibility-retirement-deletion-diff.json
  • orchestration/retirements/e02-recommender/compatibility-retirement-manifest.json
  • orchestration/retirements/e02-recommender/compatibility-retirement-ticket.json
  • orchestration/retirements/e02-recommender/e00-request.json
  • orchestration/retirements/e02-recommender/e01-request.json
  • orchestration/retirements/e02-recommender/e01-stderr.txt
  • orchestration/retirements/e02-recommender/evidence/c00-necessity.json
  • orchestration/retirements/e02-recommender/evidence/compatibility-window.json
  • orchestration/retirements/e02-recommender/evidence/contract-parity.json
  • orchestration/retirements/e02-recommender/evidence/dependency-d02-clean-machine.json
  • orchestration/retirements/e02-recommender/evidence/dependency-repo-snapshot.json
  • orchestration/retirements/e02-recommender/evidence/effect-parity.json
  • orchestration/retirements/e02-recommender/evidence/golden-parity.json
  • orchestration/retirements/e02-recommender/evidence/independent-approval.json
  • orchestration/retirements/e02-recommender/evidence/registry-reconciliation.json
  • orchestration/retirements/e02-recommender/evidence/replacement-atom.json
  • orchestration/retirements/e02-recommender/evidence/rollback-execution.json
  • orchestration/retirements/e02-recommender/evidence/usage-observation.json
  • orchestration/retirements/e02-recommender/gate-out/compatibility-retirement-decision.json
  • orchestration/retirements/e03-provider-preflight/compatibility-retirement-deletion-diff.json
  • orchestration/retirements/e03-provider-preflight/compatibility-retirement-manifest.json
  • orchestration/retirements/e03-provider-preflight/compatibility-retirement-ticket.json
  • orchestration/retirements/e03-provider-preflight/e00-request.json
  • orchestration/retirements/e03-provider-preflight/e01-request.json
  • orchestration/retirements/e03-provider-preflight/e01-stderr.txt
  • orchestration/retirements/e03-provider-preflight/evidence/c00-necessity.json
  • orchestration/retirements/e03-provider-preflight/evidence/compatibility-window.json
  • orchestration/retirements/e03-provider-preflight/evidence/contract-parity.json
  • orchestration/retirements/e03-provider-preflight/evidence/dependency-a04-admissibility.json
  • orchestration/retirements/e03-provider-preflight/evidence/dependency-repo-snapshot.json
  • orchestration/retirements/e03-provider-preflight/evidence/effect-parity.json
  • orchestration/retirements/e03-provider-preflight/evidence/golden-parity.json
  • orchestration/retirements/e03-provider-preflight/evidence/independent-approval.json
  • orchestration/retirements/e03-provider-preflight/evidence/registry-reconciliation.json
  • orchestration/retirements/e03-provider-preflight/evidence/replacement-atom.json
  • orchestration/retirements/e03-provider-preflight/evidence/rollback-execution.json
  • orchestration/retirements/e03-provider-preflight/evidence/usage-observation.json
  • orchestration/retirements/e03-provider-preflight/gate-out/compatibility-retirement-decision.json
  • orchestration/retirements/e04-codenexus-direct/compatibility-retirement-deletion-diff.json
  • orchestration/retirements/e04-codenexus-direct/compatibility-retirement-manifest.json
  • orchestration/retirements/e04-codenexus-direct/compatibility-retirement-ticket.json
  • orchestration/retirements/e04-codenexus-direct/e00-request.json
  • orchestration/retirements/e04-codenexus-direct/e01-request.json
  • orchestration/retirements/e04-codenexus-direct/e01-stderr.txt
  • orchestration/retirements/e04-codenexus-direct/evidence/c00-necessity.json
  • orchestration/retirements/e04-codenexus-direct/evidence/compatibility-window.json
  • orchestration/retirements/e04-codenexus-direct/evidence/contract-parity.json
  • orchestration/retirements/e04-codenexus-direct/evidence/dependency-b05.json
  • orchestration/retirements/e04-codenexus-direct/evidence/effect-parity.json
  • orchestration/retirements/e04-codenexus-direct/evidence/golden-parity.json
  • orchestration/retirements/e04-codenexus-direct/evidence/independent-approval.json
  • orchestration/retirements/e04-codenexus-direct/evidence/registry-reconciliation.json
  • orchestration/retirements/e04-codenexus-direct/evidence/replacement-atom.json
  • orchestration/retirements/e04-codenexus-direct/evidence/rollback-execution.json
  • orchestration/retirements/e04-codenexus-direct/evidence/usage-observation.json
  • orchestration/retirements/e04-codenexus-direct/gate-out/compatibility-retirement-decision.json
  • orchestration/retirements/e04-codenexus-direct/rollback-rehearsal/run-code-intel.ps1
  • orchestration/retirements/e07-native-code/compatibility-retirement-deletion-diff.json
  • orchestration/retirements/e07-native-code/compatibility-retirement-manifest.json
  • orchestration/retirements/e07-native-code/compatibility-retirement-ticket.json
  • orchestration/retirements/e07-native-code/e00-request.json
  • orchestration/retirements/e07-native-code/e01-request.json
  • orchestration/retirements/e07-native-code/e01-stderr.txt
  • orchestration/retirements/e07-native-code/evidence/c00-necessity.json
  • orchestration/retirements/e07-native-code/evidence/compatibility-window.json
  • orchestration/retirements/e07-native-code/evidence/contract-parity.json
  • orchestration/retirements/e07-native-code/evidence/dependency-inventory.json
  • orchestration/retirements/e07-native-code/evidence/dependency-snapshot.json
  • orchestration/retirements/e07-native-code/evidence/effect-parity.json
  • orchestration/retirements/e07-native-code/evidence/golden-parity.json
  • orchestration/retirements/e07-native-code/evidence/independent-approval.json
  • orchestration/retirements/e07-native-code/evidence/registry-reconciliation.json
  • orchestration/retirements/e07-native-code/evidence/replacement-atom.json
  • orchestration/retirements/e07-native-code/evidence/rollback-execution.json
  • orchestration/retirements/e07-native-code/evidence/usage-observation.json
  • orchestration/retirements/e07-native-code/gate-out/compatibility-retirement-decision.json
  • orchestration/retirements/e07-native-code/rollback-rehearsal/run-code-intel.ps1
  • orchestration/retirements/e08-hospital/compatibility-retirement-deletion-diff.json
  • orchestration/retirements/e08-hospital/compatibility-retirement-manifest.json
  • orchestration/retirements/e08-hospital/compatibility-retirement-ticket.json
  • orchestration/retirements/e08-hospital/e00-request.json
  • orchestration/retirements/e08-hospital/e01-request.json
  • orchestration/retirements/e08-hospital/e01-stderr.txt
  • orchestration/retirements/e08-hospital/evidence/c00-necessity.json
  • orchestration/retirements/e08-hospital/evidence/compatibility-window.json
  • orchestration/retirements/e08-hospital/evidence/contract-parity.json
  • orchestration/retirements/e08-hospital/evidence/dependency-a04.json
  • orchestration/retirements/e08-hospital/evidence/dependency-b07.json
  • orchestration/retirements/e08-hospital/evidence/effect-parity.json
  • orchestration/retirements/e08-hospital/evidence/golden-parity.json
  • orchestration/retirements/e08-hospital/evidence/independent-approval.json
  • orchestration/retirements/e08-hospital/evidence/registry-reconciliation.json
  • orchestration/retirements/e08-hospital/evidence/replacement-atom.json
  • orchestration/retirements/e08-hospital/evidence/rollback-execution.json
  • orchestration/retirements/e08-hospital/evidence/usage-observation.json
  • orchestration/retirements/e08-hospital/gate-out/compatibility-retirement-decision.json
📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Improved Windows installation and doctor-pipeline setup by correctly preserving the release location and executable paths.
    • Added safer repository and manifest detection, including fallback handling for installations using CODE_INTEL_HOME.
    • Prevented installer-generated forwarding manifests from being mistaken for repository manifests.
    • Made filesystem scanning more resilient when files or directories disappear during traversal.
    • Improved reliability when running in shallow repositories or environments with inherited Git and pipeline settings.
  • Documentation

    • Documented compatibility behavior for manifests retained by older installations.

Walkthrough

The change centralizes manifest-root resolution, handles installer environment values explicitly, tolerates disappearing filesystem entries, improves test isolation, and refreshes capability and conformance digests.

Changes

Pipeline resolution and validation

Layer / File(s) Summary
Shared manifest-root resolution
crates/code-intel-cli/src/capability.rs, crates/code-intel-cli/src/orchestration.rs, crates/code-intel-cli/src/capability_inventory.rs, crates/code-intel-cli/src/doctor_adapter.rs, legacy/install-code-intel-pipeline.ps1
Manifest discovery rejects bin-forwarder roots, supports valid CODE_INTEL_HOME fallback, and preserves separate handling for explicit manifests. Pipeline consumers use the shared root resolver.
Installer release environment
skills/code-intel-pipeline/scripts/bootstrap.py
The installer receives CODE_INTEL_HOME set to the release root and PATH prefixed with the data-root bin directory.
Filesystem and test isolation
crates/code-intel-cli/src/file_gate/walk.rs, crates/code-intel-cli/tests/internalization_record.rs, crates/code-intel-cli/tests/native_code_evidence.rs, crates/code-intel-cli/tests/snapshot_identity.rs
Filesystem walks skip transient missing entries. Fixtures clear global Git excludes, remove pipeline variables from PowerShell execution, and construct shallow repositories locally.
Release records and pinned evidence
CHANGELOG.md, crates/code-intel-cli/tests/artifact_ref.rs, crates/code-intel-cli/tests/capability_exec.rs, legacy/run-code-intel.ps1, orchestration/integrations.json, orchestration/acceptance/*, orchestration/internalization/*
Release notes, pinned implementation digests, capability records, and conformance evidence hashes are updated.

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

Possibly related issues

Possibly related PRs

Poem

A rabbit checked the manifest trail,
And found the true root without fail.
Stale paths hopped away,
Clean tests saved the day,
While fresh hashes marked the detail.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 36.36% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary fix: rejecting bin forwarder manifests and falling back to CODE_INTEL_HOME.
Description check ✅ Passed The description directly explains the manifest discovery bug, the implemented fixes, test hardening, and verification results.
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 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • 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.

@repowise-bot

repowise-bot Bot commented Aug 8, 2026

Copy link
Copy Markdown

✅ Health of changed files: 3.7 (unchanged)
⚠️ Change risk: moderate, riskier than 63% of this repo's commits.

📋 At a glance
1 file changed health · 5 hotspots touched · 2 new findings introduced · 2 co-change pairs left out · 5 files with recent fix history · 1 dead-code finding.

Files & modules (2)
  • crates (9 files)
    • .../file_gate/walk.rs
    • .../tests/capability_exec.rs
    • .../tests/snapshot_identity.rs
    • .../src/orchestration.rs
    • .../tests/internalization_record.rs
    • .../src/capability.rs
    • .../src/capability_inventory.rs
    • .../tests/artifact_ref.rs
    • .../src/doctor_adapter.rs
  • skills (1 file)
    • .../scripts/bootstrap.py

✅ Health gate: passed

📌 Before you merge

  • orchestration/internalization/rg.json changed together with .../tests/capability_exec.rs in 11 past commits and isn't in this PR
  • orchestration/integrations.json changed together with .../src/capability_inventory.rs in 11 past commits and isn't in this PR
🔎 More signals (4)

🗺️ Change map

flowchart LR
  subgraph PR ["Changed in this PR (6 with dependents)"]
    f_crates_code_intel_cli_src_capability_rs[".../src/capability.rs 🔥"]:::changed
    f_crates_code_intel_cli_src_orchestration_rs[".../src/orchestration.rs 🔥"]:::changed
    f_crates_code_intel_cli_src_capability_inventory_rs[".../src/capability_inventory.rs"]:::changed
    f_crates_code_intel_cli_src_file_gate_walk_rs[".../file_gate/walk.rs"]:::changed
    f_crates_code_intel_cli_tests_artifact_ref_rs[".../tests/artifact_ref.rs"]:::changed
    f_crates_code_intel_cli_tests_capability_exec_rs[".../tests/capability_exec.rs"]:::changed
  end
  f_crates_code_intel_cli_src_admissibility_rs[".../src/admissibility.rs"]
  f_crates_code_intel_cli_src_capability_rs --> f_crates_code_intel_cli_src_admissibility_rs
  f_crates_code_intel_cli_src_artifact_index_rs[".../src/artifact_index.rs"]
  f_crates_code_intel_cli_src_capability_rs --> f_crates_code_intel_cli_src_artifact_index_rs
  f_crates_code_intel_cli_src_builtin_provider_evidence_rs[".../src/builtin_provider_evidence.rs"]
  f_crates_code_intel_cli_src_capability_rs --> f_crates_code_intel_cli_src_builtin_provider_evidence_rs
  f_crates_code_intel_cli_src_compatibility_retirement_gate_rs[".../src/compatibility_retirement_gate.rs"]
  f_crates_code_intel_cli_src_capability_rs --> f_crates_code_intel_cli_src_compatibility_retirement_gate_rs
  f_crates_code_intel_cli_src_main_rs[".../src/main.rs"]
  f_crates_code_intel_cli_src_orchestration_rs --> f_crates_code_intel_cli_src_main_rs
  f_crates_code_intel_cli_src_anchor_verification_mod_rs[".../anchor_verification/mod.rs"]
  f_crates_code_intel_cli_src_capability_inventory_rs --> f_crates_code_intel_cli_src_anchor_verification_mod_rs
  f_crates_code_intel_cli_src_edit_impact_rs[".../src/edit_impact.rs"]
  f_crates_code_intel_cli_src_capability_inventory_rs --> f_crates_code_intel_cli_src_edit_impact_rs
  f_crates_code_intel_cli_src_capability_inventory_rs --> f_crates_code_intel_cli_src_main_rs
  f_crates_code_intel_cli_src_file_gate_mod_rs[".../file_gate/mod.rs"]
  f_crates_code_intel_cli_src_file_gate_walk_rs --> f_crates_code_intel_cli_src_file_gate_mod_rs
  f_crates_code_intel_cli_tests_artifact_ref_rs --> f_crates_code_intel_cli_src_main_rs
  f_crates_code_intel_cli_tests_capability_exec_rs --> f_crates_code_intel_cli_src_main_rs
  more(["+15 more dependents"])
  PR --> more
  w_orchestration_internalization_rg_json(["⚠️ orchestration/internalization/rg.json changed together 11×, not in PR"]):::warn
  f_crates_code_intel_cli_tests_capability_exec_rs -.- w_orchestration_internalization_rg_json
  w_orchestration_integrations_json(["⚠️ orchestration/integrations.json changed together 11×, not in PR"]):::warn
  f_crates_code_intel_cli_src_capability_inventory_rs -.- w_orchestration_integrations_json
  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 (23 direct dependents, from the last indexed snapshot). Dashed: history/tests.

🔥 Hotspots touched (5)

  • .../tests/capability_exec.rs: 14 commits/90d, 4 dependents
  • .../tests/snapshot_identity.rs: 3 commits/90d, 1 dependents
  • .../src/orchestration.rs: 6 commits/90d, 2 dependents
2 more
  • .../tests/internalization_record.rs: 11 commits/90d, 1 dependents
  • .../src/capability.rs: 8 commits/90d, 22 dependents

🔗 Hidden coupling (2 files)

  • .../tests/capability_exec.rs co-changes with orchestration/internalization/rg.json (11×, 🟡 notable), not in this PR.
  • .../src/capability_inventory.rs co-changes with these files (not in this PR):
    • orchestration/integrations.json (11×, 🟡 notable)
    • orchestration/internalization/rg.json (11×, 🟡 notable)

💀 Dead code (1 finding)

  • 💀 .../scripts/bootstrap.py (file-level) (confidence 0.40)

📊 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 01:59 UTC

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

Code Intel change risk

Score Percentile Level
65/100 73th (vs last 49 commits) 🟡 medium

Top signals

  • Diff shape: 116 file(s), +344/-155 (max file share 0.21)
  • Test asymmetry: source changed, tests touched
  • Bug-magnet: 727 fix commit(s) in touched files (180d)
  • Churn: 1654 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.

Actionable comments posted: 1

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

477-481: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Get HEAD through Git instead of reading .git/HEAD.

Read the local .git/HEAD file when the repository uses reftable storage and HEAD points to an invalid ref name; the test needs to create a valid repository from the clone instead of parsing the ref target.

Run git -C &full rev-parse HEAD, then write that ID to .git/shallow.

🤖 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/snapshot_identity.rs` around lines 477 - 481,
Update the shallow-repository setup around the shallow variable to obtain the
current commit via Git using rev-parse HEAD in the cloned repository, rather
than reading and parsing .git/HEAD and its referenced ref file. Write the
returned commit ID, trimmed, followed by a newline to .git/shallow, preserving
the existing shallow assignment.
🤖 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 `@crates/code-intel-cli/src/file_gate/walk.rs`:
- Around line 26-35: The read_dir NotFound handling in the walk_candidates flow
must reject a missing scan root while still treating disappeared descendant
directories as empty. When directory == root, propagate an error; retain the
existing Ok(()) behavior otherwise. Add focused cargo tests covering both a
missing root and a disappearing child directory, plus the relevant
integration-contract checks.

---

Nitpick comments:
In `@crates/code-intel-cli/tests/snapshot_identity.rs`:
- Around line 477-481: Update the shallow-repository setup around the shallow
variable to obtain the current commit via Git using rev-parse HEAD in the cloned
repository, rather than reading and parsing .git/HEAD and its referenced ref
file. Write the returned commit ID, trimmed, followed by a newline to
.git/shallow, preserving the existing shallow assignment.
🪄 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: 211ebedb-5088-467f-b810-29ae7805f7f5

📥 Commits

Reviewing files that changed from the base of the PR and between b0cfa7c and a73a5b9.

📒 Files selected for processing (20)
  • CHANGELOG.md
  • crates/code-intel-cli/src/capability.rs
  • crates/code-intel-cli/src/capability_inventory.rs
  • crates/code-intel-cli/src/doctor_adapter.rs
  • crates/code-intel-cli/src/file_gate/walk.rs
  • crates/code-intel-cli/src/orchestration.rs
  • crates/code-intel-cli/tests/artifact_ref.rs
  • crates/code-intel-cli/tests/capability_exec.rs
  • crates/code-intel-cli/tests/internalization_record.rs
  • crates/code-intel-cli/tests/native_code_evidence.rs
  • crates/code-intel-cli/tests/snapshot_identity.rs
  • legacy/install-code-intel-pipeline.ps1
  • legacy/run-code-intel.ps1
  • orchestration/acceptance/native-code-evidence-candidate.json
  • orchestration/integrations.json
  • orchestration/internalization/ast-grep.json
  • orchestration/internalization/git.json
  • orchestration/internalization/native-code-evidence.json
  • orchestration/internalization/rg.json
  • skills/code-intel-pipeline/scripts/bootstrap.py

Comment on lines +26 to +35
let entries = match fs::read_dir(directory) {
Ok(entries) => entries,
Err(error) if error.kind() == std::io::ErrorKind::NotFound => {
// The directory vanished between enumeration and now (for example
// a parallel test or tool created and removed a temp directory
// under `target/` while this walk was in flight). Treat it as
// empty rather than failing the whole scan: concurrent cleanup is
// not a repository integrity problem. Other IO errors (permission,
// hardware) still propagate.
return Ok(());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Reject NotFound for the scan root.

evaluate calls walk_candidates(repo, repo, ...). If repo disappears before this call, Lines 26-35 return success and produce a report with zero candidates. This can make a failed scan appear clean.

Return an error when directory == root. Keep the current skip behavior only for descendant directories. Add focused coverage for both a missing root and a disappearing child directory.

Proposed fix
-        Err(error) if error.kind() == std::io::ErrorKind::NotFound => {
+        Err(error)
+            if error.kind() == std::io::ErrorKind::NotFound && directory != root =>
+        {
             // The directory vanished between enumeration and now (for example
             // a parallel test or tool created and removed a temp directory
             // under `target/` while this walk was in flight). Treat it as

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

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
let entries = match fs::read_dir(directory) {
Ok(entries) => entries,
Err(error) if error.kind() == std::io::ErrorKind::NotFound => {
// The directory vanished between enumeration and now (for example
// a parallel test or tool created and removed a temp directory
// under `target/` while this walk was in flight). Treat it as
// empty rather than failing the whole scan: concurrent cleanup is
// not a repository integrity problem. Other IO errors (permission,
// hardware) still propagate.
return Ok(());
let entries = match fs::read_dir(directory) {
Ok(entries) => entries,
Err(error)
if error.kind() == std::io::ErrorKind::NotFound && directory != root =>
{
// The directory vanished between enumeration and now (for example
// a parallel test or tool created and removed a temp directory
// under `target/` while this walk was in flight). Treat it as
// empty rather than failing the whole scan: concurrent cleanup is
// not a repository integrity problem. Other IO errors (permission,
// hardware) still propagate.
return Ok(());
🤖 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/src/file_gate/walk.rs` around lines 26 - 35, The
read_dir NotFound handling in the walk_candidates flow must reject a missing
scan root while still treating disappeared descendant directories as empty. When
directory == root, propagate an error; retain the existing Ok(()) behavior
otherwise. Add focused cargo tests covering both a missing root and a
disappearing child directory, plus the relevant integration-contract checks.

Source: Coding guidelines

@2233admin
2233admin force-pushed the fix/discover-manifest-root-218 branch 2 times, most recently from 317ba14 to edb7458 Compare August 8, 2026 01:36
…TEL_HOME (#218)

Installer copies orchestration/integrations.json into <bin>/orchestration/ as
a forwarder, but discover_manifest prefers that copy (exe ancestor walk) and
root_for_manifest treats <bin> as the repository root, so every entrypoint
resolves under <bin> and fails (~40 'entrypoint missing' errors). The pipeline
then fails at the doctor node on any fresh Windows install.

- capability.rs: add is_repo_like/manifest_root; auto-discovered manifests
  must resolve to a real checkout (pipeline.config.json/Cargo.toml/.git),
  otherwise discovery falls through to CODE_INTEL_HOME. manifest_root_from is
  the pure, env-injected variant so tests avoid racing on process env.
- orchestration.rs: root_for_manifest distinguishes explicit --manifest
  (honored as-is; doctor_envelope regression guard) from auto-discovery
  (requires checkout).
- doctor_adapter.rs / capability_inventory.rs: pipeline_root uses shared
  manifest_root.
- bootstrap.py: installer subprocess now runs with CODE_INTEL_HOME pinned to
  the release root, so a caller shell's MSYS-style /d/... value is no longer
  written verbatim into the user registry as C:\d\...

Also hardens the test suite against developer-machine git/env state:
- file_gate/walk.rs tolerates directories vanishing mid-walk (NotFound),
  fixing a parallel race between sentrux cycle checks and tool_path temp dirs
- internalization_record fixture git clears core.excludesFile (user global
  ignore no longer blocks git add binary.bin)
- native_code_evidence clears PIPELINE_VARS for the legacy pwsh facade (shell
  CODE_INTEL_HOME no longer points at an installed release's stale manifest)
- snapshot_identity builds the shallow repo via .git/shallow boundary instead
  of file:// clone, which fails under Windows 8.3 short temp names

Verified: cargo test 3794 passed / 0 failed; code-intel doctor bootstrap
passes with the bin forwarder present; orchestrate Validate clean; repin
clean; check-hardcoded-paths OK.
@2233admin

Copy link
Copy Markdown
Owner Author

处置判词(撞车对账,依 DR-0004 撤退方留痕):#218 的修法由 #228 承接——两案差异见 docs/decisions/DR-0003(probe 验不变量而非形态;manifest 与 root 不分家;orchestrate 补 env var 档)。本 PR 请 rebase 成只保留五件独立真货:bootstrap.py MSYS CODE_INTEL_HOME 毒化修复、file_gate/walk.rs NotFound 竞态容错(#178 根修)、internalization_record 清 core.excludesFile、native_code_evidence 清 PIPELINE_VARS、snapshot_identity 绕 8.3 短路径——并按保留集重算 digest pin。这五件每一件都该进主干。

@2233admin

Copy link
Copy Markdown
Owner Author

Closing in favor of #228 (merged, earlier + more focused fix for #218). The unique high-value changes from this branch (bootstrap.py CODE_INTEL_HOME pinning, test-suite hermeticity hardening) will be extracted into a follow-up PR.

@2233admin 2233admin closed this Aug 8, 2026
2233admin pushed a commit that referenced this pull request Aug 8, 2026
…st-suite hermeticity

Follow-up extracted from the closed #227 (the #218 fix itself landed via #228).
This branch carries the parts of that work #228 did not cover:

- bootstrap.py: the installer subprocess now runs with CODE_INTEL_HOME pinned
  to the release root (was inheriting the caller shell). A git-bash MSYS-style
  CODE_INTEL_HOME like /d/projects/... was written verbatim into the user
  registry as C:\d\projects\... and poisoned every later run; now installer
  and doctor both use the same pinned environment.

- file_gate/walk.rs: tolerate a directory vanishing mid-walk (NotFound) —
  treats it as empty instead of failing the whole scan. Fixes a parallel race
  between sentrux cycle checks and tool_path test temp-dir cleanup on
  developer machines.

- internalization_record: fixture git clears core.excludesFile so a user
  global ignore (e.g. *.bin) can no longer block git add binary.bin.

- native_code_evidence: the legacy pwsh facade clears PIPELINE_VARS so a
  shell CODE_INTEL_HOME pointing at an installed release's stale manifest
  cannot poison the comparison run.

- snapshot_identity: builds the shallow repo via a .git/shallow boundary
  instead of file:// clone, which fails under Windows 8.3 short temp names
  (git parses file:///C:/... as a relative /C:/... path).

Verified: cargo test 3827 passed / 0 failed (MSVC toolchain, clean target);
repin clean; check-hardcoded-paths OK.
2233admin pushed a commit that referenced this pull request Aug 8, 2026
…st-suite hermeticity

Follow-up extracted from the closed #227 (the #218 fix itself landed via #228).
This branch carries the parts of that work #228 did not cover:

- bootstrap.py: the installer subprocess now runs with CODE_INTEL_HOME pinned
  to the release root (was inheriting the caller shell). A git-bash MSYS-style
  CODE_INTEL_HOME like /d/projects/... was written verbatim into the user
  registry as C:\d\projects\... and poisoned every later run; now installer
  and doctor both use the same pinned environment.

- file_gate/walk.rs: tolerate a directory vanishing mid-walk (NotFound) —
  treats it as empty instead of failing the whole scan. Fixes a parallel race
  between sentrux cycle checks and tool_path test temp-dir cleanup on
  developer machines.

- internalization_record: fixture git clears core.excludesFile so a user
  global ignore (e.g. *.bin) can no longer block git add binary.bin.

- native_code_evidence: the legacy pwsh facade clears PIPELINE_VARS so a
  shell CODE_INTEL_HOME pointing at an installed release's stale manifest
  cannot poison the comparison run.

- snapshot_identity: builds the shallow repo via a .git/shallow boundary
  instead of file:// clone, which fails under Windows 8.3 short temp names
  (git parses file:///C:/... as a relative /C:/... path).

Verified: cargo test 3827 passed / 0 failed (MSVC toolchain, clean target);
repin clean; check-hardcoded-paths OK.
2233admin pushed a commit that referenced this pull request Aug 8, 2026
…st-suite hermeticity

Follow-up extracted from the closed #227 (the #218 fix itself landed via #228).
This branch carries the parts of that work #228 did not cover:

- bootstrap.py: the installer subprocess now runs with CODE_INTEL_HOME pinned
  to the release root (was inheriting the caller shell). A git-bash MSYS-style
  CODE_INTEL_HOME like /d/projects/... was written verbatim into the user
  registry as C:\d\projects\... and poisoned every later run; now installer
  and doctor both use the same pinned environment.

- file_gate/walk.rs: tolerate a directory vanishing mid-walk (NotFound) —
  treats it as empty instead of failing the whole scan. Fixes a parallel race
  between sentrux cycle checks and tool_path test temp-dir cleanup on
  developer machines.

- internalization_record: fixture git clears core.excludesFile so a user
  global ignore (e.g. *.bin) can no longer block git add binary.bin.

- native_code_evidence: the legacy pwsh facade clears PIPELINE_VARS so a
  shell CODE_INTEL_HOME pointing at an installed release's stale manifest
  cannot poison the comparison run.

- snapshot_identity: builds the shallow repo via a .git/shallow boundary
  instead of file:// clone, which fails under Windows 8.3 short temp names
  (git parses file:///C:/... as a relative /C:/... path).

Verified: cargo test 3827 passed / 0 failed (MSVC toolchain, clean target);
repin clean; check-hardcoded-paths OK.
2233admin added a commit that referenced this pull request Aug 8, 2026
…st-suite hermeticity (#233)

Follow-up extracted from the closed #227 (the #218 fix itself landed via #228).
This branch carries the parts of that work #228 did not cover:

- bootstrap.py: the installer subprocess now runs with CODE_INTEL_HOME pinned
  to the release root (was inheriting the caller shell). A git-bash MSYS-style
  CODE_INTEL_HOME like /d/projects/... was written verbatim into the user
  registry as C:\d\projects\... and poisoned every later run; now installer
  and doctor both use the same pinned environment.

- file_gate/walk.rs: tolerate a directory vanishing mid-walk (NotFound) —
  treats it as empty instead of failing the whole scan. Fixes a parallel race
  between sentrux cycle checks and tool_path test temp-dir cleanup on
  developer machines.

- internalization_record: fixture git clears core.excludesFile so a user
  global ignore (e.g. *.bin) can no longer block git add binary.bin.

- native_code_evidence: the legacy pwsh facade clears PIPELINE_VARS so a
  shell CODE_INTEL_HOME pointing at an installed release's stale manifest
  cannot poison the comparison run.

- snapshot_identity: builds the shallow repo via a .git/shallow boundary
  instead of file:// clone, which fails under Windows 8.3 short temp names
  (git parses file:///C:/... as a relative /C:/... path).

Verified: cargo test 3827 passed / 0 failed (MSVC toolchain, clean target);
repin clean; check-hardcoded-paths OK.

Co-authored-by: Curry <curry@test.com>
@2233admin
2233admin deleted the fix/discover-manifest-root-218 branch August 8, 2026 15:58
2233admin added a commit that referenced this pull request Aug 8, 2026
…230)

* docs(decisions): stand up decision records + agent work-intake rules

Five records born from the 2026-08-08 install-campaign postmortem, where
the core finding was not any single bug but the machine that produces
them: a verification tool whose own verification points inward.

- DR-0001 install-topology gate: every install-class bug's repro must
  join the install-smoke CI gate in the same PR. 3794 checkout-topology
  tests missed every installed-topology bug that shipped with v0.7.0
  (#218, #216, skill-required, README platform claims).
- DR-0002 version pins are floors (owner decree; the counterfactual is
  #208, a parallel session arguing exact pins after the decree existed
  only in chat).
- DR-0003 manifest discovery precedence + entrypoint-probe semantics;
  probes validate the invariant (entrypoints resolve), not the shape
  (repo-like markers); manifest and root never split.
- DR-0004 issue claim protocol (the counterfactual is #227/#228: two
  sessions, one issue, two incompatible fixes).
- DR-0005 integration debt ceiling: >=5 open fix PRs stops feature work.
  The cure for the install campaign (#214) sat CLEAN and unmerged while
  GA shipped without it.

AGENTS.md gains a 'Before starting any work' intake section wiring all
five into every future session's first minute.

Refs #99 #148 #180 #184 #206 #226

* test(repowise): isolate hook fixtures

---------

Co-authored-by: Curry <curry@test.com>
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.

Installer's <bin>/orchestration/integrations.json copy breaks discover_manifest root resolution (v0.7.0)

1 participant