docs(core): note improvise-core layout in repo-map

Reflect Phase B of improvise-36h: `model/`, `view/`, `workbook.rs`, and
`format.rs` now live in the `improvise-core` sub-crate under `crates/`.

- Sub-crate list expanded to describe improvise-core's scope, its
  dependency on improvise-formula, and the standalone-build guarantee.
- File Inventory reorganized into a single "Core crate layers" block
  covering model/view/workbook/format, with paths rooted at
  `crates/improvise-core/src/`.
- Updated line/test counts to match current contents (Phase A + merge
  with main brought in records mode, IndexMap-backed DataStore, etc).

No architectural change; the main crate's re-exports keep every
`crate::model`/`crate::view`/`crate::workbook`/`crate::format` path
resolving unchanged, so no "How to Find Things" table edits are needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Edward Langley
2026-04-15 22:33:45 -07:00
parent fc9d9cb52a
commit 79f78c496e

View File

@ -2,8 +2,9 @@
Terminal pivot-table modeling app. Rust, Ratatui TUI, command/effect architecture. Terminal pivot-table modeling app. Rust, Ratatui TUI, command/effect architecture.
Cargo workspace, Apache-2.0, edition 2024. Root package `improvise` v0.1.0-rc2. Cargo workspace, Apache-2.0, edition 2024. Root package `improvise` v0.1.0-rc2.
Library + binary crate: `src/lib.rs` exports public modules, `src/main.rs` is the CLI entry. Library + binary crate: `src/lib.rs` re-exports public modules (many from sub-crates), `src/main.rs` is the CLI entry.
Sub-crates live under `crates/`: Sub-crates live under `crates/`:
- `crates/improvise-core/` — pure-data core: `Model`, `View`, `Workbook`, and number formatting. Depends on `improvise-formula`. Re-exported from the main crate so `crate::model`, `crate::view`, `crate::workbook`, `crate::format` still resolve everywhere. Has no awareness of UI, I/O, or commands — builds standalone via `cargo build -p improvise-core`.
- `crates/improvise-formula/` — formula parser, AST (`Expr`, `BinOp`, `AggFunc`, `Formula`, `Filter`), `parse_formula`. Re-exported as `crate::formula` from the main crate via `pub use improvise_formula as formula;`. - `crates/improvise-formula/` — formula parser, AST (`Expr`, `BinOp`, `AggFunc`, `Formula`, `Filter`), `parse_formula`. Re-exported as `crate::formula` from the main crate via `pub use improvise_formula as formula;`.
--- ---
@ -376,30 +377,44 @@ Import flags: `--category`, `--measure`, `--time`, `--skip`, `--extract`, `--axi
Lines / tests / path — grouped by layer. Lines / tests / path — grouped by layer.
### Model layer ### Core crate layers (sub-crate `improvise-core` under `crates/`)
All of `model/`, `view/`, `workbook.rs`, `format.rs` now live under
`crates/improvise-core/src/`. Paths below are relative to that root.
The main crate re-exports each as `crate::model`, `crate::view`,
`crate::workbook`, `crate::format` via `src/lib.rs`, so every
consumer path stays unchanged.
#### Model layer
``` ```
1692 / 66t model/types.rs Model struct, formula eval, CRUD, MAX_CATEGORIES=12 2062 / 70t model/types.rs Model struct, formula eval, CRUD, MAX_CATEGORIES=12
621 / 28t model/cell.rs CellKey (canonical sort), CellValue, DataStore (interned) 650 / 28t model/cell.rs CellKey (canonical sort), CellValue, DataStore (interned, sort_by_key)
216 / 6t model/category.rs Category, Item, Group, CategoryKind 222 / 6t model/category.rs Category, Item, Group, CategoryKind
79 / 3t model/symbol.rs Symbol interning (SymbolTable) 79 / 3t model/symbol.rs Symbol interning (SymbolTable)
6 / 0t model/mod.rs 6 / 0t model/mod.rs
``` ```
### Formula layer (sub-crate `improvise-formula` under `crates/`) #### View layer
``` ```
776 / 35t crates/improvise-formula/src/parser.rs Recursive descent parser → Formula AST 1140 / 24t view/layout.rs GridLayout (pure fn of Model+View), records mode, drill
77 / 0t crates/improvise-formula/src/ast.rs Expr, BinOp, AggFunc, Formula, Filter (data only) 531 / 28t view/types.rs View config (axes, pages, hidden, collapsed, format), none_cats()
5 / 0t crates/improvise-formula/src/lib.rs
```
### View layer
```
1013 / 23t view/layout.rs GridLayout (pure fn of Model+View), records mode, drill
521 / 28t view/types.rs View config (axes, pages, hidden, collapsed, format)
21 / 0t view/axis.rs Axis enum {Row, Column, Page, None} 21 / 0t view/axis.rs Axis enum {Row, Column, Page, None}
7 / 0t view/mod.rs 7 / 0t view/mod.rs
``` ```
#### Workbook + format (top-level in improvise-core)
```
259 / 11t workbook.rs Workbook wraps Model + views; cross-slice category/view ops
229 / 29t format.rs format_f64, parse_number_format (display-only rounding)
12 / 0t lib.rs Module declarations + `pub use improvise_formula as formula;`
```
### Formula layer (sub-crate `improvise-formula` under `crates/`)
```
776 / 65t crates/improvise-formula/src/parser.rs PEG parser (pest) → Formula AST
77 / 0t crates/improvise-formula/src/ast.rs Expr, BinOp, AggFunc, Formula, Filter (data only)
5 / 0t crates/improvise-formula/src/lib.rs
```
### Command layer ### Command layer
``` ```
command/cmd/ Cmd trait, CmdContext, CmdRegistry, 40+ commands command/cmd/ Cmd trait, CmdContext, CmdRegistry, 40+ commands