refactor: complete ocw→tj/tokenjam naming migration#55
Conversation
Sweeps all remaining `ocw` CLI references across the codebase: - CLI: `ocw` → `tj` in all docs, examples, incidents, and tests - Prometheus metrics: `ocw_*` prefix → `tj_*` in metrics.py - OTel attributes: `ocw.*` namespace → `tokenjam.*` in TypeScript SDK semconv - TS SDK default service name: `ocw-ts-sdk` → `tj-ts-sdk` - Import paths: `from ocw.sdk.*` → `from tokenjam.sdk.*` in examples - Config/paths: `ocw.toml` → `tj.toml`, `~/.ocw/` → `~/.tj/` in docs - Test fixtures: mock paths and assertion strings updated to match Co-Authored-By: Claude <noreply@anthropic.com>
|
Reviewed the diff against the working tree. Two real bugs and a fair amount of cleanup grep -i '\bocw\b' -- ':!CLAUDE.md' still returns 117 matches across 47 files. Bugs (blocking)
tokenjam/api/app.py:92 injects <meta name="tj-api-key" …>
Makefile:13 → ruff check ocw/, Makefile:16 → mypy ocw/. Directory is tokenjam/. Both exit 1. User-visible strings still saying OCW UI alerts empty-state — tokenjam/ui/index.html:978 tells users to configure Nits .gitignore still ignores ocw.toml / .ocw/ only — add tj.toml and .tj/. |
Two blocking bugs called out in the review: - Makefile lint/typecheck pointed at non-existent ocw/ dir; fixed to tokenjam/ - UI auth meta tag mismatch (ocw-api-key vs tj-api-key) caused 401s on every /api/v1/* call when auth.api_key was set Plus the long tail of user-visible OCW strings: CLI output (onboard, uninstall, demo), MCP tool docstrings (injected into Claude Code verbatim), TS SDK error messages and doc-comments, UI empty-state, internal comments and local var names. Bulk-renamed prose in docs/, examples/, incidents/, sdk-ts/README.md, and test docstrings. Dropped legacy ocw.toml/.ocw/ entries from .gitignore now that the rename is permanent. CLAUDE.md rule 13 keeps the single intentional 'ocw' reference (the 'pip install ocw' warning). Reviewer's grep `\bocw\b` excluding CLAUDE.md: 119 → 0 matches.
Summary
ocwCLI references across 52 files — docs, examples, incidents, tests, and sourceocw_*→tj_*intokenjam/api/routes/metrics.pyocw.*→tokenjam.*and default service nameocw-ts-sdk→tj-ts-sdkfrom ocw.sdk.*→from tokenjam.sdk.*in all examplesocw.toml→tj.toml,~/.ocw/→~/.tj/) in docsTest plan
pytest tests/unit/ tests/synthetic/ tests/agents/ tests/integration/— all 293 tests passcd sdk-ts && npm test— TypeScript SDK tests pass with updated semconv assertionsruff check tokenjam/— no lint errors introducedocwrefs (excluding intentional guard in CLAUDE.md):git grep -i '\bocw\b' -- ':!CLAUDE.md'🤖 Generated with Claude Code