worktrees: provision declared gitignored dependency dirs - #86
Open
robreyreynolds wants to merge 1 commit into
Open
worktrees: provision declared gitignored dependency dirs#86robreyreynolds wants to merge 1 commit into
robreyreynolds wants to merge 1 commit into
Conversation
git worktree add starts clean, which is the point -- and also the trap: anything gitignored is absent from the new worktree, so a task whose build or check depends on node_modules, a vendored toolchain, or a data cache fails before the worker types a word, and the failure output points at the build, not at the empty directory that caused it. New run-level manifest field: worktree_provision, a list of repo-relative paths cloned from the primary checkout into each fresh worktree during taskdir preparation. Copying uses cp -Rc first (an APFS copy-on-write clone, near-instant for a 90k-file node_modules on macOS) with plain cp -R as the portable fallback. Declarations are validated where they can fail loudest: parsing rejects non-string entries, absolute paths (POSIX and Windows forms), '..' segments, and the field without worktrees mode or a repo; at provision time, realpath re-proves the source resolves inside the repo (so a symlinked entry cannot pull from outside it), a missing source fails taskdir preparation rather than handing the worker a half-provisioned tree, and an existing destination is left alone. Ten new tests cover the field's parsing and the provisioning behaviour, including the symlink-escape rejection and the existing-destination no-overwrite rule. Full suite matches the baseline on this host (one pre-existing, unrelated test_deliverables failure reproduces identically with and without this change -- same one noted on NateBJones-Projects#85).
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.
git worktree addstarts clean — which is the point, and also the trap: anything gitignored is absent from the new worktree, so a task whose build or check depends onnode_modules, a vendored toolchain, or a data cache fails before the worker types a word, and the failure output points at the build rather than at the empty directory that caused it.New run-level manifest field:
worktree_provision— a list of repo-relative paths cloned from the primary checkout into each fresh worktree during taskdir preparation. Copying usescp -Rcfirst (an APFS copy-on-write clone, near-instant for a 90k-filenode_moduleson macOS) with plaincp -Ras the portable fallback.Validation lives where it can fail loudest. Parsing rejects non-string entries, absolute paths (POSIX and Windows forms),
..segments, and the field withoutworktrees: trueor arepo. At provision time, realpath re-proves the source resolves inside the repo (a symlinked entry cannot pull from outside it), a missing source fails taskdir preparation rather than handing the worker a half-provisioned tree, and an existing destination is left alone.Tests: ten new tests cover the field's parsing and the provisioning behaviour, including the symlink-escape rejection and the existing-destination no-overwrite rule. Full suite matches the baseline on this host — the one pre-existing, unrelated
test_deliverablesfailure reproduces identically with and without this change (same one noted on #85).Context: this is the first piece of the decomposition plan I posted in
#open-brain-skills-engine-ringer, following #85. Pieces 2–3 (aworktree_readonlycontract field, then path-containment/fail-loud preparation) build on this one; feedback here will shape how they're carved.