Skip to content

v0.9.3 Refactor: converge runtime ownership, delete duplication, and ship one executable #3306

Description

@Hmbown

Why this is the v0.9.3 umbrella

Current main has 18 Rust packages and roughly 771k Rust lines, but about 87% remains inside codewhale-tui. The problem is not the crate count by itself: the TUI still owns parallel runtime, tool, config, session, hook, and control paths beside much smaller shared crates. v0.9.3 should make existing boundaries real, delete duplication, and measure the result.

Product goals

  • one durable runtime and event/control vocabulary;
  • one resolver for model, route, configuration, home, and secret-backend decisions;
  • one canonical tool contract and dispatch registry;
  • TUI, CLI, API, Fleet, and CWC as thin projections over owned runtime interfaces;
  • one required installed executable, after the entrypoints and runtime seam are ready;
  • fewer publish units only where the ownership/dependency evidence supports folding a crate.

Sequence

0. Ownership and measurement

1. Correctness foundation

2. Deletion-friendly performance

3. Runtime convergence

Land in dependency order:

  1. Architecture D-2: unify ModelRegistry with RouteResolver #4166 — one route/model resolver.
  2. v0.9.3 architecture: reconcile codewhale-tools and TUI ToolRegistry systems #4174 — one tool contract and registry.
  3. Architecture D-3: merge JobManager and TaskManager #4167 — one durable background-work contract.
  4. v0.9.3 architecture D-1: consolidate TUI engine onto core Runtime #4165 — move TUI execution onto the canonical runtime.
  5. finish v0.9.3: define CLI/TUI parity for subagent and runtime control surfaces #4022 identity/control parity.

4. Structural decomposition

After ownership is settled:

Code-motion changes must not carry behavior changes. Prefer moving contiguous code with its tests, then deleting the old block.

5. Distribution convergence

6. Completion gate

Crate decision rule

Do not create or delete a crate to improve a count. For each small crate, choose one outcome with evidence:

  • canonical owner: all duplicate callers migrate behind it;
  • optional/heavy boundary: retain and keep out of default paths where possible;
  • release/build-only boundary: retain if it removes duplicated release logic;
  • fold: only after its consumers, compile impact, publication need, and compatibility surface are measured.

Acceptance

  • Every selected issue states what remains on current main and which duplicate tracker it supersedes.
  • Provider-free baselines capture clean/incremental build time, prompt/schema size, fanout latency, cancellation, RSS, and artifact size with exact SHA and repeated runs.
  • TUI executes through the canonical runtime rather than a parallel engine.
  • One registry owns tool identity, schema, capability metadata, and dispatch.
  • Cross-surface session identity and unsupported states are explicit.
  • Large-file extraction preserves byte-identical CLI/help and wire behavior.
  • A normal install needs one executable and the release matrix proves it on every platform.
  • The release removes more obsolete paths and blanket allowances than it adds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cleanupCode cleanup, refactor, or maintenance workenhancementNew feature or requestperformanceRuntime/render performancereliabilityReliability, flaky behavior, retries, fallbacks, and robustnessrustPull requests that update rust code

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions