Repository navigation
fix(setup): refuse linked skill installation directories - #3108
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
47e6cdb to
4263051
Compare
Review PR morluto#3108 alongside the overlapping lifecycle proposal morluto#3109 on the current main baseline before verifying selected-root planning and mutation. Co-authored-by: Kaoru0822 <[email protected]>
Validate final selected roots and references before preview/approval and again before any client or Hopper change. Keep interactive proposals available for unselected clients and retain registration-only setup. Recheck at installation. Share typed directory observations across setup, identity, and maintenance. Report unmanaged paths and unknown reads with their reasons instead of missing or stale facts. Keep expected inspection failures in Result and retain cleanup failures. Propagate retained uninstall children and preserve ownership manifests. Validation: 205 related tests pass, including actual CLI preflight, lifecycle, retained bytes, selection and approval-change controls. Full static/docs checks pass. Four real CLI install/rerun/repair/uninstall workflows match main outcomes, with identical 9,758 output tokens per task; timing limits are recorded separately. The explicit unmanaged doctor reporting direction also incorporates the related proposal and issue analysis from PR morluto#3109. Co-authored-by: Kaoru0822 <[email protected]> Co-authored-by: akushonkamen <[email protected]>
Include current main before final CI; setup directory, doctor, and uninstall owners are unchanged by the intervening unrelated main corrections. Co-authored-by: Kaoru0822 <[email protected]>
|
Independent follow-up verification is complete at The original change prevents writes into linked skill/root-reference directories, but combined setup still planned an install and configured the client before refusing the skill. I reproduced both root and references cases through the real compiled CLI in isolated profiles. Uninstall preserved linked reference bytes and its ownership manifest but incorrectly returned The follow-up now:
This keeps the issue's refusal direction and incorporates the explicit doctor reporting idea from competing PR #3109, credited in the follow-up commit. Validation:
Linux, Node 24.18.0/npm 11.16.0; two CPUs and 8-GiB sampled family RSS threshold. Peak across verification was about 4.4 GiB, with no guard stop. All mutation probes used owned profiles and minimal process environments (HOME was omitted, not repurposed); an initial inherited-home dry-run was stopped by a target-path check before any writes. Native Windows execution of this follow-up, a real client-agent session, global package update, and arbitrary concurrent directory-swap containment are not claimed. Current-head CI/review remain the merge gate. |
|
Current-head CI is blocked by an unrelated new main test failure. Shard 5 reports 1 failure, 1,178 passes and 22 skips; the other four shards were cancelled. A clean checkout of this PR's integrated main baseline The smallest upstream repair is to expect |
Integrate latest main, including 1341e8c's exact capinfos stdout expectation and unconditional release of the injected cleanup failure. Setup directory, doctor, and uninstall owners are unchanged by this synchronization. Co-authored-by: Kaoru0822 <[email protected]>
Inspect every selected managed file after a freshness mismatch or read failure. Keep all unreadable paths visible even when the manifest is stale or absent, while preserving known metadata and exact cleanup/resource failure ownership. Read the manifest once in the shared inspection and consume those facts in doctor identity instead of performing a second pass that can hide failures. After a mismatch, skip redundant canonical-content comparisons while still examining subsequent file reads. Three real permission regressions fail before the change for aligned, stale, and missing manifests. All 217 related filesystem, CLI/MCP, planning, recovery and maintenance tests pass after it, as does the complete static check. Co-authored-by: Kaoru0822 <[email protected]>
An absent installed file already establishes noncanonical state. Avoid reading generated canonical artifacts for that comparison, while still inspecting all later managed files and retaining their failures. This fixes the source-only initial setup snapshot without requiring a build. A clean checkout without dist or generated skills reproduces the one failure before the change and passes all six setup-environment cases after it. All 41 selected filesystem, cleanup, actual CLI/MCP and environment tests also pass. The full no-artifact source suite passes 7,446 tests across 508 files with eight existing platform/condition skips. Co-authored-by: Kaoru0822 <[email protected]>
|
Final head is A clean checkout without Final before/after public CLI install/rerun/repair/uninstall tasks return equal results and 10,668 output tokens per four-call task (10,760 explicit transcript proxy). Before cold/warm: 10.70/9.88 s, CPU 11.74/10.58 s, peak family RSS 390/385 MiB. Fixed: 10.30/10.04 s, CPU 11.08/10.93 s, RSS 386/351 MiB. Individual trials with isolated Node compile caches and warm OS caches; no speedup or billed/whole-agent token claim. New current-head CI/review remains the merge gate. All local heavy verification stayed on two CPUs with the 8-GiB guard; no stop or OOM. Native-platform and concurrent directory-swap limits remain in the PR description. |
Render a terminal dry-run plan only after setup admission succeeds. Blocked skill or registration plans use the existing remediation output. Reuse one bounded PTY helper for success and refusal workflows; verify no linked target or client configuration changes. Follow-up-to: #3108 Validation: public CLI PTY tests and RPC owner controls pass (77 tests); build and static checks pass.
Summary
Prevent setup from writing through a linked skill root or
referencesdirectory. Validate the final selected destinations before preview/approval, again before any client/Hopper changes, and at skill installation. Fixes #3057.Problem and expected behavior
Setup could write into a symbolic link's target. The initial PR refused the skill write, but combined setup still configured the client first. An already canonical linked copy also appeared installable/aligned. Doctor must distinguish unmanaged directories and unreadable observations from missing files; retained uninstall files must remain reported as retained.
Change and scope
Shared typed directory observations and single-pass canonical/read facts own the policy. Every selected managed file remains examined after a mismatch or expected read failure; observed metadata and all unreadable paths survive stale/absent manifests. Cleanup/resource failures retain their owner. Duplicate manifest reads are removed. Absent installed files are classified before any bundled-byte comparison, so source-only initial snapshots do not require generated artifacts. Final selection is admitted before side effects, preserving interactive choices for unselected clients and registration-only
--skill=false. Doctor reportsunmanaged/unknownwith paths, reasons and alternatives. Update excludes linked roots/references; uninstall propagates retained child outcomes and preserves ownership manifests.The explicit unmanaged doctor direction also incorporates #3109, credited in the follow-up commit. This is an ordinary correction within existing installation authority; a new capability scope decision is not applicable.
Contract and boundary impact
skill_install_failed; doctor adds explicitunmanaged/unknownskill states and optional issues. Public stdio MCP doctor consumers were tested.--skill=falseremains available. Readiness/freshness does not establish permission to install.Expected effects: reads selected existing files; normal approved setup may write skill/configuration files and use existing Hopper installation behavior. No new provider, target execution, instrumentation or protection recovery is added.
Evidence and regression coverage
ec67aebed: three original regressions fail; initial PR: 19 focused tests pass. Two additional actual-CLI preflight tests fail on the initial PR because it creates Claude configuration before refusal.needs_human,code: "skill_install_failed", andappliedActions: []for unsafe roots/references. Doctor reportsidentity.skill.state: "unmanaged"; unreadable reads remainunknownwith reasons.Validation performed
Final reviewed head
36b93d512, based on main29d3dcb7e. Linux / Node 24.18.0 / npm 11.16.0:a03e6bf9c. Related selection: 17 files / 217 passes.f4cca100dexposed an own source-CI regression: missing installed files unnecessarily requested generated bundled bytes. A clean no-dist/no-skillscheckout reproduces exactly 5 passes / one failure insetupEnvironment; the final absence-first correction passes all six. Full no-artifact source suite: 508 files / 7,446 passes / eight existing platform/condition skips. Production source matches final head byte-for-byte. Final focused environment/filesystem/cleanup/actual CLI/MCP selection: five files / 41 passes.npm run checkpasses for the single-pass follow-up; final absence correction passescheck:fastandgit diff --check. Earlierdocs:check(five consistency tests) passes. The identity-reader complexity warning is resolved. Module length remains one nonblocking warning (585 nonblank lines); related filesystem ownership stays in one module, with no forwarding layers or relaxed rules.36b93d512compared againsta03e6bf9c: four equivalent complete CLI tasks keep identical 10,668 output tokens (10,760 explicit transcript proxy). Before cold/warm: 10.70/9.88 s, CPU 11.74/10.58 s, RSS 390/385 MiB; fixed: 10.30/10.04 s, CPU 11.08/10.93 s, RSS 386/351 MiB. Individual trials, isolated compile caches, warm OS caches; no speedup, statistical equivalence or billed-token claim.a03e6bf9cCI passes all five shards, static/source/docs/build and all four native package platforms. Its review finding is corrected and resolved with regression evidence. Previous main PCAP blocker is repaired upstream in1341e8c83(clean main: 20 passes); duplicate repair PR test(pcap): expect the producer's final stdout newline #3257 was closed as already incorporated. Greptile passedf4cca100dwith no remaining threads, but its own source-CI failure is fixed above. Final36b93d512CI run 38528527903 passes all five shards, source/static/docs/build, four native package platforms and aggregate gates. Greptile passes, with no unresolved review threads. This is current-head validation.Compatibility and release
No dependency, package/release metadata or target-format change. Existing normal setup calls keep their behavior; linked skill directories now receive actionable refusal. Transport credentials and ambient environments are not persisted. No generated artifacts are committed.
Before merge