Repository navigation
sminos 1.39.1: never read inside, or fork above, a macOS protected folder from outside it - #469
Merged
Merged
Conversation
…er from outside it On macOS a launchd agent is its own responsible process, so the daemon's first look inside ~/Desktop, ~/Documents, ~/Downloads, iCloud Drive, ~/Library/CloudStorage or a volume raises a privacy dialog charged to it. On the Mac mini (2026-11-07) derive's headless fork of a member whose cwd was $HOME raised one for Downloads (the engine's startup scans its directory's children), and it held the CI runner until dismissed. - read_refused(path): a sminos process looks inside a protected folder only when its own cwd is inside the same one, judged from the path string. Applied at the lowest reads: .smns walk, git dir and its gitdir pointer, the remote's config, git_branch, project roots in the tick, the uplink and the checkouts, member_cwd, kept_root, names_hub, the desk's diff, mcp key, media upload/exclude/sweep, the cd and spawn checkouts, a verb's cwd. - A resolution that met a refusal is told from what is recorded: the session's recorded membership, else the registration whose root is the nearest ancestor, as a Guessed; with neither it is unknown (UNREAD), and a seat there gets no made-up local project. Reconciliation joins, moves and retires nothing on a Guessed answer, so an unreadable directory leaves a member as recorded. - launch_refused(dir): derive forks no member whose directory is inside a protected folder or holds one ($HOME, /, /Volumes), unless it is the process's own cwd; the skip is said once in daemon.log, nothing recorded. - spawn, fill and join --cwd into such a folder from outside it are refused with a message; a resume still launches there, unlooked-at. test_protected.py proves the daemon's view touches nothing under the folder (a recorder on every stat, open, listing and child, and chmod 000), that an unregistered one stays as recorded (it was retired `moved` before), that a process inside still reads, that derive skips $HOME and ~/Documents members and forks a plain one, and that Linux is unchanged. Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
… join recorded A local member in a protected folder, read from outside it (the daemon's presence, a list from another directory), showed repo@branch blank once repo_branch stopped reading there; its joined event, written by its own hook where it works, already holds both. Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…not read, no join on a guess The review of 904b0a3..953f9f4 found three holes: - A linked worktree outside the folders whose repository is in one was followed: the plane's project_key read its gitdir's commondir and gitdir, and working_diff and the media exclude ran git there, which follows the .git pointer. git_refused(d) reads the .git file where it sits and refuses when the gitdir or its commondir is in a protected folder; project_key, working_diff, the media exclude, git_branch and common_git_dir's git fallback all ask it first, and _canonical_root guards the gitdir's back-pointer. - ensure_mirrored took a registered root it could not read as present, so a hub recorded in the registration no longer raised BecameHub and a stale tick kept a hub-only log on git. A root not read now defers to the registration. - A hook or the bridge's export run outside the folder reached join_on_sight through _member_alias with no here_now recheck, so a registry guess became a `joined`. join_on_sight and join_seat refuse a Guessed project, and lifecycle writes no `joined` into one. test_protected.py: each case failed before its fix (a read of the gitdir's files, BecameHub not raised, a `joined` appended to the guessed project). Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sminos 1.39.1: on macOS, sminos never reads inside a protected folder (Desktop, Documents, Downloads, iCloud Drive, CloudStorage, /Volumes) unless its own working directory is in it, and never starts a child in a directory inside one or containing one.
Why: on 2026-11-07 at 07:16:58Z, the mini's sminos daemon (a launchd agent, so TCC charges whatever it does to python3.14) ran the hourly
derive --all. Its headlessclaude -pfork for a member whose cwd is~touched ~/Downloads at startup. The dialog drained the mini's CI runner until CI-opt dismissed it. The daemon also reads each session's launch directory every tick (the.smnswalk, git), so sessions in ~/Documents/College are the same exposure. Friction entry:doperpowers/live/sminos-daemon-reads-session-dirs-in-tcc-folders.md.The rule:
read_refused(path), decided from the path string alone, never a filesystem call on it.launch_refused(dir): inside a protected folder, or$HOME,/Users,/,~/Libraryor/Volumes, unless that is the process's own cwd or the same protected folder its cwd is in.git_refused(d): git in a session's directory, or a read of git's files for it, including a linked worktree whose gitdir or commondir is protected.sys.platform == "darwin"; Linux is unchanged.When a read is refused:
Guessedproject), and otherwise is unknown.join_on_sight,join_seat,retire_movedandhere_nowreject it, andlifecyclewrites nojoinedinto one.ensure_mirroredraisesBecameHubwhen the registration records a hub.--cwdrefuse a directory they can't read, and say to run from inside the folder.Tests:
sminos/tests/test_protected.py, 12 cases. They record every stat, open, listdir and child process (argv and cwd), with the directory at chmod 000 as well. Each case was seen red first.Review: reviewer-high, two rounds. Round 1 found three issues: worktree metadata, the hub fence, and a hook joining on a guess. All three were fixed in
9cafe7c4, and round 2 judged it correct.Gates: all six GREEN on
9cafe7c4(run 42355327580).Left as debt (board ticket to follow): a symlink or firmlink into a folder, since the check is on the string alone;
objects/info/alternatesandcore.worktreepointing into one; a.gitfile that isn't agitdir:line; a member whose cwd is/; and other apps' data in~/Library/Containers.Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)