Repository navigation
Commit 9585bef
fix(fork): refresh legacy setup scripts in project settings overrides (#1866)
## Problem
After setup-script adoption, project settings and the header **Setup Worktree** action keep the legacy `vp run setup:worktree`.
Startup reconciliation refreshes only `project.scripts`, but `resolveProjectScripts` reads `projectSettingsOverrides[id].defaultProjectScripts` first.
## Change
`reconcileSetupScriptsFork` also runs each override's scripts through `refreshPersistedSetupScripts`, so only exact legacy generated commands change.
A patch entry replaces the whole override set, so the update writes the full entry.
```ts
for (const [projectId, entry] of Object.entries(projectSettingsOverrides)) {
const current = entry.defaultProjectScripts;
if (current === undefined) continue;
const scripts = refreshPersistedSetupScripts(current);
if (scripts !== current) refreshed[projectId] = { ...entry, defaultProjectScripts: scripts };
}
```
## Scope and approval
Closes #1774
Human decision: fix it in the fork, inside the existing `.fork.` reconcile path.
## Verification
- [x] **Settings:** Edit Action shows the new command
- [x] **Header:** Setup Worktree runs the new command
- [x] **Test:** fails before the fix, passes after
- [x] **Test:** custom override command unchanged
- [x] **Test:** sibling `defaultAutoPull` kept
- [x] **Runtime:** legacy override refreshed on restart
- [x] `vp run fork:ci` → exit 0
- [ ] `vp run check:changed` → exit 1
**check:changed:** format, lint, knip, and typecheck pass.
2 tests fail that do not import the changed files; the first fails alone too:
```text
GitManager.test.ts > includes CLAUDE.md for Claude writers only when it differs from AGENTS.md
markdownPipeline.browser.test.ts > renders interactive tasks, workspace chips, and code chrome
```
**Settings → Project → Actions** after restart:

**Header → Script actions → Edit Setup Worktree.**
Both surfaces resolve through `resolveProjectScripts`.
Running it in the empty fixture fails with Node `MODULE_NOT_FOUND`, not the legacy `vite-plus` error.

Claude Opus 5.5 in Claude Code.
## Fork trailers
Fork-Domain: upstream-fixes
Fork-Tier: bugfix
Fork-Upstreamable: no
Co-authored-by: donjor <[email protected]>1 parent 7cd6ea1 commit 9585bef
2 files changed
Lines changed: 79 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
15 | 25 | | |
16 | 26 | | |
17 | 27 | | |
18 | 28 | | |
19 | 29 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
33 | 49 | | |
34 | 50 | | |
35 | 51 | | |
36 | 52 | | |
37 | 53 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
47 | 58 | | |
48 | 59 | | |
49 | 60 | | |
| |||
55 | 66 | | |
56 | 67 | | |
57 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
30 | 46 | | |
31 | 47 | | |
32 | 48 | | |
| |||
0 commit comments