Repository navigation
fix: name the writable path in the macos launch refusal - #31363
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the five checks still refuse the same bundles, and the change only adds the path that caused the refusal, inside a private function that nothing outside the module calls. [DESIGN-REVIEWED] 31158ed Description read[DESCRIPTION-READ] c78bf35c6fd800fd2b88dfffca431efbc7c3327e6e44f6c85be4031dd920132a That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. This is a fix linked to #23891, and it works at the mechanism level: the predicate that only answered yes or no now returns the path it found. Refusals happen in exactly the same cases as before. What this change shipsInventory (4 items) — 4 justifiedIntent: when Kiro Crew refuses to launch a macOS app, the operator learns which writable path to fix. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 31158ed Description read[DESCRIPTION-READ] 508f55734f3d085dfb7e880d187f4be48da48703275e018555b36f6af7210eea That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Review detailsNo findings. Notes:
[OPUS-REVIEWED] 31158ed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
1327c00 to
92c2554
Compare
92c2554 to
91418c3
Compare
|
Rebased: main moved in docs/system-specs/modules/crew-mode.md, docs/system-specs/modules/decisions.md, docs/system-specs/modules/learn-cron-dashboard.md, docs/system-specs/modules/memory-skills-hooks.md, docs/system-specs/modules/security.md since this head went green (0eecd84 -> 4991e9f); CI re-running. [operator: bolichen97] |
|
[operator: bolichen97] The three red checks on this head (Backend Tests shard 2 on Linux and Windows, and the Coverage Gate that follows them) are one test that is red on |
91418c3 to
365dde5
Compare
365dde5 to
f343996
Compare
A macOS launch refused for a writable bundle always said the app "is installed in a directory this user can write", whichever probed location failed, and named none of them. An operator whose install directory was locked down but whose bundle executable was user-owned could not tell where to look. _writable_component now returns the first path that would let this user change what runs (or None), naming a replaceable executable as the file itself, and resolve_target picks the install-directory message when that path is the bundle's parent and a component message otherwise, each naming the path. Closes #23891
f343996 to
31158ed
Compare
|
Rebased: main moved in src/kiro_crew/computer_use/launch_macos.py, test/test_computer_use_launch_macos_stock.py, docs/system-specs/modules/computer-use.md since this head went green (7c364bc -> 3c09c74); CI re-running. The branch conflicted with #31408, which added the stock [operator: bolichen97] |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Verified on 31158ed: the macOS launch tests in both changed test files pass at this head (42 passed). Swapping the merge-base launch_macos.py back in fails 21 of them, including all three new test_the_refusal_NAMES_the_path_found_writable cases. Four targeted mutations were each caught. A grep found no other caller of _writable_component or _any_executable_is_writable that relies on the old bool return. The spec paragraph in computer-use.md matches both new message strings.
Security: the refusal predicate was restructured, but the same bundles are still refused, in the same probe order, on both the stock /Applications and non-stock branches. Every error path still returns a non-None path, and the caller refuses on is not None, so the check stays fail-closed. The new message text is a path under the fixed app roots or inside the bundle. It carries no credential or secret path.
Done well: the tests now assert the exact path each probe reports, not just that a refusal happened. A reordered probe or the wrong component being named would fail them.
Optional:
- The Proof line in the body still cites the pre-rebase head 6ef9017ec777. A body edit could re-run it on 31158ed and add the three stock /Applications tests in
test/test_computer_use_launch_macos_stock.py. _any_executable_is_writablenow returns a path but keeps its yes/no name.- Issue #23891 still has the
needs-triageandparkedlabels. #20132, the PR it was parked on, has merged.
A macOS launch refused for a writable bundle always said the app "is installed in a directory this user can write", whichever probed location failed, and named none of them. An operator whose install directory was locked down but whose bundle executable was user-owned could not tell where to look. _writable_component now returns the first path that would let this user change what runs (or None), naming a replaceable executable as the file itself, and resolve_target picks the install-directory message when that path is the bundle's parent and a component message otherwise, each naming the path. Closes #23891 Original author: Bolin Chen (cherry picked from commit 6d07df1)
A macOS launch refused for a writable bundle always said the app "is installed in a directory this user can write", whichever probed location failed, and named none of them. An operator whose install directory was locked down but whose bundle executable was user-owned could not tell where to look. _writable_component now returns the first path that would let this user change what runs (or None), naming a replaceable executable as the file itself, and resolve_target picks the install-directory message when that path is the bundle's parent and a component message otherwise, each naming the path. Closes #23891 Original author: Bolin Chen (cherry picked from commit 6d07df1)
A macOS launch refused for a writable bundle always said the app "is installed in a directory this user can write", whichever probed location failed, and named none of them. An operator whose install directory was locked down but whose bundle executable was user-owned could not tell where to look. _writable_component now returns the first path that would let this user change what runs (or None), naming a replaceable executable as the file itself, and resolve_target picks the install-directory message when that path is the bundle's parent and a component message otherwise, each naming the path. Closes #23891 Original author: Bolin Chen (cherry picked from commit 6d07df1)
Problem / Motivation
Goal: When Kiro Crew refuses to launch a macOS app because something on its path is writable, the refusal names that path so the operator knows what to fix.
computer_launch_appon macOS refuses a bundle when any of five locations is writable by the current user: the bundle's parent directory, the bundle itself,Contents,Contents/MacOS(or an executable in it), andInfo.plist. Every one of those cases produced the same text, "'Foo' is installed in a directory this user can write", which names no path. For a bundle whose install directory is locked down but whose executable is owned by the user, that sentence points the operator at the wrong place.Why it matters
An operator who sees the refusal has to guess which of five locations to inspect, and the one sentence they get describes only the first. The launch is correctly refused either way; the cost is a support round-trip or a permission change in the wrong directory.
Not a goal
What changed (motivation → approach → change)
A refused launch now tells the operator which path made it unsafe. When the bundle's install directory is writable, the refusal says "'Foo' is installed in a directory (
/Applications) this user can write". When the bundle or something in it is, it says "'Foo' has a component (/Applications/Foo.app/Contents/MacOS/Foo) this user can write or that could not be verified".The old message existed because
_writable_componentincomputer_use/launch_macos.pyanswered only yes or no. It now returns the first path that would let this user change what runs, orNone, andresolve_targetpicks the install-directory message when that path is the bundle's parent and the component message otherwise._any_executable_is_writablereturns the replaceable file itself, so a user-owned binary in a locked-down directory is named as the file. A stock/Applicationsis judged by its bundle, never probed itself, so under it the path named is always a bundle path. "Could not be verified" covers the fail-closed cases, such as a missingContents/MacOS. The computer-use spec states the two messages.Backwards compatibility
Compatible: the same bundles are refused in the same cases; only the refusal text changes, and
_writable_componentis module-private with no caller outsidelaunch_macos.pyand its tests.Removes nothing: no check, path or caller is removed; the refusal gains a path and a second wording.
Tests
test_the_refusal_NAMES_the_path_found_writable(three cases) drivesresolve_targetthrough the real_writable_component: a writable parent gets the install-directory wording with the parent path; a writableContents/MacOS, and a user-owned executable inside an unwritable one, get the component wording with that directory or that file._writable_componenttests assert the exact path each probe reports (the directory, the executable file,Info.plist, the missing executable directory) andNonefor a clean bundle. The stock/Applicationstests intest_computer_use_launch_macos_stock.pyassertNonefor a root-owned bundle, the owned bundle directory for a user-owned one, and the parent for any non-stock parent.Proof: PROVEN test/test_computer_use_launch.py::TestMacOSCatalogAndResolution::test_the_refusal_NAMES_the_path_found_writable[parent], test/test_computer_use_launch.py::TestMacOSCatalogAndResolution::test_the_refusal_NAMES_the_path_found_writable[directory], test/test_computer_use_launch.py::TestMacOSCatalogAndResolution::test_the_refusal_NAMES_the_path_found_writable[executable], test/test_computer_use_launch.py::TestMacOSBundleVerification::test_a_writable_bundle_EXECUTABLE_directory_is_refused, test/test_computer_use_launch.py::TestMacOSBundleVerification::test_an_unwritable_bundle_still_resolves (head 6ef9017ec777)
Manual verification
N/A — unit coverage sufficient: the module's tests inject the writability answers and run on every platform, so the message selection is exercised without a macOS host.
Screenshots / video
N/A — backend-only change; no frontend surface is touched.
Related Issues
Closes #23891
Sibling sweep
Swept: git grep -nE "ERR[A-Z_]+.format" -- src/kiro_crew/computer_use/
Sibling: src/kiro_crew/computer_use/launch_windows.py:775 -- not affected -- the Windows refusal states the protected-install-directory rule and names no writable location; giving it a path is a separate Windows-side change this issue does not ask for
Pattern harvest
Not generalizable: one refusal string was shared by five distinct checks in a single predicate; the fix is local to that predicate and its caller.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.