Repository navigation
fix: name the umask cause when service install refuses a writable venv - #31399
Conversation
a804d13 to
60c103d
Compare
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: |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns: the advice text is chosen from [DESIGN-REVIEWED] ebea776 Description read[DESCRIPTION-READ] 3fd64c2bab97dcc3d65d4cfd3fee883574803dcb7e93a3cefb41cb169186826a 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: the fix changes refusal text and docs, links issue #22407, and leaves the check's verdicts unchanged. What this change shipsInventory (4 items) — 4 justifiedIntent: a pip or venv user whose service install is refused under umask 002 learns the cause and the fix. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] ebea776 Description read[DESCRIPTION-READ] e4ef96a473e0cc6c5a0de411d90c4bfe9cd475c00d5b60e1e8ac045e9766eabd That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
|
[operator: bolichen97] The three red checks on 60c103d (Backend Tests shard 2 on Linux and Windows, and the Coverage Gate that follows them) come from one test, |
|
[operator: bolichen97] #31469 landed, but main went red on the same test again after #30774: |
On an AppArmor userns-restricted host, a pip or venv install made under umask 002 leaves the venv group-writable, so service install refuses the launcher. Its refusal gave AppImage-only advice. The service case now names the umask cause and the chmod -R g-w <venv> fix, the AppImage wording is unchanged, and the pip install docs set umask 022 first. The writable-path check itself is unchanged. Closes #22407
60c103d to
ebea776
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved for the on-call. Review lanes pass on ebea776, no conflict, no open change request.
#31399) On an AppArmor userns-restricted host, a pip or venv install made under umask 002 leaves the venv group-writable, so service install refuses the launcher. Its refusal gave AppImage-only advice. The service case now names the umask cause and the chmod -R g-w <venv> fix, the AppImage wording is unchanged, and the pip install docs set umask 022 first. The writable-path check itself is unchanged. Closes #22407 (cherry picked from commit d18b76e)
Problem / Motivation
Goal: When
kirocrew service installrefuses a venv made under umask 002, it says why and how to fix it, and the pip install docs say to use umask 022.On a host that restricts unprivileged user namespaces (Ubuntu 24.04 and later),
kirocrew service installloads no AppArmor profile for a pip orpython -m venvinstall made under umask002. Both tools follow the umask, so<venv>/binand thekirocrewlauncher come out0775, and the writable-path check refuses them. The refusal then tells the user to move "the AppImage", which a pip user does not have, and agent sandbox spawns fail closed.Why it matters
002is a common default umask for ordinary users on Ubuntu and Fedora, and the documented pip commands use the caller's umask. A user who follows the docs gets a service whose sandbox fails, plus advice meant for a different install type.Not a goal
What changed (motivation → approach → change)
When the service refuses a group- or world-writable path, the message now names the likely cause and the fix: if the venv was made under umask 002, run
chmod -R g-w <venv>on the venv that holds the launcher; otherwise tighten the named path. Then re-runkirocrew service install. The AppImage launcher keeps its old advice, and what the check accepts and refuses is unchanged.The two texts split on
expected_uid. The same function already uses it to word its ownership refusal: the service passes the service account's uid, and the AppImage launcher passes none.The pip commands in
getting-started.mdnow start withumask 022, followed by a short note: create the venv under that umask too, and how to repair an existing install. The pip section ofdocs/guides/install.mdsays the same in one paragraph.Backwards compatibility
Compatible: only the advice text of one refusal and the docs change; every path accepted or refused before still is.
Removes nothing: the check, its verdicts and the AppImage message stay; the service case swaps advice that named the wrong install type.
Tests
test_a_group_writable_venv_names_the_umask_cause_and_the_chmod(test/test_service_launcher_profile.py): a launcher in a0775kc/bindirectory, checked with the service'sexpected_uid, is refused. The message names that directory,umask 002andchmod -R g-w <venv>, and does not give the AppImage advice.test_a_group_writable_file_is_refusedgains one assertion: the launcher case (noexpected_uid) still gives the AppImage advice and does not mention umask.Proof: PROVEN test/test_service_launcher_profile.py::TestExpectedUidOverride::test_a_group_writable_venv_names_the_umask_cause_and_the_chmod (head 60c103d)
Determinism: both tests passed 20 runs at
-n0, and 10 runs at-n 4 --dist loadgroup --max-worker-restart=2alongsidetest/test_service_apparmor.py. The whole file also passed in shuffled order (seed 20718).Manual verification
N/A — unit coverage sufficient: the change is message text and docs, and the test drives the real
validate_exec_pathon a real0775directory.Screenshots / video
N/A — no frontend change.
Related Issues
Closes #22407
Sibling sweep
Swept: git grep -nE "pip install (--pre kirocrew|-e)" -- '*.md'; git grep -n "AppImage" -- src/kiro_crew/service/apparmor.py
Sibling: docs/guides/install.md:445 -- changed here
Sibling: docs/build/release.md:574 -- not affected -- a maintainer's check of the channel index, not a host install that runs service install
Sibling: docs/guides/windows-install.md:260 -- not affected -- Windows has no AppArmor profile to refuse
Sibling: src/kiro_crew/service/apparmor.py:846 -- not affected -- the shared-interpreter refusal; the service attaches to the venv console script, which that rule never matches
Pattern harvest
Not generalizable: one refusal shared by two callers carried only one caller's advice, and the function already words its other refusal per caller through the same argument.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)