Skip to content

refactor: split auditui into auditui-core + auditui workspace#20

Merged
rollysys merged 1 commit into
mainfrom
refactor/workspace
Apr 22, 2026
Merged

refactor: split auditui into auditui-core + auditui workspace#20
rollysys merged 1 commit into
mainfrom
refactor/workspace

Conversation

@rollysys

@rollysys rollysys commented Apr 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Split the single-crate auditui into a Cargo workspace with auditui-core (lib) + auditui (bin), so future frontends (e.g. the planned web launcher) can depend on the same transcript/session/cost/dashboard code without duplicating parsers.
  • All moves are git mv renames (100% similarity — no content diff). The only non-rename change is 9 lines in tui/src/main.rs where mod X; declarations become pub use auditui_core::{X};, which keeps crate::session::… references inside tui.rs resolving so business code is untouched.
  • Makefile / deploy-xserver.sh untouched: workspace-root cargo build --release still produces target/release/auditui at the same path.

Layout

auditit-tui/
├── Cargo.toml        # workspace root, members = ["core", "tui"]
├── core/             # auditui-core (lib): providers, session, cache,
│                     #   cost, dashboard, memory, skills
└── tui/              # auditui (bin): main, tui, md, update

Test plan

  • cargo build --release green at workspace root
  • ./target/release/auditui --dry-run → indexes 10502 sessions (CLA/COD/HER/QWN breakdown unchanged)
  • ./target/release/auditui --memory-dump → global + 21 projects listed
  • ./target/release/auditui --group-dump → 213 groups from 10502 sessions
  • ./target/release/auditui --bench → cold 210ms, warm 9ms (in the same range as before the split)
  • Interactive TUI smoke: all four tabs, search, session detail, dashboard range switching, memory + skills markdown rendering

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chore
    • Restructured internal codebase from a single package to a modular workspace architecture with a shared library and application layer, improving maintainability and code organization.

Phase 0 of adding a future web launcher UI: the transcript/session/cost
logic now lives in a shared `auditui-core` library crate so multiple
frontends can depend on it without duplicating parsers.

Layout:
  auditit-tui/
  ├── Cargo.toml     # workspace root
  ├── core/          # auditui-core lib (providers, session, cache,
  │                  #   cost, dashboard, memory, skills)
  └── tui/           # auditui bin (TUI-only: main, tui, md, update)

No behavior changes:
- All files moved with `git mv` (git shows renames, zero content diff)
- tui/src/main.rs replaces its `mod X;` declarations with
  `pub use auditui_core::{X};` so `crate::session::…` references
  inside `tui.rs` keep resolving — no edits to business code.
- `cargo build --release` + `--dry-run` / `--memory-dump` /
  `--group-dump` smoke pass (10495 sessions indexed as before).
- Makefile / deploy-xserver.sh untouched — `cargo build --release`
  at workspace root still produces `target/release/auditui`.

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Apr 22, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6cde5fda-f2a5-4b7c-8626-cf981f30dce0

📥 Commits

Reviewing files that changed from the base of the PR and between b3bb3a9 and c5b513d.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (20)
  • CLAUDE.md
  • Cargo.toml
  • core/Cargo.toml
  • core/src/cache.rs
  • core/src/cost.rs
  • core/src/dashboard.rs
  • core/src/lib.rs
  • core/src/memory.rs
  • core/src/providers/claude.rs
  • core/src/providers/codex.rs
  • core/src/providers/hermes.rs
  • core/src/providers/mod.rs
  • core/src/providers/qwen.rs
  • core/src/session.rs
  • core/src/skills.rs
  • tui/Cargo.toml
  • tui/src/main.rs
  • tui/src/md.rs
  • tui/src/tui.rs
  • tui/src/update.rs

📝 Walkthrough

Walkthrough

Repository converted from a single-crate Rust TUI into a Cargo workspace with two crates: auditui-core (library) containing data-layer and shared logic, and tui (binary) containing TUI entry points and UI-specific code; root manifest changed to a workspace manifest and documentation updated.

Changes

Cohort / File(s) Summary
Workspace Manifest & Root
Cargo.toml
Root manifest converted to a workspace ([workspace] resolver = "2") and package metadata moved into [workspace.package]; crate-level package fields and bin target removed.
Core crate manifest
core/Cargo.toml
New library crate auditui-core added with dependencies for serde, chrono, walkdir, rayon, rusqlite (bundled), etc.
Core library exports
core/src/lib.rs
New public module declarations added: cache, cost, dashboard, memory, providers, session, skills.
TUI crate manifest
tui/Cargo.toml
New binary crate auditui added, referencing workspace metadata and depending on auditui-core; UI-specific deps declared (tui rendering, markdown, reqwest, etc.).
TUI entry / re-exports
tui/src/main.rs
Replaced local mod declarations with public re-exports from auditui_core (pub use auditui_core::{cache, cost, dashboard, memory, providers, session, skills};).
Documentation update
CLAUDE.md
Architecture doc updated to describe workspace layout: core/ for shared logic (transcript parsing, session normalization, cache, dashboard, pricing), tui/ for TUI entry, markdown rendering, and tui/src/update.rs self-update checks.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 I hopped from one crate to two,

Core seeds planted, TUI grew.
Workspace paths now split and neat,
Shared logic down the middle street.
A joyful jig — new builds to chew!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/workspace

Comment @coderabbitai help to get the list of available commands and usage tips.

@rollysys
rollysys merged commit c4082f5 into main Apr 22, 2026
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants