fix(platform): enforce strict path and version resolution - #37
Conversation
- define fail-closed platform pinning semantics - plan typed locator, JSON metadata, and verification
- add strict platform path validation and normalization\n- regenerate platform configuration schemas
- add typed source-aware fail-closed locator policy - pin canonical platform installations and preserve fallback behavior - cover version, boundary, PATH, alias, and sibling resolution
- revalidate cached executable identity and strict boundaries - select versions from canonical roots across strict and EDT discovery - preserve legacy hint behavior and capture absolute PATH roots
- add canonical resolution details to launch JSON and MCP results - cover source/version metadata and document strict resolution behavior
- parameterize platform metadata by selected binary - preserve launch-result path invariants in MCP tests
- preserve Windows drive-relative PATH roots and case-insensitive utility identity - allow strict primary config to receive its platform path from the local overlay - regenerate the published schema and clarify strict root pinning
WalkthroughИзменения добавляют ChangesСтрогое разрешение платформы
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant LaunchExecute
participant Locator
Client->>LaunchExecute: launch request
LaunchExecute->>Locator: locate platform utility
Locator-->>LaunchExecute: canonical resolution metadata
LaunchExecute-->>Client: binary and platform_resolution
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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 `@docs/superpowers/plans/2026-07-22-strict-platform-resolution.md`:
- Line 11: Change the “Task 1: Configuration and path normalization” heading
from level 3 to level 2 by using ## so the document’s heading hierarchy
satisfies markdownlint MD001.
🪄 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
Run ID: 54f4ae7b-dbf4-47ab-baa5-969f5ae3b671
📒 Files selected for processing (27)
README.mdSKILL/references/config-and-backends.mddocs/CAPABILITIES.mddocs/CONFIGURATION.mddocs/schemas/v8project.local.schema.jsondocs/schemas/v8project.schema.jsondocs/superpowers/plans/2026-07-22-strict-platform-resolution.mddocs/superpowers/specs/2026-07-22-strict-platform-resolution-design.mdsrc/config/loader.rssrc/config/model.rssrc/config/schema.rssrc/config/validate.rssrc/domain/launch.rssrc/mcp/service.rssrc/platform/locator.rssrc/platform/utilities.rssrc/use_cases/artifacts.rssrc/use_cases/build_project.rssrc/use_cases/check_syntax.rssrc/use_cases/configure_extensions.rssrc/use_cases/dump_config.rssrc/use_cases/external_artifacts.rssrc/use_cases/launch_app.rssrc/use_cases/load_artifact.rstests/cli_launch.rstests/mcp_http.rstests/mcp_stdio.rs
- promote task headings to satisfy Markdown structure checks
|
@coderabbitai review |
✅ Action performedReview finished.
|
- merge alkoleft/master into fix/platform-strict-hint\n- preserve platform resolution metadata and updated launch workflows
- make configured platform path explicit-only - ignore platform version for lenient path hints - document and test the path/version/strict matrix
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tests/cli_launch.rs (1)
243-252: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winНе допускайте тихого no-op при изменении тестовой конфигурации.
Если
tools.client_mcpиtools.platformотсутствуют или изменились отступы,replaceвернёт исходную строку, а helper молча запишет её обратно. В результате тест может проверять значения по умолчанию вместо настроенного сценария. Добавьтеassert_ne!(updated, config, "configuration marker not found")или возвращайте ошибку из helper.🤖 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 `@tests/cli_launch.rs` around lines 243 - 252, Ensure the configuration update flow around the updated value detects when neither replacement marker is found: assert that updated differs from config with the message "configuration marker not found", or propagate an equivalent helper error before writing the configuration. Preserve the existing replacement behavior when either tools.client_mcp or tools.platform is present.
🤖 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.
Outside diff comments:
In `@tests/cli_launch.rs`:
- Around line 243-252: Ensure the configuration update flow around the updated
value detects when neither replacement marker is found: assert that updated
differs from config with the message "configuration marker not found", or
propagate an equivalent helper error before writing the configuration. Preserve
the existing replacement behavior when either tools.client_mcp or tools.platform
is present.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: d3c80f73-ce7c-4579-b491-7da3db121dff
📒 Files selected for processing (18)
SKILL/references/config-and-backends.mddocs/CAPABILITIES.mddocs/CONFIGURATION.mddocs/schemas/v8project.local.schema.jsondocs/schemas/v8project.schema.jsondocs/superpowers/plans/2026-07-22-strict-platform-resolution.mddocs/superpowers/specs/2026-07-22-strict-platform-resolution-design.mdsrc/config/loader.rssrc/config/model.rssrc/config/schema.rssrc/config/validate.rssrc/domain/launch.rssrc/mcp/service.rssrc/platform/locator.rssrc/platform/utilities.rssrc/use_cases/dump_config.rssrc/use_cases/launch_app.rstests/cli_launch.rs
💤 Files with no reviewable changes (1)
- src/config/validate.rs
🚧 Files skipped from review as they are similar to previous changes (13)
- SKILL/references/config-and-backends.md
- docs/superpowers/plans/2026-07-22-strict-platform-resolution.md
- docs/CAPABILITIES.md
- docs/schemas/v8project.schema.json
- src/config/model.rs
- docs/schemas/v8project.local.schema.json
- src/use_cases/dump_config.rs
- src/domain/launch.rs
- docs/superpowers/specs/2026-07-22-strict-platform-resolution-design.md
- src/use_cases/launch_app.rs
- src/mcp/service.rs
- src/config/schema.rs
- src/platform/locator.rs
Closes #28.
What changed
tools.platform.strictwith fail-closed explicit path resolution1cv8,1cv8c, andibcmdto one canonical installation root in strict modestrict: truewith a machine-local path supplied by the local overlayVerification
cargo fmt --all -- --check,cargo check --all-targets, andgit diff --checkpassedPlatform note
Windows-specific regressions cover cross-drive drive-relative PATH handling and case-insensitive executable/BIN/1CEDT identity. The local Homebrew Rust toolchain has no Windows standard-library target, so those cfg-gated tests require Windows CI/runtime confirmation.
Two pre-existing unrelated warnings remain in
tool_extension.rsandprocess.rs.Summary by CodeRabbit
Новые возможности
tools.platform.strictдля fail-closed резолва платформенных утилит без fallback-логики.launchтеперь возвращает расширенные платформенные сведения: канонический путь, версия (илиnull), источник обнаружения и корень установки.Исправления
tools.platform.path.Документация
launch.