[BUG] Sealed Python cannot launch nested dependency checks #114

Closed
opened 2026-10-12 23:59:26 +02:00 by erikinkinen · 3 comments
Owner

Summary

Dependency preparation fails when Python was executed from a sealed descriptor. The nested dependency check tries to reuse sys.executable, whose descriptor is closed before the child resolves it.

Reproduction

Run the maintained scripts/setup-component-ci-overrides.py through Exsh's sealed Python tool. Dependency discovery calls dependency_pins.validate_repository_sources, which launches check-dependency-policy.py with sys.executable and Python's default descriptor cleanup.

The complete source capture reproduced this during the first preparation command. The interpreter reported /proc/self/fd/14.

Expected and actual behavior

The nested check should execute the same approved immutable interpreter without inheriting unrelated descriptors. Instead, os.posix_spawn raises:

FileNotFoundError: [Errno 2] No such file or directory: '/proc/self/fd/14'

Environment and identity

  • Exsh: d7b8e9baf46ab28ce004e195de4eb0c1e4fbc12a.
  • Integration helper: 9c064a519cdd82e86c18c524281c317247883244.
  • Linux x86-64, Python 3.14; interpreter bytes were captured in a sealed tool.
  • Host preparation; no EriX guest build ran.

Evidence and prior checks

The traceback reaches dependency_pins.py, subprocess.Popen and os.posix_spawn before the error above. The original failed command and cleanup receipts are retained. Its tool process and cohort retired; compiler execution did not begin.

Original current-MM interpreter selection

The maintained supervisor may select literal /proc/self/exe only when its
selected tool is the genuine signed Programme's same original approved Python
owner. Another interpreter, another sealed owner with equal bytes, a caller flag
or JSON receipt cannot select this route. The complete signed module inventory
adds cleanup_frame_owned_current_image, changing nineteen modules to twenty;
the existing bootstrap schema, approval policy and acceptance criteria remain.

Before tool creation, retain prospective original image and sealed-runtime read
owners under the admitted exclusive actor, native reaper and complete signal
custody. Require current read-only/CLOEXEC rights, original immutable seals,
extent and ELF identity, independent original-description witnesses, and exact
streamed bytes against the originally approved sealed runtime. Pre-admit and
charge the complete two-image and bounded EOF work to the original aggregate
allowance before reading; keep actual returned bytes and progress separately.
The reviewed current-task MM and controlled fork/exec relationship establishes
image selection. Paths, inode equality, status and hashes alone do not establish
consumption. Unsupported mechanisms refuse without a fallback.

Use the literal as executable and argv zero, preserving ordinary descriptor
cleanup. Exclude the original runtime and every guard copy from tool recipients,
along with all existing programme/channel/bootstrap/native control exclusions.
Retain the guard through original child/cohort registration. Partial acquisition,
read, cancellation or close failure preserves the first error and every uncertain
owner while independently retiring authenticated peers; no effect, last close,
ordinary request, terminal completion or acknowledgement is replayed. Original
descendant closure, actor acknowledgement and genuine reaping remain required.

The finite helper exercise verifies and completely captures the workflow-selected
original signed helper source, then directly invokes its fixed preparation entry
using -E -S -B -Werror and its deliberately wanted original helper script
directory. It grants no PYTHONPATH/PYTHONHOME, site or implicit cwd import role;
the supervisor retains -I. Complete source/runtime/sysroot/depot consumption,
typed provider/callback/SSA closure, independent Kernel effects, complete frame
acceptance and guest/self-hosting are separate requirements. A successful host
preparation or current-image guard cannot satisfy those domains.

Tracking

Related: Exsh #15, Exsh #4, and Phase 6. A repair must bind nested execution to the original immutable image and preserve descriptor exclusion, cancellation and first-error handling.

