Skip to content

Architecture Overview en

EnerOS Bot edited this page Jul 5, 2026 · 1 revision

中文 | English

Architecture Overview

Maintained version: v0.51.2 | Last updated: 2026-07-06

EnerOS uses a dual-execution-domain + 11-layer architecture (L0 foundation → L3 application). This page is a summary; full details in main repo docs/developer-guide.md §1 and README.md §Architecture.

Dual Execution Domain

┌──────────────────────────────────────────────────────────────────┐
│                  General Domain (seconds~minutes)                │
│  Agent orchestration · AI inference · Powerflow · Optimization   │
│  Standard kernel fair scheduling                                  │
└──────────────────────────────────────────────────────────────────┘
                              │
                              │  SafetyGateway (7-stage pipeline)
                              │  Validated<Command> type-level seal
                              ▼
┌──────────────────────────────────────────────────────────────────┐
│                  Real-Time Domain (μs~ms, P99 < 1ms)             │
│  Protection · Switching · Fault isolation · Frequency regulation │
│  SCHED_FIFO priority preemption                                   │
└──────────────────────────────────────────────────────────────────┘

Core principle: the real-time domain cannot be blocked by the general domain; general→RT commands must pass SafetyGateway constraint validation + priority arbitration; on general-domain failure, RT domain automatically degrades to local protection logic.

11-Layer Architecture

┌──────────────────────────────────────────────────────────────────┐
│ L3 Application  eneros-api (HTTP/WS/CLI) · eneros-dashboard       │
├──────────────────────────────────────────────────────────────────┤
│ L3 Orchestration  eneros-agent (7 domain Agents + orchestration)  │
│                   eneros-gateway (7-stage pipeline + SafetyGW)    │
├──────────────────────────────────────────────────────────────────┤
│ L2 Capability  eneros-reasoning · eneros-tool · eneros-memory     │
│                 eneros-scada · eneros-device · eneros-constraint  │
│                 eneros-analysis · eneros-network · eneros-bridge  │
│                 eneros-plugin · eneros-simulator                  │
├──────────────────────────────────────────────────────────────────┤
│ L1 Kernel  eneros-os (agentos/ha/init/security/syslog/timesync    │
│            /update/devmgr/hal/rt) · eneros-eventbus               │
├──────────────────────────────────────────────────────────────────┤
│ L0 Foundation  eneros-core · eneros-topology · eneros-linalg      │
│                eneros-powerflow · eneros-equipment · eneros-cnpower│
│                eneros-timeseries                                  │
└──────────────────────────────────────────────────────────────────┘
Layer Responsibility Representative crates
L0 Foundation Domain types, linear algebra, powerflow, topology, device models, CN power params, timeseries eneros-core, eneros-linalg, eneros-powerflow, eneros-topology, eneros-equipment, eneros-cnpower, eneros-timeseries
L1 Kernel OS kernel capabilities (Agent scheduling, HA, security, time sync, OTA, device mgmt, HAL) eneros-os, eneros-eventbus
L2 Capability Domain capabilities (reasoning, tools, memory, SCADA, protocols, constraints, analysis, network, bridge, plugins, simulation) eneros-reasoning, eneros-tool, eneros-memory, eneros-scada, eneros-device, eneros-constraint, eneros-analysis, eneros-network, eneros-bridge, eneros-plugin, eneros-simulator
L3 Orchestration Agent orchestration + safety gateway eneros-agent, eneros-gateway
L3 Application External interfaces (HTTP API, Dashboard) eneros-api, eneros-dashboard

Five Key Architecture Principles

  1. Unidirectional dependencies — L0 → L3, no reverse or circular dependencies
  2. Constraint as Kernel Law — Safety constraints enforced by kernel, cannot be bypassed
  3. Dual Execution Domain — General domain + real-time domain isolation
  4. Type-Level SafetyValidated<Command> newtype + clippy::disallowed_types
  5. Open & Interoperable — 11 protocols native, plugin marketplace

Key ADRs

ADR Decision
ADR-0002 Power-Native AgentOS positioning
ADR-0003 Plugin process isolation
ADR-0009 Multi-region HA
ADR-0015 RT type-level safety

See ADRs for the full index of 19 ADRs.

Related Docs

Clone this wiki locally