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(scripts): replace em dashes with commas and colons in READMEs
Steven Enamakel54b6330f02b3
diff --git a/scripts/bench/README.md b/scripts/bench/README.mdindex 0fd5c14c85..c41b4da39c 100644--- a/scripts/bench/README.md+++ b/scripts/bench/README.md@@ -1,4 +1,4 @@-# `scripts/bench/` — agent-scale benchmarks+# `scripts/bench/`: agent-scale benchmarksDrive a **real [`openhuman-core`](../../crates/openhuman-cli/README.md) server process** at concurrency against amocked LLM ([`mock-llm.mjs`](./mock-llm.mjs)), sample its CPU and memory from the outside, and report a leak@@ -14,7 +14,7 @@ the reason this directory exists rather than another scenario in the old one.| Core runs as | a library, embedded in the bench binary | a normally-built `openhuman-core serve` process || Driven through | direct `Agent` calls | JSON-RPC over HTTP `/rpc` || LLM mocked by | a native `ChatModel` override | an HTTP endpoint the core dials |-| Needs | `--features rss-bench` | nothing — the shipped feature set |+| Needs | `--features rss-bench` | nothing, the shipped feature set || Measures | domain and harness cost in isolation | what the OS charges the shipped binary || Best for | attributing cost to a subsystem | leak hunting, capacity, tail latency |@@ -31,7 +31,7 @@ but attributes less precisely. Use `profile/` to find out *what* costs; usecore's workspace under `--out-dir` and refuses to start if that lands ontmpfs. This is not fussiness: tmpfs pages *are* memory, so the core's diskwrites would be charged against the machine's RAM while the benchmark is- trying to attribute RAM to the core — and a sustained run fills the mount,+ trying to attribute RAM to the core, and a sustained run fills the mount,after which turns fail with "Failed to write auth profile lock owner" andSQLite I/O errors. That looks like a leak-induced meltdown and is a full disk.- **Several GB free.** A 5-minute run at concurrency 8 leaves ~5 GB of memory@@ -116,7 +116,7 @@ Two facts carry the whole design, and a change to either breaks this tier:would trigger, so the benchmark needs no login and the mock needs no authroutes. The driver seeds it before the load starts.-The mock also must not listen on 11434, 8000, 8080, 1234 or 8888 — the core+The mock also must not listen on 11434, 8000, 8080, 1234 or 8888, the coreclassifies those as local-AI endpoints and routes around them. `mock-llm.mjs`refuses to start on one rather than failing mysteriously later.@@ -140,7 +140,7 @@ you reproduce this setup by hand:See [`FINDINGS.md`](./FINDINGS.md) for the longer write-up of these runs.-From a 5-minute run at concurrency 8, tool-depth 1, on one machine — indicative,+From a 5-minute run at concurrency 8, tool-depth 1, on one machine, indicative,not a target, and not yet reproduced across hosts:| Measure | Value |@@ -155,7 +155,7 @@ not a target, and not yet reproduced across hosts:Two findings from that run reproduced across repeats and are worth chasingrather than treating as harness noise: RSS grew ~115 KiB/turn and was **still-growing at the end** (confounded by the 5 GB of workspace growth — needs the+growing at the end** (confounded by the 5 GB of workspace growth, needs thememory-disabled comparison to settle), and **throughput fell to ~37% of itsstarting rate** under constant offered load, which the workspace growth does notobviously explain.@@ -164,11 +164,11 @@ obviously explain.Memory gets three outcomes, and the middle one is the point:-- **pass** — no growth trend, or growth within the per-turn budget.-- **plateau** — grew past the budget overall, but stopped climbing by the final+- **pass**: no growth trend, or growth within the per-turn budget.+- **plateau**: grew past the budget overall, but stopped climbing by the finalthird of the window. The shape of a cache filling to its working set. Worthre-running longer to confirm the plateau holds.-- **fail** — grew past the budget *and was still growing at the end*.+- **fail**: grew past the budget *and was still growing at the end*.That distinction is why the analyzer fits the tail of the series separatelyrather than comparing an early average to a late one. Early-vs-late cannot tell@@ -182,7 +182,7 @@ memory. In practice they are the least ambiguous leak signal available.**Memory verdicts can be `confounded`.** `fresh` thread mode stops conversationhistory accumulating, but it does not stop the agent persisting memory chunks-and embeddings every turn — a 5-minute run writes gigabytes. An index over data+and embeddings every turn, a 5-minute run writes gigabytes. An index over datathat genuinely grew is not a leak. So when RSS fails alongside large workspacegrowth, the report marks the verdict `confounded` and says what it cannot ruleout, rather than asserting a leak it cannot distinguish from correct behaviour.@@ -191,7 +191,7 @@ run long enough that on-disk growth levels off while RSS keeps climbing.**Throughput held / liveness.** The analyzer checks that turns kept completing,because on resource metrics alone a dead process is indistinguishable from a-healthy idle one — flat memory, no CPU, stable threads. An early version of this+healthy idle one, flat memory, no CPU, stable threads. An early version of thisreport gave a confident PASS on a run where the core had stopped answering twothirds of the way in. A total outage additionally marks `livenessBroken`, whichqualifies every other verdict; mere degradation does not, because the process@@ -199,7 +199,7 @@ was still working and its resource numbers remain real.**CPU drift** compares CPU consumed per unit wall time between the start andend of the window. Under constant offered load a rising figure means each turn-is costing more than the last — the CPU analogue of a memory leak, typically an+is costing more than the last, the CPU analogue of a memory leak, typically anunbounded structure being rescanned every turn.### Thread mode decides what you can conclude@@ -212,7 +212,7 @@ unbounded structure being rescanned every turn.Only `fresh` supports a leak verdict. In the other two, conversation historyaccumulates *by design*, so RSS growth is expected and a leak is-indistinguishable from correct behaviour — the analyzer reports the growth rate+indistinguishable from correct behaviour, the analyzer reports the growth rateand explicitly declines to judge it. Use them for contention and tail latency,not for leak hunting.@@ -223,13 +223,13 @@ not for leak hunting.agent loop, not just a single completion)--latency-ms N mean inference latency; realistic values keep many turns--jitter-ms N in flight and change the concurrency profile entirely---reply-chars N reply size — varies serde and allocation pressure+--reply-chars N reply size, varies serde and allocation pressure--fail-rate F fraction of completions answered 500, to exercise retries````--tool-depth 0` measures the RPC and inference path alone. Anything above zeroputs the agent's tool loop under test, which is where per-turn state actually-accumulates — so a leak hunt should use at least 1.+accumulates, so a leak hunt should use at least 1.## Tests@@ -241,8 +241,8 @@ node --test scripts/bench/analyze.test.mjsThe analyzer's failure mode is silence: wrong math reports "pass" on a leakingrun and nobody notices. The tests drive it with synthetic series whose correct-verdict is known by construction — a steady leak, a plateau, a flat line,-thread and FD growth, CPU drift — so a regression in the leak math fails loudly.+verdict is known by construction, a steady leak, a plateau, a flat line,+thread and FD growth, CPU drift, so a regression in the leak math fails loudly.## Further readingdiff --git a/scripts/dep-audit/README.md b/scripts/dep-audit/README.mdindex d36793262c..4fb98b2c1e 100644--- a/scripts/dep-audit/README.md+++ b/scripts/dep-audit/README.md@@ -1,4 +1,4 @@-# `scripts/dep-audit/` — Cargo dependency audit+# `scripts/dep-audit/`: Cargo dependency auditFinds dependencies we can drop, unify, or slim across OpenHuman **and everyCargo submodule under `vendor/`**, using@@ -17,8 +17,8 @@ The run avoids side effects on the tree: `cargo metadata` rewrites a`Cargo.lock` that is stale relative to its manifest ([`crates/openhuman-app`](../../crates/openhuman-app/README.md)'slockfile in particular), or creates one where a target had none, so `run.sh`records each target's lockfile state (present, with its exact contents, or-absent) before analyzing it and restores that state afterwards — restoring on-interruption too — printing which lockfiles it had to put back or remove. It+absent) before analyzing it and restores that state afterwards, restoring on+interruption too, printing which lockfiles it had to put back or remove. Itrefuses to analyze a target whose `Cargo.lock` is a symlink rather thanbacking up and writing through it. Refresh a lockfile deliberately (`cargoupdate` / `cargo generate-lockfile`) if you want it refreshed.@@ -43,8 +43,8 @@ update` / `cargo generate-lockfile`) if you want it refreshed.`run.sh` builds the target list itself, so a new submodule is picked upautomatically:-1. `root` — the OpenHuman workspace ([`Cargo.toml`](../../Cargo.toml) at the repo root).-2. `openhuman-app` — the Tauri host. It is `exclude`d from the root+1. `root`, the OpenHuman workspace ([`Cargo.toml`](../../Cargo.toml) at the repo root).+2. `openhuman-app`, the Tauri host. It is `exclude`d from the rootworkspace and has its own `Cargo.lock`, so it is a separate graph.3. Every entry of `git submodule status --recursive` that has a `Cargo.toml`,named after its directory (`tinyagents`, `tinybus`, `tinycortex`, …).@@ -63,7 +63,7 @@ siblings. `--keep-nested` analyzes every checkout regardless.One row per target with its commit and headline counts. "Crates in graph" isthe `cargo metadata` resolve for every platform (no `--filter-platform`),using each package's **default features** (tinyanalyzer does not pass-`--all-features`) — which is why Windows-only crates appear on a Linux run,+`--all-features`), which is why Windows-only crates appear on a Linux run,why a duplicate listed here may not show in `cargo tree` on your host, andwhy a crate reachable only through a non-default optional feature will notappear at all.@@ -71,12 +71,12 @@ appear at all.### 1. Declared dependencies no source file namestinyanalyzer's check is textual: a dependency is "unused" if no `.rs` file in-the package mentions it *the way Rust code references a dependency* —+the package mentions it *the way Rust code references a dependency* ,`dep_name::…`, `use dep_name`, `extern crate dep_name`, or `dep_name!` (`_`for `-`; `dep_name` is the crate's rename alias when one is declared). Thatmisses crate names inside attributes (`#[tokio::test]`,`#[derive(thiserror::Error)]`), so `report.mjs` re-checks every flag with a-grep over the package's own sources — **the crate's own directory,+grep over the package's own sources, **the crate's own directory,recursively, plus the exact file (not directory) of every `[[test]]` /`[[example]]` / `[[bench]]` / `[[bin]]` / build-script target declared by`path =` in its `Cargo.toml`** (the root crate keeps its integration tests in@@ -117,7 +117,7 @@ Each version is compiled and linked separately. **Only the `root` (andwhere a requirement should move so the root can unify. Within a `root` /`openhuman-app` section, a duplicate reached only through a `development`dependency (see section 1's Kind column) costs test/CI build time, not the-shipped binary — check the Kind before treating a row as production weight.+shipped binary, check the Kind before treating a row as production weight."Pulled in via" names the *direct* dependencies whose subtree carries thatversion, walked from tinyanalyzer's edge list. `direct dep of <pkg>` means one@@ -135,7 +135,7 @@ of our own packages declares it. To unify:### 3. Heaviest direct dependenciesPer target, the direct dependencies with the largest **exclusive** transitive-footprint — crates that would leave the build entirely if this one were+footprint, crates that would leave the build entirely if this one weredropped. "Reaches" is the raw transitive count, most of which something elsepulls in anyway. "Source" is checked-out source size, not binary size. Unlikesection 1, this table excludes a dependency whose only edge kind is@@ -144,8 +144,8 @@ shipped binary, so they do not belong in a shipped-build weight ranking.A high exclusive count usually means default features pulling in a subtree wedo not use. Try `default-features = false` plus the two or three features-needed, then re-run the audit and compare the row. `scripts/dep-sim.py` and-`scripts/assert-shed.sh` remain the tools for *proving* a reduction before+needed, then re-run the audit and compare the row. [`scripts/dep-sim.py`](../dep-sim.py) and+[`scripts/assert-shed.sh`](../assert-shed.sh) remain the tools for *proving* a reduction beforeclaiming it in a PR.### 4. Version drift across repositoriesdiff --git a/scripts/profile/README.md b/scripts/profile/README.mdindex b44ddaaadc..1aca638065 100644--- a/scripts/profile/README.md+++ b/scripts/profile/README.md@@ -13,7 +13,7 @@ Benchmarks run from these scripts, not in CI. For the server-process counterpart## Scripts-### `rss-bench.sh` — embedded agent-roster RSS (#5046)+### `rss-bench.sh`: embedded agent-roster RSS (#5046)Builds the stripped-release `rss-bench` binary, runs its fixture tests, thenmeasures steady-state RSS/PSS of 5 fresh processes × {1, 8} agents against the@@ -25,7 +25,7 @@ CI job until benchmarks moved out of CI../scripts/profile/rss-bench.sh --skip-build --out /path/rss.json```-### `library-bench.sh` — RSS/duration benchmark+### `library-bench.sh`: RSS/duration benchmarkBuilds `library-profile` + `rss-bench`, runs each scenario N times as a freshprocess, and aggregates median/min/max duration, settled RSS, retained delta,@@ -39,7 +39,7 @@ and peak delta into `summary.json` + `summary.md`.Results land in `target/profile/rust-library/bench-<timestamp>/` (or `--out DIR`).-### `library-cpu.sh` — CPU profile via samply+### `library-cpu.sh`: CPU profile via samplyWraps `samply record` around one scenario, isolated from persistence/timezonenoise by default (matching the documented cold-path CPU recipe).@@ -50,7 +50,7 @@ noise by default (matching the documented cold-path CPU recipe).samply load target/profile/rust-library/subagent-storm-cpu.json.gz```-### `library-heap.sh` — live heap attribution via dhat+### `library-heap.sh`: live heap attribution via dhatBuilds the `rss-bench-dhat` variant and runs one scenario under dhat. RSS andtiming numbers from this build are perturbed by instrumentation; use it only@@ -62,7 +62,7 @@ for allocation-site/retained-bytes attribution, not for RSS comparisons.# target/profile/rust-library/dhat-agent-turn.json```-### `library-fleet.sh` — fleet sweep + 2 GB / 2 vCPU budget gate+### `library-fleet.sh`: fleet sweep + 2 GB / 2 vCPU budget gateBuilds `library-profile` + `rss-bench`, sweeps the `fleet` scenario (Nconcurrent live agents with latency-realistic mock inference) across a list@@ -78,17 +78,17 @@ Results land in `target/profile/rust-library/fleet-<timestamp>/` (or`--out DIR`). Exits nonzero if any swept N reports `fits: false` (use`--no-gate` to report only). The script's `--help` documents the budget math.-### `library-instances.sh` — multi-instance (many-processes) sweep+### `library-instances.sh`: multi-instance (many-processes) sweepSpawns N independent `library-profile` processes (each a live instance heldalive via `OPENHUMAN_PROFILE_HOLD_SECS`), staggered on startup, and measures-**per-process** cost and box survivability — the opencompany "N independent+**per-process** cost and box survivability, the opencompany "N independentprocesses/containers" deployment model, as opposed to `library-fleet.sh`'s"N agents in one process" model. Samples aggregate sum-RSS + live count every2s while instances hold, captures a `vm_stat` snapshot at peak (and abest-effort `footprint` sample if that macOS tool is present), thenaggregates per swept N: launched/ok counts, median settled RSS per instance,-mean and peak aggregate sum-RSS, and — on Linux, where it's meaningful —+mean and peak aggregate sum-RSS, and, on Linux, where it's meaningful ,summed PSS.```bash@@ -98,11 +98,11 @@ summed PSS.Results land in `target/profile/rust-library/instances-<timestamp>/` (or`--out DIR`). Refuses to spawn more than `--max-instances` (default 200)-without an explicit raise — see the script's `--help` for the RAM math. Exits+without an explicit raise, see the script's `--help` for the RAM math. Exitsnonzero with `--gate` if any instance failed to complete cleanly (nonzeroexit or missing/invalid JSON); default is report-only.-### `library-pool-gate.sh` — runtime pool regression gate (#5106)+### `library-pool-gate.sh`: runtime pool regression gate (#5106)Drives the `skill-run` scenario with K parallel skill runs and asserts the DoD:with the shared runtime pool ON, the process tree grows by ~one pooled worker,