Skip to content

A new worktree links its deps and Games, and the daemon restarts Vite when the games world changes - #2322

Merged
Noisemaker111 merged 1 commit into
betafrom
agent/lane-worktree-ready
Oct 24, 2026
Merged

Noisemaker111 merged 1 commit into
betafrom
agent/lane-worktree-ready

Conversation

@Noisemaker111

@Noisemaker111 Noisemaker111 commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Fresh worktrees created by claude --worktree or git worktree add had no node_modules and no Games link, and the shoot daemon kept a Vite server whose game list was frozen before that link existed.

Root cause: readiness lived only in agent:worktree, and only for the tree it created. ensure-ready and agent:bootstrap installed packages but never linked Games, so a bare tree reported "ready" and then rejected every game.

  • scripts/agent-worktree.ts: one readiness path (ensureWorktreeReady) shared by the command and any tree; finds the main checkout from the worktree's .git file, links deps, Games and dev assets, repairs dangling junctions, prints a one-line summary with the whole command's wall time.
  • scripts/ensure-ready.ts: calls that path before the install check, so every test/build/smoke run repairs a bare tree; no-op and silent when already ready.
  • scripts/shoot-daemon.ts: daemon state records the games world (link target, link mtime, games HEAD, game ids). ensureDaemonTarget retires the target's Vite server when that world changed and boots it against the new one; an unchanged world reuses the server. Fingerprint costs 0.5-1.4 ms per shot (measured, 2 and 15 games).

Verification

  • bun test scripts/agent-worktree.test.ts scripts/shoot-daemon.test.ts scripts/ensure-ready.test.ts - pass (38)
  • bun run verify:fast - pass; bun run check-types - 28 stages pass
  • bun run agent:worktree -- prove-ready on a real fresh worktree: 20.7 s cold (15.7 s of it bun install, locks differed from the main checkout), second call 0.7 s with "already set up", deps and Games present; worktree deleted after the run
  • daemon proof: started with Games -> world-a (beatlane), the dev server's game glob served beatlane only; repointed the link to world-b (beatlane + bogeylab), the next shot logged Games ... -> ...; +bogeylab — restarting the dev server against it and the glob then served bogeylab; a third shot reused the server without a restart

Still true: linking needs the main checkout on the same lockfile, so when origin/beta has moved each worktree pays one bun install (~16 s, bun's store makes it 411 packages in ~10-16 s, not minutes).

@Noisemaker111
Noisemaker111 merged commit d4ba63b into beta Oct 24, 2026
33 of 52 checks passed
Noisemaker111 added a commit that referenced this pull request Oct 24, 2026
pr:sweep counted every `statusCheckRollup` row, so an attempt from a superseded push could name a red on a PR that was green.

- `scripts/pr-sweep.ts` judges each armed PR's rollup through `judgeChecks`: one row per check name, on the head commit, so an older attempt or a same-commit cancelled duplicate cannot read as red.
- Three verdicts, one line per PR: `RED` naming each real failing check with its URL, `wait` with `still running: N of M (run <id>)`, or `ok`. A check cancelled on every attempt is a re-run rather than a red, because nothing is broken.
- Same job as before: one `gh pr list`, non-zero exit while any armed PR is really red.
- `package.json`: the script is now `pr:sweep`, the name `AGENTS.md` and the script's own usage line already used; `bun run pr:sweep` failed with "Script not found" before this.

Root cause: the sweep trusted a flat list of attempts where each check name can appear once per workflow run, so the last attempt to finish was not necessarily the one that decided.

Verification:
- `bun test scripts/pr-sweep.test.ts` - pass, 12 tests: #2330's real 42-row, 21-name rollup reads clean; a failing current check is RED and named; #2322's cancelled-then-skipped jobs ask for a re-run; a failure from a superseded push says nothing.
- `bun run verify:fast` - pass
- `bun run check-types` - pass, 28 stages
- `bun run pr:sweep` against the live repo - pass, prints `1 open PR(s), 0 armed`

Phantom check over the 102 open and last-100 merged PRs, old logic vs new: old named 4 reds, 3 of them phantom (#2287, #2252, #2235 named `quick`/`ci` failure while the newer attempt on the same PR passed and it merged), and 10 green merged PRs read as `wait` from cancelled rows alone. #2330's real rollup now prints `ok`; #2317 (open) stays RED on `types`, `test (g)` and `ci`.
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