Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

docs(cron): update scheduler gate documentation to reflect inlined architecture

Steven Enamakel01472d9c9c0d
diff --git a/crates/openhuman-core/src/config/schema/scheduler_gate.rs b/crates/openhuman-core/src/config/schema/scheduler_gate.rs
index 7493e3bc3c..3cf7d2f2ee 100644
--- a/crates/openhuman-core/src/config/schema/scheduler_gate.rs
+++ b/crates/openhuman-core/src/config/schema/scheduler_gate.rs
@@ -1,6 +1,6 @@
//! Scheduler-gate configuration — controls when background AI work runs.
//!
-//! Consumed by `tinymemory-gate` and, through it, the host's scheduler gate.
+//! Consumed by `cron::scheduler_gate`.
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
diff --git a/crates/openhuman-core/src/cron/scheduler_gate/README.md b/crates/openhuman-core/src/cron/scheduler_gate/README.md
index 60e0693084..889073035e 100644
--- a/crates/openhuman-core/src/cron/scheduler_gate/README.md
+++ b/crates/openhuman-core/src/cron/scheduler_gate/README.md
@@ -1,6 +1,6 @@
# scheduler_gate
-Gates background AI work (memory-tree digests, embeddings, summarisation, triage, reflection, local inference) on live host conditions so the process doesn't make the machine visibly lag: especially on battery. It exposes a single process-wide decision point: background workers consult `current_policy()` for a cheap read, or `await wait_for_capacity()` to cooperatively block until the host is ready and hold a slot in a one-permit LLM semaphore. A background sampler refreshes host signals every 30s and recomputes the policy. A separate "signed out" override trumps everything to halt LLM work the moment the app session goes away.
+Gates background AI work (embeddings, summarisation, triage, local inference) on live host conditions so the process doesn't make the machine visibly lag: especially on battery. It exposes a single process-wide decision point: background workers consult `current_policy()` for a cheap read, or `await wait_for_capacity()` to cooperatively block until the host is ready and hold a slot in a one-permit LLM semaphore. A background sampler refreshes host signals every 30s and recomputes the policy. A separate "signed out" override trumps everything to halt LLM work the moment the app session goes away.
## Responsibilities
@@ -16,10 +16,11 @@ Gates background AI work (memory-tree digests, embeddings, summarisation, triage
| File | Role |
| --- | --- |
| `crates/openhuman-core/src/cron/scheduler_gate/mod.rs` | Module docstring + re-exports of the public surface. |
-| `crates/openhuman-core/src/cron/scheduler_gate/gate.rs` | The host's wiring of `tinymemory-gate`: the process-wide `SharedCore`, the signed-out override, the resume `Notify`, the single-slot LLM semaphore, `init_global(SchedulerGateConfig)`/`update_config`/`current_policy`/`wait_for_capacity`, and the per-tokio-runtime test-state scaffolding. |
-| `tinymemory-gate` (vendored) | The machinery: `GateCore` (config + signals + policy), the 30s `spawn_sampler` task, `wait_for_capacity` over a host-owned semaphore, the `LlmPermit` RAII guard, and `signals::sample(&SignalEnv)` which probes battery (via `starship_battery`, its `battery` feature), CPU usage (via `sysinfo`, two-refresh delta), and detects server/container mode. |
-| `tinymemory-api` (`host::scheduler_gate_decide`, vendored) | Pure decision logic: `decide(signals, cfg) -> Policy`, the `Signals` snapshot, with `Policy` / `PauseReason` beside `SchedulerGateConfig` in `host::scheduler_gate`. Evaluation order: user mode override → server mode → power-aware stand-down → hard CPU ceiling → battery/CPU headroom. |
-| `SIGNAL_ENV` in `gate.rs` | The env-override names the host hands `tinymemory-gate`: `OPENHUMAN_ON_AC_POWER`, `OPENHUMAN_BATTERY_CHARGE`, `OPENHUMAN_DEPLOYMENT` (plus the crate's Kubernetes / `/.dockerenv` heuristics). |
+| `crates/openhuman-core/src/cron/scheduler_gate/gate.rs` | The process-wide wiring: the `SharedCore`, the signed-out override, the resume `Notify`, the single-slot LLM semaphore, `init_global(SchedulerGateConfig)`/`update_config`/`current_policy`/`wait_for_capacity`, and the per-tokio-runtime test-state scaffolding. |
+| `crates/openhuman-core/src/cron/scheduler_gate/throttle.rs` | The machinery: `GateCore` (config + signals + policy), the 30s `spawn_sampler` task, `wait_for_capacity` over a caller-owned semaphore, and the `LlmPermit` RAII guard. |
+| `crates/openhuman-core/src/cron/scheduler_gate/signals.rs` | `sample(&SignalEnv)`: battery (via `starship_battery`, behind the `scheduler-gate` feature), CPU usage (via `sysinfo`, two-refresh delta), and server/container detection. |
+| `crates/openhuman-core/src/cron/scheduler_gate/decide.rs` | Pure decision logic: `decide(signals, cfg) -> Policy` over the `Signals` snapshot; `Policy` / `PauseReason` live beside `SchedulerGateConfig` in `config::schema::scheduler_gate`. Evaluation order: user mode override → server mode → power-aware stand-down → hard CPU ceiling → battery/CPU headroom. |
+| `SIGNAL_ENV` in `gate.rs` | The env-override names: `OPENHUMAN_ON_AC_POWER`, `OPENHUMAN_BATTERY_CHARGE`, `OPENHUMAN_DEPLOYMENT` (plus the Kubernetes / `/.dockerenv` heuristics). |
## Public surface