Skip to content

Follow-ups from #307 and #308: edited copies freeze, refusal advice, a finish hook and add, status vs build #317

Open

Description

@willgosnold

Follow-ups found while verifying #313 (#307) and #314 (#308). None is a failure of the copy or move rule those PRs add. Items 3 to 5 behave the same on main today.

  1. An edit to a recorded copy freezes the copy. Copy skills/a/SKILL.md to skills/b/SKILL.md and commit, so record writes copy skills/a -> skills/b. Then edit skills/b/SKILL.md and commit. record writes replace skills/b/SKILL.md with a full copy of the file, because the source still builds skills/a on disk. From then on b misses upstream's changes to a, and status says no problems. The same rule keeps an edited rename of a file that a copy still builds from as delete + add. A content edit that applies only at the copy's destination would let it keep following.
  2. A copy edited before it is recorded is an add with no note. Copy an upstream file and edit it in the same commit. record writes add, as designed, but says nothing about the file not following upstream. A note such as "recorded as add; it matches no upstream file exactly" would tell the user to commit the copy first.
  3. The refusal's "Record into X" advice can name a change that also refuses. When the writes of one recording conflict with two different later changes, refusal (src/record.ts, const floor = ... .at(-1)) picks the change of the last write it lists, not the latest change in series order. Repro: changes early, late1 (deletes a file under extra/skills/x) and late2 (deletes skills/a/SKILL.md). Copy extra/skills/x/SKILL.md into skills/x/ and another upstream file into skills/a/SKILL.md, then run patchbook record early. The advice names late1, and record late1 refuses too. Nothing is written in either refusal.
  4. A finish hook that rewrites a hand-added file makes direct record exit 0. With a finish hook that changes outputs by their content, add a file the hook rewrites and run patchbook record --intent .... It records add and exits 0. Then patchbook build refuses with "these output files changed since the last build", and patchbook status says no problems. The commit hook refuses the same commit, so nothing wrong is committed. PR 313 checks the build again after saving only for copy and move rows. An add row could get the same check.
  5. status says no problems while build refuses. This happens in item 4, and after deleting an output by hand without recording it. build refuses on a hand edit, but status doesn't report one.
  6. The copy search scans every staged file for each new output. A size check skips most pairs, but on a large upstream the work is (new outputs) × (staged files), and a file with block entries or a file edit is built for each comparison. Nothing measures it yet.

🤖 Generated with Claude Code

Activity

  1. willgosnold commented on Oct 20, 2026

    @willgosnold
    OwnerAuthor
    1. A renamed file that grows to more than about twice its old length is still a delete + add. PR 314 records an edited rename as a move only when the two versions keep at least half of the longer one's non-blank lines. Rename skills/a to skills/a2, keep all 6 lines of SKILL.md, and add 8 more. The rename is recorded as delete + add, so the file stops following upstream and status says no problems. The longer-text denominator is deliberate: it stops a short deleted file from pairing with a much larger new file that only contains it. A rule that also pairs when every old line is kept in order would cover this case.
  2. willgosnold commented on Oct 26, 2026

    @willgosnold
    OwnerAuthor

    Item 1 (an edited copy keeps following upstream) is fixed by #368. The other items in this issue are still open. Follow-ups found during that review are #373, #376, #377 and #378.

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