F7 phone-home + branding triage: rename to bcode/.bcode/bcode.sh, disable self-upgrade
Merged
AL
7mo ago+157+157+012345678901234567890123456789-126-126-012345678901234567890123456789
What
Medium-depth pass at ROADMAP F7 — phone-home / branding triage. Targets the visible-to-end-user "opencode" leaks surfaced by the v0.0.1 binary smoke (PROGRESS.md item 33). Easy items only; deeper sweep deferred and tracked in EXCEPTIONS.md.
Changes (6 files, +110/-7)
packages/opencode/src/global/index.ts— XDG app nameopencode→bcode. One-timemigrateLegacy()copies~/.config/opencode/→~/.config/bcode/(and same for data + state) on first launch when the new dir doesn't exist and the old does. Cache is regenerated, not migrated. Legacy directory left in place as rollback.packages/shared/src/global.ts— Same XDG app name change in the parallel Effect-serviceGlobal. No migration logic here — thepackages/opencodestartup path runs migration once for both.packages/opencode/src/server/routes/control/index.ts— OpenAPIinfo.title/info.description:"opencode"→"bcode".packages/app/index.html—<title>OpenCode</title>→<title>BrowserCode</title>. (Embedded web UI; rebuilds on every binary build.)packages/opencode/src/config/config.ts— Background@opencode-ai/plugin@<our-version>install:log.warn(...)on failure →log.debug(...). The fetch is expected to fail in BrowserCode binaries (we publish under non-@opencode-ai/pluginversions that don't exist on npm). Demoting keeps stderr clean without losing the diagnostic.packages/opencode/src/index.ts— Startup log messageLog.Default.info("opencode", ...)→"bcode". Visible in~/.local/share/bcode/log/.EXCEPTIONS.md(new) — ROADMAP F2 deliverable. Lists every Yellow-zone modification BrowserCode makes to upstream (rebrand, banner, A4/A5/A7, C0, this F7 pass) and a "deliberately NOT changed" section explaining what's deferred (33 theme$schemaURLs, provider HTTP-Referer, TUI upsells,opencode.ai/install,opencode.dbfilename, etc.) with rationale per row.
Deliberately NOT changed (Yellow-zone candidates skipped this pass)
These either need product calls, would cause large diffs, or are dead code paths in compiled binaries. Tracked per-row in EXCEPTIONS.md "Deliberately NOT changed" section:
- 33 theme
*.jsonfiles with$schema: https://opencode.ai/theme.json(metadata-only, large diff). provider.tsHTTP-Referer: https://opencode.ai/(sent to LLM providers; closer to Red than Yellow).- TUI upsell dialogs (
opencode.ai/zen,/go,/auth,/docs) (need BrowserCode equivalents). installation/index.tshttps://opencode.ai/install(needsbcode.sh/installto land first — ROADMAP A1+C4).app.opencode.aiproxy fallback inserver/routes/ui.ts(dead path in compiled binaries).opencode.dbdata file +.opencode/project subdir (ROADMAP G1).- All
OPENCODE_*env vars,@opencode/...Effect service IDs,x-opencode-*headers (Red zone).
Verification
- Filtered typecheck:
bun run typecheck→ 5/5 pass. - Single-target compile:
OPENCODE_VERSION=0.0.2-f7 bun run --cwd packages/opencode build -- --single→bcode --versionprints0.0.2-f7. Build's smoke test passes. - Migration logic verified live on this Sprite. Pre-existing
~/.config/opencode/,~/.local/share/opencode/,~/.local/state/opencode/were copied to the newbcode/paths on first startup. Identical sizes, legacy intact for rollback. - End-to-end browser drive: cleared
~/.cache/bcode/harness/, ranbcode run --model anthropic/claude-haiku-4-5 ...against headless Chrome over CDP. Harness extracted (un-versioned cache from C8 confirmed working),browser_executeinvoked,goto_url("https://example.com") + page_info()returned the page title. - OpenAPI title:
curl http://localhost:13579/doc→{"title":"bcode","description":"bcode api","version":"0.0.3"}. - Web UI title:
curl http://localhost:13579/→<title>BrowserCode</title>. - Plugin install warn: demoted to debug; stderr clean during smoke runs.
- Startup log identifier:
~/.local/share/bcode/log/<latest>.logfirst line now ends with... bcodenot... opencode.
After merge: cut v0.0.2 GitHub Release with this + C8 (un-versioned harness cache, already on main).