Skip to content

Fix the Stale Docstring on test_a_created_file_that_cannot_be_removed_is_named_as_incomplete #2499

Closed

Description

@ptr727

What is open

The local strict review of #2493's last fix round raised four findings in host-setup/agent-safety/claude/install.py and its tests. None is a regression against develop. They were left for a fresh pass because each round of wording fixes on that branch drew a new wording finding.

  1. A test docstring is stale. test_a_created_file_that_cannot_be_removed_is_named_as_incomplete says the error is "the write's own rather than the removal's". Since Recognize the Installer's Own Partial CLAUDE.md Rather Than Backing It Up as a Hand Edit #2493's later rounds, that error names the removal failure too.
  2. One message drops the write's own failure. A created file whose write fails with an ordinary error, for example ftruncate raising an I/O error, and which then cannot be removed, raises IncompleteWrite naming only the removal failure. The write's error survives only as __cause__, which main never prints, while main asks the user to "Fix what the error names". The neighbouring branch, for a write left incomplete, names both failures.
  3. The leftover note blames a missing stamp. On a host with no stamp yet, record_leftover_instructions puts the FileNotFoundError for agent-safety-stamp.json in its note. The note then reads as an error to fix, but a missing stamp is expected there.
  4. An interrupt window widened slightly. After the exclusive open creates a file, the islink and fstat calls run outside any try that would close the descriptor and remove the file. A KeyboardInterrupt in that window leaves an empty created file, which the next run backs up as a hand edit. develop had a narrower form of the same window.

Shape of a fix

Settle the error messages from one place rather than per branch, so the cause and the cleanup outcome are always both named. Leave out a missing stamp's error from the note. Move the post-open calls inside the cleanup's try.

Activity

  1. added
    agents
    on Oct 7, 2026
  2. ptr727 commented on Oct 8, 2026

    @ptr727
    OwnerAuthor

    Items 2 to 4 are declined under GOVERNANCE.md "Trust Boundaries and Hardening Effort" (#2501, released in 2.0.867), at the maintainer's direction. Item 2 is a message missing a cause after a rare I/O error, and the failure is still loud. Item 3 is a note's wording on a first-install host after a cut-short write. Item 4 is an interrupt landing between two calls in a single-user host tool. None fails silently or destructively. Item 1, the stale test docstring, is a plain doc divergence rather than hardening, so this issue now tracks only that one-line fix.

  3. changed the title [-]Name Both Failures in write_regular_file's Cleanup Errors, and Settle the Leftover Note's Wording[/-] [+]Fix the Stale Docstring on test_a_created_file_that_cannot_be_removed_is_named_as_incomplete[/+] on Oct 8, 2026
  4. ptr727 commented on Oct 23, 2026

    @ptr727
    OwnerAuthor

    Closed under the maintainer's decision (ptr727, 2026-10-23) on #3391: the backlog keeps real bugs with a stated failure, features the maintainer wants, and open decisions. A finding the review loop filed on code or text a change did not touch, a refactor or consolidation chore, a tracker, a wording item, or a guard shape no session has produced is closed rather than worked. Reopen with the input and the wrong result if this issue states one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agents

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions