Skip to content

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

Merged
KooshaPari merged 3 commits into
feature/herdr-plugin-manifestfrom
feature/decollide-kcode-r2
Nov 11, 2026
Merged

KooshaPari merged 3 commits into
feature/herdr-plugin-manifestfrom
feature/decollide-kcode-r2

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Lands the decollide rename work that was left uncommitted in the
jcode-decollide-kcode-r2 worktree.

  • crates/kcode-storage/src/lib.rs: adds the four remaining
    JCODE_TO_KCODE_ENV entries (JCODE_RUNTIME_DIR, JCODE_SOCKET,
    JCODE_SWARM_MODEL, JCODE_WAKE_MODE).
  • sdk/typescript/src/binary.ts: resolves the renamed kcode binary package
    (@1jehuang/kcode-*), with bundledJcodeBinary kept as a one-cycle alias.
  • sdk/typescript/src/launch.ts / sdk/typescript/src/sockets.ts: emit and
    read the KCODE_* environment variables, honoring the legacy JCODE_*
    forms for one release cycle.

Base is feature/herdr-plugin-manifest (the base this branch's previous PR
#34 used), so the diff is limited to these four files.


Tracks #271 (residual agent PR backlog): the Require Linked Issue gate failed only because this PR predates the issue.

KooshaPari and others added 2 commits October 8, 2026 18:47
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)
…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
Copilot AI balanced review requested due to automatic review settings November 8, 2026 07:15
@codeant-ai

codeant-ai Bot commented Nov 8, 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 Nov 8, 2026 •

Copy link
Copy Markdown
Pre-merge checks: Inconclusive 2

Failed Failed checks: 2 inconclusive

Check name Status Explanation Resolution
Title check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
Description check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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 insufficient remaining quota. Try requesting a review at a lower effort level.

Resolve merge conflict for #263 by merging the current feature/herdr-plugin-manifest into the PR head.
Conflict resolution: keep the PR's side in the conflicting hunks (the PR's own change
is the point); the base branch's non-conflicting changes are retained.

tx-agent: jcode
tx-validated: manual
tx-scope: KooshaPari/KCode
tx-intent: make #263 mergeable by merging feature/herdr-plugin-manifest into feature/decollide-kcode-r2
@sonarqubecloud

sonarqubecloud Bot commented Nov 8, 2026

Copy link
Copy Markdown

@kilo-code-bot

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

Copy link
Copy Markdown

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 1
WARNING 0
SUGGESTION 0
Issue Details (click to expand)

CRITICAL

File Line Issue
sdk/typescript/src/launch.ts 572 bundledKcodeBinary is called but never imported, causing a runtime ReferenceError
Files Reviewed (4 files)
  • crates/kcode-storage/src/lib.rs
  • sdk/typescript/src/binary.ts
  • sdk/typescript/src/launch.ts - 1 issue
  • sdk/typescript/src/sockets.ts

Fix these issues in Kilo Cloud


Reviewed by free · Input: 127.4K · Output: 5.2K · Cached: 1.5M

@KooshaPari
KooshaPari merged commit f40293a into feature/herdr-plugin-manifest Nov 11, 2026
8 of 11 checks passed
@KooshaPari
KooshaPari deleted the feature/decollide-kcode-r2 branch November 11, 2026 13:16
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