Skip to content

Architecture

Andrew Paolucci edited this page Dec 2, 2026 · 4 revisions

Workspace Architecture (guap-kit)

guap-kit is structured as a clean 5-crate Cargo workspace (edition = "2024", MSRV 1.89, resolver 2), referenced as sibling workspace dependencies across the downstream *2rust suites and verified end-to-end by guap-e2e.

flowchart LR
    TABLE["guap-table<br/>TableProvider, ColumnDef, Row, CellValue,<br/>GuapQuery, TableTextCompare, SuiteWorkbenchHost"]
    EXPORT["guap-export<br/>7-Format Serializer, Formula Sanitizer,<br/>CSP HTML, CustodyManifest (SHA-256/512)"]
    WIN32["guap-gui-win32<br/>Win32GridState + Virtual LVS_OWNERDATA Host<br/>(5-Zone Cockpit, DWM Dark Mode, Hex Pane)"]
    ICED["guap-gui-iced<br/>Iced 0.14 IcedDataGrid, 5-Zone Cockpit,<br/>Detail JSON & Hex Inspector"]
    MCP["guap-mcp<br/>JSON-RPC 2.0 stdio (2024-11-05 + guap/rollback)<br/>PolicyGate, schema::validate_against_schema, RollbackStore"]

    EXPORT --> TABLE
    WIN32 --> TABLE
    WIN32 --> EXPORT
    ICED --> TABLE
    ICED --> EXPORT
    MCP --> TABLE
    MCP --> EXPORT
Loading

Crate Summary & unsafe_code Boundary

Four of the five crates enforce #![forbid(unsafe_code)] at crate root, isolating Windows FFI exclusively inside guap-gui-win32 (when its default native-host feature is enabled):

Crate Policy Primary Responsibilities
guap-table #![forbid(unsafe_code)] Normalized tabular schema, CellValue variants, GuapQuery AST parser/evaluator, sorting, pagination, TableTextCompare, and guap_table::shell (GuapShellState, SuiteWorkbenchHost).
guap-export #![forbid(unsafe_code)] RFC-4180 CSV/TSV (formula-neutralized), JSON/JSONL, air-gapped CSP HTML / HTML-vertical, pipe-escaped Markdown, and binary Merkle CustodyManifest (RFC 6962 v2).
guap-gui-iced #![forbid(unsafe_code)] Pure-Rust cross-platform iced 0.14 (wgpu + tiny-skia) IcedDataGrid widget, 5-zone cockpit (ApproveCard / UndoExecutedCard), filter bar, sortable headers, and detail JSON / hex dump panes.
guap-mcp #![forbid(unsafe_code)] Standalone JSON-RPC 2.0 stdio MCP server loop (initialize, ping, notifications/initialized, tools/list, tools/call, guap/rollback), PolicyGate, schema::validate_against_schema, and RollbackSnapshot / RollbackStore.
guap-gui-win32 Headless state safe; FFI gated behind native-host Reusable Win32GridState (--no-default-features) + winsafe native SysListView32 (LVS_OWNERDATA / LVN_GETDISPINFO) host and 5-zone cockpit (ApproveCard / UndoExecutedCard).