Skip to content

prose_lint.py Adds Nothing to Scope for a Rename, So Prose Moved Out of a Generated Tree Is Never Read #1586

Closed

Description

@ptr727

Problem

Git reports a pure rename as a rename from / rename to pair with no +++ header and no hunk, so changed_lines in .github/actions/prose-gate/prose_lint.py adds nothing to scope for it. The moved file is never read.

That matters most in the direction where a rename changes whether the gate would read the file at all. A path under one of the GENERATED_TREES is never read, on the grounds that its prose is generated rather than authored. Renaming such a file into a checked path leaves it unread in diff mode too, so prose that was exempt where it sat arrives in a checked tree still exempt, and nothing ever reads it.

An empty scope is falsy, so main's if scope and not matched refusal does not fire either. The run exits 0.

Evidence

Constructed: a repository holding one file under a generated tree carrying a duplicated word, renamed into a checked path and nothing else changed.

--diff HEAD   scope: 0 of 1 file(s) read, 0 changed line(s)   exit 0   <- false clean
whole tree    docs/x.md:2: dupword: duplicated word            exit 1

Reach

Any rename, and the gate's action always runs in diff mode. The generated-tree case is the one where the result is not merely late but wrong: the file's content has never been read by any run, so there is no earlier pass to rely on.

Suggested direction

Either pin --no-renames on the invocation, so a rename is reported as a delete plus a full add and the destination lands in scope with every line changed, or read rename to and credit the destination as fully added. The first is one flag and matches how the same invocation already pins what it depends on; the second keeps the diff smaller.

Worth deciding at the same time whether a rename into a checked path should be read whole or only where it also changed, since a file that moved unmodified has content no run in that path has ever read.

Scope

Found by a local review pass on the branch fixing #1575 and #1576. Confirmed present at 7e39cb8, so it predates that branch. Left out of it because the choice above wants deciding rather than assuming, and the branch was already two issues wide.

Activity

  1. ptr727 commented on Oct 31, 2026

    @ptr727
    OwnerAuthor

    Backlog burndown, round 1 file claim.

    Group issues: #3220, #1586
    Branch: feature/burndown-3220-1586
    Predicted file set:

    • .github/actions/prose-gate/prose_lint.py
    • scripts/tests/test_prose_lint.py

    Another group must not edit these files until this branch merges or the claim is released here.

  2. ptr727 commented on Oct 31, 2026

    @ptr727
    OwnerAuthor

    Claim correction for this group: the test file is tests/test_prose_lint.py (repo-root tests/), not the scripts/tests/ path the claim above names. Branch and other files unchanged.

  3. ptr727 commented on Oct 31, 2026

    @ptr727
    OwnerAuthor

    Claim released: feature/burndown-3220-1586 merged to develop as #3685 and its branch and worktree are cleaned up. This issue closes when the next develop -> main promotion merges.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions