fix(harness): normalize materialized checkouts and stop the harness layer stranding the device - #42
Merged
Merged
Conversation
…ayer stranding the device Found by running the 2.3.0 apply on a real Ubuntu 26.04 desktop, where it failed with: nddev-codex: error: nddev-builder source plugin tree must not be writable by group or others `git clone` and `git checkout` create files under the caller's umask. Under `umask 002` the materialized harness checkout landed with 252 group-writable paths, and nddev-codex-app's `install-builder` then correctly refused it - after rldyour::_ensure_pinned_git_checkout had already reported success. rldyour::_harness_checkout_permissions now normalizes the tree through the shared managed-tree helper, on the clone path and on the fast path both: the fast path is the only one a host with an already-pinned checkout ever takes again, so skipping it there would leave such a host permanently unable to bootstrap. Normalizing rather than refusing is safe because the bytes are provably the pinned commit, so tightening their modes cannot change what gets installed. That fix moved the failure to a second, independent guard in the same module (a stale local builder profile), which makes the real defect obvious: the harness layer sits ahead of every other layer while depending on local state this repository does not own. That is the same pathology ADR 0006 removed for zcode, and it had the same consequence - a desktop missing 24 of the 46 commands verify.sh requires, because one delegated guard aborted the run before the language servers, compiled hosts, pinned scanners, browser stack, and rtk. Both installers now run the harness layer last, immediately before verification. The step stays fatal - it is not softened into warn-and-continue - but it is now fatal to itself instead of to the whole device.
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.
Found by running the 2.3.0 apply on a real Ubuntu 26.04 desktop. It failed with:
Cause, and why it belongs here
git cloneandgit checkoutcreate files under the caller's umask. Underumask 002the materialized harness checkout landed with 252 group-writable paths, andnddev-codex-app'sinstall-builderthen correctly refused it - afterrldyour::_ensure_pinned_git_checkouthad already reported success. The refusal is right; producing the tree that trips it is this repository's bug.rldyour::_harness_checkout_permissionsnow normalizes through the shared managed-tree helper (no third permission implementation) on both paths:Normalizing rather than refusing is safe: the bytes are provably the pinned commit, so tightening their modes cannot change what gets installed. Refusing would instead brick every
umask 002host.Measured on the real broken tree: 252 -> 0 group-writable paths, and the module's guard then accepts it.
The defect that fix exposed
With the permission cause removed, the failure moved to a second, independent guard in the same module (a stale local builder profile). That makes the real problem plain: the harness layer sat ahead of every other layer while depending on local state this repository does not own.
This is the same pathology ADR 0006 removed for zcode, with the same consequence - the reporting desktop was missing 24 of the 46 commands
verify.shrequires, because one delegated guard aborted the run before the language servers, compiled hosts, pinned scanners, browser stack, and rtk.Both installers now run the harness layer last, immediately before verification. The step stays fatal - it is not softened into warn-and-continue, which this repository forbids - but it is now fatal to itself instead of to the whole device.
Evidence
python3 -m pytestscripts/ci/lint.shscripts-lint-okbash -non all three edited scriptsTwo tests pin the invariants so neither can silently regress: the harness layer must run after
install_browser_providersandinstall_rtkin both installers while staying fatal, and both checkout paths must call the shared normalizer.