Skip to content

Finish separating J5 from upstream T3 on disk: worktree .t3 → .j5code, T3CODE_HOME → J5CODE_HOME #68

Closed

Description

@Jacksondr5

Ruling from Jackson (2026-09-02): J5 Code must never share on-disk locations or environment names with an installed upstream T3 Code. Someone running both must get two fully independent apps. The home directory already moved to ~/.j5code (issue #33); this ticket finishes the job.

Measured inventory (j5/main)

On-disk paths still bound to .t3 (collision-capable):

  • Worktree state default <worktree>/.t3 — scripts/dev-runner.ts (precedence comment and resolution near lines 323 and 678–706), apps/server/src/cli/pair.ts (worktree lookup ~257–267), @t3tools/shared/devHome, and .gitignore (.t3).
  • Telemetry anonymous-id fallback ~/.t3/telemetry/anonymous-id — apps/server/src/telemetry/Identify.ts ~252.
  • Tests that assert the old shape (config.test.ts "without touching ~/.t3" is the guard to keep; bootService.test.ts, service.test.ts fixtures use .t3 paths as inputs only).

Environment variables — one collision-capable, the rest cosmetic:

  • T3CODE_HOME — read by apps/server/src/cli/config.ts:107, cli/pair.ts:264, scripts/dev-runner.ts (exported to the child), apps/desktop/src/app/DesktopEarlyElectronStartup.ts:54, apps/server/src/serviceLauncher.ts:603 (required), and written into generated systemd units by apps/server/src/cloud/bootService.ts:64. Hazard: a machine that sets T3CODE_HOME for upstream T3 (Jackson's Linux box does, for the t3dev service) would silently point a J5 server at upstream's state. This is the same class of defect as the old ~/.t3 default, reachable from a real deployment.
  • ~30 other T3CODE_* names (T3CODE_PORT, _HOST, _MODE, _LOG_LEVEL, trace/OTLP settings, dev-runner offsets, desktop mock ports). Sharing these with upstream is a nuisance, not a data collision.

Scope of this ticket

  1. Worktree state directory becomes <worktree>/.j5code (dev runner, pair, shared devHome helper, .gitignore), with the same precedence rules as today.
  2. Telemetry fallback path moves under ~/.j5code.
  3. T3CODE_HOME is replaced by J5CODE_HOME everywhere it is read or written (server config, pair, dev runner, desktop startup, service launcher, systemd unit generation, docs/j5/dogfood-runtime.md and the operator scripts under scripts/j5/). No compatibility shim: pre-dogfood, an ambient T3CODE_HOME must be ignored by J5 entirely — that is the point.
  4. Tests: keep the "never touches ~/.t3" guard and add its twin: an ambient T3CODE_HOME does not influence J5's base dir.

Deferred to the naming audit: renaming the cosmetic T3CODE_* settings. They touch many upstream files for no isolation gain; do them in one sweep when the glossary rename happens.

Every touched file here is upstream-owned, so each edit is an enumerated FORK.md integration case with anchors. Contributor rule reference: docs/j5/process/working-in-the-repo.md.

Activity

  1. self-assigned this
    on Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions