Repository navigation
fix(server): J5 state and home variable never collide with upstream T3 - #71
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Essentials Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
CodeRabbit CLI reviewRun 1 ( Finding from the dropped run, refuted
Refuted as out of scope. That phrase is the product name in help copy, not a path or a variable, so it cannot collide with an installed T3 Code. It is the same class as the ~30 cosmetic |
An installed upstream T3 Code and J5 Code could still meet on disk: a linked worktree's dev state lived in `<worktree>/.t3`, and every base-directory read (server config, pair, dev runner, desktop startup, service launcher, generated systemd unit) honored `T3CODE_HOME`, so a machine that sets that variable for upstream silently pointed a J5 server at upstream's state. The worktree state directory is now `<worktree>/.j5code` and the variable is `J5CODE_HOME` everywhere it is read or written, with no fallback read of `T3CODE_HOME`. Precedence is unchanged. `.gitignore` and the vitest exclude add a `.j5code` line beside upstream's `.t3` line. The telemetry comment is corrected; the anonymous id already lived under the J5 base dir. The retained "never touches ~/.t3" config test gains its twin: an ambient `T3CODE_HOME` does not influence J5's base dir. Recorded as FORK.md case 24. Co-Authored-By: Claude Fable 5.1 <[email protected]>
The script already followed the shared worktree-home helper, so its behavior moved with it, but its header, not-in-worktree message, and --base-dir flag descriptions still said the default was <worktree>/.t3. Comment and help-text change only; the ~/.t3 source and protection paths are untouched. Co-Authored-By: Claude Fable 5.1 <[email protected]>
7442b3d to
a00738c
Compare
Problem
An installed upstream T3 Code and J5 Code could still meet on disk. A linked worktree's dev state lived in
<worktree>/.t3, and every base-directory read honoredT3CODE_HOME: server config,pair, the dev runner's child export, desktop startup, the service launcher, and the generated systemd unit. A machine that setsT3CODE_HOMEfor upstream's own service silently pointed a J5 server at upstream's state. Jackson's ruling (2026-09-02): J5 Code must never share on-disk locations or environment names with an installed upstream T3 Code.Fix
<worktree>/.j5code(shareddevHomehelper, dev runner,pair), same precedence as before:--home-dir> worktree dir > ambient variable.J5CODE_HOMEeverywhere it is read or written: server CLI config,pair, dev runner child export, service launcher, systemd unit renderer, desktopDesktopConfig(the primary desktop read), the desktop early-startup read, the dev Electron launcher forward, and the WSL strip. No compatibility shim and no fallback read ofT3CODE_HOME; an ambientT3CODE_HOMEis ignored entirely..gitignoreand the vitestexcludeadd a.j5codeline beside upstream's.t3line (add-beside; the state dir holds agent worktree checkouts with their own test files).<stateDir>/anonymous-idunder the J5 base dir.process.envand the config provider). The systemd renderer test assertsEnvironment=J5CODE_HOME=and the absence ofT3CODE_HOME. Desktop and dev-runner fixtures key on the new name.docs/j5/dogfood-runtime.mdunit and pair command,BRANDING.mdbullet on the base-directory override..t3orT3CODE_HOME(AGENTS.md,.agents/skills/*,docs/internals,docs/operations,.cursor) is untouched by the J5 docs rule and logged on the friction list. The ~30 cosmeticT3CODE_*settings are deferred to the naming audit.Live proof
Before (j5/main, from the worktree, no server running):
pairprobed the ambient upstream home.After (this branch): dev server started from the worktree with an ambient
T3CODE_HOMEpointing at an empty throwaway directory. State landed in<worktree>/.j5code, the throwaway stayed empty, andpairresolved the same home and paired with the worktree server on its own port.Verification
vp test runondevHome.test.ts,dev-runner.test.ts,config.test.ts,pair.test.ts,bootService.test.ts: 5 files, 107 tests passed.vp test runon the 13 touched desktop test files: 145 tests passed.vp run --filter t3 typecheck,--filter @t3tools/shared typecheck,--filter @t3tools/desktop typecheck: exit 0.vp fmtapplied; lockfile unchanged.Built by Claude Fable 5.1 running as a J5 Code lane inside Claude Code.
Closes #68