agent-joule/dev-docs/UPSTREAM_DIVERGENCE.md
David Charlot 88a41bedd3 Rebrand Zed -> Joule across UI, docs, embedded assets, and legal
The fork shipped renamed binary/bundle but the product name "Zed" was still
shown everywhere in the UI. Rename the display name to "Joule" (tagline
"Energy-metered agentic coding") while preserving every load-bearing reference.

Display renames (105 .rs files): release_channel display_name, welcome +
onboarding + ai_onboarding, macOS app menu (About/Hide/Quit), window titles,
About panel, settings UI, notifications, update/collab messages, system specs.
Bundle display name (crates/zed/Cargo.toml) -> "Joule" so CFBundleName / the
menu-bar name and the .app are "Joule" (identifier science.transaction.AgentJoule
and the agent-joule binary are unchanged).

Docs (223 .md): product prose Zed -> Joule, fence-aware (code blocks untouched).
Embedded assets (12 JSONC): // comments only.
Legal (4 files): product -> Joule, entity "Zed Industries, Inc." -> "Transaction
Science, Inc.", domain zed.dev -> openie.dev. NOTE: these are structurally Zed's
inherited terms and need a real legal review, not just a rename.

Deliberately PRESERVED (renaming would break the app): font aliases ("Zed Plex
Sans"/".ZedMono" in text_system + assets), HTTP header names (X-Zed-Predict-*),
zed:: action ids, app/bundle identifiers (dev.zed.Zed*, Zed-Editor-* product ids),
zed.dev URLs, ZED_* env vars, crate/package names, "Zed Industries" in non-legal
attribution, and the {zed,Zed} config-dir glob.

Signed + notarized + stapled as Joule.app, installed to /Applications, verified
(Gatekeeper: Notarized Developer ID, FH93XC2VRR). Caveat: test-code string
literals were renamed too, so some `cargo test` assertions may need updating.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-03 02:23:35 -04:00

72 lines
6.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Upstream Divergence — what we removed & modified
> Generated 2026-06-14. Fork baseline `a084434` ("hard fork of zed@e2e7a67") → HEAD. `git diff --stat a084434 HEAD`: **245 files, +13,564 / −187,592.** The binary compiles clean (`cargo check -p zed --bin agent-joule` → exit 0; 8 benign warnings).
The deletions are almost entirely upstream's `agent` + `agent_ui` + `sidebar`; the insertions are almost entirely the new `crates/agent_joule_panel`.
## 1. Entire crates / features removed
LOC = Rust LOC at baseline.
| Crate / feature | LOC | What it did upstream | Reason |
|---|---|---|---|
| `crates/agent` | ~75,549 | Native in-tree agent: thread engine, tool suite, prompt templates, eval fixtures, agent DB | Replaced by `agent_joule_panel` (federated ACP + local cascade) |
| `crates/agent_ui` | ~74,075 | Agent Panel UI: thread views, model selector, inline assistant, provider modals, agent_diff | Replaced by `agent_joule_panel` UI |
| `crates/sidebar` | ~22,660 | Thread/workspace switcher (+14.6k LOC tests) | Tied to removed agent_ui thread model; bloat |
| `crates/skill_creator` | ~1,993 | "Skill" authoring UI | Tied to removed agent skill system |
| `crates/auto_update` | ~1,555 | In-app updater; **held live egress** to Joule release servers | **Privacy / no-phone-home** |
| `crates/auto_update_ui` | ~391 | Release-notes / update banner | Privacy |
| `crates/auto_update_helper` | ~858 | Windows updater helper exe | Privacy |
| `crates/acp_tools` | ~842 | ACP protocol-inspector devtool | Bloat |
| `crates/eval_cli` | ~898 | Headless agent eval harness | Bloat |
| `crates/eval_utils` | ~146 | Eval helpers | Bloat |
| `title_bar/src/update_version.rs` | 148 | Title-bar "update available" | Privacy |
| `zed/src/zed/open_listener.rs` | 264 | `zed://` URL handler (AgentPanel/SharedAgentThread/InstallSkill deep-links) | Depended on removed agent_ui |
| `settings_ui/.../tool_permissions_setup.rs` | 1,461 | Agent tool-permission setup page | Tied to removed agent tool-permissions |
**Added:** `crates/agent_joule_panel` (~+12k LOC) + conformance vectors.
## 2. Core files modified
| File (lines) | What changed | Classification |
|---|---|---|
| `zed/src/main.rs` (~269) | Removed `agent_ui::init`/`acp_tools::init`/`auto_update*::init`/`PromptBuilder`; added `agent_joule_panel::init`. `authenticate()` → no-op (no startup sign-in — "the real phone-home"). Deleted agent deep-link handlers. Added `--jc-control/-params/-sock/-tcp/-token/-mcp` flags + control/MCP dispatch. Multi-instance by default (single now opt-in). | **privacy + wiring** |
| `zed/src/zed.rs` (~148) | Removed `Sidebar`, `acp_tools` toolbar, and the entire `initialize_agent_panel`/`setup_or_teardown_ai_panel`/`DisableAiSettings` machinery. Loads `AgentJoulePanel`. | **wiring + dead-removal** |
| `http_client/src/http_client.rs` (~84) | The four `build_zed_*_url` builders now `bail!` instead of returning a URL. | **privacy (egress backstop)** |
| `client/src/telemetry.rs` (~18) | `MINIDUMP_ENDPOINT = None` (ignores env); `send_event` builds but never transmits. | **privacy (crash + telemetry)** |
| `telemetry/src/telemetry.rs` (~14) | `send_event`/`init` no-ops; neutralizes ~43 `telemetry::event!` sites with one edit. | **privacy** |
| `title_bar/src/title_bar.rs` (~132) | Removed `update_version`, `SimulateUpdateAvailable`, and the Sign-In button (`render_sign_in_button` deleted). | **privacy + branding** |
| `onboarding/{basics_page,onboarding}.rs` (~109) | Removed `render_zed_agent_button` (Joule-cloud promo) + the `SignIn` action/handler. | **privacy** |
| `remote_connection/src/remote_connection.rs` (~112) | `download_server_binary_locally` → "disabled" error; `get_download_url` → `Ok(None)`; removed `AutoUpdater` dep (closes residual SSH remote-server fetch). | **privacy** |
| `project/src/agent_registry_store.rs` (~28) | `init_global` no longer auto-`refresh()`es; `refresh_if_stale` no-op. On-disk cache only; explicit `refresh()` retained. | **privacy (ACP registry auto-fetch)** |
| `activity_indicator.rs` (~5) | `DismissMessage` re-homed from removed `auto_update` crate. | clean re-home |
| `zed/Cargo.toml`, `Cargo.toml` | Binary `zed`→`agent-joule`; bundle id `dev.zed.Zed`→`science.transaction.AgentJoule`; member/path-dep changes. | **branding + wiring** |
| `assets/settings/default.json` (~37) | Theme→"Agent Joule"; `auto_install_extensions` emptied; added local `vllm` provider + `agent_servers` (claude-acp/gemini/codex). | **privacy + wiring + branding** |
| `assets/keymaps/*` | Removed `agent::*`/`agents_sidebar::*`/`onboarding::SignIn` bindings (would panic keymap validation); added `agent_joule::*`. | **wiring + privacy** |
## 3. Privacy hardening — claims vs code (all verified ✅)
`PRIVACY_HARDENING.md` claims check out against the diff:
- **A Sign-in removed** ✅ `main.rs::authenticate` no-op; title-bar button + `onboarding::SignIn` + keymap bindings removed. `client` crate retained, signed-out.
- **B Auto-update removed** ✅ all three `auto_update*` crates deleted; inits removed; menu items gone; `remote_connection` download stubbed (closes residual SSH egress).
- **C Telemetry neutralized** ✅ both `send_event` paths confirmed inert.
- **D Crash upload disabled** ✅ `MINIDUMP_ENDPOINT = None` (forced).
- **E ACP registry auto-fetch disabled** ✅ `init_global` auto-refresh removed + `refresh_if_stale` no-op (was ~36 startup connections to `cdn.agentclientprotocol.com`); explicit refresh retained.
- **F Egress backstop** ✅ all four `build_zed_*_url` `bail!`.
- **Extensions** ✅ `auto_install_extensions` emptied.
The doc's tshark-SNI "network-silent startup" runtime claim is asserted there, not re-run in this audit.
## 4. Dangling risk — none load-bearing
Build compiles (exit 0). Per removed-crate grep:
- `acp_tools`, `auto_update_ui`, `auto_update_helper`, `eval_cli`, `eval_utils` → **0 references.** Clean.
- `agent_ui` → 3 benign refs (a comment, a `clippy.toml` allow-path, and `visual_test_runner.rs` behind the **`visual-tests` feature** — *not* built by the binary). **Latent:** the `visual-tests` feature is itself now broken (calls removed `agent_ui::init`); dev-only.
- `sidebar` → all false positives (the word "sidebar" in `agents_sidebar` action ns, `AgentSettings.sidebar_side`, a `SidebarHandle` in `crates/workspace`).
- `skill_creator` / `agents_sidebar` → dead string literals in `zed.rs::test_action_namespaces:5135` (only fails if that test runs).
- `auto_update` → all refs are the inert settings *key* (a harmless dead config bool).
**Cleanly handled:** `DismissMessage` re-homed (not dangling); `render_sign_in_button` fully deleted; keymap bindings removed in lockstep (avoids the documented startup keymap-validation panic).
**Cleanup left behind** (see [FINDINGS.md](FINDINGS.md) P3): 8 unused-import/var warnings in `zed.rs`/`main.rs`; the broken `visual-tests` feature; the dead `"skill_creator"`/`"agents_sidebar"` test-namespace strings.