## Summary Dependency preparation fails when Python was executed from a sealed descriptor. The nested dependency check tries to reuse `sys.executable`, whose descriptor is closed before the child resolves it. ## Reproduction Run the maintained `scripts/setup-component-ci-overrides.py` through Exsh's sealed Python tool. Dependency discovery calls `dependency_pins.validate_repository_sources`, which launches `check-dependency-policy.py` with `sys.executable` and Python's default descriptor cleanup. The complete source capture reproduced this during the first preparation command. The interpreter reported `/proc/self/fd/14`. ## Expected and actual behavior The nested check should execute the same approved immutable interpreter without inheriting unrelated descriptors. Instead, `os.posix_spawn` raises: ```text FileNotFoundError: [Errno 2] No such file or directory: '/proc/self/fd/14' ``` ## Environment and identity - Exsh: `d7b8e9baf46ab28ce004e195de4eb0c1e4fbc12a`. - Integration helper: `9c064a519cdd82e86c18c524281c317247883244`. - Linux x86-64, Python 3.14; interpreter bytes were captured in a sealed tool. - Host preparation; no EriX guest build ran. ## Evidence and prior checks The traceback reaches `dependency_pins.py`, `subprocess.Popen` and `os.posix_spawn` before the error above. The original failed command and cleanup receipts are retained. Its tool process and cohort retired; compiler execution did not begin. ### Original current-MM interpreter selection The maintained supervisor may select literal `/proc/self/exe` only when its selected tool is the genuine signed Programme's same original approved Python owner. Another interpreter, another sealed owner with equal bytes, a caller flag or JSON receipt cannot select this route. The complete signed module inventory adds `cleanup_frame_owned_current_image`, changing nineteen modules to twenty; the existing bootstrap schema, approval policy and acceptance criteria remain. Before tool creation, retain prospective original image and sealed-runtime read owners under the admitted exclusive actor, native reaper and complete signal custody. Require current read-only/CLOEXEC rights, original immutable seals, extent and ELF identity, independent original-description witnesses, and exact streamed bytes against the originally approved sealed runtime. Pre-admit and charge the complete two-image and bounded EOF work to the original aggregate allowance before reading; keep actual returned bytes and progress separately. The reviewed current-task MM and controlled fork/exec relationship establishes image selection. Paths, inode equality, status and hashes alone do not establish consumption. Unsupported mechanisms refuse without a fallback. Use the literal as executable and argv zero, preserving ordinary descriptor cleanup. Exclude the original runtime and every guard copy from tool recipients, along with all existing programme/channel/bootstrap/native control exclusions. Retain the guard through original child/cohort registration. Partial acquisition, read, cancellation or close failure preserves the first error and every uncertain owner while independently retiring authenticated peers; no effect, last close, ordinary request, terminal completion or acknowledgement is replayed. Original descendant closure, actor acknowledgement and genuine reaping remain required. The finite helper exercise verifies and completely captures the workflow-selected original signed helper source, then directly invokes its fixed preparation entry using `-E -S -B -Werror` and its deliberately wanted original helper script directory. It grants no PYTHONPATH/PYTHONHOME, site or implicit cwd import role; the supervisor retains `-I`. Complete source/runtime/sysroot/depot consumption, typed provider/callback/SSA closure, independent Kernel effects, complete frame acceptance and guest/self-hosting are separate requirements. A successful host preparation or current-image guard cannot satisfy those domains. ## Tracking Related: [Exsh #15](https://git.erikinkinen.fi/erix/exsh/issues/15), [Exsh #4](https://git.erikinkinen.fi/erix/exsh/issues/4), and [Phase 6](https://git.erikinkinen.fi/erix/integration/issues/65). A repair must bind nested execution to the original immutable image and preserve descriptor exclusion, cancellation and first-error handling.
Author
Owner

The current-image guard is published. It selects literal /proc/self/exe only for the Programme's same approved Python owner, checks the complete immutable image through native owners, excludes runtime/guard copies from recipients and preserves the original total and quiet deadlines before child creation. The actual helper demonstration remains pending the coordinated sealed-source and retained-pin custody work in the source contract. This is no complete consumed-input, frame or guest acceptance.

[The current-image guard](https://git.erikinkinen.fi/erix/exsh/commit/e5fb97ea18455a961887d3f439310b5646a1e7c2) is published. It selects literal `/proc/self/exe` only for the Programme's same approved Python owner, checks the complete immutable image through native owners, excludes runtime/guard copies from recipients and preserves the original total and quiet deadlines before child creation. The actual helper demonstration remains pending the coordinated sealed-source and retained-pin custody work in [the source contract](https://git.erikinkinen.fi/erix/exsh/issues/4). This is no complete consumed-input, frame or guest acceptance.
Author
Owner

The coordinated sealed-source and pin custody change is published alongside the current-interpreter guard. The next preparation attempt will directly invoke the workflow-selected signed helper with its original producer inputs and ownership limits. Successful host preparation still cannot establish compiler input consumption, source/frame proof or an EriX guest build.

The coordinated [sealed-source and pin custody change](https://git.erikinkinen.fi/erix/exsh/commit/237c8875bd41d62d128746226ccdde7a9550372a) is published alongside the current-interpreter guard. The next preparation attempt will directly invoke the workflow-selected signed helper with its original producer inputs and ownership limits. Successful host preparation still cannot establish compiler input consumption, source/frame proof or an EriX guest build.
Author
Owner

Fixed by the published interpreter and source-custody change. The genuine signed helper now completes its nested dependency checks and prepares all six exact manifest-pinned dependencies. The attempt uses the workflow-selected helper and original approved interpreter, excludes unused auxiliary descriptors, and completes native actor, descendant and parent cleanup. This closes the nested-interpreter defect. Complete compiler input consumption, source/frame proof and EriX plus Rust/LLVM guest rebuilding remain separate requirements.

Fixed by the [published interpreter and source-custody change](https://git.erikinkinen.fi/erix/exsh/commit/237c8875bd41d62d128746226ccdde7a9550372a). The genuine signed helper now completes its nested dependency checks and prepares all six exact manifest-pinned dependencies. The attempt uses the workflow-selected helper and original approved interpreter, excludes unused auxiliary descriptors, and completes native actor, descendant and parent cleanup. This closes the nested-interpreter defect. Complete compiler input consumption, source/frame proof and EriX plus Rust/LLVM guest rebuilding remain separate requirements.
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:39:15 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
erix/integration#114
No description provided.