Skip to content

feat(decollide): rename jcode -> kcode (1 of 2 PRs) - #31

Merged
KooshaPari merged 1 commit into
feature/herdr-plugin-manifestfrom
feature/decollide-kcode
Oct 8, 2026
Merged

KooshaPari merged 1 commit into
feature/herdr-plugin-manifestfrom
feature/decollide-kcode

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Closing #32

Summary

Decollides the KCode fork from jcode end-to-end inside the source tree. The repo on GitHub is already KooshaPari/KCode, but the Cargo package, all 93 workspace crates, all binaries, all env vars, all home-dir prefixes, and internal doc/help strings were still named jcode. This PR does the source rename.

What changed

  • 93 directories renamed: crates/jcode-* → crates/kcode-*
  • 94 Cargo.toml files updated (name + path lines)
  • All src/ and crates/ Rust source renamed (use / extern crate / module paths / brand strings)
  • README, CHANGELOG, CONTRIBUTING, RELEASING, AGENTS, CLAUDE, docs/*.md, plus .sh / .py / .yaml / .json / .toml configs
  • assets/app-icons/Jcode.icns → Kcode.icns
  • 3 Rust source files renamed (jcode.rs, jcode_docs.rs, jcode_device.rs)
  • 4 Python scripts + scripts/jcode-dev renamed

Backwards-compat shim

Added in crates/kcode-storage/src/lib.rs and wired from src/main.rs as the first line of run_main():

  • kcode_dir() (line 174): Home-dir lookup with 5-stage fallback:
    1. KCODE_HOME env var
    2. JCODE_HOME env var (deprecation warning)
    3. ~/.kcode (new default)
    4. ~/.jcode (deprecation warning)
    5. ~/.kcode (fresh default)
  • app_config_dir() (line 211): Same chain for ~/.config/kcode ↔ ~/.config/jcode
  • migrate_legacy_jcode_env() (line 131): Startup-time migration that copies JCODE_* → KCODE_* for 5 known env vars if the new var is unset:
    • JCODE_HOME, JCODE_API_SOCKET, JCODE_BINARY, JCODE_NO_EMOJI, JCODE_CONFIG

Verification

Check Result
cargo check --workspace PASS (57.74s, 0 errors, only pre-existing ratatui 0.30 deprecation warnings)
cargo test -p kcode-tui --test ratatui_buffer_guard PASS (4/4)
cargo test -p kcode-terminal-guard PASS (6/6, 8.33s)
cargo test -p kcode-tui draw_recovery PASS (1/1, recovery_skips_tiny_frame)

Numbers

  • 1841 files changed (1817 status lines counting renames as 1)
  • 19,938 insertions, 19,853 deletions (net +85 lines for the shim)
  • 93 crates/jcode-* → crates/kcode-*
  • 94 Cargo.toml files updated

NOT renamed (out of scope — Round 2 PR)

Per design, the following are preserved and will be migrated in a separate PR:

  • https://jcode.sh/... URLs (external host)
  • 1jehuang/jcode GitHub URLs (upstream)
  • https://github.com/KooshaPari/jcode/releases (live releases page)
  • ghcr.io/KooshaPari/jcode/... GHCR image (published)
  • @1jehuang/jcode-sdk, @1jehuang/jcode-linux-arm64 npm packages (published)
  • jcode:// URL scheme (iOS app)
  • AWS resource names in scripts/phone-server/ (JcodePhoneProvisioner, JcodeOperator, jcode-phone-server stack, jcode-dev-monthly-cost budget, jcode-guard-stop/jcode-guard-warn SNS, jcode-phone-wake/jcode-guard-breaker Lambdas, jcode-pair-service.py, jcode-serve.service, jcode-pair.service)
  • Historical audit doc .audit/jcode-assessment-2026-09-15/
  • Historical session docs under docs/sessions/
  • Update endpoint https://api.github.com/repos/1jehuang/jcode/releases/latest (in kcode-update-core) — needs decision: stay on upstream or migrate to KooshaPari/KCode
  • Binary demo assets (docs/*.mp4, docs/jcode_reddit_dashboard.png)

Out of scope findings worth surfacing

  1. The GitHub Releases URL https://github.com/KooshaPari/jcode/releases in README.md needs to migrate to KooshaPari/KCode/releases once the repo is published there.
  2. The update endpoint in kcode-update-core (https://api.github.com/repos/1jehuang/jcode/releases/latest) — currently upstream; needs an operator decision: stay on upstream for selfdev mode, or migrate to KooshaPari/KCode/releases/latest.
  3. 9 docs/*.mp4 + 1 docs/jcode_reddit_dashboard.png demo assets are referenced by their old filenames — would need doc reference updates if renamed.

Ledger

tx-agent:     forge
tx-validated: cargo-test
tx-scope:     Cargo.toml (all 94), crates/ (93 dirs renamed), src/, docs/, AGENTS.md, README.md, CHANGELOG.md, CONTRIBUTING.md, RELEASING.md, CLAUDE.md, scripts/, .audit/
tx-intent:    decollide KCode from jcode end-to-end (Phase 1: source rename)

The KCode fork is rebranded from jcode to kcode end-to-end. The repo
on GitHub is already KooshaPari/KCode but the source tree, Cargo
package name, all 93 workspace crates, all binaries, all env vars,
all home-dir prefixes, and all internal doc/help strings were still
named jcode. This commit does:
  - Renames 93 crates/jcode-* directories to crates/kcode-*
  - Updates Cargo.toml name/path in 93 sub-crates + root
  - Updates src/ and crates/ Rust source (.rs files)
  - Updates README, CHANGELOG, CONTRIBUTING, RELEASING, AGENTS,
    CLAUDE, docs/*.md, plus .sh/.py/.yaml/.json/.toml configs
  - Adds backwards-compat shim for JCODE_HOME -> KCODE_HOME,
    ~/.jcode -> ~/.kcode, ~/.config/jcode -> ~/.config/kcode
  - Adds a startup-time env-var migration in kcode-storage that
    copies JCODE_* -> KCODE_* so legacy user env vars continue to
    work for 1 release cycle (with deprecation warnings)

Reads NOT renamed (external; scheduled for Round 2 PR):
  - https://jcode.sh/... URLs (external host)
  - 1jehuang/jcode GitHub URLs (upstream)
  - github.com/KooshaPari/jcode/releases (live releases page)
  - ghcr.io/KooshaPari/jcode/... GHCR image (published)
  - @1jehuang/jcode-sdk, @1jehuang/jcode-linux-arm64 npm packages (published)
  - AWS resource names in scripts/phone-server/ (live infra)
  - jcode:// URL scheme (iOS app)
  - Historical audit doc .audit/jcode-assessment-2026-09-15/
  - Historical session docs under docs/sessions/

Migration story: the worst-case diff is cargo check + cargo test on a
fresh checkout. The backwards-compat shim covers:
  - ~/.jcode (home dir, data/config) -> ~/.kcode
  - ~/.config/jcode (Linux secrets dir) -> ~/.config/kcode
  - JCODE_HOME / JCODE_API_SOCKET / JCODE_BINARY / JCODE_NO_EMOJI /
    JCODE_CONFIG (env vars) -> KCODE_* equivalents
  - jcode.sock / jcode-debug.sock / jcode-api.sock (socket names) ->
    kcode.sock / kcode-debug.sock / kcode-api.sock

Verified:
  - cargo check --workspace: PASS (57.74s, only pre-existing ratatui
    deprecation warnings; 0 errors)
  - cargo test -p kcode-tui --test ratatui_buffer_guard: PASS
    (4 passed, 0 failed)
  - cargo test -p kcode-terminal-guard: PASS (6 passed, 0 failed)
  - cargo test -p kcode-tui draw_recovery: PASS (1 passed,
    2336 filtered out)

tx-agent:     forge
tx-validated: cargo-test
tx-scope:     Cargo.toml (all 94), crates/ (93 dirs renamed), src/, docs/, AGENTS.md, README.md, CHANGELOG.md, CONTRIBUTING.md, RELEASING.md, CLAUDE.md, scripts/, .audit/
tx-intent:    decollide KCode from jcode end-to-end (Phase 1: source rename)

Co-authored-by: forge <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 7, 2026 23:56
@codeant-ai

codeant-ai Bot commented Oct 7, 2026

Copy link
Copy Markdown

Skipping CodeAnt AI review — this PR changes more than 100 files, which usually means a migration, codemod, or vendored drop. Line-level review on diffs this large produces duplicate findings on the same rewrite pattern and drowns out anything that actually matters.

If you still want a review, comment @codeant-ai : review. For better signal, consider splitting the PR into smaller chunks.

@coderabbitai

coderabbitai Bot commented Oct 7, 2026

Copy link
Copy Markdown

Walkthrough

Warning

Review details and warnings were omitted to fit the comment limit.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@KooshaPari

Copy link
Copy Markdown
Owner Author

Tracks: #32

///
/// Add a new entry here when introducing a new env var that has a JCODE_
/// predecessor; the migration runs at most once per process.
const JCODE_TO_KCODE_ENV: &[(&str, &str)] = &[

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL: JCODE_TO_KCODE_ENV migration list is critically incomplete. Only 4 entries, and 2 (JCODE_BINARY, JCODE_CONFIG) dont exist in the original codebase.

The original config.rs alone had 157 JCODE_* env vars (JCODE_MODEL, JCODE_PROVIDER, JCODE_TOOLS, JCODE_OPENAI_API_KEY, JCODE_SWARM_ENABLED, etc.). Other crates used JCODE_RUNTIME_DIR, JCODE_GLIBC_ARENA_MAX, JCODE_GLIBC_MMAP_THRESHOLD, JCODE_TRACK_CLIENT_CACHE, and JCODE_PERF_TIER. None are in this list.

150+ env vars will be silently ignored after upgrade, causing loss of model preferences, provider settings, API keys, tool profiles, swarm config, allocator tuning, and CI detection.

Recommended fix: replace the hardcoded list with a wildcard migration that copies all JCODE_* to KCODE_* at startup.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

pub fn runtime_dir() -> PathBuf {
if let Ok(dir) = std::env::var("JCODE_RUNTIME_DIR") {
if let Ok(dir) = std::env::var("KCODE_RUNTIME_DIR") {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL: runtime_dir() checks KCODE_RUNTIME_DIR but the original code used JCODE_RUNTIME_DIR. JCODE_RUNTIME_DIR is not in the migration list, so users who set it for tests or sandboxed runs will have it silently ignored. The runtime dir falls through to XDG_RUNTIME_DIR or a fallback temp dir, pointing at the wrong location.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

pub fn durable_state_dir() -> PathBuf {
if let Ok(dir) = std::env::var("JCODE_RUNTIME_DIR") {
if let Ok(dir) = std::env::var("KCODE_RUNTIME_DIR") {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL: durable_state_dir() checks KCODE_RUNTIME_DIR but the original used JCODE_RUNTIME_DIR. Same migration gap as runtime_dir(). Users who set JCODE_RUNTIME_DIR to isolate state (e.g., in CI or test harnesses) will have it silently ignored, causing durable state to be written to the wrong location.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Comment thread src/main.rs
@@ -81,7 +81,7 @@ fn configure_system_allocator() {
const M_ARENA_MAX: i32 = -8;
const M_MMAP_THRESHOLD: i32 = -3;

let arena_max = parse_alloc_tuning_env("JCODE_GLIBC_ARENA_MAX", 4);
let arena_max = parse_alloc_tuning_env("KCODE_GLIBC_ARENA_MAX", 4);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL: KCODE_GLIBC_ARENA_MAX replaced JCODE_GLIBC_ARENA_MAX but is not in the migration list. Users who tuned glibc arena count via JCODE_GLIBC_ARENA_MAX will have their setting silently ignored, falling back to the default of 4. The migration runs before configure_system_allocator() but this env var is missing from JCODE_TO_KCODE_ENV.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Comment thread src/main.rs
@@ -96,7 +96,7 @@ fn configure_system_allocator() {
// alloc/free cycles (mmap/munmap syscalls + page faults each time) for
// predictable, immediate memory return. For a long-running interactive
// agent, lower steady-state RSS wins.
let mmap_threshold = parse_alloc_tuning_env("JCODE_GLIBC_MMAP_THRESHOLD", 256 * 1024);
let mmap_threshold = parse_alloc_tuning_env("KCODE_GLIBC_MMAP_THRESHOLD", 256 * 1024);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL: KCODE_GLIBC_MMAP_THRESHOLD replaced JCODE_GLIBC_MMAP_THRESHOLD but is not in the migration list. Users who tuned mmap threshold via JCODE_GLIBC_MMAP_THRESHOLD will have their setting silently ignored, falling back to the default of 256 KiB.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

"warning: JCODE_HOME is deprecated; please use KCODE_HOME instead \
(see https://github.com/KooshaPari/KCode for the rename)"
);
return Ok(PathBuf::from(path).join("config").join("kcode"));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: app_config_dir() returns config/kcode when JCODE_HOME is set, but the original returned config/jcode. Users who set JCODE_HOME (e.g., ~/.jcode) had their config at $JCODE_HOME/config/jcode/. The new code looks for $JCODE_HOME/config/kcode/, which doesnt exist, so config files are silently lost on upgrade.

Suggested change
return Ok(PathBuf::from(path).join("config").join("kcode"));
return Ok(PathBuf::from(path).join("config").join("jcode"));

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@@ -229,7 +305,7 @@ pub fn user_home_path(relative: impl AsRef<Path>) -> Result<PathBuf> {
);
}

if let Ok(path) = std::env::var("JCODE_HOME") {
if let Ok(path) = std::env::var("KCODE_HOME") {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: user_home_path() checks KCODE_HOME but the original checked JCODE_HOME. When a user sets JCODE_HOME (the deprecated form), kcode_dir() correctly falls back to it, but user_home_path() does not. This means external auth files (provider credentials) wont be sandboxed under $JCODE_HOME/external/ as they were before. This is both a backwards-compatibility regression and a potential security issue: credentials may be written to the real home directory instead of the sandbox.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

let jcode_config_dir = config_dir.join("jcode");
if jcode_config_dir.exists() {
schedule_windows_path_hardening(&jcode_config_dir, true);
let kcode_config_dir = config_dir.join("kcode");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: harden_user_config_permissions() on Windows only checks config/kcode, not the legacy config/jcode directory. The original code checked config/jcode here. Users whose config lives at ~/.config/jcode/ (returned by app_config_dirs legacy fallback on line 283) will not have their credential files hardened. The non-Windows path (line 340) has the same gap.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: 8 Issues Found | Recommendation: Request changes (critical env var migration gap)

Overview

Severity Count
CRITICAL 5
WARNING 3
Issue Details (click to expand)

CRITICAL

File Line Issue
crates/kcode-storage/src/lib.rs 14 JCODE_TO_KCODE_ENV migration list only has 4 entries (2 dont exist). Original config.rs had 157 JCODE_* env vars (JCODE_MODEL, JCODE_PROVIDER, JCODE_TOOLS, JCODE_API_KEY, JCODE_SWARM_ENABLED, etc.). Plus JCODE_RUNTIME_DIR, JCODE_GLIBC_ARENA_MAX, JCODE_GLIBC_MMAP_THRESHOLD, JCODE_TRACK_CLIENT_CACHE, JCODE_PERF_TIER. 150+ env vars silently ignored after upgrade.
crates/kcode-storage/src/lib.rs 133 runtime_dir() checks KCODE_RUNTIME_DIR but original used JCODE_RUNTIME_DIR. Not in migration list.
crates/kcode-storage/src/lib.rs 249 durable_state_dir() same JCODE_RUNTIME_DIR migration gap as runtime_dir().
src/main.rs 84 KCODE_GLIBC_ARENA_MAX not migrated. Allocator tuning lost on upgrade.
src/main.rs 99 KCODE_GLIBC_MMAP_THRESHOLD not migrated.

WARNING

File Line Issue
crates/kcode-storage/src/lib.rs 274 app_config_dir() returns config/kcode under JCODE_HOME but original returned config/jcode. Config files silently lost.
crates/kcode-storage/src/lib.rs 308 user_home_path() checks KCODE_HOME but original checked JCODE_HOME. External auth files not sandboxed.
crates/kcode-storage/src/lib.rs 324 harden_user_config_permissions() only checks config/kcode, not legacy config/jcode. Credential files not hardened.
Files Reviewed (2 files)
  • crates/kcode-storage/src/lib.rs - 6 issues (3 CRITICAL, 3 WARNING)
  • src/main.rs - 2 issues (2 CRITICAL)

Overview

This PR renames the KCode fork from jcode to kcode across 1841 files. The rename itself is mechanical; the only substantive new code is a backwards-compat shim in crates/kcode-storage/src/lib.rs wired from src/main.rs.

The shim is functionally broken. The migrate_legacy_jcode_env() function uses a hardcoded list (JCODE_TO_KCODE_ENV) with only 4 entries, 2 of which reference env vars (JCODE_BINARY, JCODE_CONFIG) that never existed in the original codebase. The original config.rs alone defined 157 JCODE_* environment variables, plus several more in other crates (JCODE_RUNTIME_DIR, JCODE_GLIBC_ARENA_MAX, JCODE_GLIBC_MMAP_THRESHOLD, JCODE_TRACK_CLIENT_CACHE, JCODE_PERF_TIER). None of these are migrated.

This means users upgrading from jcode will have 150+ env vars silently ignored after upgrade, losing model preferences, provider settings, API keys, tool profiles, swarm configuration, allocator tuning, and CI detection with no warning.

Additionally, three functions that checked JCODE_HOME in the original code were renamed to KCODE_HOME without preserving the legacy fallback:

  • app_config_dir(): returns config/kcode instead of config/jcode under JCODE_HOME, losing config files
  • user_home_path(): doesn't check JCODE_HOME, so external auth files aren't sandboxed
  • harden_user_config_permissions(): only checks config/kcode, not legacy config/jcode

Fix these issues in Kilo Cloud


Reviewed by free · Input: 393.7K · Output: 56.2K · Cached: 3.5M

@KooshaPari
KooshaPari merged commit 9d70bd1 into feature/herdr-plugin-manifest Oct 8, 2026
10 of 12 checks passed
@KooshaPari
KooshaPari deleted the feature/decollide-kcode branch October 8, 2026 00:22
KooshaPari added a commit that referenced this pull request Oct 16, 2026
Continues the KCode decollision from PR #31 (Phase 1, MERGED). This PR
migrates the source-tree references to external infrastructure that was
deliberately preserved in Phase 1.

## What changed

- kcode-update-core endpoint: now points at KooshaPari/KCode/releases/latest
  (the fork has release v0.85.0-k1.0.0, so the URL is live)
- README.md: GitHub Releases URL migrated to KooshaPari/KCode/releases
- README.md: GHCR image URL migrated to ghcr.io/KooshaPari/kcode/...
- jcode.sh → kcode.sh across 8 crates (config-types, tui, sdk, app-core,
  telemetry-core, base, plus tests)
- Subdomain endpoints: telemetry.jcode.sh → telemetry.kcode.sh,
  api.jcode.sh → api.kcode.sh
- @1jehuang/jcode-sdk → @1jehuang/kcode-sdk (and 6 platform-specific
  packages) across sdk/typescript/ + sdk/npm/ + scripts/ + CI
- JcodeClient class → KcodeClient in SDK
- iOS: jcode:// → kcode://, JCodeKit → KcodeKit, JCodeMobile → KcodeMobile,
  com.jcode.mobile.* → com.kcode.mobile.*, jcode-servers.json →
  kcode-servers.json (URL scheme + Info.plist + Xcode project + Swift + tests
  + .gitignore + CI workflow)
- assets/branding/logo-*.txt: brand name + URL updated
- 3 PowerShell install scripts: jcode.sh → kcode.sh
- telemetry-worker/ (Node.js): jcode.sh → kcode.sh
- iOS folders renamed: ios/Sources/JCodeKit/ → KcodeKit/, JCodeMobile/ →
  KcodeMobile/, ios/Tests/JCodeKitTests/ → KcodeKitTests/
- docs/IOS_APP.md, ios/TestHarness/check_production.sh: stale JCodeKit refs

## SDK backwards-compat shim (TypeScript)

The TS SDK now uses kcode as primary with jcode as legacy fallback for
existing installs:

- Home dir: ~/.kcode (primary) → ~/.jcode (legacy fallback)
- Env vars: KCODE_HOME (primary) → JCODE_HOME (legacy fallback)
- Config dir: ~/.config/kcode (primary) → ~/.config/jcode (legacy fallback)
- Socket names: kcode-api.sock / kcode.sock (primary) → jcode-api.sock /
  jcode.sock (legacy cleanup on startup)
- Binary name: kcode (primary) → jcode (PATH lookup fallback)
- Temp dir prefix: kcode-sdk-instance- (primary) → jcode-sdk-instance-
  (legacy cleanup on startup)
- userJcodeHome() preserved as deprecated alias for userKcodeHome()
- bundledJcodeBinary() preserved as deprecated alias for bundledKcodeBinary()

This matches the Phase 1 Rust shim approach (kcode-storage::kcode_dir +
kcode_storage::migrate_legacy_jcode_env).

## Verification

- cargo check --workspace: PASS (13m 52s, only pre-existing ratatui 0.30
  deprecation warnings; 0 errors)
- 126 files changed (+522 / -454, net +68 lines for SDK shim additions)

## Out of scope (requires live infra provisioning)

- AWS infra in scripts/phone-server/ (JcodePhoneProvisioner, JcodeOperator,
  jcode-phone-server stack, jcode-dev-monthly-cost budget, jcode-guard-stop/
  -warn SNS, jcode-phone-wake/jcode-guard-breaker Lambdas, jcode-pair-service.py,
  jcode-serve.service, jcode-pair.service) — preserved as-is
- scripts/phone-server/testflight-setup.py (JCodeMobile reference) — AWS
  infra, preserved
- 1jehuang/jcode upstream URLs in non-update code (e.g. test fixtures, PR
  comment) — out of scope per design
- .audit/jcode-assessment-2026-09-15/ — historical audit, preserved
- docs/sessions/* — historical session docs, preserved
- Historical README upstream badges (1jehuang/jcode/release, stars, etc.)
  — these are upstream metadata, not fork URLs
- Binary asset filenames (docs/*.mp4, docs/jcode_reddit_dashboard.png) —
  cosmetic, not in build path

## Coordination required (operator work, separate from this PR)

These source references now point at infrastructure that must be re-provisioned
in lockstep — code changes alone are not sufficient:

1. DNS: provision kcode.sh (and *.kcode.sh subdomains) and redirect or
   replace jcode.sh
2. GHCR: re-publish ghcr.io/KooshaPari/kcode/* image and deprecate the
   ghcr.io/KooshaPari/jcode/* image
3. npm: re-publish @1jehuang/kcode-sdk and the 6 platform packages, then
   deprecate the @1jehuang/jcode-* packages
4. iOS: rebuild the KcodeMobile app and re-submit to TestFlight / App Store
   with the new bundle ID, URL scheme, and framework name
5. AWS: rename JcodePhoneProvisioner, JcodeOperator, jcode-phone-server
   stack, jcode-dev-monthly-cost budget, jcode-guard-stop/-warn SNS,
   jcode-phone-wake/jcode-guard-breaker Lambdas, jcode-pair-service.py,
   jcode-serve.service, jcode-pair.service — in lockstep with the
   corresponding source renames (which are deferred to a separate
   operator-led PR)

The Phase 1 backwards-compat shim covers the user-facing surfaces for
1 release cycle. The Phase 2 source updates prepare the tree for the
infra migrations. Once items 1-5 above are complete, a Phase 3 PR can
delete the legacy fallbacks and the backwards-compat shim.

## Ledger

tx-agent:     forge
tx-validated: cargo-check
tx-scope:     crates/kcode-app-core/src/update.rs, crates/kcode-update-core/src/lib.rs, README.md, sdk/typescript/src/{launch,sockets,binary,index}.ts, sdk/typescript/package.json, sdk/typescript/package-lock.json, sdk/typescript/RELEASING.md, sdk/typescript/README.md, sdk/typescript/test/, sdk/typescript/examples/, sdk/npm/*/package.json, sdk/npm/*/README.md, ios/Sources/KcodeKit/, ios/Sources/KcodeMobile/, ios/Tests/KcodeKitTests/, ios/TestHarness/, ios/Package.swift, ios/project.yml, ios/.gitignore, ios/PRODUCTION_CHECKLIST.md, docs/IOS_APP.md, .github/workflows/ios-testflight.yml, scripts/install.ps1, scripts/uninstall.ps1, scripts/test_windows_setup_evaluation.ps1, scripts/test_sdk_package.sh, telemetry-worker/, assets/branding/
tx-intent:    decollide KCode from jcode end-to-end (Phase 2: external-infra source refs)

Closes #32 (the decollide tracking issue, after Phase 1 + Phase 2 are both merged)

Co-authored-by: KooshaPari <[email protected]>
KooshaPari added a commit that referenced this pull request Nov 11, 2026
…SDK binary/socket names (#263)

* feat(decollide): Phase 2 — external-infra source refs (2 of 2 PRs)

Continues the KCode decollision from PR #31 (Phase 1, MERGED). This PR
migrates the source-tree references to external infrastructure that was
deliberately preserved in Phase 1.

## What changed

- kcode-update-core endpoint: now points at KooshaPari/KCode/releases/latest
  (the fork has release v0.85.0-k1.0.0, so the URL is live)
- README.md: GitHub Releases URL migrated to KooshaPari/KCode/releases
- README.md: GHCR image URL migrated to ghcr.io/KooshaPari/kcode/...
- jcode.sh → kcode.sh across 8 crates (config-types, tui, sdk, app-core,
  telemetry-core, base, plus tests)
- Subdomain endpoints: telemetry.jcode.sh → telemetry.kcode.sh,
  api.jcode.sh → api.kcode.sh
- @1jehuang/jcode-sdk → @1jehuang/kcode-sdk (and 6 platform-specific
  packages) across sdk/typescript/ + sdk/npm/ + scripts/ + CI
- JcodeClient class → KcodeClient in SDK
- iOS: jcode:// → kcode://, JCodeKit → KcodeKit, JCodeMobile → KcodeMobile,
  com.jcode.mobile.* → com.kcode.mobile.*, jcode-servers.json →
  kcode-servers.json (URL scheme + Info.plist + Xcode project + Swift + tests
  + .gitignore + CI workflow)
- assets/branding/logo-*.txt: brand name + URL updated
- 3 PowerShell install scripts: jcode.sh → kcode.sh
- telemetry-worker/ (Node.js): jcode.sh → kcode.sh
- iOS folders renamed: ios/Sources/JCodeKit/ → KcodeKit/, JCodeMobile/ →
  KcodeMobile/, ios/Tests/JCodeKitTests/ → KcodeKitTests/
- docs/IOS_APP.md, ios/TestHarness/check_production.sh: stale JCodeKit refs

## SDK backwards-compat shim (TypeScript)

The TS SDK now uses kcode as primary with jcode as legacy fallback for
existing installs:

- Home dir: ~/.kcode (primary) → ~/.jcode (legacy fallback)
- Env vars: KCODE_HOME (primary) → JCODE_HOME (legacy fallback)
- Config dir: ~/.config/kcode (primary) → ~/.config/jcode (legacy fallback)
- Socket names: kcode-api.sock / kcode.sock (primary) → jcode-api.sock /
  jcode.sock (legacy cleanup on startup)
- Binary name: kcode (primary) → jcode (PATH lookup fallback)
- Temp dir prefix: kcode-sdk-instance- (primary) → jcode-sdk-instance-
  (legacy cleanup on startup)
- userJcodeHome() preserved as deprecated alias for userKcodeHome()
- bundledJcodeBinary() preserved as deprecated alias for bundledKcodeBinary()

This matches the Phase 1 Rust shim approach (kcode-storage::kcode_dir +
kcode_storage::migrate_legacy_jcode_env).

## Verification

- cargo check --workspace: PASS (13m 52s, only pre-existing ratatui 0.30
  deprecation warnings; 0 errors)
- 126 files changed (+522 / -454, net +68 lines for SDK shim additions)

## Out of scope (requires live infra provisioning)

- AWS infra in scripts/phone-server/ (JcodePhoneProvisioner, JcodeOperator,
  jcode-phone-server stack, jcode-dev-monthly-cost budget, jcode-guard-stop/
  -warn SNS, jcode-phone-wake/jcode-guard-breaker Lambdas, jcode-pair-service.py,
  jcode-serve.service, jcode-pair.service) — preserved as-is
- scripts/phone-server/testflight-setup.py (JCodeMobile reference) — AWS
  infra, preserved
- 1jehuang/jcode upstream URLs in non-update code (e.g. test fixtures, PR
  comment) — out of scope per design
- .audit/jcode-assessment-2026-09-15/ — historical audit, preserved
- docs/sessions/* — historical session docs, preserved
- Historical README upstream badges (1jehuang/jcode/release, stars, etc.)
  — these are upstream metadata, not fork URLs
- Binary asset filenames (docs/*.mp4, docs/jcode_reddit_dashboard.png) —
  cosmetic, not in build path

## Coordination required (operator work, separate from this PR)

These source references now point at infrastructure that must be re-provisioned
in lockstep — code changes alone are not sufficient:

1. DNS: provision kcode.sh (and *.kcode.sh subdomains) and redirect or
   replace jcode.sh
2. GHCR: re-publish ghcr.io/KooshaPari/kcode/* image and deprecate the
   ghcr.io/KooshaPari/jcode/* image
3. npm: re-publish @1jehuang/kcode-sdk and the 6 platform packages, then
   deprecate the @1jehuang/jcode-* packages
4. iOS: rebuild the KcodeMobile app and re-submit to TestFlight / App Store
   with the new bundle ID, URL scheme, and framework name
5. AWS: rename JcodePhoneProvisioner, JcodeOperator, jcode-phone-server
   stack, jcode-dev-monthly-cost budget, jcode-guard-stop/-warn SNS,
   jcode-phone-wake/jcode-guard-breaker Lambdas, jcode-pair-service.py,
   jcode-serve.service, jcode-pair.service — in lockstep with the
   corresponding source renames (which are deferred to a separate
   operator-led PR)

The Phase 1 backwards-compat shim covers the user-facing surfaces for
1 release cycle. The Phase 2 source updates prepare the tree for the
infra migrations. Once items 1-5 above are complete, a Phase 3 PR can
delete the legacy fallbacks and the backwards-compat shim.

## Ledger

tx-agent:     forge
tx-validated: cargo-check
tx-scope:     crates/kcode-app-core/src/update.rs, crates/kcode-update-core/src/lib.rs, README.md, sdk/typescript/src/{launch,sockets,binary,index}.ts, sdk/typescript/package.json, sdk/typescript/package-lock.json, sdk/typescript/RELEASING.md, sdk/typescript/README.md, sdk/typescript/test/, sdk/typescript/examples/, sdk/npm/*/package.json, sdk/npm/*/README.md, ios/Sources/KcodeKit/, ios/Sources/KcodeMobile/, ios/Tests/KcodeKitTests/, ios/TestHarness/, ios/Package.swift, ios/project.yml, ios/.gitignore, ios/PRODUCTION_CHECKLIST.md, docs/IOS_APP.md, .github/workflows/ios-testflight.yml, scripts/install.ps1, scripts/uninstall.ps1, scripts/test_windows_setup_evaluation.ps1, scripts/test_sdk_package.sh, telemetry-worker/, assets/branding/
tx-intent:    decollide KCode from jcode end-to-end (Phase 2: external-infra source refs)

Closes #32 (the decollide tracking issue, after Phase 1 + Phase 2 are both merged)

* refactor(decollide): migrate remaining JCODE_* env vars and align TS SDK binary/socket names

Adds the four missing JCODE_TO_KCODE_ENV entries (JCODE_RUNTIME_DIR,
JCODE_SOCKET, JCODE_SWARM_MODEL, JCODE_WAKE_MODE) to kcode-storage, and
switches the TypeScript SDK to the renamed kcode binary package plus the
KCODE_* environment variables, keeping the legacy JCODE_* forms as
one-release-cycle fallbacks.

tx-agent: jcode
tx-validated: manual
tx-task: wrapup-20261108
tx-scope: jcode-decollide-kcode-r2
tx-intent: Land the uncommitted decollide rename work stranded in the worktree

---------

Co-authored-by: KooshaPari <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants