-
Notifications
You must be signed in to change notification settings - Fork 0
Development Workflow en
中文 | English
Maintained version: v0.51.2 | Last updated: 2026-07-06
This page summarizes the EnerOS development workflow: workspace organization / adding a new Agent / adding a new protocol / adding a new plugin / debugging tips. For the full developer guide see the main repo docs/developer-guide.md and CONTRIBUTING.md.
EnerOS uses a Cargo workspace with 79 members: 56 libraries + 23 binaries + 3 SDK/macros. For the full index see the Crate Index page.
Dependencies are strictly top-down; reverse and circular dependencies are forbidden (see Layered Dependencies).
| Item | Requirement |
|---|---|
| Rust | 1.75+, edition 2021 |
| Platform | Linux x86_64/aarch64 (production) / Windows & macOS (core library development) |
| Recommended components | rustfmt / clippy / rust-src |
| IDE | VS Code + rust-analyzer |
rustup component add rustfmt clippy rust-srcBuilding core libraries on Windows/macOS (excluding eneros-installer):
cargo build --workspace --exclude eneros-installer-
Implement the Agent logic: create a new module under
crates/eneros-agent/src/agents/, implementing the decision loop and message handling -
Create the binary entry: create a new directory under
crates/eneros-agent/bins/containingCargo.tomlandsrc/main.rs -
Register in workspace: add the path to the
memberslist in the rootCargo.toml -
Configure init.toml: add a startup config (binary path / args / resource quota) in
os/rootfs/files/etc/eneros/init.toml - Build verification:
cargo build -p my-agent
cargo test -p eneros-agentSee the main repo docs/developer-guide.md §4.
-
Create the adapter module: new directory under
crates/eneros-device/src/adapters/ -
Implement the DeviceAdapter trait: refer to the trait definition in
crates/eneros-device/src/adapter.rs -
Register with DeviceManager: declare it in
crates/eneros-device/src/adapters/mod.rs -
Protocol conformance tests: add test cases under
tests/protocol_conformance/ -
Fuzz target (optional): add a fuzz target under
fuzz/
See the main repo docs/developer-guide.md §5.
See the Operations & Plugins page and the main repo docs/plugin-development.md.
Summary:
- Create a
cdylibcrate - Implement the
Plugintrait + the correspondingProtocolPlugin/AgentPlugin/AnalysisPlugintrait - Use the
#[eneros_plugin]macro to auto-generate the C ABI entry - Write a
manifest.tomlmanifest - Sign with Ed25519
- Deploy to
~/.eneros/plugins/
{
"rust-analyzer.checkOnSave.command": "clippy",
"rust-analyzer.cargo.features": "all"
}{
"type": "lldb",
"request": "launch",
"name": "debug eneros-api",
"cargo": {
"args": ["build", "--package", "eneros-api"],
"filter": { "kind": "bin" }
},
"args": ["run", "--config", "eneros.toml"],
"cwd": "${workspaceFolder}"
}ENEROS_OBSERVABILITY__LOG_LEVEL=debug ./target/release/eneros-api runOr at runtime via API:
curl -X POST http://localhost:8080/api/config/reload# Generate a flamegraph
cargo flamegraph --bin eneros-api -- run --config eneros.toml
# Benchmarks
cargo bench --workspaceEvery PR automatically runs:
| Gate | Command | On failure |
|---|---|---|
| Formatting | cargo fmt --all -- --check |
Blocks merge |
| Lint | cargo clippy --workspace --all-targets -- -D warnings |
Blocks merge |
| Build | cargo build --workspace |
Blocks merge |
| Test | cargo test --workspace |
Blocks merge |
| Docs | cargo doc --workspace --no-deps |
Warning |
| Dependencies | cargo deny check |
Blocks merge |
| Coverage | llvm-cov | Threshold check |
See the Testing Strategy page.
Follow CONTRIBUTING.md:
- Use conventional commits (
feat:/fix:/docs:/refactor:/test:/chore:) - Every PR must update the corresponding version section in
CHANGELOG.md - On a new release, move completed items from
ROADMAP.mdtoCHANGELOG.md - Major architecture decisions require a new ADR
- Main repo docs/developer-guide.md — Full developer guide
- Main repo CONTRIBUTING.md — Contribution guidelines
- Wiki Crate Index — 79-member list
- Wiki Layered Dependencies — Dependency direction rules
- Wiki Testing Strategy — Testing and quality gates
- Wiki Operations & Plugins — Plugin development details
EnerOS Wiki | v0.51.2