Skip to content

Adopt unreadable Desktop Spark OS discovery guard#620

Merged
vibeforge1111 merged 1 commit into
masterfrom
codex/adopt-spark-cli-619
Jun 2, 2026
Merged

Adopt unreadable Desktop Spark OS discovery guard#620
vibeforge1111 merged 1 commit into
masterfrom
codex/adopt-spark-cli-619

Conversation

@vibeforge1111

Copy link
Copy Markdown
Owner

Maintainer adoption of #619 by @banse. The participant PR was useful and packet-ready, but GitHub blocked direct merge because the branch was behind current master. This PR cherry-picks the same narrow fix onto current master. Verification run locally: python -m pytest tests/test_system_map.py -k unreadable_desktop; python -m pytest tests/test_system_map.py; python -m pytest tests/test_cli.py; python -m compileall src; git diff --check master..HEAD. Credit source: #619, subject to normal Spark Compete gates and no-double-credit rules.

discover_repo_paths in system_map.py checked desktop.exists() then
iterated desktop.iterdir() with no error handling. On macOS the default
~/Desktop is TCC-protected: .exists() returns True but .iterdir() raises
PermissionError ([Errno 1] Operation not permitted). That uncaught error
crashed `spark os capabilities|compile|authority|trace|memory` with a raw
traceback (exit 1). A missing Desktop was already handled gracefully; an
unreadable one now is too.

Merged PR #603 hardened the sibling filesystem walkers in this file
against PermissionError but missed discover_repo_paths. This completes
that coverage with the same narrow OSError handling pattern.

Fix: snapshot desktop.iterdir() inside try/except OSError -> [] before
iterating, mirroring the surrounding narrow-exception style.

Adds a regression test that drives discover_repo_paths with a desktop
whose iterdir() raises PermissionError plus a non-empty installed dict,
asserting it returns the installed paths without raising.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vibeforge1111 vibeforge1111 merged commit 597550c into master Jun 2, 2026
6 checks passed
@vibeforge1111 vibeforge1111 deleted the codex/adopt-spark-cli-619 branch June 2, 2026 06:28
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.

2 participants