Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
e0e074d
docs(embed): document core_runtime and re-export embed facade
senamakel Oct 9, 2026
25a3b5f
chore(openhuman-app): route core deps through openhuman-rpc
senamakel Oct 9, 2026
f4e8155
feat(build): forward e2e-test-support feature through crate chain
senamakel Oct 9, 2026
f7c90a8
refactor(cli): route binary deps through openhuman-rpc
senamakel Oct 9, 2026
6468461
feat(cli): add library profile harness and benchmark binaries
senamakel Oct 9, 2026
c8f65ad
chore: I don't see a diff in your message — the "Diff:" section is em…
senamakel Oct 9, 2026
76f993e
chore(cli): add tests for main entry point
senamakel Oct 9, 2026
3a04b1b
refactor(examples): migrate embed examples to the Runtime library API
senamakel Oct 9, 2026
81e27dc
refactor(tui): route feature gates through openhuman-rpc
senamakel Oct 9, 2026
5ec3d55
refactor(crash-reporting): reuse embed's shared sentry client options
senamakel Oct 9, 2026
161d7f8
feat(tui): add session state and controls to the terminal UI
senamakel Oct 9, 2026
c516078
feat(tui): add runner module to the library
senamakel Oct 9, 2026
01f2a90
chore(deps): drop openhuman-core from workspace dependencies
senamakel Oct 9, 2026
fbb0313
chore(deps): update lockfile after dependency changes
senamakel Oct 9, 2026
f5e4d54
refactor(app): remove unused imports and dead code
senamakel Oct 9, 2026
83a214e
feat(app): add local data reset and workspace path handling
senamakel Oct 9, 2026
ec950eb
refactor(core_process): extract process spawn logic into helper
senamakel Oct 9, 2026
4b0f15e
feat(core_process): add core process management
senamakel Oct 9, 2026
446caee
feat(core): add core process management
senamakel Oct 9, 2026
363b2a5
chore(openhuman-app): update embedded server entry point reference
senamakel Oct 9, 2026
7dc3ed6
test(openhuman-app): pin localhost dev fetch noise filter to shared c…
senamakel Oct 9, 2026
9501971
refactor(feature-forwarding): track shell forwarding on openhuman-rpc
senamakel Oct 9, 2026
87430a1
ci(feature-forwarding): check tui and rpc-only host forwarding
senamakel Oct 9, 2026
a7e8ea3
chore(ci): update feature forwarding check comments
senamakel Oct 9, 2026
0e23510
test(feature-forwarding): cover rpc local gates and tui in chain checks
senamakel Oct 9, 2026
fb1337f
chore(ci): add crate dependency chain check script
senamakel Oct 9, 2026
857ce0b
test(scripts): cover crate chain check edge cases
senamakel Oct 9, 2026
b207931
test(scripts): remove unused cpSync import and guard
senamakel Oct 9, 2026
b61ac1e
chore(scripts): add crate chain check to rust:layout
senamakel Oct 9, 2026
7646649
chore(profile): remove library profiling scripts
senamakel Oct 9, 2026
9304b08
test(tool_search): remove intents fixture
senamakel Oct 9, 2026
d61ddcd
docs(cli): trim bin README to the two remaining binaries
senamakel Oct 9, 2026
2f27ac0
docs(openhuman-cli): update README for the rpc-only dependency chain
senamakel Oct 9, 2026
ea80053
docs: note benchmark tooling moved to openhuman-benchmarks
senamakel Oct 9, 2026
2c0d81a
docs(tests): clarify dependency wiring for cli test targets
senamakel Oct 9, 2026
1ec0b5b
docs(ci): document the crate chain check and rpc forwarding
senamakel Oct 9, 2026
bd5a4de
docs(ci): mention check-crate-chain in local run notes
senamakel Oct 9, 2026
1cbf8ab
ci: add crate-chain check to self-hosted lanes
senamakel Oct 9, 2026
2246d81
docs(agents): document the strict Rust crate chain and host boot paths
senamakel Oct 9, 2026
46a9cdd
docs(agents): clarify core process and CLI server guidance
senamakel Oct 9, 2026
a493194
docs(crates): document the strict crate dependency chain
senamakel Oct 9, 2026
b92677f
docs(architecture): document the crate layering chain
senamakel Oct 9, 2026
c0cb689
docs(rpc): update READMEs for the host facade and feature forwarding
senamakel Oct 9, 2026
5a32189
docs(openhuman-app): update README for the openhuman-rpc host and emb…
senamakel Oct 9, 2026
a3ad142
docs(openhuman-tui): update README for the rpc embed facades
senamakel Oct 9, 2026
b8e616a
docs(openhuman-embed): update runtime setup guidance
senamakel Oct 9, 2026
5242f96
style: reformat long expressions to satisfy rustfmt
senamakel Oct 9, 2026
5258b9d
Merge branch 'crate-chain-p3' into crate-chain-p4
senamakel Oct 9, 2026
9c936e8
chore: files changed crates/openhuman-app/Cargo.lock
senamakel Oct 9, 2026
36e0059
Merge branch 'crate-chain-p3' into crate-chain-p4
senamakel Oct 9, 2026
69c8317
Merge branch 'crate-chain-p3' into crate-chain-p4
senamakel Oct 9, 2026
57df989
Merge branch 'crate-chain-p3' into crate-chain-p4
senamakel Oct 9, 2026
16b7269
Merge branch 'crate-chain-p3' into crate-chain-p4
senamakel Oct 9, 2026
43dd4d3
Merge remote-tracking branch 'upstream/main' into crate-chain-p4
senamakel Oct 9, 2026
54473d8
chore(vendor): bump tinyagents, tinymcp, tinysearch and tinyskills
senamakel Oct 9, 2026
8150439
fix(embed): skip live policy install when config is unavailable
senamakel Oct 9, 2026
1ff8616
chore(vendor): bump tinyagents, tinymcp, tinysearch and tinyskills
senamakel Oct 9, 2026
1ee9541
fix(rpc): use crate-relative path for background completion store rel…
senamakel Oct 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/ci-paths-filter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ rust-core:
- 'scripts/ci/assert-coverage-presence.sh'
- 'scripts/ci/coverage-presence-allowlist.txt'
- 'scripts/ci/check-openhuman-rust-layout.mjs'
- 'scripts/ci/check-crate-chain.mjs'
- 'scripts/ci/check-agent-runtime-boundary.mjs'
- 'scripts/ci/agent-runtime-boundary-baseline.json'
- 'scripts/ci/check-saas-ambient.mjs'
Expand Down
70 changes: 50 additions & 20 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ Architecture: [overview](gitbooks/developing/architecture.md),
| Path | Purpose |
| --- | --- |
| `app/src/` | Vite and React frontend |
| `crates/openhuman-app/` | Thin desktop host; excluded from the root workspace, build with `--manifest-path crates/openhuman-app/Cargo.toml` |
| `crates/openhuman-app/` | Thin desktop host; excluded from the root workspace, build with `--manifest-path crates/openhuman-app/Cargo.toml`. Depends on `openhuman-rpc` only and boots its in-process core with `openhuman_rpc::host::desktop` |
| `crates/openhuman-core/` | Package `openhuman`: business domains under `src/<domain>/`, the controller contract, dispatch and auth under `src/core/` |
| `crates/openhuman-core/src/<domain>/` | Flat business-domain modules (agent, memory, tools, security, channels, ...) |
| `crates/openhuman-core/src/core/` | CLI, controller contract (`Outcome`, schemas) and in-process dispatch, controller registry, event bus, runtime composition; no business logic and no JSON-RPC server |
| `crates/openhuman-cli/` | The `openhuman-core` binary (`src/main.rs`), the developer bins (`src/bin/`), and every root `tests/*.rs` / `examples/*.rs` target; depends on `openhuman-tinyhumans` for the backend transport the core does not carry |
| `crates/openhuman-embed/` | Typed library facade for embedding the core in another product |
| `crates/openhuman-rpc/` | JSON-RPC 2.0 over the core: envelopes, HTTP client, and the server (router, Socket.IO, listener, `run_server*`) used by app, CLI and TUI; plus `session_store` (`session-store` feature), the on-disk session store (`session_raw/`, `session_db/`, `tinyagents_store/`, turn states) behind TinyAgents' session store port, which the app, CLI and TUI install. Core and embed reach session state through the port (`agent::session_store`); a few legacy paths still fall back to workspace files when no store is installed. With a storage URL (`OPENHUMAN_STORAGE_URL` / `[storage] url`), `install_for_host` installs TinyAgents' `DriverSessionStores` over that backend instead (core `storage` domain) |
| `crates/openhuman-tinyhumans/` | The TinyHumans layer above embed: SDK-backed backend transport, a `RuntimeBuilder` that boots connected, and the host-side login/session owner (login-token exchange, `/auth/me`, current-user cache, credential handoff) used by app and TUI |
| `crates/openhuman-tui/` | Standalone terminal frontend |
| `crates/openhuman-cli/` | The `openhuman-core` binary (`src/main.rs`, `openhuman_rpc::host::cli`), the ops bins (`src/bin/`: `openhuman-fleet`, `test-mcp-stub`), and every root `tests/*.rs` / `examples/*.rs` target. Normal dependency: `openhuman-rpc` only; the tests reach core, embed and tinyhumans through `[dev-dependencies]`. The benchmark bins live in the openhuman-benchmarks repository |
| `crates/openhuman-embed/` | Library facade over the core (depends on core only): `Runtime`/`RuntimeBuilder` with host presets, `embed::process` (tokio runtime, logging, dotenv, master key, Sentry options), and the curated facades hosts use (`config`, `artifacts`, `chat_surface`, `modules`, `identity`). Its doc-hidden `__host` list is for tinyhumans and rpc only |
| `crates/openhuman-rpc/` | Top of the library chain (depends on tinyhumans only). JSON-RPC 2.0 over the core: envelopes, HTTP client, and the server (router, Socket.IO, listener, `run_server*`); `host::{cli, desktop, tui}`, the shared host boot; re-exports `embed` and `tinyhumans` as the hosts' curated facade; plus `session_store` (`session-store` feature), the on-disk session store (`session_raw/`, `session_db/`, `tinyagents_store/`, turn states) behind TinyAgents' session store port, which the app, CLI and TUI install. Core and embed reach session state through the port (`agent::session_store`); a few legacy paths still fall back to workspace files when no store is installed. With a storage URL (`OPENHUMAN_STORAGE_URL` / `[storage] url`), `install_for_host` installs TinyAgents' `DriverSessionStores` over that backend instead (core `storage` domain) |
| `crates/openhuman-tinyhumans/` | The TinyHumans layer above embed (depends on embed only): SDK-backed backend transport, a `RuntimeBuilder` that boots connected, and the host-side login/session owner (login-token exchange, `/auth/me`, current-user cache, credential handoff) used by app and TUI |
| `crates/openhuman-tui/` | Standalone terminal frontend; depends on `openhuman-rpc` only and boots with `openhuman_rpc::host::tui` |
| `tests/` | Rust integration and JSON-RPC tests |
| `gitbooks/` | Public product and contributor documentation |
| `docs/` | Internal maintainer documentation |
Expand All @@ -30,6 +30,20 @@ Architecture: [overview](gitbooks/developing/architecture.md),
Run commands from the repository root. The root package is a private pnpm
workspace.

The Rust crates form a strict chain; each one's normal dependencies name only
the layer directly below it:

```text
openhuman-core -> openhuman-embed -> openhuman-tinyhumans -> openhuman-rpc -> { app, cli, tui }
```

Hosts (app, CLI, TUI) depend on `openhuman-rpc` alone and reach the core
through its curated facade (`openhuman_rpc::host`, `openhuman_rpc::embed`,
`openhuman_rpc::tinyhumans`), never through `__host` / `core_host` or an
`openhuman_core::` path. `node scripts/ci/check-crate-chain.mjs` (part of
`pnpm rust:layout`) enforces both. Dev-dependencies are exempt, which is how
the root tests keep reaching into the core.

## Product boundaries

- The shipped Tauri product targets Windows, macOS, and Linux.
Expand All @@ -40,8 +54,9 @@ workspace.
- The frontend and Tauri shell present or orchestrate core behavior. Do not
duplicate core policy in TypeScript or shell code.
- The desktop core runs as a tokio task managed by
`crates/openhuman-app/src/core_process.rs`. Frontend RPC uses the per-launch bearer
returned through the `core_rpc_token` command.
`crates/openhuman-app/src/core_process.rs` (`openhuman_rpc::host::desktop`).
Frontend RPC uses the per-launch bearer returned through the
`core_rpc_token` command.
- `OPENHUMAN_CORE_REUSE_EXISTING=1` connects the shell to an external core for
debugging.

Expand Down Expand Up @@ -180,9 +195,10 @@ coverage must be at least 80 percent.
need no entry. Run them as `cargo test -p openhuman-cli --test <name>`.
- A suite that boots the core **in-process** and reaches the backend (mock)
must call `tinyhumans_boot::boot()` from `tests/support/tinyhumans_boot.rs`
first; the core has no backend transport of its own, and without it every
backend call answers `BACKEND_UNAVAILABLE:`. Suites that spawn the
`openhuman-core` binary get it from `main.rs`.
first (it runs `openhuman_tinyhumans::install`, a dev-dependency of
`openhuman-cli`); the core has no backend transport of its own, and without
it every backend call answers `BACKEND_UNAVAILABLE:`. Suites that spawn the
`openhuman-core` binary get it from `main.rs` (`openhuman_rpc::host::cli`).

Shared mock backend:

Expand Down Expand Up @@ -369,14 +385,23 @@ Additional rules:
(`http-client` feature), and the whole server (`server` feature): the axum
router and handlers, auth middleware, Socket.IO, `/dev/connect`, the
listener bind (`openhuman_rpc::server::serve`) and the `run_server*` entry
points. A host that runs `openhuman-core run`/`serve` calls
`openhuman_rpc::server::install_cli_server()` before `run_core_from_args`.
points. `openhuman_rpc::host::cli` gives the core this crate's server as
the `run`/`serve` launcher (the older `install_cli_server()` +
`run_core_from_args` pair does the same for embedders that predate it).
Domain-owned HTTP handlers the router mounts (`inference::http`, the
dictation WebSocket) stay in their domains behind core's `http-server`
feature. The `http_host` static-directory file server lives here too
(`openhuman_rpc::http_host`); `install_cli_server()` and
`build_core_http_router()` register its `http_host.*` controllers as a core
extension, so a host without this crate has no `http_host` surface.
- The hosts boot through `openhuman_rpc::host`: `host::cli(args)` is the
`openhuman-core` binary (and the app's `core` / `mcp` subcommands);
`host::desktop(DesktopOptions, shutdown, ready_tx)` is the desktop shell's
embedded server (in-memory bearer, preferred port with stale-listener
takeover, ready signal); `host::tui()` builds the TUI's runtime. Each
connects the TinyHumans backend itself. One embed runtime exists per
process, so a host that restarts its server must let the old task (and the
runtime it owns) drop before it spawns the next.

## Tool, harness, and runtime boundaries

Expand Down Expand Up @@ -476,11 +501,12 @@ narrow capabilities.

Cargo default features define the contributor build;
`scripts/ci/product-features.txt` defines the shipped product. The Tauri shell
disables default features, so product gates must be forwarded explicitly in
`crates/openhuman-app/Cargo.toml` and checked by
`scripts/ci/check-feature-forwarding.mjs`. The same gate checks the library
chain: a core gate must be forwarded by `openhuman-embed`, then
`openhuman-tinyhumans`, then `openhuman-cli`, or be listed in
disables default features, so product gates must be forwarded explicitly on
its `openhuman-rpc` dependency in `crates/openhuman-app/Cargo.toml` and
checked by `scripts/ci/check-feature-forwarding.mjs`. The same gate checks the
library chain: a core gate must be forwarded by `openhuman-embed`, then
`openhuman-tinyhumans`, then `openhuman-rpc`, then the `openhuman-cli` and
`openhuman-tui` hosts (each to `openhuman-rpc/<gate>`), or be listed in
`CHAIN_GATES_NOT_FORWARDED` / `CHAIN_LOCAL_GATES` with a reason. Test both enabled and disabled
builds after changing a gate. Use `scripts/assert-shed.sh` or
`scripts/dep-sim.py` before claiming a dependency reduction.
Expand Down Expand Up @@ -622,9 +648,13 @@ to them. The `cortexdb` engine likewise calls CortexDB directly with the
user's key. Never add `tinyhumans-sdk` back to the core; the only
crate allowed to depend on it is `openhuman-tinyhumans` (`cargo tree -p
openhuman -i tinyhumans-sdk` must stay empty). Every host that boots a core
(`crates/openhuman-app/src/main.rs` and `lib.rs::run`,
(`crates/openhuman-app/src/core_process.rs` and `lib.rs::run_core_from_args`,
`crates/openhuman-tui/src/runner.rs`, `crates/openhuman-cli/src/main.rs`)
calls `openhuman_tinyhumans::install` first; it also registers the hosted RPC
does it through an `openhuman_rpc::host` entry, which connects the TinyHumans
layer (`openhuman_tinyhumans::RuntimeBuilder::connect`: the transport, as the
process global and bound to the runtime; library hosts call
`openhuman_tinyhumans::install` or the `RuntimeBuilder` directly). Connecting
also registers the hosted RPC
proxies (`billing`, `team`, `referral`, `announcements`, `webhooks`,
`channel_link`, `oauth` — `crates/openhuman-tinyhumans/src/hosted/`) into the
core's controller registry through `core::all::register_controller_extension`
Expand Down
6 changes: 1 addition & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ license = "GPL-3.0-only"
repository = "https://github.com/tinyhumansai/openhuman"

[workspace.dependencies]
openhuman-core = { path = "crates/openhuman-core", package = "openhuman" }
# The library chain: core -> embed -> tinyhumans -> rpc -> app/cli/tui. Hosts
# name `openhuman-rpc` only (`scripts/ci/check-crate-chain.mjs`). There is no
# `openhuman-core` entry on purpose: one spelled here carried the core's whole
# `default` feature set into whichever member named it.
openhuman-rpc = { path = "crates/openhuman-rpc", default-features = false }
openhuman-embed = { path = "crates/openhuman-embed", default-features = false }
openhuman-tinyhumans = { path = "crates/openhuman-tinyhumans", default-features = false }
Expand Down
Loading
Loading