Skip to main content

kaptein_viewmodel/
lib.rs

1//! Kaptein view-model: the renderer-agnostic domain layer (the product).
2//!
3//! This crate owns all *semantics* — columns, sorting, filtering, status inference,
4//! permission decisions, and action graphs. The frontends (TUI, GUI, headless, serve)
5//! consume the render contract defined here and own only *geometry*.
6//!
7//! See ADR-0005 (`docs/adr/0005-render-intent-three-layers.md`) for the three-layer
8//! model this crate implements.
9
10#![forbid(unsafe_code)]
11
12pub mod audit;
13pub mod diff;
14pub mod error;
15pub mod fuzzy;
16pub mod logparse;
17pub mod render;
18pub mod semantic;
19pub mod sink;
20pub mod surface;
21
22pub use audit::{Actor, ActorKind, AuditEvent, Operation, Outcome, ResourceRef, Source};
23pub use diff::{DiffLine, UnifiedDiff, render_unified, unified_diff};
24pub use error::Error;
25pub use fuzzy::{FuzzyMatch, fuzzy_jump};
26pub use logparse::{LogCell, ParsedLogLine, infer_columns, parse_json_line, parse_log_stream};
27pub use render::{
28    Cell, DataPlane, Filter, Page, Query, Revision, Row, RowId, RowPatch, SortSpec, StatusLevel,
29};
30pub use semantic::{Action, ActionState, Status};
31pub use sink::{AuditConfig, AuditSink};
32pub use surface::{
33    Column, ColumnKind, EditorMode, Field, FieldKind, Projection, SupportLevel, Surface,
34    SurfaceKind, support_level,
35};
36
37#[cfg(test)]
38mod contract_tests;