Repository navigation
Conversation
…d common dir are granted Confinement had no gitdir/commondir handling. A card checkout is a `git worktree` whose `.git` FILE names a gitdir under the main checkout's `.git`; her hands were granted the worktree and denied the rest of $HOME, so `git status` in her own worktree answered "fatal: not a git repository: …/.git/worktrees/cc2db61d" while her `test -e` on the path said EXISTS (Benchy, M5, 15:34Z 2026-10-16); the same for Aiko's worktree 1b232595. Every confined citizen's git had been dead since #4882 (10/9), so no citizen could commit. `worktree_git_dirs` grants the gitdir and the common dir for write, guarded by git's own back-pointer (`<gitdir>/gitdir` must physically name this checkout's `.git`): a `.git` file she forged toward another repository cannot carry that back-pointer and grants nothing; a symlinked pointer is resolved physical before the check; a commondir outside the `.git` that holds the gitdir is dropped. The grant is the whole common `.git` of the ONE repository her card lives in (every branch's refs and objects): git's worktree model needs it for a commit, and it is the reach she had before confinement for that repo and no other. Credential carve-outs still apply. Measured (M5, 3ad1300 which carries this): Benchy 18:02:49Z in ~/.airc/worktrees/cc2db61d under her confined hands: git status exit 0, git log shows her branch, git branch --show-current → cc2db61d/source-hygiene-ratchet-a-fn-inserted. Test: a_card_worktree_gets_its_gitdir_and_common_dir_and_a_forged_link_gets_nothing (confinement 4/4). Held for Joel's read (Cormac, #5112): the scope of the common-.git write grant. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo (cherry picked from commit 516276b)
joelteply
force-pushed
the
fable/worktree-git-grant
branch
from
October 16, 2026 19:09
516276b to
98652b1
Compare
Contributor
Author
joelteply
added a commit
that referenced
this pull request
Oct 18, 2026
…recious mirror; confinement reads only the mirror's objects (card 573cc58a, airc half d166e4f2) card_staging::stage_for_card made the card's checkout a worktree of repo_registry's clone, which for continuum is the DEPLOY checkout. Every resident's card was therefore registered in the deploy repo's .git (M5: .git/worktrees/cc2db61d). git under confinement failed there, and #5116 could only fix it by granting write on that .git. Joel: do it right. - card_staging: ensure_mirror(repo, registry clone), then ensure_card_clone from the mirror (airc-lib, airc #1581). The checkout is at the same worktree_path_for path; its .git is inside it, objects are borrowed through alternates, and origin is the real remote, so the carry pushes. - confinement: each ~/.airc/mirrors/*/*.git/objects is a READ-only root (canonicalised with every root). No write root is added anywhere, and nothing of a mirror but its objects is readable. - disk governor: TrackedDir airc-mirrors, with a decided deferred eviction: whole-mirror removal only when no live card clone names it in its alternates. Never prune in place; preciousObjects refuses it. Test (macOS, real sandbox-exec): on_macos_a_card_clone_reads_its_mirror_and_commits_but_cannot_write_the_mirror. Her git reads the borrowed base, her commit lands, and a write into the mirror's objects is refused by the OS. Not in this commit: the airc-lib pin bump (needs #1581 merged) and migration of existing linked worktrees (follow-up card). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply
added a commit
that referenced
this pull request
Oct 18, 2026
…recious mirror; confinement reads only the mirror's objects (card 573cc58a, airc half d166e4f2) card_staging::stage_for_card made the card's checkout a worktree of repo_registry's clone, which for continuum is the DEPLOY checkout. Every resident's card was therefore registered in the deploy repo's .git (M5: .git/worktrees/cc2db61d). git under confinement failed there, and #5116 could only fix it by granting write on that .git. Joel: do it right. - card_staging: ensure_mirror(repo, registry clone), then ensure_card_clone from the mirror (airc-lib, airc #1581). The checkout is at the same worktree_path_for path; its .git is inside it, objects are borrowed through alternates, and origin is the real remote, so the carry pushes. - confinement: each ~/.airc/mirrors/*/*.git/objects is a READ-only root (canonicalised with every root). No write root is added anywhere, and nothing of a mirror but its objects is readable. - disk governor: TrackedDir airc-mirrors, with a decided deferred eviction: whole-mirror removal only when no live card clone names it in its alternates. Never prune in place; preciousObjects refuses it. Test (macOS, real sandbox-exec): on_macos_a_card_clone_reads_its_mirror_and_commits_but_cannot_write_the_mirror. Her git reads the borrowed base, her commit lands, and a write into the mirror's objects is refused by the OS. Not in this commit: the airc-lib pin bump (needs #1581 merged) and migration of existing linked worktrees (follow-up card). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
Contributor
Author
|
Closed unmerged, superseded by #5132 (Joel 2026-10-17: "do it right"). Instead of granting the deploy repo's .git to residents, a card checkout is now its own clone, borrowing objects from a precious mirror (airc #1581 and #1582), and residents' credential access is decided in #5170. — Cormac (IntelMac) |
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.
Split out of #5112 at Cormac's request so the reviewed parts there can merge; this commit is the confinement change alone (
core/continuum-core/src/code/confinement.rs, +84).Defect: confinement had no gitdir/commondir handling. A card checkout is a
git worktreewhose.gitfile names a gitdir under the main checkout's.git; her hands were granted the worktree and denied the rest of $HOME, sogit statusin her own worktree answeredfatal: not a git repository: …/.git/worktrees/cc2db61dwhile hertest -eon the path said EXISTS (Benchy 15:34Z, Aiko's worktree 1b232595 likewise). Every confined citizen's git has been dead since #4882 (10/9).Fix:
worktree_git_dirsgrants the gitdir and the common dir for write, guarded by git's own back-pointer (<gitdir>/gitdirmust physically name this checkout's.git): a forged.gitfile grants nothing; a symlinked pointer is resolved physical first; a commondir outside the.githolding the gitdir is dropped. Credential carve-outs still apply.Scope (the open concern, Cormac → Joel): the grant is the whole common
.gitof the one repository her card lives in — every branch's refs and objects — which git's worktree model needs for a commit, and the reach she had before confinement for that repo and no other. The narrower design (card checkouts as clones with a shared object store; grant = one directory under her workspace) is airc's seam, not confinement's.Measured
a_card_worktree_gets_its_gitdir_and_common_dir_and_a_forged_link_gets_nothing; confinement tests 4 passed, 0 failed (M5, metal,accelerate).~/.airc/worktrees/cc2db61dunder confined hands —git status --shortexit 0,git log --oneline -3lists her branch,git branch --show-current→cc2db61d/source-hygiene-ratchet-a-fn-inserted. Same command:fatal: not a git repositoryat 15:34:47Z on the previous core.Hold: not to be merged or deployed beyond the M5 until Joel or root has read the scope concern.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo