Skip to content

Commit 5ab618d

Browse files
committed
docs(rebrand): rewrite current docs for BCODE_*, bcode://, ~/.bcode
Updates observability, release, perf-benchmarks, quick-start, scripts, KEYBINDINGS, and debugging rule docs to use the new env var names and home directory. Adds an env var deprecation-window note at the top of observability.md. Historical plans and specs are left untouched.
1 parent db3232e commit 5ab618d

7 files changed

Lines changed: 53 additions & 48 deletions

File tree

.claude/rules/debugging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The server writes structured NDJSON spans to a local trace file — always on du
1919
tail -f ./dev/logs/server.trace.ndjson
2020

2121
# In production/CLI mode:
22-
tail -f ~/.t3/userdata/logs/server.trace.ndjson
22+
tail -f ~/.bcode/userdata/logs/server.trace.ndjson
2323
```
2424

2525
Read `@docs/observability.md` for the full set of jq queries. Key ones:

.docs/quick-start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ bun run dev
88
bun run dev:desktop
99

1010
# Desktop development on an isolated port set
11-
T3CODE_DEV_INSTANCE=feature-xyz bun run dev:desktop
11+
BCODE_DEV_INSTANCE=feature-xyz bun run dev:desktop
1212

1313
# Production
1414
bun run build

.docs/scripts.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
- `bun run dev` — Starts contracts, server, and web in `turbo watch` mode.
44
- `bun run dev:server` — Starts just the WebSocket server (uses Bun TypeScript execution).
55
- `bun run dev:web` — Starts just the Vite dev server for the web app.
6-
- Dev commands default `T3CODE_STATE_DIR` to `~/.t3/dev` to keep dev state isolated from desktop/prod state.
6+
- Dev commands default `BCODE_STATE_DIR` to `~/.bcode/dev` to keep dev state isolated from desktop/prod state.
77
- Override server CLI-equivalent flags from root dev commands with `--`, for example:
88
`bun run dev -- --base-dir ~/.t3-2`
99
- `bun run start` — Runs the production server (serves built web app as static files).
@@ -33,10 +33,10 @@
3333

3434
## Running multiple dev instances
3535

36-
Set `T3CODE_DEV_INSTANCE` to any value to deterministically shift all dev ports together.
36+
Set `BCODE_DEV_INSTANCE` to any value to deterministically shift all dev ports together.
3737

3838
- Default ports: server `3773`, web `5733`
39-
- Shifted ports: `base + offset` (offset is hashed from `T3CODE_DEV_INSTANCE`)
40-
- Example: `T3CODE_DEV_INSTANCE=branch-a bun run dev:desktop`
39+
- Shifted ports: `base + offset` (offset is hashed from `BCODE_DEV_INSTANCE`)
40+
- Example: `BCODE_DEV_INSTANCE=branch-a bun run dev:desktop`
4141

42-
If you want full control instead of hashing, set `T3CODE_PORT_OFFSET` to a numeric offset.
42+
If you want full control instead of hashing, set `BCODE_PORT_OFFSET` to a numeric offset.

KEYBINDINGS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
T3 Code reads keybindings from:
44

5-
- `~/.t3/keybindings.json`
5+
- `~/.bcode/keybindings.json`
66

77
The file must be a JSON array of rules:
88

docs/observability.md

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ If you want a log message to show up in the trace file, emit it inside an active
2222

2323
### Traces
2424

25-
Completed spans are written as NDJSON records to `serverTracePath` (by default, `~/.t3/userdata/logs/server.trace.ndjson`).
25+
Completed spans are written as NDJSON records to `serverTracePath` (by default, `~/.bcode/userdata/logs/server.trace.ndjson`).
2626

2727
Important fields in each record:
2828

@@ -58,6 +58,11 @@ There are two useful modes:
5858

5959
The local trace file is always on. OTLP export is opt-in.
6060

61+
> **Env var deprecation window (v0.0.19):** All `BCODE_*` env vars below are
62+
> also read from their legacy `T3CODE_*` names through v0.0.19, with a
63+
> one-time `[bcode]` console warning per legacy key. The `T3CODE_*` fallback
64+
> is removed in v0.0.20. Examples in this document use the new names.
65+
6166
### Option 1: Local Traces Only
6267

6368
You do not need any extra env vars. Just run the app normally and inspect `server.trace.ndjson`.
@@ -99,16 +104,16 @@ Default Grafana login:
99104
#### 2. Export OTLP env vars
100105

101106
```bash
102-
export T3CODE_OTLP_TRACES_URL=http://localhost:4318/v1/traces
103-
export T3CODE_OTLP_METRICS_URL=http://localhost:4318/v1/metrics
104-
export T3CODE_OTLP_SERVICE_NAME=t3-local
107+
export BCODE_OTLP_TRACES_URL=http://localhost:4318/v1/traces
108+
export BCODE_OTLP_METRICS_URL=http://localhost:4318/v1/metrics
109+
export BCODE_OTLP_SERVICE_NAME=t3-local
105110
```
106111

107112
Optional:
108113

109114
```bash
110-
export T3CODE_TRACE_MIN_LEVEL=Info
111-
export T3CODE_TRACE_TIMING_ENABLED=true
115+
export BCODE_TRACE_MIN_LEVEL=Info
116+
export BCODE_TRACE_TIMING_ENABLED=true
112117
```
113118

114119
#### 3. Launch the app from that same shell
@@ -133,23 +138,23 @@ bun dev:desktop
133138

134139
Packaged desktop app:
135140

136-
Launch the actual app executable from the same shell so the desktop app and embedded backend inherit `T3CODE_OTLP_*`.
141+
Launch the actual app executable from the same shell so the desktop app and embedded backend inherit `BCODE_OTLP_*`.
137142

138143
macOS app bundle example:
139144

140145
```bash
141-
T3CODE_OTLP_TRACES_URL=http://localhost:4318/v1/traces \
142-
T3CODE_OTLP_METRICS_URL=http://localhost:4318/v1/metrics \
143-
T3CODE_OTLP_SERVICE_NAME=t3-desktop \
146+
BCODE_OTLP_TRACES_URL=http://localhost:4318/v1/traces \
147+
BCODE_OTLP_METRICS_URL=http://localhost:4318/v1/metrics \
148+
BCODE_OTLP_SERVICE_NAME=t3-desktop \
144149
"/Applications/BCode (Alpha).app/Contents/MacOS/BCode (Alpha)"
145150
```
146151

147152
Direct binary example:
148153

149154
```bash
150-
T3CODE_OTLP_TRACES_URL=http://localhost:4318/v1/traces \
151-
T3CODE_OTLP_METRICS_URL=http://localhost:4318/v1/metrics \
152-
T3CODE_OTLP_SERVICE_NAME=t3-desktop \
155+
BCODE_OTLP_TRACES_URL=http://localhost:4318/v1/traces \
156+
BCODE_OTLP_METRICS_URL=http://localhost:4318/v1/metrics \
157+
BCODE_OTLP_SERVICE_NAME=t3-desktop \
153158
./path/to/your/desktop-app-binary
154159
```
155160

@@ -168,7 +173,7 @@ The trace file is the fastest way to inspect raw span data.
168173
Tail it:
169174

170175
```bash
171-
tail -f "$T3CODE_HOME/userdata/logs/server.trace.ndjson"
176+
tail -f "$BCODE_HOME/userdata/logs/server.trace.ndjson"
172177
```
173178

174179
In monorepo dev, use:
@@ -185,7 +190,7 @@ jq -c 'select(.exit._tag != "Success") | {
185190
durationMs,
186191
exit,
187192
attributes
188-
}' "$T3CODE_HOME/userdata/logs/server.trace.ndjson"
193+
}' "$BCODE_HOME/userdata/logs/server.trace.ndjson"
189194
```
190195

