Skip to content

πŸ”§ [P1] Split lib.rs god module into subsystem modulesΒ #130

Closed

Description

@ajianaz

Problem

Uteke struct in crates/uteke-core/src/lib.rs (783 lines) implements 20+ methods spanning memory CRUD, health ops, data management, aging, and statistics. God module β€” no internal decomposition.

Mutex patterns duplicated 9+ times: .lock().map_err(|_| Error::Database(...)) β€” swallows original panic context.

Proposed Structure

crates/uteke-core/src/
β”œβ”€β”€ lib.rs          # Public API re-exports + Uteke facade (thin, <200 lines)
β”œβ”€β”€ ops/
β”‚   β”œβ”€β”€ recall.rs   # recall, search, tag filtering + scoring
β”‚   β”œβ”€β”€ crud.rs     # remember, forget, get, update
β”‚   β”œβ”€β”€ health.rs   # doctor, verify, repair
β”‚   β”œβ”€β”€ transfer.rs # export, import, consolidate
β”‚   └── aging.rs    # aging_status, aging_cleanup
└── error.rs        # Centralized error types + Mutex helper

Acceptance Criteria

  • lib.rs reduced to <200 lines
  • No module exceeds 400 lines
  • Mutex helper extracted (single impl)
  • Public API unchanged (non-breaking)
  • All tests pass

Effort: ~2 days

Activity

  1. added a commit that references this issue on Jun 4, 2026
    a2c6cd3
  2. added a commit that references this issue on Jul 2, 2026
    89fc139
  3. added 2 commits that reference this issue on Aug 13, 2026
    0636431
    11af27b
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

    scope:core

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions