Repository navigation
feat(scripts): one command sets up a live-test server in a worktree - #551
Merged
Merged
Conversation
…an existing project The seed refused any base directory below ~/.j5code, which is where thread worktrees live, so a test home inside a worktree could not use it. It now accepts a base directory inside a linked git worktree's own .j5code. It can also write its threads into a project that already exists in the home, instead of creating a second project rooted at the current directory. Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Builds a small TODO-app repository with a local bare origin, and a J5 home that holds only that project: replayed Claude and Codex threads from upstream's provider replay kit, the delivery seed, two light personas and Claude Haiku as the default model. No model is called. Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
setup-agent-live-test builds the test home in the worktree's .j5code, starts the dev server with the live server's variables removed, and prints the ports, pairing URL, project and commands. stop, status and restart act only on the process group it started, after confirming that group owns the port from inside the worktree. Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…tory root The gate takes no argument. It blocks until .hold-release exists in the main checkout of the test repository, deletes it and exits, so a tester releases a held turn with one touch and has nothing to clean up. The file is ignored. Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The startup pairing URL works once, so the copy in the log is usually spent by the time a tester asks again. status, and a start against a server that is already running, now mint a new one from that server. Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… checkout Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…is missing It imported its dependencies at the top, so a fresh worktree failed with ERR_MODULE_NOT_FOUND before the script could say anything. Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The output told agents to rm -rf the directory, which some harnesses refuse to run. rebuild stops the server, deletes the directory the script already confirmed is inside the worktree's .j5code, builds it again and starts. Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…every run Review fixes for #551: - The home and repository paths come from the worktree, never from the manifest, and a home or repository that has become a link out of the build is refused before anything is started or a pairing URL is minted. - A worktree path with a space or shell character is refused, since the paths are printed inside commands and read back from a log line. - The two start-time refusals are one tested function. - A repeated start waits for recovery before it returns. - The start timeout is 90 seconds, under a two-minute shell timeout. Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…pped The script identified its server only by the listener on its port, so a server that crashed under node --watch, or was still booting, left a process group no command would touch. It now records the group leader's start time at spawn and treats the group as its own when that process is still the leader and runs from the worktree. The port check only decides whether the server is reported as running. A start returns within 90 seconds and leaves a slow server running instead of killing it. Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The server keeps its database in <home>/userdata, so a link there reaches another home's state even when <home> itself is a real directory. Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each generated persona had one model route, and a persona must have exactly two, so the library rejected both files and Settings showed none. Each now names its pinned model first and the other cheap model second. The shape test decodes the persona and playbook files the way the app does. Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The startup URL carries the admin scopes Connections settings need, and a minted one does not. The call that spawns the server prints the unused startup URL; status and a repeated start still mint a fresh one. Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…copes A URL minted with pair has only the standard client scopes, so a tester paired from status could not use Connections settings. The script now mints every pairing URL it prints with the administrative scope set, and a test fails if that set drifts from the contracts. Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s called ours A healthy listener in the recorded group was enough to classify the server as running, so stop could signal a group whose leader was no longer the process that was spawned. The leader's pid, start time and cwd are now checked first, for every state that allows a signal, and a start that must abandon its server classifies it before stopping it. Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…on the pairing form Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ing form Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-worktree turn Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e-test, not everything Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Where git does not trust file modes (core.fileMode false, as on the CI runner), git add recorded scripts/hold.sh as a plain file, so a thread's worktree checked it out unable to run. The generator now records the executable bit in the index itself. Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… about the run How to test lives in the j5-live-test skill, so the printed block drops its testing guidance and keeps the pairing URL, ports, paths, project, default model, personas, playbooks, hold gate commands and its own commands. The test repository's README and playbook say pnpm test, to match this repo. Part of #546. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merged
6 of 8 tasks
Jacksondr5
marked this pull request as ready for review
October 12, 2026 03:19
This was referenced Oct 12, 2026
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
An agent that needs to live-test J5 Code rebuilds the same rig by hand each time, and copies of real data have reached real repositories. Part of #546 (stage 2: the default mode of
setup-agent-live-test).What changed
node scripts/j5/setup-agent-live-test.ts, run from a worktree, builds a test home and starts a dev server on it. It then prints what only the script knows about the run: the pairing URL, ports, home and log paths, the one project to use, the default model, the personas and playbooks, the two hold-gate commands, and its ownstatus,restart,stopandrebuildcommands. How to test is thej5-live-testskill's job (#549) and is not repeated in the output.The test home, the test repository and the logs live in the worktree's gitignored
.j5code/live-test/:test-repo/: a small TODO app with four commits, anode --testsuite run withpnpm test(no dependencies, nothing to install),scripts/hold.sh(blocks until.hold-releaseexists in the test repository root, deletes it and exits; gives up after 540 s), and two playbooks. Itsoriginis a bare repository beside it, so "From origin/main" is true and pushes stay inside the directory.home/: a J5 home whose only project is that repository. It holds 15 replayed Claude and Codex threads from upstream's provider replay kit (clocks set so they read as the last five hours), J5's delivery seed, two personas (haiku-helper,luna-helper; each names its pinned model first and the other cheap model as the required second route), and Claude Haiku 4.5 as the default model. No model is called; the build takes about 22 s.server.json(the process group) andserver.log.The work is in three parts:
~/.j5code, which is where thread worktrees live. It now accepts a base directory inside a linked git worktree's own.j5code, and still refuses the shared home, a non-worktree directory below it, and a symlink out of the worktree's.j5code. The seed can also write into an existing project instead of creating a second one rooted atprocess.cwd().apps/server/src/j5/test-support/liveTestHome.ts,liveTestRepo.ts).scripts/j5/setup-agent-live-test.ts): no argument starts, thenstatus,restart,stopandrebuild(stop, delete.j5code/live-test, build and start).Process safety:
T3CODE_PORT,T3CODE_HOST,J5CODE_HOMEandJ5CODE_SERVER_NAMEare removed from its environment, andT3CODE_AUTO_BOOTSTRAP_PROJECT_FROM_CWD=falsestops the dev server registering<worktree>/apps/serveras a project.statussaysNOT SERVINGand points at the log andrestart..j5codethat links out of the worktree, a.j5codethat is the live home, a home or repository that has become a link out of the build, and a worktree path with a space or shell character. A server that comes up on another home, on port 5773 or on the inheritedT3CODE_PORTis stopped.AuthAdministrativeScopes); a test fails if the script's list drifts from the contracts./procand callsss.Not in this PR (later stages of #546):
--fresh,--peer,--for-dev,--base, the evidence upload script, and any skill orAGENTS.mdtext.Live testing
Run on 2026-10-11 from this branch's worktree, through the Browser panel.
Exercised:
README.mdin the test repository, "1 changed file".home/worktrees/test-repo/.status, a repeated start (each prints a fresh pairing URL),restart(5 s; the browser stayed paired and earlier threads were still there),stop,stopwhen stopped, an unknown argument.pair --base-dircommand mints a working URL.RUNNING;statusin the first seconds of boot printedNOT SERVING.node --watch(the listener, confirmed in my group);statusprintedNOT SERVINGandstopcleared the whole group.rebuild, twice in a row.node_modules: a plain "install first" message.statusURL opened Settings > Connections with "Create link", "Revoke others", "Add environment" and "Add peer" enabled.A tester (a peer agent in its own worktree, working only from the script's output) then used it cold. Its report is the artifact
test-reports/setup-agent-live-test.md. Its verdict: the default current-checkout setup passes with no unresolved setup defect; its full matrix is marked FAIL for the three product and scope items listed below. It found and I fixed: the import crash with nonode_modules, therm -rfits harness refused (nowrebuild), and persona files the library rejected. It exercised live:scripts/hold.sh, and a normal release withtouch .hold-release.two-stepplaybook to completion.statussaidNOT SERVING,stopemptied the group and freed both ports.Not exercised live by anyone:
add-a-featureplaybook from start to finish.Found by the tester and not fixed here, because they are not the script's:
node_modules, outside.j5code. Provider CLIs write their own session and support files under~/.claude,~/.codexand/tmp. All test data, repositories and thread worktrees stay inside.j5code/live-test.Open fault, not fixed here: in "New worktree" mode the first turn of a thread can be interrupted by the server. Right after the draft becomes a server thread, the web client's "default the worktree base" effect (
BranchToolbarBranchSelector.tsx) sends a metadata update withbranch: main, worktreePath: null, which clears the worktree the server just assigned and detaches the provider session ("Workspace changed."). It reproduced on 3 of 3 automated attempts here (two Haiku, one Luna). The live install does not show it, and why is not settled. The local bare origin is unrelated. Thej5-live-testskill, not the script's output, carries the advice to take live turns in "Current checkout".Upstream impact
No upstream-owned file is edited. New files are under
apps/server/src/j5/andscripts/j5/.The generator imports upstream's replay kit (
orchestration-v2/testkit/*,Adapters/*.testkit.ts,@t3tools/provider-testing) without changing it.replayFixtureinliveTestHome.tsis adapted from the privaterunFixtureProviderin upstream'sOrchestratorReplayFixtures.integration.test.ts(about 70 lines). It differs in using a file database, our project and cwd, a set clock, and no assertions. A request for upstream to export that seam is on the give-back backlog (#276).Checklist
FORK.md(case text and file-table row) in this PR (none edited)docs/j5/product/upstream.md(none)AGENTS.md). A developer tool with one entry point;stopis the way out ofstart. Replays cover Claude and Codex only.docs/j5/product/and user docs rewritten where this changes them (the skill andAGENTS.mdtext are 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 apps/server/src/j5/test-support/liveTestHome.test.ts apps/server/src/j5/a2a/test-support/devDeliverySeed.test.ts(22 pass). Typecheck forapps/serverandscripts, and lint on the touched files, are clean. No repo-wide checks were run.Built with Claude Opus 5.5 in Claude Code.
🤖 Generated with Claude Code