| 1 | # Legacy `.deepseek/` compatibility paths — audit & migration status (#3068) |
| 2 | |
| 3 | > 阅读简体中文版:[zh_hans/LEGACY_PATHS.md](zh_hans/LEGACY_PATHS.md)。 |
| 4 | |
| 5 | ## v0.9.10 cleanse ledger |
| 6 | |
| 7 | This is the release-window decision record for residue that can otherwise look |
| 8 | interchangeable in a text search. A compatibility entry must name the contract |
| 9 | that still requires it; new production code must use a current path. |
| 10 | |
| 11 | | Class | Surface | Decision / contract | |
| 12 | |---|---|---| |
| 13 | | DELETE | Retired underwater build-version test override | Removed in `1cc4d1d1b`; the owner test was already deleted and the production-only build version remains authoritative. | |
| 14 | | MIGRATE | Cross-task Agent Mail | `bd998495a` and managed-app `4ff7bc50d` replace guessed event aliases and same-session mailbox conflation with one durable typed runtime protocol. | |
| 15 | | MIGRATE | TUI `status_message` writes | Active residue; touched flows must move to the typed toast/current-state owner. No new writes are allowed. | |
| 16 | | COMPATIBILITY | `.deepseek/` state and stored provider aliases | Read fallback for upgraded installations and stored provider identity; writes remain Codewhale-only. Details are below. | |
| 17 | | COMPATIBILITY | `agent_message` transcript/protocol decoding | Persisted transcripts and tool wire values require decoding; it is not the cross-task Agent Mail transport. | |
| 18 | | COMPATIBILITY | Managed runtime envelope schema 1 | Previously persisted/enrolled runner replay; current local Codewhale Agent Mail producer is schema 2 and both normalize to the managed envelope. | |
| 19 | | CURRENT | DeepSeek provider support | A real selectable provider, not product branding; provider-scoped names and configuration remain. | |
| 20 | | CURRENT | Same-session subagent mailbox | Start/status/peek/message/followup/interrupt/wait/cancel stays scoped to a parent runtime session. | |
| 21 | | CURRENT | Web locale dictionaries | The application and documentation routes have no page-local `isZh` branches; new copy continues through dictionaries. | |
| 22 | | CURRENT | Safety, authorization, protocol, persistence, migration, and data-integrity tests | These protect external or durable contracts and are not copy/layout cleanup candidates. | |
| 23 | |
| 24 | Snapshot on 2026-08-19: `10,954` Rust `#[test]` attributes under |
| 25 | `crates/tui`, `523` TUI `status_message` source lines, and zero page-local |
| 26 | `isZh` files under `apps/web/app` in the paired managed-app candidate. Counts |
| 27 | are inventory signals, not deletion targets. |
| 28 | |
| 29 | Codewhale was renamed from DeepSeek-TUI. To avoid breaking existing installs, the runtime reads |
| 30 | state from the new `~/.codewhale/` location but **falls back** to the legacy `~/.deepseek/` location, |
| 31 | and always **writes** to `~/.codewhale/`. This doc audits each legacy reference and records a |
| 32 | keep / deprecate / remove decision so the migration is auditable. |
| 33 | |
| 34 | ## The canonical resolver (use this for new code) |
| 35 | |
| 36 | State-dir APIs are exported by `codewhale-config`; their implementation is |
| 37 | `crates/config/src/state_dirs.rs`, with root selection in `crates/paths/src/lib.rs`. |
| 38 | The paths in this audit show defaults. `CODEWHALE_HOME` selects the primary |
| 39 | home and prevents fallback outside that root. |
| 40 | |
| 41 | | Symbol | Purpose | |
| 42 | |---|---| |
| 43 | | `CODEWHALE_APP_DIR` / `LEGACY_APP_DIR` | Default directory names from `codewhale-paths`. | |
| 44 | | `codewhale_home()` | Selected primary home, defaulting to `~/.codewhale`. | |
| 45 | | `legacy_deepseek_home()` | Selected legacy home, defaulting to `~/.deepseek`. | |
| 46 | | `resolve_state_dir(subdir)` | Read the primary directory; fall back only if it is absent and no explicit primary home was selected. | |
| 47 | | `ensure_state_dir(subdir)` | Write under the primary home; guarded migration can relocate owned legacy state and reports what moved. | |
| 48 | |
| 49 | Compatible harness roots are read-only discovery inputs, not owned migration |
| 50 | or deletion targets. |
| 51 | |
| 52 | ## Per-path decisions |
| 53 | |
| 54 | **Decision for all legacy references below: keep-as-fallback.** Removing the `.deepseek` fallback |
| 55 | would strand users who upgraded in place and never re-ran onboarding. Revisit only after a release |
| 56 | that actively migrates `~/.deepseek/` → `~/.codewhale/` on first run and a deprecation window. |
| 57 | |
| 58 | | Reference | Routed through `resolve_state_dir`? | Decision | |
| 59 | |---|---|---| |
| 60 | | `config::resolve_state_dir` / `ensure_state_dir` | n/a (the resolver itself) | keep — canonical | |
| 61 | | `crates/skills/src/roots.rs` (`~/.deepseek/skills`) | no — compatible-root enumeration | Keep read-only harness discovery; this is not an owned write target. | |
| 62 | | `crates/engine/src/prompts.rs` (`LEGACY_HANDOFF_RELATIVE_PATH = ".deepseek/handoff.md"`) | no — explicit legacy const | keep — explicit legacy handoff fallback | |
| 63 | | `crates/runtime/src/workspace_trust.rs` | no — hardcoded | keep-as-fallback; follow-up | |
| 64 | | `crates/engine/src/session_manager.rs` | no — hardcoded | keep-as-fallback; follow-up | |
| 65 | | `crates/runtime/src/skill_state.rs` | no — hardcoded | keep-as-fallback; follow-up | |
| 66 | | `crates/engine/src/tools/skill.rs` | no — hardcoded | keep-as-fallback; follow-up | |
| 67 | | `crates/snapshot/src/lib.rs` | no — hardcoded | keep-as-fallback; follow-up | |
| 68 | | `crates/runtime/src/workspace_discovery.rs` | no — hardcoded | keep-as-fallback; follow-up | |
| 69 | |
| 70 | ## Follow-up source changes |
| 71 | |
| 72 | The table retains the original audit with moved owners corrected. Verify each |
| 73 | current caller before changing it. Reuse its existing issue and resolver; |
| 74 | preserve explicit-home isolation, read fallback, ownership and recovery. |
| 75 | Use existing focused checks. This document does not authorize moving or |
| 76 | deleting another harness's roots. |
| 77 |