← Back to Projects

adaptive-powerd: Agent-Operable Power Controller

A Rust power and thermal controller for a Linux workstation: compile mode, quiet idle behavior, typed fail-safes, cgroup control, and JSON status for agent-readable operation.

This case proves infrastructure orchestration at the machine layer: performance, acoustics, thermal safety, cgroup pressure, and recovery are encoded as typed policy instead of manual tuning rituals.

typed modes
Policy States
cgroup enforced
Compile Contract
recoverable latch
Thermal Safety
> Private repository. Available for code review on request.

▍ Problem Space

AI-first engineering work creates bursts of heavy Rust compilation, browser automation, media processing, and long local agent sessions. A workstation cannot be tuned once and forgotten.

  • Conflicting Priorities: The same machine needs fast builds during compile work and quiet, cooler behavior when idle.
  • Human Symptom Lag: If the user notices freezing or fan spikes first, the system lacks a machine-readable health surface.
  • Unsafe Fail-Safes: Thermal protection must be strict, but a recoverable heat event should not permanently kill normal control.
  • Resource Contention: Compiler jobs, foreground desktop work, and background agents need explicit cgroup boundaries rather than manual process policing.

▍ Architecture

SENSORS
  hwmon temperature | fan PWM | cgroup pressure | workload slices
          ↓
POLICY ENGINE
  idle cooling | compile mode | capped mode | fail-safe states
          ↓
ACTUATORS
  CPU governor | EPP | fan PWM | cgroup CPU/memory limits
          ↓
READBACK
  JSON status | structured events | regression tests | systemd watchdog

▍ Operating Proof

typed modes
Policy States
cgroup enforced
Compile Contract
recoverable latch
Thermal Safety
JSON status
Readback
systemd watchdog
Supervisor
regression suite
Test Surface

▍ Key Engineering Decisions

Problem
Fast Rust builds and usable desktop responsiveness compete for CPU, memory, IO, and thermal headroom.
Solution
Separate unlimited compile mode from capped build mode. Capped mode reserves desktop capacity through generated cgroup limits while compile mode uses fan headroom before software throttling.
Alternative Rejected
Manual nice/kill commands — reactive, non-repeatable, and invisible to future agents.
Problem
A critical temperature event must protect hardware but should recover after fresh cooldown evidence.
Solution
Latch maximum cooling during critical heat, then clear only that heat latch after sustained safe sensor readback. Control-integrity failures remain latched.

▍ Tech Stack

Core
Rust 2024, serde, toml, tracing
Linux Control
sysfs, cgroups, CPU governor, EPP
Reliability
systemd notify, watchdog, typed fail-safe states
Verification
fake sysfs tests, fan policy and run-mode regressions

▍ What This Proves

Agent-Operable Infrastructure
Local hardware state is exposed through typed readback so agents can diagnose pressure without asking the user to watch the machine.
Reliability Engineering
Every major state has a legal transition: normal control, capped builds, critical heat, recoverable cooldown, and latched control failures.
Systems Integration
CPU policy, fan PWM, cgroups, and systemd supervision are coordinated as one operating loop.
Practical Performance
The goal is not abstract tuning; it is faster builds without turning the desktop into an unreliable shared resource.

Ready to build something like this?

Start a Project