chore: Simplify native CLI install path handling
Merged
HA
3mo ago+376+376+012345678901234567890123456789-337-337-012345678901234567890123456789
Summary
- Preserve native CLI setup behavior while separating install path resolution from process execution and orchestration.
- Keep existing public installer and setup APIs unchanged.
User Impact
- No user-visible behavior change.
- Install, uninstall, PATH setup, and package-owned CLI detection continue to use the same paths, comparisons, and commands.
Changes
- Move install path calculation, comparison, ownership checks, and environment reads into
NativeCliInstallPathResolver. - Keep current-process PATH writes in
NativeCliInstaller, maintaining a clear read/write boundary. - Move uninstall command construction into
NativeCliCommandBuilderafter path resolution becomes an independent dependency. - Update production callers and existing tests to reference the extracted responsibilities directly without compatibility wrappers.
- Restore
QuoteProcessArgumentfrom internal to private visibility after all command construction becomes builder-internal; this is the only non-move production change.
Verification
- Unity compile: 0 errors, 0 warnings
NativeCliInstallerTests: 32 passed- Related detector, PATH setup, application service, and static guard fixtures: 51 passed
- No resolver-to-installer reverse references
- No IPC or protocol changes
Review Follow-up
- CodeRabbit and cubic identified a pre-existing raw PATH comparison that can leave a trailing-separator duplicate in the current-process PATH.
- The finding is recorded as R2-29 [Medium] for a separate Red-Green TDD fix so this PR retains its move-only review guarantee; CLI resolution and the persisted User PATH are unaffected.