diff --git a/.plans/12-effect-new.md b/.plans/12-effect-new.md deleted file mode 100644 index 3d87049f8..000000000 --- a/.plans/12-effect-new.md +++ /dev/null @@ -1,67 +0,0 @@ -# Effect Migration Plan (From Current State) - -Current status summary: - -- Service contracts, typed errors, and most checkpoint/persistence services exist. -- `ProviderServiceLive` is already native orchestration (not a thin adapter). -- Production server path still uses legacy `ProviderManager`/`FilesystemCheckpointStore`. -- Checkpoint flow now avoids snapshot re-sync and is write-time driven. - -## PR 1: Wire Provider/Checkpoint Effect Stack Into `wsServer` - -- Build one runtime layer graph for provider + checkpoint + persistence + orchestration. -- Resolve `ProviderService` from runtime in `wsServer`. -- Replace `ProviderManager` method calls in WS handlers with `ProviderService` calls. -- Forward provider events by subscribing to `ProviderService.subscribeToEvents`. -- Keep WS method/push payloads identical. - -## PR 2: Runtime Composition + Startup Ownership - -- Create/centralize `AppLive` composition for server startup. -- Ensure outer runtime provides Node/platform services once. -- Ensure migrations run at startup via scoped/layer startup path. -- Remove ad-hoc service initialization in request-time paths. - -## PR 3: Session Lifecycle Hygiene + Checkpoint Invariants - -- Add explicit checkpoint session cleanup on `stopSession` / `stopAll`. -- Remove per-session lock/cwd map leaks. -- Keep strict invariant model: - - root checkpoint created at session initialization before agent modifications - - each completed turn captures filesystem checkpoint and persists metadata - - no after-the-fact metadata rebuild/sync -- Add tests for lifecycle cleanup and invariant-failure surfaces. - -## PR 4: Provider Event Stream Hardening (Without Extra Service Fragmentation) - -- Keep `ProviderService` as the public event surface. -- Internally move callback fanout to Effect concurrency primitives (`Queue`/`PubSub`) for ordering/backpressure control. -- Keep API as `subscribeToEvents` unless we explicitly choose stream API later. -- Add tests for ordering and subscriber isolation under load. - -## PR 5: Codex Runtime Split (Scoped Effect Core) - -- Extract `CodexAppServerManager` responsibilities into Effect-native layers: - - scoped process lifecycle - - RPC request/response + pending map via `Deferred` - - session registry/state -- Keep `CodexAdapter` contract stable while swapping internals. -- Preserve protocol behavior and timeout semantics. - -## PR 6: Codex Protocol Decode Hardening - -- Replace ad-hoc unknown parsing with runtime schema decode. -- Map decode failures to typed tagged errors with `cause` retained. -- Add regression tests for malformed/partial protocol frames. - -## PR 7: Remove Legacy Provider Stack - -- Remove `ProviderManager` + legacy checkpoint integration from runtime path. -- Remove `FilesystemCheckpointStore` from active server flow (keep only if explicitly needed for compatibility tooling). -- Update tests to assert only Effect service path is used. - -## PR 8: Final Cleanup + Docs - -- Update architecture docs with final layer graph and service boundaries. -- Document error model and recovery semantics. -- Trim dead compatibility code and stale plan references. diff --git a/.plans/15-effect-server.md b/.plans/15-effect-server.md deleted file mode 100644 index 5e245bb8e..000000000 --- a/.plans/15-effect-server.md +++ /dev/null @@ -1,11 +0,0 @@ -Rewrite `createServer` and `index.ts` to be Effect native. - -Maybe use `effect/unstable/Socket` for the web socket server - -- https://github.com/Effect-TS/effect-smol/blob/main/packages/effect/src/unstable/socket/SocketServer.ts -- https://github.com/Effect-TS/effect-smol/blob/main/packages/platform-node/test/NodeSocket.test.ts - -- Migrate remaining runtime code to Effect - - `gitManager` -> `src/git` - - `terminalManager` -> `src/terminal` (Manager + PTY) - - ... diff --git a/.plans/17-provider-neutral-runtime-determinism.md b/.plans/17-provider-neutral-runtime-determinism.md deleted file mode 100644 index d70ec1054..000000000 --- a/.plans/17-provider-neutral-runtime-determinism.md +++ /dev/null @@ -1,109 +0,0 @@ -# Plan: Provider-Neutral Runtime Determinism and Flake Elimination - -## Summary -Replace timing-sensitive websocket and orchestration behavior with explicit typed runtime boundaries, ordered push delivery, and server-owned completion receipts. The cutover is broad and single-shot: no compatibility shim, no mixed old/new transport. The design must reduce flakes without baking Codex-specific lifecycle semantics into generic runtime code. - -## Implementation Status - -All 7 sections are implemented. CI passes (format, lint, typecheck, test, browser test, build). One deferred item remains: the shared `WsTestClient` helper from section 7 — tests use direct transport subscription and receipt-based waits instead. - -### New files - -| File | Purpose | -|------|---------| -| `packages/shared/src/DrainableWorker.ts` | Queue-based Effect worker with deterministic `drain` signal | -| `packages/shared/src/schemaJson.ts` | Two-phase JSON→Schema decode helpers (`decodeJsonResult`, `formatSchemaError`) | -| `apps/server/src/wsServer/pushBus.ts` | `ServerPushBus` — ordered typed push pipeline with auto-incrementing sequence | -| `apps/server/src/wsServer/readiness.ts` | `ServerReadiness` — Deferred-based barriers for startup sequencing | -| `apps/server/src/orchestration/Services/RuntimeReceiptBus.ts` | Receipt schema union: checkpoint captured, diff finalized, turn quiesced | -| `apps/server/src/orchestration/Layers/RuntimeReceiptBus.ts` | PubSub-backed receipt bus implementation | -| `apps/server/src/watchFileWithStatPolling.ts` | Stat-polling file watcher for containers where `fs.watch` is unreliable | -| `apps/server/vitest.config.ts` | Server-specific test config (timeout bumps) | -| `apps/server/src/wsServer/pushBus.test.ts` | Push bus serialization and welcome-gating tests | -| `packages/shared/src/DrainableWorker.test.ts` | Drainable worker enqueue/drain lifecycle tests | - -### Key modifications - -| File | Change | -|------|--------| -| `packages/contracts/src/ws.ts` | Channel-indexed `WsPushPayloadByChannel` map, `WsPush` union schema, `WsPushSequence` | -| `apps/server/src/wsServer.ts` | Integrated `ServerPushBus` and `ServerReadiness`; welcome gated on readiness | -| `apps/server/src/keybindings.ts` | Explicit runtime with `start`/`ready`/`snapshot`; dual `fs.watch` + stat-polling watcher | -| `apps/web/src/wsTransport.ts` | Connection state machine (`connecting`→`open`→`reconnecting`→`closed`→`disposed`); two-phase decode at boundary; cached latest push by channel | -| `apps/web/src/wsNativeApi.ts` | Removed decode logic; delegates to pre-validated transport messages | -| `apps/server/src/orchestration/Layers/CheckpointReactor.ts` | Uses `DrainableWorker`; publishes completion receipts | -| `apps/server/src/orchestration/Layers/ProviderCommandReactor.ts` | Uses `DrainableWorker` for command processing | -| `apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts` | Uses `DrainableWorker` for event ingestion | -| `apps/server/integration/OrchestrationEngineHarness.integration.ts` | Receipt-based waits replace polling loops | - -## Key Changes -### 1. Strengthen the generic boundaries, not the Codex boundary — DONE -- `ProviderRuntimeEvent` remains the canonical provider event contract; `ProviderService` remains the only cross-provider facade. -- Raw Codex payloads and event ordering stay isolated in `CodexAdapter.ts` and `codexAppServerManager.ts`. -- `ProviderKind` was not expanded. The runtime stays provider-neutral by contract. - -### 2. Replace loose websocket envelopes with channel-indexed typed pushes — DONE -- `packages/contracts/src/ws.ts` now derives push messages from a `WsPushPayloadByChannel` channel-to-schema map. `WsPush` is a union schema replacing `channel: string` + `data: unknown`. -- Every server push carries `sequence: number`, auto-incremented in `ServerPushBus`. -- `packages/shared/src/schemaJson.ts` provides structured decode diagnostics via `formatSchemaError`. -- `packages/contracts/src/ws.test.ts` covers typed push envelope validation and channel/payload mismatch rejection. - -### 3. Introduce explicit server readiness and a single push pipeline — DONE -- `apps/server/src/wsServer/pushBus.ts`: `ServerPushBus` with `publishAll` (broadcast) and `publishClient` (targeted) methods, backed by one ordered path. All pushes flow through it. -- `apps/server/src/wsServer/readiness.ts`: `ServerReadiness` with Deferred-based barriers for HTTP listening, push bus, keybindings, terminal subscriptions, and orchestration subscriptions. -- `server.welcome` is emitted only after connection-scoped and server-scoped readiness is complete. -- `wsServer.ts` no longer publishes directly from ad hoc background streams. - -### 4. Turn background watchers into explicit runtimes — DONE -- `apps/server/src/keybindings.ts` refactored as explicit `KeybindingsShape` service with `start`, `ready`, `snapshot` semantics. -- Initial config load, cache warmup, and dual watcher attachment (`fs.watch` + `watchFileWithStatPolling`) complete before `ready` resolves. -- `watchFileWithStatPolling.ts` is the thin adapter for environments where `fs.watch` is unreliable. - -### 5. Replace polling-based orchestration waiting with receipts — DONE -- `RuntimeReceiptBus` service defines three receipt types: `CheckpointBaselineCapturedReceipt`, `CheckpointDiffFinalizedReceipt` (with `status: "ready"|"missing"|"error"`), and `TurnProcessingQuiescedReceipt`. -- `CheckpointReactor`, `ProviderCommandReactor`, and `ProviderRuntimeIngestion` use `DrainableWorker` and publish receipts on completion. -- Integration harness and checkpoint tests await receipts instead of polling snapshots and git refs. - -### 6. Centralize client transport state and decoding — DONE -- `apps/web/src/wsTransport.ts` implements an explicit connection state machine: `connecting`, `open`, `reconnecting`, `closed`, `disposed`. -- Two-phase decode (JSON parse → Schema validate) happens at the transport boundary. `wsNativeApi.ts` receives pre-validated messages. -- Cached latest welcome/config modeled as explicit `latestPushByChannel` state. - -### 7. Replace ad hoc test helpers with semantic test clients — MOSTLY DONE -- `DrainableWorker` replaces timing-sensitive `Effect.sleep` with deterministic `drain()` across reactor tests. -- Orchestration harness waits on receipts/barriers instead of `waitForThread`, `waitForGitRef`, and retry loops. -- Behavioral assertions moved to deterministic unit-style harnesses; narrow integration tests kept for real filesystem/socket behavior. -- **Deferred:** Shared `WsTestClient` helper (connect, awaitSemanticWelcome, awaitTypedPush, trackSequence, matchRpcResponseById). Tests use direct transport subscription instead. - -## Provider-Coupling Guardrails -- No generic runtime API may depend on Codex-native event names, thread IDs, or request payload shapes. -- No readiness barrier may be defined as "Codex has emitted X." Readiness is owned by the server runtime, not by provider event order. -- No websocket channel payload may contain raw provider-native payloads unless the channel is explicitly debug/internal. -- Any provider-specific divergence must be exposed through provider capabilities from `ProviderService.getCapabilities()`, not `if provider === "codex"` branches in shared runtime code. -- Generic tests must use canonical `ProviderRuntimeEvent` fixtures. Codex-specific ordering and translation tests stay in adapter/app-server suites only. -- Keep UI/provider-specific knobs such as Codex-only options scoped to provider UX code. Do not pull them into generic transport or orchestration state. - -## Test Plan -- Contracts: - - schema tests for typed push envelopes and structured decode diagnostics - - ordering tests for `sequence` -- Server: - - readiness tests proving `server.welcome` cannot precede runtime readiness - - push bus tests proving terminal/config/orchestration pushes are serialized and typed - - keybindings runtime tests with fake watch source plus one real watcher integration test -- Orchestration: - - receipt tests proving checkpoint refs and projections are complete before completion signals resolve - - replacement of polling-based checkpoint/integration waits with receipt-based waits -- Web: - - transport tests for invalid JSON, invalid envelope, invalid payload, reconnect queue flushing, cached semantic state -- Validation gate: - - `bun run lint` - - `bun run typecheck` - - `mise exec -- bun run test` - - repeated full-suite run after cutover to confirm flake removal - -## Assumptions and Defaults -- This remains a single-provider product during the cutover, but the runtime contracts must stay provider-neutral. -- No backward-compatibility layer is required for old websocket push envelopes. -- The goal is deterministic runtime behavior first; reducing retries and sleeps in tests is a consequence, not the primary mechanism. -- If a completion signal cannot be expressed provider-neutrally, it does not belong in the shared runtime layer and must stay adapter-local. diff --git a/.plans/README.md b/.plans/README.md index c2a682969..eb3851a4f 100644 --- a/.plans/README.md +++ b/.plans/README.md @@ -1,13 +1,40 @@ # Maintainability Plans -1. `01-shared-model-normalization.md` -2. `02-typed-ipc-boundaries.md` -3. `03-split-codex-app-server-manager.md` -4. `04-split-chatview-component.md` -5. `05-zod-persisted-state-validation.md` -6. `06-provider-logstream-lifecycle.md` -7. `07-ci-quality-gates.md` -8. `08-precommit-format-and-lint.md` -9. `09-event-state-test-expansion.md` -10. `10-unify-process-session-abstraction.md` -11. `11-openclaw-provider-rollout.md` +## Numbered Plans + +1. `01-shared-model-normalization.md` - Move model alias normalization into shared contracts +2. `02-typed-ipc-boundaries.md` - Strict Zod schema parsing for Electron IPC +3. `03-split-codex-app-server-manager.md` - Decompose CodexAppServerManager +4. `04-split-chatview-component.md` - Refactor ChatView.tsx into composable pieces +5. `05-zod-persisted-state-validation.md` - Zod schemas for localStorage state +6. `06-provider-logstream-lifecycle.md` - ProviderManager logging stream lifecycle +7. `07-ci-quality-gates.md` - GitHub Actions lint/typecheck/test gates +8. `08-precommit-format-and-lint.md` - Pre-commit hooks for formatting and lint +9. `09-event-state-test-expansion.md` - Tests for renderer event handling +10. `10-unify-process-session-abstraction.md` - Unified runtime-session interface +11. `11-effect.md` - Effect.js phased migration *(in progress)* +12. `11-openclaw-provider-rollout.md` - OpenClaw provider rollout +13. `13-provider-service-integration-tests.md` - ProviderService integration tests +14. `14-server-authoritative-event-sourcing-cleanup.md` - Server-authoritative event sourcing +15. `16-pr89-review-remediation-phases.md` - PR #89 remediation strategy *(in progress)* +16. `16c-pr89-remediation-checklist.md` - PR #89 remediation checklist *(in progress)* +17. `17-claude-agent.md` - Claude Code provider integration *(in progress)* + +## Feature Plans + +- `branch-environment-picker-in-chatview-input.md` - Branch/environment picker in chat input +- `git-flows-integration-tests.md` - Git functions extraction and integration tests +- `git-flows-test-plan.md` - Git flows unit test plan +- `git-integration-branch-picker-worktrees.md` - Branch picker and worktree support +- `skills-system.md` - Skills system pipeline +- `spec-1-1-cutover-plan.md` - SPEC.md 1:1 cutover +- `spec-contract-matrix.md` - SPEC requirements contract matrix *(in progress)* +- `web-i18n-rollout.md` - Multilingual i18n rollout *(in progress)* +- `workspace-file-tree.md` - Workspace file tree sidebar + +## Archived (completed or superseded) + +- `t3code-to-okcode-rebrand.md` - Rebrand complete (March 2026), deleted +- `17-provider-neutral-runtime-determinism.md` - All 7 sections implemented, deleted +- `12-effect-new.md` - Superseded by `11-effect.md`, deleted +- `15-effect-server.md` - Superseded by `11-effect.md`, deleted diff --git a/.plans/t3code-to-okcode-rebrand.md b/.plans/t3code-to-okcode-rebrand.md deleted file mode 100644 index 1fc5d7f34..000000000 --- a/.plans/t3code-to-okcode-rebrand.md +++ /dev/null @@ -1,284 +0,0 @@ -# T3Code → OKCode Rebrand Checklist - -This document tracked conversions from T3Code to OKCode. **Status: completed** (March 2026). Items below are checked off; legacy migration hooks are listed at the end. - -## 1. Package Names (@t3tools → @okcode) - -### Root package.json - -- [x] `@t3tools/monorepo` → `@okcode/monorepo` - -### apps/server/package.json - -- [x] `@t3tools/contracts` → `@okcode/contracts` -- [x] `@t3tools/shared` → `@okcode/shared` -- [x] `@t3tools/web` → `@okcode/web` - -### apps/web/package.json - -- [x] `@t3tools/contracts` → `@okcode/contracts` -- [x] `@t3tools/shared` → `@okcode/shared` - -### packages/contracts/package.json - -- [x] `@t3tools/contracts` (name only) - -### packages/shared/package.json - -- [x] `@t3tools/shared` (name only) -- [x] `@t3tools/contracts` → `@okcode/contracts` - -### scripts/package.json - -- [x] `@t3tools/scripts` (name only) -- [x] `@t3tools/contracts` → `@okcode/contracts` -- [x] `@t3tools/shared` → `@okcode/shared` - -### Import statements (all .ts/.tsx files) - -- [x] `from "@t3tools/contracts"` → `from "@okcode/contracts"` -- [x] `from "@t3tools/shared/..."` → `from "@okcode/shared/..."` - -### vitest.config.ts - -- [x] `/^@t3tools\/contracts$/` → `/^@okcode\/contracts$/` - -### turbo.json - -- [x] `"@t3tools/contracts#build"` → `"@okcode/contracts#build"` -- [x] `"--filter=@t3tools/..."` → `"--filter=@okcode/..."` -- [x] `"--filter=t3"` → `"--filter=okcode"` (CLI package filter) - -## 2. Package Bin Name - -### apps/server/package.json - -- [x] `"t3"` bin → `"okcode"` - -## 3. Environment Variables (T3CODE_* → OKCODE_*) - -### turbo.json globalEnv - -- [x] `T3CODE_LOG_WS_EVENTS` → `OKCODE_LOG_WS_EVENTS` -- [x] `T3CODE_MODE` → `OKCODE_MODE` -- [x] `T3CODE_PORT` → `OKCODE_PORT` -- [x] `T3CODE_NO_BROWSER` → `OKCODE_NO_BROWSER` -- [x] `T3CODE_HOME` → `OKCODE_HOME` -- [x] `T3CODE_AUTH_TOKEN` → `OKCODE_AUTH_TOKEN` -- [x] `T3CODE_DESKTOP_WS_URL` → `OKCODE_DESKTOP_WS_URL` - -### scripts/dev-runner.ts - -- [x] All `T3CODE_*` env vars → `OKCODE_*` -- [x] All config names (T3CODE_PORT_OFFSET, T3CODE_DEV_INSTANCE, etc.) -- [x] `DEFAULT_T3_HOME` constant → `DEFAULT_OKCODE_HOME` -- [x] `homedir(), ".t3"` → `homedir(), ".okcode"` - -### scripts/dev-runner.test.ts - -- [x] All test references to `T3CODE_*` env vars → `OKCODE_*` -- [x] `"~/.t3"` → `"~/.okcode"` - -## 4. Documentation Files - -### README.md - -- [x] "T3 Code" → "OK Code" -- [x] `npx t3` → `npx okcode` -- [x] `github.com/pingdotgg/t3code` → `github.com/OpenKnots/okcode` - -### REMOTE.md - -- [x] "T3 Code" → "OK Code" -- [x] `T3CODE_*` env vars → `OKCODE_*` -- [x] CLI flag descriptions updated - -### KEYBINDINGS.md - -- [x] `~/.t3/keybindings.json` → `~/.okcode/keybindings.json` - -### CONTRIBUTING.md - -- [x] No references (verify none) - -### AGENTS.md - -- [x] "T3 Code" → "OK Code" -- [x] `@t3tools/shared/...` → `@okcode/shared/...` - -### docs/release.md - -- [x] `t3` package references → `okcode` -- [x] `T3CODE_DESKTOP_UPDATE_REPOSITORY` → `OKCODE_DESKTOP_UPDATE_REPOSITORY` -- [x] `T3CODE_DESKTOP_UPDATE_GITHUB_TOKEN` → `OKCODE_DESKTOP_UPDATE_GITHUB_TOKEN` - -### .docs/*.md files - -- [x] .docs/architecture.md: "T3 Code" → "OK Code" -- [x] .docs/quick-start.md: "npx t3" → "npx okcode", `T3CODE_*` → `OKCODE_*` -- [x] .docs/provider-architecture.md: `@t3tools/contracts` → `@okcode/contracts` -- [x] .docs/workspace-layout.md: `@t3tools/shared/...` → `@okcode/shared/...` -- [x] .docs/scripts.md: `T3CODE_*` → `OKCODE_*`; backend name `t3` → `okcode` -- [x] .docs/encyclopedia.md: "T3 Code" → "OK Code" - -### .github/workflows/*.yml - -- [x] release.yml: `--filter=t3` → `--filter=okcode`, `T3 Code` → `OK Code` - -## 5. Storage Keys (t3code:* → okcode:*) - -### apps/web/src/store.ts - -- [x] `"t3code:renderer-state:..."` → `"okcode:renderer-state:..."` - -### apps/web/src/terminalStateStore.ts - -- [x] `"t3code:terminal-state:..."` → `"okcode:terminal-state:..."` - -### apps/web/src/hooks/useTheme.ts - -- [x] `"t3code:theme"` → `"okcode:theme"` - -### apps/web/src/hooks/useLocalStorage.ts - -- [x] `"t3code:local_storage_change"` → `"okcode:local_storage_change"` - -### apps/web/src/editorPreferences.ts - -- [x] `"t3code:last-editor"` → `"okcode:last-editor"` - -### apps/web/src/composerDraftStore.ts - -- [x] `"t3code:composer-drafts:..."` → `"okcode:composer-drafts:..."` - -### apps/web/src/appSettings.ts - -- [x] `"t3code:app-settings:..."` → `"okcode:app-settings:..."` - -### apps/web/src/components/ChatView.logic.ts - -- [x] `"t3code:last-invoked-script-by-project"` → `"okcode:last-invoked-script-by-project"` - -## 6. Config Files (.t3code* → .okcode*) - -### apps/web/src/components/KeybindingsToast.browser.tsx - -- [x] `"/repo/project/.t3code-keybindings.json"` → `"/repo/project/.okcode-keybindings.json"` - -### apps/web/src/components/ChatView.browser.tsx - -- [x] `"/repo/project/.t3code-keybindings.json"` → `"/repo/project/.okcode-keybindings.json"` - -## 7. Git Branch Prefixes (t3code/ → okcode/) - -### apps/server/src/orchestration/Layers/ProviderCommandReactor.ts - -- [x] `WORKTREE_BRANCH_PREFIX = "t3code"` → `"okcode"` - -### apps/web/src/components/ChatView.logic.ts - -- [x] `WORKTREE_BRANCH_PREFIX = "t3code"` → `"okcode"` - -## 8. Test Fixtures - -### apps/server/src/git/Layers/GitCore.test.ts - -- [x] Branch names `t3code/feat/session`, `t3code/tmp-working` → `okcode/...` -- [x] Git remote URLs `git@github.com:pingdotgg/t3code.git` → `git@github.com:OpenKnots/okcode.git` -- [x] Branch prefix references - -### apps/server/src/git/Layers/GitManager.test.ts - -- [x] Temp dir prefixes `t3code-git-remote-` → `okcode-git-remote-` -- [x] Branch names `t3code/pr-488/...` → `okcode/pr-488/...` - -### apps/server/src/wsServer.test.ts - -- [x] Temp dir prefixes `t3code-ws-*` → `okcode-ws-*` - -### apps/server/src/workspaceEntries.test.ts - -- [x] Temp dir prefixes `t3code-workspace-*` → `okcode-workspace-*` - -### apps/server/src/terminal/Layers/Manager.test.ts - -- [x] Temp dir prefixes `t3code-terminal-*` → `okcode-terminal-*` - -### apps/server/src/projectFaviconRoute.test.ts - -- [x] Temp dir prefixes `t3code-favicon-route-*` → `okcode-favicon-route-*` - -### apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts - -- [x] Temp dir prefixes `t3code-reactor-*` → `okcode-reactor-*` - -### apps/server/src/keybindings.test.ts - -- [x] Temp dir prefixes `t3code-keybindings-*` → `okcode-keybindings-*` - -### apps/server/src/git/Layers/GitCore.ts - -- [x] Trace prefix `t3code-git-trace2-*` → `okcode-git-trace2-*` - -### apps/server/src/open.test.ts - -- [x] Command name `t3code-no-such-command-*` → `okcode-no-such-command-*` - -### apps/web/src/worktreeCleanup.test.ts - -- [x] Test paths `t3code-mvp/t3code-*` → `okcode-mvp/okcode-*` - -### apps/web/src/pullRequestReference.test.ts - -- [x] GitHub URL `github.com/pingdotgg/t3code/pull/42` → `github.com/OpenKnots/okcode/pull/42` - -## 9. Desktop App - -### scripts/build-desktop-artifact.ts - -- [x] `t3codeCommitHash` → `okcodeCommitHash` (written; legacy key still read for migration) -- [x] `"t3code-icon-build-*"` → `"okcode-icon-build-*"` -- [x] `appId: "com.t3tools.t3code"` → `"com.okcode.okcode"` -- [x] `"t3code-desktop-*"` → `"okcode-desktop-*"` - -### .docs/scripts.md - -- [x] `t3://app/index.html` → `okcode://app/index.html` - -## 10. Telemetry - -### apps/server/src/telemetry/Layers/AnalyticsService.ts - -- [x] `t3CodeVersion: version` → `okCodeVersion: version` - -### apps/server/src/telemetry/Identify.ts - -- [x] `~/.t3/telemetry/` → `~/.okcode/telemetry/` - -## 11. Domain/URL References - -### scripts/build-desktop-artifact.ts - -- [x] Update any GitHub URL references - -## 12. Misc code aligned with this plan - -- [x] `apps/server/src/os-jank.ts`: default base dir when empty → `~/.okcode` (was `.t3`) -- [x] `apps/server/src/terminal/Layers/BunPTY.ts`: Windows help text `npx t3` → `npx okcode` - -## 13. Verification Checklist - -- [x] `bun run typecheck` passes -- [x] `bun run lint` passes -- [x] `bun run fmt:check` passes -- [x] `bun run test` passes -- [x] All imports resolve correctly -- [x] No remaining `@t3tools/` imports or `t3code:` storage keys in source - -## Legacy & follow-ups (intentional) - -- **Desktop migration:** `apps/desktop/src/main.ts` still recognizes legacy Electron userData folder names (`T3 Code (Dev)` / `T3 Code (Alpha)`) via `LEGACY_USER_DATA_DIR_NAME`, legacy `t3code` app data path, and `t3codeCommitHash` in `package.json` alongside `okcodeCommitHash`. -- **Third-party test URLs:** Some server tests still use `github.com/pingdotgg/codething-mvp/...` as generic PR URL fixtures (not the old product repo). -- **Short `t3-` temp prefixes:** A few tests/scripts still use `t3-` as a `mkdtemp` prefix (e.g. orchestration, provider tests). Renaming to `okcode-` is optional noise reduction, not required for the rebrand. - -**Previously applied in-repo:** `OKCODE_*` env vars, `okcode` CLI, desktop bundle IDs / `okcode://` scheme, shell capture markers `__OKCODE_*`, Effect `ServiceMap` keys `okcode/...`, `scripts/build-desktop-artifact` `OKCODE_DESKTOP_*`, dev-runner `okcodeHome`, root `start` script `--filter=okcode`.