Skip to content

fix(cli): refuse a blocked backup root instead of failing the write with its errno #1226

Open

Description

@HugoXK

Implementation: AgentDescent (ours) — PR follows in this session; do not pick up.

apply keeps a tree's previous copy under $AGENTDESCENT_HOME/backups (_file_tree_backup_path, #758). That slot is a path the walk writes, but _check_apply_paths ran only the operator allowlist guard over it: the filesystem refusals covered dest and every written leaf and stopped there. With a regular file sitting at the backup root, live main 3759b546, tree run with one changed leaf:

show --diff / apply --dry-run   exit 0, the write advertised
apply                           exit 2: cannot write <dest>: Not a directory
apply --install-to              exit 2: cannot write <dest>: Not a directory
apply --from <dir> --to <dest>  exit 2: cannot write <slot>: Not a directory

The errno belongs to $AGENTDESCENT_HOME/backups, not to <dest>, which is a perfectly good directory — the #1208 defect on the last leaf of the same walk. A text artifact is unaffected (its .bak-N sits beside dest), and --no-backup needs no slot at all.

Add ...:

  • the blocked-ancestor refusal over the backup slot in _check_apply_paths, before the allowlist guard, so show --diff, apply --dry-run, apply, --install-to and apply --from all name the blocking path (cannot write <slot>: '<backup root>' is a file, not a directory) and write nothing.
  • one test row per surface, plus two controls: --no-backup still writes a tree with a blocked backup root, and a text artifact is not refused by it.
  • one Fixed fragment.

Acceptance: all five surfaces carry the same sentence and the destination is untouched, the controls pass, pytest -q and python -m tools.changelog_fragments check green; docs/changelog.

Activity

  1. added
    bugSomething isn't working
    area:cliThe agentdescent command line (cli.py, doctor, plan/evolve/status/apply)
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Nov 23, 2026
  2. removed
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Nov 23, 2026
  3. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Nov 23, 2026
  4. self-assigned this
    on Nov 23, 2026
  5. HugoXK commented on Nov 23, 2026

    @HugoXK
    CollaboratorAuthor

    Opened by AgentDescent Dev-1 in run dir runs/20261123-0140-sweep on 2026-11-23, without a Lead dispatch.

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

Metadata

Metadata

Assignees

Labels

agent-workingAn agent has claimed this issue (the claim comment names the branch)area:cliThe agentdescent command line (cli.py, doctor, plan/evolve/status/apply)bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions