Skip to main content

max / everycycle

land phase 0 sketches: hal inventory, executor trait, native client API Phase 0 (hardware-free work) sketches per the roadmap. Lock the type graph now so the A1 hardware lands against a settled shape. - crates/hal: DeviceInventory module — Linux sysfs PCI walker producing HostFingerprint + per-device class/IDs/driver/NUMA/IOMMU/DRM/hwmon. Linux-only walker, empty inventory on other targets so the workspace builds on the mbp. - crates/runtime: Executor trait with vendor/devices/dtypes/alloc/ execute methods, plus export_activation/import_activation present from day one as forward-compat for A4 cross-vendor handoff. Shape constrained to what flattens to a repr(C) call for the eventual stable C ABI module boundary. - crates/api: native client API (renamed from crates/serving). Types for ClientRequest/ServerEvent/ModelRef/SamplingParams/Priority/ TokenChunk/FleetSnapshot/ErrorKind, ClientTransport trait, framing constants (CBOR over length-prefixed Unix-socket frames, 16 MiB max). API_VERSION = "0", API_UNSTABLE = true. Serving framing is gone from the daemon by design — Thread J shims will live in their own crates. - docs/api-stability.md: freeze gate (A4 AND second external client), semver post-freeze (additive minor, bugfix-only patch, migration doc + deprecation window of >=1 distro release cycle for majors), scope boundary, daemon/API versioning decoupled. - docs/roadmap.md: settled-decisions entry for the crate-naming move. - todo.md: mark four Phase 0 items + the serving-rename Phase 1 decision done. - Pre-existing pedantic doc_markdown lints on runtime/scheduler/ orchestrator/tui/bmc-agent fixed with #![allow(clippy::doc_markdown)] to match the hal pattern. Also folds in previously-uncommitted prior work that the new code depends on to build: crates/appraise (Phase A signing + Phase B enumeration on astra), crates/hal/src/capability.rs (probe/report schema), docs/appraisal.md. cargo fmt + cargo clippy --all-targets --all-features -- -D warnings + cargo test --workspace all clean.
Co-Authored-By
Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-06-21 15:21 UTC
Signed with PGP, not checked
Commit: 6ad8ae023983cacbef248f86b9ce991de2afa0ae
Parent: 32e9819
35 files changed, +3380 insertions, -18 deletions
M Cargo.toml +2 -1
@@ -4,10 +4,11 @@
4 4 "crates/runtime",
5 5 "crates/scheduler",
6 6 "crates/orchestrator",
7 - "crates/serving",
7 + "crates/api",
8 8 "crates/tui",
9 9 "crates/hal",
10 10 "crates/bmc-agent",
11 + "crates/appraise",
11 12 ]
12 13
13 14 [workspace.package]
@@ -133,6 +133,7 @@
133 133 - **Multi-client is the default, not a feature.** The daemon assumes concurrent clients from A1, even when only one is connected. The internal data model, scheduler, and audit surface are designed around N clients sharing M devices under policy; the N=1 case is just the limit. This is the structural difference between a system service and a runtime library.
134 134 - **Compatibility shims are clients, not daemon code.** Each protocol shim (OpenAI, llama.cpp, Ollama, vLLM, ComfyUI) is a separate process that speaks the native EveryCycle client API. The shims do not get privileged access to internals. This forces the native API to be expressive enough that the shims are thin — and keeps the daemon free of protocol-specific code paths.
135 135 - **Implementation languages.** Main binary is Rust, built natively for Ubuntu LTS 24.04 (glibc, .deb-packaged). Module boundary is a **stable C ABI** from a reasonable point — early enough that the second executor doesn't lock the trait shape into Rust-internals. Module *implementations* may be in any language that emits a C-ABI shared library (Rust, Zig, C). The BMC agent is a separate binary and is the leading candidate for being written in Zig rather than Rust; that decision deferred until the agent is real.
136 + - **Crate naming.** The daemon-internal native client API lives in `crates/api/` (renamed from `crates/serving/` on 2026-06-21). Thread J shims (OpenAI, llama.cpp, Ollama, vLLM, ComfyUI) will land as their own crates (`crates/shim-openai`, etc.) when they ship — they are not modules of `crates/api`. The HTTP "serving" framing is gone from the daemon by design.
136 137
137 138 ## Model stance
138 139
@@ -8,5 +8,8 @@
8 8 authors.workspace = true
9 9 repository.workspace = true
10 10
11 + [dependencies]
12 + serde = { version = "1", features = ["derive"] }
13 +
11 14 [lints]
12 15 workspace = true
@@ -8,5 +8,9 @@
8 8 authors.workspace = true
9 9 repository.workspace = true
10 10
11 + [dependencies]
12 + everycycle-hal = { path = "../hal" }
13 + serde = { version = "1", features = ["derive"] }
14 +
11 15 [lints]
12 16 workspace = true
@@ -1,3 +1,5 @@
1 + #![allow(clippy::doc_markdown)]
2 +
1 3 //! EveryCycle BMC agent.
2 4 //!
3 5 //! Runs on the box's baseboard management controller (an OpenBMC fork on
@@ -1,6 +1,21 @@
1 + #![allow(clippy::doc_markdown)]
2 +
1 3 //! EveryCycle hardware abstraction layer.
2 4 //!
3 5 //! Device enumeration across CUDA, ROCm, Vulkan, and CPU. PCIe topology and
4 6 //! NVLink (where present). Memory pool allocation. Shared-memory and lockless
5 7 //! IPC primitives between the runtime, scheduler, and serving processes.
6 8 //! Power and thermal telemetry, sourced from drivers and from the BMC.
9 +
10 + pub mod capability;
11 + pub mod inventory;
12 +
13 + pub use capability::{
14 + BoxReport, BoxReportPayload, CapabilityVector, CardReport, CardReportPayload, DeviceIdentity,
15 + DriverBinding, HostIdentity, Interconnect, LaunchOverhead, Memory, PeerLink, Precision,
16 + PrecisionThroughput, ProbeEnvironment, Signature, ThermalEnvelope,
17 + };
18 + pub use inventory::{
19 + DeviceInventory, DeviceKind, EnumeratedDevice, HostFingerprint, HwmonSensor, InventoryConfig,
20 + PciBusAddress, PciClass, PciIds, enumerate, host_fingerprint,
21 + };