Skip to main content

v0.43.0 Release Notes

Release Notes

EnerOS v0.43.0 Release Notes

  • Release Date: 2026-06-27
  • Codename: DevEx
  • Support Status: Stable
  • Total Crates: 52
  • Test Cases: 6600+
  • Contributors: 28

Version Overview

EnerOS v0.43.0 is the third release of the “Mature Optimization” phase, focusing on the comprehensive improvement of Developer Experience. After v0.41.0 established the performance baseline and v0.42.0 perfected security auditing, this release turns its attention to the efficiency and experience of developers’ daily workflows, covering four directions: CLI tools, debugging tools, hot reload, and project scaffolding.

The success of an operating system depends not only on the power of the kernel, but also on the prosperity of the application ecosystem built around it. The prerequisite for ecosystem prosperity is that developers can quickly get started, develop efficiently, and debug smoothly. The goal of v0.43.0 is to enable a developer who has never encountered EnerOS to complete environment setup and run their first Agent within 5 minutes, and to complete a usable power dispatching Agent within 30 minutes.

This release completely refactors eneros-cli, adding 40+ subcommands covering the full lifecycle of project creation, development, debugging, deployment, and operations. The new eneros-dev crate provides hot reload capability, where code changes take effect without restarting the service, greatly shortening the development-testing cycle. Project scaffolding supports 12 templates, covering typical business scenarios such as generation, transmission, distribution, dispatching, and marketing.

Key Metrics

MetricValueDescription
Crate count52Added eneros-dev and 2 other crates
Test cases6600+Including 320+ CLI tests
CLI subcommands40+Full lifecycle coverage
Scaffolding templates12Full business scenario coverage
Hot reload latency< 200msCode change to effective
First Agent onboarding time< 5 minutesFrom installation to running

New Features

1. CLI Tool Enhancement

eneros-cli is completely refactored, expanding from the original 8 basic commands to 40+ subcommands, organized into six command groups by function: project, development, debugging, deployment, operations, and security. All commands support JSON output format for scripted integration.

Command Structure

eneros-cli
├── project    # Project management
│   ├── new        # Create new project (template support)
│   ├── build      # Build project
│   ├── test       # Run tests
│   └── package    # Package release
├── dev        # Development assistance
│   ├── run        # Local run (with hot reload)
│   ├── watch      # File watching
│   ├── fmt        # Code formatting
│   └── lint       # Code checking
├── debug      # Debugging tools
│   ├── agent      # Agent debugger
│   ├── topology   # Topology visualization
│   ├── trace      # Distributed tracing
│   └── profile    # Performance analysis
├── deploy     # Deployment management
│   ├── push       # Push image
│   ├── rollout    # Rolling release
│   └── rollback   # Version rollback
├── ops        # Operations management
│   ├── health     # Health check
│   ├── logs       # Log query
│   ├── metrics    # Metrics viewing
│   └── shell      # Interactive shell
└── security   # Security management
    ├── audit      # Security audit
    ├── trust      # Certificate management
    └── rbac       # Permission management

Usage Example

# Create new project
eneros-cli project new my-dispatch-agent --template economic-dispatch

# Local run (with hot reload)
eneros-cli dev run --hot-reload

# Debug Agent
eneros-cli debug agent --agent dispatch --breakpoint step-3

# Performance analysis
eneros-cli debug profile --duration 60s --output profile.flamegraph

# JSON output (for scripting)
eneros-cli ops health --output json | jq '.status'

CLI Programmatic Invocation

use eneros_cli::{Cli, Command, OutputFormat};

let cli = Cli::new();

// Programmatic CLI invocation
let result = cli.run(Command::HealthCheck {
    full: true,
    output: OutputFormat::Json,
}).await?;

let status: HealthStatus = serde_json::from_str(&result.stdout)?;
println!("Cluster status: {}", status.overall);

2. Debugging Tools

Added the eneros-debug module, providing four debugging capabilities: Agent debugger, topology visualization, distributed tracing, and performance analysis. The Agent debugger supports breakpoints, single-step execution, variable inspection, and backtracking, bringing the Agent development debugging experience on par with mainstream IDEs.

Agent Debugger

use eneros_debug::{AgentDebugger, Breakpoint, DebugSession};

let mut debugger = AgentDebugger::connect("agent://dispatch-1").await?;

// Set breakpoints
debugger.set_breakpoint(Breakpoint::at_step("economic_dispatch", 3)).await?;
debugger.set_breakpoint(Breakpoint::on_event("constraint_violation")).await?;

// Start debug session
let mut session = debugger.start_session().await?;

while let Some(event) = session.next_event().await {
    match event {
        DebugEvent::BreakpointHit { step, context } => {
            println!("Breakpoint hit: {}", step);
            println!("Context variables: {:?}", context.variables);
            println!("Topology snapshot: {} nodes", context.topology.node_count());

            // Single step execution
            session.step_over().await?;
        }
        DebugEvent::ConstraintViolated { command, violation } => {
            println!("Constraint violated: {} - {}", command, violation);
            session.continue_().await?;
        }
        DebugEvent::Completed { result } => {
            println!("Agent completed: {:?}", result);
            break;
        }
    }
}

Performance Analysis

use eneros_debug::profiler::{Profiler, ProfileConfig};

let profiler = Profiler::new(ProfileConfig {
    duration: Duration::from_secs(60),
    sample_rate: 1000,           // 1000 Hz sampling
    cpu_profiling: true,
    memory_profiling: true,
    allocation_tracking: true,
});

let report = profiler.profile_agent("dispatch-1").await?;

// Generate flame graph
report.flamegraph("reports/dispatch-flame.svg")?;

// Output hotspot functions
for hotspot in report.top_hotspots(10) {
    println!(
        "{}: {:.2}% ({} calls)",
        hotspot.function, hotspot.cpu_pct, hotspot.call_count
    );
}

Debugging Capabilities Overview

ToolCapabilityApplicable Scenarios
Agent debuggerBreakpoints, single step, variable inspectionAgent logic debugging
Topology visualizationGraph structure rendering, path highlightingTopology problem location
Distributed tracingCross-Agent call chainPerformance bottleneck analysis
Performance analysisCPU/memory flame graphsPerformance optimization
Time-series replayHistorical data replayFault retrospective
Constraint diagnosticsConstraint violation tracingConstraint configuration debugging

3. Hot Reload

Added the eneros-dev crate, providing code hot reload capability. After developers modify Rust code, the hot reload engine automatically detects changes, incrementally compiles, and loads new modules without restarting the service. Based on hot-lib-reloader, combined with dylib linking strategy, hot reload latency < 200ms.

Configuration Example

use eneros_dev::{HotReloader, ReloadConfig, WatchPattern};

let reloader = HotReloader::new(ReloadConfig {
    watch_paths: vec!["src/".into(), "agents/".into()],
    watch_patterns: vec![
        WatchPattern::glob("**/*.rs"),
        WatchPattern::glob("**/Cargo.toml"),
    ],
    reload_delay: Duration::from_millis(100),  // Debounce
    rebuild_args: vec!["build".into(), "--lib".into()],
})?;

// Register reload callback
reloader.on_reload(|event| {
    println!("Module reloaded: {} (took {}ms)", event.module, event.duration_ms);
    // Re-register Agents, refresh routes, etc.
}).await?;

reloader.start().await?;

Hot Reload Applicable Scope

ComponentHot Reload SupportDescription
Agent business logicSupporteddylib dynamic loading
Constraint rulesSupportedRuntime registration
Topology configurationSupportedConfiguration hot update
Kernel data structuresNot supportedRestart required
System call ABINot supportedRestart required
Device driversNot supportedRestart required

4. Project Scaffolding

Project scaffolding provides 12 business scenario templates. Each template contains a complete project structure, example code, test cases, and deployment configuration. Developers can quickly create projects based on templates.

Template List

Template NameScenarioIncluded Components
economic-dispatchEconomic dispatchDispatchAgent + OPF + constraints
load-forecastLoad forecastingForecastAgent + time-series model
fault-diagnosisFault diagnosisDiagnosisAgent + protection coordination
scada-gatewaySCADA gatewayIEC 104 + Modbus adapter
topology-analyzerTopology analysisTopology engine + N-1 verification
trading-agentElectricity tradingTradingAgent + market interface
new-energyNew energy managementWind/solar forecasting + output control
ev-chargingEV chargingLoad management + billing
microgridMicrogridIsland detection + grid-connected/off-grid switching
demand-responseDemand responseLoad aggregation + response strategy
digital-twinDigital twinTwin engine + state estimation
compliance-reportCompliance reportAudit + compliance scanning

Usage Example

# Create project from template
eneros-cli project new my-dispatch --template economic-dispatch

# Generated project structure
# my-dispatch/
# ├── Cargo.toml
# ├── src/
# │   ├── main.rs
# │   ├── agent.rs        # DispatchAgent implementation
# │   ├── constraints.rs   # Constraint definitions
# │   └── config.rs
# ├── tests/
# │   ├── integration.rs
# │   └── fixtures/
# ├── deploy/
# │   ├── Dockerfile
# │   └── eneros.toml
# └── README.md
// Generated Agent skeleton
use eneros_agent::{Agent, AgentContext, AgentResult};

pub struct DispatchAgent {
    bus_id: BusId,
}

impl Agent for DispatchAgent {
    async fn run(&mut self, ctx: &mut AgentContext) -> AgentResult<()> {
        let island = ctx.syscall(GetIsland { bus: self.bus_id }).await?;
        let generators = ctx.syscall(ListGenerators { island_id: island.id }).await?;

        // TODO: Implement economic dispatch logic
        let dispatch = self.economic_dispatch(&generators, &island.load)?;
        ctx.syscall(ApplyDispatch(dispatch)).await?;

        Ok(())
    }
}

Improvements

Error Message Enhancement

All crate error types implement Display, source chain, and Diagnostic trait. CLI errors display complete call stacks and remediation recommendations.

// Error output example
// Error: Power flow computation did not converge
// 
// Caused by:
//   0: Newton-Raphson did not converge after 20 iterations (residual: 0.0023 > tolerance: 0.000001)
//   1: Node 47 initial voltage estimate deviation too large (0.78 p.u., recommended range 0.95-1.05)
// 
// Recommendation: Check the initial conditions of node 47, or increase the max_iter parameter

Structured Logging

All crates output JSON structured logs by default, supporting fine-grained control via RUST_LOG. Added eneros-cli logs command supporting cross-node log aggregation query and filtering.

IDE Integration

Released VS Code extension eneros-devtools, providing syntax highlighting, code completion, topology preview, and Agent debugging integration.

Bug Fixes

  • BG-401: CLI garbled color output in PowerShell, detected terminal capability and downgraded
  • BG-405: Hot reload file lock conflict on Windows, changed to rename + replace strategy
  • BG-409: Agent debugger breakpoint failure in async context, fixed poll-driven breakpoint detection
  • BG-413: Scaffolding-generated Cargo.toml missing workspace inheritance configuration, fixed
  • BG-417: Performance analysis unstable sampling frequency on ARM platform, switched to perf_event_open

Breaking Changes

BC-221: eneros-cli Command Renaming

Some commands renamed to unify naming conventions. Old commands retain aliases until v0.45.0.

Old CommandNew CommandDescription
eneros runeneros-cli dev runMoved to dev group
eneros testeneros-cli project testMoved to project group
eneros deployeneros-cli deploy rolloutMore explicit verb
eneros healtheneros-cli ops healthMoved to ops group

BC-222: Agent::run Adds AgentResult Return Type

The return type of the run method in the Agent trait changed from Result<()> to AgentResult<()> to carry richer Agent execution results.

Dependency Upgrades

DependencyOld VersionNew VersionDescription
hot-lib-reloader0.60.7Hot reload engine
clap4.44.5CLI framework
indicatif0.170.17.5Progress bar
comfy-table7.07.1Terminal table
dialoguer0.110.11.2Interactive input

Upgrade Guide

Upgrade from v0.42.0

cargo update
cargo test --workspace

Install new CLI tool:

cargo install eneros-cli --version 0.43

Migrate old commands (optional, old commands still available):

eneros-cli dev run    # Replaces eneros run
eneros-cli project test  # Replaces eneros test

Install VS Code extension:

code --install-extension eneros.eneros-devtools