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: standardize punctuation in approval README and testing strategy
Steven Enamakelb8b788bd6249
diff --git a/crates/openhuman-core/src/security/approval/README.md b/crates/openhuman-core/src/security/approval/README.mdindex fdaa4b3a14..815f7ac0cd 100644--- a/crates/openhuman-core/src/security/approval/README.md+++ b/crates/openhuman-core/src/security/approval/README.md@@ -61,11 +61,11 @@ None. This module gates other domains' tools; it owns no tools of its own (no `tPublished via `crate::core::bus::BUS.publish` with variants from `crate::core::events::DomainEvent` (`crates/openhuman-core/src/core/events.rs`):-- `DomainEvent::ApprovalRequested { request_id, tool_name, action_summary, args_redacted, session_id, thread_id, client_id }` — emitted (`gate_intercept.rs`) when a call is parked. Bridged to the `approval_request` web-channel socket event by `ApprovalSurfaceSubscriber` (defined in `crates/openhuman-core/src/web_chat/`).-- `DomainEvent::ApprovalDecided { request_id, tool_name, decision }` — emitted (`gate_state.rs`) when a decision is applied.-- `DomainEvent::FlowApprovalRequested { request_id, flow_id, run_id, tool_name, summary }` — emitted (`gate_intercept.rs`) alongside `ApprovalRequested` when the parked call has a `Workflow` origin. It carries no thread/client id, so `ApprovalSurfaceSubscriber` drops it; `core::socketio` broadcasts it as `flow_approval_request` for the Workflows UI.+- `DomainEvent::ApprovalRequested { request_id, tool_name, action_summary, args_redacted, session_id, thread_id, client_id }`: emitted (`gate_intercept.rs`) when a call is parked. Bridged to the `approval_request` web-channel socket event by `ApprovalSurfaceSubscriber` (defined in `crates/openhuman-core/src/web_chat/`).+- `DomainEvent::ApprovalDecided { request_id, tool_name, decision }`: emitted (`gate_state.rs`) when a decision is applied.+- `DomainEvent::FlowApprovalRequested { request_id, flow_id, run_id, tool_name, summary }`: emitted (`gate_intercept.rs`) alongside `ApprovalRequested` when the parked call has a `Workflow` origin. It carries no thread/client id, so `ApprovalSurfaceSubscriber` drops it; `core::socketio` broadcasts it as `flow_approval_request` for the Workflows UI.-No `bus.rs` in this module — it only publishes; the subscriber (`ApprovalSurfaceSubscriber`) lives in `crates/openhuman-core/src/web_chat/event_bus.rs`.+No `bus.rs` in this module. It only publishes; the subscriber (`ApprovalSurfaceSubscriber`) lives in `crates/openhuman-core/src/web_chat/event_bus.rs`.## Persistence@@ -74,20 +74,20 @@ SQLite DB at `{workspace_dir}/approval/approval.db`, table `pending_approvals` (## Dependencies- `crate::core::bus::BUS` + `crate::core::events::DomainEvent` to surface approval prompts/decisions.-- `crate::core::all` — `ControllerFuture` / `RegisteredController` for the controller registry.-- `crate::core` (`ControllerSchema`, `FieldSchema`, `TypeSchema`) — schema definitions.-- `crate::rpc::RpcOutcome` — RPC return contract.-- `crate::config::Config` — workspace dir (DB path) + the boot-time `autonomy.auto_approve` snapshot; `config::ops::add_auto_approve_tool` to persist "Always allow".-- `crate::security` — `live_policy::current()` for the live "Always allow" list and `POLICY_DENIED_MARKER` for deny reasons.-- `tinymemory_core::store::safety::sanitize_text` — scrub secrets out of stored execution-error strings.+- `crate::core::all`: `ControllerFuture` / `RegisteredController` for the controller registry.+- `crate::core` (`ControllerSchema`, `FieldSchema`, `TypeSchema`): schema definitions.+- `crate::rpc::RpcOutcome`: RPC return contract.+- `crate::config::Config`: workspace dir (DB path) plus the boot-time `autonomy.auto_approve` snapshot; `config::ops::add_auto_approve_tool` persists "Always allow".+- `crate::security`: `live_policy::current()` for the live "Always allow" list and `POLICY_DENIED_MARKER` for deny reasons.+- `tinymemory_core::store::safety::sanitize_text`: scrub secrets out of stored execution-error strings.## Used by-- `crates/openhuman-core/src/core/jsonrpc.rs` — installs the global gate (`ApprovalGate::init_global`) at startup; wires the approval RPCs.-- `crates/openhuman-core/src/core/all.rs` — registers the controller schemas.-- `crates/openhuman-core/src/agent/tinyagents/middleware.rs` (`ApprovalSecurityMiddleware`, a `wrap_tool` middleware on every turn path) — routes external-effect tool calls through the gate before `execute()` and records the terminal audit row.-- `crates/openhuman-core/src/web_chat/` — sets `APPROVAL_CHAT_CONTEXT`, hosts `ApprovalSurfaceSubscriber`, and routes typed yes/no replies to `approval_decide`.-- `crates/openhuman-core/src/channels/proactive.rs`, `crates/openhuman-core/src/agent/triage/escalation.rs`, `crates/openhuman-core/src/tools/impl/system/install_tool.rs`, `crates/openhuman-core/src/web3/wallet/execution.rs` — interact with the gate / approval types.+- `crates/openhuman-core/src/core/jsonrpc.rs`: installs the global gate (`ApprovalGate::init_global`) at startup and wires the approval RPCs.+- `crates/openhuman-core/src/core/all.rs`: registers the controller schemas.+- `crates/openhuman-core/src/agent/tinyagents/middleware.rs` (`ApprovalSecurityMiddleware`, a `wrap_tool` middleware on every turn path): routes external-effect tool calls through the gate before `execute()` and records the terminal audit row.+- `crates/openhuman-core/src/web_chat/`: sets `APPROVAL_CHAT_CONTEXT`, hosts `ApprovalSurfaceSubscriber`, and routes typed yes/no replies to `approval_decide`.+- `crates/openhuman-core/src/channels/proactive.rs`, `crates/openhuman-core/src/agent/triage/escalation.rs`, `crates/openhuman-core/src/tools/impl/system/install_tool.rs`, `crates/openhuman-core/src/web3/wallet/execution.rs`: interact with the gate / approval types.## Notes / gotchas@@ -99,10 +99,10 @@ SQLite DB at `{workspace_dir}/approval/approval.db`, table `pending_approvals` (- **Interactive only.** With no `ApprovalChatContext` task-local in scope, `intercept` returns `Allow` immediately (no row, no event) so autonomous turns don't stall on a prompt nobody can answer.- **Fail-closed everywhere.** Persist failure, channel drop, and TTL timeout all return `Deny` (with a `POLICY_DENIED_MARKER`-prefixed reason). The TTL path re-reads the persisted decision to honor an approve that committed in the timeout race (PR #2367).- **Waiter registered before persist** so a fast `approval_decide` can't mark a request approved while no waiter exists (PR #2149).-- **Orphan rows are intentionally preserved** across launches (issue #1339); deciding one is a DB-only audit update — no side effect can fire across processes, so the security invariant holds.-- **`approve_always_for_tool` persistence is the RPC handler's job**, not the gate's — `gate.decide` only resolves the parked future and emits the audit event; `rpc::approval_decide` appends to `autonomy.auto_approve` + reloads the live policy (best-effort; failure degrades to prompting again).+- **Orphan rows are intentionally preserved** across launches (issue #1339); deciding one is a DB-only audit update, and no side effect can fire across processes, so the security invariant holds.+- **`approve_always_for_tool` persistence is the RPC handler's job**, not the gate's: `gate.decide` only resolves the parked future and emits the audit event; `rpc::approval_decide` appends to `autonomy.auto_approve` and reloads the live policy (best-effort; failure degrades to prompting again).- `OPENHUMAN_APPROVAL_GATE=0`/`false` skips installing the gate for CLI, Docker, and library hosts only (`approval_gate_boot_decision` in `crates/openhuman-core/src/core/types.rs`, applied in `core/jsonrpc.rs`); the Tauri shell always installs it and ignores the override. Where honored, `Prompt`-class calls run unprompted.-- **A disabled autonomy policy parks nothing.** With `[autonomy] enabled = false` (the shipped default, see `security/README.md`) `SecurityPolicy::gate_decision` answers `Allow` for every class, so the acting tools' `external_effect_with_args` — which asks for `GateDecision::Prompt` — is `false` and the gate is never reached. The gate is still installed and still works the moment the policy is turned on; nothing here is special-cased on the flag.+- **A disabled autonomy policy parks nothing.** With `[autonomy] enabled = false` (the shipped default, see `security/README.md`) `SecurityPolicy::gate_decision` answers `Allow` for every class, so the acting tools' `external_effect_with_args` (which asks for `GateDecision::Prompt`) is `false` and the gate is never reached. The gate is still installed and still works the moment the policy is turned on; nothing here is special-cased on the flag.- A prior list-based `ApprovalManager` was removed; the gate is now the sole control reading the `autonomy.auto_approve` allowlist.## Testsdiff --git a/gitbooks/developing/testing-strategy.md b/gitbooks/developing/testing-strategy.mdindex ea11fc6721..4335e321da 100644--- a/gitbooks/developing/testing-strategy.md+++ b/gitbooks/developing/testing-strategy.md@@ -211,7 +211,7 @@ error: failed to get `tinytools` as a dependency of package `openhuman-cli v0.63```**Check content, never status.** `git submodule status` prints `-` only for-*unregistered* modules, and registration happens **before** checkout — so a+*unregistered* modules, and registration happens **before** checkout, so amid-flight init reads as ready while every working tree is still empty.Observed mid-`update --init`: **13 `+`, 3 ` `, zero `-`** while `du -sh vendor`was **120K** and `ls vendor/tinychannels` was empty.