191196
Show slow spans:
@@ -196,7 +201,7 @@ jq -c 'select(.durationMs > 1000) | {
196201
durationMs,
197202
traceId,
198203
spanId
199-
}' "$T3CODE_HOME/userdata/logs/server.trace.ndjson"
204+
}' "$BCODE_HOME/userdata/logs/server.trace.ndjson"
200205
```
201206

202207
Inspect embedded log events:
@@ -213,7 +218,7 @@ jq -c 'select(any(.events[]?; .attributes["effect.logLevel"] != null)) | {
213218
level: .attributes["effect.logLevel"]
214219
}
215220
]
216-
}' "$T3CODE_HOME/userdata/logs/server.trace.ndjson"
221+
}' "$BCODE_HOME/userdata/logs/server.trace.ndjson"
217222
```
218223

219224
Follow one trace:
@@ -224,7 +229,7 @@ jq -r 'select(.traceId == "TRACE_ID_HERE") | [
224229
.spanId,
225230
(.parentSpanId // "-"),
226231
.durationMs
227-
] | @tsv' "$T3CODE_HOME/userdata/logs/server.trace.ndjson"
232+
] | @tsv' "$BCODE_HOME/userdata/logs/server.trace.ndjson"
228233
```
229234

230235
Filter orchestration commands:
@@ -235,7 +240,7 @@ jq -c 'select(.attributes["orchestration.command_type"] != null) | {
235240
durationMs,
236241
commandType: .attributes["orchestration.command_type"],
237242
aggregateKind: .attributes["orchestration.aggregate_kind"]
238-
}' "$T3CODE_HOME/userdata/logs/server.trace.ndjson"
243+
}' "$BCODE_HOME/userdata/logs/server.trace.ndjson"
239244
```
240245

