Repository navigation
feat: generate toolchain profiles from installed toolchains - #75
Conversation
Add a core discovery service with one detector per family (Rust, C and C++, Java, Python, Perl, Go, Node.js, .NET, Ruby) that reads install folders, the operator's PATH and toolchain variables, and small installer-written files, and runs no program. The settings window lists its proposals and, after one native confirmation per batch, records the selected ones through add_profile or, on Windows, grants the folders a workspace container needs through grant_container_access (ADR-0103). Core gains check_profile and a reasoned 32-profile refusal; the platform crate gains a WRITE_DAC probe so only grants this account can apply are offered. Version 0.65.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 16 minutes. View limit details
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. |
|
⏭️ Review skipped on The pull request was closed before the review started. |
On Linux the fixture's Go sits in usr/local/go, inside the system part's usr root, so core drops the nested root and the proposal lists usr alone. The discovery listing test expected two roots on every platform and failed on ubuntu-24.04. It now expects the exact roots for each platform. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🤖 Automated review of 4a2da2c
Bot review number 1 of 30.
This PR adds read-only discovery of installed toolchains and turns them into proposed profiles, with native confirmation before any profile or container grant is recorded, plus desktop plumbing, a settings UI panel, mock-backend support, platform helpers, core tests, and ADR-0103 docs. The change is generally careful and has no blocking P1/P2 findings; counts, command names, documented limits, and test counts are consistent across core, app, and docs. The main risks are minor grant-status and post-apply edge cases: an unknown root grant is silently dropped, a workspace grant check and invalid workspace_id handling can misreport outcomes, grant batches are not pre-validated, and FIFO installer paths can hang discovery. Remaining findings are P4 quality/accuracy issues in UI refresh/doc comments, caps, and documentation claims.
Findings: 🟡 5 × [P3] MINOR (Defect) · 🔵 7 × [P4] MINOR (Quality)
🛑 Changes requested: 5 unresolved finding(s) at [P3] MINOR (Defect) or above. I'll withdraw this once they're fixed or resolved.
Files not reviewed (1)
Cargo.lock (ignored by pattern)
1 lower-priority or previously reported findings were omitted.
Model beam → deepseek-v4.1-flash · skill code-change-review · 45 files reviewed. Reply to an inline comment to discuss it.
Main took version 0.65.0 and ADR-0100 for the command tool's recorded profile list (PR #73). This branch keeps ADR-0103 and moves to 0.66.0. The ADR index lists both records, and the execution guide's toolchain profile paragraph keeps both the generated-profiles sentence and the command tool's profile rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Address the PR 75 review: - core: check_container_grants applies every grant rule to a batch without recording, through prepare_grant shared with grant_container_access. - discovery: open installer files only when they are regular files; drop proposals whose roots are links; filter listings before keeping 512 directories (scanning at most 16,384 entries); past 32 proposals keep each name's first installation and report the omitted count. - desktop: check the workspace before the add dialog; check the whole grant batch with core before the grant dialog; read ACLs with the settings store closed; name folders whose ACLs could not be read instead of saying every folder is readable. - UI: show the omitted count; generate a shown list again when another workspace is chosen; restore the createMockBackend doc comment. - docs: say discovery never reads repository configuration such as rust-toolchain.toml, and record the new rules in ADR-0103. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🤖 Automated re-review of ae847ca
Bot review number 2 of 30.
New findings are only on code changed since the last review (4a2da2c); the rest was reviewed then.
This PR adds toolchain profile generation from installed toolchains, including the discovery logic, a settings discovery panel with mock backend and IPC types, detector fixtures and tests, plus an ADR and operator-facing docs. The implementation reads sound across all three review parts—bounds, filtering, selection/refusal behavior, and workspace refresh all match their assertions—and no reachable code defect was identified. The remaining risks are documentation-accuracy only: contradictions about pending grants and FIFO blocking, understated environment variables, a missing container-access state, and inaccuracies about list ordering and the system part's lib64/lib32 directories. All findings are P4 minor quality issues, so the main exposure is operator confusion from drifting docs rather than runtime behavior.
Findings: 🔵 6 × [P4] MINOR (Quality)
✅ Approved: no unresolved findings at [P3] MINOR (Defect) or above.
Files not reviewed (1)
Cargo.lock (ignored by pattern)
Model beam → deepseek-v4.1-flash · skill code-change-review · 46 files reviewed. Reply to an inline comment to discuss it.
Address the second PR 75 review: - Say a recorded grant can still stay pending (container_access_failed) instead of claiming discovery never leaves one. - Name JAVA_HOME, GOROOT and RUSTUP_HOME in the panel's help and nothing-found text. - Say the FIFO check narrows the race rather than closing it. - List the fourth container-access state (access could not be read). - Give the per-name order as preferred installation first, then newest. - List lib64 and lib32 in the Linux system part. - Name check_grant_scope in the read-write grant comment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main took version 0.66.0 for movable section dividers (ADR-0101), so toolchain discovery moves to 0.67.0. Both changelog entries and both ADR index rows are kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🤖 Automated re-review of 834346d
Bot review number 3 of 30.
New findings are only on code changed since the last review (ae847ca); the rest was reviewed then.
This PR adds generation of toolchain profiles from installed toolchains, along with related documentation and comment clarifications. It keeps grant-active inference consistent with core read-write grant scope checks. Remaining risks are user-facing wording defects in discovery help and empty-state text, plus an ordering wording issue in the generated-profile documentation, which should be corrected before release.
Findings: 🔵 1 × [P4] MINOR (Quality)
✅ Approved: no unresolved findings at [P3] MINOR (Defect) or above.
Files not reviewed (1)
Cargo.lock (ignored by pattern)
1 lower-priority or previously reported findings were omitted.
Model beam · skill code-change-review · 46 files reviewed. Reply to an inline comment to discuss it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🤖 Automated re-review of 92403ac
Bot review number 4 of 30.
New findings are only on code changed since the last review (834346d); the rest was reviewed then.
This PR bumps metadata/version and updates changelog and documentation for generating toolchain profiles from installed toolchains. The main risks are documentation inconsistencies: the changelog misnames the feature, the desktop overview overstates which folders discovery grants, and the execution guide attributes the feature to 0.66.0 instead of 0.67.0.
Findings: 🔵 2 × [P4] MINOR (Quality)
✅ Approved: no unresolved findings at [P3] MINOR (Defect) or above.
Files not reviewed (1)
Cargo.lock (ignored by pattern)
Model beam · skill code-change-review · 46 files reviewed. Reply to an inline comment to discuss it.
- Qualify the desktop overview and AGENTS.md: on Windows the container is granted only the needed folders this account can change; the others are named and skipped. - Keep the control's label in the changelog and say it generates toolchain profiles from installed toolchains. - Move execution.md's generated-profiles intro to version 0.67.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🤖 Automated re-review of 7e80dfe
Bot review number 5 of 30.
New findings are only on code changed since the last review (92403ac); the rest was reviewed then.
Reviewed the touched help and empty-state wording in discovery_panel.ts. The changed lines are accurate and consistent with discovery's documented behavior; no new issues were found in those lines.
No new issues found in this update.
✅ Approved: no unresolved findings at [P3] MINOR (Defect) or above.
Files not reviewed (1)
Cargo.lock (ignored by pattern)
Model beam · skill code-change-review · 46 files reviewed. Reply to an inline comment to discuss it.
There was a problem hiding this comment.
🤖 Automated re-review of 7b544e0
Bot review number 6 of 30.
New findings are only on code changed since the last review (7e80dfe); the rest was reviewed then.
This PR adds a feature for generating toolchain profiles from installed toolchains and updates the accompanying documentation, including a new desktop-interface overview bullet and revised execution docs. Reviewers found no new code defects: the new overview claims and version/label references match the implementation (settings_grant_discovered_roots, root_grant_need, UI constants, Cargo.toml 0.67.0) and the "records and grants nothing" discovery behavior matches ADR-0103. The main risks are documentation accuracy: AGENTS.md implies Windows records profiles by granting folders rather than through the core add call, and the CHANGELOG heading and first sentence disagree on whether profiles come from local packages or installed toolchains. Two previously raised issues — the lib64/lib32 system part and the "newest first" ordering — also remain open.
Findings: 🔵 2 × [P4] MINOR (Quality)
✅ Approved: no unresolved findings at [P3] MINOR (Defect) or above.
Files not reviewed (1)
Cargo.lock (ignored by pattern)
Model beam → deepseek-v4.1-flash · skill code-change-review · 46 files reviewed. Reply to an inline comment to discuss it.
main took version 0.67.0 for per-session reasoning effort (ADR-0102), so toolchain discovery moves to 0.68.0. The desktop shell now has 66 commands: 31 in main (main's new effort command), 3 in approvals, and 32 in settings (this branch's three discovery commands). Both changelog entries, both ADR index rows, and both mock-backend imports are kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o installed toolchains - AGENTS.md: profiles are recorded through the core add call on every platform; on Windows a separate command grants folders. - CHANGELOG: say the button's "local packages" are the toolchains installed on this computer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|



