fix: Preserve watchdog source trees during child imports #763

Closed
erikinkinen wants to merge 0 commits from fix/root-source-bytecode-producer into perf/source-bookend-ancestry-boundary
Owner

Summary and rationale

The Rust CI source closure rejects scripts/__pycache__. The watchdog imports its custody siblings before suppressing bytecode, and shell children do not inherit their parent Python -B setting. The VM diagnostics fixture links its watchdog entry back to the original source, so those imports write cache files in the original checkout.

Disable bytecode before the first sibling import. Add copied-source checks for direct help, symlinked help and argument refusal, each using a fresh child without caller bytecode suppression and verifying the complete source inventory. Run that regression in Rust CI immediately before the VM failure diagnostics controls and include it in both ordered syntax selections and their golden argv fixtures.

Tracking and scope

Quick CI bug fix related to #761; no new issue. Base: perf/source-bookend-ancestry-boundary. This fixes the producer that writes source bytecode and preserves the literal closure rejection.

Architecture, authority and failure behavior

The bootstrap prevents incidental compiled-file writes before custody imports. Command selection, waits, retirement, status handling, deadlines and byte allowances retain their original behavior. No source exclusion, cleanup workaround, ABI or persistent-format change applies.

Validation evidence

Signed commits 1f26fadcdd907c52b524a541c9dcdf350c344669 and 7416eb6ff010ebd8be61dc3aed37eaf2adadd61d, based on 6f38d763a73fcc102fb17dfc19ba6fb5eb2a2055.

Before the fix, a fresh copied watchdog --help invocation exited successfully but wrote cache files for vm_process_custody, command_native_lifetime and native_command_custody. Direct and symlinked cache-absence regressions failed against that behavior. After the fix:

  • Three copied-source regression checks pass (0.255 seconds).
  • Two existing watchdog status and no-progress retirement controls pass (0.466 seconds), retaining their original subprocess and retirement bounds.
  • Five maintained syntax-runner checks pass (23.703 seconds), including exact argv order, first-failure stopping and actual source namespace/byte preservation.
python3 -B -Werror tests/watchdog_source_cleanliness_test.py -v
PYTHONPATH=tests:scripts python3 -B -Werror -m unittest progress_watchdog_test.ProgressWatchdogTests.test_preserves_completed_command_status progress_watchdog_test.ProgressWatchdogTests.test_terminates_a_command_without_progress -v
python3 -B -Werror tests/validate_integration_scripts_test.py -v

Whitespace checks pass. New CI results are pending; these host checks establish no guest execution result. Rust builds and VM qualification are inapplicable to the bootstrap policy change.

Review checklist

  • Original implementation and copied original-source fixtures; no external code.
  • Signed commits with tagged titles and rationale; authored files below 1,000 lines.
  • Existing CLI, source closure and operation bounds preserved.
  • No helper hash cohort selects the watchdog entry; shared governance files are unchanged.
## Summary and rationale The Rust CI source closure rejects `scripts/__pycache__`. The watchdog imports its custody siblings before suppressing bytecode, and shell children do not inherit their parent Python `-B` setting. The VM diagnostics fixture links its watchdog entry back to the original source, so those imports write cache files in the original checkout. Disable bytecode before the first sibling import. Add copied-source checks for direct help, symlinked help and argument refusal, each using a fresh child without caller bytecode suppression and verifying the complete source inventory. Run that regression in Rust CI immediately before the VM failure diagnostics controls and include it in both ordered syntax selections and their golden argv fixtures. ## Tracking and scope Quick CI bug fix related to #761; no new issue. Base: `perf/source-bookend-ancestry-boundary`. This fixes the producer that writes source bytecode and preserves the literal closure rejection. ## Architecture, authority and failure behavior The bootstrap prevents incidental compiled-file writes before custody imports. Command selection, waits, retirement, status handling, deadlines and byte allowances retain their original behavior. No source exclusion, cleanup workaround, ABI or persistent-format change applies. ## Validation evidence Signed commits `1f26fadcdd907c52b524a541c9dcdf350c344669` and `7416eb6ff010ebd8be61dc3aed37eaf2adadd61d`, based on `6f38d763a73fcc102fb17dfc19ba6fb5eb2a2055`. Before the fix, a fresh copied watchdog `--help` invocation exited successfully but wrote cache files for `vm_process_custody`, `command_native_lifetime` and `native_command_custody`. Direct and symlinked cache-absence regressions failed against that behavior. After the fix: - Three copied-source regression checks pass (0.255 seconds). - Two existing watchdog status and no-progress retirement controls pass (0.466 seconds), retaining their original subprocess and retirement bounds. - Five maintained syntax-runner checks pass (23.703 seconds), including exact argv order, first-failure stopping and actual source namespace/byte preservation. ```sh python3 -B -Werror tests/watchdog_source_cleanliness_test.py -v PYTHONPATH=tests:scripts python3 -B -Werror -m unittest progress_watchdog_test.ProgressWatchdogTests.test_preserves_completed_command_status progress_watchdog_test.ProgressWatchdogTests.test_terminates_a_command_without_progress -v python3 -B -Werror tests/validate_integration_scripts_test.py -v ``` Whitespace checks pass. New CI results are pending; these host checks establish no guest execution result. Rust builds and VM qualification are inapplicable to the bootstrap policy change. ## Review checklist - Original implementation and copied original-source fixtures; no external code. - Signed commits with tagged titles and rationale; authored files below 1,000 lines. - Existing CLI, source closure and operation bounds preserved. - No helper hash cohort selects the watchdog entry; shared governance files are unchanged.
erikinkinen added this to the Alpha 1 milestone 2026-11-12 01:17:46 +01:00
fix: Preserve watchdog source trees during child imports
Some checks failed
CI / cargo_publications (push) Has been cancelled
CI / rust (push) Has been cancelled
CI / native_sources (push) Has been cancelled
CI / host_zero (push) Has been cancelled
CI / host_one (push) Has been cancelled
CI / host_two (push) Has been cancelled
CI / host_three (push) Has been cancelled
CI / integration (push) Has been cancelled
Coreutils provider graph / coreutils (push) Has been cancelled
Markdown / markdown (push) Has been cancelled
1f26fadcdd
A shell-launched watchdog does not inherit its parent Python bytecode setting. Its eager custody imports wrote three cache files beside the original code, including when a diagnostic fixture linked back to the original watchdog entry, causing literal source closure to refuse the checkout.

