BREAKING CHANGE: Repository restructured from flat layout to tiered: FOLDER REORGANIZATION: - core/ - L0-L3 layers (Commonwealth LCL-1.0) - l0-transport/ - Transport with MIMIC, Noise, PNG - l1-identity/ - Identity, QVL, Crypto - l2_session/ - Session management - l2-federation/ - Cross-chain bridging - l2-membrane/ - Policy enforcement - sdk/ - L4+ and bindings (Sovereign LSL-1.0) - janus-sdk/ - l4-feed/ - apps/ - Examples (Unbound LUL-1.0) - examples/ - legal/ - All license texts - LICENSE_COMMONWEALTH.md - LICENSE_SOVEREIGN.md - LICENSE_UNBOUND.md IMPORT FIXES (All Layers): - L0: 13 files fixed - all relative imports corrected - L1: 14 files fixed - module imports for cross-layer dependencies - L2: 6 files fixed - session, membrane, federation - Capsule: 9 files fixed - TUI, node, main, control - Examples: 2 files fixed - lwf, crypto LICENSES ADDED: - LCL-1.0: Viral reciprocity for Core (SaaS-proof) - LSL-1.0: Business-friendly for SDK - LUL-1.0: Maximum freedom for docs/apps NO CLA REQUIRED - contributors keep copyright README.md REWRITTEN: - Documents new folder structure - Explains tiered licensing strategy - Clear SPDX identifiers per component TODO: - Fix remaining test module configuration issues - Full green build in follow-up Refs: 4 sub-agents parallel execution |
||
|---|---|---|
| .. | ||
| README.md | ||
| app.zig | ||
| client.zig | ||
| view.zig | ||
README.md
Capsule TUI & Control Protocol Documentation
Overview
The Capsule TUI Monitor (The "Luxury Deck") provides a real-time visualization of the node's internal state, network topology, and security events. It communicates with the Capsule daemon via a Unix Domain Socket using a custom JSON-based control protocol.
Architecture
1. Control Protocol (control.zig)
A unified command/response schema shared between the daemon and any management client.
- Commands:
Status,Peers,Sessions,Topology,SlashLog,Shutdown,Lockdown,Unlock. - Responses: Tagged unions containing specific telemetry data.
2. TUI Engine (tui/)
app.zig: Orchestrates the Vaxis event loop. Spawns a dedicated background thread for non-blocking I/O with the daemon.client.zig: Implements the IPC client with mandatory deep-copying and explicit memory management to ensure a zero-leak footprint.view.zig: Renders the stateful UI components:- Dashboard: Core node stats (ID, Version, State, Uptime).
- Slash Log: Real-time list of network security interventions.
- Trust Graph: Circular topology visualization using f64 polar coordinates mapped to terminal cells.
Memory Governance
In accordance with high-stakes SysOps standards:
- Zero-Leak Polling: Every data refresh explicitly frees the previously "duped" strings and slices.
- Thread Safety:
AppStateuses an internal Mutex to synchronize the rendering path with the background polling path. - Unmanaged Design: Alignment with Zig 0.15.2 architecture by using explicit allocators for all dynamic structures.
Usage
- Daemon: Start the node using
./zig-out/bin/capsule start. - Monitor: Connect the monitor using
./zig-out/bin/capsule monitor. - Navigation:
Tab: Cycle between Dashboard, Slash Log, and Trust Graph.Ctrl+CorQ: Exit monitor.
Current Technical Debt
- Implement
uptime_secondstracking innode.zig. - Implement
dht_node_idextraction for IdentityInfo. - Add interactive node inspection in the Trust Graph view.