Skip to content

Conversation

@bolinfest
Copy link
Collaborator

@bolinfest bolinfest commented Dec 16, 2025

In preparation for in-repo configuration support, this updates WritableRoot::get_writable_roots_with_cwd() to include the .codex subfolder in WritableRoot.read_only_subpaths, if it exists, as we already do for .git.

As noted, currently, like .git, .codex will only be read-only under macOS Seatbelt, but we plan to bring support to other OSes, as well.

Updated the integration test in seatbelt.rs so that it actually attempts to run the generated Seatbelt commands, verifying that:

  • trying to write to .codex/config.toml in a writable root fails
  • trying to write to .git/hooks/pre-commit in a writable root fails
  • trying to write to the writable root containing the .codex and .git subfolders succeeds

@bolinfest bolinfest marked this pull request as ready for review December 16, 2025 04:55
@pakrym-oai
Copy link
Collaborator

Should we add an integration test?

Copy link
Collaborator

@joshka-oai joshka-oai left a comment

Choose a reason for hiding this comment

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

The tests look like they test the config, but not the desired effect (unless I'm misreading them). Do we have any tests that try to write to a read-only files?

@bolinfest
Copy link
Collaborator Author

@pakrym-oai hmm, admittedly #1765 where I introduced the test in seatbelt.rs used /bin/echo hello as the command as opposed to something like git init, so I'll fix that as part of this PR now...

@bolinfest bolinfest merged commit bef36f4 into main Dec 16, 2025
52 checks passed
@bolinfest bolinfest deleted the pr8088 branch December 16, 2025 06:54
@github-actions github-actions bot locked and limited conversation to collaborators Dec 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants