The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
docs: add README documentation for migration helpers, scheduler gate, and memory sources
Steven Enamakelaaf27e2f7a8c
diff --git a/crates/openhuman-core/src/config/migration_helpers/README.md b/crates/openhuman-core/src/config/migration_helpers/README.mdindex 3d32b8a09b..b4032f3a9c 100644--- a/crates/openhuman-core/src/config/migration_helpers/README.md+++ b/crates/openhuman-core/src/config/migration_helpers/README.md@@ -20,7 +20,7 @@ Data-migration helpers that import memory from other AI assistants' workspaces (| File | Role || --- | --- || `crates/openhuman-core/src/config/migration_helpers/mod.rs` | Export-only: declares `core`/`ops`/`schemas`, re-exports `core::*` and `ops::*`, aliases `ops as rpc`, and exports the `all_migration_controller_schemas` / `all_migration_registered_controllers` pair. |-| `crates/openhuman-core/src/config/migration_helpers/core.rs` | Core logic. `MigrationStats`, `MigrationReport`, `SourceEntry`; `migrate_openclaw_memory` / `migrate_hermes_memory`; source readers (SQLite + Markdown), workspace resolution, key/category normalization, backup, conflict-rename helpers. Inline `#[cfg(test)]` unit tests. |+| `crates/openhuman-core/src/config/migration_helpers/core.rs` | Host seam. `migrate_openclaw_memory` / `migrate_hermes_memory` call `tinymemory-import` (which owns `MigrationStats`/`MigrationReport`, the SQLite + Markdown source readers, workspace resolution, key/category normalization, backup and conflict-rename helpers) with the target workspace and `target_memory_backend`, the closure that binds the driver and refuses the null one. || `crates/openhuman-core/src/config/migration_helpers/ops.rs` | JSON-RPC/CLI adapter (the canonical handler file, re-exported as `rpc`). `migrate_openclaw` / `migrate_hermes` wrap the core fns, map `anyhow::Error` → `String`, and return `Outcome<MigrationReport>` with a `"migration completed"` log. Tests cover dry-run, apply, missing-source, and self-migration. || `crates/openhuman-core/src/config/migration_helpers/schemas.rs` | Controller schemas + handlers. Defines `MigrateOpenClawParams` / `MigrateHermesParams`, `all_controller_schemas`, `all_registered_controllers`, `schemas(function)`, and `handle_migrate_openclaw` / `handle_migrate_hermes` which load config and delegate to `migration_helpers::rpc::*`. |@@ -33,7 +33,7 @@ From `mod.rs` re-exports (`core::*` + `ops::*`):- RPC fns (via `ops` / alias `rpc`): `migrate_openclaw(...) -> Result<Outcome<MigrationReport>, String>`, `migrate_hermes(...)`.- Controller registry exports: `all_migration_controller_schemas`, `all_migration_registered_controllers`.-(`SourceEntry` and the internal helpers in `core.rs` are private.)+(The importers' internals are private to `tinymemory-import`; `target_memory_backend` is private to `core.rs`.)## RPC / controllers@@ -65,7 +65,7 @@ No own store. It writes imported entries through the **target memory backend** o- `crate::memory::store`: `create_memory_for_migration` constructs the target memory backend.- `crate::core::all` (`ControllerFuture`, `RegisteredController`) and `crate::core::{ControllerSchema, FieldSchema, TypeSchema}`: controller registry/schema types.- `crate::core::Outcome`: RPC response envelope.-- External crates: `rusqlite` (read OpenClaw `brain.db`), `directories::UserDirs` (home dir), `anyhow`, `serde`/`serde_json`.+- Vendored: `tinymemory-import` (the importers; it carries `rusqlite` and `directories`). External crates here: `anyhow`.## Used bydiff --git a/crates/openhuman-core/src/cron/scheduler_gate/README.md b/crates/openhuman-core/src/cron/scheduler_gate/README.mdindex 6c77675d12..717d07d9f9 100644--- a/crates/openhuman-core/src/cron/scheduler_gate/README.md+++ b/crates/openhuman-core/src/cron/scheduler_gate/README.md@@ -16,15 +16,16 @@ 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` | Process-wide singleton: cached `State` (config + signals + policy), the 30s sampler task, the single-slot LLM semaphore, `LlmPermit` RAII guard, signed-out override, and `init_global`/`update_config`/`current_policy`/`current_signals`/`wait_for_capacity`. Holds the per-tokio-runtime test-state scaffolding. |+| `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`/`current_signals`/`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. |-| `crates/openhuman-core/src/cron/scheduler_gate/signals.rs` | `sample() -> Signals` (the `Signals` type lives in `tinymemory-api`). Probes battery (via `starship_battery`), CPU usage (via `sysinfo`, two-refresh delta), and detects server/container mode. Honours `OPENHUMAN_ON_AC_POWER`, `OPENHUMAN_BATTERY_CHARGE`, `OPENHUMAN_DEPLOYMENT` env overrides plus Kubernetes / `/.dockerenv` heuristics. |+| `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). |## Public surfaceFrom `mod.rs`:-- Functions (`gate`): `init_global(&Config)`, `current_policy() -> Policy`, `current_signals() -> Signals`, `wait_for_capacity() -> Option<LlmPermit>`, `is_signed_out() -> bool`, `set_signed_out(bool)`.+- Functions (`gate`): `init_global(SchedulerGateConfig)`, `current_policy() -> Policy`, `current_signals() -> Signals`, `wait_for_capacity() -> Option<LlmPermit>`, `is_signed_out() -> bool`, `set_signed_out(bool)`.- Types: `LlmPermit` (RAII semaphore guard, `#[must_use]`), `Policy` (`Aggressive` / `Normal` / `Throttled` / `Paused { reason }`), `PauseReason` (`UserDisabled` / `OnBattery` / `CpuPressure` / `SignedOut` / `Unknown`), `Signals`.- Not re-exported but `pub` on `gate`: `update_config(SchedulerGateConfig)`.- Test-only: `SignedOutTestGuard` (RAII flag snapshot/restore), `try_acquire_llm_permit`, `available_llm_permits`.diff --git a/crates/openhuman-core/src/memory/sources/README.md b/crates/openhuman-core/src/memory/sources/README.mdindex bed6fdcc96..f3ed1e05b3 100644--- a/crates/openhuman-core/src/memory/sources/README.md+++ b/crates/openhuman-core/src/memory/sources/README.md@@ -23,7 +23,7 @@ of `mod.rs`.| `status.rs` | Per-source sync status: the chunk-key prefix (derived from the registry entry) and freshness label are host-side; in-flight/chunk counts go through `MemoryChunks::source_ingest_status`. || `sync.rs` | `derive_scopes`: which tree scope and raw-archive id a configured source maps onto; the only production-reached piece of the old engine sync pipeline. || `reconcile.rs` | Startup/list-time reconciliation of active Composio connections into the registry, built on `memory::sync::composio::scan_active_sync_targets`. |-| `readers/mod.rs` | `SourceReader` trait (takes `&Config`, unlike the crate's `&Path` trait) plus one implementation per `SourceKind`: `composio`, `conversation`, `folder`, `github`, `rss`, `twitter`, `web_page`. This module's `reader_for` hands out all seven, network kinds included, because its callers are RPC handlers acting on an explicit user request; the crate's `reader_for` returns `None` for network kinds. Do not call it from a polling loop. |+| `readers/mod.rs` | Re-exports `tinymemory_sources::readers`: the `SourceReader` trait (takes the workspace `&Path`) and one implementation per `SourceKind` (`composio`, `conversation`, `folder`, `github`, `rss`, `twitter`, `web_page`). `reader_for_request` hands out all seven, network kinds included, because its callers are RPC handlers acting on an explicit user request; the crate's `reader_for` returns `None` for network kinds. Do not call it from a polling loop. |## RPC surface (`memory_sources.*`)