Skip to content

Adopt "only place that does X" discipline — name module ownership, delete 79 lines of dead metrics #31

Description

@stanvx

Parent

Architecture review (2026-06-21). Slice 5 of 6 from the deepening series. Overlaps with Slice 1 (Reconcile docs to code) — Slice 1 establishes the section header; this slice executes the inventory of dead code and overlapping responsibilities that the new discipline will eliminate.

What to build

Walk the workspace and find every case where two or more modules claim the same responsibility. The architecture review names three:

  • Config: Server::app_state, api::load_config, and the CLI all merge config from different sources. Pick one.
  • Metrics: metrics.rs contains 79 lines of static counters that nothing increments. Delete the file, or wire it (one path).
  • Windows process spawn: windows/src/actions.rs and main.rs both spawn the server. Pick one.

For each, name the single owner in CONTEXT.md, delete the duplicates, and add a "// the only place that does X — see CONTEXT.md" comment at the new owner. Apply the same discipline to anything else the agent finds in the walk.

This is the slice where "many small files" pays off. A 200-line file with one responsibility is easier to police than a 2000-line god module.

Acceptance criteria

  • metrics.rs is either deleted or wired; either way the file is no longer dead
  • Exactly one module in the workspace reads and writes the merged server config; comment marks the site
  • Exactly one module in the windows crate spawns the server process; comment marks the site
  • CONTEXT.md "module ownership" section (introduced in Slice 1) is complete with one entry per resolved concern
  • Walk the workspace (grep -r '// TODO.*only place\|// NOTE.*owner' etc.) and surface any new overlapping responsibility found; record in CONTEXT.md
  • cargo test --workspace --release passes; cargo clippy --workspace -- -D warnings clean

Blocked by

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

    enhancementNew feature or requestready-for-agentTriage complete; ready for an agent to implement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions