Skip to content

[PLAN] workspace layering: modular structure inside the three published crates #752

Closed

Description

@ajianaz

STATUS: APPROVED (2026-11-14), module version. Owner decision: the published crates stay exactly as today (tole-core, tole-tui, tole-cli); the goal is a tidier, more modular structure inside them so nothing is too big. Layering is a convention checked by a test, not by crate boundaries.

Owner decision (2026-11-14)

  • No new published crates; publish.yml, release.yml and the crates.io names do not change.
  • Reorganise tole-core (about 51k lines, ~80 flat files) and tole-cli (about 52k lines) into subsystem directories (modules), by pure moves.
  • Layering is one-way and enforced by a test that scans use crate:: edges (levels: kernel, engines, faces); existing violations are recorded in an allow list, not silently fixed.
  • Public paths do not change: every moved module stays reachable through pub use at its old path.
  • Not a compile-time win (one crate is one compile unit); real crate splits stay a future option if compile time or embedder size requires it, and the module boundaries make that cheap.

Rules

  • One subsystem per PR, pure moves (git mv plus pub use), each PR small enough for Cora; the PR with new logic (the layering test) is separate and small.
  • Each PR keeps: same number of tests, cargo test --workspace green, cargo check -p tole-core --no-default-features green, the OS Check jobs green, no change in the public API (cargo public-api diff empty), tole --version and a smoke of run, discuss and serve unchanged.
  • Do not move files that an open PR is changing (delegation files wait for design: an owner approval surface for delegated children (durable queue, parked and resumed) #714 PR 5 and 6).

Work order

  1. PR 0: the layering test with a baseline allow list.
  2. discussion/ in tole-core (discussion.rs, discussion_log.rs and tests; imports only secrets, paths, delegation_report, skill_draft).
  3. secrets/ (with sensitive).
  4. delegation/ (after design: an owner approval surface for delegated children (durable queue, parked and resumed) #714 PR 5 and 6).
  5. web/, mcp/, storage/.
  6. tole-cli: discuss/, serve/, delegation/, plugin/.

Testing (per PR)

  • cargo test --workspace green; test count unchanged
  • cargo check -p tole-core --no-default-features green
  • public API unchanged (cargo public-api diff or an equivalent check)
  • layering test green with a baseline that only shrinks
  • build time not higher than before

Activity

  1. changed the title [-][PLAN] workspace layering: modular-monolith crate structure (crastu-style)[/-] [+][PLAN] workspace layering: modular structure inside the three published crates[/+] on Nov 14, 2026
  2. added 20 commits that reference this issue on Nov 14, 2026
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions