Files
CodeWhale Bot e34f207d21 refactor(engine): extract the shared runtime from the TUI [skip ci]
Move the Engine band, extension host, fixtures and shared test support into
codewhale-engine; wire TUI/CLI to that owner. Preserve human-decision
construction boundaries and lower reusable test helpers. Remove unused
copied dependencies and repair path-based guards, scripts and crate maps.

Correct the blocking scanner external-module scope leak; raised counts equal
the corrected pre-move source. Refresh embedded built-in hashes after path-only
bundle regeneration. Restore the provider-free prompt budget to the exact
pre-b984e31290 macOS bytes and representative identities; tool catalogs are
unchanged. Portable prompt-fixture pinning remains follow-up work.

Local validation: Engine/TUI/CLI clippy --tests --no-deps -D warnings passed
with the existing allow-list; production CLI check passed; fmt passed.
Focused native run: 705 passed / 83 failed initially; after hash/path repairs,
81 affected cases plus 2 existing build-relocation cases passed (83/83).
Thus 786/788 original cases pass; 2 compiled-release-image cases lack input
and are not qualified. Frozen input inventories unchanged. macOS test-link
unwind-table warnings remain. Four metric tests pass; all 55 budgets pass.
Host Node: 413 pass, 7 skip; Bun: 414 pass, 6 skip. Existing scanner checks:
34 + 33 pass. Compiled-delivery synthetic fixtures: 7 pass. Web: 42 pass.
Import, blocking, dead-code, coarse-map, version and facts checks pass.

CW-7701. No hosted CI, provider call, release build or publication.
Stage A part 2 and the old App Server/ratatui dependencies remain separate.
2026-10-31 18:55:14 -07:00

5.4 KiB

Legacy .deepseek/ compatibility paths — audit & migration status (#3068)

阅读简体中文版:zh_hans/LEGACY_PATHS.md。

v0.9.10 cleanse ledger

This is the release-window decision record for residue that can otherwise look interchangeable in a text search. A compatibility entry must name the contract that still requires it; new production code must use a current path.

Class Surface Decision / contract
DELETE Retired underwater build-version test override Removed in 1cc4d1d1b; the owner test was already deleted and the production-only build version remains authoritative.
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.
MIGRATE TUI status_message writes Active residue; touched flows must move to the typed toast/current-state owner. No new writes are allowed.
COMPATIBILITY .deepseek/ state and stored provider aliases Read fallback for upgraded installations and stored provider identity; writes remain Codewhale-only. Details are below.
COMPATIBILITY agent_message transcript/protocol decoding Persisted transcripts and tool wire values require decoding; it is not the cross-task Agent Mail transport.
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.
CURRENT DeepSeek provider support A real selectable provider, not product branding; provider-scoped names and configuration remain.
CURRENT Same-session subagent mailbox Start/status/peek/message/followup/interrupt/wait/cancel stays scoped to a parent runtime session.
CURRENT Web locale dictionaries The application and documentation routes have no page-local isZh branches; new copy continues through dictionaries.
CURRENT Safety, authorization, protocol, persistence, migration, and data-integrity tests These protect external or durable contracts and are not copy/layout cleanup candidates.

Snapshot on 2026-08-19: 10,954 Rust #[test] attributes under crates/tui, 523 TUI status_message source lines, and zero page-local isZh files under apps/web/app in the paired managed-app candidate. Counts are inventory signals, not deletion targets.

Codewhale was renamed from DeepSeek-TUI. To avoid breaking existing installs, the runtime reads state from the new ~/.codewhale/ location but falls back to the legacy ~/.deepseek/ location, and always writes to ~/.codewhale/. This doc audits each legacy reference and records a keep / deprecate / remove decision so the migration is auditable.

The canonical resolver (use this for new code)

State-dir APIs are exported by codewhale-config; their implementation is crates/config/src/state_dirs.rs, with root selection in crates/paths/src/lib.rs. The paths in this audit show defaults. CODEWHALE_HOME selects the primary home and prevents fallback outside that root.

Symbol Purpose
CODEWHALE_APP_DIR / LEGACY_APP_DIR Default directory names from codewhale-paths.
codewhale_home() Selected primary home, defaulting to ~/.codewhale.
legacy_deepseek_home() Selected legacy home, defaulting to ~/.deepseek.
resolve_state_dir(subdir) Read the primary directory; fall back only if it is absent and no explicit primary home was selected.
ensure_state_dir(subdir) Write under the primary home; guarded migration can relocate owned legacy state and reports what moved.

Compatible harness roots are read-only discovery inputs, not owned migration or deletion targets.

Per-path decisions

Decision for all legacy references below: keep-as-fallback. Removing the .deepseek fallback would strand users who upgraded in place and never re-ran onboarding. Revisit only after a release that actively migrates ~/.deepseek/ → ~/.codewhale/ on first run and a deprecation window.

Reference Routed through resolve_state_dir? Decision
config::resolve_state_dir / ensure_state_dir n/a (the resolver itself) keep — canonical
crates/skills/src/roots.rs (~/.deepseek/skills) no — compatible-root enumeration Keep read-only harness discovery; this is not an owned write target.
crates/engine/src/prompts.rs (LEGACY_HANDOFF_RELATIVE_PATH = ".deepseek/handoff.md") no — explicit legacy const keep — explicit legacy handoff fallback
crates/tui/src/workspace_trust.rs no — hardcoded keep-as-fallback; follow-up
crates/engine/src/session_manager.rs no — hardcoded keep-as-fallback; follow-up
crates/runtime/src/skill_state.rs no — hardcoded keep-as-fallback; follow-up
crates/engine/src/tools/skill.rs no — hardcoded keep-as-fallback; follow-up
crates/snapshot/src/lib.rs no — hardcoded keep-as-fallback; follow-up
crates/runtime/src/workspace_discovery.rs no — hardcoded keep-as-fallback; follow-up

Follow-up source changes

The table retains the original audit with moved owners corrected. Verify each current caller before changing it. Reuse its existing issue and resolver; preserve explicit-home isolation, read fallback, ownership and recovery. Use existing focused checks. This document does not authorize moving or deleting another harness's roots.