Repository navigation
Open
Description
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.
- An edit to a recorded copy freezes the copy. Copy
skills/a/SKILL.mdtoskills/b/SKILL.mdand commit, sorecordwritescopy skills/a -> skills/b. Then editskills/b/SKILL.mdand commit.recordwritesreplace skills/b/SKILL.mdwith a full copy of the file, because the source still buildsskills/aon disk. From then onbmisses upstream's changes toa, andstatussays no problems. The same rule keeps an edited rename of a file that a copy still builds from asdelete+add. A content edit that applies only at the copy's destination would let it keep following. - A copy edited before it is recorded is an
addwith no note. Copy an upstream file and edit it in the same commit.recordwritesadd, 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. - 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: changesearly,late1(deletes a file underextra/skills/x) andlate2(deletesskills/a/SKILL.md). Copyextra/skills/x/SKILL.mdintoskills/x/and another upstream file intoskills/a/SKILL.md, then runpatchbook record early. The advice nameslate1, andrecord late1refuses too. Nothing is written in either refusal. - A finish hook that rewrites a hand-added file makes direct
recordexit 0. With afinishhook that changes outputs by their content, add a file the hook rewrites and runpatchbook record --intent .... It recordsaddand exits 0. Thenpatchbook buildrefuses with "these output files changed since the last build", andpatchbook statussays no problems. The commit hook refuses the same commit, so nothing wrong is committed. PR 313 checks the build again after saving only forcopyandmoverows. Anaddrow could get the same check. statussays no problems whilebuildrefuses. This happens in item 4, and after deleting an output by hand without recording it.buildrefuses on a hand edit, butstatusdoesn't report one.- 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
fileedit is built for each comparison. Nothing measures it yet.
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Labels
No labels
Activity
willgosnold commentedon Oct 20, 2026
delete+add. PR 314 records an edited rename as amoveonly when the two versions keep at least half of the longer one's non-blank lines. Renameskills/atoskills/a2, keep all 6 lines ofSKILL.md, and add 8 more. The rename is recorded asdelete+add, so the file stops following upstream andstatussays 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.fix(record): an edited copy keeps following upstream (#317)
refactor(record): name the destination rule's predicates and drop its…
test(build): a later copy or move of an edited copy should build its …
fix(build): apply a copy's destination edit in its place in the series (
test(record): an edited copy should keep following upstream (#317)
fix(record): an edited copy keeps following upstream (#317)
refactor(record): name the destination rule's predicates and drop its…
test(build): a later copy or move of an edited copy should build its …
fix(build): apply a copy's destination edit in its place in the series (
test(sync): a destination file edit with a missing base copy fails wi…
fix(sync,build): skip a copy's file edit that a later replace or dele…
fix(sync): keep ours for a copy's file edit that isn't text (#317)
fix(status,build): name the change and the missing copy for a copy de…
fix(record): an edited copy keeps following upstream (#317 item 1) (#368
willgosnold commentedon Oct 26, 2026
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.