R1
What to build¶
Isolated evaluation returns within its declared receive deadline even when a child stops mid-frame.
Source and evidence¶
Repository scientific/architectural review, snapshot 86c8517, item R1.
Classification: confirmed defect; high severity.
poll() only establishes read readiness. The subsequent recv_bytes() blocks
until the entire frame is available; the monotonic deadline is no longer checked.
A child stopped during transmission can leave its parent stuck indefinitely,
preventing the finally block from terminating the child. The byte limit limits
allocation, not receive duration. This defeats the isolation containment boundary.
Reproduction on macOS, Python 3.14.7: create a one-way multiprocessing pipe;
write struct.pack('!i', 8) + b'R' to the writer file descriptor; keep the writer
open; call _receive_frame(reader, live_process_double, 0.05) on a thread.
After a 0.2-second join the thread remained blocked (observed 0.201 seconds).
Closing the writer released the reader, and the thread was joined successfully.
The process double's is_alive() returns true; no child is left running.
This tests the real pipe receiver, not an emulated recv_bytes().
Acceptance criteria¶
- [ ] A real pipe with a valid frame header and incomplete body returns a closed timeout/failure outcome within the deadline plus documented cleanup grace.
- [ ] Partial header, partial body, EOF, oversized frame and healthy complete-frame cases are covered without leaked readers or direct children.
- [ ] The byte ceiling is enforced before excessive allocation, independently of duration enforcement.
- [ ] Deadline tests use deterministic readiness synchronization and independent cleanup on every supported test platform.
- [ ] Preserve Consumer-owned meaning, payload-free evidence, disabled optional-import isolation, safe diagnostics and the non-relaxable Safety Floor.
- [ ] Run the narrowest observable contract, then applicable committed Make gates. Record every command and outcome; update specifications/compatibility evidence for changed public or wire contracts. Run native Collector verification for changed Collector assets and build for packaging changes.
Design guidance¶
Keep deadline ownership outside any blocking whole-frame read. Choose a transport/read strategy with explicit reader and child ownership; do not introduce a helper thread that can remain blocked after return. Preserve the existing closed outcomes and payload-safe validation.
Keep prefactoring narrow and verifiable in this slice. Reuse established owners and structural interfaces; introduce a pattern only when it clarifies a real responsibility or variation point. Do not add consumer vocabulary or private payloads to platform code or evidence. Mocked/local results must not claim hosted, production, accelerator or release qualification.
Blocked by¶
None (can start immediately). Shared-area coordination is useful, but no other review fix is a genuine prerequisite for this slice.
Verification scope¶
Convert the described counterexample or investigation oracle into an observable test at the lowest suitable public boundary. Prefer bounded operation-count or deterministic interleaving evidence to flaky timing assertions; timing guarantees need a declared tolerance and independently owned cleanup. This ticket authorizes remediation/research, not publication or deployment.