Summary
Adds Generate toolchain profiles from local packages to the Toolchain profiles group of the desktop
settingswindow (ADR-0103). A core service finds installed toolchains by reading folders only and proposes profiles for the operator to select. After one native confirmation per batch, it records each selected profile through the existing core call, and on Windows each needed read-execute container grant. Version 0.68.0.What changed
omgcode_core::toolchain_discovery):PATH,JAVA_HOME,GOROOTandRUSTUP_HOME, and small installer-written files, opened only when they are regular files.rust-toolchain.toml.discover_boundedreports how many were left out.~/.cargo.ControlStore::check_profileapplies everyadd_profilerule without recording anything;add_profilegives the 32-profile limit its own reason.check_container_grantsapplies every grant rule to a whole batch without recording anything. The rules are scope, storage overlap, repeats, and the 32-per-workspace and 256-total limits. It sharesprepare_grantwithgrant_container_access.root_grant_needreports whether a workspace container can read a root, needs a grant, or needs an administrator. It reads the Windows ACL and tries aWRITE_DACopen inomgcode-platform; nothing changes.settingswindow:settings_discover_toolchains,settings_add_discovered_profilesandsettings_grant_discovered_roots.discovery_changed. Before any dialog it checks the workspace, then the profiles or the whole grant batch, with core.PATHentry and variable value, or every folder to grant, and the change applies from the confirmed revision.PATHentries,NAME=valuevariables, notes, refusal reasons) and Add selected profiles….execution.md,development-tools.md,desktop-interface.md,AGENTS.md,CHANGELOG.md; version 0.67.0 → 0.68.0.Why it changed
An operator's chat failed with
toolchain profile is not recorded. No profile had ever been recorded, and writing one by hand means knowing every root,PATHentry and variable. Discovery proposes them but grants nothing: every record still goes through the core add or grant call with a native confirmation.Known limits are documented, not worked around. Model runs have no network, a 20-second deadline and 1 GiB of memory, so a
cargobuild that needs crates.io dependencies still fails offline.Merge note:
mainis merged in. It took ADR-0100 (command-tool profiles, version 0.65.0), ADR-0101 (movable section dividers, version 0.66.0) and ADR-0102 (reasoning effort, version 0.67.0), so this branch is now 0.68.0 with 66 desktop commands (31 inmain, 3 inapprovals, 32 insettings). ADR-0103 keeps its number; renumber the version, not the ADR, if another PR lands first.Tests
Updated
crates/omgcode-core/src/control/profile/tests.rs:check_profilematchesadd_profileand records nothing; the 32-profile limit has its own reason.crates/omgcode-core/src/control/container/tests.rs: the non-Windows test also checks thatcheck_container_grantsis refused as unsupported.crates/omgcode-desktop/src/policy.rsandcrates/omgcode-desktop/tests/layers.rs: 66 commands (32 insettings) and the settings capability list.crates/omgcode-desktop/ui/tests/dist.test.ts: the settings bundle reads the three new commands.New
crates/omgcode-core/src/toolchain_discovery/tests.rs: detector tests on Windows and Linux fixture trees, plus one ignored test that runs discovery on the real host. They cover every family, links,PATHresolution, drive-root and home refusal, shape rules, digests, bounds, the fair share past 32, long listings and naming. Two tests run only on Unix or Linux: a root that is a link is not proposed, and a FIFO at an installer file does not block discovery.crates/omgcode-core/src/control/container/tests.rs: a Windows test that a grant batch is checked against every grant rule and records nothing.crates/omgcode-app/src/desktop/settings_discovery.rsunit tests, including the reasons given when nothing can be granted.crates/omgcode-app/tests/desktop_settings_discovery.rs: 16 service tests on Windows (13 on Linux) with a scripted prompt and a fixture host. They cover listing, confirmation text, cancel, stale revision, bad selections,discovery_changed, core refusal before any dialog, an unknown workspace before any dialog, a change during the dialog, a partial batch, Windows grant states, a folder core would not grant, and non-Windows refusal.crates/omgcode-desktop/ui/tests/settings_discovery.test.ts: 18 Vitest tests for the panel and the mock commands, including the omitted count and the list being generated again for another workspace.Checks run on Windows 11:
cargo fmt --all -- --check,cargo clippy --workspace --all-targets --locked -- -D warnings,cargo test --workspace --all-targets --locked --no-fail-fast,cargo test --workspace --doc --locked,npm run check,npm run lint,npm testandnpm run test:dist.Checks run on Ubuntu 24.04 in WSL:
cargo clippyonomgcode-coreandomgcode-app, the discovery and container tests, and the app's discovery unit and integration tests. CI runs the full Linux job.The ignored real-host test ran on this Windows machine. It found Rust (3), MSVC, Clang, Python (2), Go, Node.js and .NET (2) proposals, all within core's rules. The panel was driven in the Vite mock.
Not run: the native dialogs and the real Tauri settings window, and applying a real container grant.
🤖 Generated with Claude Code