Skip to content

sminos 1.39.1: never read inside, or fork above, a macOS protected folder from outside it - #469

Merged
SSFSKIM merged 3 commits into
mainfrom
sminos-tcc-folders
Nov 7, 2026
Merged

SSFSKIM merged 3 commits into
mainfrom
sminos-tcc-folders

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Nov 7, 2026

Copy link
Copy Markdown
Owner

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 headless claude -p fork 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 .smns walk, 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, /, ~/Library or /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.
  • All three are on only for sys.platform == "darwin"; Linux is unchanged.

When a read is refused:

  • The project comes from the session's recorded membership, then from the registry's recorded roots (a Guessed project), and otherwise is unknown.
  • A guess or an unknown never moves, retires, joins or re-joins a member. join_on_sight, join_seat, retire_moved and here_now reject it, and lifecycle writes no joined into one.
  • A refused root defers to the registration at the hub fence: ensure_mirrored raises BecameHub when the registration records a hub.
  • derive skips such a member with one said-once daemon.log line.
  • Spawn, fill and join --cwd refuse a directory they can't read, and say to run from inside the folder.
  • Delivery resumes still launch.

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/alternates and core.worktree pointing into one; a .git file that isn't a gitdir: line; a member whose cwd is /; and other apps' data in ~/Library/Containers.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)

…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)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T08:49:35.730362Z 9cafe7c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@SSFSKIM
SSFSKIM merged commit fcf0b6a into main Nov 7, 2026
11 checks passed
@SSFSKIM
SSFSKIM deleted the sminos-tcc-folders branch November 7, 2026 09:08
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.

1 participant