diff --git a/docs/superpowers/evidence/nvidia-config-seams-restore-2026-08-23.json b/docs/superpowers/evidence/nvidia-config-seams-restore-2026-08-23.json new file mode 100644 index 00000000..87550d6b --- /dev/null +++ b/docs/superpowers/evidence/nvidia-config-seams-restore-2026-08-23.json @@ -0,0 +1,41 @@ +{ + "intent": "Restore the four test seams in nvidia_config.sh, which were verified and measured but did not reach the previous commit, so the committed suite read and wrote the real system files.", + "scope": [ + "linux_configuration/scripts/single_use/fixes/lib/nvidia_config.sh", + "Non-goal: any change to the tests, which were already correct" + ], + "changes": [ + "Re-applied the XORG_CONF, XORG_CONF_D, PROFILE_FILE and USER_HOME defaults at their assignment sites", + "Grepped the file for all four immediately after writing it, before running anything, because a silently-reverted edit is exactly what caused this" + ], + "verification": [ + { + "command": "ci-mirror during git push", + "result": "fail", + "evidence": "'lib/tests suite failed: .../fixes/lib/tests/run_all.sh'. ci-mirror runs from a clean checkout of committed files, which is why it caught what the local run could not." + }, + { + "command": "bash run_all.sh from a detached worktree at the previous commit", + "result": "fail", + "evidence": "EXIT 1 with 10 failures, including 'configure_xorg: enables RenderAccel (expected \"RenderAccel\" \"true\", got: # NVIDIA configuration with RenderAccel disabled)' -- the suite was reading this machine's real /etc/X11 config, and 'does not re-clone over a checkout' showed a clone path of /home/testuser/pyroveil rather than the tmpdir." + }, + { + "command": "grep -n 'XORG_CONF:-|XORG_CONF_D:-|PROFILE_FILE:-|USER_HOME:-' nvidia_config.sh", + "result": "pass", + "evidence": "All four present at lines 26, 27, 60 and 85 after re-applying." + }, + { + "command": "shellcheck + shfmt -l on nvidia_config.sh", + "result": "pass", + "evidence": "No findings, zero suppressions, no reformat pending." + } + ], + "risks": [ + "The previous commit, cb1e8c53, is pushed and briefly had a suite that would write to the real /etc/X11/xorg.conf.d on any machine that ran it un-jailed. Nothing ran it in that window on this machine -- the real 20-nvidia.conf still carries its Jun 2025 mtime.", + "The local run passed against a stale seamed copy in the measurement worktree, which is why a clean-checkout run is now the check that matters before pushing." + ], + "rollback": [ + "git revert the commit; nvidia_config.sh returns to hardcoded paths and the suite will fail again from a clean checkout", + "Re-run run_all.sh from a detached worktree to confirm the failure mode returns" + ] +} diff --git a/linux_configuration/scripts/single_use/fixes/lib/nvidia_config.sh b/linux_configuration/scripts/single_use/fixes/lib/nvidia_config.sh index 00702219..c659558a 100755 --- a/linux_configuration/scripts/single_use/fixes/lib/nvidia_config.sh +++ b/linux_configuration/scripts/single_use/fixes/lib/nvidia_config.sh @@ -19,8 +19,12 @@ configure_xorg() { echo "2. Configuring Xorg Settings..." echo "===============================" - XORG_CONF="/etc/X11/xorg.conf" - XORG_CONF_D="/etc/X11/xorg.conf.d" + # These paths default to the real locations and are overridden only by + # the test harness. They are plain globals ASSIGNED here rather than read + # from the environment, so the default has to live at the assignment -- + # an exported value alone would be overwritten on entry. + XORG_CONF="${XORG_CONF:-/etc/X11/xorg.conf}" + XORG_CONF_D="${XORG_CONF_D:-/etc/X11/xorg.conf.d}" NVIDIA_CONF="$XORG_CONF_D/20-nvidia.conf" # Create xorg.conf.d directory if it doesn't exist @@ -53,7 +57,7 @@ configure_gcc_workaround() { echo "3. Configuring GCC Mismatch Workaround..." echo "==========================================" - local PROFILE_FILE="/etc/profile" + local PROFILE_FILE="${PROFILE_FILE:-/etc/profile}" local timestamp timestamp=$(date) backup_file "$PROFILE_FILE" @@ -78,7 +82,7 @@ install_pyroveil() { echo "4. Pyroveil Setup for Mesh Shader Issues..." echo "===========================================" - local user_home="/home/$SUDO_USER" + local user_home="${USER_HOME:-/home/$SUDO_USER}" local pyroveil_dir="$user_home/pyroveil" echo "Mesh shaders have poor support on NVIDIA drivers, causing issues in games"