Skip to content

fix(harness): normalize materialized checkouts and stop the harness layer stranding the device - #42

Merged
rldyourmnd merged 1 commit into
mainfrom
fix/harness-checkout-permissions
Aug 3, 2026
Merged

fix(harness): normalize materialized checkouts and stop the harness layer stranding the device#42
rldyourmnd merged 1 commit into
mainfrom
fix/harness-checkout-permissions

Conversation

@rldyourmnd

Copy link
Copy Markdown
Contributor

Found by running the 2.3.0 apply on a real Ubuntu 26.04 desktop. It failed with:

nddev-codex: error: nddev-builder source plugin tree must not be writable by group or others

Cause, and why it belongs here

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. The refusal is right; producing the tree that trips it is this repository's bug.

rldyour::_harness_checkout_permissions now normalizes through the shared managed-tree helper (no third permission implementation) on both paths:

  • the clone path, and
  • the fast path, which is the only one a host with an already-pinned clean checkout ever takes again. Skipping it there would leave such a host permanently unable to bootstrap - which is exactly the state the reporting device was in.

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 002 host.

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.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, which this repository forbids - but it is now fatal to itself instead of to the whole device.

Evidence

Check Result
python3 -m pytest 96 passed (+2 new invariants)
scripts/ci/lint.sh scripts-lint-ok
bash -n on all three edited scripts clean
permission fix on the real tree 252 -> 0; module guard now passes

Two tests pin the invariants so neither can silently regress: the harness layer must run after install_browser_providers and install_rtk in both installers while staying fatal, and both checkout paths must call the shared normalizer.

…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.
@rldyourmnd
rldyourmnd merged commit 1ac9f76 into main Aug 3, 2026
29 checks passed
@rldyourmnd
rldyourmnd deleted the fix/harness-checkout-permissions branch August 3, 2026 18:54
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