Repository navigation
feat(scripts): --for-dev starts a shared server for the developer on a copy of their data - #556
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
5 of 7 tasks
Jacksondr5
force-pushed
the
j5code/live-test-peer
branch
from
October 12, 2026 04:05
4a6b2e7 to
32130b1
Compare
Jacksondr5
force-pushed
the
j5code/live-test-for-dev
branch
from
October 12, 2026 04:05
c39ae0a to
7c919e0
Compare
Jacksondr5
force-pushed
the
j5code/live-test-peer
branch
from
October 12, 2026 04:06
32130b1 to
0055f90
Compare
Jacksondr5
force-pushed
the
j5code/live-test-for-dev
branch
from
October 12, 2026 04:06
7c919e0 to
88d81ed
Compare
Jacksondr5
force-pushed
the
j5code/live-test-peer
branch
from
October 12, 2026 04:09
0055f90 to
d82f7db
Compare
Jacksondr5
force-pushed
the
j5code/live-test-for-dev
branch
from
October 12, 2026 04:09
88d81ed to
19da1ed
Compare
Jacksondr5
force-pushed
the
j5code/live-test-for-dev
branch
from
October 12, 2026 04:16
19da1ed to
7140218
Compare
Jacksondr5
force-pushed
the
j5code/live-test-for-dev
branch
from
October 12, 2026 04:24
7140218 to
561c2ed
Compare
This was referenced Oct 12, 2026
Jacksondr5
force-pushed
the
j5code/live-test-for-dev
branch
from
October 12, 2026 04:43
3cdf4ad to
1b935fd
Compare
Jacksondr5
force-pushed
the
j5code/live-test-peer
branch
from
October 12, 2026 04:46
de18fe9 to
c0fa7c0
Compare
Jacksondr5
force-pushed
the
j5code/live-test-for-dev
branch
from
October 12, 2026 04:46
1b935fd to
a66e0c1
Compare
Jacksondr5
force-pushed
the
j5code/live-test-for-dev
branch
from
October 12, 2026 04:55
a66e0c1 to
31ae118
Compare
Jacksondr5
force-pushed
the
j5code/live-test-for-dev
branch
from
October 12, 2026 04:57
31ae118 to
9213ae1
Compare
Jacksondr5
force-pushed
the
j5code/live-test-for-dev
branch
from
October 12, 2026 04:59
9213ae1 to
991ede5
Compare
…a copy of their data A start or rebuild with --for-dev copies a slice of the developer's data into its own home with migrate-dev-db, starts the dev server shared on the tailnet, and prints the tailnet pairing URL for the developer. It refuses a server that could not be shared, never opens the pairing URL, and on stop makes sure its own tailnet mapping is gone. The output says agents take no turns there. Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t make Sharing replaces whatever is mapped on the web port, and the dev runner moves to another port pair when its first choice is taken. The script now pins the runner to this worktree's own ports, and before starting refuses the live install's tailnet port, a port that carries someone else's mapping, and a port something is already listening on. On stop it removes a mapping only when this run's log recorded a share and the mapping proxies to this server's own web port. A failed read of the mappings is an error. Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ed runner and refuses blocked ports Review fixes for #556: - A foreign tailnet mapping on the port is reported and passed over on stop, not refused, so restart and rebuild still work while it is there. - When the runner was killed outright and the group will not be signalled, the tailnet cleanup runs before that refusal. It signals nothing and acts only on a mapping this run made. - A web port that browsers refuse to open is refused, since pinning the port skips the dev runner's own check. - The dry run and the tailscale reads are capped by the start's time budget. Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Jacksondr5
force-pushed
the
j5code/live-test-for-dev
branch
from
October 12, 2026 05:18
8f2afe7 to
4bd7b5d
Compare
…unning The advice was always to run the same start again, but a start only joins a server that is already there, so with one server not serving it waited out its budget and failed. The same start is advised only when both are running. Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When the developer wants to look at a branch themselves, an agent has to stand up a server on a copy of their data and share it over the tailnet by hand, and each step has a way to go wrong: the copy, the port, a share that fails silently, a mapping left behind. Part of #546 (stage 3, third of five stacked PRs; based on #555).
What changed
A start or
rebuildtakes--for-dev:apps/server/scripts/migrate-dev-db.ts --base-dir <worktree>/.j5code/live-test/home. That script attaches~/.j5code/userdataread-only and writes only below its base directory.--sharereplaces whatever is mapped on the web port, and the dev runner moves to the next free port pair when its first choice is taken. So the script pins the runner to this worktree's own ports (both given explicitly, which turns the runner's search off) and, before starting anything, refuses: the live install's tailnet port 8444; a port that already carries a mapping this server did not make; and a port something is already listening on.pairwould give a localhost URL) and never opens it.restartprints a new one.stopremoves only its own mapping. The dev runner removes its mapping on a normal exit. After stopping, the script acts only if this run's log recorded a share, and only on a mapping that proxies to this server's own web port on loopback: it runstailscale serve --https=<that port> offand checks again. A mapping on that port that proxies anywhere else is reported and left alone, without refusing, sorestartandrebuildstill work while it is there. A failed read of the mappings is an error, never "nothing is mapped". It never callsserve reset.isBrowserAllowedPortitself and refuses such a port.The mode rules from #554 apply: one build per worktree, fixed at build,
rebuildto switch.Live testing
On 2026-10-11, on the dev host, from this branch's worktree. I did not open the pairing URL or take a turn on this server.
Exercised:
rebuild --for-dev: 16 s. The output shows ahttps://<host>.ts.net:<web port>pairing URL and "Shared at". Recovery reported no terminalized runs and no stopped sessions, and the log shows no provider turn started.tailscale serve statuslisted this server's port beside the live install's 8444 while it ran. Afterstop, only 8444 remained and the web port was free.restartshares again and prints a new URL; a bare start on the for-dev build is refused with the two commands.https://<host>:7594 -> http://localhost:7594.stopremoved it and left 8444 in place.After the port-pinning and cleanup changes, the Captain released the mode for one watched run, in my worktree at the reviewed commit:
tailscale serve statusshowed only the live 8444 mapping before; the runner used exactly the pinned ports and logged "shared on tailnet"; during the run the status showed this server's port proxying tohttp://localhost:<web port>beside an unchanged 8444; afterstoponly 8444 remained. A plainrebuildthen replaced the copy. The tester repeated it from its own worktree at this PR's head (report: artifacttest-reports/setup-agent-live-test-for-dev.md): startup,status,restart, the copy staying inside its worktree, andstopremoving only its own port's mapping, with 8444 unchanged at every check.This PR also carries two small fixes to the merged peer mode:
statusgives both peer-list reads one deadline, and a failed peering advisesrestartunless both servers are running (found and rechecked by the tester).Not exercised:
Checklist
FORK.md(case text and file-table row) in this PR (none edited;migrate-dev-dband the dev runner are called, not changed)docs/j5/product/upstream.md(none)AGENTS.md).stopundoes the share. Tailnet only.docs/j5/product/and user docs rewritten where this changes them (the skill text is in docs(j5): agents live-test with one setup script, the Browser panel and a testing skill #549)Tests:
vp test run scripts/j5/setup-agent-live-test.test.ts(40 pass): the flag and its refused combinations, reading the share line and the share failure from the log, refusing an unshared server only when a share was required, reading each mapping and its target fromtailscale serve status, recognising a mapping as this server's own, refusing port 8444 and a foreign mapping, treating a failed status read as an error, and removing only this run's own mapping on stop. Typecheck and lint are clean on the touched files.Built with Claude Opus 5.5 in Claude Code.
🤖 Generated with Claude Code