Skip to content

No FIFO witness: the copier's SpecialFileError raise is asserted in prose only #422

Description

@pbean

Found while verifying a docstring edit during PR #406's close-out. Pure coverage gap — no behaviour is wrong.

What

install.py now asserts, in prose, that a FIFO in a skill tree or seed source reaches shutil.copy2 and raises SpecialFileError rather than hanging:

install.py:1241-1242 — "a FIFO raises SpecialFileError (copyfile stats both ends before opening either, so this is a crash, not the unbounded read a FIFO causes where something reads it)"

and install.py:1780-1782 documents the seed side the same way. This was measured during that PR — shutil.copy2 on a FIFO raises immediately and deterministically, out of provision_worktree, from both eager loops, with no hang — and an AST scan confirmed neither _copy_traversable call sits inside any enclosing try.

Nothing in the suite pins it. grep mkfifo over src/ and tests/ hits one docstring and zero tests.

Why the existing rationale does not cover it

tests/test_install.py:2270-2272 records the repo's reason for having no FIFO test:

"making a preflight hang is a poor thing to ask CI to reproduce"

That reason is sound for the reader side (_absent_renderer_sources used to block forever on a FIFO named pipe.md; path.is_file() closes that, and it is witnessed). It does not transfer to the copier side, because copyfile stats before it opens — so a copier-side FIFO witness terminates immediately and cannot hang CI.

Shape of a fix

A skipif(sys.platform == "win32") test that os.mkfifos a file inside a repo skill tree and asserts provision_worktree raises shutil.SpecialFileError (or, if the doctrine has since changed to per-file degradation, asserts the rel is reported instead — the point is that something pins which it is). Cheap, deterministic, non-hanging.

Related nit, same area

The docstring at install.py:1241 cites test_a_dangling_repo_symlink_is_dropped_by_the_copier_and_the_gate as its witness, but that test drives the skills merge, not the seed loops. The seed-loop mirror is test_worktree_seed_undelivered_stays_silent_on_a_dangling_repo_symlink (tests/test_install.py:3037). Worth correcting the citation while adding the FIFO witness.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:engineOrchestrator engine and run lifecycle

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions