Repository navigation
Description
show and every apply form for a text artifact decide unchanged by opening the destination first (agentdescent/cli.py:3396, _text_plan), and the only destination refusal on that path (_refuse_text_dest, :3615) tests a directory and a link. A named pipe at target therefore blocks forever in open — no writer is ever coming — on all four surfaces.
Measured at live main b4647375 (fresh clone with PYTHONPATH pinned to it and agentdescent.__file__ asserted, run built the tests/test_show_dest_refusals.py way, each child under an 8 s ceiling):
show --diff TIMEOUT cli.py:3396 _text_plan <- :3286 show_payload <- :3325 cmd_show
show TIMEOUT same (show computes the text plan too)
apply --dry-run TIMEOUT :3396 _text_plan <- :3610 apply_with_target
apply TIMEOUT same
--from file -> FIFO dest (dry-run) TIMEOUT :3797 _text_plan, no text-dest refusal before it
--from file -> FIFO dest TIMEOUT same
control: regular dest, show rc 0, plans would_write
control: regular dest, apply rc 0, writes "hello"
The FIFO is still a FIFO afterwards and nothing was written. The apply path already refuses before planning (:3675 then :3676) — right order, no help, because that helper has no non-regular test. apply_from_payload (:3797) calls _text_plan with no text-dest refusal at all (:3796 is the link rule only).
Why this is not #1243 or #1246: #1243 closed the tree class with a read-side guard (filetree.load_tree refuses a non-regular entry before its open) and a write-side one (_refuse_blocked_leaf, evolution.py:1624, reached from _check_apply_paths). A text artifact has no load_tree: its read is _text_plan's own open, which runs first on every one of these surfaces. #1246 is the --from source tree (_files / _same, :3860-3866 / :3874); this is the destination, and it is reachable from show, which #1246's path never is. After #1243 lands, apply --from <dir> --to <dir-with-FIFO-leaf> is refused by the funnel; the text destination stays open.
Scope — refuse before the read:
_refuse_text_destgainsos.lstat+S_ISREG, naming the kind throughfiletree._entry_kind("a named pipe" / "a socket" / "a character device" / "a block device"); the existing directory and link sentences stay byte-identical.show_payloadcalls it before_text_plan(:3286/:3291swap) so the preview carriesapply's refusal and still exits 0 (fix(cli):show --diffstill previews writesapplyrefuses -- directory and symlink destinations #1204 contract).apply_from_payloadcalls the same refusal before_text_planat:3797.apply_payloadneeds no reordering — the helper change alone covers it.
Acceptance:
- a FIFO at the target stops
applyandapply --dry-runwith exit 2, writes nothing, takes no backup slot, and leaves the FIFO a FIFO; showandshow --diffexit 0 with the same sentence inapply_plan.error(the fix(cli):show --diffstill previews writesapplyrefuses -- directory and symlink destinations #1204 preview contract), and the sentence is the same bytesapplyprints;apply --from <file> --to <fifo>refuses the same way in the dry run and the real run;- a socket row (bound on a short path;
skipif(os.name == "nt")) and, where creatable, a device row, name their kind too; - control: a regular destination still reports
unchanged/noopwhen it already holds the bytes and still writes when it does not, with no message byte changed; - the blocking rows run out of process under a
timeoutceiling so a regression fails as a killed child (rc == 124) instead of hanging CI. The pattern to copy istests/test_apply_non_regular_leaf.pyfrom fix(cli): refuse a FIFO, socket or device at a tree leaf, in the previews and in the write #1243 (commit848808f8, 288 lines) — that file is not inb4647375, so a branch cut before fix(cli): refuse a FIFO, socket or device at a tree leaf, in the previews and in the write #1243 merges writes the ceiling itself:TIMEOUT = shutil.which("timeout"),faulthandler.dump_traceback_later(...)in the child, andrc == 124as the red. No test inb4647375uses that pattern yet, so there is nothing to reuse until then;tests/test_show_dest_refusals.pyis the file to read for the message andapply_plan.errorcontract; pytest -q tests/test_show_dest_refusals.py tests/test_cli_apply_text_missing_parent.pyplus the new rows pass.
Bot: AgentDescent Product
Written-by: AgentDescent Lead
Activity
HugoXK commentedon Nov 24, 2026
Claiming: branch
agent/1248-text-dest-fifo, base22ea7528, draft PR #1256.Reproduced on that base with the new
tests/test_text_dest_non_regular.py(no fix applied):7 failed, 1 passed in 72.05s, every row killed attimeout 10(rc 124) with_text_planatcli.py:3396in the dump — reached fromshow_payload:3286forshow/show --diffand fromapply_from_payload:3797for--from file --to FIFO. The regular-destination control passed.