Skip to content

V2: make tracedecay a real composition root #1073

Description

@ScriptedAlchemy

Context

PR #707 has extracted daemon, automation, store, host, protocol, and runtime concerns into dedicated crates, but the root crates/tracedecay crate still owns large amounts of product/runtime implementation.

Examples in crates/tracedecay/src/daemon/ include large modules such as automation_effect.rs, branch_admin.rs, broker_stream_transport.rs, bootstrap.rs, branch_add.rs, plus HTTP routing, LSP session management, remote query/protocol execution, shutdown orchestration, graph resolution, maintenance, and other runtime behavior.

At the same time the workspace already contains owners such as:

  • tracedecay-daemon-service
  • tracedecay-daemon-protocol
  • tracedecay-daemon-control
  • tracedecay-automation-runtime
  • tracedecay-agent-hosts
  • tracedecay-store-runtime

The extraction is therefore incomplete: the new crates exist, but the root still acts as a large implementation crate rather than a composition root.

Goal

Reduce crates/tracedecay to process composition, dependency construction/registration, startup, package/binary concerns, and top-level shutdown.

Work

  • Move automation-effect implementation to tracedecay-automation-runtime.
  • Move broker/connection serving and daemon transport implementation to tracedecay-daemon-service / tracedecay-daemon-protocol as appropriate.
  • Move HTTP application transport implementation to the API/daemon-service transport owner.
  • Move LSP session integration to the LSP/daemon-service boundary.
  • Collapse root remote query/protocol implementations onto the canonical application remote service plus a thin transport adapter.
  • Review branch administration/addition code and move business behavior to the relevant application/use-case owner, leaving only daemon adaptation in daemon-service.
  • Continue this audit for every root daemon module: if it owns business/runtime behavior rather than composition, move it to the owning vertical crate.
  • Do not replace moved implementation with compatibility shims in root.

Acceptance criteria

  • crates/tracedecay owns composition and process lifecycle, not subsystem implementations.
  • Root daemon modules are thin wiring/adaptation rather than large business/runtime implementations.
  • No product behavior is duplicated between root and extracted crates.
  • Dependency graph stays acyclic without introducing a common/shared junk-drawer crate.
  • Full feat: TraceDecay V2 delivery (PR8–PR13) + daemon performance, memory, and reliability overhaul #707 journeys continue to pass.
  • Root LOC and root-owned public API decrease materially.

Related: #707.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions