| 1 | # Legacy `.deepseek/` compatibility paths — audit & migration status (#3068) |
| 2 | |
| 3 | Codewhale was renamed from DeepSeek-TUI. To avoid breaking existing installs, the runtime reads |
| 4 | state from the new `~/.codewhale/` location but **falls back** to the legacy `~/.deepseek/` location, |
| 5 | and always **writes** to `~/.codewhale/`. This doc audits each legacy reference and records a |
| 6 | keep / deprecate / remove decision so the migration is auditable. |
| 7 | |
| 8 | ## The canonical resolver (use this for new code) |
| 9 | |
| 10 | State-dir resolution is consolidated in `crates/config/src/lib.rs`: |
| 11 | |
| 12 | | Symbol | Line | Purpose | |
| 13 | |---|---|---| |
| 14 | | `CODEWHALE_APP_DIR = ".codewhale"` | 3428 | canonical app dir | |
| 15 | | `LEGACY_APP_DIR = ".deepseek"` | 3431 | legacy app dir (fallback only) | |
| 16 | | `codewhale_home()` | 3437 | `~/.codewhale` | |
| 17 | | `legacy_deepseek_home()` | 3451 | `~/.deepseek` (legacy) | |
| 18 | | `resolve_state_dir(subdir)` | 3469 | **read** path: `~/.codewhale/<subdir>`, falling back to `~/.deepseek/<subdir>` when only the legacy dir exists | |
| 19 | | `ensure_state_dir(subdir)` | 3484 | **write** path: always creates under `~/.codewhale/<subdir>` | |
| 20 | |
| 21 | Migration contract: read-with-fallback, write-to-new. This preserves the v0.8.44 migration for |
| 22 | users who still have `~/.deepseek/` while steering all new writes to `~/.codewhale/`. |
| 23 | |
| 24 | ## Per-path decisions |
| 25 | |
| 26 | **Decision for all legacy references below: keep-as-fallback.** Removing the `.deepseek` fallback |
| 27 | would strand users who upgraded in place and never re-ran onboarding. Revisit only after a release |
| 28 | that actively migrates `~/.deepseek/` → `~/.codewhale/` on first run and a deprecation window. |
| 29 | |
| 30 | | Reference | Routed through `resolve_state_dir`? | Decision | |
| 31 | |---|---|---| |
| 32 | | `config::resolve_state_dir` / `ensure_state_dir` | n/a (the resolver itself) | keep — canonical | |
| 33 | | `crates/tui/src/skills/mod.rs` (`~/.deepseek/skills`) | no — hardcoded | keep-as-fallback; route through resolver in a follow-up refactor | |
| 34 | | `crates/tui/src/prompts.rs` (`LEGACY_HANDOFF_RELATIVE_PATH = ".deepseek/handoff.md"`) | no — explicit legacy const | keep — explicit legacy handoff fallback | |
| 35 | | `crates/tui/src/workspace_trust.rs` | no — hardcoded | keep-as-fallback; follow-up | |
| 36 | | `crates/tui/src/session_manager.rs` | no — hardcoded | keep-as-fallback; follow-up | |
| 37 | | `crates/tui/src/skill_state.rs` | no — hardcoded | keep-as-fallback; follow-up | |
| 38 | | `crates/tui/src/tools/skill.rs` | no — hardcoded | keep-as-fallback; follow-up | |
| 39 | | `crates/tui/src/snapshot/mod.rs` | no — hardcoded | keep-as-fallback; follow-up | |
| 40 | | `crates/tui/src/workspace_discovery.rs` | no — hardcoded | keep-as-fallback; follow-up | |
| 41 | |
| 42 | ## Follow-up (separate, non-doc change — out of scope for #3068) |
| 43 | |
| 44 | The optional consolidation the issue mentions — routing the hardcoded sites above through |
| 45 | `resolve_state_dir`/`ensure_state_dir` instead of joining `.deepseek`/`.codewhale` by hand — is a |
| 46 | small refactor that should land as its own PR with tests asserting read-fallback + write-to-new for |
| 47 | each migrated site. It is intentionally kept out of this audit so the documentation can land safely |
| 48 | on its own. |
| 49 |