Architecture & Platform Overview¶
SmrtHub combines supervised .NET desktop services with a Python automation fabric. This page sketches the major layers, processes, and data flows so new engineers can form a mental model before diving into component-level docs.
Platform Goals¶
- Hybrid runtime: .NET handles Windows-first UI, supervision, and packaging while Python delivers rapid automation features.
- Deterministic operations: Every binary is supervised, every path is policy-driven, and every log follows the same schema.
- Extensible surface: Components can be added without rewriting the host thanks to manifest-driven supervision and well-defined contracts.
High-Level Layout¶
graph TD
subgraph Desktop Shell (Win32/WinUI3)
HW[HubWindow]
TM[TriggerManager]
CM[ClipboardMonitor]
SP[SmrtHubSupervisor]
end
subgraph Automation Plane (Python)
PC[python_core]
DET[smrtdetect]
FLOW[flow_enhance]
NET[net \n (Flask bridge + web listener)]
end
HW -->|Commands| SP
TM -->|Triggers| SP
CM -->|Clipboard Events| SP
SP -->|Lifecycle| CAP
SP -->|Lifecycle| DOCS
SP <--> |IPC| PC
PC -->|Heartbeat| SP
NET -->|HTTP Bridge| HW
DET -->|Signals| PC
Runtime Responsibilities¶
| Layer | Key Responsibilities | Representative Projects |
|---|---|---|
| Supervisor Plane | Process orchestration, restart policy, Support Bundle integration | SmrtHubSupervisor, Smrt.SupportBundle |
| Experience Layer | Tray/UI, hotkeys, clipboard automation, configuration UX | HubWindow, TriggerManager, ClipboardMonitor, Smrt.UI |
| Automation Plane | Python automation services, heartbeat, machine learning helpers | python_core, smrtdetect, flow_enhance, net |
| Focused Services | notifications, infrastructure libraries | Smrt.Notifications |
| Shared Libraries | Logging, configuration, security & contracts | Smrt.Logging, Smrt.Config, Smrt.Security, Smrt.Contracts.Triggers |
Process Lifecycle¶
- Supervisor boots – reads component manifest, ensures operational directories exist, initializes
Smrt.Logging. - Python fabric starts – supervisor launches the Python bridge;
python_coreactivates heartbeat emitters and waits for orchestration commands. - Runtime apps launch – clipboard, and automation services start according to manifest priorities.
- Health feedback loop – heartbeat pulses flow back to the supervisor; degraded state triggers restart policies defined in the manifest.
- Support bundle & logging – unified logging sinks allow the operator to export a support bundle with a single command.
Data & Configuration Flow¶
- Operational Data: All config/state/logs follow the slugs defined in the Operational Data Policy.
- SmrtSpace: Acts as the canonical store for captured artifacts; both extraction and automation services write into the same folder hierarchy.
- Configuration APIs: C# components call into
Smrt.Configwhile Python usespython_core.utils.config_path_resolverto ensure parity. - Logging: Every process initializes
Smrt.Loggingorpython_core.utils.loggerwith the component slug so support bundles can join logs.
Extending SmrtHub¶
- Create a component README detailing the feature’s contract and dependencies.
- Add supervision metadata to the manifest with restart policy and health checks.
- Implement logging + config using the canonical libraries.
- Update navigation by tagging the new README so
GenerateComponentDocs.ps1mirrors it automatically. - Add docstrings (C# XML or Python docstrings) so the API reference reflects the public surface.
Related Reading¶
- Architecture Layering – deep dive into layering rules and allowed dependencies.
- SmrtSpec – strategic goals and design principles.
- Supervision Capability – end-to-end supervision flow.
- Supervision Subsystem – supervision contracts and invariants.
Ready to explore individual Components Hub or jump into SmrtHub Policies.