Issue #36: delegated prompts travel by file, a delegation that fails ends the loop with rc 1. VERSIONS.md carries the entry; the merge-side reports (round 1 @59be1c8 and round 2 @708262a with identity sidecars, base59be1c8-> head708262a, evidence review-tree) are archived under .agents/reports/<session>/. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VCgu9Fa9iT7TbJUSzdq4Ff
5.5 KiB
5.5 KiB
Pre-Merge Independent Delta Review Report: PR #37 (fix/issue-36 Round 2)
- Job ID:
3121d389 - Target Agent:
agy(Session:herdr:reviewer-agy-01) - Role: Reviewer
- Target Worktree Context:
- Loop ID:
loop-20260924T085626Z-b8987e - Base Commit:
59be1c89209a232059aec0c5aeecc2329929cb49(Round 1 target) - Head Commit:
708262a598c4301c0ccc70efba5401093b4b1e30(1 delta commit: +68 / −7) - Tree SHA:
d601c2d01bb4c09931e5e1989e140b01d51f5b96 - Verification Path:
/var/folders/q_/68sxgw3j073dgjg8wl9s08vw0000gn/T/mam-review/loop-20260924T085626Z-b8987e/1
- Loop ID:
1. Executive Summary
This second review round examines delta commit 708262a ("fix(issue-36): merge review - handle prompt write failure in runner; reject empty prompt file; make test_s9 stderr check portable").
The commit directly resolves all three findings identified during Round 1:
- R1 / H1 (Prompt Write Failure Handling in
runner.py):_run_cmdnow wraps temporary prompt file creation and writing intry ... except OSError:. If writing fails (e.g.ENOSPC,EFBIG), any partial prompt file is unlinked and aCompletedProcess(..., 126, "", msg)is returned. The wrapper is not invoked, no unhandled exceptions bubble toLoopRunner.run(), and the failure is logged cleanly. Verified by new testtest_s4c. - R2 / N1 (macOS Portability in
test_s9): Intests/test_issue36_prompt_transport.py, line 637 guards the assertionassert "File too large" in result.stderrwithif sys.platform == "linux":. This accommodates macOS/bin/bash3.2.57 behavior while continuing to assertresult.returncode != 0, clean file removal (assert not leftovers), and the portable MAM diagnostic (assert "delegate_job_safe: cannot write the prompt file" in result.stderr) across all platforms. - H3 (Empty Prompt File Rejection):
multi-agent-mux-delegate-jobnow asserts[[ -s "$PROMPT_FILE" ]]incmd_submit(), rejecting empty files before registration. Verified by new testtest_s1e.
All 23 applicable tests in tests/test_issue36_prompt_transport.py passed cleanly in the macOS verification environment (with 1 platform-specific test skipped on Darwin as intended).
2. Detailed Verification Against Checklist Items
(1) Verification of the Three Delta Fixes & Side-Effect Analysis
- Prompt File Creation & Cleanup in
runner.py(R1/H1):prompt_fileis initialized to"".- In
_run_cmd,tempfile.NamedTemporaryFileandfh.write(p_text)are wrapped intry ... except OSError as e:. - If writing fails:
- If
prompt_fileexists, it is unlinked immediately in theexceptblock. - Returns
subprocess.CompletedProcess(["bash", str(wrapper_script), "submit"], 126, "", msg). - Because it returns directly from the
exceptblock, the downstreamsubprocess.run(cmd)and the outerfinally:block do not execute. The wrapper is never invoked with an incomplete file.
- If
- On the normal path:
- The wrapper executes, and the outer
finally: os.unlink(prompt_file)ensures the file is deleted exactly once.
- The wrapper executes, and the outer
- The returned exit code 126 triggers the existing retry mechanism in
delegate_job(); if the write still fails, the error message is logged cleanly anddelegate_job()returnsNone, terminating the loop with exit code 1 without tracebacks. - Verified by
test_s4c_a_prompt_file_that_cannot_be_written_is_a_failed_submit.
- macOS Test Portability for
test_s9(R2/N1):- Scoping
assert "File too large" in result.stderrtosys.platform == "linux"eliminates the macOSAssertionErrorthat caused the Round 1NOT PASS. - Portable assertions across Darwin and Linux verify:
assert result.returncode != 0(non-zero exit upon write failure).assert not leftovers(partial.mam/prompt-shloop-*files are deleted).assert "delegate_job_safe: cannot write the prompt file" in result.stderr(MAM error diagnostics printed to stderr).
- Verified by running
tests/test_issue36_prompt_transport.py::test_s9_shell_loop_removes_a_partial_prompt_file_and_says_whyon macOS (PASS).
- Scoping
- Empty Prompt File Rejection (H3):
cmd_submit()inmulti-agent-mux-delegate-jobchecks[[ -s "$PROMPT_FILE" ]] || { echo "submit: --prompt-file $PROMPT_FILE is empty" >&2; exit 1; }.- Rejects zero-byte prompt files fail-closed before invoking
registry.py. - Verified by
test_s1e_an_empty_prompt_file_is_refused.
(2) Impact of Empty File Rejection on Valid Workflows
- In MAM, all valid delegated prompts (task instructions, review requests, refinement briefs, compliance orders) require meaningful textual context.
- Loop brief provisioning (
prompt.md) always writes non-empty markdown briefs containing metadata and task descriptions. - Enforcing
-sprevents unintended empty job dispatches without affecting legitimate system workflows.
(3) Overall Merge Readiness
- Commit
708262acleanly addresses all review concerns with minimal, surgical changes (+68 / −7). git diff 59be1c8...HEAD --checkreported 0 whitespace or formatting errors.- Version bump to
v4.7.3is scheduled for the orchestrator release commit. - Zero blockers remaining.
3. Test Execution Summary
| Test Suite / Target | Result | Duration | Notes |
|---|---|---|---|
tests/test_issue36_prompt_transport.py |
23 PASS, 1 SKIP | 42.4s | 23 passed on macOS; test_s1b skipped (linux_only constant test); test_s9, test_s4c, test_s1e all pass |
git diff 59be1c8...HEAD --check |
0 errors | 0.05s | Clean formatting and no whitespace errors |
[VERDICT: PASS]