2.9 KiB
Prompt
Follow-up from the design session logged in 20260417T034918Z_9703210_prompt_io.md: the user greenlit Phase A after /prompt-io tracking, so execute the Phase A “modularize spawn._spawn” plan end-to-end in a new worktree — four logical steps (pytest harness prep, trio_proc extraction, mp_proc extraction, docstring refresh), each green via /run-tests.
User directives during execution: - Option 3 for the test cadence (“continue A.2–A.4 first, then run the full suite once at the end of Phase A”). - One commit for the whole phase (“can’t we just commit the whole patch in one commit?”) instead of the 3/4-commit split I initially proposed. - Don’t pre-draft commit messages — wait for the user to invoke /commit-msg (captured as feedback memory feedback_no_auto_draft_commit_msgs.md).
Response summary
Produced the cohesive Phase A modularization patch, landed as commit 61a73bae (subject: Mv trio_proc/mp_proc to per-backend submods`). Five files changed, +565 / -418 lines.
Key pieces of the patch (generated by claude, reviewed by the human before commit): - tractor/spawn/_trio.py — new; receives trio_proc() verbatim from _spawn.py; imports cross-backend helpers back from ._spawn. - tractor/spawn/_mp.py — new; receives mp_proc() verbatim; uses from . import _spawn for late-binding access to the mutable _ctx / _spawn_method globals (design decision made during impl, not the original plan). - tractor/spawn/_spawn.py — shrunk 847 → 448 LOC; import pruning; bottom-of-module late imports for trio_proc / mp_proc with a one-line comment explaining the circular-dep reason. - tractor/spawn/__init__.py — docstring refresh describing the new layout. - tractor/_testing/pytest.py — the valid-backend set now comes from typing.get_args(SpawnMethodKey) so future additions ('subint') don’t need harness edits.
Files changed
See git diff 61a73ba~1..61a73ba --stat:
tractor/_testing/pytest.py | 12 +-
tractor/spawn/__init__.py | 31 +++-
tractor/spawn/_mp.py | 235 ++++++++++++++++++++++++
tractor/spawn/_spawn.py | 413 +-------------------------------
tractor/spawn/_trio.py | 292 ++++++++++++++++++++++++++++
5 files changed, 565 insertions(+), 418 deletions(-)
Validation: - import probe + _methods wiring check — OK - spawn-relevant test subset — 37 passed, 1 skipped - full suite — 350 passed, 14 skipped, 7 xfailed, 1 xpassed
Human edits
None — committed as generated by claude (no diff between .claude/git_commit_msg_LATEST.md and the committed body, as far as the assistant could observe).