Skip to content

fix: name the writable path in the macos launch refusal - #31363

Merged
bolichen97 merged 1 commit into
mainfrom
fix/23891-name-writable-component
Nov 8, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/23891-name-writable-component

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

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_app on 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), and Info.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

  • Changing which bundles are refused. The same five checks run in the same order and refuse exactly the same bundles.
  • The Windows launcher's refusal text.
  • Suggesting a fix command (chmod, chown) in the refusal.

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_component in computer_use/launch_macos.py answered only yes or no. It now returns the first path that would let this user change what runs, or None, and resolve_target picks the install-directory message when that path is the bundle's parent and the component message otherwise. _any_executable_is_writable returns the replaceable file itself, so a user-owned binary in a locked-down directory is named as the file. A stock /Applications is 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 missing Contents/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_component is module-private with no caller outside launch_macos.py and 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) drives resolve_target through the real _writable_component: a writable parent gets the install-directory wording with the parent path; a writable Contents/MacOS, and a user-owned executable inside an unwritable one, get the component wording with that directory or that file.
  • The _writable_component tests assert the exact path each probe reports (the directory, the executable file, Info.plist, the missing executable directory) and None for a clean bundle. The stock /Applications tests in test_computer_use_launch_macos_stock.py assert None for 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

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 6, 2026 11:14
@bolichen97
bolichen97 requested a review from Zedmor November 6, 2026 11:14
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 31158ed9b98965d97518e8b8d32ec4aad1607c07 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 31158ed9b98965d97518e8b8d32ec4aad1607c07 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 31158ed9b98965d97518e8b8d32ec4aad1607c07 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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 ships

Inventory (4 items) — 4 justified

Intent: when Kiro Crew refuses to launch a macOS app, the operator learns which writable path to fix. This is a FIX.

  1. The writable-install-directory refusal now names the directory (/Applications, etc.) — justified
  2. When the bundle itself, something inside it, or a file that could not be checked is the problem, the refusal uses a different wording and names that path — justified
  3. _writable_component and _any_executable_is_writable return the offending path instead of a boolean. The only production consumer is resolve_target (grepped _writable_component|_any_executable_is_writable in src/: one call site) — justified
  4. The computer-use spec paragraph now states the two refusal messages — justified

[FIRST-PRINCIPLES-REVIEWED] 31158ed

Description read

[DESCRIPTION-READ] 508f55734f3d085dfb7e880d187f4be48da48703275e018555b36f6af7210eea

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 31158ed9b98965d97518e8b8d32ec4aad1607c07 — this comment is updated in place on each push.

Review details

No findings.

Notes:

  • If the parent directory's probe hits an error it cannot read as a denial, the refusal still says "this user can write". That wording was already there before this PR; only the path in the message is new.

[OPUS-REVIEWED] 31158ed

Verdict parsed from the review's SHA-scoped output markers for commit 31158ed9b98965d97518e8b8d32ec4aad1607c07.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 31158ed9b98965d97518e8b8d32ec4aad1607c07 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 31158ed9b98965d97518e8b8d32ec4aad1607c07 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 31158ed

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 31158ed9b98965d97518e8b8d32ec4aad1607c07 false-positive: <reason, 20 to 500 characters>

@bolichen97
bolichen97 enabled auto-merge (squash) November 6, 2026 11:43
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 6, 2026
@bolichen97
bolichen97 force-pushed the fix/23891-name-writable-component branch from 1327c00 to 92c2554 Compare November 6, 2026 13:34
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/system-specs/modules/issue-radar.md, docs/system-specs/modules/kas-auth.md, docs/system-specs/modules/memory-skills-hooks.md, docs/system-specs/modules/slack-gateway.md since this head went green (603115b -> 0eecd84); CI re-running.

[operator: bolichen97]

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: passed Eligible automated validation passed for the current revision readiness: checking Automated validation is still running labels Nov 6, 2026
@bolichen97
bolichen97 force-pushed the fix/23891-name-writable-component branch from 92c2554 to 91418c3 Compare November 6, 2026 14:40
@bolichen97

Copy link
Copy Markdown
Contributor Author

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]

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: passed Eligible automated validation passed for the current revision readiness: checking Automated validation is still running labels Nov 6, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

[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 main itself: test/test_security_gate_liveness.py::test_the_package_stays_within_its_line_budget (34733 lines against a budget of 34699). This PR does not touch that package. The fix is #31469; this PR waits for it to merge, then rebases and re-runs.

@bolichen97
bolichen97 force-pushed the fix/23891-name-writable-component branch from 91418c3 to 365dde5 Compare November 6, 2026 20:33
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 6, 2026
@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Nov 6, 2026
@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Nov 6, 2026
@bolichen97
bolichen97 force-pushed the fix/23891-name-writable-component branch from 365dde5 to f343996 Compare November 6, 2026 22:21
@github-actions github-actions Bot added readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision labels Nov 6, 2026
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
@bolichen97
bolichen97 force-pushed the fix/23891-name-writable-component branch from f343996 to 31158ed Compare November 8, 2026 07:54
@bolichen97

Copy link
Copy Markdown
Contributor Author

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 /Applications branch to _writable_component. The resolution keeps that branch as it is and returns the path each probe finds, so the same bundles are refused; the three stock /Applications tests assert the returned path (None, the owned bundle directory, the parent) where they asserted True/False.

[operator: bolichen97]

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 8, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_writable now returns a path but keeps its yes/no name.
  • Issue #23891 still has the needs-triage and parked labels. #20132, the PR it was parked on, has merged.

@bolichen97
bolichen97 merged commit 6d07df1 into main Nov 8, 2026
99 checks passed
@bolichen97
bolichen97 deleted the fix/23891-name-writable-component branch November 8, 2026 09:22
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 8, 2026
buluoray added a commit that referenced this pull request Nov 8, 2026
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)
buluoray added a commit that referenced this pull request Nov 8, 2026
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)
buluoray added a commit that referenced this pull request Nov 8, 2026
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(computer-use/macos): per-component refusal messages — name the directory the probe found writable

2 participants