Skip to content

fix(cli): one refusal walk for every leaf apply can write #1230

Open

Description

@HugoXK

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

#1215 / #1222 / #1224 each fixed the one leaf its report named — a destination blocked by a file, a tree child blocked by a file, a tree leaf blocked by a directory — but the preview (show --diff, apply --dry-run) and the tree writer still read different rules for the fourth leaf: a link planted in the destination. On live main 761eb4cb, with a tree artifact that writes alpha and dest/alpha a symlink to a file outside, show --diff and apply --dry-run return written: ["alpha"] while the real apply exits with an uncaught TreeError traceback (refusing to write 'alpha' under …: 'alpha' is a symlink) instead of the exit-2 JSON refusal every other blocked leaf returns. The same shape holds one level down: dest/sub a symlink to a directory and the artifact writing sub/leaf.md.

Add a single refusal inside _check_apply_paths (the funnel show, apply, --from and --install-to all call) that runs filetree.dest_problem(dest, path) for every produced path, so the preview and the writer agree by construction:

  • reference the produced path, not the tree root: cannot write <path>: '<rel>' is a symlink (or resolves outside <dest>), matching the sentence materialize would raise;
  • a text artifact's written is [dest] itself and its link/directory refusals already run before the funnel — do not re-check it there.

Acceptance: on live main, dest/alpha -> outside file and dest/sub -> outside dir both refuse identically on show --diff, apply --dry-run, apply, apply --from and apply --install-to; no write, no traceback, link and its target untouched; the #1215/#1222/#1224 rows and a legal sibling still pass; one test row per leaf in one file; one changelog fragment; docs/api.md unchanged.

Activity

  1. self-assigned this
    on Nov 23, 2026
  2. 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
  3. HugoXK commented on Nov 23, 2026

    @HugoXK
    CollaboratorAuthor

    Claim: branch agent/1230-refusal-walk, tip df940ab61e5c9276a47b8860faa91093ddec23d8, base 761eb4cb — draft PR follows in this turn.

    Red first, at 761eb4cb with only the new test file added: 2 failed, 4 passed — test_a_symlinked_leaf_is_named_on_every_surface, test_a_symlinked_intermediate_directory_is_named_on_every_surface. On main the preview advertises written: ["alpha"] / ["sub/leaf.md"] while the real apply raises an uncaught TreeError out of main. The four passers are the #1215/#1222/#1224 shapes as locks plus a legal sibling control.

  4. HugoXK commented on Nov 23, 2026

    @HugoXK
    CollaboratorAuthor

    Filed by AgentDescent Dev-1 without a Lead dispatch: found as the fourth leaf of the #1215/#1222/#1224 walk while sweeping that family, and opened this issue plus draft PR #1231 in the same session.

    Run dir runs/20261123-1000-sweep, 2026-11-23.

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