Skip to content

chore(pstack): flag lines of ours that name a path upstream deletes - #40

Merged
mstephenholl merged 1 commit into
mainfrom
merge-upstream-deleted-paths
Oct 29, 2026
Merged

mstephenholl merged 1 commit into
mainfrom
merge-upstream-deleted-paths

Conversation

@mstephenholl

Copy link
Copy Markdown
Owner

The sync for upstream cursor#1043 deleted scripts/orch, and merge-upstream.py said nothing about the fork's own references to it: the harness's bun note and the verify-orch-store-lock project skill. #39 found them by hand. This adds the check that would have caught them.

What changes

  • merge-upstream.py reports each file of ours with a line that names a path the merge deletes, with that line:

    upstream deleted pstack/skills/poteto-mode/scripts/orch, and our pstack/skills/pstack-harness/SKILL.md still names it: - `scripts/watch-pr` and `scripts/orch` need `bun`. …
    
    • Our lines only. A line is ours when upstream's version of the file lacks it. The script diffs the merged index against the incoming commit, so files only the fork has, our README copies, and our rewrites are all covered, and upstream's own text in a pointer-only skill never counts.
    • Endings. A path is named by any ending of two or more of its parts, such as scripts/orch or orch/store.ts. An ending that a path left in the port shares is skipped, so scripts/package.json never matches. The excerpt starts just before the match, so a long line still shows the name.
    • Folders and renames. A folder the merge empties counts as deleted. The diff runs with --no-renames, so a renamed file counts as deleted too, and a reference to its old name is flagged.
  • sync-upstream.sh needs no change. A new item goes under "Needs porting" in the sync issue, and on a clean merge it labels the sync pull request needs-porting.

  • port/README.md and the script's docstring describe the check.

Risk

  • Noise. A short ending like scripts/orch could match a path outside the repository with the same ending. The replay below found none.
  • Misses. A bare name such as `orch` or store.ts isn't a path ending, so it isn't flagged. chore(upstream): merge cursor/plugins #39's --store to every orch call line was like that. Its file still gets flagged, because the same file names scripts/orch elsewhere.

Proof

  • Replay of all 12 upstream merges in this repository's history, each run in a detached worktree at the merge's first parent with --ref at its second:
    • chore(upstream): merge cursor/plugins #39's merge (3b99a9d): the three references chore(upstream): merge cursor/plugins #39 removed: verify-orch-store-lock/SKILL.md and StoreLock.tla for store.ts, and pstack-harness/SKILL.md for scripts/orch.
    • The other 11: nothing. Two of them deleted files, 26 in 323d97f and 3 in 914da34, and a git grep for each file's basename across pstack/port, pstack-harness, both READMEs, .agents, and .github finds no reference.
  • Three new tests, and each fails without what it checks:
    • With the check removed from triage, all three fail.
    • With rename detection back on, the rename test fails.
  • Port unit tests: 264 pass.
  • check.py: 0 problems, 0 warnings.

The sync for upstream cursor#1043 deleted scripts/orch, and the report said nothing about the fork's own references to it: the harness's bun note and the verify-orch-store-lock project skill. #39 found them by hand.

merge-upstream.py now reports each file of ours with a line that names a path the merge deletes, with that line.

- A line is ours when upstream's version of the file lacks it, so upstream's own text in a pointer-only skill never counts.
- A path is named by any ending of two or more of its parts, such as scripts/orch. An ending that a path left in the port shares is skipped, so scripts/package.json never matches.
- A folder the merge empties counts as deleted, and so does a renamed file.

Over the last 12 syncs, this flags the three references #39 removed and nothing else. Two other syncs deleted 29 files, and no file of ours named any of them.
@mstephenholl
mstephenholl merged commit b314a9d into main Oct 29, 2026
10 checks passed
@mstephenholl
mstephenholl deleted the merge-upstream-deleted-paths branch October 29, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant