--- model: gpt-5.6-sol service: opencode session: root-bindspace-bootstrap timestamp: 2026-08-30T02:52:02Z git_ref: b1f6ade8 scope: code substantive: true raw_file: 20260830T025202Z_b1f6ade8_prompt_io.raw.md --- ## Prompt The human chose to defer multiprocessing bindspace FD transport because that backend may be removed, selected root/single-actor namespace bootstrap as the next stage, approved caller-thread restoration and public `tractor.net.open_wg_bindspace()` composition, and authorized implementation after the stack rebase. ## Response summary Added `bindspace=` to `tractor.open_root_actor()`. Root startup now duplicates and validates the live namespace FD, enters before any debugger, registry, IPC, or actor-runtime work, and synchronously restores the caller thread's original namespace after complete root teardown. Added deterministic failure/cancellation coverage, a real UDS root actor E2E across two network namespaces, and an executable public WireGuard-bindspace/root composition regression. Bound roots reject the persistent `mp_forkserver` backend because a helper from an earlier runtime may retain a stale namespace; the public annotation also remains runtime-resolvable without importing `tractor.net` eagerly. ## Files changed - `tractor/_root.py` - public root bindspace lifecycle integration. - `tractor/spawn/_netns.py` - temporary thread-local netns enter/restore. - `tests/test_netns_spawn.py` - deterministic and real root regressions. - `tests/net/test_wg_iface_lifecycle.py` - public root composition test. - `docs/api/net.rst` - root ownership and restoration contract. ## Human edits The human explicitly deferred multiprocessing support, selected root bootstrap as the next implementation stage, approved the requirement to restore the caller's original namespace so owned teardown can complete, and approved composition through public `tractor.net` contexts rather than a new one-shot convenience API. The human later rewrote `_enter_netns_temporarily()` to separate restoration from FD cleanup and make the transition flow easier to inspect. The agent retained that intent with nested lexical FD ownership while fixing setup-error masking, conditional restoration, and duplicate-FD cleanup found during the requested audit.