241246
Filter git activity:
@@ -250,7 +255,7 @@ jq -c 'select(.attributes["git.operation"] != null) | {
250255
.events[]
251256
| select(.name == "git.hook.started" or .name == "git.hook.finished")
252257
]
253-
}' "$T3CODE_HOME/userdata/logs/server.trace.ndjson"
258+
}' "$BCODE_HOME/userdata/logs/server.trace.ndjson"
254259
```
255260

256261
### Use Tempo When You Need A Real Trace Viewer
@@ -358,7 +363,7 @@ If you need those later, add client-side instrumentation or a dedicated server f
358363

359364
Usually one of these is true:
360365

361-
- `T3CODE_OTLP_TRACES_URL` was not set
366+
- `BCODE_OTLP_TRACES_URL` was not set
362367
- the app was launched from a different environment than the one where you exported the vars
363368
- the app was not fully restarted after changing env
364369
- Grafana is looking at the wrong time range or service name
@@ -482,19 +487,19 @@ It provides:
482487

483488
Local trace file:
484489

485-
- `T3CODE_TRACE_FILE`: override trace file path
486-
- `T3CODE_TRACE_MAX_BYTES`: per-file rotation size, default `10485760`
487-
- `T3CODE_TRACE_MAX_FILES`: rotated file count, default `10`
488-
- `T3CODE_TRACE_BATCH_WINDOW_MS`: flush window, default `200`
489-
- `T3CODE_TRACE_MIN_LEVEL`: minimum trace level, default `Info`
490-
- `T3CODE_TRACE_TIMING_ENABLED`: enable timing metadata, default `true`
490+
- `BCODE_TRACE_FILE`: override trace file path
491+
- `BCODE_TRACE_MAX_BYTES`: per-file rotation size, default `10485760`
492+
- `BCODE_TRACE_MAX_FILES`: rotated file count, default `10`
493+
- `BCODE_TRACE_BATCH_WINDOW_MS`: flush window, default `200`
494+
- `BCODE_TRACE_MIN_LEVEL`: minimum trace level, default `Info`
495+
- `BCODE_TRACE_TIMING_ENABLED`: enable timing metadata, default `true`
491496

492497
OTLP export:
493498

494-
- `T3CODE_OTLP_TRACES_URL`: OTLP trace endpoint
495-
- `T3CODE_OTLP_METRICS_URL`: OTLP metric endpoint
496-
- `T3CODE_OTLP_EXPORT_INTERVAL_MS`: export interval, default `10000`
497-
- `T3CODE_OTLP_SERVICE_NAME`: service name, default `t3-server`
499+
- `BCODE_OTLP_TRACES_URL`: OTLP trace endpoint
500+
- `BCODE_OTLP_METRICS_URL`: OTLP metric endpoint
501+
- `BCODE_OTLP_EXPORT_INTERVAL_MS`: export interval, default `10000`
502+
- `BCODE_OTLP_SERVICE_NAME`: service name, default `t3-server`
498503

499504
If the OTLP URLs are unset, local tracing still works and metrics stay in-process only.
500505

docs/perf-benchmarks.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,14 @@ bun run test:perf
164164
### Watch the automated run in a live browser
165165

166166
```bash
167-
T3CODE_PERF_HEADFUL=1 bun run test:perf:web
167+
BCODE_PERF_HEADFUL=1 bun run test:perf:web
168168
```
169169

170170
If you already have fresh build artifacts:
171171

172172
```bash
173173
cd apps/web
174-
T3CODE_PERF_HEADFUL=1 bun run test:perf
174+
BCODE_PERF_HEADFUL=1 bun run test:perf
175175
```
176176

177177
### Open the seeded app manually for exploration
@@ -241,20 +241,20 @@ Current summary fields:
241241
To change the artifact output directory for one run:
242242

243243
```bash
244-
T3CODE_PERF_ARTIFACT_DIR=/tmp/t3-perf bun run test:perf:web
244+
BCODE_PERF_ARTIFACT_DIR=/tmp/t3-perf bun run test:perf:web
245245
```
246246

247247
## Internal env vars
248248

249249
These are the perf-specific env vars in the current harness:
250250

251-
- `T3CODE_PERF_HEADFUL=1`
251+
- `BCODE_PERF_HEADFUL=1`
252252
- Launch Chromium headed instead of headless.
253-
- `T3CODE_PERF_ARTIFACT_DIR=/path/to/output`
253+
- `BCODE_PERF_ARTIFACT_DIR=/path/to/output`
254254
- Override the artifact directory.
255-
- `T3CODE_PERF_PROVIDER=1`
255+
- `BCODE_PERF_PROVIDER=1`
256256
- Enables the perf provider path on the server.
257-
- `T3CODE_PERF_SCENARIO=dense_assistant_stream`
257+
- `BCODE_PERF_SCENARIO=dense_assistant_stream`
258258
- Selects the live perf provider scenario.
259259

260260
In normal usage, the automated harness and `perf:open` script set the provider env vars for you.

docs/release.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ This document covers the unified release workflow for stable and nightly desktop
5151
- The desktop UI shows a rocket update button when an update is available; click once to download, click again after download to restart/install.
5252
- Provider: GitHub Releases (`provider: github`) configured at build time.
5353
- Repository slug source:
54-
- `T3CODE_DESKTOP_UPDATE_REPOSITORY` (format `owner/repo`), if set.
54+
- `BCODE_DESKTOP_UPDATE_REPOSITORY` (format `owner/repo`), if set.
5555
- otherwise `GITHUB_REPOSITORY` from GitHub Actions.
5656
- Temporary private-repo auth workaround:
57-
- set `T3CODE_DESKTOP_UPDATE_GITHUB_TOKEN` (or `GH_TOKEN`) in the desktop app runtime environment.
57+
- set `BCODE_DESKTOP_UPDATE_GITHUB_TOKEN` (or `GH_TOKEN`) in the desktop app runtime environment.
5858
- the app forwards it as an `Authorization: Bearer <token>` request header for updater HTTP calls.
5959
- Required release assets for updater:
6060
- platform installers (`.exe`, `.dmg`, `.AppImage`, plus macOS `.zip` for Squirrel.Mac update payloads)

0 commit comments

Comments
 (0)