Disable bytecode before the first sibling import and verify fresh copied source inventories for direct help, symlinked help and argument refusal without caller suppression. Preserve command authority, status handling, deadlines and byte bounds.
ci: Run the watchdog source cleanliness regression
Some checks failed
CI / cargo_publications (pull_request) Has been skipped
CI / rust (pull_request) Has been skipped
CI / native_sources (pull_request) Has been skipped
CI / host_zero (pull_request) Has been skipped
CI / host_one (pull_request) Has been skipped
CI / host_two (pull_request) Has been skipped
CI / host_three (pull_request) Has been skipped
CI / integration (pull_request) Has been skipped
Coreutils provider graph / coreutils (pull_request) Has been skipped
Markdown / markdown (pull_request) Has been skipped
Markdown / markdown (push) Has been cancelled
Coreutils provider graph / coreutils (push) Successful in 4m44s
CI / cargo_publications (push) Failing after 11m19s
CI / rust (push) Failing after 14m16s
CI / native_sources (push) Has been skipped
CI / host_zero (push) Has been skipped
CI / host_one (push) Has been skipped
CI / host_two (push) Has been skipped
CI / host_three (push) Has been skipped
CI / integration (push) Has been skipped
7416eb6ff0
Run the copied-source watchdog admission checks immediately before the VM failure diagnostics controls in Rust CI. Include the regression in both maintained syntax selections and their independent ordered argv fixtures so normal validation checks its original code and preserves failure-stop ordering.

Keep all existing commands, source identities and operation bounds unchanged.
Author
Owner

Included in the root builder, scripted CLI and metadata-ancestry feature branches. The watchdog now suppresses bytecode before importing its source closure; the new regression runs through direct and symlink entrypoints without inherited suppression. Main is unchanged.

Included in the root builder, scripted CLI and metadata-ancestry feature branches. The watchdog now suppresses bytecode before importing its source closure; the new regression runs through direct and symlink entrypoints without inherited suppression. Main is unchanged.
erikinkinen closed this pull request 2026-11-12 01:37:15 +01:00
Some checks failed
CI / cargo_publications (pull_request) Has been skipped
CI / rust (pull_request) Has been skipped
CI / native_sources (pull_request) Has been skipped
CI / host_zero (pull_request) Has been skipped
CI / host_one (pull_request) Has been skipped
CI / host_two (pull_request) Has been skipped
CI / host_three (pull_request) Has been skipped
CI / integration (pull_request) Has been skipped
Coreutils provider graph / coreutils (pull_request) Has been skipped
Markdown / markdown (pull_request) Has been skipped
Markdown / markdown (push) Has been cancelled
Coreutils provider graph / coreutils (push) Successful in 4m44s
CI / cargo_publications (push) Failing after 11m19s
CI / rust (push) Failing after 14m16s
CI / native_sources (push) Has been skipped
CI / host_zero (push) Has been skipped
CI / host_one (push) Has been skipped
CI / host_two (push) Has been skipped
CI / host_three (push) Has been skipped
CI / integration (push) Has been skipped

Pull request closed

Sign in to join this conversation.
No description provided.