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
chore: rename `RpcOutcome` to `Outcome` across the codebase
Steven Enamakel6ae3785748ac
diff --git a/.claude/agents/pr-reviewer.md b/.claude/agents/pr-reviewer.mdindex f2a866f842..c3bc8add00 100644--- a/.claude/agents/pr-reviewer.md+++ b/.claude/agents/pr-reviewer.md@@ -44,7 +44,7 @@ Skipping this step produces shallow reviews that miss architectural/consistency### 4. Analyze against these axes-**Correctness** — logic bugs, off-by-one, null/undefined, async/await misuse, race conditions, error propagation (`Result<T>` / `RpcOutcome<T>` / thrown errors).+**Correctness** — logic bugs, off-by-one, null/undefined, async/await misuse, race conditions, error propagation (`Result<T>` / `Outcome<T>` / thrown errors).**Project standards** (from `AGENTS.md`; `CLAUDE.md` is a symlink to it)- New Rust functionality lives in a subdirectory under `crates/openhuman-core/src/<domain>/`, not flat `crates/openhuman-core/src/*.rs` files or `crates/openhuman-core/src/core/`.@@ -145,7 +145,7 @@ sequenceDiagram## Verified / looks good<Short bullets of things you explicitly checked and consider correct — signals the review was thorough, not just looking for things to complain about.>-- Error paths in `foo.rs` propagate `RpcOutcome<T>` correctly.+- Error paths in `foo.rs` propagate `Outcome<T>` correctly.- New Vitest in `Foo.test.tsx` exercises the empty + error states.---diff --git a/AGENTS.md b/AGENTS.mdindex 163483ef7d..c54d0e0ddf 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -294,7 +294,7 @@ Preferred module shape:| `mod.rs` | Module declarations, re-exports, and controller aggregators || `types.rs` | Serde domain types || `store.rs` | Persistence |-| `ops.rs` | Business operations returning `RpcOutcome<T>` |+| `ops.rs` | Business operations returning `Outcome<T>` || `schemas.rs` | Controller schemas and thin handlers || `tools.rs` | Domain-owned agent tools || `bus.rs` | Event subscribers |@@ -313,7 +313,7 @@ Additional rules:are deduplication keys.- Update `crates/openhuman-core/src/platform/about_app/` when user-visible capabilitieschange.-- The JSON-RPC wire contract lives in `crates/openhuman-rpc/`: `RpcOutcome<T>`,+- The JSON-RPC wire contract lives in `crates/openhuman-rpc/`: `Outcome<T>`,`StructuredRpcError`, `unwrap_rpc`, the request/response envelopes(`RpcRequest`, `RpcSuccess`, `RpcFailure`, `request_body`,`decode_response`), the params contract and its validation messages, thediff --git a/app/src/features/share/shareCaption.test.ts b/app/src/features/share/shareCaption.test.tsindex 742d7b812f..ff50ad35a7 100644--- a/app/src/features/share/shareCaption.test.ts+++ b/app/src/features/share/shareCaption.test.ts@@ -11,7 +11,7 @@ describe('extractResponseText', () => {expect(extractResponseText('hello')).toBe('hello');});- test('handles the { result } envelope from RpcOutcome', () => {+ test('handles the { result } envelope from Outcome', () => {expect(extractResponseText({ result: 'hi', logs: ['x'] })).toBe('hi');});diff --git a/app/src/features/share/shareCaption.ts b/app/src/features/share/shareCaption.tsindex cdd734c92d..381872f2c2 100644--- a/app/src/features/share/shareCaption.ts+++ b/app/src/features/share/shareCaption.ts@@ -35,7 +35,7 @@ function buildPrompt(agentOutput: string): string {/*** Extracts the response text from whatever envelope shape the core returns for* `inference_agent_chat_simple`. The op wraps its `String` result via- * `RpcOutcome::single_log`, which serialises to `{ result, logs }`; older/other+ * `Outcome::single_log`, which serialises to `{ result, logs }`; older/other* transports may hand back a bare string or a `{ response }` object. We accept* all three defensively.*/diff --git a/app/src/hooks/useCostDashboard.test.ts b/app/src/hooks/useCostDashboard.test.tsindex 646c4bcb37..0d01329b84 100644--- a/app/src/hooks/useCostDashboard.test.ts+++ b/app/src/hooks/useCostDashboard.test.ts@@ -53,7 +53,7 @@ describe('useCostDashboard', () => {expect(result.current.data?.currency).toBe('USD');});- it('unwraps RpcOutcome `{ result, logs }` envelopes', async () => {+ it('unwraps Outcome `{ result, logs }` envelopes', async () => {mockedCall.mockResolvedValueOnce({ result: fixture, logs: ['info'] });const { result } = renderHook(() => useCostDashboard({ paused: true }));await waitFor(() => expect(result.current.data).not.toBeNull());diff --git a/app/src/hooks/useDictationHotkey.ts b/app/src/hooks/useDictationHotkey.tsindex 564fe1fb96..01c49a6eed 100644--- a/app/src/hooks/useDictationHotkey.ts+++ b/app/src/hooks/useDictationHotkey.ts@@ -83,7 +83,7 @@ export function useDictationHotkey(): DictationHotkeyState {return;}- // Handle RpcOutcome wrapper — the result may be nested in .result+ // Handle Outcome wrapper — the result may be nested in .resultconst s = ('result' in settings ? (settings as Record<string, unknown>).result : settings) as DictationSettings;diff --git a/app/src/lib/bootCheck/index.ts b/app/src/lib/bootCheck/index.tsindex adf97cca95..ee4cf82da8 100644--- a/app/src/lib/bootCheck/index.ts+++ b/app/src/lib/bootCheck/index.ts@@ -156,12 +156,12 @@ type VersionCheckResult = 'match' | 'outdated' | 'noVersionMethod' | 'unreachablasync function checkVersion(callRpc: BootCheckTransport['callRpc']): Promise<VersionCheckResult> {try {- // `openhuman.update_version` is wrapped by RpcOutcome::single_log+ // `openhuman.update_version` is wrapped by Outcome::single_log// (see crates/openhuman-core/src/platform/update/ops.rs + crates/openhuman-rpc/src/mod.rs::into_cli_compatible_json):// when logs are present the response shape is `{ result: VersionInfo, logs }`,// and VersionInfo is `{ version, target_triple, asset_prefix }`. Earlier// attempts read `result.version_info.version` (no such field) and then- // `result.version` (skipped the RpcOutcome `result` wrapper) — both+ // `result.version` (skipped the Outcome `result` wrapper) — both// yielded '' and pinned every boot to "outdated local".const response = await callRpc<{ result?: { version?: string } }>('openhuman.update_version',diff --git a/app/src/lib/composio/composioApi.ts b/app/src/lib/composio/composioApi.tsindex 4e2f0dd79d..059316ab13 100644--- a/app/src/lib/composio/composioApi.ts+++ b/app/src/lib/composio/composioApi.ts@@ -28,8 +28,8 @@ import type {} from './types';/**- * Every `composio_*` op on the Rust side returns an `RpcOutcome` with a- * user-visible log line attached. `RpcOutcome::into_cli_compatible_json`+ * Every `composio_*` op on the Rust side returns an `Outcome` with a+ * user-visible log line attached. `Outcome::into_cli_compatible_json`* (see `crates/openhuman-rpc/src/mod.rs`) therefore wraps the payload as* `{ "result": <flat shape>, "logs": [...] }` before handing it to the* JSON-RPC layer. This helper peels that envelope back off so everydiff --git a/app/src/pages/onboarding/steps/ContextGatheringStep.tsx b/app/src/pages/onboarding/steps/ContextGatheringStep.tsxindex 63c3ad532b..47e3c098bd 100644--- a/app/src/pages/onboarding/steps/ContextGatheringStep.tsx+++ b/app/src/pages/onboarding/steps/ContextGatheringStep.tsx@@ -46,7 +46,7 @@ interface ContextGatheringStepProps {onBack?: () => void;}-/** Unwrap the RpcOutcome CLI envelope the core wraps around responses. */+/** Unwrap the Outcome CLI envelope the core wraps around responses. */function unwrapCliEnvelope<T>(value: unknown): T {if (value !== null &&diff --git a/app/src/services/api/agentContextApi.ts b/app/src/services/api/agentContextApi.tsindex 37387ab508..eb66cca38f 100644--- a/app/src/services/api/agentContextApi.ts+++ b/app/src/services/api/agentContextApi.ts@@ -39,7 +39,7 @@ function isSection(value: unknown): value is ContextBreakdownSection {return typeof section.label === 'string' && typeof section.est_tokens === 'number';}-/** Accept the bare response or the `{ result, logs }` RpcOutcome envelope. */+/** Accept the bare response or the `{ result, logs }` Outcome envelope. */function unwrap(response: unknown): Record<string, unknown> | null {if (!response || typeof response !== 'object') return null;const record = response as Record<string, unknown>;diff --git a/app/src/services/api/agentRegistryApi.ts b/app/src/services/api/agentRegistryApi.tsindex 2a86e1a7e9..adf090748b 100644--- a/app/src/services/api/agentRegistryApi.ts+++ b/app/src/services/api/agentRegistryApi.ts@@ -4,7 +4,7 @@* user-authored custom agents, their enable/disable state, and tool policy.** Wire shape note: the Rust handlers return the bare controller payload- * (RpcOutcome → `into_cli_compatible_json` serializes `data` directly), so+ * (Outcome → `into_cli_compatible_json` serializes `data` directly), so* `agent_registry_list` resolves to `{ agents }`, the mutating calls to* `{ agent }`, and remove to `{ removed }`. Entries serialize with* snake_case fields (no serde rename), so the TS shape matches that.diff --git a/app/src/services/api/approvalApi.ts b/app/src/services/api/approvalApi.tsindex 9fb5b95d1a..a9d792b12b 100644--- a/app/src/services/api/approvalApi.ts+++ b/app/src/services/api/approvalApi.ts@@ -8,7 +8,7 @@ import { callCoreRpc } from '../coreRpcClient';// approval gate through the controller registry; this client only READS them —// decisions still flow through `openhuman.approval_decide` (ApprovalRequestCard).//-// Wire-shape note: both RPCs return an `RpcOutcome` with a single diagnostic+// Wire-shape note: both RPCs return an `Outcome` with a single diagnostic// log line when the gate is installed, so the JSON-RPC `result` is the// CLI-compatible envelope `{ result: [...rows], logs: [...] }`. When the gate// is NOT installed the core returns a bare `[]`. `unwrapRows` normalizes both.diff --git a/app/src/services/api/flowsApi.test.ts b/app/src/services/api/flowsApi.test.tsindex f2fa02b9fe..68ea722339 100644--- a/app/src/services/api/flowsApi.test.ts+++ b/app/src/services/api/flowsApi.test.ts@@ -27,7 +27,7 @@ vi.mock('../../lib/workflows/workflowProposal', async importOriginal => {return { ...actual, coerceWorkflowProposal: vi.fn(actual.coerceWorkflowProposal) };});-/** Every `flows_*` handler wraps its payload via `RpcOutcome::single_log`. */+/** Every `flows_*` handler wraps its payload via `Outcome::single_log`. */function cliEnvelope<T>(result: T,logs: string[] = ['did something']diff --git a/app/src/services/api/flowsApi.ts b/app/src/services/api/flowsApi.tsindex d54e37f3f9..df032c32c6 100644--- a/app/src/services/api/flowsApi.ts+++ b/app/src/services/api/flowsApi.ts@@ -12,7 +12,7 @@* - `flows_get` — a single flow by id, graph included (B5b.1 canvas)** Wire shape note: every `crates/openhuman-core/src/flows/ops.rs` handler returns its- * value via `RpcOutcome::single_log(value, "...")`, which+ * value via `Outcome::single_log(value, "...")`, which* `into_cli_compatible_json` ALWAYS wraps as `{ result: value, logs: [...] }`* (see `crates/openhuman-rpc/src/mod.rs`) because a log message is always attached. `callCoreRpc`* already unwraps the outer JSON-RPC envelope, so the value this client@@ -340,11 +340,11 @@ function asRecord(value: unknown): Record<string, unknown> | null {}/**- * Every `flows_*` handler goes through `RpcOutcome::single_log`, so the value+ * Every `flows_*` handler goes through `Outcome::single_log`, so the value* `callCoreRpc` resolves is always `{ result: <payload>, logs: string[] }`.* Peel that back to `<payload>`. Falls through unchanged if the shape doesn't* match (defensive — keeps this client working if a future handler switches- * to a log-less `RpcOutcome::new` and stops wrapping).+ * to a log-less `Outcome::new` and stops wrapping).*/function unwrapCliEnvelope<T>(payload: unknown): T {const record = asRecord(payload);@@ -477,7 +477,7 @@ export async function getFlowRun(runId: string): Promise<FlowRun> {* B5a). No params. Unlike the run-surface calls above, the payload IS the* `Flow[]` array directly — there is no outer `{ flows: [...] }` wrapper (see* `crates/openhuman-core/src/flows/ops.rs::flows_list`, which returns `Vec<Flow>`- * straight through `RpcOutcome::single_log`).+ * straight through `Outcome::single_log`).*/export async function listFlows(): Promise<Flow[]> {log('listFlows: request');@@ -508,7 +508,7 @@ export async function setFlowEnabled(id: string, enabled: boolean): Promise<Flow* Canvas, B5b.1). Returns the `Flow` directly (same no-wrapper shape as* `flows_list`'s elements and `flows_set_enabled` — see* `crates/openhuman-core/src/flows/schemas.rs::handle_get`, which delegates straight to- * `ops::flows_get` through `RpcOutcome::single_log`).+ * `ops::flows_get` through `Outcome::single_log`).*/export async function getFlow(id: string): Promise<Flow> {log('getFlow: request id=%s', id);diff --git a/app/src/services/api/goalsApi.ts b/app/src/services/api/goalsApi.tsindex 87f46e1679..57e9752e40 100644--- a/app/src/services/api/goalsApi.ts+++ b/app/src/services/api/goalsApi.ts@@ -42,7 +42,7 @@ function pruneParams<T extends Record<string, unknown>>(params: T): Partial<T> {/** Pull the goal items out of any of the handler response shapes. */function extractItems(res: unknown): GoalItem[] {if (!res || typeof res !== 'object') return [];- // Unwrap the RpcOutcome `{ result, logs }` envelope when present.+ // Unwrap the Outcome `{ result, logs }` envelope when present.const value ='result' in (res as Record<string, unknown>) ? (res as { result: unknown }).result : res;if (!value || typeof value !== 'object') return [];diff --git a/app/src/utils/tauriCommands/aboutApp.ts b/app/src/utils/tauriCommands/aboutApp.tsindex d28e137930..78ee011e80 100644--- a/app/src/utils/tauriCommands/aboutApp.ts+++ b/app/src/utils/tauriCommands/aboutApp.ts@@ -45,7 +45,7 @@ export async function listCapabilities(category?: CapabilityCategory): Promise<Cmethod: 'openhuman.about_app_list',params: category ? { category } : {},});- // RpcOutcome::single_log emits {result, logs}; bare arrays are handled too+ // Outcome::single_log emits {result, logs}; bare arrays are handled too// for forward-compat if logs ever go away.if (Array.isArray(response)) {return response;diff --git a/app/src/utils/tauriCommands/config.ts b/app/src/utils/tauriCommands/config.tsindex 38efdab568..71c0637091 100644--- a/app/src/utils/tauriCommands/config.ts+++ b/app/src/utils/tauriCommands/config.ts@@ -338,7 +338,7 @@ export async function openhumanClaudeCodeAuthStatus(): Promise<ClaudeCodeAuthStaif (!isTauri()) {throw new Error('Not running in Tauri');}- // The core handler returns the value via `RpcOutcome::new(_, vec![])` with no+ // The core handler returns the value via `Outcome::new(_, vec![])` with no// logs, which `into_cli_compatible_json` serializes as the BARE value (not a// `{ result, logs }` envelope). `callCoreRpc` returns the JSON-RPC `result`,// so this resolves directly to the AuthStatus — do NOT read `.result`.diff --git a/app/src/utils/tauriCommands/core.ts b/app/src/utils/tauriCommands/core.tsindex a96199c9bd..812e76227b 100644--- a/app/src/utils/tauriCommands/core.ts+++ b/app/src/utils/tauriCommands/core.ts@@ -284,7 +284,7 @@ export async function getOnboardingCompleted(): Promise<boolean> {const res = await callCoreRpc<boolean | { result: boolean }>({method: 'openhuman.config_get_onboarding_completed',});- // RpcOutcome may wrap value in { result, logs } when logs are present+ // Outcome may wrap value in { result, logs } when logs are presentif (typeof res === 'boolean') return res;if (res && typeof res === 'object' && 'result' in res) return res.result;return false;diff --git a/app/src/utils/tauriCommands/memory.ts b/app/src/utils/tauriCommands/memory.tsindex 2ce269d3d2..71d65d4e84 100644--- a/app/src/utils/tauriCommands/memory.ts+++ b/app/src/utils/tauriCommands/memory.ts@@ -196,7 +196,7 @@ export async function memoryGraphQuery(method: 'openhuman.memory_graph_query',params: { namespace, subject, predicate },});- // RpcOutcome wraps with { result, logs } when logs are present — unwrap if needed.+ // Outcome wraps with { result, logs } when logs are present — unwrap if needed.if (Array.isArray(raw)) return raw;if (raw && typeof raw === 'object' && 'result' in raw && Array.isArray(raw.result))return raw.result;diff --git a/app/src/utils/tauriCommands/memoryTree.test.ts b/app/src/utils/tauriCommands/memoryTree.test.tsindex a7b6a0300c..b18fbb6698 100644--- a/app/src/utils/tauriCommands/memoryTree.test.ts+++ b/app/src/utils/tauriCommands/memoryTree.test.ts@@ -2,7 +2,7 @@* Unit tests for memory_tree RPC wrappers. Mirror the pattern used by* `memory.test.ts` — mock the underlying `callCoreRpc` and assert that* each helper dispatches the right method name + params and unwraps- * `RpcOutcome`'s `{ result, logs }` envelope correctly.+ * `Outcome`'s `{ result, logs }` envelope correctly.*/import { beforeEach, describe, expect, type Mock, test, vi } from 'vitest';diff --git a/app/src/utils/tauriCommands/memoryTree.ts b/app/src/utils/tauriCommands/memoryTree.tsindex 735b1c73bf..0dad16785f 100644--- a/app/src/utils/tauriCommands/memoryTree.ts+++ b/app/src/utils/tauriCommands/memoryTree.ts@@ -6,7 +6,7 @@* shapes mirror the Rust handlers in `crates/openhuman-core/src/memory/tree/read_rpc.rs`* and `schemas.rs`.*- * Responses come back wrapped by `RpcOutcome::single_log` as+ * Responses come back wrapped by `Outcome::single_log` as* `{ result: <T>, logs: string[] }` (single-log envelope). Each helper* unwraps `result` so callers see the bare value the Rust handler* returned, falling back gracefully if a future handler stops emitting@@ -174,7 +174,7 @@ export interface SetLlmRequest {// ── Envelope unwrap helper ────────────────────────────────────────────────/**- * Internal envelope shape produced by `RpcOutcome::single_log` on the+ * Internal envelope shape produced by `Outcome::single_log` on the* Rust side. Every read_rpc handler emits at least one log line, so the* shape will be `{ result, logs }` in practice — but we keep the* fallback path for defensive parsing.diff --git a/crates/openhuman-app/src/imessage_scanner/mod.rs b/crates/openhuman-app/src/imessage_scanner/mod.rsindex a44bcb5915..ee1855b5b6 100644--- a/crates/openhuman-app/src/imessage_scanner/mod.rs+++ b/crates/openhuman-app/src/imessage_scanner/mod.rs@@ -208,7 +208,7 @@ async fn fetch_imessage_gate() -> anyhow::Result<Option<Vec<String>>> {anyhow::bail!("config_get http {}", res.status());}let v: serde_json::Value = res.json().await?;- // JSON-RPC envelope is `{"result": {"logs": [...], "result": <RpcOutcome body>}}`+ // JSON-RPC envelope is `{"result": {"logs": [...], "result": <Outcome body>}}`// so the config lives at `/result/result/config/...`, not `/result/config/...`.let imessage = v.pointer("/result/result/config/channels_config/imessage")diff --git a/crates/openhuman-app/src/local_data_reset.rs b/crates/openhuman-app/src/local_data_reset.rsindex f363f02045..7abbbaab8e 100644--- a/crates/openhuman-app/src/local_data_reset.rs+++ b/crates/openhuman-app/src/local_data_reset.rs@@ -326,7 +326,7 @@ async fn fetch_data_paths(user_id: Option<String>) -> Result<ResolvedDataPaths,.json().await.map_err(|e| format!("config_get_data_paths decode failed: {e}"))?;- // JSON-RPC envelope wraps the `RpcOutcome` result twice:+ // JSON-RPC envelope wraps the `Outcome` result twice:// `{ "result": { "result": { ...paths... }, "logs": [...] } }`.let inner = envelope.pointer("/result/result")diff --git a/crates/openhuman-core/README.md b/crates/openhuman-core/README.mdindex 5ca852f022..9e2bfa7bc9 100644--- a/crates/openhuman-core/README.md+++ b/crates/openhuman-core/README.md@@ -55,7 +55,7 @@ contents inside `mod.rs` behind the feature of the same name. See the| `web3` | High-level web3 surface built on the wallet layer | [README](src/web3/README.md) || `web_chat` | Web/desktop channel turn runner (`channel.web_*` RPC, `WebChannelEvent` bus) | [README](src/web_chat/README.md) |-RPC contract types (`RpcOutcome`, `StructuredRpcError`, the HTTP client) live+RPC contract types (`Outcome`, `StructuredRpcError`, the HTTP client) livein `crates/openhuman-rpc` and are re-exported here as `openhuman_core::rpc` —they are not redefined in this crate.diff --git a/crates/openhuman-core/src/agent/artifacts/README.md b/crates/openhuman-core/src/agent/artifacts/README.mdindex 9009bc3541..62bfa9355e 100644--- a/crates/openhuman-core/src/agent/artifacts/README.md+++ b/crates/openhuman-core/src/agent/artifacts/README.md@@ -16,9 +16,9 @@ renders artifact content itself.| `mod.rs` | `mod` decls and re-exports: `ArtifactKind` / `ArtifactMeta` / `ArtifactStatus`, the producer API (`create_artifact`, `finalize_artifact`, `fail_artifact`, `read_artifact_bytes`), and `all_artifacts_controller_schemas` / `all_artifacts_registered_controllers`. || `types.rs` | `ArtifactKind` (presentation/document/image/other), `ArtifactStatus` (pending/ready/failed), `ArtifactMeta`. Enums serialize lowercase; `parse` is case-insensitive and never errors (unknown kind → `Other`, unknown status → `Pending`). `ArtifactMeta.error` and `.thread_id` are optional, `skip_serializing_if` none. || `store.rs` | All filesystem I/O over `tokio::fs`: `artifacts_root`, `create_artifact`, `finalize_artifact`, `fail_artifact`, `read_artifact_bytes` (`pub`); `save_artifact_meta`, `save_artifact_args`, `read_artifact_args`, `list_artifacts`, `get_artifact`, `delete_artifact` (`pub(crate)`); `validate_artifact_id` / `assert_within_root` sandboxing; the `REGENERATE_TARGET_ID` task-local; `sanitize_filename_stem`. |-| `ops.rs` | RPC business logic returning `RpcOutcome<Value>`: `ai_list_artifacts`, `ai_get_artifact`, `ai_delete_artifact`, `ai_regenerate`. `DEFAULT_LIMIT = 50`, `MAX_LIMIT = 200`. The regenerate path that re-runs `PresentationTool` is `#[cfg(feature = "documents")]`; without the feature `ai_regenerate` returns an error. |+| `ops.rs` | RPC business logic returning `Outcome<Value>`: `ai_list_artifacts`, `ai_get_artifact`, `ai_delete_artifact`, `ai_regenerate`. `DEFAULT_LIMIT = 50`, `MAX_LIMIT = 200`. The regenerate path that re-runs `PresentationTool` is `#[cfg(feature = "documents")]`; without the feature `ai_regenerate` returns an error. || `schemas.rs` | `ControllerSchema`s and `handle_*` fns for the four `ai.*` controllers; param helpers `read_required`, `read_optional_u64`, `read_optional_string` (whitespace-only → absent), `type_name`. |-| `tools.rs` | `ArtifactListTool`, `ArtifactGetTool`, `ArtifactDeleteTool` — shims over `ops` that unwrap the `RpcOutcome` and return `outcome.value` as the `ToolResult` string. |+| `tools.rs` | `ArtifactListTool`, `ArtifactGetTool`, `ArtifactDeleteTool` — shims over `ops` that unwrap the `Outcome` and return `outcome.value` as the `ToolResult` string. || `*_tests.rs` | Sibling test files for each of the above (`#[path]`). |## Public surfacediff --git a/crates/openhuman-core/src/agent/artifacts/ops.rs b/crates/openhuman-core/src/agent/artifacts/ops.rsindex 7734c59ef9..7e653ed202 100644--- a/crates/openhuman-core/src/agent/artifacts/ops.rs+++ b/crates/openhuman-core/src/agent/artifacts/ops.rs@@ -1,7 +1,7 @@use serde_json::{json, Value};use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;// Imports used only by the `documents`-gated presentation regeneration helper// below; when the feature is off the PresentationTool is compiled out.@@ -37,7 +37,7 @@ pub async fn ai_list_artifacts(offset: Option<usize>,limit: Option<usize>,thread_id: Option<&str>,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let offset = offset.unwrap_or(0);let limit = limit.unwrap_or(DEFAULT_LIMIT).min(MAX_LIMIT);log::debug!(@@ -60,7 +60,7 @@ pub async fn ai_list_artifacts("offset": offset,"limit": limit,});- Ok(RpcOutcome::new(value, vec![]))+ Ok(Outcome::new(value, vec![]))}/// Retrieve a single artifact by ID.@@ -70,7 +70,7 @@ pub async fn ai_list_artifacts(pub async fn ai_get_artifact(config: &Config,artifact_id: &str,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {log::debug!("[artifacts] ai_get_artifact: id={artifact_id} workspace={:?}",config.workspace_dir@@ -106,7 +106,7 @@ pub async fn ai_get_artifact(log::debug!("[artifacts] ai_get_artifact: found id={artifact_id} absolute_path={absolute_path}");- Ok(RpcOutcome::new(value, vec![]))+ Ok(Outcome::new(value, vec![]))}/// Delete an artifact and all associated files.@@ -115,7 +115,7 @@ pub async fn ai_get_artifact(pub async fn ai_delete_artifact(config: &Config,artifact_id: &str,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {log::debug!("[artifacts] ai_delete_artifact: id={artifact_id} workspace={:?}",config.workspace_dir@@ -132,7 +132,7 @@ pub async fn ai_delete_artifact("artifact_id": artifact_id,"deleted": true,});- Ok(RpcOutcome::new(value, vec![]))+ Ok(Outcome::new(value, vec![]))}/// Re-dispatch the producing tool for a failed (or any) artifact using@@ -161,7 +161,7 @@ pub async fn ai_regenerate(artifact_id: &str,thread_id: &str,client_id: &str,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {log::info!("[artifacts] ai_regenerate: id={artifact_id} thread_id={thread_id} client_id={client_id} workspace={:?}",config.workspace_dir@@ -197,7 +197,7 @@ async fn regenerate_presentation(artifact_id: &str,thread_id: &str,client_id: &str,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let args = store::read_artifact_args(&config.workspace_dir, artifact_id).await?;// A fresh policy from the live config — cheap, sync, and mirrors how@@ -240,7 +240,7 @@ async fn regenerate_presentation("regenerated": true,"is_error": tool_result.is_error,});- Ok(RpcOutcome::new(value, vec![]))+ Ok(Outcome::new(value, vec![]))}Err(err) => Err(format!("[artifacts] regenerate execution error for id={artifact_id}: {err}"@@ -257,7 +257,7 @@ async fn regenerate_presentation(artifact_id: &str,_thread_id: &str,_client_id: &str,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {log::debug!("[artifacts] presentation regeneration rejected for id={artifact_id}: built without the `documents` feature");diff --git a/crates/openhuman-core/src/agent/artifacts/schemas.rs b/crates/openhuman-core/src/agent/artifacts/schemas.rsindex a6f4a64b1c..3d78e60853 100644--- a/crates/openhuman-core/src/agent/artifacts/schemas.rs+++ b/crates/openhuman-core/src/agent/artifacts/schemas.rs@@ -4,7 +4,7 @@ use serde_json::{Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub fn all_controller_schemas() -> Vec<ControllerSchema> {vec![@@ -356,7 +356,7 @@ fn read_optional_u64(params: &Map<String, Value>, key: &str) -> Result<Option<u6}}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/agent/artifacts/tools.rs b/crates/openhuman-core/src/agent/artifacts/tools.rsindex f7b04ce3ff..34a8bbc51e 100644--- a/crates/openhuman-core/src/agent/artifacts/tools.rs+++ b/crates/openhuman-core/src/agent/artifacts/tools.rs@@ -1,7 +1,7 @@//! LLM-callable wrappers over the artifacts metadata domain.//!//! Each tool is a thin shim over a read/delete handler in-//! [`crate::agent::artifacts::ops`], unwrapping the `RpcOutcome`+//! [`crate::agent::artifacts::ops`], unwrapping the `Outcome`//! envelope and emitting the inner JSON value. The artifacts domain owns//! agent-generated files (presentations/documents/images) under//! `<workspace>/artifacts/`; these tools let the agent enumerate anddiff --git a/crates/openhuman-core/src/agent/context_breakdown.rs b/crates/openhuman-core/src/agent/context_breakdown.rsindex 5fec781b23..189b03494b 100644--- a/crates/openhuman-core/src/agent/context_breakdown.rs+++ b/crates/openhuman-core/src/agent/context_breakdown.rs@@ -20,7 +20,7 @@ use serde::{Deserialize, Serialize};use crate::agent::debug::prompt_size::{PromptSizeReport, SectionSize, ToolSize};use crate::agent::debug::DumpPromptOptions;use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// Default agent whose prompt is measured when the caller names none — the/// one every main chat turn actually runs under.@@ -176,7 +176,7 @@ fn tools_section(tools: &[ToolSize]) -> ContextSection {/// given) a `history` section.pub async fn context_breakdown(params: ContextBreakdownParams,-) -> Result<RpcOutcome<ContextBreakdownResponse>, String> {+) -> Result<Outcome<ContextBreakdownResponse>, String> {let config = crate::config::rpc::load_config_with_timeout().await?;let agent_id = params.agent_id@@ -214,7 +214,7 @@ pub async fn context_breakdown(total_est_tokens,context_window,};- Ok(RpcOutcome::new(response, Vec::new()))+ Ok(Outcome::new(response, Vec::new()))}#[cfg(test)]diff --git a/crates/openhuman-core/src/agent/experience/README.md b/crates/openhuman-core/src/agent/experience/README.mdindex 90dfe50900..6c421c9d89 100644--- a/crates/openhuman-core/src/agent/experience/README.md+++ b/crates/openhuman-core/src/agent/experience/README.md@@ -62,7 +62,7 @@ Records are stored through the `Memory` trait (no dedicated DB), served by `Driv- `crate::memory` — `Memory` trait, `MemoryCategory`, `memory::binding::{for_config, for_subtree}` (driver binding behind `DriverMemory`), `memory::api::{provider, recall, types, health}` (the provider contract `DriverMemory` adapts), `memory::safety::sanitize_text` (store-time scrub), `memory::source_scope::as_bus_scope` (explicit recall scope), `memory::preferences::recall_by_vector_over`.- `crate::config` — `Config::load_or_init` for `workspace_dir` and `subsystems.memory` when the RPC handlers bind a store.- `crate::core::all` — `ControllerFuture`, `RegisteredController` for RPC registration.-- `crate::core` — `ControllerSchema`, `FieldSchema`, `TypeSchema` (schema types); `crate::rpc::RpcOutcome`.+- `crate::core` — `ControllerSchema`, `FieldSchema`, `TypeSchema` (schema types); `crate::rpc::Outcome`.- `crate::memory::tool_memory::test_helpers::MockMemory` and `crate::memory::guard::test_support::RecordingProvider` — tests only.## Used bydiff --git a/crates/openhuman-core/src/agent/experience/ops.rs b/crates/openhuman-core/src/agent/experience/ops.rsindex b4deee3bc6..f52d39a020 100644--- a/crates/openhuman-core/src/agent/experience/ops.rs+++ b/crates/openhuman-core/src/agent/experience/ops.rs@@ -20,7 +20,7 @@ use crate::memory::api::types::{MemoryCategory, MemoryEntry, MemoryTaint, NamespaceSummary, RecallOpts,};use crate::memory::Memory;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use async_trait::async_trait;use std::collections::BTreeMap;use std::sync::Arc;@@ -304,13 +304,13 @@ async fn open_query_stores() -> Result<Vec<AgentExperienceStore>, String> {Ok(vec![open_store().await?])}-pub async fn capture(params: CaptureParams) -> Result<RpcOutcome<AgentExperience>, String> {+pub async fn capture(params: CaptureParams) -> Result<Outcome<AgentExperience>, String> {let store = open_store().await?;let stored = store.put(params.experience).await?;- Ok(RpcOutcome::single_log(stored, "agent experience captured"))+ Ok(Outcome::single_log(stored, "agent experience captured"))}-pub async fn retrieve(params: RetrieveParams) -> Result<RpcOutcome<Vec<ExperienceHit>>, String> {+pub async fn retrieve(params: RetrieveParams) -> Result<Outcome<Vec<ExperienceHit>>, String> {let stores = open_query_stores().await?;let max_hits = params.max_hits.unwrap_or(5);let query = ExperienceQuery {@@ -322,10 +322,10 @@ pub async fn retrieve(params: RetrieveParams) -> Result<RpcOutcome<Vec<Experiencmax_hits,};let hits = retrieve_across_stores(&stores, query).await?;- Ok(RpcOutcome::single_log(hits, "agent experiences retrieved"))+ Ok(Outcome::single_log(hits, "agent experiences retrieved"))}-pub async fn list(_params: ListParams) -> Result<RpcOutcome<Vec<AgentExperience>>, String> {+pub async fn list(_params: ListParams) -> Result<Outcome<Vec<AgentExperience>>, String> {let stores = open_query_stores().await?;let mut by_id: BTreeMap<String, AgentExperience> = BTreeMap::new();for store in stores {@@ -345,19 +345,19 @@ pub async fn list(_params: ListParams) -> Result<RpcOutcome<Vec<AgentExperience>.cmp(&a.updated_at_ms).then_with(|| a.id.cmp(&b.id))});- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(experiences,"agent experiences listed",))}-pub async fn dismiss(params: DismissParams) -> Result<RpcOutcome<DismissResult>, String> {+pub async fn dismiss(params: DismissParams) -> Result<Outcome<DismissResult>, String> {let stores = open_query_stores().await?;let mut dismissed = false;for store in stores {dismissed |= store.dismiss(¶ms.id).await?;}- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(DismissResult {id: params.id,dismissed,diff --git a/crates/openhuman-core/src/agent/experience/schemas.rs b/crates/openhuman-core/src/agent/experience/schemas.rsindex f63089494c..4539c5d59e 100644--- a/crates/openhuman-core/src/agent/experience/schemas.rs+++ b/crates/openhuman-core/src/agent/experience/schemas.rs@@ -4,7 +4,7 @@ use serde_json::{Map, Value};use crate::agent::experience::ops::{CaptureParams, DismissParams, ListParams, RetrieveParams};use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub fn all_controller_schemas() -> Vec<ControllerSchema> {vec![@@ -201,7 +201,7 @@ fn read_params<T: DeserializeOwned>(params: Map<String, Value>) -> Result<T, Strserde_json::from_value(Value::Object(params)).map_err(|e| e.to_string())}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/agent/learning/README.md b/crates/openhuman-core/src/agent/learning/README.mdindex fe8f54e68a..d065b368e3 100644--- a/crates/openhuman-core/src/agent/learning/README.md+++ b/crates/openhuman-core/src/agent/learning/README.md@@ -107,7 +107,7 @@ These are subscriber registrations rather than a single `bus.rs`; subscriptions- `crate::integrations::composio` — `composio::client` (Gmail fetch for enrichment) and `composio::profile_md` (`replace_managed_block` for `PROFILE.md`).- `crate::integrations` — `build_client` / `IntegrationClient` for the Apify scrape call.- `crate::core::bus` / `crate::core::events` / `tinybus` — `BUS.publish` / `BUS.subscribe`, `DomainEvent::CacheRebuilt`, and `tinybus::{EventHandler, SubscriptionHandle}`.-- `crate::core::all` / `crate::rpc` — controller registry types (`RegisteredController`, `ControllerFuture`) and `RpcOutcome` (the latter re-exported from the `openhuman-rpc` crate via `pub use openhuman_rpc as rpc` in `lib.rs`).+- `crate::core::all` / `crate::rpc` — controller registry types (`RegisteredController`, `ControllerFuture`) and `Outcome` (the latter re-exported from the `openhuman-rpc` crate via `pub use openhuman_rpc as rpc` in `lib.rs`).## Used bydiff --git a/crates/openhuman-core/src/agent/learning/schemas/facet_handlers.rs b/crates/openhuman-core/src/agent/learning/schemas/facet_handlers.rsindex 0360ecf899..3c71810965 100644--- a/crates/openhuman-core/src/agent/learning/schemas/facet_handlers.rs+++ b/crates/openhuman-core/src/agent/learning/schemas/facet_handlers.rs@@ -4,7 +4,7 @@use serde_json::{Map, Value};use crate::core::all::ControllerFuture;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::{facet_to_json, forget_facet_log, full_key, get_cache};@@ -69,7 +69,7 @@ pub(super) fn handle_list_facets(params: Map<String, Value>) -> ControllerFuture)];let payload = serde_json::json!({ "facets": facets, "count": count });- RpcOutcome::new(payload, log).into_cli_compatible_json()+ Outcome::new(payload, log).into_cli_compatible_json()})}@@ -112,7 +112,7 @@ pub(super) fn handle_get_facet(params: Map<String, Value>) -> ControllerFuture {let log = vec![format!("learning.get_facet: key={fk} found={found}")];let payload = serde_json::json!({ "facet": facet_val, "found": found });- RpcOutcome::new(payload, log).into_cli_compatible_json()+ Outcome::new(payload, log).into_cli_compatible_json()})}@@ -170,7 +170,7 @@ pub(super) fn handle_update_facet(params: Map<String, Value>) -> ControllerFutur"learning.update_facet: key={fk} new_value={new_value} user_state=pinned")];let payload = serde_json::json!({ "facet": facet_to_json(&updated) });- RpcOutcome::new(payload, log).into_cli_compatible_json()+ Outcome::new(payload, log).into_cli_compatible_json()})}@@ -214,7 +214,7 @@ pub(super) fn handle_pin_facet(params: Map<String, Value>) -> ControllerFuture {let log = vec![format!("learning.pin_facet: key={fk} user_state=pinned")];let payload = serde_json::json!({ "facet": facet_to_json(&facet) });- RpcOutcome::new(payload, log).into_cli_compatible_json()+ Outcome::new(payload, log).into_cli_compatible_json()})}@@ -258,7 +258,7 @@ pub(super) fn handle_unpin_facet(params: Map<String, Value>) -> ControllerFuturelet log = vec![format!("learning.unpin_facet: key={fk} user_state=auto")];let payload = serde_json::json!({ "facet": facet_to_json(&facet) });- RpcOutcome::new(payload, log).into_cli_compatible_json()+ Outcome::new(payload, log).into_cli_compatible_json()})}@@ -316,7 +316,7 @@ pub(super) fn handle_forget_facet(params: Map<String, Value>) -> ControllerFuturlet log = forget_facet_log(&fk, dropped);let payload = serde_json::json!({ "facet": facet_json });- RpcOutcome::new(payload, log).into_cli_compatible_json()+ Outcome::new(payload, log).into_cli_compatible_json()})}@@ -343,6 +343,6 @@ pub(super) fn handle_reset_cache(_params: Map<String, Value>) -> ControllerFutur"deleted": deleted,"pinned_preserved": pinned_preserved,});- RpcOutcome::new(payload, log).into_cli_compatible_json()+ Outcome::new(payload, log).into_cli_compatible_json()})}diff --git a/crates/openhuman-core/src/agent/learning/schemas/profile_handlers.rs b/crates/openhuman-core/src/agent/learning/schemas/profile_handlers.rsindex f5c05377e0..27b07f8d88 100644--- a/crates/openhuman-core/src/agent/learning/schemas/profile_handlers.rs+++ b/crates/openhuman-core/src/agent/learning/schemas/profile_handlers.rs@@ -5,7 +5,7 @@ use serde_json::{Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::ControllerFuture;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub(super) fn handle_linkedin_enrichment(params: Map<String, Value>) -> ControllerFuture {Box::pin(async move {@@ -28,7 +28,7 @@ pub(super) fn handle_linkedin_enrichment(params: Map<String, Value>) -> Controll"log": result.log,});- RpcOutcome::new(payload, result.log.clone()).into_cli_compatible_json()+ Outcome::new(payload, result.log.clone()).into_cli_compatible_json()})}@@ -75,7 +75,7 @@ pub(super) fn handle_save_profile(params: Map<String, Value>) -> ControllerFuturlet log = vec![format!("learning.save_profile: wrote {bytes} bytes to {path_display} (summarize={summarize})")];- RpcOutcome::new(payload, log).into_cli_compatible_json()+ Outcome::new(payload, log).into_cli_compatible_json()})}@@ -116,7 +116,7 @@ pub(super) fn handle_rebuild_cache(_params: Map<String, Value>) -> ControllerFut"total_size": outcome.total_size,});- RpcOutcome::new(payload, log).into_cli_compatible_json()+ Outcome::new(payload, log).into_cli_compatible_json()})}@@ -182,6 +182,6 @@ pub(super) fn handle_cache_stats(_params: Map<String, Value>) -> ControllerFutur"by_class": by_class,});- RpcOutcome::new(payload, log).into_cli_compatible_json()+ Outcome::new(payload, log).into_cli_compatible_json()})}diff --git a/crates/openhuman-core/src/agent/orchestration/agent_teams/schemas.rs b/crates/openhuman-core/src/agent/orchestration/agent_teams/schemas.rsindex 72145a547e..ffc4deb2d3 100644--- a/crates/openhuman-core/src/agent/orchestration/agent_teams/schemas.rs+++ b/crates/openhuman-core/src/agent/orchestration/agent_teams/schemas.rs@@ -12,7 +12,7 @@ use serde_json::{Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use tinyagents_session::run_ledger::AgentTeamListRequest;use super::runtime;@@ -567,7 +567,7 @@ fn log_err(cid: &str, op: &str, err: anyhow::Error) -> String {}fn to_json<T: serde::Serialize>(value: T) -> Result<Value, String> {- RpcOutcome::new(value, vec![]).into_cli_compatible_json()+ Outcome::new(value, vec![]).into_cli_compatible_json()}fn new_correlation_id() -> String {diff --git a/crates/openhuman-core/src/agent/orchestration/command_center/schemas.rs b/crates/openhuman-core/src/agent/orchestration/command_center/schemas.rsindex 65f0c2c051..8d3b0065c6 100644--- a/crates/openhuman-core/src/agent/orchestration/command_center/schemas.rs+++ b/crates/openhuman-core/src/agent/orchestration/command_center/schemas.rs@@ -7,7 +7,7 @@ use serde_json::{Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// Controller schemas exposed by the command center.pub fn all_controller_schemas() -> Vec<ControllerSchema> {@@ -141,7 +141,7 @@ fn handle_agent_work_control(params: Map<String, Value>) -> ControllerFuture {}fn to_json<T: serde::Serialize>(value: T) -> Result<Value, String> {- RpcOutcome::new(value, vec![]).into_cli_compatible_json()+ Outcome::new(value, vec![]).into_cli_compatible_json()}fn new_correlation_id() -> String {diff --git a/crates/openhuman-core/src/agent/orchestration/subagent_control.rs b/crates/openhuman-core/src/agent/orchestration/subagent_control.rsindex 544f10afc8..d1b65e3cd5 100644--- a/crates/openhuman-core/src/agent/orchestration/subagent_control.rs+++ b/crates/openhuman-core/src/agent/orchestration/subagent_control.rs@@ -20,7 +20,7 @@ use crate::agent::orchestration::running_subagents::{CancelledSubagent, SteerErruse crate::agent::orchestration::{background_completions, running_subagents, subagent_sessions};use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use tinyagents_harness::run_queue::QueueLane;/// Controller schemas exposed for detached sub-agent control.@@ -232,7 +232,7 @@ fn handle_subagent_steer(params: Map<String, Value>) -> ControllerFuture {}fn to_json<T: serde::Serialize>(value: T) -> Result<Value, String> {- RpcOutcome::new(value, vec![]).into_cli_compatible_json()+ Outcome::new(value, vec![]).into_cli_compatible_json()}fn new_correlation_id() -> String {diff --git a/crates/openhuman-core/src/agent/orchestration/subagent_control_tests.rs b/crates/openhuman-core/src/agent/orchestration/subagent_control_tests.rsindex 1bc6d8647a..644528c424 100644--- a/crates/openhuman-core/src/agent/orchestration/subagent_control_tests.rs+++ b/crates/openhuman-core/src/agent/orchestration/subagent_control_tests.rs@@ -33,7 +33,7 @@ async fn cancel_unknown_task_is_a_noop_false() {let mut params = Map::new();params.insert("taskId".into(), json!("sub-does-not-exist"));let out = handle_subagent_cancel(params).await.expect("handler ok");- // RpcOutcome wraps the payload under `data`.+ // Outcome wraps the payload under `data`.let cancelled = out.get("data").and_then(|d| d.get("cancelled"))diff --git a/crates/openhuman-core/src/agent/orchestration/workflow_runs/schemas.rs b/crates/openhuman-core/src/agent/orchestration/workflow_runs/schemas.rsindex 1c7de9f211..13a79ada67 100644--- a/crates/openhuman-core/src/agent/orchestration/workflow_runs/schemas.rs+++ b/crates/openhuman-core/src/agent/orchestration/workflow_runs/schemas.rs@@ -10,7 +10,7 @@ use serde_json::{Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use tinyagents_session::run_ledger::WorkflowRunListRequest;/// Controller schemas exposed by the workflow-runs module.@@ -272,7 +272,7 @@ fn handle_resume(params: Map<String, Value>) -> ControllerFuture {}fn to_json<T: serde::Serialize>(value: T) -> Result<Value, String> {- RpcOutcome::new(value, vec![]).into_cli_compatible_json()+ Outcome::new(value, vec![]).into_cli_compatible_json()}fn new_correlation_id() -> String {diff --git a/crates/openhuman-core/src/agent/orchestration/worktree_schemas.rs b/crates/openhuman-core/src/agent/orchestration/worktree_schemas.rsindex a445040459..ea97203b1f 100644--- a/crates/openhuman-core/src/agent/orchestration/worktree_schemas.rs+++ b/crates/openhuman-core/src/agent/orchestration/worktree_schemas.rs@@ -22,7 +22,7 @@ use serde_json::{json, Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use tinyagents_harness::workspace::{detect_worktree_overlaps, git_worktree_diff_summary, git_worktree_status, list_git_worktrees,remove_git_worktree, GitWorktreeError, GitWorktreeStatus, GIT_WORKTREE_SUBDIR,@@ -291,7 +291,7 @@ fn overlaps_json(worktrees: &[GitWorktreeStatus]) -> Vec<Value> {}fn to_json<T: serde::Serialize>(value: T) -> Result<Value, String> {- RpcOutcome::new(value, vec![]).into_cli_compatible_json()+ Outcome::new(value, vec![]).into_cli_compatible_json()}fn new_correlation_id() -> String {diff --git a/crates/openhuman-core/src/agent/registry/rpc.rs b/crates/openhuman-core/src/agent/registry/rpc.rsindex 8a079b2603..0899616543 100644--- a/crates/openhuman-core/src/agent/registry/rpc.rs+++ b/crates/openhuman-core/src/agent/registry/rpc.rs@@ -3,7 +3,7 @@use serde::{Deserialize, Serialize};use serde_json::Value;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::ops;use super::types::{@@ -21,8 +21,8 @@ pub struct ListResponse {pub agents: Vec<AgentRegistryEntry>,}-pub async fn list_rpc(req: ListRequest) -> Result<RpcOutcome<ListResponse>, String> {- Ok(RpcOutcome::new(+pub async fn list_rpc(req: ListRequest) -> Result<Outcome<ListResponse>, String> {+ Ok(Outcome::new(ListResponse {agents: ops::list_agents(req.include_disabled).await?,},@@ -40,8 +40,8 @@ pub struct AvailableToolsResponse {pub async fn available_tools_rpc(_req: AvailableToolsRequest,-) -> Result<RpcOutcome<AvailableToolsResponse>, String> {- Ok(RpcOutcome::new(+) -> Result<Outcome<AvailableToolsResponse>, String> {+ Ok(Outcome::new(AvailableToolsResponse {tools: ops::available_tools().await?,},@@ -59,8 +59,8 @@ pub struct GetResponse {pub agent: Option<AgentRegistryEntry>,}-pub async fn get_rpc(req: GetRequest) -> Result<RpcOutcome<GetResponse>, String> {- Ok(RpcOutcome::new(+pub async fn get_rpc(req: GetRequest) -> Result<Outcome<GetResponse>, String> {+ Ok(Outcome::new(GetResponse {agent: ops::get_agent(&req.id).await?,},@@ -112,8 +112,8 @@ impl CreateCustomRequest {pub async fn create_custom_rpc(req: CreateCustomRequest,-) -> Result<RpcOutcome<AgentResponse>, String> {- Ok(RpcOutcome::new(+) -> Result<Outcome<AgentResponse>, String> {+ Ok(Outcome::new(AgentResponse {agent: ops::upsert_custom_agent(req.into_entry()).await?,},@@ -133,8 +133,8 @@ pub struct AgentResponse {pub async fn upsert_custom_rpc(req: UpsertCustomRequest,-) -> Result<RpcOutcome<AgentResponse>, String> {- Ok(RpcOutcome::new(+) -> Result<Outcome<AgentResponse>, String> {+ Ok(Outcome::new(AgentResponse {agent: ops::upsert_custom_agent(req.agent).await?,},@@ -149,8 +149,8 @@ pub struct UpdateRequest {pub patch: AgentRegistryPatch,}-pub async fn update_rpc(req: UpdateRequest) -> Result<RpcOutcome<AgentResponse>, String> {- Ok(RpcOutcome::new(+pub async fn update_rpc(req: UpdateRequest) -> Result<Outcome<AgentResponse>, String> {+ Ok(Outcome::new(AgentResponse {agent: ops::update_agent(&req.id, req.patch).await?,},@@ -164,8 +164,8 @@ pub struct SetEnabledRequest {pub enabled: bool,}-pub async fn set_enabled_rpc(req: SetEnabledRequest) -> Result<RpcOutcome<AgentResponse>, String> {- Ok(RpcOutcome::new(+pub async fn set_enabled_rpc(req: SetEnabledRequest) -> Result<Outcome<AgentResponse>, String> {+ Ok(Outcome::new(AgentResponse {agent: ops::set_agent_enabled(&req.id, req.enabled).await?,},@@ -183,8 +183,8 @@ pub struct RemoveResponse {pub removed: bool,}-pub async fn remove_rpc(req: RemoveRequest) -> Result<RpcOutcome<RemoveResponse>, String> {- Ok(RpcOutcome::new(+pub async fn remove_rpc(req: RemoveRequest) -> Result<Outcome<RemoveResponse>, String> {+ Ok(Outcome::new(RemoveResponse {removed: ops::remove_agent(&req.id).await?,},diff --git a/crates/openhuman-core/src/agent/registry/schemas.rs b/crates/openhuman-core/src/agent/registry/schemas.rsindex 11959402a7..326714abb9 100644--- a/crates/openhuman-core/src/agent/registry/schemas.rs+++ b/crates/openhuman-core/src/agent/registry/schemas.rs@@ -5,7 +5,7 @@ use serde_json::{Map, Value};use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::rpc;@@ -322,7 +322,7 @@ fn parse_value<T: DeserializeOwned>(v: Value) -> Result<T, String> {serde_json::from_value(v).map_err(|e| format!("invalid params: {e}"))}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/agent/schemas.rs b/crates/openhuman-core/src/agent/schemas.rsindex a860c4ec09..c7b5f021c1 100644--- a/crates/openhuman-core/src/agent/schemas.rs+++ b/crates/openhuman-core/src/agent/schemas.rs@@ -5,7 +5,7 @@ use serde_json::{Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// Params for `agent.chat` and `agent.chat_simple`.///@@ -731,7 +731,7 @@ fn json_output(name: &'static str, comment: &'static str) -> FieldSchema {}}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/agent/schemas_tests.rs b/crates/openhuman-core/src/agent/schemas_tests.rsindex 4b8bd8d605..f1233455df 100644--- a/crates/openhuman-core/src/agent/schemas_tests.rs+++ b/crates/openhuman-core/src/agent/schemas_tests.rs@@ -165,6 +165,6 @@ async fn triage_handler_rejects_unknown_source_and_to_json_maps_outcome() {.expect_err("unsupported source should fail before runtime dispatch");assert!(err.contains("unsupported trigger source"));- let value = to_json(RpcOutcome::new(json!({ "ok": true }), Vec::new())).expect("json outcome");+ let value = to_json(Outcome::new(json!({ "ok": true }), Vec::new())).expect("json outcome");assert_eq!(value["ok"], json!(true));}diff --git a/crates/openhuman-core/src/agent/session_db/mod.rs b/crates/openhuman-core/src/agent/session_db/mod.rsindex 8012668c1c..125fd01f0e 100644--- a/crates/openhuman-core/src/agent/session_db/mod.rs+++ b/crates/openhuman-core/src/agent/session_db/mod.rs@@ -3,7 +3,7 @@//! The store itself — run ledger rows, child lineage, events, and telemetry —//! lives in [`tinyagents::session::run_ledger`]. Only the controller schemas and//! their handlers stay here, because the RPC envelope, config resolution, and-//! `RpcOutcome` shape are host concerns the runtime crate has no business+//! `Outcome` shape are host concerns the runtime crate has no business//! knowing about.//!//! Call the store directly (`tinyagents_session::run_ledger::…`) ratherdiff --git a/crates/openhuman-core/src/agent/session_db/schemas.rs b/crates/openhuman-core/src/agent/session_db/schemas.rsindex f05bce13f1..fe280df309 100644--- a/crates/openhuman-core/src/agent/session_db/schemas.rs+++ b/crates/openhuman-core/src/agent/session_db/schemas.rs@@ -5,7 +5,7 @@ use serde_json::{Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use tinyagents_session::run_ledger::{AgentRunListRequest, RunEventListRequest};@@ -170,7 +170,7 @@ fn handle_run_ledger_events(params: Map<String, Value>) -> ControllerFuture {}fn to_json<T: serde::Serialize>(value: T) -> Result<Value, String> {- RpcOutcome::new(value, vec![]).into_cli_compatible_json()+ Outcome::new(value, vec![]).into_cli_compatible_json()}fn required_str(name: &'static str, comment: &'static str) -> FieldSchema {diff --git a/crates/openhuman-core/src/agent/session_import/schemas.rs b/crates/openhuman-core/src/agent/session_import/schemas.rsindex ac870c208c..61dc803f3c 100644--- a/crates/openhuman-core/src/agent/session_import/schemas.rs+++ b/crates/openhuman-core/src/agent/session_import/schemas.rs@@ -5,7 +5,7 @@ use serde_json::{Map, Value};use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::ops::run_import;use super::types::ImportOptions;@@ -116,7 +116,7 @@ fn handle_session_import_run(params: Map<String, Value>) -> ControllerFuture {.await.map_err(|e| format!("session import failed: {e:#}"))?;let logs = summary.warnings.clone();- RpcOutcome::new(summary, logs).into_cli_compatible_json()+ Outcome::new(summary, logs).into_cli_compatible_json()})}diff --git a/crates/openhuman-core/src/channels/controllers/README.md b/crates/openhuman-core/src/channels/controllers/README.mdindex 7341bb3538..744e098720 100644--- a/crates/openhuman-core/src/channels/controllers/README.md+++ b/crates/openhuman-core/src/channels/controllers/README.md@@ -9,7 +9,7 @@ Owns the `channels.*` RPC namespace: provider metadata, connect/disconnect lifec| `backend.rs` | `OpenHumanChannelBackend` — the OpenHuman implementation of `tinychannels::ChannelBackend`; `tinychannels::ChannelManager` calls back into it, and each method forwards to the matching `ops` function. `send_outbound_intent` first tries `channels::relay_runtime::send_outbound_intent` when `relay_runtime_fronts_channel` says the relay-websocket transport fronts the channel, then falls back to `ops::channel_send_message` || `definitions.rs` | Re-exports provider metadata (`ChannelDefinition`, `ChannelAuthMode`, `ChannelCapability`, `AuthModeSpec`, `FieldRequirement`, `all_channel_definitions`, `find_channel_definition`) from `tinychannels::controllers` || `ops/` | Business logic behind each RPC handler, grouped by concern (connect, discord, messaging, telegram, yuanbao) |-| `schemas.rs` | `all_registered_controllers` / `all_controller_schemas` and the thin RPC handlers: deserialize params, build a `ChannelManager<OpenHumanChannelBackend>` over the loaded config, call the manager, and shape the `RpcOutcome`. Field schemas come from `tinychannels::controllers::channel_controller_schema`, converted by `from_channel_controller_schema` |+| `schemas.rs` | `all_registered_controllers` / `all_controller_schemas` and the thin RPC handlers: deserialize params, build a `ChannelManager<OpenHumanChannelBackend>` over the loaded config, call the manager, and shape the `Outcome`. Field schemas come from `tinychannels::controllers::channel_controller_schema`, converted by `from_channel_controller_schema` |## RPC surfacediff --git a/crates/openhuman-core/src/channels/controllers/backend.rs b/crates/openhuman-core/src/channels/controllers/backend.rsindex ce26ae3ae9..c2d2daf0c2 100644--- a/crates/openhuman-core/src/channels/controllers/backend.rs+++ b/crates/openhuman-core/src/channels/controllers/backend.rs@@ -5,7 +5,7 @@ use serde::Serialize;use serde_json::{json, Value};use crate::config::{ChannelsConfig, Config};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::ops;use tinychannels::controllers::{@@ -39,7 +39,7 @@ impl OpenHumanChannelBackend {}}-fn into_anyhow<T>(result: Result<RpcOutcome<T>, String>) -> anyhow::Result<T> {+fn into_anyhow<T>(result: Result<Outcome<T>, String>) -> anyhow::Result<T> {result.map(|outcome| outcome.value).map_err(anyhow::Error::msg)diff --git a/crates/openhuman-core/src/channels/controllers/ops/connect/catalog.rs b/crates/openhuman-core/src/channels/controllers/ops/connect/catalog.rsindex 61d4b0d693..2c72d415b2 100644--- a/crates/openhuman-core/src/channels/controllers/ops/connect/catalog.rs+++ b/crates/openhuman-core/src/channels/controllers/ops/connect/catalog.rs@@ -1,19 +1,19 @@//! Read-only channel catalog lookups.-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::super::super::definitions::{all_channel_definitions, find_channel_definition, ChannelDefinition,};/// List all available channel definitions.-pub async fn list_channels() -> Result<RpcOutcome<Vec<ChannelDefinition>>, String> {- Ok(RpcOutcome::new(all_channel_definitions(), vec![]))+pub async fn list_channels() -> Result<Outcome<Vec<ChannelDefinition>>, String> {+ Ok(Outcome::new(all_channel_definitions(), vec![]))}/// Describe a single channel by id.-pub async fn describe_channel(channel_id: &str) -> Result<RpcOutcome<ChannelDefinition>, String> {+pub async fn describe_channel(channel_id: &str) -> Result<Outcome<ChannelDefinition>, String> {let def = find_channel_definition(channel_id).ok_or_else(|| format!("unknown channel: {channel_id}"))?;- Ok(RpcOutcome::new(def, vec![]))+ Ok(Outcome::new(def, vec![]))}diff --git a/crates/openhuman-core/src/channels/controllers/ops/connect/connect_channel.rs b/crates/openhuman-core/src/channels/controllers/ops/connect/connect_channel.rsindex ef306cc36c..54d25dabed 100644--- a/crates/openhuman-core/src/channels/controllers/ops/connect/connect_channel.rs+++ b/crates/openhuman-core/src/channels/controllers/ops/connect/connect_channel.rs@@ -6,7 +6,7 @@ use serde_json::Value;use crate::channels::email_channel::EmailConfig;use crate::channels::providers::yuanbao::YuanbaoConfig;use crate::config::{Config, DiscordConfig, IMessageConfig, TelegramConfig};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::security::credentials;use super::super::super::definitions::{find_channel_definition, ChannelAuthMode};@@ -26,7 +26,7 @@ pub async fn connect_channel(channel_id: &str,auth_mode: ChannelAuthMode,credentials_value: Value,-) -> Result<RpcOutcome<ChannelConnectionResult>, String> {+) -> Result<Outcome<ChannelConnectionResult>, String> {let def = find_channel_definition(channel_id).ok_or_else(|| format!("unknown channel: {channel_id}"))?;@@ -39,7 +39,7 @@ pub async fn connect_channel(// For OAuth/managed modes, return the auth action without storing credentials.if let Some(action) = spec.auth_action {- return Ok(RpcOutcome::new(+ return Ok(Outcome::new(ChannelConnectionResult {status: "pending_auth".to_string(),restart_required: false,@@ -102,7 +102,7 @@ pub async fn connect_channel("[imessage] connect_channel: wrote channels_config.imessage; restart core for AppleScript bridge to load");- return Ok(RpcOutcome::single_log(+ return Ok(Outcome::single_log(ChannelConnectionResult {status: "connected".to_string(),restart_required: true,@@ -300,7 +300,7 @@ pub async fn connect_channel(persist_email_config(config, email_cfg).await?;}- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(ChannelConnectionResult {status: "connected".to_string(),restart_required: true,diff --git a/crates/openhuman-core/src/channels/controllers/ops/connect/disconnect.rs b/crates/openhuman-core/src/channels/controllers/ops/connect/disconnect.rsindex f69625c1a0..38ffb62f0f 100644--- a/crates/openhuman-core/src/channels/controllers/ops/connect/disconnect.rs+++ b/crates/openhuman-core/src/channels/controllers/ops/connect/disconnect.rs@@ -4,7 +4,7 @@use serde_json::{json, Value};use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::security::credentials;use super::super::super::definitions::{find_channel_definition, ChannelAuthMode};@@ -17,7 +17,7 @@ pub async fn disconnect_channel(channel_id: &str,auth_mode: ChannelAuthMode,clear_memory: bool,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {// Verify channel exists.find_channel_definition(channel_id).ok_or_else(|| format!("unknown channel: {channel_id}"))?;@@ -102,7 +102,7 @@ pub async fn disconnect_channel(0};- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({"channel": channel_id,"auth_mode": auth_mode,diff --git a/crates/openhuman-core/src/channels/controllers/ops/connect/status.rs b/crates/openhuman-core/src/channels/controllers/ops/connect/status.rsindex 250dfef310..c8b7cb09df 100644--- a/crates/openhuman-core/src/channels/controllers/ops/connect/status.rs+++ b/crates/openhuman-core/src/channels/controllers/ops/connect/status.rs@@ -4,7 +4,7 @@use serde_json::{json, Value};use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::security::credentials;use super::super::super::definitions::{all_channel_definitions, find_channel_definition};@@ -15,7 +15,7 @@ use super::shared::{channel_config_connected, credential_provider, merge_listenepub async fn channel_status(config: &Config,channel_id: Option<&str>,-) -> Result<RpcOutcome<Vec<ChannelStatusEntry>>, String> {+) -> Result<Outcome<Vec<ChannelStatusEntry>>, String> {// List all stored credentials with "channel:" prefix. Uses the// prefix-match helper because channel credentials are keyed as// `channel:<id>:<mode>` and no single literal value matches them@@ -68,7 +68,7 @@ pub async fn channel_status(}}- Ok(RpcOutcome::new(entries, vec![]))+ Ok(Outcome::new(entries, vec![]))}/// Set the default messaging channel for proactive agent delivery (issue #3712@@ -79,7 +79,7 @@ pub async fn channel_status(pub async fn set_default_channel(config: &mut Config,channel: &str,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let canonical = channel.trim().to_ascii_lowercase();if canonical.is_empty() {return Err("channel must not be empty".to_string());@@ -98,7 +98,7 @@ pub async fn set_default_channel(// Apply live so proactive routing follows the new default immediately.crate::channels::proactive::set_runtime_active_channel(Some(canonical.clone()));- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({ "active_channel": canonical, "restart_required": false }),format!("default messaging channel set to {canonical}"),))@@ -106,13 +106,13 @@ pub async fn set_default_channel(/// Return the persisted default messaging channel/// (`channels_config.active_channel`), defaulting to `"web"` when unset.-pub fn get_default_channel(config: &Config) -> Result<RpcOutcome<Value>, String> {+pub fn get_default_channel(config: &Config) -> Result<Outcome<Value>, String> {let active = config.channels_config.active_channel.clone().unwrap_or_else(|| "web".to_string());- Ok(RpcOutcome::new(json!({ "active_channel": active }), vec![]))+ Ok(Outcome::new(json!({ "active_channel": active }), vec![]))}/// Return the slugs of all messaging channels currently connected,diff --git a/crates/openhuman-core/src/channels/controllers/ops/connect/test_channel.rs b/crates/openhuman-core/src/channels/controllers/ops/connect/test_channel.rsindex 4f5a17f58f..ac422b53a8 100644--- a/crates/openhuman-core/src/channels/controllers/ops/connect/test_channel.rs+++ b/crates/openhuman-core/src/channels/controllers/ops/connect/test_channel.rs@@ -3,7 +3,7 @@use serde_json::Value;use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::super::super::definitions::{find_channel_definition, ChannelAuthMode};use super::super::types::ChannelTestResult;@@ -15,7 +15,7 @@ pub async fn test_channel(channel_id: &str,auth_mode: ChannelAuthMode,credentials_value: Value,-) -> Result<RpcOutcome<ChannelTestResult>, String> {+) -> Result<Outcome<ChannelTestResult>, String> {let def = find_channel_definition(channel_id).ok_or_else(|| format!("unknown channel: {channel_id}"))?;@@ -31,7 +31,7 @@ pub async fn test_channel(if channel_id == "email" && auth_mode == ChannelAuthMode::ApiKey {let email_cfg = build_email_config(creds_map, None)?;verify_email_credentials(&email_cfg).await?;- return Ok(RpcOutcome::new(+ return Ok(Outcome::new(ChannelTestResult {success: true,message: "IMAP login succeeded.".to_string(),@@ -42,7 +42,7 @@ pub async fn test_channel(// For other channels, field validation is the test. A future version can// instantiate the channel provider and call health_check().- Ok(RpcOutcome::new(+ Ok(Outcome::new(ChannelTestResult {success: true,message: format!(diff --git a/crates/openhuman-core/src/channels/controllers/ops/discord.rs b/crates/openhuman-core/src/channels/controllers/ops/discord.rsindex 585cbadf1d..7b1411bca2 100644--- a/crates/openhuman-core/src/channels/controllers/ops/discord.rs+++ b/crates/openhuman-core/src/channels/controllers/ops/discord.rs@@ -6,7 +6,7 @@ use crate::api::config::effective_backend_api_url;use crate::api::jwt::get_session_token;use crate::api::rest::BackendOAuthClient;use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::security::credentials;use super::super::definitions::ChannelAuthMode;@@ -23,7 +23,7 @@ use super::types::{DiscordLinkCheckResult, DiscordLinkStartResult};/// Requires an active session JWT.pub async fn discord_link_start(config: &Config,-) -> Result<RpcOutcome<DiscordLinkStartResult>, String> {+) -> Result<Outcome<DiscordLinkStartResult>, String> {let api_url = effective_backend_api_url(&config.api_url);let jwt = get_session_token(config)?.ok_or_else(|| "session JWT required; complete login first".to_string())?;@@ -61,7 +61,7 @@ pub async fn discord_link_start(link_token.len());- Ok(RpcOutcome::new(+ Ok(Outcome::new(DiscordLinkStartResult {link_token,instructions,@@ -77,7 +77,7 @@ pub async fn discord_link_start(pub async fn discord_link_check(config: &Config,_link_token: &str,-) -> Result<RpcOutcome<DiscordLinkCheckResult>, String> {+) -> Result<Outcome<DiscordLinkCheckResult>, String> {let api_url = effective_backend_api_url(&config.api_url);let jwt = get_session_token(config)?.ok_or_else(|| "session JWT required".to_string())?;@@ -138,7 +138,7 @@ pub async fn discord_link_check();}- Ok(RpcOutcome::new(+ Ok(Outcome::new(DiscordLinkCheckResult {linked,details: if linked { Some(user_payload) } else { None },@@ -170,21 +170,21 @@ async fn discord_bot_token(config: &Config) -> Result<String, String> {/// List Discord guilds (servers) the connected bot is a member of.pub async fn discord_list_guilds(config: &Config,-) -> Result<RpcOutcome<Vec<crate::channels::providers::discord::api::DiscordGuild>>, String> {+) -> Result<Outcome<Vec<crate::channels::providers::discord::api::DiscordGuild>>, String> {use crate::channels::providers::discord::api;let token = discord_bot_token(config).await?;let guilds = api::list_bot_guilds(&token).await.map_err(|e| format!("Discord API error: {e}"))?;- Ok(RpcOutcome::single_log(guilds, "discord guilds listed"))+ Ok(Outcome::single_log(guilds, "discord guilds listed"))}/// List text channels in a Discord guild.pub async fn discord_list_channels(config: &Config,guild_id: &str,-) -> Result<RpcOutcome<Vec<crate::channels::providers::discord::api::DiscordTextChannel>>, String> {+) -> Result<Outcome<Vec<crate::channels::providers::discord::api::DiscordTextChannel>>, String> {use crate::channels::providers::discord::api;if guild_id.is_empty() {@@ -194,7 +194,7 @@ pub async fn discord_list_channels(let channels = api::list_guild_channels(&token, guild_id).await.map_err(|e| format!("Discord API error: {e}"))?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(channels,format!("discord channels listed for guild {guild_id}"),))@@ -205,7 +205,7 @@ pub async fn discord_check_permissions(config: &Config,guild_id: &str,channel_id: &str,-) -> Result<RpcOutcome<crate::channels::providers::discord::api::BotPermissionCheck>, String> {+) -> Result<Outcome<crate::channels::providers::discord::api::BotPermissionCheck>, String> {use crate::channels::providers::discord::api;if guild_id.is_empty() || channel_id.is_empty() {@@ -215,7 +215,7 @@ pub async fn discord_check_permissions(let check = api::check_channel_permissions(&token, guild_id, channel_id).await.map_err(|e| format!("Discord API error: {e}"))?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(check,format!("discord permissions checked for channel {channel_id}"),))diff --git a/crates/openhuman-core/src/channels/controllers/ops/messaging.rs b/crates/openhuman-core/src/channels/controllers/ops/messaging.rsindex 4f632ece1b..d4c73385bf 100644--- a/crates/openhuman-core/src/channels/controllers/ops/messaging.rs+++ b/crates/openhuman-core/src/channels/controllers/ops/messaging.rs@@ -6,14 +6,14 @@ use crate::api::config::effective_backend_api_url;use crate::api::jwt::get_session_token;use crate::api::rest::BackendOAuthClient;use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// Send a rich message to a channel via the backend API.pub async fn channel_send_message(config: &Config,channel: &str,message: Value,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let api_url = effective_backend_api_url(&config.api_url);let jwt = get_session_token(config)?.ok_or_else(|| "session JWT required; complete login first".to_string())?;@@ -32,7 +32,7 @@ pub async fn channel_send_message(log::debug!("[channels] send_message response: {:?}", result);- Ok(RpcOutcome::new(result, vec![]))+ Ok(Outcome::new(result, vec![]))}/// Send a reaction to a message in a channel via the backend API.@@ -40,7 +40,7 @@ pub async fn channel_send_reaction(config: &Config,channel: &str,reaction: Value,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let api_url = effective_backend_api_url(&config.api_url);let jwt = get_session_token(config)?.ok_or_else(|| "session JWT required; complete login first".to_string())?;@@ -59,7 +59,7 @@ pub async fn channel_send_reaction(log::debug!("[channels] send_reaction response: {:?}", result);- Ok(RpcOutcome::new(result, vec![]))+ Ok(Outcome::new(result, vec![]))}/// Create a thread in a channel via the backend API.@@ -67,7 +67,7 @@ pub async fn channel_create_thread(config: &Config,channel: &str,title: &str,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let api_url = effective_backend_api_url(&config.api_url);let jwt = get_session_token(config)?.ok_or_else(|| "session JWT required; complete login first".to_string())?;@@ -87,7 +87,7 @@ pub async fn channel_create_thread(log::debug!("[channels] create_thread response: {:?}", result);- Ok(RpcOutcome::new(result, vec![]))+ Ok(Outcome::new(result, vec![]))}/// Close or reopen a thread in a channel via the backend API.@@ -96,7 +96,7 @@ pub async fn channel_update_thread(channel: &str,thread_id: &str,action: &str,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let api_url = effective_backend_api_url(&config.api_url);let jwt = get_session_token(config)?.ok_or_else(|| "session JWT required; complete login first".to_string())?;@@ -117,7 +117,7 @@ pub async fn channel_update_thread(log::debug!("[channels] update_thread response: {:?}", result);- Ok(RpcOutcome::new(result, vec![]))+ Ok(Outcome::new(result, vec![]))}/// List threads in a channel via the backend API.@@ -125,7 +125,7 @@ pub async fn channel_list_threads(config: &Config,channel: &str,active: Option<bool>,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let api_url = effective_backend_api_url(&config.api_url);let jwt = get_session_token(config)?.ok_or_else(|| "session JWT required; complete login first".to_string())?;@@ -145,5 +145,5 @@ pub async fn channel_list_threads(log::debug!("[channels] list_threads response: {:?}", result);- Ok(RpcOutcome::new(result, vec![]))+ Ok(Outcome::new(result, vec![]))}diff --git a/crates/openhuman-core/src/channels/controllers/ops/telegram.rs b/crates/openhuman-core/src/channels/controllers/ops/telegram.rsindex 5a7db0da41..ae0f40b94c 100644--- a/crates/openhuman-core/src/channels/controllers/ops/telegram.rs+++ b/crates/openhuman-core/src/channels/controllers/ops/telegram.rs@@ -6,7 +6,7 @@ use crate::api::config::{app_env_from_env, effective_backend_api_url, is_staginguse crate::api::jwt::get_session_token;use crate::api::rest::BackendOAuthClient;use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::security::credentials;use super::super::definitions::ChannelAuthMode;@@ -38,7 +38,7 @@ fn telegram_bot_username() -> String {/// Requires an active session JWT.pub async fn telegram_login_start(config: &Config,-) -> Result<RpcOutcome<TelegramLoginStartResult>, String> {+) -> Result<Outcome<TelegramLoginStartResult>, String> {let api_url = effective_backend_api_url(&config.api_url);let jwt = get_session_token(config)?.ok_or_else(|| "session JWT required; complete login first".to_string())?;@@ -81,7 +81,7 @@ pub async fn telegram_login_start(telegram_url);- Ok(RpcOutcome::new(+ Ok(Outcome::new(TelegramLoginStartResult {link_token,telegram_url,@@ -99,7 +99,7 @@ pub async fn telegram_login_start(pub async fn telegram_login_check(config: &Config,_link_token: &str,-) -> Result<RpcOutcome<TelegramLoginCheckResult>, String> {+) -> Result<Outcome<TelegramLoginCheckResult>, String> {let api_url = effective_backend_api_url(&config.api_url);let jwt = get_session_token(config)?.ok_or_else(|| "session JWT required".to_string())?;@@ -164,7 +164,7 @@ pub async fn telegram_login_check();}- Ok(RpcOutcome::new(+ Ok(Outcome::new(TelegramLoginCheckResult {linked,details: if linked { Some(user_payload) } else { None },diff --git a/crates/openhuman-core/src/channels/controllers/schemas.rs b/crates/openhuman-core/src/channels/controllers/schemas.rsindex 4a348c0949..0fee09aa63 100644--- a/crates/openhuman-core/src/channels/controllers/schemas.rs+++ b/crates/openhuman-core/src/channels/controllers/schemas.rs@@ -8,7 +8,7 @@ use crate::config::rpc as config_rpc;use crate::config::Config;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::backend::OpenHumanChannelBackend;use super::definitions::ChannelAuthMode;@@ -240,7 +240,7 @@ pub fn schemas(function: &str) -> ControllerSchema {fn handle_list(_params: Map<String, Value>) -> ControllerFuture {Box::pin(async move {let manager = ChannelManager::new(ChannelsConfig::default(), ());- to_json(RpcOutcome::new(manager.list_definitions(), vec![]))+ to_json(Outcome::new(manager.list_definitions(), vec![]))})}@@ -252,7 +252,7 @@ fn handle_describe(params: Map<String, Value>) -> ControllerFuture {let definition = manager.describe(channel).ok_or_else(|| format!("unknown channel: {channel}"))?;- to_json(RpcOutcome::new(definition, vec![]))+ to_json(Outcome::new(definition, vec![]))})}@@ -272,7 +272,7 @@ fn handle_connect(params: Map<String, Value>) -> ControllerFuture {.await.map_err(|e| e.to_string())?;let logs = connect_logs(channel, mode, result.auth_action.is_some());- to_json(RpcOutcome::new(result, logs))+ to_json(Outcome::new(result, logs))})}@@ -290,7 +290,7 @@ fn handle_disconnect(params: Map<String, Value>) -> ControllerFuture {.disconnect(channel, mode, p.clear_memory).await.map_err(|e| e.to_string())?;- to_json(RpcOutcome::single_log(+ to_json(Outcome::single_log(raw_or_typed(result.raw.clone(), &result)?,format!("removed credentials for {}",@@ -315,7 +315,7 @@ fn handle_status(params: Map<String, Value>) -> ControllerFuture {.filter(|s| !s.is_empty());let manager = openhuman_channel_manager(config);let result = manager.status(filter).await.map_err(|e| e.to_string())?;- to_json(RpcOutcome::new(result, vec![]))+ to_json(Outcome::new(result, vec![]))})}@@ -330,7 +330,7 @@ fn handle_set_default(params: Map<String, Value>) -> ControllerFuture {.await.map_err(|e| e.to_string())?;let canonical = channel.to_ascii_lowercase();- to_json(RpcOutcome::single_log(+ to_json(Outcome::single_log(serde_json::json!({ "active_channel": canonical, "restart_required": false }),format!("default messaging channel set to {canonical}"),))@@ -346,7 +346,7 @@ fn handle_get_default(_params: Map<String, Value>) -> ControllerFuture {.await.map_err(|e| e.to_string())?.unwrap_or_else(|| "web".to_string());- to_json(RpcOutcome::new(+ to_json(Outcome::new(serde_json::json!({ "active_channel": active }),vec![],))@@ -366,7 +366,7 @@ fn handle_test(params: Map<String, Value>) -> ControllerFuture {.test(p.channel.trim(), mode, p.credentials).await.map_err(|e| e.to_string())?;- to_json(RpcOutcome::new(result, vec![]))+ to_json(Outcome::new(result, vec![]))})}@@ -378,7 +378,7 @@ fn handle_telegram_login_start(_params: Map<String, Value>) -> ControllerFuture.telegram_login_start().await.map_err(|e| e.to_string())?;- to_json(RpcOutcome::new(result, vec![]))+ to_json(Outcome::new(result, vec![]))})}@@ -391,7 +391,7 @@ fn handle_telegram_login_check(params: Map<String, Value>) -> ControllerFuture {.telegram_login_check(p.link_token.trim()).await.map_err(|e| e.to_string())?;- to_json(RpcOutcome::new(result, vec![]))+ to_json(Outcome::new(result, vec![]))})}@@ -403,7 +403,7 @@ fn handle_discord_link_start(_params: Map<String, Value>) -> ControllerFuture {.discord_link_start().await.map_err(|e| e.to_string())?;- to_json(RpcOutcome::new(result, vec![]))+ to_json(Outcome::new(result, vec![]))})}@@ -416,7 +416,7 @@ fn handle_discord_link_check(params: Map<String, Value>) -> ControllerFuture {.discord_link_check(p.link_token.trim()).await.map_err(|e| e.to_string())?;- to_json(RpcOutcome::new(result, vec![]))+ to_json(Outcome::new(result, vec![]))})}@@ -428,7 +428,7 @@ fn handle_discord_list_guilds(_params: Map<String, Value>) -> ControllerFuture {.discord_list_guilds().await.map_err(|e| e.to_string())?;- to_json(RpcOutcome::single_log(+ to_json(Outcome::single_log(raw_or_typed(result.raw.clone(), &result)?,"discord guilds listed",))@@ -445,7 +445,7 @@ fn handle_discord_list_channels(params: Map<String, Value>) -> ControllerFuture.discord_list_channels(guild_id).await.map_err(|e| e.to_string())?;- to_json(RpcOutcome::single_log(+ to_json(Outcome::single_log(raw_or_typed(result.raw.clone(), &result)?,format!("discord channels listed for guild {guild_id}"),))@@ -463,7 +463,7 @@ fn handle_discord_check_permissions(params: Map<String, Value>) -> ControllerFut.discord_check_permissions(guild_id, channel_id).await.map_err(|e| e.to_string())?;- to_json(RpcOutcome::single_log(+ to_json(Outcome::single_log(raw_or_typed(result.raw.clone(), &result)?,format!("discord permissions checked for channel {channel_id}"),))@@ -479,7 +479,7 @@ fn handle_send_message(params: Map<String, Value>) -> ControllerFuture {.send_message_value(p.channel.trim(), p.message).await.map_err(|e| e.to_string())?;- to_json(RpcOutcome::new(+ to_json(Outcome::new(raw_or_typed(result.raw.clone(), &result)?,vec![],))@@ -495,7 +495,7 @@ fn handle_send_reaction(params: Map<String, Value>) -> ControllerFuture {.send_reaction(p.channel.trim(), p.reaction).await.map_err(|e| e.to_string())?;- to_json(RpcOutcome::new(+ to_json(Outcome::new(raw_or_typed(result.raw.clone(), &result)?,vec![],))@@ -511,7 +511,7 @@ fn handle_create_thread(params: Map<String, Value>) -> ControllerFuture {.create_thread(p.channel.trim(), p.title.trim()).await.map_err(|e| e.to_string())?;- to_json(RpcOutcome::new(+ to_json(Outcome::new(raw_or_typed(result.raw.clone(), &result)?,vec![],))@@ -527,7 +527,7 @@ fn handle_update_thread(params: Map<String, Value>) -> ControllerFuture {.update_thread(p.channel.trim(), p.thread_id.trim(), p.action.trim()).await.map_err(|e| e.to_string())?;- to_json(RpcOutcome::new(+ to_json(Outcome::new(raw_or_typed(result.raw.clone(), &result)?,vec![],))@@ -543,7 +543,7 @@ fn handle_list_threads(params: Map<String, Value>) -> ControllerFuture {.list_threads(p.channel.trim(), p.active).await.map_err(|e| e.to_string())?;- to_json(RpcOutcome::new(+ to_json(Outcome::new(raw_or_typed(result.raw.clone(), &result)?,vec![],))@@ -580,7 +580,7 @@ fn raw_or_typed<T: serde::Serialize>(raw: Option<Value>, typed: &T) -> Result<Va.unwrap_or_else(|| serde_json::to_value(typed).map_err(|e| e.to_string()))}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/channels/controllers/schemas_tests.rs b/crates/openhuman-core/src/channels/controllers/schemas_tests.rsindex 67a5b4629e..7b2fa832ea 100644--- a/crates/openhuman-core/src/channels/controllers/schemas_tests.rs+++ b/crates/openhuman-core/src/channels/controllers/schemas_tests.rs@@ -75,7 +75,7 @@ fn deserialize_send_message_params() {#[test]fn to_json_helper() {- let outcome = RpcOutcome::single_log(json!({"ok": true}), "log");+ let outcome = Outcome::single_log(json!({"ok": true}), "log");assert!(to_json(outcome).is_ok());}diff --git a/crates/openhuman-core/src/commands/ops.rs b/crates/openhuman-core/src/commands/ops.rsindex 4bd061a114..4fcbbcda09 100644--- a/crates/openhuman-core/src/commands/ops.rs+++ b/crates/openhuman-core/src/commands/ops.rs@@ -7,7 +7,7 @@use serde_json::{Map, Value};use crate::core::all::RegisteredController;-use crate::rpc::{unwrap_rpc, RpcOutcome};+use crate::core::{unwrap_rpc, Outcome};use super::types::{CommandEntry, CommandKind, CommandsListResponse};@@ -98,7 +98,7 @@ fn entries_from_array(value: &Value, array_field: &str, kind: CommandKind) -> Ve/// Builds the merged command list: built-ins first (stable order, cheapest),/// then skills, then workflows.-pub async fn commands_list() -> Result<RpcOutcome<CommandsListResponse>, String> {+pub async fn commands_list() -> Result<Outcome<CommandsListResponse>, String> {let mut entries = builtin_entries();let skills_controllers = crate::skills::all_skills_registered_controllers();@@ -129,7 +129,7 @@ pub async fn commands_list() -> Result<RpcOutcome<CommandsListResponse>, String>BUILTINS.len(),entries.len());- Ok(RpcOutcome::new(+ Ok(Outcome::new(CommandsListResponse { commands: entries },Vec::new(),))diff --git a/crates/openhuman-core/src/config/migration_helpers/README.md b/crates/openhuman-core/src/config/migration_helpers/README.mdindex 99017d1e36..57a46f1476 100644--- a/crates/openhuman-core/src/config/migration_helpers/README.md+++ b/crates/openhuman-core/src/config/migration_helpers/README.md@@ -21,7 +21,7 @@ Data-migration helpers that import memory from **other AI assistants' workspaces| --- | --- || `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/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 `RpcOutcome<MigrationReport>` with a `"migration completed"` log. Tests cover dry-run, apply, missing-source, and self-migration. |+| `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::*`. |## Public surface@@ -30,7 +30,7 @@ From `mod.rs` re-exports (`core::*` + `ops::*`):- Types: `MigrationReport`, `MigrationStats`.- Core fns: `migrate_openclaw_memory(config, source_workspace, dry_run) -> Result<MigrationReport>`, `migrate_hermes_memory(...)`.-- RPC fns (via `ops` / alias `rpc`): `migrate_openclaw(...) -> Result<RpcOutcome<MigrationReport>, String>`, `migrate_hermes(...)`.+- 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.)@@ -64,7 +64,7 @@ No own store. It writes imported entries through the **target memory backend** o- `crate::memory` (`Memory`, `MemoryCategory`) — target backend trait + category enum entries are mapped into.- `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::rpc::RpcOutcome` — RPC response envelope.+- `crate::rpc::Outcome` — RPC response envelope.- External crates: `rusqlite` (read OpenClaw `brain.db`), `directories::UserDirs` (home dir), `anyhow`, `serde`/`serde_json`.## Used bydiff --git a/crates/openhuman-core/src/config/migration_helpers/ops.rs b/crates/openhuman-core/src/config/migration_helpers/ops.rsindex 3df205dc1f..1ae18dd4d7 100644--- a/crates/openhuman-core/src/config/migration_helpers/ops.rs+++ b/crates/openhuman-core/src/config/migration_helpers/ops.rs@@ -4,28 +4,28 @@ use std::path::PathBuf;use crate::config::migration_helpers::{self, MigrationReport};use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub async fn migrate_openclaw(config: &Config,source_workspace: Option<PathBuf>,dry_run: bool,-) -> Result<RpcOutcome<MigrationReport>, String> {+) -> Result<Outcome<MigrationReport>, String> {let report = migration_helpers::migrate_openclaw_memory(config, source_workspace, dry_run).await.map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(report, "migration completed"))+ Ok(Outcome::single_log(report, "migration completed"))}pub async fn migrate_hermes(config: &Config,source_workspace: Option<PathBuf>,dry_run: bool,-) -> Result<RpcOutcome<MigrationReport>, String> {+) -> Result<Outcome<MigrationReport>, String> {let report = migration_helpers::migrate_hermes_memory(config, source_workspace, dry_run).await.map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(report, "migration completed"))+ Ok(Outcome::single_log(report, "migration completed"))}#[cfg(test)]diff --git a/crates/openhuman-core/src/config/migration_helpers/schemas.rs b/crates/openhuman-core/src/config/migration_helpers/schemas.rsindex 35366bbc2d..45f598d43a 100644--- a/crates/openhuman-core/src/config/migration_helpers/schemas.rs+++ b/crates/openhuman-core/src/config/migration_helpers/schemas.rs@@ -4,7 +4,7 @@ use serde_json::{Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;#[derive(Debug, Deserialize)]struct MigrateOpenClawParams {@@ -136,7 +136,7 @@ fn handle_migrate_hermes(params: Map<String, Value>) -> ControllerFuture {})}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/config/migration_helpers/schemas_tests.rs b/crates/openhuman-core/src/config/migration_helpers/schemas_tests.rsindex 3d6de66c90..ef355e7ff2 100644--- a/crates/openhuman-core/src/config/migration_helpers/schemas_tests.rs+++ b/crates/openhuman-core/src/config/migration_helpers/schemas_tests.rs@@ -60,7 +60,7 @@ fn migrate_openclaw_params_parses_both_fields() {#[test]fn to_json_wraps_rpc_outcome_result_envelope() {- let v = to_json(RpcOutcome::single_log(json!({"done": true}), "done")).unwrap();+ let v = to_json(Outcome::single_log(json!({"done": true}), "done")).unwrap();assert!(v.get("logs").is_some() || v.get("result").is_some());}diff --git a/crates/openhuman-core/src/config/ops/README.md b/crates/openhuman-core/src/config/ops/README.mdindex 079ae786b3..e781492148 100644--- a/crates/openhuman-core/src/config/ops/README.md+++ b/crates/openhuman-core/src/config/ops/README.md@@ -7,7 +7,7 @@ its own name and as `rpc` (`pub use ops as rpc`), so most callers writefunctions here: they deserialize RPC params into `../schemas/helpers.rs``*SettingsUpdate` structs, map those field-by-field onto the `*SettingsPatch`structs defined here, and call the corresponding `load_and_apply_*` / `get_*`-fn, which returns `RpcOutcome<T>`.+fn, which returns `Outcome<T>`.## Layout@@ -25,7 +25,7 @@ Each submodule follows the same shape: a `*SettingsPatch` struct withthat mutates the given config, calls `Config::save()`, and returns thesettings or snapshot; a `load_and_apply_*(patch)` wrapper that calls`load_config_with_timeout` first; and a `get_*` fn that reads the relevant-section back out, usually as `RpcOutcome<serde_json::Value>`. `ui.rs`'s+section back out, usually as `Outcome<serde_json::Value>`. `ui.rs`'sdictation and voice-server mutators exist only in `load_and_apply_*` form.## Key entry pointsdiff --git a/crates/openhuman-core/src/config/ops/agent.rs b/crates/openhuman-core/src/config/ops/agent.rsindex bfa213d295..b7ff67c855 100644--- a/crates/openhuman-core/src/config/ops/agent.rs+++ b/crates/openhuman-core/src/config/ops/agent.rs@@ -5,7 +5,7 @@ use std::path::{Path, PathBuf};use serde_json::json;use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::loader::{load_config_with_timeout, snapshot_config_json};@@ -97,7 +97,7 @@ pub struct MemorySyncSettingsPatch {pub async fn apply_autonomy_settings(config: &mut Config,update: AutonomySettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {use crate::security::AutonomyLevel;if let Some(enabled) = update.enabled {@@ -151,7 +151,7 @@ pub async fn apply_autonomy_settings(crate::core::bus::BUS.publish(crate::core::events::DomainEvent::AutonomyConfigChanged);let snapshot = snapshot_config_json(config)?;- Ok(RpcOutcome::new(+ Ok(Outcome::new(snapshot,vec![format!("autonomy settings saved to {}",@@ -163,16 +163,16 @@ pub async fn apply_autonomy_settings(/// Loads the configuration, applies autonomy settings updates, and saves it.pub async fn load_and_apply_autonomy_settings(update: AutonomySettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let mut config = load_config_with_timeout().await?;apply_autonomy_settings(&mut config, update).await}/// Returns the current `[autonomy]` settings block as JSON (no secrets).-pub async fn get_autonomy_settings() -> Result<RpcOutcome<serde_json::Value>, String> {+pub async fn get_autonomy_settings() -> Result<Outcome<serde_json::Value>, String> {let config = load_config_with_timeout().await?;let value = serde_json::to_value(&config.autonomy).map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(value, "autonomy settings read"))+ Ok(Outcome::single_log(value, "autonomy settings read"))}fn auto_approve_write_lock() -> &'static tokio::sync::Mutex<()> {@@ -215,7 +215,7 @@ pub async fn add_auto_approve_tool(tool_name: &str) -> Result<(), String> {pub async fn apply_agent_settings(config: &mut Config,update: AgentSettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {use crate::tools::timeout::{MAX_TIMEOUT_SECS, MIN_TIMEOUT_SECS};if let Some(timeout_secs) = update.agent_timeout_secs {@@ -263,7 +263,7 @@ pub async fn apply_agent_settings();let snapshot = snapshot_config_json(config)?;- Ok(RpcOutcome::new(+ Ok(Outcome::new(snapshot,vec![format!("agent settings saved to {}",@@ -275,7 +275,7 @@ pub async fn apply_agent_settings(/// Loads the configuration, applies agent settings updates, and saves it.pub async fn load_and_apply_agent_settings(update: AgentSettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let mut config = load_config_with_timeout().await?;apply_agent_settings(&mut config, update).await}@@ -283,7 +283,7 @@ pub async fn load_and_apply_agent_settings(/// Returns the agent execution settings (currently the action timeout) plus the/// runtime-effective value and whether the `OPENHUMAN_TOOL_TIMEOUT_SECS` env var/// is overriding the configured value, so the UI can explain a no-op control.-pub async fn get_agent_settings() -> Result<RpcOutcome<serde_json::Value>, String> {+pub async fn get_agent_settings() -> Result<Outcome<serde_json::Value>, String> {let config = load_config_with_timeout().await?;crate::tools::timeout::set_tool_timeout_secs(config.agent.agent_timeout_secs);let value = serde_json::json!({@@ -293,7 +293,7 @@ pub async fn get_agent_settings() -> Result<RpcOutcome<serde_json::Value>, Strin"min_timeout_secs": crate::tools::timeout::MIN_TIMEOUT_SECS,"max_timeout_secs": crate::tools::timeout::MAX_TIMEOUT_SECS,});- Ok(RpcOutcome::single_log(value, "agent settings read"))+ Ok(Outcome::single_log(value, "agent settings read"))}/// Expand a leading `~/` to the user's home directory, building the path@@ -477,7 +477,7 @@ fn agent_paths_payload(config: &Config) -> serde_json::Value {pub async fn apply_agent_paths_settings(config: &mut Config,update: AgentPathsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let mut notes: Vec<String> = Vec::new();if let Some(raw) = update.action_dir {@@ -537,13 +537,13 @@ pub async fn apply_agent_paths_settings();}- Ok(RpcOutcome::new(agent_paths_payload(config), notes))+ Ok(Outcome::new(agent_paths_payload(config), notes))}/// Loads the configuration, applies agent-paths updates, and saves it.pub async fn load_and_apply_agent_paths_settings(update: AgentPathsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let mut config = load_config_with_timeout().await?;apply_agent_paths_settings(&mut config, update).await}@@ -557,9 +557,9 @@ fn paths_equal(a: &Path, b: &Path) -> bool {/// Reports the agent's filesystem roots so the UI can render them live/// instead of hard-coding strings that drift away from `Config`.-pub async fn get_agent_paths() -> Result<RpcOutcome<serde_json::Value>, String> {+pub async fn get_agent_paths() -> Result<Outcome<serde_json::Value>, String> {let config = load_config_with_timeout().await?;- Ok(RpcOutcome::new(+ Ok(Outcome::new(agent_paths_payload(&config),vec![format!("agent paths resolved (action={}, workspace={}, source={})",@@ -571,7 +571,7 @@ pub async fn get_agent_paths() -> Result<RpcOutcome<serde_json::Value>, String>}/// Returns the current activity level and its derived settings.-pub async fn get_activity_level_settings() -> Result<RpcOutcome<serde_json::Value>, String> {+pub async fn get_activity_level_settings() -> Result<Outcome<serde_json::Value>, String> {let config = load_config_with_timeout().await?;let level = config.agent_activity_level;let (cost_min, cost_max) = level.estimated_monthly_cost_range();@@ -585,7 +585,7 @@ pub async fn get_activity_level_settings() -> Result<RpcOutcome<serde_json::Valu"estimated_monthly_cost_min_usd": cost_min,"estimated_monthly_cost_max_usd": cost_max,});- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(value,"activity level settings read",))@@ -595,7 +595,7 @@ pub async fn get_activity_level_settings() -> Result<RpcOutcome<serde_json::Valupub async fn apply_activity_level_settings(config: &mut Config,update: ActivityLevelSettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {use crate::config::schema::activity_level::AgentActivityLevel;use crate::config::SchedulerGateMode;@@ -640,7 +640,7 @@ pub async fn apply_activity_level_settings("estimated_monthly_cost_min_usd": cost_min,"estimated_monthly_cost_max_usd": cost_max,});- Ok(RpcOutcome::new(+ Ok(Outcome::new(value,vec![format!("activity level set to '{}' — saved to {}",@@ -653,7 +653,7 @@ pub async fn apply_activity_level_settings(/// Loads the configuration, applies activity level settings, and saves it.pub async fn load_and_apply_activity_level_settings(update: ActivityLevelSettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let mut config = load_config_with_timeout().await?;apply_activity_level_settings(&mut config, update).await}@@ -673,10 +673,10 @@ fn memory_sync_settings_value(stored: Option<u64>) -> serde_json::Value {}/// Returns the current global memory-sync cadence and its derived view.-pub async fn get_memory_sync_settings() -> Result<RpcOutcome<serde_json::Value>, String> {+pub async fn get_memory_sync_settings() -> Result<Outcome<serde_json::Value>, String> {let config = load_config_with_timeout().await?;let value = memory_sync_settings_value(config.memory_sync_interval_secs);- Ok(RpcOutcome::single_log(value, "memory sync settings read"))+ Ok(Outcome::single_log(value, "memory sync settings read"))}/// Updates the global memory-sync cadence and persists it. The running@@ -685,7 +685,7 @@ pub async fn get_memory_sync_settings() -> Result<RpcOutcome<serde_json::Value>,pub async fn apply_memory_sync_settings(config: &mut Config,update: MemorySyncSettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {config.memory_sync_interval_secs = update.sync_interval_secs;config.save().await.map_err(|e| e.to_string())?;@@ -701,7 +701,7 @@ pub async fn apply_memory_sync_settings(Some(n) => format!("memory sync interval set to {n}s"),None => "memory sync interval reset to default".to_string(),};- Ok(RpcOutcome::new(+ Ok(Outcome::new(value,vec![format!("{msg} — saved to {}", config.config_path.display())],))@@ -710,7 +710,7 @@ pub async fn apply_memory_sync_settings(/// Loads the configuration, applies memory-sync settings, and saves it.pub async fn load_and_apply_memory_sync_settings(update: MemorySyncSettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let mut config = load_config_with_timeout().await?;apply_memory_sync_settings(&mut config, update).await}diff --git a/crates/openhuman-core/src/config/ops/loader/reset_local_data.rs b/crates/openhuman-core/src/config/ops/loader/reset_local_data.rsindex c05b66e5f3..cd7006f0ee 100644--- a/crates/openhuman-core/src/config/ops/loader/reset_local_data.rs+++ b/crates/openhuman-core/src/config/ops/loader/reset_local_data.rs@@ -8,7 +8,7 @@ use serde_json::json;use super::load::load_config_with_timeout;use super::paths::{active_workspace_marker_path, config_openhuman_dir, default_openhuman_dir};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub(crate) fn is_windows_file_lock_error(error: &std::io::Error) -> bool {cfg!(windows) && matches!(error.raw_os_error(), Some(32 | 33))@@ -72,7 +72,7 @@ pub(crate) fn reset_local_data_marker_remove_error(path: &Path, error: &std::io:pub(crate) async fn reset_local_data_for_paths(current_openhuman_dir: &Path,default_openhuman_dir: &Path,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let active_workspace_marker = active_workspace_marker_path(default_openhuman_dir);let active_user_marker = crate::config::active_user_marker_path(default_openhuman_dir);tracing::debug!(@@ -119,7 +119,7 @@ pub(crate) async fn reset_local_data_for_paths();}- Ok(RpcOutcome::new(+ Ok(Outcome::new(json!({"removed_paths": removed_paths,"current_openhuman_dir": current_openhuman_dir.display().to_string(),@@ -147,7 +147,7 @@ pub(crate) async fn reset_local_data_for_paths(/// callers where in-process removal is acceptable (POSIX file semantics/// tolerate unlinking open files; on Windows the CLI invocation runs/// without the core attached, so no handle is in the way).-pub async fn reset_local_data() -> Result<RpcOutcome<serde_json::Value>, String> {+pub async fn reset_local_data() -> Result<Outcome<serde_json::Value>, String> {let config = load_config_with_timeout().await?;let current_openhuman_dir = config_openhuman_dir(&config);let default_openhuman_dir = default_openhuman_dir();@@ -164,7 +164,7 @@ pub async fn reset_local_data() -> Result<RpcOutcome<serde_json::Value>, String>/// after which the Tauri shell removes them while no process holds open/// handles. See OPENHUMAN-TAURI-AF for the Windows file-locking failure/// that motivated the split.-pub async fn get_data_paths() -> Result<RpcOutcome<serde_json::Value>, String> {+pub async fn get_data_paths() -> Result<Outcome<serde_json::Value>, String> {let config = load_config_with_timeout().await?;let current_openhuman_dir = config_openhuman_dir(&config);let default_openhuman_dir = default_openhuman_dir();@@ -174,7 +174,7 @@ pub async fn get_data_paths() -> Result<RpcOutcome<serde_json::Value>, String> {// out) but must leave the sibling `users/<other>` dirs and the root// itself intact — see `reset_local_data_for_paths`.let active_user_marker = crate::config::active_user_marker_path(&default_openhuman_dir);- Ok(RpcOutcome::new(+ Ok(Outcome::new(json!({"current_openhuman_dir": current_openhuman_dir.display().to_string(),"default_openhuman_dir": default_openhuman_dir.display().to_string(),@@ -215,7 +215,7 @@ pub async fn get_data_paths() -> Result<RpcOutcome<serde_json::Value>, String> {/// defense in depth, verify the resolved dir is a direct child of `users/`.pub async fn get_data_paths_for_user(user_id: &str,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {if !is_plain_user_id(user_id) {return Err(format!("refusing to resolve data paths for unsafe user id {user_id:?}: must be a single path segment with no separators, `.` or `..`"@@ -242,7 +242,7 @@ pub async fn get_data_paths_for_user(// the id or the resolved dirs. The paths are still returned in the JSON// result below for the caller that actually needs them.log::debug!("[config] get_data_paths_for_user: explicit_user_id=true");- Ok(RpcOutcome::new(+ Ok(Outcome::new(json!({"current_openhuman_dir": current_openhuman_dir.display().to_string(),"default_openhuman_dir": default_openhuman_dir.display().to_string(),diff --git a/crates/openhuman-core/src/config/ops/loader/runtime_flags.rs b/crates/openhuman-core/src/config/ops/loader/runtime_flags.rsindex 961a33be0c..df4327484a 100644--- a/crates/openhuman-core/src/config/ops/loader/runtime_flags.rs+++ b/crates/openhuman-core/src/config/ops/loader/runtime_flags.rs@@ -4,7 +4,7 @@use serde::Serialize;use serde_json::json;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub(crate) fn env_flag_enabled(key: &str) -> bool {matches!(@@ -29,8 +29,8 @@ pub(crate) const BROWSER_ALLOW_ALL_ENV: &str = "OPENHUMAN_BROWSER_ALLOW_ALL";pub(crate) const BROWSER_ALLOW_ALL_RPC_ENABLE_ENV: &str = "OPENHUMAN_BROWSER_ALLOW_ALL_RPC_ENABLE";/// Returns the current state of runtime-only flags.-pub fn get_runtime_flags() -> RpcOutcome<RuntimeFlagsOut> {- RpcOutcome::single_log(runtime_flags(), "runtime flags read")+pub fn get_runtime_flags() -> Outcome<RuntimeFlagsOut> {+ Outcome::single_log(runtime_flags(), "runtime flags read")}pub(crate) fn runtime_flags() -> RuntimeFlagsOut {@@ -50,7 +50,7 @@ pub(crate) fn runtime_flags() -> RuntimeFlagsOut {////// `is_private_host` checks still apply to the resolved IP, so this/// flag does not unlock loopback / RFC1918 destinations.-pub fn set_browser_allow_all(enabled: bool) -> Result<RpcOutcome<RuntimeFlagsOut>, String> {+pub fn set_browser_allow_all(enabled: bool) -> Result<Outcome<RuntimeFlagsOut>, String> {if enabled && !env_flag_enabled(BROWSER_ALLOW_ALL_RPC_ENABLE_ENV) {tracing::warn!("[SECURITY] refused browser allow-all enable via RPC: \@@ -97,16 +97,16 @@ pub fn set_browser_allow_all(enabled: bool) -> Result<RpcOutcome<RuntimeFlagsOut} else {"[SECURITY] browser allow-all flag set to disabled"};- Ok(RpcOutcome::single_log(flags, log_msg))+ Ok(Outcome::single_log(flags, log_msg))}/// Returns the operational status of the agent server.-pub fn agent_server_status() -> RpcOutcome<serde_json::Value> {+pub fn agent_server_status() -> Outcome<serde_json::Value> {let running = crate::platform::service::mock::mock_agent_running().unwrap_or(true);log::info!("[config] agent_server_status requested: running={running}");let payload = json!({"running": running,"url": core_rpc_url_from_env(),});- RpcOutcome::single_log(payload, "agent server status checked")+ Outcome::single_log(payload, "agent server status checked")}diff --git a/crates/openhuman-core/src/config/ops/loader/snapshot.rs b/crates/openhuman-core/src/config/ops/loader/snapshot.rsindex dd5738a8e4..8dbbec5671 100644--- a/crates/openhuman-core/src/config/ops/loader/snapshot.rs+++ b/crates/openhuman-core/src/config/ops/loader/snapshot.rs@@ -4,7 +4,7 @@ use serde_json::json;use super::load::load_config_with_timeout;use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// Serializes the current configuration into a JSON snapshot for the UI.pub fn snapshot_config_json(config: &Config) -> Result<serde_json::Value, String> {@@ -130,20 +130,20 @@ pub fn client_config_json(config: &Config) -> serde_json::Value {}/// Loads config and returns the client-facing AI config slice.-pub async fn load_and_get_client_config_snapshot() -> Result<RpcOutcome<serde_json::Value>, String>+pub async fn load_and_get_client_config_snapshot() -> Result<Outcome<serde_json::Value>, String>{let config = load_config_with_timeout().await?;let snapshot = client_config_json(&config);- Ok(RpcOutcome::new(+ Ok(Outcome::new(snapshot,vec!["client config read".to_string()],))}/// Returns a full configuration snapshot for the UI.-pub async fn get_config_snapshot(config: &Config) -> Result<RpcOutcome<serde_json::Value>, String> {+pub async fn get_config_snapshot(config: &Config) -> Result<Outcome<serde_json::Value>, String> {let snapshot = snapshot_config_json(config)?;- Ok(RpcOutcome::new(+ Ok(Outcome::new(snapshot,vec![format!("config loaded from {}",@@ -153,13 +153,13 @@ pub async fn get_config_snapshot(config: &Config) -> Result<RpcOutcome<serde_jso}/// Loads the configuration from disk and returns a snapshot.-pub async fn load_and_get_config_snapshot() -> Result<RpcOutcome<serde_json::Value>, String> {+pub async fn load_and_get_config_snapshot() -> Result<Outcome<serde_json::Value>, String> {let config = load_config_with_timeout().await?;get_config_snapshot(&config).await}/// Reads dashboard settings exposed to the desktop UI.-pub async fn get_dashboard_settings() -> Result<RpcOutcome<serde_json::Value>, String> {+pub async fn get_dashboard_settings() -> Result<Outcome<serde_json::Value>, String> {let request_id = uuid::Uuid::new_v4().to_string();tracing::debug!(target: "openhuman_core::config",@@ -209,7 +209,7 @@ pub async fn get_dashboard_settings() -> Result<RpcOutcome<serde_json::Value>, Smethod = "openhuman.config_get_dashboard_settings","OPENHUMAN: get_dashboard_settings exit");- Ok(RpcOutcome::new(+ Ok(Outcome::new(result,vec!["dashboard settings read".to_string()],))diff --git a/crates/openhuman-core/src/config/ops/model.rs b/crates/openhuman-core/src/config/ops/model.rsindex 9d1b6b051a..eab63b6f00 100644--- a/crates/openhuman-core/src/config/ops/model.rs+++ b/crates/openhuman-core/src/config/ops/model.rs@@ -1,7 +1,7 @@//! Model/provider config operations: AI providers, memory, runtime, local AI, Composio.use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::loader::{load_config_with_timeout, snapshot_config_json};@@ -252,7 +252,7 @@ fn complete_byok_route(config: &mut Config, explicit: &ExplicitRolePins) {pub async fn apply_model_settings(config: &mut Config,update: ModelSettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {// #5324: snapshot the embedder selection BEFORE applying the patch so the// failed-job un-park below only fires when the embedder actually changed.// This path also saves chat/reasoning/vision/etc. providers; without this@@ -439,7 +439,7 @@ pub async fn apply_model_settings("0".to_string()};let snapshot = snapshot_config_json(config)?;- Ok(RpcOutcome::new(+ Ok(Outcome::new(snapshot,vec![format!("model settings saved to {} (requeued_failed={requeued_note})",@@ -451,7 +451,7 @@ pub async fn apply_model_settings(/// Loads the configuration, applies model settings updates, and saves it.pub async fn load_and_apply_model_settings(update: ModelSettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let mut config = load_config_with_timeout().await?;apply_model_settings(&mut config, update).await}@@ -460,7 +460,7 @@ pub async fn load_and_apply_model_settings(pub async fn apply_memory_settings(config: &mut Config,update: MemorySettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {// #5324: snapshot the embedding signature BEFORE applying the patch. This// path also saves `backend` / `auto_save` / `memory_window`, none of which// remediate a budget-exhausted embedder — so the failed-job un-park below@@ -531,7 +531,7 @@ pub async fn apply_memory_settings("0".to_string()};let snapshot = snapshot_config_json(config)?;- Ok(RpcOutcome::new(+ Ok(Outcome::new(snapshot,vec![format!("memory settings saved to {} (requeued_failed={requeued_note})",@@ -543,7 +543,7 @@ pub async fn apply_memory_settings(/// Loads the configuration, applies memory settings updates, and saves it.pub async fn load_and_apply_memory_settings(update: MemorySettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let mut config = load_config_with_timeout().await?;apply_memory_settings(&mut config, update).await}@@ -552,7 +552,7 @@ pub async fn load_and_apply_memory_settings(pub async fn apply_runtime_settings(config: &mut Config,update: RuntimeSettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {if let Some(kind) = update.kind {config.runtime.kind = kind;}@@ -561,7 +561,7 @@ pub async fn apply_runtime_settings(}config.save().await.map_err(|e| e.to_string())?;let snapshot = snapshot_config_json(config)?;- Ok(RpcOutcome::new(+ Ok(Outcome::new(snapshot,vec![format!("runtime settings saved to {}",@@ -573,7 +573,7 @@ pub async fn apply_runtime_settings(/// Loads the configuration, applies runtime settings updates, and saves it.pub async fn load_and_apply_runtime_settings(update: RuntimeSettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let mut config = load_config_with_timeout().await?;apply_runtime_settings(&mut config, update).await}@@ -582,7 +582,7 @@ pub async fn load_and_apply_runtime_settings(pub async fn apply_local_ai_settings(config: &mut Config,update: LocalAiSettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {if let Some(v) = update.runtime_enabled {config.local_ai.runtime_enabled = v;}@@ -647,7 +647,7 @@ pub async fn apply_local_ai_settings(}config.save().await.map_err(|e| e.to_string())?;let snapshot = snapshot_config_json(config)?;- Ok(RpcOutcome::new(+ Ok(Outcome::new(snapshot,vec![format!("local AI settings saved to {}",@@ -659,7 +659,7 @@ pub async fn apply_local_ai_settings(/// Loads the configuration, applies local-AI settings updates, and saves it.pub async fn load_and_apply_local_ai_settings(update: LocalAiSettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let mut config = load_config_with_timeout().await?;apply_local_ai_settings(&mut config, update).await}@@ -668,7 +668,7 @@ pub async fn load_and_apply_local_ai_settings(pub async fn apply_composio_trigger_settings(config: &mut Config,update: ComposioTriggerSettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {if let Some(v) = update.triage_disabled {config.composio.triage_disabled = v;tracing::debug!(@@ -685,7 +685,7 @@ pub async fn apply_composio_trigger_settings(}config.save().await.map_err(|e| e.to_string())?;let snapshot = snapshot_config_json(config)?;- Ok(RpcOutcome::new(+ Ok(Outcome::new(snapshot,vec![format!("composio trigger settings saved to {}",@@ -697,19 +697,19 @@ pub async fn apply_composio_trigger_settings(/// Loads the configuration, applies composio trigger settings, and saves it.pub async fn load_and_apply_composio_trigger_settings(update: ComposioTriggerSettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let mut config = load_config_with_timeout().await?;apply_composio_trigger_settings(&mut config, update).await}/// Reads the current composio trigger-triage settings.-pub async fn get_composio_trigger_settings() -> Result<RpcOutcome<serde_json::Value>, String> {+pub async fn get_composio_trigger_settings() -> Result<Outcome<serde_json::Value>, String> {let config = load_config_with_timeout().await?;let result = serde_json::json!({"triage_disabled": config.composio.triage_disabled,"triage_disabled_toolkits": config.composio.triage_disabled_toolkits,});- Ok(RpcOutcome::new(+ Ok(Outcome::new(result,vec!["composio trigger settings read".to_string()],))@@ -722,10 +722,10 @@ pub(crate) fn resolve_backend_api_url(config: &Config) -> String {}/// Resolves the effective backend API URL from configuration or defaults.-pub async fn load_and_resolve_api_url() -> Result<RpcOutcome<serde_json::Value>, String> {+pub async fn load_and_resolve_api_url() -> Result<Outcome<serde_json::Value>, String> {let config = load_config_with_timeout().await?;let resolved = resolve_backend_api_url(&config);- Ok(RpcOutcome::new(+ Ok(Outcome::new(serde_json::json!({ "api_url": resolved }),Vec::new(),))diff --git a/crates/openhuman-core/src/config/ops/privacy.rs b/crates/openhuman-core/src/config/ops/privacy.rsindex e0de6cb8c3..b45d001abc 100644--- a/crates/openhuman-core/src/config/ops/privacy.rs+++ b/crates/openhuman-core/src/config/ops/privacy.rs@@ -6,7 +6,7 @@//! immediately, without a core restart.use crate::config::{Config, PrivacyMode};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::loader::load_config_with_timeout;@@ -41,13 +41,13 @@ fn privacy_mode_value(mode: PrivacyMode) -> serde_json::Value {}/// Returns the current `[privacy]` mode as `{ "mode": "<snake_case>" }`.-pub async fn get_privacy_mode() -> Result<RpcOutcome<serde_json::Value>, String> {+pub async fn get_privacy_mode() -> Result<Outcome<serde_json::Value>, String> {let config = load_config_with_timeout().await?;log::debug!("[privacy][rpc] get_privacy_mode -> {:?}",config.privacy.mode);- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(privacy_mode_value(config.privacy.mode),"privacy mode read",))@@ -59,7 +59,7 @@ pub async fn get_privacy_mode() -> Result<RpcOutcome<serde_json::Value>, String>pub async fn apply_privacy_settings(config: &mut Config,update: PrivacySettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {if let Some(raw) = update.mode {let mode = parse_privacy_mode(&raw)?;log::debug!(@@ -85,7 +85,7 @@ pub async fn apply_privacy_settings(),}- Ok(RpcOutcome::new(+ Ok(Outcome::new(privacy_mode_value(config.privacy.mode),vec![format!("privacy mode saved to {}",@@ -97,7 +97,7 @@ pub async fn apply_privacy_settings(/// Loads the configuration, applies the privacy-mode update, and saves it.pub async fn load_and_apply_privacy_settings(update: PrivacySettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let mut config = load_config_with_timeout().await?;apply_privacy_settings(&mut config, update).await}diff --git a/crates/openhuman-core/src/config/ops/sandbox.rs b/crates/openhuman-core/src/config/ops/sandbox.rsindex f5e9f14db0..9169bf7594 100644--- a/crates/openhuman-core/src/config/ops/sandbox.rs+++ b/crates/openhuman-core/src/config/ops/sandbox.rs@@ -1,7 +1,7 @@//! Sandbox / Docker runtime config operations.use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::loader::{load_config_with_timeout, snapshot_config_json};@@ -16,7 +16,7 @@ pub struct SandboxSettingsPatch {pub env_passthrough: Option<Vec<String>>,}-pub async fn get_sandbox_settings() -> Result<RpcOutcome<serde_json::Value>, String> {+pub async fn get_sandbox_settings() -> Result<Outcome<serde_json::Value>, String> {let config = load_config_with_timeout().await?;let sandbox = &config.sandbox;let docker = &config.runtime.docker;@@ -45,13 +45,13 @@ pub async fn get_sandbox_settings() -> Result<RpcOutcome<serde_json::Value>, Str"env_passthrough": crate::sandbox::ops::SANDBOX_ENV_PASSTHROUGH,});log::debug!("[config][sandbox] get_sandbox_settings: backend={backend_str}, docker_available={docker_available}");- Ok(RpcOutcome::single_log(value, "sandbox settings read"))+ Ok(Outcome::single_log(value, "sandbox settings read"))}pub async fn apply_sandbox_settings(config: &mut Config,update: SandboxSettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {if let Some(ref backend) = update.backend {config.sandbox.backend = match backend.as_str() {"auto" => crate::config::SandboxBackend::Auto,@@ -101,7 +101,7 @@ pub async fn apply_sandbox_settings(config.config_path.display());let snapshot = snapshot_config_json(config)?;- Ok(RpcOutcome::new(+ Ok(Outcome::new(snapshot,vec![format!("sandbox settings saved to {}",@@ -112,7 +112,7 @@ pub async fn apply_sandbox_settings(pub async fn load_and_apply_sandbox_settings(update: SandboxSettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let mut config = load_config_with_timeout().await?;apply_sandbox_settings(&mut config, update).await}diff --git a/crates/openhuman-core/src/config/ops/ui.rs b/crates/openhuman-core/src/config/ops/ui.rsindex d5adb269fc..a0bd5f8ade 100644--- a/crates/openhuman-core/src/config/ops/ui.rs+++ b/crates/openhuman-core/src/config/ops/ui.rs@@ -4,7 +4,7 @@use serde_json::json;use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::loader::{fallback_workspace_dir, load_config_with_timeout, snapshot_config_json};@@ -98,7 +98,7 @@ pub struct VoiceServerSettingsPatch {pub async fn apply_browser_settings(config: &mut Config,update: BrowserSettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let normalized_backend = update.backend.as_deref()@@ -160,7 +160,7 @@ pub async fn apply_browser_settings(config.browser = browser;config.save().await.map_err(|e| e.to_string())?;let snapshot = snapshot_config_json(config)?;- Ok(RpcOutcome::new(+ Ok(Outcome::new(snapshot,vec![format!("browser settings saved to {}",@@ -192,7 +192,7 @@ fn normalize_browser_backend(raw: &str) -> Result<String, String> {/// Loads the configuration, applies browser settings updates, and saves it.pub async fn load_and_apply_browser_settings(update: BrowserSettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let mut config = load_config_with_timeout().await?;apply_browser_settings(&mut config, update).await}@@ -201,13 +201,13 @@ pub async fn load_and_apply_browser_settings(pub async fn apply_analytics_settings(config: &mut Config,update: AnalyticsSettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {if let Some(enabled) = update.enabled {config.observability.analytics_enabled = enabled;}config.save().await.map_err(|e| e.to_string())?;let snapshot = snapshot_config_json(config)?;- Ok(RpcOutcome::new(+ Ok(Outcome::new(snapshot,vec![format!("analytics settings saved to {}",@@ -219,7 +219,7 @@ pub async fn apply_analytics_settings(/// Loads the configuration, applies analytics settings updates, and saves it.pub async fn load_and_apply_analytics_settings(update: AnalyticsSettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let mut config = load_config_with_timeout().await?;apply_analytics_settings(&mut config, update).await}@@ -229,7 +229,7 @@ pub async fn load_and_apply_analytics_settings(pub async fn apply_search_settings(config: &mut Config,update: SearchSettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {if let Some(engine) = update.engine {let trimmed = engine.trim();match trimmed {@@ -378,7 +378,7 @@ pub async fn apply_search_settings(#[cfg(feature = "modules")]crate::modules::search::refresh_loaded(config).await?;let snapshot = search_settings_json(config);- Ok(RpcOutcome::new(+ Ok(Outcome::new(snapshot,vec![format!("search settings saved to {}",@@ -389,7 +389,7 @@ pub async fn apply_search_settings(pub async fn load_and_apply_search_settings(update: SearchSettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let mut config = load_config_with_timeout().await?;apply_search_settings(&mut config, update).await}@@ -436,10 +436,10 @@ fn search_settings_json(config: &Config) -> serde_json::Value {/// Read the current search engine settings (with API keys redacted to a/// presence boolean so the UI can show "configured" without ever rendering/// the raw secret).-pub async fn get_search_settings() -> Result<RpcOutcome<serde_json::Value>, String> {+pub async fn get_search_settings() -> Result<Outcome<serde_json::Value>, String> {let config = load_config_with_timeout().await?;let result = search_settings_json(&config);- Ok(RpcOutcome::new(+ Ok(Outcome::new(result,vec!["search settings read".to_string()],))@@ -449,7 +449,7 @@ pub async fn get_search_settings() -> Result<RpcOutcome<serde_json::Value>, Stripub async fn workspace_onboarding_flag_resolve(flag_name: Option<String>,default_name: &str,-) -> Result<RpcOutcome<bool>, String> {+) -> Result<Outcome<bool>, String> {let name = flag_name.unwrap_or_else(|| default_name.to_string());let trimmed = name.trim();if trimmed.is_empty()@@ -470,7 +470,7 @@ pub async fn workspace_onboarding_flag_resolve(pub fn workspace_onboarding_flag_exists(workspace_dir: std::path::PathBuf,flag_name: &str,-) -> Result<RpcOutcome<bool>, String> {+) -> Result<Outcome<bool>, String> {let trimmed = flag_name.trim();if trimmed.is_empty()|| trimmed.contains('/')@@ -479,7 +479,7 @@ pub fn workspace_onboarding_flag_exists({return Err("Invalid onboarding flag name".to_string());}- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(workspace_dir.join(trimmed).is_file(),"onboarding flag checked",))@@ -490,7 +490,7 @@ pub async fn workspace_onboarding_flag_set(flag_name: Option<String>,default_name: &str,value: bool,-) -> Result<RpcOutcome<bool>, String> {+) -> Result<Outcome<bool>, String> {let name = flag_name.unwrap_or_else(|| default_name.to_string());let trimmed = name.trim();if trimmed.is_empty()@@ -516,16 +516,16 @@ pub async fn workspace_onboarding_flag_set(std::fs::remove_file(&flag_path).map_err(|e| format!("Failed to remove onboarding flag: {e}"))?;}- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(flag_path.is_file(),"onboarding flag updated",))}/// Returns whether the onboarding process has been marked as completed.-pub async fn get_onboarding_completed() -> Result<RpcOutcome<bool>, String> {+pub async fn get_onboarding_completed() -> Result<Outcome<bool>, String> {let config = load_config_with_timeout().await?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(config.onboarding_completed,"onboarding_completed read from config",))@@ -535,7 +535,7 @@ pub async fn get_onboarding_completed() -> Result<RpcOutcome<bool>, String> {////// On a false→true transition, seeds the recurring morning-briefing/// cron job via [`crate::cron::seed::seed_proactive_agents`].-pub async fn set_onboarding_completed(value: bool) -> Result<RpcOutcome<bool>, String> {+pub async fn set_onboarding_completed(value: bool) -> Result<Outcome<bool>, String> {tracing::debug!(value, "[onboarding] set_onboarding_completed called");let mut config = load_config_with_timeout().await?;let was_completed = config.onboarding_completed;@@ -561,14 +561,14 @@ pub async fn set_onboarding_completed(value: bool) -> Result<RpcOutcome<bool>, S);}- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(config.onboarding_completed,"onboarding_completed saved to config",))}/// Returns the current dictation settings as a JSON object.-pub async fn get_dictation_settings() -> Result<RpcOutcome<serde_json::Value>, String> {+pub async fn get_dictation_settings() -> Result<Outcome<serde_json::Value>, String> {let config = load_config_with_timeout().await?;let result = json!({"enabled": config.dictation.enabled,@@ -578,7 +578,7 @@ pub async fn get_dictation_settings() -> Result<RpcOutcome<serde_json::Value>, S"streaming": config.dictation.streaming,"streaming_interval_ms": config.dictation.streaming_interval_ms,});- Ok(RpcOutcome::new(+ Ok(Outcome::new(result,vec!["dictation settings read".to_string()],))@@ -587,7 +587,7 @@ pub async fn get_dictation_settings() -> Result<RpcOutcome<serde_json::Value>, S/// Loads configuration, applies dictation settings updates, and saves it.pub async fn load_and_apply_dictation_settings(update: DictationSettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let mut config = load_config_with_timeout().await?;if let Some(enabled) = update.enabled {config.dictation.enabled = enabled;@@ -621,7 +621,7 @@ pub async fn load_and_apply_dictation_settings(}config.save().await.map_err(|e| e.to_string())?;let snapshot = snapshot_config_json(&config)?;- Ok(RpcOutcome::new(+ Ok(Outcome::new(snapshot,vec![format!("dictation settings saved to {}",@@ -631,7 +631,7 @@ pub async fn load_and_apply_dictation_settings(}/// Returns the current voice server settings as a JSON object.-pub async fn get_voice_server_settings() -> Result<RpcOutcome<serde_json::Value>, String> {+pub async fn get_voice_server_settings() -> Result<Outcome<serde_json::Value>, String> {let config = load_config_with_timeout().await?;let result = json!({"auto_start": config.voice_server.auto_start,@@ -645,7 +645,7 @@ pub async fn get_voice_server_settings() -> Result<RpcOutcome<serde_json::Value>"wake_word": config.voice_server.wake_word,"stt_engine": config.voice_server.stt_engine,});- Ok(RpcOutcome::new(+ Ok(Outcome::new(result,vec!["voice server settings read".to_string()],))@@ -654,7 +654,7 @@ pub async fn get_voice_server_settings() -> Result<RpcOutcome<serde_json::Value>/// Loads configuration, applies voice server settings updates, and saves it.pub async fn load_and_apply_voice_server_settings(update: VoiceServerSettingsPatch,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let mut config = load_config_with_timeout().await?;if let Some(auto_start) = update.auto_start {config.voice_server.auto_start = auto_start;@@ -706,7 +706,7 @@ pub async fn load_and_apply_voice_server_settings(}config.save().await.map_err(|e| e.to_string())?;let snapshot = snapshot_config_json(&config)?;- Ok(RpcOutcome::new(+ Ok(Outcome::new(snapshot,vec![format!("voice server settings saved to {}",diff --git a/crates/openhuman-core/src/config/schemas/controllers/workspace.rs b/crates/openhuman-core/src/config/schemas/controllers/workspace.rsindex 38099f30d3..e5e8b69f57 100644--- a/crates/openhuman-core/src/config/schemas/controllers/workspace.rs+++ b/crates/openhuman-core/src/config/schemas/controllers/workspace.rs@@ -52,12 +52,12 @@ pub(super) fn handle_update_analytics_settings(params: Map<String, Value>) -> Copub(super) fn handle_get_analytics_settings(_params: Map<String, Value>) -> ControllerFuture {Box::pin(async {- use crate::rpc::RpcOutcome;+ use crate::core::Outcome;let config = config_rpc::load_config_with_timeout().await?;let result = serde_json::json!({"enabled": config.observability.analytics_enabled,});- to_json(RpcOutcome::new(+ to_json(Outcome::new(result,vec!["analytics settings read".to_string()],))@@ -100,7 +100,7 @@ pub(crate) fn handle_get_data_paths(params: Map<String, Value>) -> ControllerFut/// resolution (the default used by the agent tool and diagnostics).async fn resolve_data_paths(params: Map<String, Value>,-) -> Result<crate::rpc::RpcOutcome<Value>, String> {+) -> Result<crate::core::Outcome<Value>, String> {let user_id = params.get("user_id").and_then(Value::as_str)diff --git a/crates/openhuman-core/src/config/schemas/helpers.rs b/crates/openhuman-core/src/config/schemas/helpers.rsindex 47ad87cadf..832fb5d413 100644--- a/crates/openhuman-core/src/config/schemas/helpers.rs+++ b/crates/openhuman-core/src/config/schemas/helpers.rs@@ -3,7 +3,7 @@ use serde::Deserialize;use serde_json::{Map, Value};use crate::core::{FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub(super) const DEFAULT_ONBOARDING_FLAG_NAME: &str = ".skip_onboarding";@@ -344,6 +344,6 @@ pub fn json_output(name: &'static str, comment: &'static str) -> FieldSchema {}}-pub(super) fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+pub(super) fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/config/schemas/mod.rs b/crates/openhuman-core/src/config/schemas/mod.rsindex cef197654a..ce6cb9aa21 100644--- a/crates/openhuman-core/src/config/schemas/mod.rs+++ b/crates/openhuman-core/src/config/schemas/mod.rs@@ -5,7 +5,7 @@//! `core/all.rs` registers the latter under `DomainGroup::Config` (the schema-only//! list is consumed by tests). Handlers here are thin: they deserialize params,//! delegate to `config::ops` (re-exported as `config::rpc`) for the actual-//! mutation/read, and shape the `RpcOutcome` response.+//! mutation/read, and shape the `Outcome` response.//!//! - `controllers.rs` — declares submodules `controllers/{agent,inference,//! integrations,registry,voice,workspace}.rs` (split for file-size only;@@ -48,7 +48,7 @@ pub use controllers::{all_controller_schemas, all_registered_controllers};#[cfg(test)]use crate::core::TypeSchema;#[cfg(test)]-use crate::rpc::RpcOutcome;+use crate::core::Outcome;#[cfg(test)]use controllers::{handle_get_agent_paths, handle_get_autonomy_settings, handle_update_autonomy_settings,diff --git a/crates/openhuman-core/src/config/schemas_tests.rs b/crates/openhuman-core/src/config/schemas_tests.rsindex ee3eb9a468..7e9cfa7b34 100644--- a/crates/openhuman-core/src/config/schemas_tests.rs+++ b/crates/openhuman-core/src/config/schemas_tests.rs@@ -79,7 +79,7 @@ fn json_output_helper_builds_required_json_field() {#[test]fn to_json_wraps_rpc_outcome() {let v =- to_json(RpcOutcome::single_log(serde_json::json!({"ok": true}), "l")).expect("serialize");+ to_json(Outcome::single_log(serde_json::json!({"ok": true}), "l")).expect("serialize");assert!(v.get("logs").is_some() || v.get("result").is_some());}diff --git a/crates/openhuman-core/src/config/tools.rs b/crates/openhuman-core/src/config/tools.rsindex ba86d7be70..b087a213f3 100644--- a/crates/openhuman-core/src/config/tools.rs+++ b/crates/openhuman-core/src/config/tools.rs@@ -29,7 +29,7 @@ macro_rules! emit {}};}-/// Read tool over an arg-less `async fn() -> Result<RpcOutcome<Value>, String>`.+/// Read tool over an arg-less `async fn() -> Result<Outcome<Value>, String>`.macro_rules! read_tool {($ty:ident, $name:literal, $fn:ident, $desc:literal) => {pub struct $ty;@@ -94,7 +94,7 @@ impl Tool for ConfigSnapshotTool {}}-/// Runtime flags (sync, returns RpcOutcome directly).+/// Runtime flags (sync, returns Outcome directly).pub struct ConfigRuntimeFlagsTool;#[async_trait]diff --git a/crates/openhuman-core/src/config/workspace/README.md b/crates/openhuman-core/src/config/workspace/README.mdindex 0772b68c99..aec0c77c11 100644--- a/crates/openhuman-core/src/config/workspace/README.md+++ b/crates/openhuman-core/src/config/workspace/README.md@@ -17,7 +17,7 @@ Owns workspace layout bootstrap and the editable "Persona Pack" prompt files (`S| --- | --- || `crates/openhuman-core/src/config/workspace/mod.rs` | Export-focused. Re-exports `ops::*` and the RPC controller-schema pair (`all_workspace_controller_schemas` / `all_workspace_registered_controllers`). || `crates/openhuman-core/src/config/workspace/ops.rs` | `init_workspace(force)` bootstrap logic, the `BOOTSTRAP_FILES` table (`SOUL.md`, `IDENTITY.md`), `bundled_default_contents` (the editable allowlist + reset source of truth), and `ensure_workspace_file`. |-| `crates/openhuman-core/src/config/workspace/rpc.rs` | Pure-domain persona file API: `WorkspaceFile` type, `read_workspace_file` / `write_workspace_file` / `reset_workspace_file`, `MAX_WORKSPACE_FILE_BYTES`, allowlist enforcement (`ensure_editable`). Returns `RpcOutcome<WorkspaceFile>`. |+| `crates/openhuman-core/src/config/workspace/rpc.rs` | Pure-domain persona file API: `WorkspaceFile` type, `read_workspace_file` / `write_workspace_file` / `reset_workspace_file`, `MAX_WORKSPACE_FILE_BYTES`, allowlist enforcement (`ensure_editable`). Returns `Outcome<WorkspaceFile>`. || `crates/openhuman-core/src/config/workspace/schemas.rs` | Controller schemas + `handle_*` fns delegating to `rpc.rs`; loads config to resolve `workspace_dir`. |## Public surface@@ -40,7 +40,7 @@ Namespace `workspace`; three controllers (defined in `schemas.rs`, all return th| `openhuman.workspace_file_write` | `filename`, `contents` | Overwrite an editable persona file (size-capped server-side). || `openhuman.workspace_file_reset` | `filename` | Restore an editable persona file to its bundled default. |-Handlers resolve `workspace_dir` from config (`config_rpc::load_config_with_timeout`), trim the filename, delegate to `rpc.rs`, and serialize via `RpcOutcome::into_cli_compatible_json`. Unknown function names yield an `unknown` schema. Wired into the global registry in `crates/openhuman-core/src/core/all.rs`.+Handlers resolve `workspace_dir` from config (`config_rpc::load_config_with_timeout`), trim the filename, delegate to `rpc.rs`, and serialize via `Outcome::into_cli_compatible_json`. Unknown function names yield an `unknown` schema. Wired into the global registry in `crates/openhuman-core/src/core/all.rs`.## Persistence@@ -57,7 +57,7 @@ The editable surface is restricted to the `BOOTSTRAP_FILES` allowlist (`SOUL.md`- `crate::skills::init_skills_dir` — seeds the `skills/` directory README during `init_workspace`.- `crate::subconscious::heartbeat::engine::HeartbeatEngine::ensure_heartbeat_file` — ensures `HEARTBEAT.md` during `init_workspace`.- `crate::core::all` (`ControllerFuture`, `RegisteredController`) and `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` — controller registry types.-- `crate::rpc::RpcOutcome` — uniform RPC return type.+- `crate::rpc::Outcome` — uniform RPC return type.- Bundled prompt assets via `include_str!("../../agent/prompts/SOUL.md" | "IDENTITY.md")`.## Used bydiff --git a/crates/openhuman-core/src/config/workspace/rpc.rs b/crates/openhuman-core/src/config/workspace/rpc.rsindex 24191cd52e..158a12e41b 100644--- a/crates/openhuman-core/src/config/workspace/rpc.rs+++ b/crates/openhuman-core/src/config/workspace/rpc.rs@@ -12,7 +12,7 @@ use std::path::Path;use serde::Serialize;use crate::config::workspace::ops::bundled_default_contents;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// Hard cap on the size accepted by [`write_workspace_file`] and tolerated by/// [`read_workspace_file`]. `SOUL.md` / `IDENTITY.md` are prose prompts@@ -54,7 +54,7 @@ fn ensure_editable(filename: &str) -> Result<&'static str, String> {pub fn read_workspace_file(workspace_dir: &Path,filename: &str,-) -> Result<RpcOutcome<WorkspaceFile>, String> {+) -> Result<Outcome<WorkspaceFile>, String> {let default_contents = ensure_editable(filename)?;let path = workspace_dir.join(filename);@@ -69,7 +69,7 @@ pub fn read_workspace_file(log::debug!("[workspace][rpc] read fallback-to-default file='{filename}' (missing on disk)");- return Ok(RpcOutcome::new(+ return Ok(Outcome::new(WorkspaceFile {filename: filename.to_string(),contents: default_contents.to_string(),@@ -115,7 +115,7 @@ pub fn read_workspace_file("[workspace][rpc] read ok file='{filename}' bytes={}",contents.len());- Ok(RpcOutcome::new(+ Ok(Outcome::new(WorkspaceFile {filename: filename.to_string(),contents,@@ -132,7 +132,7 @@ pub fn write_workspace_file(workspace_dir: &Path,filename: &str,contents: &str,-) -> Result<RpcOutcome<WorkspaceFile>, String> {+) -> Result<Outcome<WorkspaceFile>, String> {ensure_editable(filename)?;if contents.len() as u64 > MAX_WORKSPACE_FILE_BYTES {log::debug!(@@ -162,7 +162,7 @@ pub fn write_workspace_file("[workspace][rpc] write ok file='{filename}' bytes={}",contents.len());- Ok(RpcOutcome::new(+ Ok(Outcome::new(WorkspaceFile {filename: filename.to_string(),contents: contents.to_string(),@@ -177,7 +177,7 @@ pub fn write_workspace_file(pub fn reset_workspace_file(workspace_dir: &Path,filename: &str,-) -> Result<RpcOutcome<WorkspaceFile>, String> {+) -> Result<Outcome<WorkspaceFile>, String> {let default_contents = ensure_editable(filename)?;let path = workspace_dir.join(filename);std::fs::create_dir_all(workspace_dir).map_err(|e| {@@ -195,7 +195,7 @@ pub fn reset_workspace_file(format!("failed to reset {filename}: {e}")})?;log::debug!("[workspace][rpc] reset ok file='{filename}' (restored bundled default)");- Ok(RpcOutcome::new(+ Ok(Outcome::new(WorkspaceFile {filename: filename.to_string(),contents: default_contents.to_string(),diff --git a/crates/openhuman-core/src/config/workspace/schemas.rs b/crates/openhuman-core/src/config/workspace/schemas.rsindex a2e2ebab00..5901b5ae0f 100644--- a/crates/openhuman-core/src/config/workspace/schemas.rs+++ b/crates/openhuman-core/src/config/workspace/schemas.rs@@ -5,7 +5,7 @@ use crate::config::rpc as config_rpc;use crate::config::workspace::rpc as workspace_rpc;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub fn all_controller_schemas() -> Vec<ControllerSchema> {vec![@@ -170,7 +170,7 @@ fn read_required<T: DeserializeOwned>(params: &Map<String, Value>, key: &str) ->serde_json::from_value(value).map_err(|e| format!("invalid '{key}': {e}"))}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/core/README.md b/crates/openhuman-core/src/core/README.mdindex c9bf0b3086..47691dee64 100644--- a/crates/openhuman-core/src/core/README.md+++ b/crates/openhuman-core/src/core/README.md@@ -213,7 +213,7 @@ expected to reuse the same registry rather than invent their own.## `crate::rpc``crate::rpc` is `pub use openhuman_rpc as rpc;` (see `lib.rs`), so-`crate::rpc::RpcOutcome`, `StructuredRpcError`, and `apply_log_envelope` are+`crate::rpc::Outcome`, `StructuredRpcError`, and `apply_log_envelope` arethe same types `crates/openhuman-rpc` exposes to `openhuman-app` and`openhuman-tui`. There is no separate RPC contract layer under `core/`.diff --git a/crates/openhuman-core/src/core/all.rs b/crates/openhuman-core/src/core/all.rsindex 34b520051d..06823c382c 100644--- a/crates/openhuman-core/src/core/all.rs+++ b/crates/openhuman-core/src/core/all.rs@@ -1489,7 +1489,7 @@ pub fn validate_params() -> Result<(), String> {for input in &schema.inputs {if input.required && !params.contains_key(input.name) {- return Err(crate::rpc::missing_required_param_message(+ return Err(crate::core::params::missing_required_param_message(input.name,input.comment,));@@ -1498,7 +1498,7 @@ pub fn validate_params(for key in params.keys() {if !schema.inputs.iter().any(|f| f.name == key) {- return Err(crate::rpc::unknown_param_message(+ return Err(crate::core::params::unknown_param_message(key,schema.namespace,schema.function,@@ -1515,7 +1515,7 @@ pub fn validate_params(check_type(value, &input.ty).map_err(|mismatch| {let (expected, got) = match mismatch {TypeMismatch::Kind(expected) => {- (expected.to_string(), crate::rpc::json_type_name(value).to_string())+ (expected.to_string(), crate::core::params::json_type_name(value).to_string())}TypeMismatch::OutOfRange { min, max, got } => {log::debug!(diff --git a/crates/openhuman-core/src/core/cli.rs b/crates/openhuman-core/src/core/cli.rsindex 3eab8331eb..5163fcc7dd 100644--- a/crates/openhuman-core/src/core/cli.rs+++ b/crates/openhuman-core/src/core/cli.rs@@ -12,7 +12,7 @@ use crate::core::all;use crate::core::jsonrpc::{default_state, invoke_method};use crate::core::logging::CliLogDefault;use crate::core::{ControllerSchema, TypeSchema};-use crate::rpc::parse_json_params;+use crate::core::params::parse_json_params;/// The ASCII banner displayed when the CLI starts.const CLI_BANNER: &str = r#"diff --git a/crates/openhuman-core/src/core/jsonrpc/classify.rs b/crates/openhuman-core/src/core/jsonrpc/classify.rsindex 25c69e1cb4..53daa14762 100644--- a/crates/openhuman-core/src/core/jsonrpc/classify.rs+++ b/crates/openhuman-core/src/core/jsonrpc/classify.rs@@ -186,7 +186,7 @@ pub(super) fn classify_failure(message: &str, expected_user_state: bool) -> FailFailureDisposition::ExpectedUserState} else if is_wallet_not_configured_error(message) {FailureDisposition::WalletNotConfigured- } else if crate::rpc::is_param_validation_error(message) {+ } else if crate::core::params::is_param_validation_error(message) {FailureDisposition::ParamValidation} else if is_session_expired_error(message) {FailureDisposition::SessionExpireddiff --git a/crates/openhuman-core/src/core/jsonrpc/classify_tests.rs b/crates/openhuman-core/src/core/jsonrpc/classify_tests.rsindex 0f8722b023..11e3710471 100644--- a/crates/openhuman-core/src/core/jsonrpc/classify_tests.rs+++ b/crates/openhuman-core/src/core/jsonrpc/classify_tests.rs@@ -295,7 +295,7 @@ fn classify_failure_routes_each_boundary_class() {);assert_eq!(classify_failure(- &crate::rpc::unknown_param_message("api_key", "config", "update_model_settings"),+ &crate::core::params::unknown_param_message("api_key", "config", "update_model_settings"),false),FailureDisposition::ParamValidation@@ -328,7 +328,7 @@ fn classify_failure_param_validation_outranks_session_expiry() {// could have expired anything.assert_eq!(classify_failure(- &crate::rpc::missing_required_param_message("token", "Session expired token"),+ &crate::core::params::missing_required_param_message("token", "Session expired token"),false),FailureDisposition::ParamValidationdiff --git a/crates/openhuman-core/src/core/jsonrpc/invoke.rs b/crates/openhuman-core/src/core/jsonrpc/invoke.rsindex 921d374c1b..e537851bb8 100644--- a/crates/openhuman-core/src/core/jsonrpc/invoke.rs+++ b/crates/openhuman-core/src/core/jsonrpc/invoke.rs@@ -104,7 +104,7 @@ async fn invoke_method_inner() -> Result<Value, String> {// Phase 1: Check static controller registry.if let Some(schema) = all::schema_for_rpc_method(method) {- let params_obj = crate::rpc::params_to_object(params.clone())?;+ let params_obj = crate::core::params::params_to_object(params.clone())?;// Validate inputs against the schema before calling the handler.all::validate_params(&schema, ¶ms_obj)?;if let Some(result) = all::try_invoke_registered_rpc(method, params_obj).await {diff --git a/crates/openhuman-core/src/core/subsystem/schemas.rs b/crates/openhuman-core/src/core/subsystem/schemas.rsindex b7ba7a3b1d..f12a6a70dc 100644--- a/crates/openhuman-core/src/core/subsystem/schemas.rs+++ b/crates/openhuman-core/src/core/subsystem/schemas.rs@@ -23,7 +23,7 @@ use serde_json::{Map, Value};use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::status::SubsystemStatus;@@ -79,7 +79,7 @@ fn handle_status(_params: Map<String, Value>) -> ControllerFuture {Box::pin(async move {let rows = subsystems_status().await;log::debug!("[subsystem] status requested: {} slot(s)", rows.len());- RpcOutcome::new(serde_json::json!({ "subsystems": rows }), vec![])+ Outcome::new(serde_json::json!({ "subsystems": rows }), vec![]).into_cli_compatible_json()})}diff --git a/crates/openhuman-core/src/core/types.rs b/crates/openhuman-core/src/core/types.rsindex a3348262a4..518e60c392 100644--- a/crates/openhuman-core/src/core/types.rs+++ b/crates/openhuman-core/src/core/types.rs@@ -65,11 +65,11 @@ impl InvocationResult {/// - `!logs.is_empty()` -> `{ "result": inv.value, "logs": inv.logs }`pub fn invocation_to_rpc_json(inv: InvocationResult) -> serde_json::Value {// Delegates rather than repeating the rule. This function and- // `RpcOutcome::into_cli_compatible_json` are the two ways a controller+ // `Outcome::into_cli_compatible_json` are the two ways a controller// result reaches a caller, and they carried independent copies of the same// six lines — so a fix to one would have silently left the other on the old- // shape. See `crate::rpc::apply_log_envelope` (#6080).- crate::rpc::apply_log_envelope(inv.value, inv.logs)+ // shape. See `crate::core::apply_log_envelope` (#6080).+ crate::core::apply_log_envelope(inv.value, inv.logs)}/// Global core-level application state.diff --git a/crates/openhuman-core/src/core/types_tests.rs b/crates/openhuman-core/src/core/types_tests.rsindex 05440ff819..e13b18ee08 100644--- a/crates/openhuman-core/src/core/types_tests.rs+++ b/crates/openhuman-core/src/core/types_tests.rs@@ -42,7 +42,7 @@ fn invocation_to_rpc_json_with_logs_wraps_in_envelope() {/// The two controller return paths must produce byte-identical JSON for the/// same (value, logs) pair.///-/// `RpcOutcome::into_cli_compatible_json` (the registry path, 152 call+/// `Outcome::into_cli_compatible_json` (the registry path, 152 call/// sites) and `invocation_to_rpc_json` (the dynamic-dispatch path) used to/// carry independent copies of the same envelope rule. Nothing linked them,/// so a fix or a normalisation applied to one would have left the other@@ -69,7 +69,7 @@ fn both_controller_return_paths_apply_the_same_log_envelope() {value: value.clone(),logs: logs.clone(),});- let via_registry = crate::rpc::RpcOutcome::new(value.clone(), logs.clone())+ let via_registry = crate::core::Outcome::new(value.clone(), logs.clone()).into_cli_compatible_json().expect("a serde_json::Value always serializes");diff --git a/crates/openhuman-core/src/cron/ops.rs b/crates/openhuman-core/src/cron/ops.rsindex 0d79827837..c6a7a3c4db 100644--- a/crates/openhuman-core/src/cron/ops.rs+++ b/crates/openhuman-core/src/cron/ops.rs@@ -2,7 +2,7 @@ use crate::config::Config;use crate::cron::{self, add_shell_job, get_job, update_job, CronJob, CronJobPatch, CronRun, Schedule,};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::security::SecurityPolicy;use anyhow::Result;use once_cell::sync::Lazy;@@ -149,19 +149,19 @@ pub fn parse_human_delay(input: &str) -> Result<chrono::Duration> {Ok(duration)}-pub async fn cron_list(config: &Config) -> Result<RpcOutcome<Vec<CronJob>>, String> {+pub async fn cron_list(config: &Config) -> Result<Outcome<Vec<CronJob>>, String> {if !config.cron.enabled {return Err("cron is disabled by config (cron.enabled=false)".to_string());}let jobs = cron::list_jobs(config).map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(jobs, "cron jobs listed"))+ Ok(Outcome::single_log(jobs, "cron jobs listed"))}pub async fn cron_update(config: &Config,job_id: &str,patch: CronJobPatch,-) -> Result<RpcOutcome<CronJob>, String> {+) -> Result<Outcome<CronJob>, String> {if job_id.trim().is_empty() {return Err("Missing 'job_id' parameter".to_string());}@@ -181,7 +181,7 @@ pub async fn cron_update(}let updated = cron::update_job(config, job_id.trim(), patch).map_err(|e| e.to_string())?;- Ok(RpcOutcome::new(+ Ok(Outcome::new(updated,vec![format!("cron job updated: {}", job_id.trim())],))@@ -190,7 +190,7 @@ pub async fn cron_update(pub async fn cron_remove(config: &Config,job_id: &str,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {if job_id.trim().is_empty() {return Err("Missing 'job_id' parameter".to_string());}@@ -199,7 +199,7 @@ pub async fn cron_remove(}cron::remove_job(config, job_id.trim()).map_err(|e| e.to_string())?;- Ok(RpcOutcome::new(+ Ok(Outcome::new(json!({ "job_id": job_id.trim(), "removed": true }),vec![format!("cron job removed: {}", job_id.trim())],))@@ -208,7 +208,7 @@ pub async fn cron_remove(pub async fn cron_run(config: &Config,job_id: &str,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let job_id = job_id.trim();if job_id.is_empty() {return Err("Missing 'job_id' parameter".to_string());@@ -294,7 +294,7 @@ pub async fn cron_run(cron::scheduler::deliver_job(&config_owned, &job, &output).await;});- Ok(RpcOutcome::new(+ Ok(Outcome::new(json!({"job_id": job_id,"status": "queued",@@ -307,7 +307,7 @@ pub async fn cron_runs(config: &Config,job_id: &str,limit: Option<usize>,-) -> Result<RpcOutcome<Vec<CronRun>>, String> {+) -> Result<Outcome<Vec<CronRun>>, String> {if job_id.trim().is_empty() {return Err("Missing 'job_id' parameter".to_string());}@@ -317,7 +317,7 @@ pub async fn cron_runs(let limit = limit.unwrap_or(20).max(1);let runs = cron::list_runs(config, job_id.trim(), limit).map_err(|e| e.to_string())?;- Ok(RpcOutcome::new(+ Ok(Outcome::new(runs,vec![format!("cron run history loaded: {}", job_id.trim())],))diff --git a/crates/openhuman-core/src/cron/schemas.rs b/crates/openhuman-core/src/cron/schemas.rsindex a9cc5b0423..18d8e4ef04 100644--- a/crates/openhuman-core/src/cron/schemas.rs+++ b/crates/openhuman-core/src/cron/schemas.rs@@ -5,7 +5,7 @@ use crate::config::rpc as config_rpc;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};use crate::cron::CronJobPatch;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;fn job_id_input(comment: &'static str) -> FieldSchema {FieldSchema {@@ -361,7 +361,7 @@ fn handle_add(params: Map<String, Value>) -> ControllerFuture {other => return Err(format!("invalid 'job_type': {other}")),};- to_json(RpcOutcome::single_log(job, "cron job created"))+ to_json(Outcome::single_log(job, "cron job created"))})}@@ -431,7 +431,7 @@ fn read_optional_u64(params: &Map<String, Value>, key: &str) -> Result<Option<u6}}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/desktop/app_state/README.md b/crates/openhuman-core/src/desktop/app_state/README.mdindex 27dff36241..d71ce75a37 100644--- a/crates/openhuman-core/src/desktop/app_state/README.md+++ b/crates/openhuman-core/src/desktop/app_state/README.md@@ -23,8 +23,8 @@ The snapshot never talks to the backend. The user it reports is the payload the- `AppStateSnapshot` — composite payload: `auth` (`AuthStateResponse`: `isAuthenticated`, `userId`, `user`, `profileId`, `credential`, `expiresAt`), `session_token`, `current_user` (= `auth.user`), `onboarding_completed`, `chat_onboarding_completed`, `analytics_enabled`, `local_state`, `keyring_status`, `runtime` (`RuntimeSnapshot { local_ai: LocalAiStatus, service: ServiceStatus }`), `health`, `config_recovered`.- `StoredAppState` — disk schema persisted to `<workspace_dir>/state/app-state.json` (`encryption_key`, `onboarding_tasks`, `keyring_consent`). `StoredOnboardingTasks` holds the shell-tracked onboarding flags plus `enabled_tools` and `connected_sources`.- `StoredAppStatePatch` — partial update (`Option<Option<_>>` per field) applied by `update_local_state`.-- `pub async fn snapshot() -> Result<RpcOutcome<AppStateSnapshot>, String>` — full snapshot; one auth-profile load per call, no network.-- `pub async fn update_local_state(StoredAppStatePatch) -> Result<RpcOutcome<StoredAppState>, String>` — merge under `APP_STATE_FILE_LOCK` and save atomically.+- `pub async fn snapshot() -> Result<Outcome<AppStateSnapshot>, String>` — full snapshot; one auth-profile load per call, no network.+- `pub async fn update_local_state(StoredAppStatePatch) -> Result<Outcome<StoredAppState>, String>` — merge under `APP_STATE_FILE_LOCK` and save atomically.- `pub(crate) fn load_stored_app_state(&Config)` / `pub fn save_app_state(&Config, &StoredAppState)` — direct disk access; a corrupt file is renamed to `app-state.json.corrupted.<ts>` and replaced with defaults.- `latch_from_config(&Config)` / `config_recovered_this_session()` — recovery latch.- RPC `app_state.{snapshot, update_local_state}` via `all_app_state_controller_schemas` / `all_app_state_registered_controllers`.diff --git a/crates/openhuman-core/src/desktop/app_state/ops/snapshot.rs b/crates/openhuman-core/src/desktop/app_state/ops/snapshot.rsindex 1e10de57dd..606dbd564a 100644--- a/crates/openhuman-core/src/desktop/app_state/ops/snapshot.rs+++ b/crates/openhuman-core/src/desktop/app_state/ops/snapshot.rs@@ -18,7 +18,7 @@ use super::state_file::{use super::types::{AppStateSnapshot, StoredAppState, StoredAppStatePatch};use super::LOG_PREFIX;use crate::config::rpc as config_rpc;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::security::credentials::session_support::{load_app_session_profile, session_state_from_profile, session_token_from_profile,};@@ -38,7 +38,7 @@ pub(super) fn sanitize_snapshot_user(user: Option<Value>) -> Option<Value> {}}-pub async fn snapshot() -> Result<RpcOutcome<AppStateSnapshot>, String> {+pub async fn snapshot() -> Result<Outcome<AppStateSnapshot>, String> {let req_id = SNAPSHOT_REQ_COUNTER.fetch_add(1, Ordering::Relaxed);let t_total = Instant::now();@@ -117,7 +117,7 @@ pub async fn snapshot() -> Result<RpcOutcome<AppStateSnapshot>, String> {let keyring_status = crate::security::keyring_consent::policy::current_status();let health = crate::platform::health::snapshot();- Ok(RpcOutcome::new(+ Ok(Outcome::new(AppStateSnapshot {auth,session_token,@@ -137,7 +137,7 @@ pub async fn snapshot() -> Result<RpcOutcome<AppStateSnapshot>, String> {pub async fn update_local_state(patch: StoredAppStatePatch,-) -> Result<RpcOutcome<StoredAppState>, String> {+) -> Result<Outcome<StoredAppState>, String> {let config = config_rpc::load_config_with_timeout().await?;let _guard = APP_STATE_FILE_LOCK.lock();let mut current = load_stored_app_state_unlocked(&config)?;@@ -166,7 +166,7 @@ pub async fn update_local_state(current.keyring_consent.is_some(),);- Ok(RpcOutcome::new(+ Ok(Outcome::new(current,vec!["core local app state updated".to_string()],))diff --git a/crates/openhuman-core/src/desktop/dashboard/README.md b/crates/openhuman-core/src/desktop/dashboard/README.mdindex a53a597d0c..0a13df74fe 100644--- a/crates/openhuman-core/src/desktop/dashboard/README.md+++ b/crates/openhuman-core/src/desktop/dashboard/README.md@@ -16,12 +16,12 @@ Aggregate, operator-facing views over local config. Today it owns a single read-| --- | --- || `crates/openhuman-core/src/desktop/dashboard/mod.rs` | Export-only: module docstring + `mod`/`pub use` re-exports of ops, schemas, and types. || `crates/openhuman-core/src/desktop/dashboard/types.rs` | Wire types: `ModelHealthEntry`, `ModelHealthConfigView`, `ModelHealthResponse` (serde). |-| `crates/openhuman-core/src/desktop/dashboard/ops.rs` | Business logic: `model_health(&Config)` joins registry + thresholds, returns `RpcOutcome<ModelHealthResponse>`. Inline tests cover mapping, thresholds, disabled feature, empty registry. |+| `crates/openhuman-core/src/desktop/dashboard/ops.rs` | Business logic: `model_health(&Config)` joins registry + thresholds, returns `Outcome<ModelHealthResponse>`. Inline tests cover mapping, thresholds, disabled feature, empty registry. || `crates/openhuman-core/src/desktop/dashboard/schemas.rs` | Controller schemas + registered controller + `handle_dashboard_model_health` handler (loads config via timeout, delegates to `ops::model_health`). Inline tests assert schema stability and list-length parity. |## Public surface-- `ops::model_health` — `fn model_health(config: &Config) -> Result<RpcOutcome<ModelHealthResponse>, String>`.+- `ops::model_health` — `fn model_health(config: &Config) -> Result<Outcome<ModelHealthResponse>, String>`.- `schemas::all_dashboard_controller_schemas`, `schemas::all_dashboard_registered_controllers`, `schemas::dashboard_schemas` — controller-registry entry points.- `types::ModelHealthEntry`, `types::ModelHealthConfigView`, `types::ModelHealthResponse`.@@ -34,7 +34,7 @@ Aggregate, operator-facing views over local config. Today it owns a single read-`ModelHealthEntry`: `id`, `provider`, `cost_per_1m_output` (f64), `vision` (bool), `quality_score` (`f64?`, placeholder), `hallucination_rate` (`f64?`, placeholder), `agents_using` (u64, placeholder 0), `tasks_evaluated` (u64, placeholder 0).`ModelHealthConfigView`: `hallucination_threshold` (f64), `min_tasks_for_rating` (u64), `evaluation_window_tasks` (u64).-The handler loads config via `crate::config::rpc::load_config_with_timeout()` and returns CLI-compatible JSON through `RpcOutcome::into_cli_compatible_json()`. Wired into the registry in `crates/openhuman-core/src/core/all.rs` (both `all_dashboard_registered_controllers` and `all_dashboard_controller_schemas`).+The handler loads config via `crate::config::rpc::load_config_with_timeout()` and returns CLI-compatible JSON through `Outcome::into_cli_compatible_json()`. Wired into the registry in `crates/openhuman-core/src/core/all.rs` (both `all_dashboard_registered_controllers` and `all_dashboard_controller_schemas`).## Persistence@@ -44,7 +44,7 @@ None. The module reads from in-memory `Config`; it stores no state.- `crate::config` (`Config`, `config::rpc::load_config_with_timeout`) — source of the model registry and `dashboard.model_health` thresholds. `DashboardConfig` / `ModelHealthConfig` are defined in `crates/openhuman-core/src/config/schema/dashboard.rs`.- `crate::core::all` (`ControllerFuture`, `RegisteredController`) and `crate::core` (`ControllerSchema`, `FieldSchema`, `TypeSchema`) — controller registry types.-- `crate::rpc::RpcOutcome` — standard RPC result wrapper.+- `crate::rpc::Outcome` — standard RPC result wrapper.- `serde` / `serde_json` — wire (de)serialization and handler params.## Used bydiff --git a/crates/openhuman-core/src/desktop/dashboard/ops.rs b/crates/openhuman-core/src/desktop/dashboard/ops.rsindex d9526f73c6..78c589cee0 100644--- a/crates/openhuman-core/src/desktop/dashboard/ops.rs+++ b/crates/openhuman-core/src/desktop/dashboard/ops.rs@@ -1,7 +1,7 @@//! Dashboard model-health aggregation.use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::types::{ModelHealthConfigView, ModelHealthEntry, ModelHealthResponse};@@ -15,7 +15,7 @@ use super::types::{ModelHealthConfigView, ModelHealthEntry, ModelHealthResponse}/// badges to `staging` (under `min_tasks_for_rating`) and keeps the table/// useful for cost and vision comparison. When a telemetry source lands,/// populate these fields here rather than at the transport layer.-pub fn model_health(config: &Config) -> Result<RpcOutcome<ModelHealthResponse>, String> {+pub fn model_health(config: &Config) -> Result<Outcome<ModelHealthResponse>, String> {let mh_cfg = &config.dashboard.model_health;if !mh_cfg.enabled {log::debug!("[dashboard] model_health request rejected — feature disabled");@@ -48,7 +48,7 @@ pub fn model_health(config: &Config) -> Result<RpcOutcome<ModelHealthResponse>,mh_cfg.evaluation_window_tasks,);- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(ModelHealthResponse {models,config: ModelHealthConfigView {diff --git a/crates/openhuman-core/src/desktop/dashboard/schemas.rs b/crates/openhuman-core/src/desktop/dashboard/schemas.rsindex 74bd4c2533..b6d179d2cb 100644--- a/crates/openhuman-core/src/desktop/dashboard/schemas.rs+++ b/crates/openhuman-core/src/desktop/dashboard/schemas.rs@@ -4,7 +4,7 @@ use serde_json::{Map, Value};use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::ops;use super::types::ModelHealthResponse;@@ -171,7 +171,7 @@ fn handle_dashboard_model_health(_params: Map<String, Value>) -> ControllerFuturlog::warn!("[dashboard] model_health failed to load config: {err}");format!("config unavailable: {err}")})?;- let outcome: RpcOutcome<ModelHealthResponse> = ops::model_health(&cfg)?;+ let outcome: Outcome<ModelHealthResponse> = ops::model_health(&cfg)?;outcome.into_cli_compatible_json()})}diff --git a/crates/openhuman-core/src/desktop/notifications/README.md b/crates/openhuman-core/src/desktop/notifications/README.mdindex 982d664083..d8a8c4755f 100644--- a/crates/openhuman-core/src/desktop/notifications/README.md+++ b/crates/openhuman-core/src/desktop/notifications/README.md@@ -91,7 +91,7 @@ SQLite DB at `{workspace_dir}/notifications/notifications.db`, opened per-call v- `crate::core::all` (`ControllerFuture`, `RegisteredController`) and `crate::core` (`ControllerSchema`, `FieldSchema`, `TypeSchema`) — controller registry contract.- `crate::config` — `Config` (workspace dir for the DB path), `config::rpc::load_config_with_timeout` in handlers, `active_workspace_snapshot` / `workspace_handle` for the workspace gate.- `crate::agent::triage` — `run_triage`, `apply_decision`, `TriageOutcome`, `TriggerEnvelope`, `TriggerSource`, `TriageAction` for the background scoring/routing pipeline; `crate::agent::turn_origin::with_origin` scopes the routing turn.-- `crate::rpc::RpcOutcome` — RPC response shaping.+- `crate::rpc::Outcome` — RPC response shaping.- External crates: `rusqlite` (store), `chrono`, `uuid`, `serde_json`, `tokio`, `once_cell`, `async_trait`.## Used bydiff --git a/crates/openhuman-core/src/desktop/notifications/rpc.rs b/crates/openhuman-core/src/desktop/notifications/rpc.rsindex 2dd8356803..75df1b24cf 100644--- a/crates/openhuman-core/src/desktop/notifications/rpc.rs+++ b/crates/openhuman-core/src/desktop/notifications/rpc.rs@@ -19,7 +19,7 @@ use crate::agent::turn_origin::with_origin;use crate::config::rpc as config_rpc;use crate::core::bus::BUS;use crate::core::events::DomainEvent;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::store;use super::types::{@@ -45,7 +45,7 @@ pub async fn handle_ingest(params: Map<String, Value>) -> Result<Value, String>let provider_settings = store::get_settings(&config, &req.provider).map_err(|e| format!("[notification_intel] get_settings failed: {e}"))?;if !provider_settings.enabled {- let outcome = RpcOutcome::new(+ let outcome = Outcome::new(json!({ "skipped": true, "reason": "provider_disabled" }),vec![],);@@ -75,7 +75,7 @@ pub async fn handle_ingest(params: Map<String, Value>) -> Result<Value, String>title_chars = req.title.chars().count(),"[notification_intel] skipping duplicate notification");- let outcome = RpcOutcome::new(json!({ "skipped": true, "reason": "duplicate" }), vec![]);+ let outcome = Outcome::new(json!({ "skipped": true, "reason": "duplicate" }), vec![]);return outcome.into_cli_compatible_json();}@@ -238,7 +238,7 @@ pub async fn handle_ingest(params: Map<String, Value>) -> Result<Value, String>}});- let outcome = RpcOutcome::new(json!({ "id": id, "skipped": false }), vec![]);+ let outcome = Outcome::new(json!({ "id": id, "skipped": false }), vec![]);outcome.into_cli_compatible_json()}@@ -278,7 +278,7 @@ pub async fn handle_list(params: Map<String, Value>) -> Result<Value, String> {let unread = store::unread_count(&config).map_err(|e| format!("[notification_intel] unread_count failed: {e}"))?;- let outcome = RpcOutcome::new(json!({ "items": items, "unread_count": unread }), vec![]);+ let outcome = Outcome::new(json!({ "items": items, "unread_count": unread }), vec![]);outcome.into_cli_compatible_json()}@@ -301,7 +301,7 @@ pub async fn handle_mark_read(params: Map<String, Value>) -> Result<Value, Strintracing::debug!(id = %id, "[notification_intel] marked read");- let outcome = RpcOutcome::new(json!({ "ok": true }), vec![]);+ let outcome = Outcome::new(json!({ "ok": true }), vec![]);outcome.into_cli_compatible_json()}@@ -314,7 +314,7 @@ pub async fn handle_settings_get(params: Map<String, Value>) -> Result<Value, St.ok_or_else(|| "[notification_intel] missing required param 'provider'".to_string())?;let settings = store::get_settings(&config, provider).map_err(|e| format!("[notification_intel] settings_get failed: {e}"))?;- let outcome = RpcOutcome::new(json!({ "settings": settings }), vec![]);+ let outcome = Outcome::new(json!({ "settings": settings }), vec![]);outcome.into_cli_compatible_json()}@@ -331,7 +331,7 @@ pub async fn handle_settings_set(params: Map<String, Value>) -> Result<Value, St};store::upsert_settings(&config, &clamped).map_err(|e| format!("[notification_intel] settings_set failed: {e}"))?;- let outcome = RpcOutcome::new(json!({ "ok": true, "settings": clamped }), vec![]);+ let outcome = Outcome::new(json!({ "ok": true, "settings": clamped }), vec![]);outcome.into_cli_compatible_json()}@@ -351,7 +351,7 @@ pub async fn handle_dismiss(params: Map<String, Value>) -> Result<Value, String>let updated = store::mark_dismissed(&config, &id).map_err(|e| format!("[notification_intel] mark_dismissed failed: {e}"))?;tracing::debug!(id = %id, updated = updated, "[notification_intel] notification dismissed");- let outcome = RpcOutcome::new(json!({ "ok": updated }), vec![]);+ let outcome = Outcome::new(json!({ "ok": updated }), vec![]);outcome.into_cli_compatible_json()}@@ -375,7 +375,7 @@ pub async fn handle_mark_acted(params: Map<String, Value>) -> Result<Value, Striupdated = updated,"[notification_intel] notification marked acted");- let outcome = RpcOutcome::new(json!({ "ok": updated }), vec![]);+ let outcome = Outcome::new(json!({ "ok": updated }), vec![]);outcome.into_cli_compatible_json()}@@ -407,7 +407,7 @@ pub async fn handle_core_list(params: Map<String, Value>) -> Result<Value, Strinlet unread = store::unread_core_notification_count(&config).map_err(|e| format!("[notification_intel] core unread_count failed: {e}"))?;- let outcome = RpcOutcome::new(json!({ "items": items, "unread_count": unread }), vec![]);+ let outcome = Outcome::new(json!({ "items": items, "unread_count": unread }), vec![]);outcome.into_cli_compatible_json()}@@ -424,7 +424,7 @@ pub async fn handle_core_mark_read(params: Map<String, Value>) -> Result<Value,let updated = store::mark_core_notification_read(&config, &id).map_err(|e| format!("[notification_intel] core_mark_read failed: {e}"))?;tracing::debug!(id = %id, updated = updated, "[notification_intel] core notification marked read");- let outcome = RpcOutcome::new(json!({ "ok": updated }), vec![]);+ let outcome = Outcome::new(json!({ "ok": updated }), vec![]);outcome.into_cli_compatible_json()}@@ -439,7 +439,7 @@ pub async fn handle_stats(_params: Map<String, Value>) -> Result<Value, String>let s = store::stats(&config).map_err(|e| format!("[notification_intel] stats failed: {e}"))?;- let outcome = RpcOutcome::new(json!(s), vec![]);+ let outcome = Outcome::new(json!(s), vec![]);outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/desktop/provider_surfaces/README.md b/crates/openhuman-core/src/desktop/provider_surfaces/README.mdindex e13bde2a41..031f23c4f7 100644--- a/crates/openhuman-core/src/desktop/provider_surfaces/README.md+++ b/crates/openhuman-core/src/desktop/provider_surfaces/README.md@@ -15,7 +15,7 @@ Local assistive surfaces for third-party provider apps. This domain owns a norma| --- | --- || `crates/openhuman-core/src/desktop/provider_surfaces/mod.rs` | Export-only: declares submodules; re-exports `all_provider_surfaces_controller_schemas` / `all_provider_surfaces_registered_controllers`. || `crates/openhuman-core/src/desktop/provider_surfaces/types.rs` | Serde domain types: `ProviderEvent`, `RespondQueueItem`, `RespondQueueListResponse`. Snake_case contract shared by request and response. |-| `crates/openhuman-core/src/desktop/provider_surfaces/ops.rs` | Business logic / entry points: `ingest_event`, `list_queue`. Wrap results in `ApiEnvelope` + `RpcOutcome`. Tests in sibling `ops_tests.rs`. |+| `crates/openhuman-core/src/desktop/provider_surfaces/ops.rs` | Business logic / entry points: `ingest_event`, `list_queue`. Wrap results in `ApiEnvelope` + `Outcome`. Tests in sibling `ops_tests.rs`. || `crates/openhuman-core/src/desktop/provider_surfaces/store.rs` | In-memory persistence: process-global `RESPOND_QUEUE` (`OnceLock<Mutex<Vec<…>>>`), `upsert_queue_item`, `list_queue_items`, `clear_queue` (test-only). || `crates/openhuman-core/src/desktop/provider_surfaces/schemas.rs` | Controller registry: `ControllerSchema`s + `handle_*` fns delegating to `ops.rs`. Tests in sibling `schemas_tests.rs`. || `crates/openhuman-core/src/desktop/provider_surfaces/rpc.rs` | Docstring-only placeholder; no code. The handler delegation lives in `schemas.rs`, not here. |@@ -25,7 +25,7 @@ Local assistive surfaces for third-party provider apps. This domain owns a norma- `types::ProviderEvent` — inbound normalized provider event (`#[serde(deny_unknown_fields)]`).- `types::RespondQueueItem` — queue entry (adds `id` and `status`, default `"pending"`).- `types::RespondQueueListResponse` — `{ items, count }`.-- `ops::ingest_event(ProviderEvent)` / `ops::list_queue(EmptyRequest)` — async handlers returning `RpcOutcome<ApiEnvelope<T>>`.+- `ops::ingest_event(ProviderEvent)` / `ops::list_queue(EmptyRequest)` — async handlers returning `Outcome<ApiEnvelope<T>>`.- `store::{upsert_queue_item, list_queue_items}` — internal to `ops.rs`; no external caller reads the store directly today.- Re-exported from `mod.rs`: `all_provider_surfaces_controller_schemas`, `all_provider_surfaces_registered_controllers`.@@ -55,7 +55,7 @@ In-memory only. State lives in a process-global `RESPOND_QUEUE` (`static OnceLoc## Dependencies- `crate::memory` — `ApiEnvelope`, `ApiMeta`, `EmptyRequest` (response envelope shape + empty-request type).-- `crate::rpc::RpcOutcome` — RPC return contract.+- `crate::rpc::Outcome` — RPC return contract.- `crate::core::all` — `RegisteredController`, `ControllerFuture` (controller registry wiring).- `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` — controller schema types.- External crates: `serde` / `serde_json`, `uuid` (request ids), `tracing` (debug logging with `[provider-surfaces]` prefix).diff --git a/crates/openhuman-core/src/desktop/provider_surfaces/ops.rs b/crates/openhuman-core/src/desktop/provider_surfaces/ops.rsindex 2414565b08..592f6652c1 100644--- a/crates/openhuman-core/src/desktop/provider_surfaces/ops.rs+++ b/crates/openhuman-core/src/desktop/provider_surfaces/ops.rs@@ -4,7 +4,7 @@//! can land before the SQLite-backed store arrives.use crate::memory::{ApiEnvelope, ApiMeta, EmptyRequest};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use serde::Serialize;use std::collections::BTreeMap;@@ -25,8 +25,8 @@ fn counts(entries: impl IntoIterator<Item = (&'static str, usize)>) -> BTreeMap<fn envelope<T: Serialize>(data: T,counts: Option<BTreeMap<String, usize>>,-) -> RpcOutcome<ApiEnvelope<T>> {- RpcOutcome::new(+) -> Outcome<ApiEnvelope<T>> {+ Outcome::new(ApiEnvelope {data: Some(data),error: None,@@ -44,7 +44,7 @@ fn envelope<T: Serialize>(pub async fn ingest_event(request: ProviderEvent,-) -> Result<RpcOutcome<ApiEnvelope<RespondQueueItem>>, String> {+) -> Result<Outcome<ApiEnvelope<RespondQueueItem>>, String> {tracing::debug!(provider = %request.provider,account_id = %request.account_id,@@ -59,7 +59,7 @@ pub async fn ingest_event(pub async fn list_queue(_request: EmptyRequest,-) -> Result<RpcOutcome<ApiEnvelope<RespondQueueListResponse>>, String> {+) -> Result<Outcome<ApiEnvelope<RespondQueueListResponse>>, String> {let items = store::list_queue_items();let count = items.len();tracing::debug!(count, "[provider-surfaces] list_queue");diff --git a/crates/openhuman-core/src/flows/builder_tools_save_and_edit_tests.rs b/crates/openhuman-core/src/flows/builder_tools_save_and_edit_tests.rsindex f483a1a992..8ca6a03644 100644--- a/crates/openhuman-core/src/flows/builder_tools_save_and_edit_tests.rs+++ b/crates/openhuman-core/src/flows/builder_tools_save_and_edit_tests.rs@@ -286,7 +286,7 @@ async fn save_workflow_surfaces_auto_disarm_warning_on_manual_to_automatic_trans// Regression for #4889 + the stale-docs issue that motivated this test:// `flows_update` auto-disables a flow whenever its trigger transitions// from manual to automatic on an already-enabled flow, but `save_workflow`- // used to drop `flows_update`'s explanatory `RpcOutcome.logs` entirely —+ // used to drop `flows_update`'s explanatory `Outcome.logs` entirely —// the agent had no way to relay the disarm to the user. Assert both the// disarm itself and that its log now surfaces in `save_workflow`'s// `warnings`.diff --git a/crates/openhuman-core/src/flows/ops.rs b/crates/openhuman-core/src/flows/ops.rsindex b0d0d8ed74..1cc50feeb1 100644--- a/crates/openhuman-core/src/flows/ops.rs+++ b/crates/openhuman-core/src/flows/ops.rs@@ -65,7 +65,7 @@ use crate::flows::types::{FlowConnection, FlowRunStep, FlowRunTrigger, FlowSuggestion, SuggestionStatus,};use crate::flows::{flow_namespace, Flow, FlowRun};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::security::approval::{ApprovalChatContext, FlowRunContext, APPROVAL_CHAT_CONTEXT, APPROVAL_COPILOT_STREAM_CONTEXT,APPROVAL_FLOW_RUN_CONTEXT,diff --git a/crates/openhuman-core/src/flows/ops/approval_manifest.rs b/crates/openhuman-core/src/flows/ops/approval_manifest.rsindex 435df2ca13..68f6c77667 100644--- a/crates/openhuman-core/src/flows/ops/approval_manifest.rs+++ b/crates/openhuman-core/src/flows/ops/approval_manifest.rs@@ -227,7 +227,7 @@ pub async fn flows_approval_manifest(config: &Config,id: Option<&str>,graph_json: Option<Value>,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {tracing::debug!(target: "flows", id = ?id, has_graph = graph_json.is_some(), "[flows] flows_approval_manifest: entry");let (graph, flow_id) = match (id, graph_json) {(Some(id), _) => {@@ -263,7 +263,7 @@ pub async fn flows_approval_manifest(missing.len());tracing::debug!(target: "flows", entries = entries.len(), missing = missing.len(), gate_installed, "[flows] flows_approval_manifest: exit");- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({"entries": entries,"missing": missing,diff --git a/crates/openhuman-core/src/flows/ops/builder.rs b/crates/openhuman-core/src/flows/ops/builder.rsindex f7b524de51..910fc2528a 100644--- a/crates/openhuman-core/src/flows/ops/builder.rs+++ b/crates/openhuman-core/src/flows/ops/builder.rs@@ -19,7 +19,7 @@ pub async fn flows_build(config: &Config,req: crate::flows::agents::workflow_builder::builder_prompt::BuilderRequest,stream: Option<FlowStreamTarget>,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {flows_build_with_extra_hidden_tools(config, req, stream, &[]).await}@@ -34,7 +34,7 @@ pub(crate) async fn flows_build_with_extra_hidden_tools(req: crate::flows::agents::workflow_builder::builder_prompt::BuilderRequest,stream: Option<FlowStreamTarget>,extra_hidden_tools: &[&str],-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {use crate::agent::OpenHumanSessionHost;use crate::flows::agents::workflow_builder::builder_prompt::render_prompt;@@ -51,7 +51,7 @@ pub(crate) async fn flows_build_with_extra_hidden_tools(if let Some(target) = &stream {finalize_flow_stream(target, &Ok(assistant_text.clone()), &prompt).await;}- return Ok(RpcOutcome::single_log(+ return Ok(Outcome::single_log(json!({"proposal": Value::Null,"assistant_text": assistant_text,@@ -320,7 +320,7 @@ pub(crate) async fn flows_build_with_extra_hidden_tools(has_proposal = proposal.is_some(),"[flows] flows_build: workflow builder turn cancelled by user");- return Ok(RpcOutcome::single_log(+ return Ok(Outcome::single_log(json!({"proposal": proposal,"assistant_text": assistant_text,@@ -407,7 +407,7 @@ pub(crate) async fn flows_build_with_extra_hidden_tools(trail_off,"[flows] flows_build: workflow_builder turn complete");- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({"proposal": proposal,"assistant_text": assistant_text,@@ -436,7 +436,7 @@ pub(crate) async fn flows_build_with_extra_hidden_tools(pub async fn flows_build_cancel(thread_id: &str,request_id: Option<&str>,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let cancelled = build_registry::cancel_build_turn_scoped(thread_id, request_id);tracing::info!(target: "flows",@@ -445,7 +445,7 @@ pub async fn flows_build_cancel(cancelled,"[flows] flows_build_cancel: cancel request handled");- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({ "cancelled": cancelled }),if cancelled {"workflow builder turn cancellation requested"diff --git a/crates/openhuman-core/src/flows/ops/catalog.rs b/crates/openhuman-core/src/flows/ops/catalog.rsindex 8d062c2f24..a735385ca7 100644--- a/crates/openhuman-core/src/flows/ops/catalog.rs+++ b/crates/openhuman-core/src/flows/ops/catalog.rs@@ -12,11 +12,11 @@ pub async fn flows_search_tool_catalog(query: &str,toolkit: Option<&str>,limit: usize,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {tracing::debug!(target: "flows", %query, toolkit = toolkit.unwrap_or("<all>"), "[flows] flows_search_tool_catalog: searching live catalog");let tools =crate::flows::builder_tools::search_live_catalog(config, query, toolkit, limit).await;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({ "tools": tools }),"tool catalog searched",))@@ -55,7 +55,7 @@ pub(crate) fn toolkit_for_contract_slug(slug: &str) -> Option<String> {pub async fn flows_get_tool_contract(config: &Config,slug: &str,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let trimmed = slug.trim();// Shape-check before `toolkit_from_slug`, and before any I/O: the shared// helper is deliberately permissive, so an unshaped slug would otherwise@@ -83,7 +83,7 @@ pub async fn flows_get_tool_contract(Some(contract) => {let contract = crate::flows::tinyflows::caps::apply_probe_override(contract.clone());let value = serde_json::to_value(&contract).map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({ "contract": value }),"tool contract fetched",))diff --git a/crates/openhuman-core/src/flows/ops/connections.rs b/crates/openhuman-core/src/flows/ops/connections.rsindex c2250a1863..9785d90f92 100644--- a/crates/openhuman-core/src/flows/ops/connections.rs+++ b/crates/openhuman-core/src/flows/ops/connections.rs@@ -13,7 +13,7 @@ use super::*;/// fails the whole picker.pub async fn flows_list_connections(config: &Config,-) -> Result<RpcOutcome<Vec<FlowConnection>>, String> {+) -> Result<Outcome<Vec<FlowConnection>>, String> {tracing::debug!("[flows] rpc flows_list_connections: aggregating composio + http_cred picker sources");@@ -97,7 +97,7 @@ pub async fn flows_list_connections("flows_list_connections: {} connection(s)",connections.len()));- Ok(RpcOutcome::new(connections, logs))+ Ok(Outcome::new(connections, logs))}/// Fold Composio connected accounts + named HTTP credentials into the flat,@@ -315,10 +315,10 @@ pub async fn compute_required_connections(config: &Config, graph: &WorkflowGraphpub async fn flows_required_connections(config: &Config,graph_json: Value,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let graph = migrate_and_deserialize_graph(graph_json)?;let required = compute_required_connections(config, &graph).await;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({ "required_connections": required }),"required connections computed",))diff --git a/crates/openhuman-core/src/flows/ops/definitions.rs b/crates/openhuman-core/src/flows/ops/definitions.rsindex bf3874e4ed..9423c11869 100644--- a/crates/openhuman-core/src/flows/ops/definitions.rs+++ b/crates/openhuman-core/src/flows/ops/definitions.rs@@ -56,7 +56,7 @@ pub async fn flows_create(name: String,graph_json: Value,require_approval: bool,-) -> Result<RpcOutcome<Flow>, String> {+) -> Result<Outcome<Flow>, String> {let graph = validate_and_migrate_graph(graph_json)?;ensure_config_aware_engine_compatible(config, &graph)?;@@ -115,7 +115,7 @@ pub async fn flows_create(}publish_flow_changed(&flow.id, "created", "system");- Ok(RpcOutcome::new(flow, logs))+ Ok(Outcome::new(flow, logs))}/// Duplicates a saved flow: creates an independent copy of its graph under a@@ -126,7 +126,7 @@ pub async fn flows_create(/// can never immediately fire. Run history does not carry over. The user/// enables it explicitly (via `flows_set_enabled`) once they've reviewed the/// copy, at which point its trigger binds like any other flow.-pub async fn flows_duplicate(config: &Config, id: &str) -> Result<RpcOutcome<Flow>, String> {+pub async fn flows_duplicate(config: &Config, id: &str) -> Result<Outcome<Flow>, String> {let source = store::get_flow(config, id).map_err(|e| e.to_string())?.ok_or_else(|| format!("flow '{id}' not found"))?;@@ -137,18 +137,18 @@ pub async fn flows_duplicate(config: &Config, id: &str) -> Result<RpcOutcome<Flo// Intentionally NO bind_trigger: a duplicate is disabled and must stay// inert (no schedule/trigger dispatch) until the user enables it.publish_flow_changed(&flow.id, "created", "system");- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(flow,format!("flow duplicated from {id}"),))}/// Loads one flow by id.-pub async fn flows_get(config: &Config, id: &str) -> Result<RpcOutcome<Flow>, String> {+pub async fn flows_get(config: &Config, id: &str) -> Result<Outcome<Flow>, String> {let flow = store::get_flow(config, id).map_err(|e| e.to_string())?.ok_or_else(|| format!("flow '{id}' not found"))?;- Ok(RpcOutcome::single_log(flow, format!("flow loaded: {id}")))+ Ok(Outcome::single_log(flow, format!("flow loaded: {id}")))}/// Loads a saved flow's portable [`WorkflowGraph`] by id, for the@@ -197,7 +197,7 @@ pub(crate) fn load_engine_compatible_flow_graph(/// (`[flows]`-prefixed, id + error only — never row content) and surfaced in/// the RPC's `logs` so the UI can tell the user "N workflows could not be/// loaded" instead of silently rendering a shorter list than actually exists.-pub async fn flows_list(config: &Config) -> Result<RpcOutcome<Vec<Flow>>, String> {+pub async fn flows_list(config: &Config) -> Result<Outcome<Vec<Flow>>, String> {let (flows, skipped) = store::list_flows(config).map_err(|e| e.to_string())?;if skipped > 0 {tracing::warn!(@@ -206,7 +206,7 @@ pub async fn flows_list(config: &Config) -> Result<RpcOutcome<Vec<Flow>>, Stringloaded = flows.len(),"[flows] flows_list: skipped corrupt/unmigratable flow_definitions rows");- Ok(RpcOutcome::new(+ Ok(Outcome::new(flows,vec![format!("flows listed ({skipped} workflow{} could not be loaded and were skipped)",@@ -214,7 +214,7 @@ pub async fn flows_list(config: &Config) -> Result<RpcOutcome<Vec<Flow>>, String)],))} else {- Ok(RpcOutcome::single_log(flows, "flows listed"))+ Ok(Outcome::single_log(flows, "flows listed"))}}@@ -229,7 +229,7 @@ pub async fn flows_list(config: &Config) -> Result<RpcOutcome<Vec<Flow>>, String/// (flow already gone, store error) is logged and does not block the delete/// itself — `store::remove_flow` below still errors clearly if `id` doesn't/// exist.-pub async fn flows_delete(config: &Config, id: &str) -> Result<RpcOutcome<Value>, String> {+pub async fn flows_delete(config: &Config, id: &str) -> Result<Outcome<Value>, String> {flows_delete_impl(config, id, None).await}@@ -259,7 +259,7 @@ pub(super) async fn flows_delete_impl(config: &Config,id: &str,memory_override: Option<Arc<crate::memory::guard::MemoryGuard>>,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {match store::get_flow(config, id) {Ok(Some(flow)) => unbind_trigger(config, &flow),Ok(None) => {}@@ -319,7 +319,7 @@ pub(super) async fn flows_delete_impl(}publish_flow_changed(id, "deleted", "system");- Ok(RpcOutcome::new(+ Ok(Outcome::new(json!({ "id": id, "removed": true }),vec![format!("flow removed: {id}")],))diff --git a/crates/openhuman-core/src/flows/ops/discovery.rs b/crates/openhuman-core/src/flows/ops/discovery.rsindex 3a01072a0d..872b31c8ef 100644--- a/crates/openhuman-core/src/flows/ops/discovery.rs+++ b/crates/openhuman-core/src/flows/ops/discovery.rs@@ -38,7 +38,7 @@ const FLOW_DISCOVER_PROMPT: &str = "Discover the most useful automations you coupub async fn flows_discover(config: &Config,stream: Option<FlowStreamTarget>,-) -> Result<RpcOutcome<Vec<FlowSuggestion>>, String> {+) -> Result<Outcome<Vec<FlowSuggestion>>, String> {use crate::agent::turn_origin::{with_origin, AgentTurnOrigin};use crate::agent::OpenHumanSessionHost;@@ -116,7 +116,7 @@ pub async fn flows_discover(count = suggestions.len(),"[flows] flows_discover: returning active suggestions");- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(suggestions,"flow discovery complete",))@@ -128,9 +128,9 @@ pub async fn flows_discover(pub async fn flows_list_suggestions(config: &Config,status: Option<SuggestionStatus>,-) -> Result<RpcOutcome<Vec<FlowSuggestion>>, String> {+) -> Result<Outcome<Vec<FlowSuggestion>>, String> {let suggestions = store::list_suggestions(config, status, 100).map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(suggestions, "suggestions listed"))+ Ok(Outcome::single_log(suggestions, "suggestions listed"))}/// Marks a suggestion `dismissed` (the user rejected the card). The row is kept@@ -138,10 +138,10 @@ pub async fn flows_list_suggestions(pub async fn flows_dismiss_suggestion(config: &Config,id: &str,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let found = store::set_suggestion_status(config, id, SuggestionStatus::Dismissed).map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({ "id": id, "dismissed": found }),"suggestion dismissed",))@@ -152,10 +152,10 @@ pub async fn flows_dismiss_suggestion(pub async fn flows_mark_suggestion_built(config: &Config,id: &str,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let found = store::set_suggestion_status(config, id, SuggestionStatus::Built).map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({ "id": id, "built": found }),"suggestion marked built",))diff --git a/crates/openhuman-core/src/flows/ops/drafts.rs b/crates/openhuman-core/src/flows/ops/drafts.rsindex bdebb33e55..0b11e73251 100644--- a/crates/openhuman-core/src/flows/ops/drafts.rs+++ b/crates/openhuman-core/src/flows/ops/drafts.rs@@ -11,21 +11,21 @@ pub fn flows_draft_create(name: String,graph: Value,origin: crate::flows::DraftOrigin,-) -> Result<RpcOutcome<crate::flows::FlowDraft>, String> {+) -> Result<Outcome<crate::flows::FlowDraft>, String> {let draft = draft_store::create_draft(config, flow_id, name, graph, origin).map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(draft, "draft created"))+ Ok(Outcome::single_log(draft, "draft created"))}/// Reads a draft by id (errors if it does not exist).pub fn flows_draft_get(config: &Config,id: &str,-) -> Result<RpcOutcome<crate::flows::FlowDraft>, String> {+) -> Result<Outcome<crate::flows::FlowDraft>, String> {let draft = draft_store::get_draft(config, id).map_err(|e| e.to_string())?.ok_or_else(|| format!("draft '{id}' not found"))?;- Ok(RpcOutcome::single_log(draft, format!("draft loaded: {id}")))+ Ok(Outcome::single_log(draft, format!("draft loaded: {id}")))}/// Patches a draft's `name`/`graph`/`flow_id` (any `Some` applied) and bumps@@ -36,24 +36,24 @@ pub fn flows_draft_update(name: Option<String>,graph: Option<Value>,flow_id: Option<Option<String>>,-) -> Result<RpcOutcome<crate::flows::FlowDraft>, String> {+) -> Result<Outcome<crate::flows::FlowDraft>, String> {let draft =draft_store::update_draft(config, id, name, graph, flow_id).map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(draft, "draft updated"))+ Ok(Outcome::single_log(draft, "draft updated"))}/// Lists all drafts, newest-updated first.pub fn flows_draft_list(config: &Config,-) -> Result<RpcOutcome<Vec<crate::flows::FlowDraft>>, String> {+) -> Result<Outcome<Vec<crate::flows::FlowDraft>>, String> {let drafts = draft_store::list_drafts(config).map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(drafts, "drafts listed"))+ Ok(Outcome::single_log(drafts, "drafts listed"))}/// Deletes a draft by id (idempotent — reports whether a file was removed).-pub fn flows_draft_delete(config: &Config, id: &str) -> Result<RpcOutcome<Value>, String> {+pub fn flows_draft_delete(config: &Config, id: &str) -> Result<Outcome<Value>, String> {let deleted = draft_store::delete_draft(config, id).map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({ "id": id, "deleted": deleted }),"draft deleted",))@@ -70,7 +70,7 @@ pub async fn flows_draft_promote(config: &Config,id: &str,require_approval: Option<bool>,-) -> Result<RpcOutcome<Flow>, String> {+) -> Result<Outcome<Flow>, String> {let draft = draft_store::get_draft(config, id).map_err(|e| e.to_string())?.ok_or_else(|| format!("draft '{id}' not found"))?;diff --git a/crates/openhuman-core/src/flows/ops/execution.rs b/crates/openhuman-core/src/flows/ops/execution.rsindex 202fe6e9e6..2eab17b58b 100644--- a/crates/openhuman-core/src/flows/ops/execution.rs+++ b/crates/openhuman-core/src/flows/ops/execution.rs@@ -101,7 +101,7 @@ pub(super) async fn run_flow_body(no_actionable_nodes: bool,cancel_token: tokio_util::sync::CancellationToken,_run_guard: run_registry::RunGuard,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let config: &Config = config_arc.as_ref();let flow_id: &str = flow_id.as_str();@@ -309,7 +309,7 @@ pub(super) async fn run_flow_body();finalizer.disarm();drop_checkpoint(config, &thread_id).await;- return Ok(RpcOutcome::single_log(+ return Ok(Outcome::single_log(json!({"output": Value::Null,"pending_approvals": Vec::<String>::new(),@@ -402,7 +402,7 @@ pub(super) async fn run_flow_body(logs.push(NO_ACTIONABLE_NODES_NOTE.to_string());}- Ok(RpcOutcome::new(result, logs))+ Ok(Outcome::new(result, logs))}/// Milliseconds since the Unix epoch, for `CoreNotificationEvent::timestamp_ms`.diff --git a/crates/openhuman-core/src/flows/ops/resume.rs b/crates/openhuman-core/src/flows/ops/resume.rsindex 1d8fd8846e..fe2f147c35 100644--- a/crates/openhuman-core/src/flows/ops/resume.rs+++ b/crates/openhuman-core/src/flows/ops/resume.rs@@ -23,7 +23,7 @@ pub async fn flows_resume(thread_id: &str,approvals: Vec<String>,rejections: Vec<String>,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let flow = store::get_flow(config, flow_id).map_err(|e| e.to_string())?.ok_or_else(|| format!("flow '{flow_id}' not found"))?;@@ -364,7 +364,7 @@ pub async fn flows_resume(tracing::warn!(target: "flows", flow_id = %flow_id, error = %e, "[flows] flows_resume: failed to record cancelled run");}drop_checkpoint(config, thread_id).await;- return Ok(RpcOutcome::single_log(+ return Ok(Outcome::single_log(json!({"output": Value::Null,"pending_approvals": Vec::<String>::new(),@@ -452,7 +452,7 @@ pub async fn flows_resume("[flows] flows_resume: finished");- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({"output": outcome.output,"pending_approvals": outcome.pending_approvals,diff --git a/crates/openhuman-core/src/flows/ops/run.rs b/crates/openhuman-core/src/flows/ops/run.rsindex 59af8d4cb1..3c77b47d12 100644--- a/crates/openhuman-core/src/flows/ops/run.rs+++ b/crates/openhuman-core/src/flows/ops/run.rs@@ -28,7 +28,7 @@ pub async fn flows_run(input: Value,inputs: serde_json::Map<String, Value>,trigger: FlowRunTrigger,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {// Prep synchronously (validate + compile-check + resolve inputs + mint the// run id), insert the initial `running` row, and announce it, then hand off// to the shared run body. Both the synchronous "Run" RPC path (this fn) and@@ -89,7 +89,7 @@ pub async fn flows_run_detached(input: Value,inputs: serde_json::Map<String, Value>,trigger: FlowRunTrigger,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let prepared = prepare_flow_run(config, flow_id, &inputs)?;let thread_id = prepared.thread_id.clone();let no_actionable_nodes = prepared.no_actionable_nodes;@@ -147,7 +147,7 @@ pub async fn flows_run_detached("status": "running","detached": true,});- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(result,format!("flow run started (detached): {thread_id}"),))diff --git a/crates/openhuman-core/src/flows/ops/run_management.rs b/crates/openhuman-core/src/flows/ops/run_management.rsindex d1866a317b..10be3a787c 100644--- a/crates/openhuman-core/src/flows/ops/run_management.rs+++ b/crates/openhuman-core/src/flows/ops/run_management.rs@@ -19,7 +19,7 @@ use super::*;/// `"cancelled"`, corrupting the run-honesty status it already recorded, and an/// already-`interrupted` run (reconciled by the drop-guard / boot sweep, bug/// B42) could be clobbered back to `"cancelled"`.-pub async fn flows_cancel_run(config: &Config, run_id: &str) -> Result<RpcOutcome<Value>, String> {+pub async fn flows_cancel_run(config: &Config, run_id: &str) -> Result<Outcome<Value>, String> {let run = store::get_flow_run(config, run_id).map_err(|e| e.to_string())?.ok_or_else(|| format!("flow run '{run_id}' not found"))?;@@ -48,7 +48,7 @@ pub async fn flows_cancel_run(config: &Config, run_id: &str) -> Result<RpcOutcom// The in-flight run's cancellation arm owns the terminal write + the// checkpoint drop; we've signalled it and return. Its settle is// eventual (the run future unwinds), so report "requested".- return Ok(RpcOutcome::single_log(+ return Ok(Outcome::single_log(json!({ "run_id": run_id, "cancelled": true, "was_in_flight": true }),format!("flow run {run_id} cancellation requested"),));@@ -95,7 +95,7 @@ pub async fn flows_cancel_run(config: &Config, run_id: &str) -> Result<RpcOutcom}drop_checkpoint(config, run_id).await;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({ "run_id": run_id, "cancelled": true, "was_in_flight": false }),format!("flow run {run_id} cancelled"),))@@ -131,10 +131,10 @@ pub async fn flows_list_runs(config: &Config,flow_id: &str,limit: usize,-) -> Result<RpcOutcome<Vec<FlowRun>>, String> {+) -> Result<Outcome<Vec<FlowRun>>, String> {sweep_expired_parked_runs(config).await;let runs = store::list_flow_runs(config, flow_id, limit).map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(runs,format!("flow runs listed: {flow_id}"),))@@ -146,11 +146,11 @@ pub async fn flows_list_runs(pub async fn flows_list_all_runs(config: &Config,limit: usize,-) -> Result<RpcOutcome<Vec<FlowRun>>, String> {+) -> Result<Outcome<Vec<FlowRun>>, String> {sweep_expired_parked_runs(config).await;let runs = store::list_all_flow_runs(config, limit).map_err(|e| e.to_string())?;let count = runs.len();- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(runs,format!("all flow runs listed: {count} run(s)"),))@@ -163,11 +163,11 @@ pub async fn flows_list_all_runs(/// automatically on every new-run insert; this RPC exposes it for an explicit/// on-demand sweep (e.g. a maintenance action). Returns the number of runs/// pruned.-pub async fn flows_prune_runs(config: &Config, flow_id: &str) -> Result<RpcOutcome<Value>, String> {+pub async fn flows_prune_runs(config: &Config, flow_id: &str) -> Result<Outcome<Value>, String> {let keep = store::MAX_FLOW_RUNS_PER_FLOW;let pruned = store::prune_flow_runs(config, flow_id, keep).map_err(|e| e.to_string())?;tracing::info!(target: "flows", flow_id, pruned, keep, "[flows] flows_prune_runs: manual retention sweep");- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({ "flow_id": flow_id, "pruned": pruned, "kept": keep }),format!("flow runs pruned: {flow_id} ({pruned} removed)"),))@@ -176,12 +176,12 @@ pub async fn flows_prune_runs(config: &Config, flow_id: &str) -> Result<RpcOutco/// Loads a single flow run record by id (== `thread_id`). Runs the lazy/// parked-run TTL sweep first so a stale parked run is reported as `cancelled`/// rather than perpetually `pending_approval`.-pub async fn flows_get_run(config: &Config, run_id: &str) -> Result<RpcOutcome<FlowRun>, String> {+pub async fn flows_get_run(config: &Config, run_id: &str) -> Result<Outcome<FlowRun>, String> {sweep_expired_parked_runs(config).await;let run = store::get_flow_run(config, run_id).map_err(|e| e.to_string())?.ok_or_else(|| format!("flow run '{run_id}' not found"))?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(run,format!("flow run loaded: {run_id}"),))diff --git a/crates/openhuman-core/src/flows/ops/triggers.rs b/crates/openhuman-core/src/flows/ops/triggers.rsindex edb8d1f69d..a91a9c6cd8 100644--- a/crates/openhuman-core/src/flows/ops/triggers.rs+++ b/crates/openhuman-core/src/flows/ops/triggers.rs@@ -92,7 +92,7 @@ pub async fn flows_set_enabled(config: &Config,id: &str,enabled: bool,-) -> Result<RpcOutcome<Flow>, String> {+) -> Result<Outcome<Flow>, String> {let flow = store::set_enabled(config, id, enabled).map_err(|e| e.to_string())?;if enabled {@@ -119,7 +119,7 @@ pub async fn flows_set_enabled(}publish_flow_changed(id, "enabled_changed", "system");- Ok(RpcOutcome::new(flow, logs))+ Ok(Outcome::new(flow, logs))}/// Registers the automatic-dispatch side effect for `flow`'s trigger kind, ifdiff --git a/crates/openhuman-core/src/flows/ops/updates.rs b/crates/openhuman-core/src/flows/ops/updates.rsindex af6ae2472a..cb0b75cadc 100644--- a/crates/openhuman-core/src/flows/ops/updates.rs+++ b/crates/openhuman-core/src/flows/ops/updates.rs@@ -70,7 +70,7 @@ pub async fn flows_update(graph_json: Option<Value>,require_approval: Option<bool>,expected_version: Option<String>,-) -> Result<RpcOutcome<Flow>, String> {+) -> Result<Outcome<Flow>, String> {flows_update_inner(config,id,@@ -97,7 +97,7 @@ pub(crate) async fn flows_update_disarming_automatic(graph_json: Option<Value>,require_approval: Option<bool>,expected_version: Option<String>,-) -> Result<RpcOutcome<Flow>, String> {+) -> Result<Outcome<Flow>, String> {flows_update_inner(config,id,@@ -118,7 +118,7 @@ async fn flows_update_inner(require_approval: Option<bool>,expected_version: Option<String>,disarm_automatic: bool,-) -> Result<RpcOutcome<Flow>, String> {+) -> Result<Outcome<Flow>, String> {let existing = store::get_flow(config, id).map_err(|e| e.to_string())?.ok_or_else(|| format!("flow '{id}' not found"))?;@@ -251,7 +251,7 @@ async fn flows_update_inner(.to_string(),);}- Ok(RpcOutcome::new(updated, logs))+ Ok(Outcome::new(updated, logs))}/// Lists a flow's revision history (prior graph snapshots), newest first,@@ -260,10 +260,10 @@ pub fn flows_get_history(config: &Config,id: &str,limit: usize,-) -> Result<RpcOutcome<Vec<crate::flows::FlowRevision>>, String> {+) -> Result<Outcome<Vec<crate::flows::FlowRevision>>, String> {let revisions = store::list_revisions(config, id, limit).map_err(|e| e.to_string())?;let count = revisions.len();- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(revisions,format!("flow history: {id} ({count} revisions)"),))@@ -278,7 +278,7 @@ pub async fn flows_rollback(id: &str,revision_id: &str,expected_version: Option<String>,-) -> Result<RpcOutcome<Flow>, String> {+) -> Result<Outcome<Flow>, String> {let rev = store::revision_by_id(config, id, revision_id).map_err(|e| e.to_string())?.ok_or_else(|| format!("revision '{revision_id}' not found for flow '{id}'"))?;diff --git a/crates/openhuman-core/src/flows/ops/validation.rs b/crates/openhuman-core/src/flows/ops/validation.rsindex 9373d32fd6..d5caf4841f 100644--- a/crates/openhuman-core/src/flows/ops/validation.rs+++ b/crates/openhuman-core/src/flows/ops/validation.rs@@ -320,7 +320,7 @@ pub(crate) fn config_aware_engine_compatibility_errors(/// save. Pure (no persistence, no config) — `valid == false` is a normal/// result, NOT an `Err`; `Err` is reserved for internal serialization faults/// (there are none on this path today).-pub fn flows_validate(graph_json: Value) -> RpcOutcome<crate::flows::FlowValidation> {+pub fn flows_validate(graph_json: Value) -> Outcome<crate::flows::FlowValidation> {use crate::flows::FlowValidation;tracing::debug!(target: "flows", "[flows] flows_validate: validating candidate graph");// Split migrate/deserialize (a genuinely single failure) from structural@@ -332,7 +332,7 @@ pub fn flows_validate(graph_json: Value) -> RpcOutcome<crate::flows::FlowValidatOk(graph) => graph,Err(error) => {tracing::debug!(target: "flows", %error, "[flows] flows_validate: graph could not be migrated/parsed");- return RpcOutcome::single_log(+ return Outcome::single_log(FlowValidation {valid: false,errors: vec![error.clone()],@@ -358,7 +358,7 @@ pub fn flows_validate(graph_json: Value) -> RpcOutcome<crate::flows::FlowValidaterror_count = errors.len(),"[flows] flows_validate: graph is structurally invalid");- return RpcOutcome::single_log(+ return Outcome::single_log(FlowValidation {valid: false,errors,@@ -380,7 +380,7 @@ pub fn flows_validate(graph_json: Value) -> RpcOutcome<crate::flows::FlowValidaterror_count = error_details.len(),"[flows] flows_validate: graph uses an unsupported engine topology");- return RpcOutcome::single_log(+ return Outcome::single_log(FlowValidation {valid: false,errors,@@ -401,7 +401,7 @@ pub fn flows_validate(graph_json: Value) -> RpcOutcome<crate::flows::FlowValidatwarning_count = warnings.len(),"[flows] flows_validate: graph is structurally valid");- RpcOutcome::single_log(+ Outcome::single_log(FlowValidation {valid: true,errors: Vec::new(),@@ -437,7 +437,7 @@ pub fn flows_validate(graph_json: Value) -> RpcOutcome<crate::flows::FlowValidatpub fn flows_import(graph_json: Value,format: Option<String>,-) -> Result<RpcOutcome<crate::flows::FlowImport>, String> {+) -> Result<Outcome<crate::flows::FlowImport>, String> {use crate::flows::{n8n_import, FlowImport};let requested = format@@ -483,7 +483,7 @@ pub fn flows_import(warning_count = warnings.len(),"[flows] flows_import: import normalized and validated");- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(FlowImport { graph, warnings },"flow imported",))diff --git a/crates/openhuman-core/src/flows/ops_run_lifecycle_tests.rs b/crates/openhuman-core/src/flows/ops_run_lifecycle_tests.rsindex 21f4c46b84..12eb4c1046 100644--- a/crates/openhuman-core/src/flows/ops_run_lifecycle_tests.rs+++ b/crates/openhuman-core/src/flows/ops_run_lifecycle_tests.rs@@ -165,7 +165,7 @@ async fn flows_run_on_trigger_only_graph_surfaces_no_actionable_nodes_note() {);assert!(outcome.logs.iter().any(|l| l.contains("no actionable")),- "the note should also surface via the RpcOutcome logs, got: {:?}",+ "the note should also surface via the Outcome logs, got: {:?}",outcome.logs);diff --git a/crates/openhuman-core/src/flows/schemas.rs b/crates/openhuman-core/src/flows/schemas.rsindex 3216d8b650..497acd6035 100644--- a/crates/openhuman-core/src/flows/schemas.rs+++ b/crates/openhuman-core/src/flows/schemas.rs@@ -3,7 +3,7 @@//! one `ControllerSchema`, `all_controller_schemas()`///! `all_registered_controllers()` aggregate them, and each `handle_*` loads//! config, reads params, awaits the matching `ops::flows_*` fn, and converts-//! the `RpcOutcome` to CLI-compatible JSON.+//! the `Outcome` to CLI-compatible JSON.use serde::de::DeserializeOwned;use serde_json::{Map, Value};@@ -12,7 +12,7 @@ use crate::config::rpc as config_rpc;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};use crate::flows::ops;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;fn id_input(comment: &'static str) -> FieldSchema {FieldSchema {diff --git a/crates/openhuman-core/src/flows/schemas_handlers.rs b/crates/openhuman-core/src/flows/schemas_handlers.rsindex 4768006e4e..0a8e9e2aa5 100644--- a/crates/openhuman-core/src/flows/schemas_handlers.rs+++ b/crates/openhuman-core/src/flows/schemas_handlers.rs@@ -516,7 +516,7 @@ fn read_required<T: DeserializeOwned>(params: &Map<String, Value>, key: &str) ->serde_json::from_value(value).map_err(|e| format!("invalid '{key}': {e}"))}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/http_host/README.md b/crates/openhuman-core/src/http_host/README.mdindex fe631b4c46..2bc0162f8f 100644--- a/crates/openhuman-core/src/http_host/README.md+++ b/crates/openhuman-core/src/http_host/README.md@@ -22,7 +22,7 @@ Static directory hosting over ad-hoc, in-process HTTP listeners owned by the cor| `crates/openhuman-core/src/http_host/handlers.rs` | `axum` router + request handlers (`HostedDirState`, `build_router`, root/path/file/directory serving, streamed file responses, generated directory listing HTML). || `crates/openhuman-core/src/http_host/auth.rs` | Basic-auth verification (`ensure_authorized`), default username resolution from session/env, username sanitization, random password generation. || `crates/openhuman-core/src/http_host/path_utils.rs` | Path safety + URL/HTML helpers: directory canonicalization, request-path traversal resolution, bind-host/label sanitization, href builders, `escape_html`, `content_type_for_path`, `redact_path_for_log`. |-| `crates/openhuman-core/src/http_host/rpc.rs` | RPC adapters wrapping ops into `RpcOutcome<T>` (`start`/`stop`/`get`/`list`). |+| `crates/openhuman-core/src/http_host/rpc.rs` | RPC adapters wrapping ops into `Outcome<T>` (`start`/`stop`/`get`/`list`). || `crates/openhuman-core/src/http_host/schemas.rs` | `ControllerSchema`s + `handle_*` controller handlers; `all_controller_schemas` / `all_registered_controllers`. || `crates/openhuman-core/src/http_host/http_host_tests.rs` | Module-level tests (start/list/stop round-trip with Basic auth, path traversal rejection, username sanitization/resolution); mounted from `mod.rs` via `#[path = "http_host_tests.rs"] mod tests`. || `crates/openhuman-core/src/http_host/schemas_tests.rs` | Controller-schema tests (schema/handler inventory parity, required inputs, unknown-function fallback); mounted from `schemas.rs` the same way. |@@ -31,7 +31,7 @@ Static directory hosting over ad-hoc, in-process HTTP listeners owned by the cor- `all_http_host_controller_schemas()` / `all_http_host_registered_controllers()` — re-exported from `schemas`; wired into the core controller registry.- `pub mod ops` — `start_hosted_dir_server`, `list_hosted_dir_servers`, `get_hosted_dir_server`, `stop_hosted_dir_server`, `stop_all_hosted_dir_servers`.-- `pub mod rpc` — async `start`/`stop`/`get`/`list` returning `RpcOutcome<...>`.+- `pub mod rpc` — async `start`/`stop`/`get`/`list` returning `Outcome<...>`.(`auth`, `handlers`, `path_utils`, `types` are private to the module.)@@ -57,7 +57,7 @@ None on disk. Running servers are held in a process-global `HostedDirRegistry` (- `crate::core::shutdown` — `register` a one-time hook so all hosted servers stop when the core shuts down (`ops.rs`).- `crate::core::all` — `ControllerFuture`, `RegisteredController` for controller registration (`schemas.rs`).- `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` — controller schema types (`schemas.rs`).-- `crate::rpc::RpcOutcome` — RPC response envelope (`rpc.rs`); `crate::rpc` is the `openhuman-rpc` crate re-exported from `crates/openhuman-core/src/lib.rs`.+- `crate::rpc::Outcome` — RPC response envelope (`rpc.rs`); `crate::rpc` is the `openhuman-rpc` crate re-exported from `crates/openhuman-core/src/lib.rs`.- External crates: `axum` (HTTP server/router), `tokio` (`TcpListener`, tasks), `tokio_util` (`CancellationToken`, `ReaderStream`), `uuid`, `base64`, `rand`, `urlencoding`, `serde`/`serde_json`.## Used bydiff --git a/crates/openhuman-core/src/http_host/rpc.rs b/crates/openhuman-core/src/http_host/rpc.rsindex a62de434e6..67c068625d 100644--- a/crates/openhuman-core/src/http_host/rpc.rs+++ b/crates/openhuman-core/src/http_host/rpc.rs@@ -5,13 +5,13 @@ use crate::http_host::types::{HostedDirGetResult, HostedDirListResult, HostedDirLookupParams, HostedDirStartResult,HostedDirStopResult, StartHostedDirParams,};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub async fn start(params: StartHostedDirParams,-) -> Result<RpcOutcome<HostedDirStartResult>, String> {+) -> Result<Outcome<HostedDirStartResult>, String> {let server = ops::start_hosted_dir_server(params).await?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(HostedDirStartResult { server },"started hosted directory HTTP server",))@@ -19,9 +19,9 @@ pub async fn start(pub async fn stop(params: HostedDirLookupParams,-) -> Result<RpcOutcome<HostedDirStopResult>, String> {+) -> Result<Outcome<HostedDirStopResult>, String> {let server = ops::stop_hosted_dir_server(¶ms.server_id).await?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(HostedDirStopResult {stopped: true,server,@@ -30,12 +30,12 @@ pub async fn stop())}-pub async fn get(params: HostedDirLookupParams) -> Result<RpcOutcome<HostedDirGetResult>, String> {+pub async fn get(params: HostedDirLookupParams) -> Result<Outcome<HostedDirGetResult>, String> {let server = ops::get_hosted_dir_server(¶ms.server_id)?;- Ok(RpcOutcome::new(HostedDirGetResult { server }, vec![]))+ Ok(Outcome::new(HostedDirGetResult { server }, vec![]))}-pub async fn list() -> Result<RpcOutcome<HostedDirListResult>, String> {+pub async fn list() -> Result<Outcome<HostedDirListResult>, String> {let servers = ops::list_hosted_dir_servers()?;- Ok(RpcOutcome::new(HostedDirListResult { servers }, vec![]))+ Ok(Outcome::new(HostedDirListResult { servers }, vec![]))}diff --git a/crates/openhuman-core/src/inference/README.md b/crates/openhuman-core/src/inference/README.mdindex 39d4a2dc96..2fbddd6985 100644--- a/crates/openhuman-core/src/inference/README.md+++ b/crates/openhuman-core/src/inference/README.md@@ -27,7 +27,7 @@ compatibility aliases in `crates/openhuman-core/src/core/legacy_aliases.rs`.| File / dir | Role || --------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- || `mod.rs` | Domain root; module decls + re-exports; wires `inference.*` controller schemas/controllers. |-| `ops.rs` | Canonical handler file — `inference_*` business logic returning `RpcOutcome<T>`; delegates to `local`, `provider`, `sentiment`, `device`, `presets`, `openai_oauth`. Includes Sentry-noise suppression for expected provider/user-config failures. |+| `ops.rs` | Canonical handler file — `inference_*` business logic returning `Outcome<T>`; delegates to `local`, `provider`, `sentiment`, `device`, `presets`, `openai_oauth`. Includes Sentry-noise suppression for expected provider/user-config failures. || `schemas.rs` + `schemas/` (`catalog.rs`, `prompt_handlers.rs`, `oauth_handlers.rs`, `claude_code_handlers.rs`, `settings_handlers.rs`) | `inference.*` controller schemas + `handle_*` fns + param DTOs. || `tinyinference_llm::{classification,completion,sentiment}` | Reusable language-model parsing and classification called directly by the host. || `tinyinference_local::device`; `tinyinference_core::sanitize` | Shared hardware detection and credential-safe diagnostic formatting. |diff --git a/crates/openhuman-core/src/inference/embedding_host/rpc/api_keys.rs b/crates/openhuman-core/src/inference/embedding_host/rpc/api_keys.rsindex 961e2275db..dff8e1035e 100644--- a/crates/openhuman-core/src/inference/embedding_host/rpc/api_keys.rs+++ b/crates/openhuman-core/src/inference/embedding_host/rpc/api_keys.rs@@ -3,7 +3,7 @@use std::collections::HashMap;use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::security::credentials::AuthService;use super::LOG_PREFIX;@@ -13,7 +13,7 @@ pub async fn set_api_key(config: &Config,provider_slug: &str,api_key: &str,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {if provider_slug.is_empty() {return Err("provider slug is required".into());}@@ -48,7 +48,7 @@ pub async fn set_api_key("{LOG_PREFIX} set_api_key stored");- Ok(RpcOutcome::new(+ Ok(Outcome::new(serde_json::json!({ "stored": true, "provider": provider_slug, "requeued_failed_jobs": requeued_count, "requeue_error": requeue_error }),vec![format!("embedding API key stored for {provider_slug} (requeued_failed={requeued_note})"@@ -60,7 +60,7 @@ pub async fn set_api_key(pub async fn clear_api_key(config: &Config,provider_slug: &str,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {if provider_slug.is_empty() {return Err("provider slug is required".into());}@@ -77,7 +77,7 @@ pub async fn clear_api_key("{LOG_PREFIX} clear_api_key");- Ok(RpcOutcome::new(+ Ok(Outcome::new(serde_json::json!({ "cleared": removed, "provider": provider_slug }),vec![format!("embedding API key cleared for {provider_slug}")],))diff --git a/crates/openhuman-core/src/inference/embedding_host/rpc/embed.rs b/crates/openhuman-core/src/inference/embedding_host/rpc/embed.rsindex 72d4f19a1a..acdaf7290c 100644--- a/crates/openhuman-core/src/inference/embedding_host/rpc/embed.rs+++ b/crates/openhuman-core/src/inference/embedding_host/rpc/embed.rs@@ -1,7 +1,7 @@//! Live embedding through the configured provider, and the connectivity test.use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::{resolve_api_key, LOG_PREFIX};use crate::inference::embedding_host::factory::create_embedding_provider_with_config;@@ -12,7 +12,7 @@ use tinyinference_embeddings::probe::probe_custom_embeddings;pub async fn embed(config: &Config,inputs: &[String],-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let provider_name = &config.memory.embedding_provider;let model = &config.memory.embedding_model;let dims = config.memory.embedding_dimensions;@@ -65,7 +65,7 @@ pub async fn embed("model": model,});- Ok(RpcOutcome::new(payload, vec!["embedding completed".into()]))+ Ok(Outcome::new(payload, vec!["embedding completed".into()]))}/// Tests connectivity to the configured (or specified) embedding provider.@@ -74,7 +74,7 @@ pub async fn test_connection(provider_slug: Option<&str>,model: Option<&str>,dims: Option<usize>,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let slug = provider_slug.unwrap_or(&config.memory.embedding_provider);let model = model.unwrap_or(&config.memory.embedding_model);let dims = dims.unwrap_or(config.memory.embedding_dimensions);@@ -130,7 +130,7 @@ pub async fn test_connection("requested_dimensions": dims,"actual_dimensions": actual_dims,});- Ok(RpcOutcome::new(+ Ok(Outcome::new(payload,vec!["connection test passed".into()],))@@ -142,7 +142,7 @@ pub async fn test_connection("model": model,"error": e.to_string(),});- Ok(RpcOutcome::new(+ Ok(Outcome::new(payload,vec![format!("connection test failed: {e}")],))diff --git a/crates/openhuman-core/src/inference/embedding_host/rpc/settings.rs b/crates/openhuman-core/src/inference/embedding_host/rpc/settings.rsindex 6e68c19aef..6143054e36 100644--- a/crates/openhuman-core/src/inference/embedding_host/rpc/settings.rs+++ b/crates/openhuman-core/src/inference/embedding_host/rpc/settings.rs@@ -2,7 +2,7 @@//! update, including the save-time verification of a custom endpoint.use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::security::credentials::AuthService;use super::{resolve_api_key, LOG_PREFIX};@@ -15,15 +15,15 @@ use tinyinference_embeddings::served_models::{check_requested_model_served, fetch_served_model_ids, ModelNotServed,};-fn probe_rejection_outcome(reject: EmbeddingProbeRejection) -> RpcOutcome<serde_json::Value> {+fn probe_rejection_outcome(reject: EmbeddingProbeRejection) -> Outcome<serde_json::Value> {let mut body = serde_json::json!({ "error": reject.error, "message": reject.message });if let Some(detail) = reject.detail {body["detail"] = serde_json::Value::String(detail);}- RpcOutcome::new(body, vec![reject.summary.to_string()])+ Outcome::new(body, vec![reject.summary.to_string()])}-fn model_rejection_outcome(reject: ModelNotServed) -> RpcOutcome<serde_json::Value> {+fn model_rejection_outcome(reject: ModelNotServed) -> Outcome<serde_json::Value> {let mut body = serde_json::json!({"error": reject.error,"message": reject.message,@@ -33,7 +33,7 @@ fn model_rejection_outcome(reject: ModelNotServed) -> RpcOutcome<serde_json::Valif let Some(suggestion) = reject.suggested_model {body["suggested_model"] = serde_json::Value::String(suggestion);}- RpcOutcome::new(body, vec![reject.summary.to_string()])+ Outcome::new(body, vec![reject.summary.to_string()])}/// Slug naming the embedder ingestion will actually use, resolved host-side@@ -125,7 +125,7 @@ pub(super) fn remember_active_custom_profile(config: &mut Config) {}/// Returns the current embedding settings plus the provider catalog.-pub async fn get_settings(config: &Config) -> Result<RpcOutcome<serde_json::Value>, String> {+pub async fn get_settings(config: &Config) -> Result<Outcome<serde_json::Value>, String> {let provider = &config.memory.embedding_provider;let model = &config.memory.embedding_model;let dimensions = config.memory.embedding_dimensions;@@ -207,7 +207,7 @@ pub async fn get_settings(config: &Config) -> Result<RpcOutcome<serde_json::Valu"{LOG_PREFIX} get_settings");- Ok(RpcOutcome::new(+ Ok(Outcome::new(payload,vec!["embeddings settings loaded".into()],))@@ -222,7 +222,7 @@ pub async fn update_settings(custom_endpoint: Option<String>,rate_limit_per_min: Option<u32>,confirm_wipe: bool,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {use crate::config::ops as config_rpc;use crate::inference::embedding_host::format_embedding_signature;@@ -410,7 +410,7 @@ pub async fn update_settings("message": "Changing embedding dimensions invalidates all stored vectors. \Pass confirm_wipe=true to wipe memory and apply.",});- return Ok(RpcOutcome::new(+ return Ok(Outcome::new(payload,vec!["embedding dimension change requires wipe confirmation".into()],));@@ -514,7 +514,7 @@ pub async fn update_settings("requeue_error": requeue_error,});- Ok(RpcOutcome::new(+ Ok(Outcome::new(payload,vec![format!("embeddings settings updated (sig_changed={sig_changed} requeued_failed={requeued_note})"diff --git a/crates/openhuman-core/src/inference/embedding_host/schemas.rs b/crates/openhuman-core/src/inference/embedding_host/schemas.rsindex f089ce0a2c..b3ed5a3c72 100644--- a/crates/openhuman-core/src/inference/embedding_host/schemas.rs+++ b/crates/openhuman-core/src/inference/embedding_host/schemas.rs@@ -6,7 +6,7 @@ use serde_json::{Map, Value};use crate::config::ops as config_rpc;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub fn all_controller_schemas() -> Vec<ControllerSchema> {vec![@@ -232,7 +232,7 @@ fn handle_test_connection(params: Map<String, Value>) -> ControllerFuture {// ── Helpers ────────────────────────────────────────────────-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/inference/host_runtime/ops/agent_chat.rs b/crates/openhuman-core/src/inference/host_runtime/ops/agent_chat.rsindex 0ae25cc781..fccdc7703e 100644--- a/crates/openhuman-core/src/inference/host_runtime/ops/agent_chat.rs+++ b/crates/openhuman-core/src/inference/host_runtime/ops/agent_chat.rs@@ -3,7 +3,7 @@use crate::agent::OpenHumanSessionHost;use crate::config::Config;use crate::inference::provider as providers;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::turn_guards::{effective_agent_chat_origin, enforce_user_prompt_or_reject, grant_turn_cwd,@@ -57,7 +57,7 @@ pub async fn agent_chat(thread_id: Option<String>,cwd: Option<String>,route: Option<crate::config::schema::EphemeralRoute>,-) -> Result<RpcOutcome<String>, String> {+) -> Result<Outcome<String>, String> {agent_chat_for(config,AgentChatTarget::Orchestrator,@@ -184,7 +184,7 @@ pub async fn agent_chat_for(thread_id: Option<String>,cwd: Option<String>,route: Option<crate::config::schema::EphemeralRoute>,-) -> Result<RpcOutcome<String>, String> {+) -> Result<Outcome<String>, String> {enforce_user_prompt_or_reject(message, "local_ai.ops.agent_chat")?;// TAURI-RUST-RS: an upstream caller (frontend, JSON-RPC client) can pass@@ -311,7 +311,7 @@ pub async fn agent_chat_for(.unwrap_or_else(std::sync::PoisonError::into_inner) = agent.last_turn_usage();}let response = outcome.map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(response, "agent chat completed"))+ Ok(Outcome::single_log(response, "agent chat completed"))}/// A simplified chat interface that does not update the base configuration.@@ -321,7 +321,7 @@ pub async fn agent_chat_simple(model_override: Option<String>,temperature: Option<f64>,thread_id: Option<String>,-) -> Result<RpcOutcome<String>, String> {+) -> Result<Outcome<String>, String> {enforce_user_prompt_or_reject(message, "local_ai.ops.agent_chat_simple")?;let mut effective = config.clone();@@ -376,7 +376,7 @@ pub async fn agent_chat_simple();let response = run.await.map_err(|e| e.to_string())?.text();- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(response,"agent simple chat completed",))diff --git a/crates/openhuman-core/src/inference/host_runtime/ops/chat.rs b/crates/openhuman-core/src/inference/host_runtime/ops/chat.rsindex 886d8b1ca6..37004a11c4 100644--- a/crates/openhuman-core/src/inference/host_runtime/ops/chat.rs+++ b/crates/openhuman-core/src/inference/host_runtime/ops/chat.rs@@ -2,7 +2,7 @@use crate::config::Config;use crate::inference::host_runtime as local_ai;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::turn_guards::enforce_user_prompt_or_reject;@@ -20,7 +20,7 @@ pub async fn local_ai_chat(config: &Config,messages: Vec<LocalAiChatMessage>,max_tokens: Option<u32>,-) -> Result<RpcOutcome<String>, String> {+) -> Result<Outcome<String>, String> {tracing::debug!(message_count = messages.len(),"[local_ai:chat] local_ai_chat op: validating"@@ -64,5 +64,5 @@ pub async fn local_ai_chat(reply_len = reply.len(),"[local_ai:chat] local_ai_chat op: done");- Ok(RpcOutcome::single_log(reply, "local ai chat completed"))+ Ok(Outcome::single_log(reply, "local ai chat completed"))}diff --git a/crates/openhuman-core/src/inference/host_runtime/ops/reactions.rs b/crates/openhuman-core/src/inference/host_runtime/ops/reactions.rsindex 3c135b11e1..40c37c201e 100644--- a/crates/openhuman-core/src/inference/host_runtime/ops/reactions.rs+++ b/crates/openhuman-core/src/inference/host_runtime/ops/reactions.rs@@ -3,7 +3,7 @@use crate::config::Config;use crate::inference::host_runtime as local_ai;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// Result of the reaction-decision prompt.#[derive(Debug, serde::Serialize)]@@ -22,7 +22,7 @@ pub async fn local_ai_should_react(config: &Config,message: &str,channel_type: &str,-) -> Result<RpcOutcome<ReactionDecision>, String> {+) -> Result<Outcome<ReactionDecision>, String> {tracing::debug!(channel_type,msg_len = message.len(),@@ -30,7 +30,7 @@ pub async fn local_ai_should_react();if message.trim().is_empty() {- return Ok(RpcOutcome::single_log(+ return Ok(Outcome::single_log(ReactionDecision {should_react: false,emoji: None,@@ -43,7 +43,7 @@ pub async fn local_ai_should_react(let status = service.status();if !matches!(status.state.as_str(), "ready") {tracing::debug!("[local_ai:should_react] local model not ready, skipping");- return Ok(RpcOutcome::single_log(+ return Ok(Outcome::single_log(ReactionDecision {should_react: false,emoji: None,@@ -63,7 +63,7 @@ pub async fn local_ai_should_react(let runtime = crate::inference::local_runtime_config(config);let Some(_permit) = crate::cron::scheduler_gate::wait_for_capacity().await else {- return Ok(RpcOutcome::single_log(+ return Ok(Outcome::single_log(ReactionDecision {should_react: false,emoji: None,@@ -114,7 +114,7 @@ pub async fn local_ai_should_react(emoji = ?decision.emoji,"[local_ai:should_react] decision");- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(decision,"reaction decision completed",))diff --git a/crates/openhuman-core/src/inference/host_runtime/ops/runtime_ops.rs b/crates/openhuman-core/src/inference/host_runtime/ops/runtime_ops.rsindex aaa66f29c2..6c260ffd92 100644--- a/crates/openhuman-core/src/inference/host_runtime/ops/runtime_ops.rs+++ b/crates/openhuman-core/src/inference/host_runtime/ops/runtime_ops.rs@@ -9,12 +9,12 @@ use crate::inference::{LocalAiAssetsStatus, LocalAiDownloadsProgress, LocalAiEmbeddingResult, LocalAiSpeechResult,LocalAiStatus, LocalAiTtsResult,};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::turn_guards::enforce_user_prompt_or_reject;/// Returns the current operational status of the local AI stack.-pub async fn local_ai_status(config: &Config) -> Result<RpcOutcome<LocalAiStatus>, String> {+pub async fn local_ai_status(config: &Config) -> Result<Outcome<LocalAiStatus>, String> {let service = local_ai::global(config);let runtime = crate::inference::local_runtime_config(config);let status = service.status();@@ -35,7 +35,7 @@ pub async fn local_ai_status(config: &Config) -> Result<RpcOutcome<LocalAiStatustinyinference_local::provider::provider_from_name(&config.local_ai.provider).as_str().to_string();- Ok(RpcOutcome::single_log(snapshot, "local ai status fetched"))+ Ok(Outcome::single_log(snapshot, "local ai status fetched"))}/// Generates a summary of the provided text using local AI models.@@ -43,7 +43,7 @@ pub async fn local_ai_summarize(config: &Config,text: &str,max_tokens: Option<u32>,-) -> Result<RpcOutcome<String>, String> {+) -> Result<Outcome<String>, String> {enforce_user_prompt_or_reject(text.trim(), "local_ai.ops.local_ai_summarize")?;let service = local_ai::global(config);@@ -56,7 +56,7 @@ pub async fn local_ai_summarize(.summarize_interactive(&runtime, text, max_tokens).await.map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(summary,"local ai summarize completed",))@@ -68,7 +68,7 @@ pub async fn local_ai_prompt(prompt: &str,max_tokens: Option<u32>,no_think: Option<bool>,-) -> Result<RpcOutcome<String>, String> {+) -> Result<Outcome<String>, String> {enforce_user_prompt_or_reject(prompt.trim(), "local_ai.ops.local_ai_prompt")?;let service = local_ai::global(config);@@ -86,7 +86,7 @@ pub async fn local_ai_prompt().await.map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(output, "local ai prompt completed"))+ Ok(Outcome::single_log(output, "local ai prompt completed"))}/// Executes a multimodal (vision) prompt with associated images.@@ -95,7 +95,7 @@ pub async fn local_ai_vision_prompt(prompt: &str,image_refs: &[String],max_tokens: Option<u32>,-) -> Result<RpcOutcome<String>, String> {+) -> Result<Outcome<String>, String> {enforce_user_prompt_or_reject(prompt.trim(), "local_ai.ops.local_ai_vision_prompt")?;let service = local_ai::global(config);@@ -107,7 +107,7 @@ pub async fn local_ai_vision_prompt(.vision_prompt(&runtime, prompt.trim(), image_refs, max_tokens).await.map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(output,"local ai vision prompt completed",))@@ -117,7 +117,7 @@ pub async fn local_ai_vision_prompt(pub async fn local_ai_embed(config: &Config,inputs: &[String],-) -> Result<RpcOutcome<LocalAiEmbeddingResult>, String> {+) -> Result<Outcome<LocalAiEmbeddingResult>, String> {let service = local_ai::global(config);let runtime = crate::inference::local_runtime_config(config);let Some(_permit) = crate::cron::scheduler_gate::wait_for_capacity().await else {@@ -127,7 +127,7 @@ pub async fn local_ai_embed(.embed(&runtime, inputs).await.map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(output,"local ai embedding completed",))@@ -137,12 +137,12 @@ pub async fn local_ai_embed(pub async fn local_ai_transcribe(config: &Config,audio_path: &str,-) -> Result<RpcOutcome<LocalAiSpeechResult>, String> {+) -> Result<Outcome<LocalAiSpeechResult>, String> {let service = local_ai::global(config);let output = local_ai::service::transcribe(&service, config, audio_path.trim()).await.map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(output,"local ai transcription completed",))@@ -153,7 +153,7 @@ pub async fn local_ai_transcribe_bytes(config: &Config,audio_bytes: &[u8],extension: Option<String>,-) -> Result<RpcOutcome<LocalAiSpeechResult>, String> {+) -> Result<Outcome<LocalAiSpeechResult>, String> {let service = local_ai::global(config);let ext = extension@@ -186,7 +186,7 @@ pub async fn local_ai_transcribe_bytes(let _ = tokio::fs::remove_file(&file_path).await;let output = output.map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(output,"local ai transcription completed",))@@ -197,25 +197,25 @@ pub async fn local_ai_tts(config: &Config,text: &str,output_path: Option<&str>,-) -> Result<RpcOutcome<LocalAiTtsResult>, String> {+) -> Result<Outcome<LocalAiTtsResult>, String> {let service = local_ai::global(config);let output = local_ai::service::tts(&service, config, text.trim(), output_path).await.map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(output, "local ai tts completed"))+ Ok(Outcome::single_log(output, "local ai tts completed"))}/// Returns the status of all local AI assets (models and support files).pub async fn local_ai_assets_status(config: &Config,-) -> Result<RpcOutcome<LocalAiAssetsStatus>, String> {+) -> Result<Outcome<LocalAiAssetsStatus>, String> {let service = local_ai::global(config);let runtime = crate::inference::local_runtime_config(config);let output = service.assets_status(&runtime).await.map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(output,"local ai assets status fetched",))@@ -224,14 +224,14 @@ pub async fn local_ai_assets_status(/// Returns progress for any ongoing asset downloads.pub async fn local_ai_downloads_progress(config: &Config,-) -> Result<RpcOutcome<LocalAiDownloadsProgress>, String> {+) -> Result<Outcome<LocalAiDownloadsProgress>, String> {let service = local_ai::global(config);let runtime = crate::inference::local_runtime_config(config);let output = service.downloads_progress(&runtime).await.map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(output,"local ai downloads progress fetched",))@@ -241,14 +241,14 @@ pub async fn local_ai_downloads_progress(pub async fn local_ai_download_asset(config: &Config,capability: &str,-) -> Result<RpcOutcome<LocalAiAssetsStatus>, String> {+) -> Result<Outcome<LocalAiAssetsStatus>, String> {let service = local_ai::global(config);let runtime = crate::inference::local_runtime_config(config);let output = service.download_asset(&runtime, capability.trim()).await.map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(output,"local ai asset download triggered",))diff --git a/crates/openhuman-core/src/inference/host_runtime/schemas.rs b/crates/openhuman-core/src/inference/host_runtime/schemas.rsindex 860d5df949..008faa859e 100644--- a/crates/openhuman-core/src/inference/host_runtime/schemas.rs+++ b/crates/openhuman-core/src/inference/host_runtime/schemas.rs@@ -10,7 +10,7 @@ struct LocalAiTestConnectionParams {use crate::config::rpc as config_rpc;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// Params for `inference.agent_chat` and `inference.agent_chat_simple`.///@@ -542,7 +542,7 @@ fn json_output(name: &'static str, comment: &'static str) -> FieldSchema {}}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/inference/host_runtime/schemas_tests.rs b/crates/openhuman-core/src/inference/host_runtime/schemas_tests.rsindex 02b3f65799..ca55bac6e6 100644--- a/crates/openhuman-core/src/inference/host_runtime/schemas_tests.rs+++ b/crates/openhuman-core/src/inference/host_runtime/schemas_tests.rs@@ -77,7 +77,7 @@ fn field_builder_helpers_are_correct_shape() {#[test]fn to_json_wraps_rpc_outcome() {let v =- to_json(RpcOutcome::single_log(serde_json::json!({"ok": true}), "l")).expect("serialize");+ to_json(Outcome::single_log(serde_json::json!({"ok": true}), "l")).expect("serialize");assert!(v.get("logs").is_some() || v.get("result").is_some() || v.get("ok").is_some());}diff --git a/crates/openhuman-core/src/inference/ops.rs b/crates/openhuman-core/src/inference/ops.rsindex e799b95ba5..15a012085e 100644--- a/crates/openhuman-core/src/inference/ops.rs+++ b/crates/openhuman-core/src/inference/ops.rs@@ -7,7 +7,7 @@ use crate::inference::host_runtime as local_runtime;use crate::inference::host_runtime::ops::ReactionDecision;use crate::inference::provider as providers;use crate::inference::{LocalAiEmbeddingResult, LocalAiStatus};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use serde_json::{json, Value};use tinyinference_llm::message::Message;use tinyinference_llm::model::ModelRequest;@@ -45,7 +45,7 @@ fn expected_test_provider_model_error_kind(crate::core::observability::expected_error_kind(err)}-pub async fn inference_status(config: &Config) -> Result<RpcOutcome<LocalAiStatus>, String> {+pub async fn inference_status(config: &Config) -> Result<Outcome<LocalAiStatus>, String> {debug!("{LOG_PREFIX} status:start");let result = local_runtime::rpc::local_ai_status(config).await;match &result {@@ -59,7 +59,7 @@ pub async fn inference_summarize(config: &Config,text: &str,max_tokens: Option<u32>,-) -> Result<RpcOutcome<String>, String> {+) -> Result<Outcome<String>, String> {debug!(text_len = text.len(),?max_tokens,@@ -81,7 +81,7 @@ pub async fn inference_prompt(prompt: &str,max_tokens: Option<u32>,no_think: Option<bool>,-) -> Result<RpcOutcome<String>, String> {+) -> Result<Outcome<String>, String> {debug!(prompt_len = prompt.len(),?max_tokens,@@ -101,7 +101,7 @@ pub async fn inference_vision_prompt(prompt: &str,image_refs: &[String],max_tokens: Option<u32>,-) -> Result<RpcOutcome<String>, String> {+) -> Result<Outcome<String>, String> {debug!(prompt_len = prompt.len(),image_count = image_refs.len(),@@ -123,7 +123,7 @@ pub async fn inference_vision_prompt(pub async fn inference_embed(config: &Config,inputs: &[String],-) -> Result<RpcOutcome<LocalAiEmbeddingResult>, String> {+) -> Result<Outcome<LocalAiEmbeddingResult>, String> {debug!(input_count = inputs.len(), "{LOG_PREFIX} embed:start");let result = local_runtime::rpc::local_ai_embed(config, inputs).await;match &result {@@ -142,7 +142,7 @@ pub async fn inference_test_provider_model(workload: &str,provider: &str,prompt: &str,-) -> Result<RpcOutcome<InferenceTestChatModelResult>, String> {+) -> Result<Outcome<InferenceTestChatModelResult>, String> {debug!(workload,provider,@@ -181,7 +181,7 @@ pub async fn inference_test_provider_model(.await.map_err(|e| e.to_string()).map(|response| {- RpcOutcome::single_log(+ Outcome::single_log(InferenceTestChatModelResult {reply: response.text(),},@@ -219,7 +219,7 @@ pub async fn inference_should_react(config: &Config,message: &str,channel_type: &str,-) -> Result<RpcOutcome<ReactionDecision>, String> {+) -> Result<Outcome<ReactionDecision>, String> {debug!(message_len = message.len(),channel_type, "{LOG_PREFIX} should_react:start"@@ -238,13 +238,13 @@ pub async fn inference_should_react(pub async fn inference_analyze_sentiment(config: &Config,message: &str,-) -> Result<RpcOutcome<SentimentResult>, String> {+) -> Result<Outcome<SentimentResult>, String> {debug!(message_len = message.len(),"{LOG_PREFIX} analyze_sentiment:start");if message.trim().is_empty() {- return Ok(RpcOutcome::single_log(+ return Ok(Outcome::single_log(SentimentResult::neutral(),"empty message — neutral sentiment",));@@ -252,7 +252,7 @@ pub async fn inference_analyze_sentiment(let service = local_runtime::global(config);if service.status().state != "ready" {- return Ok(RpcOutcome::single_log(+ return Ok(Outcome::single_log(SentimentResult::neutral(),"local model not ready",));@@ -269,7 +269,7 @@ pub async fn inference_analyze_sentiment();let runtime = crate::inference::local_runtime_config(config);let Some(_permit) = crate::cron::scheduler_gate::wait_for_capacity().await else {- return Ok(RpcOutcome::single_log(+ return Ok(Outcome::single_log(SentimentResult::neutral(),"local inference paused while signed out",));@@ -281,7 +281,7 @@ pub async fn inference_analyze_sentiment(SentimentResult::neutral()}};- let result = Ok(RpcOutcome::single_log(+ let result = Ok(Outcome::single_log(result,"sentiment analysis completed",));@@ -294,7 +294,7 @@ pub async fn inference_analyze_sentiment(result}-pub async fn inference_get_client_config() -> Result<RpcOutcome<Value>, String> {+pub async fn inference_get_client_config() -> Result<Outcome<Value>, String> {debug!("{LOG_PREFIX} get_client_config:start");let result = config_rpc::load_and_get_client_config_snapshot().await;match &result {@@ -306,7 +306,7 @@ pub async fn inference_get_client_config() -> Result<RpcOutcome<Value>, String>pub async fn inference_update_model_settings(update: config_rpc::ModelSettingsPatch,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {debug!("{LOG_PREFIX} update_model_settings:start");let result = config_rpc::load_and_apply_model_settings(update).await;match &result {@@ -318,7 +318,7 @@ pub async fn inference_update_model_settings(pub async fn inference_update_local_settings(update: config_rpc::LocalAiSettingsPatch,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {debug!("{LOG_PREFIX} update_local_settings:start");let result = config_rpc::load_and_apply_local_ai_settings(update).await;match &result {@@ -328,7 +328,7 @@ pub async fn inference_update_local_settings(result}-pub async fn inference_list_models(provider_id: &str) -> Result<RpcOutcome<Value>, String> {+pub async fn inference_list_models(provider_id: &str) -> Result<Outcome<Value>, String> {debug!(provider_id, "{LOG_PREFIX} list_models:start");let result = providers::ops::list_configured_models(provider_id).await;match &result {@@ -386,10 +386,10 @@ pub async fn inference_list_models(provider_id: &str) -> Result<RpcOutcome<Valueresult}-pub async fn inference_device_profile() -> Result<RpcOutcome<Value>, String> {+pub async fn inference_device_profile() -> Result<Outcome<Value>, String> {debug!("{LOG_PREFIX} device_profile:start");let profile = detect_device_profile();- let result = Ok(RpcOutcome::single_log(+ let result = Ok(Outcome::single_log(serde_json::to_value(profile).map_err(|e| format!("serialize: {e}"))?,"inference device profile fetched",));@@ -403,16 +403,16 @@ pub async fn inference_device_profile() -> Result<RpcOutcome<Value>, String> {/// memory summarization (TAURI-RUST-4RC) — is surfaced inline next to the key/// editor, not only in the notification center. Cleared when the user updates/// or removes the offending key.-pub async fn inference_provider_auth_errors() -> Result<RpcOutcome<Value>, String> {+pub async fn inference_provider_auth_errors() -> Result<Outcome<Value>, String> {let errors = crate::inference::auth_error_registry::snapshot();debug!(count = errors.len(), "{LOG_PREFIX} provider_auth_errors:ok");- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({ "errors": errors }),"inference provider auth errors fetched",))}-pub async fn inference_presets() -> Result<RpcOutcome<Value>, String> {+pub async fn inference_presets() -> Result<Outcome<Value>, String> {debug!("{LOG_PREFIX} presets:start");let config = config_rpc::load_config_with_timeout().await?;let device = detect_device_profile();@@ -431,7 +431,7 @@ pub async fn inference_presets() -> Result<RpcOutcome<Value>, String> {});let presets = presets::mvp_presets();let recommend_disabled = presets::should_default_to_cloud_fallback(&device);- let result = Ok(RpcOutcome::single_log(+ let result = Ok(Outcome::single_log(json!({"presets": presets,"recommended_tier": recommended,@@ -447,7 +447,7 @@ pub async fn inference_presets() -> Result<RpcOutcome<Value>, String> {result}-pub async fn inference_apply_preset(tier: &str) -> Result<RpcOutcome<Value>, String> {+pub async fn inference_apply_preset(tier: &str) -> Result<Outcome<Value>, String> {let tier_str = tier.trim().to_ascii_lowercase();debug!(tier = %tier_str, "{LOG_PREFIX} apply_preset:start");@@ -461,7 +461,7 @@ pub async fn inference_apply_preset(tier: &str) -> Result<RpcOutcome<Value>, Str.await.map_err(|e| format!("save config: {e}"))?;debug!("{LOG_PREFIX} apply_preset:disabled");- return Ok(RpcOutcome::single_log(+ return Ok(Outcome::single_log(json!({"applied_tier": "disabled","local_ai_enabled": false,@@ -497,7 +497,7 @@ pub async fn inference_apply_preset(tier: &str) -> Result<RpcOutcome<Value>, Str.map_err(|e| format!("save config: {e}"))?;debug!(tier = %tier_str, "{LOG_PREFIX} apply_preset:ok");- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({"applied_tier": tier,"chat_model_id": config.local_ai.chat_model_id,@@ -511,11 +511,11 @@ pub async fn inference_apply_preset(tier: &str) -> Result<RpcOutcome<Value>, Str))}-pub async fn inference_openai_oauth_start(config: &Config) -> Result<RpcOutcome<Value>, String> {+pub async fn inference_openai_oauth_start(config: &Config) -> Result<Outcome<Value>, String> {debug!("{LOG_PREFIX} openai_oauth_start:start");let result =crate::security::credentials::openai_oauth::start_openai_oauth(config).map(|start| {- RpcOutcome::single_log(+ Outcome::single_log(json!({"authUrl": start.auth_url,"state": start.state,@@ -534,7 +534,7 @@ pub async fn inference_openai_oauth_start(config: &Config) -> Result<RpcOutcome<pub async fn inference_openai_oauth_complete(config: &Config,callback_url: &str,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {debug!(callback_len = callback_url.len(),"{LOG_PREFIX} openai_oauth_complete:start"@@ -542,7 +542,7 @@ pub async fn inference_openai_oauth_complete(let result =crate::security::credentials::openai_oauth::complete_openai_oauth(config, callback_url).await- .map(|payload| RpcOutcome::single_log(payload, "openai oauth connected"));+ .map(|payload| Outcome::single_log(payload, "openai oauth connected"));match &result {Ok(_) => debug!("{LOG_PREFIX} openai_oauth_complete:ok"),Err(err) => warn!(error = %err, "{LOG_PREFIX} openai_oauth_complete:error"),@@ -552,11 +552,11 @@ pub async fn inference_openai_oauth_complete(pub async fn inference_openai_oauth_import_codex_cli(config: &Config,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {debug!("{LOG_PREFIX} openai_oauth_import_codex_cli:start");let result =crate::security::credentials::openai_oauth::import_openai_oauth_from_codex_cli(config)- .map(|payload| RpcOutcome::single_log(payload, "openai oauth imported from codex cli"));+ .map(|payload| Outcome::single_log(payload, "openai oauth imported from codex cli"));match &result {Ok(_) => debug!("{LOG_PREFIX} openai_oauth_import_codex_cli:ok"),// Most failures here are expected user-state (no `~/.codex/auth.json`,@@ -574,11 +574,11 @@ pub async fn inference_openai_oauth_import_codex_cli(result}-pub async fn inference_openai_oauth_status(config: &Config) -> Result<RpcOutcome<Value>, String> {+pub async fn inference_openai_oauth_status(config: &Config) -> Result<Outcome<Value>, String> {debug!("{LOG_PREFIX} openai_oauth_status:start");let result =crate::security::credentials::openai_oauth::openai_oauth_status(config).map(|status| {- RpcOutcome::single_log(+ Outcome::single_log(json!({"connected": status.connected,"profileId": status.profile_id,@@ -597,10 +597,10 @@ pub async fn inference_openai_oauth_status(config: &Config) -> Result<RpcOutcomepub async fn inference_openai_oauth_disconnect(config: &Config,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {debug!("{LOG_PREFIX} openai_oauth_disconnect:start");let result = crate::security::credentials::openai_oauth::disconnect_openai_oauth(config)- .map(|payload| RpcOutcome::single_log(payload, "openai oauth disconnected"));+ .map(|payload| Outcome::single_log(payload, "openai oauth disconnected"));match &result {Ok(_) => debug!("{LOG_PREFIX} openai_oauth_disconnect:ok"),Err(err) => warn!(error = %err, "{LOG_PREFIX} openai_oauth_disconnect:error"),@@ -608,7 +608,7 @@ pub async fn inference_openai_oauth_disconnect(result}-pub async fn inference_diagnostics(config: &Config) -> Result<RpcOutcome<Value>, String> {+pub async fn inference_diagnostics(config: &Config) -> Result<Outcome<Value>, String> {debug!("{LOG_PREFIX} diagnostics:start");let service = local_runtime::global(config);// Return the diagnostics payload directly (no `{result, logs}` wrap) so@@ -619,7 +619,7 @@ pub async fn inference_diagnostics(config: &Config) -> Result<RpcOutcome<Value>,let result = service.diagnostics(&runtime).await- .map(|value| RpcOutcome::new(value, Vec::new()));+ .map(|value| Outcome::new(value, Vec::new()));match &result {Ok(_) => debug!("{LOG_PREFIX} diagnostics:ok"),Err(err) => warn!(error = %err, "{LOG_PREFIX} diagnostics:error"),diff --git a/crates/openhuman-core/src/inference/provider/ops/models/catalog_listing.rs b/crates/openhuman-core/src/inference/provider/ops/models/catalog_listing.rsindex de68febc97..2350aac279 100644--- a/crates/openhuman-core/src/inference/provider/ops/models/catalog_listing.rs+++ b/crates/openhuman-core/src/inference/provider/ops/models/catalog_listing.rs@@ -45,7 +45,7 @@ pub fn append_query_param(url: &str, key: &str, value: &str) -> String {pub async fn list_configured_models(provider_id: &str,-) -> Result<crate::rpc::RpcOutcome<serde_json::Value>, String> {+) -> Result<crate::core::Outcome<serde_json::Value>, String> {let config = crate::config::Config::load_or_init().await.map_err(|e| e.to_string())?;@@ -56,7 +56,7 @@ pub async fn list_configured_models(pub async fn list_configured_models_from_config(provider_id: &str,config: &crate::config::Config,-) -> Result<crate::rpc::RpcOutcome<serde_json::Value>, String> {+) -> Result<crate::core::Outcome<serde_json::Value>, String> {let provider_id = provider_id.trim().to_string();if provider_id.is_empty() {return Err("provider_id must not be empty".to_string());@@ -168,7 +168,7 @@ pub async fn list_configured_models_from_config(log::info!("[providers][list_models] managed catalog unavailable — {reason}; returning an empty list");- return Ok(crate::rpc::RpcOutcome::new(+ return Ok(crate::core::Outcome::new(serde_json::json!({ "models": Vec::<ModelInfo>::new() }),vec![format!("{reason}; managed catalog is empty")],));@@ -290,7 +290,7 @@ pub async fn list_configured_models_from_config(log::info!("[providers][list_models] managed catalog unavailable — backend rejected the session token (401); returning an empty list");- return Ok(crate::rpc::RpcOutcome::new(+ return Ok(crate::core::Outcome::new(serde_json::json!({ "models": Vec::<ModelInfo>::new() }),vec!["session not accepted; managed catalog is empty".to_string()],));@@ -379,7 +379,7 @@ pub async fn list_configured_models_from_config(models.len());- Ok(crate::rpc::RpcOutcome::new(+ Ok(crate::core::Outcome::new(serde_json::json!({ "models": models }),vec![format!("fetched {} models", models.len())],))diff --git a/crates/openhuman-core/src/inference/provider/schemas.rs b/crates/openhuman-core/src/inference/provider/schemas.rsindex 790d6d4eff..cd7633228e 100644--- a/crates/openhuman-core/src/inference/provider/schemas.rs+++ b/crates/openhuman-core/src/inference/provider/schemas.rs@@ -10,7 +10,7 @@ use serde_json::{Map, Value};// ── Helpers ──────────────────────────────────────────────────────────────────-fn to_json<T: serde::Serialize>(outcome: crate::rpc::RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: crate::core::Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/inference/schemas.rs b/crates/openhuman-core/src/inference/schemas.rsindex 7e66d418e7..4c1e948a74 100644--- a/crates/openhuman-core/src/inference/schemas.rs+++ b/crates/openhuman-core/src/inference/schemas.rs@@ -16,7 +16,7 @@ use serde_json::{Map, Value};use crate::core::all::RegisteredController;use crate::core::ControllerSchema;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub use catalog::schemas;use claude_code_handlers::*;@@ -177,6 +177,6 @@ fn deserialize_params<T: DeserializeOwned>(params: Map<String, Value>) -> Resultserde_json::from_value(Value::Object(params)).map_err(|e| format!("invalid params: {e}"))}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/inference/schemas/claude_code_handlers.rs b/crates/openhuman-core/src/inference/schemas/claude_code_handlers.rsindex 384695ea67..976131c600 100644--- a/crates/openhuman-core/src/inference/schemas/claude_code_handlers.rs+++ b/crates/openhuman-core/src/inference/schemas/claude_code_handlers.rs@@ -7,7 +7,7 @@ use serde_json::{Map, Value};use super::{deserialize_params, to_json};use crate::config::rpc as config_rpc;use crate::core::all::ControllerFuture;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;#[derive(Debug, Deserialize)]pub(super) struct InferenceClaudeCodeSetFullAccessParams {@@ -23,7 +23,7 @@ pub(super) fn handle_inference_claude_code_status(_params: Map<String, Value>) -).await.map_err(|e| format!("claude_code_status join error: {e}"))?;- to_json(RpcOutcome::new(status, vec![]))+ to_json(Outcome::new(status, vec![]))})}@@ -36,7 +36,7 @@ pub(super) fn handle_inference_claude_code_auth_status().await.map_err(|e| format!("claude_code_auth_status join error: {e}"))?;- to_json(RpcOutcome::new(auth, vec![]))+ to_json(Outcome::new(auth, vec![]))})}@@ -52,7 +52,7 @@ pub(super) fn handle_inference_claude_code_settings("[rpc][inference.claude_code_settings] full_access={}",settings.full_access);- to_json(RpcOutcome::new(settings, vec![]))+ to_json(Outcome::new(settings, vec![]))})}@@ -73,6 +73,6 @@ pub(super) fn handle_inference_claude_code_set_full_access("[rpc][inference.claude_code_set_full_access] persisted full_access={}",settings.full_access);- to_json(RpcOutcome::new(settings, vec![]))+ to_json(Outcome::new(settings, vec![]))})}diff --git a/crates/openhuman-core/src/inference/schemas/settings_handlers.rs b/crates/openhuman-core/src/inference/schemas/settings_handlers.rsindex f6b5795a72..ff671d6737 100644--- a/crates/openhuman-core/src/inference/schemas/settings_handlers.rs+++ b/crates/openhuman-core/src/inference/schemas/settings_handlers.rs@@ -9,7 +9,7 @@ use serde_json::{Map, Value};use super::{deserialize_params, to_json};use crate::config::rpc as config_rpc;use crate::core::all::ControllerFuture;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;#[derive(Debug, Deserialize)]pub(super) struct InferenceResolveModelParams {@@ -100,7 +100,7 @@ pub(super) fn handle_inference_resolve_model(params: Map<String, Value>) -> Cont// tier; custom/BYOK models are covered by the user's per-model// `model_registry.vision` flag.let vision = crate::inference::model_context::model_supports_vision(&resolved, &config);- to_json(RpcOutcome::new(+ to_json(Outcome::new(serde_json::json!({ "model": resolved, "vision": vision }),vec![],))diff --git a/crates/openhuman-core/src/integrations/client/budget_gate.rs b/crates/openhuman-core/src/integrations/client/budget_gate.rsindex 6ca616e131..adeebbbfe8 100644--- a/crates/openhuman-core/src/integrations/client/budget_gate.rs+++ b/crates/openhuman-core/src/integrations/client/budget_gate.rs@@ -19,7 +19,7 @@ use serde_json::Value;use crate::api::config::effective_backend_api_url;use crate::api::BackendOAuthClient;use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// Fetch `GET /teams/me/usage` with the live backend credential.///@@ -101,7 +101,7 @@ impl UsageFailureCache {static USAGE_FAILURE_CACHE: UsageFailureCache = UsageFailureCache::new();-pub async fn get_usage(config: &Config) -> Result<RpcOutcome<Value>, String> {+pub async fn get_usage(config: &Config) -> Result<Outcome<Value>, String> {// Key the failure backoff by the effective backend URL so a failure on one// backend never suppresses probes after the backend is re-pointed (#4153).let backend_key = effective_backend_api_url(&config.api_url);@@ -132,7 +132,7 @@ async fn get_usage_with_cache<F, Fut>(ttl: Duration,now: Instant,fetch: F,-) -> Result<RpcOutcome<Value>, String>+) -> Result<Outcome<Value>, String>whereF: FnOnce() -> Fut,Fut: std::future::Future<Output = Result<Value, String>>,@@ -150,7 +150,7 @@ wherematch fetch().await {Ok(data) => {cache.clear();- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(data,"team usage fetched from backend",))diff --git a/crates/openhuman-core/src/integrations/composio/README.md b/crates/openhuman-core/src/integrations/composio/README.mdindex 061564b3fb..9cc9293e08 100644--- a/crates/openhuman-core/src/integrations/composio/README.md+++ b/crates/openhuman-core/src/integrations/composio/README.md@@ -47,7 +47,7 @@ triggers) from a real transport failure.| --- | --- || `crates/openhuman-core/src/integrations/composio/mod.rs` | Module doc + declarations; re-exports types, ops, schemas, agent tools, trigger-history, and provider/bus types. || `crates/openhuman-core/src/integrations/composio/types.rs` | Serde domain types mirroring backend response envelopes (toolkits, connections, tools, execute, triggers, trigger events/history). Includes drift-tolerant `de_string_or_object` deserializers. |-| `crates/openhuman-core/src/integrations/composio/ops/` | RPC-facing `composio_*` operations returning `RpcOutcome<T>`, split by concern (see [Ops layout](#ops-layout)). |+| `crates/openhuman-core/src/integrations/composio/ops/` | RPC-facing `composio_*` operations returning `Outcome<T>`, split by concern (see [Ops layout](#ops-layout)). || `crates/openhuman-core/src/integrations/composio/schemas.rs` + `schemas/` (`registry.rs`, `definitions.rs`, `handlers_identity.rs`, `handlers_tools.rs`, `handlers_connections.rs`, `handlers_triggers.rs`, `params.rs`, `util.rs`) | Controller schemas + `handle_*` handlers; `all_controller_schemas` / `all_registered_controllers` (`schemas/registry.rs`). || `crates/openhuman-core/src/integrations/composio/client.rs` + `client/` (`connections.rs`, `factory.rs`, `direct.rs`, `execute.rs`, `triggers.rs`) | `ComposioClient` (thin HTTP wrapper over `IntegrationClient` for backend routes, `client/connections.rs`) + `ComposioClientKind` (Backend/Direct), `create_composio_client` (`client/factory.rs`), and direct-mode v3 helpers (`direct_list_connections`, `direct_list_tools`, `direct_execute`, `direct_authorize`, all in `client/direct.rs`). || `crates/openhuman-core/src/integrations/composio/module_client.rs` | The `tinyconnectors` module bridge: the one `modules`-feature `#[cfg]` switch, `methods` re-exported from `tinyconnectors_bus`, and member-failure classification (`is_unsupported_by_route`, error-prefix peeling). |@@ -179,7 +179,7 @@ Published from `ops/` via `crate::core::bus::BUS.publish` (`crate::core::events:- `crate::core::all` — `ControllerFuture` / `RegisteredController` registry types.- `crate::core::bus` (`BUS`) / `crate::core::events::DomainEvent` — event publish/subscribe.- `crate::core::observability` — Sentry error classification/reporting.-- `crate::rpc` — `RpcOutcome<T>`.+- `crate::rpc` — `Outcome<T>`.## Used bydiff --git a/crates/openhuman-core/src/integrations/composio/ops/connections.rs b/crates/openhuman-core/src/integrations/composio/ops/connections.rsindex 1964d395a2..e2c8096ceb 100644--- a/crates/openhuman-core/src/integrations/composio/ops/connections.rs+++ b/crates/openhuman-core/src/integrations/composio/ops/connections.rs@@ -5,7 +5,7 @@ use std::collections::HashMap;use super::super::client::{create_composio_client, direct_list_connections, ComposioClientKind};use super::super::module_client::{self as connectors, methods};use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::super::connected_integrations::{fetch_connected_integrations_status, invalidate_connected_integrations_cache,@@ -25,14 +25,14 @@ use tinymemory_api::composio::normalize_connection_identifier;pub async fn composio_list_connections(config: &Config,-) -> OpResult<RpcOutcome<ComposioConnectionsResponse>> {+) -> OpResult<Outcome<ComposioConnectionsResponse>> {tracing::debug!("[composio] rpc list_connections");if direct_mode_without_key(config)? {tracing::debug!("[composio] list_connections: direct mode selected, no api key configured yet \— returning empty connection list (valid setup state, not an error)");- return Ok(RpcOutcome::new(+ return Ok(Outcome::new(ComposioConnectionsResponse {connections: Vec::new(),},@@ -101,7 +101,7 @@ pub async fn composio_list_connections(});}let resp = enrich_connections_with_identity(config, resp).await;- Ok(RpcOutcome::new(+ Ok(Outcome::new(resp,vec![format!("composio: {total} connection(s) listed ({active} active)"@@ -113,7 +113,7 @@ pub async fn composio_authorize(config: &Config,toolkit: &str,extra_params: Option<serde_json::Value>,-) -> OpResult<RpcOutcome<ComposioAuthorizeResponse>> {+) -> OpResult<Outcome<ComposioAuthorizeResponse>> {tracing::debug!(toolkit = %toolkit, has_extra_params = extra_params.is_some(), "[composio] rpc authorize");// The module owns the whole handoff: the Meta pre-clean, the 429 backoff,// and the guidance message that replaces an unhelpful rate-limit error.@@ -141,7 +141,7 @@ pub async fn composio_authorize(},);- Ok(RpcOutcome::new(+ Ok(Outcome::new(resp,vec![format!("composio: authorize flow started for {toolkit}")],))@@ -151,7 +151,7 @@ pub async fn composio_delete_connection(config: &Config,connection_id: &str,clear_memory: bool,-) -> OpResult<RpcOutcome<ComposioDeleteResponse>> {+) -> OpResult<Outcome<ComposioDeleteResponse>> {tracing::debug!(connection_id = %connection_id, "[composio] rpc delete_connection");let toolkit = match resolve_toolkit_for_connection(config, connection_id).await {Ok(toolkit) => Some(toolkit),@@ -283,7 +283,7 @@ pub async fn composio_delete_connection(if !memory_clear_errors.is_empty() {return Err(memory_clear_errors.join("; "));}- Ok(RpcOutcome::new(+ Ok(Outcome::new(resp,vec![format!("composio: connection {connection_id} deleted")],))diff --git a/crates/openhuman-core/src/integrations/composio/ops/direct_mode.rs b/crates/openhuman-core/src/integrations/composio/ops/direct_mode.rsindex 83a9c8a008..1b18ad8032 100644--- a/crates/openhuman-core/src/integrations/composio/ops/direct_mode.rs+++ b/crates/openhuman-core/src/integrations/composio/ops/direct_mode.rs@@ -1,7 +1,7 @@//! Direct mode (BYO API key) ops.use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::super::{client::{create_direct_composio_tool_for_api_key, direct_list_connections},@@ -44,7 +44,7 @@ async fn validate_direct_api_key_before_store(config: &Config, api_key: &str) ->/// Read the current Composio routing mode and whether a direct-mode API/// key is stored. **The key itself is never returned** — only a boolean/// flag so the UI can show a "Connected" / "Not set" status.-pub async fn composio_get_mode(config: &Config) -> OpResult<RpcOutcome<serde_json::Value>> {+pub async fn composio_get_mode(config: &Config) -> OpResult<Outcome<serde_json::Value>> {let mode = config.composio.mode.trim().to_string();let key_present = crate::security::credentials::get_composio_api_key(config).map_err(|e| format!("[composio-direct] get_composio_api_key failed: {e}"))?@@ -58,7 +58,7 @@ pub async fn composio_get_mode(config: &Config) -> OpResult<RpcOutcome<serde_jso"mode": mode,"api_key_set": key_present,});- Ok(RpcOutcome::new(+ Ok(Outcome::new(payload,vec![format!("composio: mode={mode}, api_key={}",@@ -75,7 +75,7 @@ pub async fn composio_set_api_key(config: &Config,api_key: &str,activate_direct: bool,-) -> OpResult<RpcOutcome<serde_json::Value>> {+) -> OpResult<Outcome<serde_json::Value>> {let trimmed = api_key.trim();if trimmed.is_empty() {return Err("composio.set_api_key: api_key must not be empty".to_string());@@ -120,7 +120,7 @@ pub async fn composio_set_api_key("[composio-cache] published ComposioConfigChanged after set_api_key");- Ok(RpcOutcome::new(+ Ok(Outcome::new(serde_json::json!({"stored": true,"mode": effective_mode,@@ -131,7 +131,7 @@ pub async fn composio_set_api_key(/// Clear the stored direct-mode API key and reset/// `config.composio.mode` back to `"backend"`.-pub async fn composio_clear_api_key(config: &Config) -> OpResult<RpcOutcome<serde_json::Value>> {+pub async fn composio_clear_api_key(config: &Config) -> OpResult<Outcome<serde_json::Value>> {tracing::debug!("[composio-direct] clear_api_key");crate::security::credentials::clear_composio_api_key(config).await@@ -153,7 +153,7 @@ pub async fn composio_clear_api_key(config: &Config) -> OpResult<RpcOutcome<serd});tracing::debug!("[composio-cache] published ComposioConfigChanged after clear_api_key");- Ok(RpcOutcome::new(+ Ok(Outcome::new(serde_json::json!({ "cleared": true, "mode": "backend" }),vec!["composio: api key cleared, mode reset to backend".into()],))diff --git a/crates/openhuman-core/src/integrations/composio/ops/execute.rs b/crates/openhuman-core/src/integrations/composio/ops/execute.rsindex 7ec307e39e..43cfc857dd 100644--- a/crates/openhuman-core/src/integrations/composio/ops/execute.rs+++ b/crates/openhuman-core/src/integrations/composio/ops/execute.rs@@ -1,7 +1,7 @@//! Tool execution op.use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::super::module_client::{self as connectors, methods};use super::super::types::{ComposioExecuteRequest, ComposioExecuteResponse};@@ -32,7 +32,7 @@ pub async fn composio_execute(tool: &str,arguments: Option<serde_json::Value>,connection_id: Option<&str>,-) -> OpResult<RpcOutcome<ComposioExecuteResponse>> {+) -> OpResult<Outcome<ComposioExecuteResponse>> {tracing::debug!(tool = %tool, connection_id = ?connection_id, "[composio] rpc execute");let started = std::time::Instant::now();let result = connectors::call::<_, ComposioExecuteResponse>(@@ -62,7 +62,7 @@ pub async fn composio_execute(elapsed_ms,},);- Ok(RpcOutcome::new(+ Ok(Outcome::new(resp,vec![format!("composio: executed {tool} ({elapsed_ms}ms)")],))diff --git a/crates/openhuman-core/src/integrations/composio/ops/mod.rs b/crates/openhuman-core/src/integrations/composio/ops/mod.rsindex 1ede599a4a..41106fcfaf 100644--- a/crates/openhuman-core/src/integrations/composio/ops/mod.rs+++ b/crates/openhuman-core/src/integrations/composio/ops/mod.rs@@ -1,7 +1,7 @@//! RPC-facing operations for the Composio domain.//!//! Each `composio_*` function wraps a [`ComposioClient`] call, translates-//! errors to strings, and returns an [`RpcOutcome`] so the controller+//! errors to strings, and returns an [`Outcome`] so the controller//! schemas can log a user-visible line. The handlers in [`super::schemas`]//! call into these.//!diff --git a/crates/openhuman-core/src/integrations/composio/ops/providers_ops.rs b/crates/openhuman-core/src/integrations/composio/ops/providers_ops.rsindex 4c9e55037a..89e100a1e7 100644--- a/crates/openhuman-core/src/integrations/composio/ops/providers_ops.rs+++ b/crates/openhuman-core/src/integrations/composio/ops/providers_ops.rs@@ -13,7 +13,7 @@//! memory driver never sees a Composio credential.use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::super::module_client::{self as connectors, methods};use super::super::providers::{ProviderUserProfile, SyncOutcome, SyncReason};@@ -99,7 +99,7 @@ async fn persist_identity(config: &Config, profile: &ComposioUserProfile) -> OpRpub async fn composio_get_user_profile(config: &Config,connection_id: &str,-) -> OpResult<RpcOutcome<ProviderUserProfile>> {+) -> OpResult<Outcome<ProviderUserProfile>> {tracing::debug!(connection_id = %connection_id, "[composio] rpc get_user_profile");let toolkit = resolve_toolkit_for_connection(config, connection_id).await?;@@ -124,7 +124,7 @@ pub async fn composio_get_user_profile("[composio] identity_set persisted profile facets from get_user_profile");- Ok(RpcOutcome::new(+ Ok(Outcome::new(reencode(&profile)?,vec![format!("composio: fetched {toolkit} profile for connection {connection_id}"@@ -140,7 +140,7 @@ pub async fn composio_get_user_profile(/// to find the broken ones.pub async fn composio_refresh_all_identities(config: &Config,-) -> OpResult<RpcOutcome<RefreshIdentitiesReport>> {+) -> OpResult<Outcome<RefreshIdentitiesReport>> {tracing::info!("[composio] rpc refresh_all_identities");let response = connectors::call_bare::<ComposioRefreshIdentitiesResponse>(config,@@ -210,7 +210,7 @@ pub async fn composio_refresh_all_identities();let mut envelope = vec![summary];envelope.extend(messages);- Ok(RpcOutcome::new(report, envelope))+ Ok(Outcome::new(report, envelope))}/// `openhuman.composio_sync` — read a connected account and write what it@@ -223,7 +223,7 @@ pub async fn composio_sync(config: &Config,connection_id: &str,reason: Option<String>,-) -> OpResult<RpcOutcome<SyncOutcome>> {+) -> OpResult<Outcome<SyncOutcome>> {composio_sync_for_source(config, connection_id, reason, None).await}@@ -238,7 +238,7 @@ pub async fn composio_sync_for_source(connection_id: &str,reason: Option<String>,source_id: Option<String>,-) -> OpResult<RpcOutcome<SyncOutcome>> {+) -> OpResult<Outcome<SyncOutcome>> {composio_sync_budgeted(config, connection_id, reason, source_id, None).await}@@ -251,7 +251,7 @@ pub async fn composio_sync_budgeted(reason: Option<String>,source_id: Option<String>,source_max_items: Option<u32>,-) -> OpResult<RpcOutcome<SyncOutcome>> {+) -> OpResult<Outcome<SyncOutcome>> {let reason = parse_sync_reason(reason.as_deref())?;tracing::debug!(connection_id = %connection_id,@@ -490,7 +490,7 @@ pub async fn composio_sync_budgeted(summary: summary.clone(),details: serde_json::json!({ "status": "started" }),};- Ok(RpcOutcome::new(outcome, vec![summary]))+ Ok(Outcome::new(outcome, vec![summary]))}/// What one [`run_sync_pass`] call did.diff --git a/crates/openhuman-core/src/integrations/composio/ops/toolkits.rs b/crates/openhuman-core/src/integrations/composio/ops/toolkits.rsindex d96291b459..a7a5fc060c 100644--- a/crates/openhuman-core/src/integrations/composio/ops/toolkits.rs+++ b/crates/openhuman-core/src/integrations/composio/ops/toolkits.rs@@ -2,7 +2,7 @@use super::super::module_client::{self as connectors, methods};use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::super::providers::agent_ready_toolkits;use super::super::types::{ComposioCapabilitiesResponse, ComposioToolkitsResponse};@@ -10,13 +10,13 @@ use super::error_utils::{report_composio_op_error, OpResult};pub async fn composio_list_toolkits(config: &Config,-) -> OpResult<RpcOutcome<ComposioToolkitsResponse>> {+) -> OpResult<Outcome<ComposioToolkitsResponse>> {tracing::debug!("[composio] rpc list_toolkits");match connectors::call_bare::<ComposioToolkitsResponse>(config, methods::LIST_TOOLKITS).await {Ok(resp) => {let count = resp.toolkits.len();- Ok(RpcOutcome::new(+ Ok(Outcome::new(resp,vec![format!("composio: {count} toolkit(s) enabled")],))@@ -31,7 +31,7 @@ pub async fn composio_list_toolkits("[composio] list_toolkits: the live route enforces no server-side allowlist; \returning an empty list");- Ok(RpcOutcome::new(+ Ok(Outcome::new(ComposioToolkitsResponse::default(),vec!["composio: direct mode — no curated allowlist (toolkits \managed via app.composio.dev)"@@ -47,7 +47,7 @@ pub async fn composio_list_toolkits(pub async fn composio_list_capabilities(config: &Config,-) -> OpResult<RpcOutcome<ComposioCapabilitiesResponse>> {+) -> OpResult<Outcome<ComposioCapabilitiesResponse>> {tracing::debug!("[composio] rpc list_capabilities");// Used to be built host-side from `tinymemory`'s engine provider// registry via `capability_matrix()`, deleted with the rest of the@@ -62,7 +62,7 @@ pub async fn composio_list_capabilities(format!("[composio] list_capabilities failed: {error}")})?;let count = resp.capabilities.len();- Ok(RpcOutcome::new(+ Ok(Outcome::new(resp,vec![format!("composio: {count} capability row(s) listed")],))@@ -76,7 +76,7 @@ pub async fn composio_list_capabilities(/// "preview / agent integration coming soon" so users aren't led into/// a broken `composio_list_tools` → max-iterations loop. See #2283.pub async fn composio_list_agent_ready_toolkits(-) -> OpResult<RpcOutcome<super::super::types::ComposioAgentReadyToolkitsResponse>> {+) -> OpResult<Outcome<super::super::types::ComposioAgentReadyToolkitsResponse>> {tracing::debug!("[composio] rpc list_agent_ready_toolkits");let toolkits: Vec<String> = agent_ready_toolkits().into_iter()@@ -84,7 +84,7 @@ pub async fn composio_list_agent_ready_toolkits(.collect();let count = toolkits.len();let resp = super::super::types::ComposioAgentReadyToolkitsResponse { toolkits };- Ok(RpcOutcome::new(+ Ok(Outcome::new(resp,vec![format!("composio: {count} agent-ready toolkit(s) listed")],))diff --git a/crates/openhuman-core/src/integrations/composio/ops/tools_ops.rs b/crates/openhuman-core/src/integrations/composio/ops/tools_ops.rsindex 0a09ac48ea..3d5f5892b9 100644--- a/crates/openhuman-core/src/integrations/composio/ops/tools_ops.rs+++ b/crates/openhuman-core/src/integrations/composio/ops/tools_ops.rs@@ -1,7 +1,7 @@//! Tool listing ops.use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::super::module_client::{self as connectors, methods};use super::super::types::{ComposioListToolsRequest, ComposioToolsResponse};@@ -37,7 +37,7 @@ pub async fn composio_list_tools(config: &Config,toolkits: Option<Vec<String>>,tags: Option<Vec<String>>,-) -> OpResult<RpcOutcome<ComposioToolsResponse>> {+) -> OpResult<Outcome<ComposioToolsResponse>> {let effective_tags = if should_forward_tags(toolkits.as_deref()) {tags} else {@@ -60,7 +60,7 @@ pub async fn composio_list_tools(} else {format!("composio: {count} tool(s) listed across {named} toolkit(s)")};- Ok(RpcOutcome::new(resp, vec![line]))+ Ok(Outcome::new(resp, vec![line]))}Err(error) => {report_composio_op_error("list_tools", &anyhow::anyhow!("{error}"));diff --git a/crates/openhuman-core/src/integrations/composio/ops/triggers.rs b/crates/openhuman-core/src/integrations/composio/ops/triggers.rsindex 67678000ef..be1753d93a 100644--- a/crates/openhuman-core/src/integrations/composio/ops/triggers.rs+++ b/crates/openhuman-core/src/integrations/composio/ops/triggers.rs@@ -11,7 +11,7 @@//! what writes to it as deliveries are dispatched.use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::super::module_client::{self as connectors, methods};use super::super::types::{@@ -27,7 +27,7 @@ use super::error_utils::{report_composio_op_error, OpResult};pub async fn composio_list_github_repos(config: &Config,connection_id: Option<String>,-) -> OpResult<RpcOutcome<ComposioGithubReposResponse>> {+) -> OpResult<Outcome<ComposioGithubReposResponse>> {tracing::debug!(?connection_id, "[composio] rpc list_github_repos");let resp = connectors::call::<_, ComposioGithubReposResponse>(config,@@ -41,7 +41,7 @@ pub async fn composio_list_github_repos(})?;let count = resp.repositories.len();let connection_id = resp.connection_id.clone();- Ok(RpcOutcome::new(+ Ok(Outcome::new(resp,vec![format!("composio: {count} github repo(s) listed for connection {connection_id}"@@ -54,7 +54,7 @@ pub async fn composio_create_trigger(slug: &str,connection_id: Option<String>,trigger_config: Option<serde_json::Value>,-) -> OpResult<RpcOutcome<ComposioCreateTriggerResponse>> {+) -> OpResult<Outcome<ComposioCreateTriggerResponse>> {tracing::debug!(slug = %slug, ?connection_id, "[composio] rpc create_trigger");let resp = connectors::call::<_, ComposioCreateTriggerResponse>(config,@@ -71,7 +71,7 @@ pub async fn composio_create_trigger(format!("[composio] create_trigger failed: {e}")})?;let trigger_id = resp.trigger_id.clone();- Ok(RpcOutcome::new(+ Ok(Outcome::new(resp,vec![format!("composio: trigger {trigger_id} created for slug {slug}"@@ -83,7 +83,7 @@ pub async fn composio_list_available_triggers(config: &Config,toolkit: &str,connection_id: Option<String>,-) -> OpResult<RpcOutcome<ComposioAvailableTriggersResponse>> {+) -> OpResult<Outcome<ComposioAvailableTriggersResponse>> {tracing::debug!(toolkit = %toolkit, ?connection_id, "[composio] rpc list_available_triggers");let resp = connectors::call::<_, ComposioAvailableTriggersResponse>(config,@@ -99,7 +99,7 @@ pub async fn composio_list_available_triggers(format!("[composio] list_available_triggers failed: {e}")})?;let count = resp.triggers.len();- Ok(RpcOutcome::new(+ Ok(Outcome::new(resp,vec![format!("composio: {count} available trigger(s) for toolkit {toolkit}"@@ -110,7 +110,7 @@ pub async fn composio_list_available_triggers(pub async fn composio_list_triggers(config: &Config,toolkit: Option<String>,-) -> OpResult<RpcOutcome<ComposioActiveTriggersResponse>> {+) -> OpResult<Outcome<ComposioActiveTriggersResponse>> {tracing::debug!(?toolkit, "[composio] rpc list_triggers");let resp = connectors::call::<_, ComposioActiveTriggersResponse>(config,@@ -123,7 +123,7 @@ pub async fn composio_list_triggers(format!("[composio] list_triggers failed: {e}")})?;let count = resp.triggers.len();- Ok(RpcOutcome::new(+ Ok(Outcome::new(resp,vec![format!("composio: {count} active trigger(s) listed")],))@@ -134,7 +134,7 @@ pub async fn composio_enable_trigger(connection_id: &str,slug: &str,trigger_config: Option<serde_json::Value>,-) -> OpResult<RpcOutcome<ComposioEnableTriggerResponse>> {+) -> OpResult<Outcome<ComposioEnableTriggerResponse>> {tracing::debug!(slug = %slug, connection_id = %connection_id, "[composio] rpc enable_trigger");let resp = connectors::call::<_, ComposioEnableTriggerResponse>(config,@@ -162,7 +162,7 @@ pub async fn composio_enable_trigger(mapped})?;let trigger_id = resp.trigger_id.clone();- Ok(RpcOutcome::new(+ Ok(Outcome::new(resp,vec![format!("composio: enabled trigger {slug} → {trigger_id}")],))@@ -171,7 +171,7 @@ pub async fn composio_enable_trigger(pub async fn composio_disable_trigger(config: &Config,trigger_id: &str,-) -> OpResult<RpcOutcome<ComposioDisableTriggerResponse>> {+) -> OpResult<Outcome<ComposioDisableTriggerResponse>> {tracing::debug!(trigger_id = %trigger_id, "[composio] rpc disable_trigger");let resp = connectors::call::<_, ComposioDisableTriggerResponse>(config,@@ -190,13 +190,13 @@ pub async fn composio_disable_trigger(} else {format!("composio: trigger {trigger_id} was not active")};- Ok(RpcOutcome::new(resp, vec![message]))+ Ok(Outcome::new(resp, vec![message]))}pub async fn composio_list_trigger_history(config: &Config,limit: Option<usize>,-) -> OpResult<RpcOutcome<ComposioTriggerHistoryResult>> {+) -> OpResult<Outcome<ComposioTriggerHistoryResult>> {let requested_limit = limit.unwrap_or(100).clamp(1, 500);let workspace_label = config.workspace_dir@@ -220,7 +220,7 @@ pub async fn composio_list_trigger_history(.map_err(|error| format!("[composio] list_trigger_history failed: {error}"))?;let count = history.entries.len();- Ok(RpcOutcome::new(+ Ok(Outcome::new(history,vec![format!("composio: {count} trigger history entrie(s) loaded (archive present)"diff --git a/crates/openhuman-core/src/integrations/composio/schemas.rs b/crates/openhuman-core/src/integrations/composio/schemas.rsindex 40ecbd09ff..b5d8b7165c 100644--- a/crates/openhuman-core/src/integrations/composio/schemas.rs+++ b/crates/openhuman-core/src/integrations/composio/schemas.rs@@ -39,7 +39,7 @@ pub use definitions::schemas;// when this was one un-split file. See each item's `pub(super)` in its// owning submodule.#[cfg(test)]-use crate::rpc::RpcOutcome;+use crate::core::Outcome;#[cfg(test)]use serde_json::{Map, Value};#[cfg(test)]diff --git a/crates/openhuman-core/src/integrations/composio/schemas/handlers_identity.rs b/crates/openhuman-core/src/integrations/composio/schemas/handlers_identity.rsindex d20d3e14e0..b7203111d6 100644--- a/crates/openhuman-core/src/integrations/composio/schemas/handlers_identity.rs+++ b/crates/openhuman-core/src/integrations/composio/schemas/handlers_identity.rs@@ -82,7 +82,7 @@ pub(super) fn handle_get_user_scopes(params: Map<String, Value>) -> ControllerFuadmin = pref.admin,"[composio:scopes] handler exit");- to_json(crate::rpc::RpcOutcome::new(pref, vec![]))+ to_json(crate::core::Outcome::new(pref, vec![]))})}@@ -134,6 +134,6 @@ pub(super) fn handle_set_user_scopes(params: Map<String, Value>) -> ControllerFuadmin = pref.admin,"[composio:scopes] handler exit");- to_json(crate::rpc::RpcOutcome::new(pref, vec![]))+ to_json(crate::core::Outcome::new(pref, vec![]))})}diff --git a/crates/openhuman-core/src/integrations/composio/schemas/util.rs b/crates/openhuman-core/src/integrations/composio/schemas/util.rsindex 388fde02ae..a62412deb1 100644--- a/crates/openhuman-core/src/integrations/composio/schemas/util.rs+++ b/crates/openhuman-core/src/integrations/composio/schemas/util.rs@@ -4,7 +4,7 @@use serde::de::DeserializeOwned;use serde_json::{Map, Value};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub(super) fn read_required<T: DeserializeOwned>(params: &Map<String, Value>,@@ -44,6 +44,6 @@ pub(super) fn read_optional<T: DeserializeOwned>(}}-pub(super) fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+pub(super) fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/integrations/composio/schemas_tests.rs b/crates/openhuman-core/src/integrations/composio/schemas_tests.rsindex 85f114fd41..331fd53fb3 100644--- a/crates/openhuman-core/src/integrations/composio/schemas_tests.rs+++ b/crates/openhuman-core/src/integrations/composio/schemas_tests.rs@@ -163,7 +163,7 @@ fn read_optional_errors_on_type_mismatch() {#[test]fn to_json_wraps_outcome() {- let v = to_json(RpcOutcome::single_log(json!({"x": 1}), "note")).unwrap();+ let v = to_json(Outcome::single_log(json!({"x": 1}), "note")).unwrap();assert!(v.get("logs").is_some() || v.get("result").is_some() || v.get("x").is_some());}diff --git a/crates/openhuman-core/src/integrations/task_sources/README.md b/crates/openhuman-core/src/integrations/task_sources/README.mdindex d2b6fe96ff..12c5bd8afb 100644--- a/crates/openhuman-core/src/integrations/task_sources/README.md+++ b/crates/openhuman-core/src/integrations/task_sources/README.md@@ -20,7 +20,7 @@ Proactive ingestion of work items from external tools. A **task source** is a us| `crates/openhuman-core/src/integrations/task_sources/mod.rs` | Export-only: module docstring, `mod`/`pub mod` decls, `pub use` re-exports, and the `all_task_sources_*` controller registry pair. || `crates/openhuman-core/src/integrations/task_sources/types.rs` | Serde domain types: `ProviderSlug`, `FilterSpec` (provider-tagged enum), `SourceTarget`, `FetchReason`, `TaskSource`, `TaskSourcePatch`, `EnrichedTask`, `FetchOutcome`. || `crates/openhuman-core/src/integrations/task_sources/store.rs` | SQLite persistence (`<workspace>/task_sources/sources.db`): `task_sources` + `ingested_tasks` tables, dedup `content_hash`, migrate-on-open. |-| `crates/openhuman-core/src/integrations/task_sources/ops.rs` | RPC-facing business logic returning `RpcOutcome<T>`: `list`/`get`/`add`/`update`/`remove`/`fetch`/`sync`/`list_tasks`/`preview_filter`/`list_databases`/`status`. |+| `crates/openhuman-core/src/integrations/task_sources/ops.rs` | RPC-facing business logic returning `Outcome<T>`: `list`/`get`/`add`/`update`/`remove`/`fetch`/`sync`/`list_tasks`/`preview_filter`/`list_databases`/`status`. || `crates/openhuman-core/src/integrations/task_sources/schemas.rs` | `task_sources` controller schemas + `all_controller_schemas` / `all_registered_controllers` + thin `handle_*` param parsers delegating to `ops.rs`. || `crates/openhuman-core/src/integrations/task_sources/pipeline.rs` | `run_source_once` — the infallible fetch → dedup → enrich → route pass shared by poll, manual RPC, and connection hook; publishes domain events. Holds the `fetch_tasks_unavailable` stub and its rationale doc comment. || `crates/openhuman-core/src/integrations/task_sources/filter.rs` | `to_fetch_filter` — flattens a `FilterSpec` variant into the shared `TaskFetchFilter`. |@@ -65,7 +65,7 @@ Handlers parse params and delegate to `ops.rs`; schemas reference `FilterSpec`,## Agent tools`tools.rs` wraps `ops.rs` as thin LLM-callable shims — each parses args,-calls the matching `ops` function, and emits its `RpcOutcome::value` as JSON.+calls the matching `ops` function, and emits its `Outcome::value` as JSON.Read/observe tools are default-enabled; the persistent-config mutators aredefault-OFF and must be explicitly allowlisted via `tools/user_filter.rs`(the `task_source_manage` filter group covers `add`/`update`/`remove`).diff --git a/crates/openhuman-core/src/integrations/task_sources/ops.rs b/crates/openhuman-core/src/integrations/task_sources/ops.rsindex 0efb0d78e4..bbe588042c 100644--- a/crates/openhuman-core/src/integrations/task_sources/ops.rs+++ b/crates/openhuman-core/src/integrations/task_sources/ops.rs@@ -1,6 +1,6 @@//! RPC-facing operations for the `task_sources` domain.//!-//! Each function returns an [`RpcOutcome`] so the controller layer can+//! Each function returns an [`Outcome`] so the controller layer can//! surface logs alongside the value. Errors are `String` to match the//! `ControllerFuture` boundary. Business logic stays here; `schemas.rs`//! only parses params and delegates.@@ -9,7 +9,7 @@ use serde_json::{json, Value};use crate::config::Config;use crate::integrations::composio::providers::{NormalizedTask, TaskContainer};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::types::{FetchReason, FilterSpec, ProviderSlug, SourceTarget, TaskSource, TaskSourcePatch,@@ -17,16 +17,16 @@ use super::types::{use super::{filter, pipeline, store};/// List all configured task sources.-pub async fn list(config: &Config) -> Result<RpcOutcome<Vec<TaskSource>>, String> {+pub async fn list(config: &Config) -> Result<Outcome<Vec<TaskSource>>, String> {let sources = store::list_sources(config).map_err(|e| e.to_string())?;tracing::debug!(count = sources.len(), "[task_sources:ops] list");- Ok(RpcOutcome::new(sources, vec![]))+ Ok(Outcome::new(sources, vec![]))}/// Fetch a single source by id.-pub async fn get(config: &Config, id: &str) -> Result<RpcOutcome<TaskSource>, String> {+pub async fn get(config: &Config, id: &str) -> Result<Outcome<TaskSource>, String> {let source = store::get_source(config, id).map_err(|e| e.to_string())?;- Ok(RpcOutcome::new(source, vec![]))+ Ok(Outcome::new(source, vec![]))}/// Create a new source. Missing schedule / target / cap fields fall back@@ -40,7 +40,7 @@ pub async fn add(interval_secs: Option<u64>,target: Option<SourceTarget>,max_tasks_per_fetch: Option<u32>,-) -> Result<RpcOutcome<TaskSource>, String> {+) -> Result<Outcome<TaskSource>, String> {let defaults = &config.task_sources;let interval_secs = interval_secs.unwrap_or(defaults.default_interval_secs);let max = max_tasks_per_fetch.unwrap_or(defaults.max_tasks_per_fetch);@@ -67,7 +67,7 @@ pub async fn add(provider = %source.provider.as_str(),"[task_sources:ops] add created source");- Ok(RpcOutcome::new(source, vec![]))+ Ok(Outcome::new(source, vec![]))}/// Apply a partial update to a source.@@ -75,14 +75,14 @@ pub async fn update(config: &Config,id: &str,patch: TaskSourcePatch,-) -> Result<RpcOutcome<TaskSource>, String> {+) -> Result<Outcome<TaskSource>, String> {let source = store::update_source(config, id, patch).map_err(|e| e.to_string())?;tracing::debug!(source_id = %id, "[task_sources:ops] update applied");- Ok(RpcOutcome::new(source, vec![]))+ Ok(Outcome::new(source, vec![]))}/// Remove a source by id.-pub async fn remove(config: &Config, id: &str) -> Result<RpcOutcome<Value>, String> {+pub async fn remove(config: &Config, id: &str) -> Result<Outcome<Value>, String> {let ingested = store::list_ingested_refs(config, id).map_err(|e| e.to_string())?;let mut pruned = 0usize;for item in ingested {@@ -92,21 +92,21 @@ pub async fn remove(config: &Config, id: &str) -> Result<RpcOutcome<Value>, Stri}store::remove_source(config, id).map_err(|e| e.to_string())?;tracing::debug!(source_id = %id, pruned, "[task_sources:ops] removed");- Ok(RpcOutcome::new(+ Ok(Outcome::new(json!({ "id": id, "removed": true, "pruned": pruned }),vec![],))}/// Manually fetch one source now (`FetchReason::Manual`).-pub async fn fetch(config: &Config, id: &str) -> Result<RpcOutcome<super::FetchOutcome>, String> {+pub async fn fetch(config: &Config, id: &str) -> Result<Outcome<super::FetchOutcome>, String> {let source = store::get_source(config, id).map_err(|e| e.to_string())?;let outcome = pipeline::run_source_once(config, &source, FetchReason::Manual).await;- Ok(RpcOutcome::new(outcome, vec![]))+ Ok(Outcome::new(outcome, vec![]))}/// Manually sync all enabled task sources now.-pub async fn sync(config: &Config) -> Result<RpcOutcome<Vec<super::FetchOutcome>>, String> {+pub async fn sync(config: &Config) -> Result<Outcome<Vec<super::FetchOutcome>>, String> {let sources = store::list_sources(config).map_err(|e| e.to_string())?;let mut outcomes = Vec::new();for source in sources.into_iter().filter(|source| source.enabled) {@@ -122,7 +122,7 @@ pub async fn sync(config: &Config) -> Result<RpcOutcome<Vec<super::FetchOutcome>pruned = outcomes.iter().map(|outcome| outcome.pruned).sum::<usize>(),"[task_sources:ops] sync completed");- Ok(RpcOutcome::new(outcomes, vec![]))+ Ok(Outcome::new(outcomes, vec![]))}/// Recently ingested tasks for a source (newest first).@@ -130,10 +130,10 @@ pub async fn list_tasks(config: &Config,id: &str,limit: Option<usize>,-) -> Result<RpcOutcome<Vec<NormalizedTask>>, String> {+) -> Result<Outcome<Vec<NormalizedTask>>, String> {let limit = limit.unwrap_or(50);let tasks = store::list_ingested(config, id, limit).map_err(|e| e.to_string())?;- Ok(RpcOutcome::new(tasks, vec![]))+ Ok(Outcome::new(tasks, vec![]))}/// Dry-run a filter: fetch matching tasks WITHOUT routing or recording@@ -144,7 +144,7 @@ pub async fn preview_filter(filter_spec: FilterSpec,connection_id: Option<String>,max: Option<u32>,-) -> Result<RpcOutcome<Vec<NormalizedTask>>, String> {+) -> Result<Outcome<Vec<NormalizedTask>>, String> {if filter_spec.provider() != provider {return Err(format!("filter provider '{}' does not match requested provider '{}'",@@ -172,7 +172,7 @@ pub async fn list_databases(config: &Config,provider: ProviderSlug,connection_id: Option<String>,-) -> Result<RpcOutcome<Vec<TaskContainer>>, String> {+) -> Result<Outcome<Vec<TaskContainer>>, String> {let _ = (config, connection_id);// `ComposioProvider::list_databases` has no replacement — see// `pipeline::fetch_tasks_unavailable`'s doc comment for why.@@ -185,10 +185,10 @@ pub async fn list_databases(}/// Domain status: enabled flag + source counts.-pub async fn status(config: &Config) -> Result<RpcOutcome<Value>, String> {+pub async fn status(config: &Config) -> Result<Outcome<Value>, String> {let sources = store::list_sources(config).map_err(|e| e.to_string())?;let enabled_count = sources.iter().filter(|s| s.enabled).count();- Ok(RpcOutcome::new(+ Ok(Outcome::new(json!({"enabled": config.task_sources.enabled,"defaultIntervalSecs": config.task_sources.default_interval_secs,diff --git a/crates/openhuman-core/src/integrations/task_sources/schemas.rs b/crates/openhuman-core/src/integrations/task_sources/schemas.rsindex 0d18913399..bb36f859de 100644--- a/crates/openhuman-core/src/integrations/task_sources/schemas.rs+++ b/crates/openhuman-core/src/integrations/task_sources/schemas.rs@@ -10,7 +10,7 @@ use serde_json::{Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::util::{read_optional, read_required};use super::ops;@@ -541,7 +541,7 @@ fn read_optional_u32(params: &Map<String, Value>, key: &str) -> Result<Option<u3}}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/integrations/task_sources/tools.rs b/crates/openhuman-core/src/integrations/task_sources/tools.rsindex aedc05be98..36b8ea4805 100644--- a/crates/openhuman-core/src/integrations/task_sources/tools.rs+++ b/crates/openhuman-core/src/integrations/task_sources/tools.rs@@ -4,7 +4,7 @@//! / Linear / ClickUp issue & task feeds), trigger an on-demand fetch, list//! ingested tasks, and dry-run a filter. Each tool is a thin shim over the//! async functions in [`crate::integrations::task_sources::ops`], which return-//! `RpcOutcome<T>`; the wrapper emits the inner value as JSON.+//! `Outcome<T>`; the wrapper emits the inner value as JSON.//!//! The read/observe tools (`list` / `get` / `fetch` / `list_tasks` ///! `preview_filter` / `status`) are default-enabled. The persistent-configdiff --git a/crates/openhuman-core/src/lib.rs b/crates/openhuman-core/src/lib.rsindex 4067a695eb..cc64a79642 100644--- a/crates/openhuman-core/src/lib.rs+++ b/crates/openhuman-core/src/lib.rs@@ -25,7 +25,7 @@//! structure") for the preferred per-domain module shape.//!//! `pub use openhuman_rpc as rpc;` re-exports the `openhuman-rpc` crate, so-//! `crate::rpc::{RpcOutcome, StructuredRpcError, ...}` are the same types the+//! `crate::rpc::{Outcome, StructuredRpcError, ...}` are the same types the//! app and TUI decode responses with — there is no separate RPC contract//! layer in this crate.//!diff --git a/crates/openhuman-core/src/mcp/audit/README.md b/crates/openhuman-core/src/mcp/audit/README.mdindex 10aea0868f..b71451bcb7 100644--- a/crates/openhuman-core/src/mcp/audit/README.md+++ b/crates/openhuman-core/src/mcp/audit/README.md@@ -52,7 +52,7 @@ appears never to have happened, rather than erroring.- `crate::core::all` (`RegisteredController`, `ControllerFuture`) and`crate::core` (`ControllerSchema`, `FieldSchema`, `TypeSchema`) — thecontroller registration types. Unlike the other RPC domains the handler- returns a raw `{ "records": [...] }` object, not an `RpcOutcome`.+ returns a raw `{ "records": [...] }` object, not an `Outcome`.## Used bydiff --git a/crates/openhuman-core/src/mcp/registry/config_ops.rs b/crates/openhuman-core/src/mcp/registry/config_ops.rsindex 8714226bec..ce0b9e6a72 100644--- a/crates/openhuman-core/src/mcp/registry/config_ops.rs+++ b/crates/openhuman-core/src/mcp/registry/config_ops.rs@@ -11,7 +11,7 @@ use serde_json::{json, Value};use crate::config::Config;use crate::core::bus::BUS;use crate::core::events::DomainEvent;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::config_doc;use super::helpers::resolve;@@ -22,7 +22,7 @@ use super::helpers::resolve;////// Credential *names* ride along as `envKeys`; values never do. See/// [`super::config_doc`] for the contract.-pub async fn mcp_clients_config_get(config: &Config) -> Result<RpcOutcome<Value>, String> {+pub async fn mcp_clients_config_get(config: &Config) -> Result<Outcome<Value>, String> {let service = resolve(config)?;let installed = service.dynamic()@@ -33,7 +33,7 @@ pub async fn mcp_clients_config_get(config: &Config) -> Result<RpcOutcome<Value>let count = installed.len();let doc = config_doc::render(&installed, &stored_keys);- Ok(RpcOutcome::new(+ Ok(Outcome::new(doc,vec![format!("config_get rendered {count} servers")],))@@ -53,7 +53,7 @@ pub async fn mcp_clients_config_get(config: &Config) -> Result<RpcOutcome<Value>pub async fn mcp_clients_config_set(config: &Config,doc: Value,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let declared = config_doc::parse(&doc)?;// Keys are trimmed on the way in, so two spellings of one name can collide@@ -239,7 +239,7 @@ pub async fn mcp_clients_config_set(object.insert("removed".into(), json!(removed));}- Ok(RpcOutcome::new(rendered, vec![note]))+ Ok(Outcome::new(rendered, vec![note]))}/// The credential *names* stored for each server, keyed by `server_id`.diff --git a/crates/openhuman-core/src/mcp/registry/helpers.rs b/crates/openhuman-core/src/mcp/registry/helpers.rsindex 77ee5f9b0c..9ae9819dde 100644--- a/crates/openhuman-core/src/mcp/registry/helpers.rs+++ b/crates/openhuman-core/src/mcp/registry/helpers.rs@@ -10,7 +10,7 @@ use serde_json::{json, Value};use crate::config::Config;use crate::mcp::host;-/// Renders a value into the `RpcOutcome` payload the frontend expects.+/// Renders a value into the `Outcome` payload the frontend expects.pub(crate) fn encode<T: serde::Serialize>(value: &T) -> Result<Value, String> {serde_json::to_value(value).map_err(|error| format!("serialization error: {error}"))}diff --git a/crates/openhuman-core/src/mcp/registry/ops.rs b/crates/openhuman-core/src/mcp/registry/ops.rsindex 3c7f8e30cd..2aa45d620e 100644--- a/crates/openhuman-core/src/mcp/registry/ops.rs+++ b/crates/openhuman-core/src/mcp/registry/ops.rs@@ -30,7 +30,7 @@ use crate::config::Config;use crate::core::bus::BUS;use crate::core::events::DomainEvent;use crate::mcp::host;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::helpers::{encode, inject_required_env_keys, require, resolve};@@ -46,7 +46,7 @@ pub async fn mcp_clients_registry_search(_transport: Option<String>,page: Option<u32>,page_size: Option<u32>,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let page = page.unwrap_or(1);let page_size = page_size.unwrap_or(20);@@ -62,7 +62,7 @@ pub async fn mcp_clients_registry_search(tinymcp::registry::curation::float_official_first(&mut found.servers);let count = found.servers.len();- Ok(RpcOutcome::new(+ Ok(Outcome::new(json!({"servers": found.servers,"page": found.page,@@ -77,7 +77,7 @@ pub async fn mcp_clients_registry_search(pub async fn mcp_clients_registry_get(config: &Config,qualified_name: String,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let qualified_name = require(&qualified_name, "qualified_name")?;let (detail, required_env_keys) = resolve(config)?@@ -91,7 +91,7 @@ pub async fn mcp_clients_registry_get(let mut server = encode(&detail)?;inject_required_env_keys(&mut server, &required_env_keys);- Ok(RpcOutcome::new(+ Ok(Outcome::new(json!({ "server": server }),vec![format!("registry_get ok: {qualified_name} env_keys={}",@@ -102,14 +102,14 @@ pub async fn mcp_clients_registry_get(// ── installed_list ───────────────────────────────────────────────────────────-pub async fn mcp_clients_installed_list(config: &Config) -> Result<RpcOutcome<Value>, String> {+pub async fn mcp_clients_installed_list(config: &Config) -> Result<Outcome<Value>, String> {let installed = resolve(config)?.dynamic().installed_list().map_err(|error| error.to_string())?;let count = installed.len();- Ok(RpcOutcome::new(+ Ok(Outcome::new(json!({ "installed": installed }),vec![format!("installed_list returned {count} servers")],))@@ -120,7 +120,7 @@ pub async fn mcp_clients_installed_list(config: &Config) -> Result<RpcOutcome<Vapub async fn mcp_clients_uninstall(config: &Config,server_id: String,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let server_id = require(&server_id, "server_id")?;let removed = resolve(config)?@@ -129,7 +129,7 @@ pub async fn mcp_clients_uninstall(.await.map_err(|error| error.to_string())?;- Ok(RpcOutcome::new(+ Ok(Outcome::new(json!({ "server_id": server_id, "removed": removed }),vec![format!("uninstalled server_id={server_id}")],))@@ -140,7 +140,7 @@ pub async fn mcp_clients_uninstall(pub async fn mcp_clients_detect_auth(config: &Config,server_id: String,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let server_id = require(&server_id, "server_id")?;let detection = resolve(config)?@@ -152,7 +152,7 @@ pub async fn mcp_clients_detect_auth(let kind = detection.kind.as_str();let value = encode(&detection)?;- Ok(RpcOutcome::new(+ Ok(Outcome::new(value,vec![format!("detect_auth {server_id} -> {kind}")],))@@ -161,7 +161,7 @@ pub async fn mcp_clients_detect_auth(pub async fn mcp_clients_oauth_begin(config: &Config,server_id: String,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let server_id = require(&server_id, "server_id")?;let authorize_url = resolve(config)?@@ -170,7 +170,7 @@ pub async fn mcp_clients_oauth_begin(.await.map_err(|error| error.to_string())?;- Ok(RpcOutcome::new(+ Ok(Outcome::new(json!({ "authorize_url": authorize_url }),vec![format!("oauth_begin {server_id}")],))@@ -181,7 +181,7 @@ pub async fn mcp_clients_oauth_begin(pub async fn mcp_clients_connect(config: &Config,server_id: String,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let server_id = require(&server_id, "server_id")?;let outcome = resolve(config)?@@ -198,7 +198,7 @@ pub async fn mcp_clients_connect(tool_count,});- Ok(RpcOutcome::new(+ Ok(Outcome::new(json!({ "server_id": server_id, "status": "connected", "tools": tools }),vec![format!("connected server_id={server_id} tools={tool_count}"@@ -212,7 +212,7 @@ pub async fn mcp_clients_set_enabled(config: &Config,server_id: String,enabled: bool,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let server_id = require(&server_id, "server_id")?;resolve(config)?@@ -228,7 +228,7 @@ pub async fn mcp_clients_set_enabled(});}- Ok(RpcOutcome::new(+ Ok(Outcome::new(json!({ "server_id": server_id, "enabled": enabled }),vec![format!("set_enabled server_id={server_id} enabled={enabled}"@@ -241,7 +241,7 @@ pub async fn mcp_clients_set_enabled(pub async fn mcp_clients_disconnect(config: &Config,server_id: String,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let server_id = require(&server_id, "server_id")?;resolve(config)?@@ -255,7 +255,7 @@ pub async fn mcp_clients_disconnect(reason: None,});- Ok(RpcOutcome::new(+ Ok(Outcome::new(json!({ "server_id": server_id, "status": "disconnected" }),vec![format!("disconnected server_id={server_id}")],))@@ -267,7 +267,7 @@ pub async fn mcp_clients_update_env(config: &Config,server_id: String,env: HashMap<String, String>,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {use tinymcp_bus::UpdateEnvStatus;let server_id = require(&server_id, "server_id")?;@@ -288,7 +288,7 @@ pub async fn mcp_clients_update_env(tool_count,});- Ok(RpcOutcome::new(+ Ok(Outcome::new(json!({"server_id": server_id,"status": "connected",@@ -300,7 +300,7 @@ pub async fn mcp_clients_update_env()],))}- UpdateEnvStatus::Disabled => Ok(RpcOutcome::new(+ UpdateEnvStatus::Disabled => Ok(Outcome::new(json!({"server_id": server_id,"status": "disabled",@@ -315,7 +315,7 @@ pub async fn mcp_clients_update_env(// metadata URL, and the frontend renders localized copy from the// code alone.let hint = outcome.auth_hint.map(|hint| hint.as_code()).unwrap_or_default();- Ok(RpcOutcome::new(+ Ok(Outcome::new(json!({"server_id": server_id,"status": "unauthorized",@@ -329,7 +329,7 @@ pub async fn mcp_clients_update_env(}_ => {let error = outcome.error.unwrap_or_default();- Ok(RpcOutcome::new(+ Ok(Outcome::new(json!({"server_id": server_id,"status": "disconnected",@@ -348,10 +348,10 @@ pub async fn mcp_clients_update_env(pub async fn mcp_clients_registry_settings_get(config: &Config,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let settings = resolve(config)?.dynamic().registry_settings();- Ok(RpcOutcome::new(+ Ok(Outcome::new(encode(&settings)?,vec!["registry_settings_get".to_string()],))@@ -366,7 +366,7 @@ pub async fn mcp_clients_registry_settings_set(smithery_api_key: Option<String>,mcp_official_base: Option<String>,mcp_official_token: Option<String>,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {/// A blank update clears the field; an absent one leaves it.fn apply(field: &mut Option<String>, update: Option<String>) {if let Some(value) = update {@@ -388,7 +388,7 @@ pub async fn mcp_clients_registry_settings_set(mcp_official_token,);- Ok(RpcOutcome::new(+ Ok(Outcome::new(encode(&settings)?,vec!["registry_settings_set saved".to_string()],))@@ -396,7 +396,7 @@ pub async fn mcp_clients_registry_settings_set(// ── status ───────────────────────────────────────────────────────────────────-pub async fn mcp_clients_status(config: &Config) -> Result<RpcOutcome<Value>, String> {+pub async fn mcp_clients_status(config: &Config) -> Result<Outcome<Value>, String> {let statuses = resolve(config)?.dynamic().status()@@ -404,7 +404,7 @@ pub async fn mcp_clients_status(config: &Config) -> Result<RpcOutcome<Value>, St.map_err(|error| error.to_string())?;let count = statuses.len();- Ok(RpcOutcome::new(+ Ok(Outcome::new(json!({ "servers": statuses }),vec![format!("status returned {count} servers")],))@@ -415,7 +415,7 @@ pub async fn mcp_clients_status(config: &Config) -> Result<RpcOutcome<Value>, Stpub async fn mcp_clients_list_tools(config: &Config,server_id: String,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let server_id = require(&server_id, "server_id")?;/// What a caller has to do about it either way.@@ -435,7 +435,7 @@ pub async fn mcp_clients_list_tools(let tools = super::tools_safe_for_agent(&server_id, tools);let count = tools.len();- Ok(RpcOutcome::new(+ Ok(Outcome::new(json!({ "server_id": server_id, "tools": tools }),vec![format!("list_tools server_id={server_id} returned {count} tools"@@ -450,7 +450,7 @@ pub async fn mcp_clients_tool_call(server_id: String,tool_name: String,arguments: Value,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let server_id = require(&server_id, "server_id")?;let tool_name = require(&tool_name, "tool_name")?;@@ -469,13 +469,13 @@ pub async fn mcp_clients_tool_call(});match result {- Ok(outcome) => Ok(RpcOutcome::new(+ Ok(outcome) => Ok(Outcome::new(json!({ "result": outcome.result, "is_error": outcome.is_error }),vec![format!("tool_call ok server_id={server_id} tool={tool_name} elapsed_ms={elapsed_ms}")],)),- Err(error) => Ok(RpcOutcome::new(+ Err(error) => Ok(Outcome::new(json!({ "result": error.to_string(), "is_error": true }),vec![format!("tool_call error server_id={server_id} tool={tool_name}: {error}"diff --git a/crates/openhuman-core/src/mcp/registry/schemas/params.rs b/crates/openhuman-core/src/mcp/registry/schemas/params.rsindex 57b9024a6d..ea3e9f6737 100644--- a/crates/openhuman-core/src/mcp/registry/schemas/params.rs+++ b/crates/openhuman-core/src/mcp/registry/schemas/params.rs@@ -3,7 +3,7 @@use serde_json::{Map, Value};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub(super) use crate::util::{read_optional, read_required};// ── Param helpers ─────────────────────────────────────────────────────────────@@ -33,7 +33,7 @@ pub(super) fn read_optional_u32(}}-pub(super) fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+pub(super) fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {serde_json::to_value(outcome.value).map_err(|e| e.to_string())}diff --git a/crates/openhuman-core/src/memory/README.md b/crates/openhuman-core/src/memory/README.mdindex 3b6b8245e9..ea3ba1b6dd 100644--- a/crates/openhuman-core/src/memory/README.md+++ b/crates/openhuman-core/src/memory/README.md@@ -96,7 +96,7 @@ Agent tools are re-exported into the crate-wide tool surface byEach (bar `conversations/`, which is a host-owned store) is the RPC surfacefor a family the *driver* serves: the handler and schema modules that name-`RpcOutcome` and `ControllerSchema`, resolving through the bound provider+`Outcome` and `ControllerSchema`, resolving through the bound providerrather than through a linked engine. Before the engine left, each was a thinwrapper over `pub use tinymemory_core::<domain>::*;` as well.diff --git a/crates/openhuman-core/src/memory/goals/ops.rs b/crates/openhuman-core/src/memory/goals/ops.rsindex 9048df73fa..c78f13855a 100644--- a/crates/openhuman-core/src/memory/goals/ops.rs+++ b/crates/openhuman-core/src/memory/goals/ops.rs@@ -1,6 +1,6 @@//! Business logic for the goals domain — thin handlers over the driver's//! goals family, plus the on-demand reflection entry point. Every function-//! returns an [`RpcOutcome`] so the RPC layer (and CLI) get a uniform shape+//! returns an [`Outcome`] so the RPC layer (and CLI) get a uniform shape//! with logs.//!//! # These take the driver's goals family, not a workspace path (#5560)@@ -56,7 +56,7 @@ use serde::Serialize;use crate::config::Config;use crate::memory::api::goals::GoalsDoc;use crate::memory::api::provider::MemoryGoals;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::doc;@@ -88,10 +88,10 @@ async fn read(goals: &dyn MemoryGoals, op: &str) -> Result<GoalsDoc, String> {}/// List the current goals.-pub async fn list(goals: &dyn MemoryGoals) -> Result<RpcOutcome<GoalsDoc>, String> {+pub async fn list(goals: &dyn MemoryGoals) -> Result<Outcome<GoalsDoc>, String> {log::debug!("[memory_goals] rpc=list");let doc = read(goals, "list").await?;- Ok(RpcOutcome::new(doc, vec![]))+ Ok(Outcome::new(doc, vec![]))}/// Add a goal and return the new id + updated list.@@ -100,7 +100,7 @@ pub async fn list(goals: &dyn MemoryGoals) -> Result<RpcOutcome<GoalsDoc>, Strin/// items and the new goal is the newest, so the read-back always contains it/// unless that one goal alone exceeds the whole-file byte cap — which is the/// same edge the engine's `add` had.-pub async fn add(goals: &dyn MemoryGoals, text: &str) -> Result<RpcOutcome<AddResult>, String> {+pub async fn add(goals: &dyn MemoryGoals, text: &str) -> Result<Outcome<AddResult>, String> {log::debug!("[memory_goals] rpc=add");let _guard = doc::mutation_lock().lock().await;let mut document = read(goals, "add").await?;@@ -110,7 +110,7 @@ pub async fn add(goals: &dyn MemoryGoals, text: &str) -> Result<RpcOutcome<AddRe.await.map_err(|e| format!("add: {e}"))?;let goals = read(goals, "add").await?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(AddResult {id: id.clone(),goals,@@ -124,7 +124,7 @@ pub async fn edit(goals: &dyn MemoryGoals,id: &str,text: &str,-) -> Result<RpcOutcome<GoalsDoc>, String> {+) -> Result<Outcome<GoalsDoc>, String> {log::debug!("[memory_goals] rpc=edit id={id}");let _guard = doc::mutation_lock().lock().await;let mut document = read(goals, "edit").await?;@@ -134,11 +134,11 @@ pub async fn edit(.await.map_err(|e| format!("edit: {e}"))?;let updated = read(goals, "edit").await?;- Ok(RpcOutcome::single_log(updated, format!("edited goal {id}")))+ Ok(Outcome::single_log(updated, format!("edited goal {id}")))}/// Delete a goal and return the updated list.-pub async fn delete(goals: &dyn MemoryGoals, id: &str) -> Result<RpcOutcome<GoalsDoc>, String> {+pub async fn delete(goals: &dyn MemoryGoals, id: &str) -> Result<Outcome<GoalsDoc>, String> {log::debug!("[memory_goals] rpc=delete id={id}");let _guard = doc::mutation_lock().lock().await;let mut document = read(goals, "delete").await?;@@ -148,7 +148,7 @@ pub async fn delete(goals: &dyn MemoryGoals, id: &str) -> Result<RpcOutcome<Goal.await.map_err(|e| format!("delete: {e}"))?;let updated = read(goals, "delete").await?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(updated,format!("deleted goal {id}"),))@@ -168,7 +168,7 @@ pub async fn reflect_now(config: &Config,goals: &dyn MemoryGoals,context: Option<String>,-) -> Result<RpcOutcome<ReflectResult>, String> {+) -> Result<Outcome<ReflectResult>, String> {log::info!("[memory_goals] rpc=reflect — running goals agent on demand");let workspace_dir = config.workspace_dir.clone();let default_nudge = "Review the user's long-term goals against recent memory and the \@@ -188,7 +188,7 @@ pub async fn reflect_now(// reading the list back should not replace that report with a// different one.let goals = goals.goals().await.unwrap_or_default();- return Ok(RpcOutcome::single_log(+ return Ok(Outcome::single_log(ReflectResult {ran: false,summary: format!("enrichment failed: {e}"),@@ -200,7 +200,7 @@ pub async fn reflect_now(};let goals = goals.goals().await.unwrap_or_default();- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(ReflectResult {ran: true,summary,diff --git a/crates/openhuman-core/src/memory/goals/schemas.rs b/crates/openhuman-core/src/memory/goals/schemas.rsindex bedc1b718d..5599f0b1cd 100644--- a/crates/openhuman-core/src/memory/goals/schemas.rs+++ b/crates/openhuman-core/src/memory/goals/schemas.rs@@ -3,7 +3,7 @@//! Methods are exposed as `openhuman.memory_goals_<function>`://! `list`, `add`, `edit`, `delete`, `reflect`. Handlers resolve the guarded//! goals family for the dispatch, delegate to [`super::ops`], and serialise the-//! [`RpcOutcome`] into the CLI-compatible JSON shape.+//! [`Outcome`] into the CLI-compatible JSON shape.//!//! The wire shape is a published compatibility surface and does not change//! here: `memory_goals.*` still answers with the same `GoalsDoc` /@@ -21,7 +21,7 @@ use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};use crate::memory::api::provider::MemoryProvider;use crate::memory::ops::guard::active_memory_guard;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// All `memory_goals` controller schemas (advertised to CLI + RPC consumers).pub fn all_memory_goals_controller_schemas() -> Vec<ControllerSchema> {@@ -254,7 +254,7 @@ fn parse_value<T: DeserializeOwned>(v: Value) -> Result<T, String> {serde_json::from_value(v).map_err(|e| format!("invalid params: {e}"))}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/memory/mod.rs b/crates/openhuman-core/src/memory/mod.rsindex ce8a5994cd..19fc50804f 100644--- a/crates/openhuman-core/src/memory/mod.rs+++ b/crates/openhuman-core/src/memory/mod.rs@@ -75,7 +75,7 @@ pub mod tools;// Domains that are *mostly* extracted but keep their JSON-RPC surface here.// Each of these started as a thin wrapper: `pub use tinymemory_core::-// <domain>::*;` plus the handler/schema modules that name `RpcOutcome` and+// <domain>::*;` plus the handler/schema modules that name `Outcome` and// `ControllerSchema`. The globs are being deleted as their production// consumers drain — `tree`, `tree::health` and `tree::tree` no longer carry// one (#5560) — so see the module docs on each for where its split stands.diff --git a/crates/openhuman-core/src/memory/ops/README.md b/crates/openhuman-core/src/memory/ops/README.mdindex 211a4aa73f..824a9b0a4f 100644--- a/crates/openhuman-core/src/memory/ops/README.md+++ b/crates/openhuman-core/src/memory/ops/README.md@@ -1,7 +1,7 @@# ops-RPC handlers for the memory system — each returns `RpcOutcome<T>`-(`crate::rpc::RpcOutcome`, `openhuman_rpc::RpcOutcome` re-exported through+RPC handlers for the memory system — each returns `Outcome<T>`+(`crate::rpc::Outcome`, `openhuman_rpc::Outcome` re-exported through`pub use openhuman_rpc as rpc;` in `crates/openhuman-core/src/lib.rs`).`memory::ops` is re-exported flat from `crate::memory::mod` (`pub useops::*;`), and `memory::rpc` is an alias of this module (`pub use ops asdiff --git a/crates/openhuman-core/src/memory/ops/documents.rs b/crates/openhuman-core/src/memory/ops/documents.rsindex 4bc0b65ff0..19ebdb39b7 100644--- a/crates/openhuman-core/src/memory/ops/documents.rs+++ b/crates/openhuman-core/src/memory/ops/documents.rs@@ -15,7 +15,7 @@ use crate::memory::{QueryNamespaceResponse, RecallContextRequest, RecallContextResponse, RecallMemoriesRequest,RecallMemoriesResponse,};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::envelope::{envelope, error_envelope, memory_counts};use super::guard::active_memory_guard;@@ -163,7 +163,7 @@ pub struct PutDocResult {// ---------------------------------------------------------------------------/// Lists all namespaces in the memory system.-pub async fn namespace_list() -> Result<RpcOutcome<Vec<String>>, String> {+pub async fn namespace_list() -> Result<Outcome<Vec<String>>, String> {let guard = active_memory_guard().await?;let documents = guard.as_documents()@@ -172,7 +172,7 @@ pub async fn namespace_list() -> Result<RpcOutcome<Vec<String>>, String> {.list_namespaces().await.map_err(|error| error.to_string())?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(namespaces,"memory namespaces listed",))@@ -193,7 +193,7 @@ pub async fn namespace_list() -> Result<RpcOutcome<Vec<String>>, String> {/// is a monotone raise over that value — it can promote this write to/// `ExternalSync` when the turn runs under a source scope, but it can never/// launder an `ExternalSync` caller down to `Internal`.-pub async fn doc_put(params: PutDocParams) -> Result<RpcOutcome<PutDocResult>, String> {+pub async fn doc_put(params: PutDocParams) -> Result<Outcome<PutDocResult>, String> {let guard = active_memory_guard().await?;let documents = guard.as_documents()@@ -218,7 +218,7 @@ pub async fn doc_put(params: PutDocParams) -> Result<RpcOutcome<PutDocResult>, S}).await.map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(PutDocResult { document_id },"memory document upserted",))@@ -227,7 +227,7 @@ pub async fn doc_put(params: PutDocParams) -> Result<RpcOutcome<PutDocResult>, S/// Ingests a document, performing chunking and embedding.pub async fn doc_ingest(params: IngestDocParams,-) -> Result<RpcOutcome<MemoryIngestionResult>, String> {+) -> Result<Outcome<MemoryIngestionResult>, String> {let guard = active_memory_guard().await?;let documents = guard.as_documents()@@ -274,13 +274,13 @@ pub async fn doc_ingest("ingested document — {} entities, {} relations, {} chunks",result.entity_count, result.relation_count, result.chunk_count,);- Ok(RpcOutcome::single_log(result, &msg))+ Ok(Outcome::single_log(result, &msg))}/// Lists documents, optionally filtered by namespace.pub async fn doc_list(params: Option<NamespaceOnlyParams>,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let guard = active_memory_guard().await?;let documents = guard.as_documents()@@ -289,11 +289,11 @@ pub async fn doc_list(.list_documents(params.as_ref().map(|value| value.namespace.as_str())).await.map_err(|error| error.to_string())?;- Ok(RpcOutcome::single_log(docs, "memory documents listed"))+ Ok(Outcome::single_log(docs, "memory documents listed"))}/// Deletes a document from a namespace.-pub async fn doc_delete(params: DeleteDocParams) -> Result<RpcOutcome<serde_json::Value>, String> {+pub async fn doc_delete(params: DeleteDocParams) -> Result<Outcome<serde_json::Value>, String> {let guard = active_memory_guard().await?;let documents = guard.as_documents()@@ -302,13 +302,13 @@ pub async fn doc_delete(params: DeleteDocParams) -> Result<RpcOutcome<serde_json.delete_document(¶ms.namespace, ¶ms.document_id).await.map_err(|error| error.to_string())?;- Ok(RpcOutcome::single_log(result, "memory document deleted"))+ Ok(Outcome::single_log(result, "memory document deleted"))}/// Clears all data within a namespace.pub async fn clear_namespace(params: ClearNamespaceParams,-) -> Result<RpcOutcome<ClearNamespaceResult>, String> {+) -> Result<Outcome<ClearNamespaceResult>, String> {let guard = active_memory_guard().await?;let documents = guard.as_documents()@@ -319,7 +319,7 @@ pub async fn clear_namespace(.await.map_err(|error| error.to_string())?;let msg = "memory namespace cleared".to_string();- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(ClearNamespaceResult {cleared: true,namespace: params.namespace,@@ -329,7 +329,7 @@ pub async fn clear_namespace(}/// Queries a namespace for contextual information based on a natural language string.-pub async fn context_query(params: QueryNamespaceParams) -> Result<RpcOutcome<String>, String> {+pub async fn context_query(params: QueryNamespaceParams) -> Result<Outcome<String>, String> {let guard = active_memory_guard().await?;let documents = guard.as_documents()@@ -342,7 +342,7 @@ pub async fn context_query(params: QueryNamespaceParams) -> Result<RpcOutcome<St).await.map_err(|error| error.to_string())?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(result.context_text,"memory context queried",))@@ -351,7 +351,7 @@ pub async fn context_query(params: QueryNamespaceParams) -> Result<RpcOutcome<St/// Recalls contextual information from a namespace without a specific query.pub async fn context_recall(params: RecallNamespaceParams,-) -> Result<RpcOutcome<Option<String>>, String> {+) -> Result<Outcome<Option<String>>, String> {let guard = active_memory_guard().await?;let documents = guard.as_documents()@@ -361,7 +361,7 @@ pub async fn context_recall(.await.map_err(|error| error.to_string())?;let context = (!result.context_text.is_empty()).then_some(result.context_text);- Ok(RpcOutcome::single_log(context, "memory context recalled"))+ Ok(Outcome::single_log(context, "memory context recalled"))}// ---------------------------------------------------------------------------@@ -389,7 +389,7 @@ pub async fn context_recall(/// either.pub async fn memory_init(request: MemoryInitRequest,-) -> Result<RpcOutcome<ApiEnvelope<MemoryInitResponse>>, String> {+) -> Result<Outcome<ApiEnvelope<MemoryInitResponse>>, String> {let _ = request.jwt_token; // accepted but unused — memory is local-onlylet workspace_dir = current_workspace_dir().await?;// Resolve (and thereby warm) the guarded driver for this workspace — the@@ -416,7 +416,7 @@ pub async fn memory_init(/// Lists documents stored in memory, optionally filtered by namespace.pub async fn memory_list_documents(request: ListDocumentsRequest,-) -> Result<RpcOutcome<ApiEnvelope<ListDocumentsResponse>>, String> {+) -> Result<Outcome<ApiEnvelope<ListDocumentsResponse>>, String> {let guard = active_memory_guard().await?;let documents = guard.as_documents()@@ -456,7 +456,7 @@ pub struct NamespaceSummariesResponse {/// sync needs the count — a Gmail source that stored 1,120 documents should/// be checkable as exactly that number (#5932 field finding).pub async fn memory_namespace_summaries(-) -> Result<crate::rpc::RpcOutcome<NamespaceSummariesResponse>, String> {+) -> Result<crate::core::Outcome<NamespaceSummariesResponse>, String> {use crate::memory::api::provider::MemoryCore;let guard = active_memory_guard().await?;let namespaces = guard@@ -464,7 +464,7 @@ pub async fn memory_namespace_summaries(.await.map_err(|error| error.to_string())?;let total_documents = namespaces.iter().map(|n| n.count as u64).sum();- Ok(crate::rpc::RpcOutcome::new(+ Ok(crate::core::Outcome::new(NamespaceSummariesResponse {namespaces,total_documents,@@ -476,7 +476,7 @@ pub async fn memory_namespace_summaries(/// Lists all namespaces that contain memory documents.pub async fn memory_list_namespaces(_request: EmptyRequest,-) -> Result<RpcOutcome<ApiEnvelope<ListNamespacesResponse>>, String> {+) -> Result<Outcome<ApiEnvelope<ListNamespacesResponse>>, String> {let guard = active_memory_guard().await?;let documents = guard.as_documents()@@ -496,7 +496,7 @@ pub async fn memory_list_namespaces(/// Deletes a specific document from a namespace.pub async fn memory_delete_document(request: DeleteDocumentRequest,-) -> Result<RpcOutcome<ApiEnvelope<DeleteDocumentResponse>>, String> {+) -> Result<Outcome<ApiEnvelope<DeleteDocumentResponse>>, String> {let guard = active_memory_guard().await?;let documents = guard.as_documents()@@ -526,7 +526,7 @@ pub async fn memory_delete_document(/// Performs a semantic query against a namespace, returning a retrieval context.pub async fn memory_query_namespace(request: QueryNamespaceRequest,-) -> Result<RpcOutcome<ApiEnvelope<QueryNamespaceResponse>>, String> {+) -> Result<Outcome<ApiEnvelope<QueryNamespaceResponse>>, String> {let include_references = request.include_references.unwrap_or(true);let requested_limit = request.resolved_limit() as usize;let result = async {@@ -605,7 +605,7 @@ pub async fn memory_query_namespace(/// Recalls contextual data from a namespace without a specific query.pub async fn memory_recall_context(request: RecallContextRequest,-) -> Result<RpcOutcome<ApiEnvelope<RecallContextResponse>>, String> {+) -> Result<Outcome<ApiEnvelope<RecallContextResponse>>, String> {let include_references = request.include_references.unwrap_or(true);// The recency path, through the contract. `recall_namespace_recent` exists// for exactly this pair of handlers — `recall_namespace_scored("")` is NOT@@ -649,7 +649,7 @@ pub async fn memory_recall_context(/// Recalls memory items from a namespace with optional retention filtering.pub async fn memory_recall_memories(request: RecallMemoriesRequest,-) -> Result<RpcOutcome<ApiEnvelope<RecallMemoriesResponse>>, String> {+) -> Result<Outcome<ApiEnvelope<RecallMemoriesResponse>>, String> {let result = async {let guard = active_memory_guard().await?;guarddiff --git a/crates/openhuman-core/src/memory/ops/envelope.rs b/crates/openhuman-core/src/memory/ops/envelope.rsindex b975ac7b38..4054da0f64 100644--- a/crates/openhuman-core/src/memory/ops/envelope.rs+++ b/crates/openhuman-core/src/memory/ops/envelope.rs@@ -9,7 +9,7 @@ use std::collections::BTreeMap;use serde::Serialize;use crate::memory::{ApiEnvelope, ApiError, ApiMeta, PaginationMeta};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// Generates a unique request ID for memory operations.///@@ -37,8 +37,8 @@ pub(crate) fn envelope<T: Serialize>(data: T,counts: Option<BTreeMap<String, usize>>,pagination: Option<PaginationMeta>,-) -> RpcOutcome<ApiEnvelope<T>> {- RpcOutcome::new(+) -> Outcome<ApiEnvelope<T>> {+ Outcome::new(ApiEnvelope {data: Some(data),error: None,@@ -60,8 +60,8 @@ pub(crate) fn envelope<T: Serialize>(pub(crate) fn error_envelope<T: Serialize>(code: &str,message: String,-) -> RpcOutcome<ApiEnvelope<T>> {- RpcOutcome::new(+) -> Outcome<ApiEnvelope<T>> {+ Outcome::new(ApiEnvelope {data: None,error: Some(ApiError {diff --git a/crates/openhuman-core/src/memory/ops/envelope_tests.rs b/crates/openhuman-core/src/memory/ops/envelope_tests.rsindex 463e045bdf..fb5e6b7dff 100644--- a/crates/openhuman-core/src/memory/ops/envelope_tests.rs+++ b/crates/openhuman-core/src/memory/ops/envelope_tests.rs@@ -18,7 +18,7 @@ fn envelope_wraps_data_with_meta() {#[test]fn error_envelope_wraps_code_and_message() {- let outcome: RpcOutcome<ApiEnvelope<serde_json::Value>> =+ let outcome: Outcome<ApiEnvelope<serde_json::Value>> =error_envelope("bad_request", "boom".to_string());let value = outcome.into_cli_compatible_json().unwrap();assert_eq!(value["error"]["code"], "bad_request");diff --git a/crates/openhuman-core/src/memory/ops/files.rs b/crates/openhuman-core/src/memory/ops/files.rsindex daae621215..6226e54c9a 100644--- a/crates/openhuman-core/src/memory/ops/files.rs+++ b/crates/openhuman-core/src/memory/ops/files.rs@@ -8,7 +8,7 @@ use crate::memory::{ApiEnvelope, ListMemoryFilesRequest, ListMemoryFilesResponse, ReadMemoryFileRequest,ReadMemoryFileResponse, WriteMemoryFileRequest, WriteMemoryFileResponse,};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::envelope::{envelope, memory_counts};use super::helpers::{@@ -18,7 +18,7 @@ use super::helpers::{/// Lists files in a memory directory.pub async fn ai_list_memory_files(request: ListMemoryFilesRequest,-) -> Result<RpcOutcome<ApiEnvelope<ListMemoryFilesResponse>>, String> {+) -> Result<Outcome<ApiEnvelope<ListMemoryFilesResponse>>, String> {validate_memory_relative_path(&request.relative_dir)?;let directory = resolve_existing_memory_path(&request.relative_dir).await?;if !directory.is_dir() {@@ -75,7 +75,7 @@ pub async fn ai_list_memory_files(/// Reads the contents of a memory file.pub async fn ai_read_memory_file(request: ReadMemoryFileRequest,-) -> Result<RpcOutcome<ApiEnvelope<ReadMemoryFileResponse>>, String> {+) -> Result<Outcome<ApiEnvelope<ReadMemoryFileResponse>>, String> {let path = resolve_existing_memory_path(&request.relative_path).await?;let content = tokio::fs::read_to_string(&path).await@@ -93,7 +93,7 @@ pub async fn ai_read_memory_file(/// Writes content to a memory file.pub async fn ai_write_memory_file(request: WriteMemoryFileRequest,-) -> Result<RpcOutcome<ApiEnvelope<WriteMemoryFileResponse>>, String> {+) -> Result<Outcome<ApiEnvelope<WriteMemoryFileResponse>>, String> {let path = resolve_writable_memory_path(&request.relative_path).await?;tokio::fs::write(&path, request.content.as_bytes()).awaitdiff --git a/crates/openhuman-core/src/memory/ops/kv_graph.rs b/crates/openhuman-core/src/memory/ops/kv_graph.rsindex 17d3f19079..628226467c 100644--- a/crates/openhuman-core/src/memory/ops/kv_graph.rs+++ b/crates/openhuman-core/src/memory/ops/kv_graph.rs@@ -4,7 +4,7 @@ use serde::Deserialize;use crate::memory::api::provider::MemoryProvider;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::guard::active_memory_guard;@@ -70,7 +70,7 @@ pub struct GraphQueryParams {/// Routed through [`MemoryGuard`](crate::memory::guard::MemoryGuard)/// and the shared [`MemoryGraph`](crate::memory::api::provider::MemoryGraph)/// API, as are the other KV and graph handlers in this file.-pub async fn kv_set(params: KvSetParams) -> Result<RpcOutcome<bool>, String> {+pub async fn kv_set(params: KvSetParams) -> Result<Outcome<bool>, String> {let guard = active_memory_guard().await?;let graph = guard.as_graph()@@ -79,13 +79,13 @@ pub async fn kv_set(params: KvSetParams) -> Result<RpcOutcome<bool>, String> {.kv_put(params.namespace.as_deref(), ¶ms.key, params.value).await.map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(true, "memory kv set"))+ Ok(Outcome::single_log(true, "memory kv set"))}/// Retrieves a value by key from the memory store.pub async fn kv_get(params: KvGetDeleteParams,-) -> Result<RpcOutcome<Option<serde_json::Value>>, String> {+) -> Result<Outcome<Option<serde_json::Value>>, String> {let guard = active_memory_guard().await?;let graph = guard.as_graph()@@ -95,11 +95,11 @@ pub async fn kv_get(.await.map_err(|error| error.to_string())?.map(|record| record.value);- Ok(RpcOutcome::single_log(value, "memory kv get"))+ Ok(Outcome::single_log(value, "memory kv get"))}/// Deletes a key-value pair from the memory store.-pub async fn kv_delete(params: KvGetDeleteParams) -> Result<RpcOutcome<bool>, String> {+pub async fn kv_delete(params: KvGetDeleteParams) -> Result<Outcome<bool>, String> {let guard = active_memory_guard().await?;let graph = guard.as_graph()@@ -108,13 +108,13 @@ pub async fn kv_delete(params: KvGetDeleteParams) -> Result<RpcOutcome<bool>, St.kv_delete(params.namespace.as_deref(), ¶ms.key).await.map_err(|error| error.to_string())?;- Ok(RpcOutcome::single_log(deleted, "memory kv delete"))+ Ok(Outcome::single_log(deleted, "memory kv delete"))}/// Lists all key-value entries in a namespace.pub async fn kv_list_namespace(params: super::documents::NamespaceOnlyParams,-) -> Result<RpcOutcome<Vec<serde_json::Value>>, String> {+) -> Result<Outcome<Vec<serde_json::Value>>, String> {let guard = active_memory_guard().await?;let graph = guard.as_graph()@@ -126,7 +126,7 @@ pub async fn kv_list_namespace(.into_iter().map(|record| serde_json::to_value(record).map_err(|error| error.to_string())).collect::<Result<Vec<_>, _>>()?;- Ok(RpcOutcome::single_log(rows, "memory namespace kv listed"))+ Ok(Outcome::single_log(rows, "memory namespace kv listed"))}// ---------------------------------------------------------------------------@@ -134,7 +134,7 @@ pub async fn kv_list_namespace(// ---------------------------------------------------------------------------/// Upserts a relation triple in the knowledge graph.-pub async fn graph_upsert(params: GraphUpsertParams) -> Result<RpcOutcome<bool>, String> {+pub async fn graph_upsert(params: GraphUpsertParams) -> Result<Outcome<bool>, String> {let guard = active_memory_guard().await?;let graph = guard.as_graph()@@ -154,13 +154,13 @@ pub async fn graph_upsert(params: GraphUpsertParams) -> Result<RpcOutcome<bool>,}).await.map_err(|error| error.to_string())?;- Ok(RpcOutcome::single_log(true, "memory graph upserted"))+ Ok(Outcome::single_log(true, "memory graph upserted"))}/// Queries relations from the knowledge graph.pub async fn graph_query(params: GraphQueryParams,-) -> Result<RpcOutcome<Vec<serde_json::Value>>, String> {+) -> Result<Outcome<Vec<serde_json::Value>>, String> {let guard = active_memory_guard().await?;let graph = guard.as_graph()@@ -177,7 +177,7 @@ pub async fn graph_query(.into_iter().map(|record| serde_json::to_value(record).map_err(|error| error.to_string())).collect::<Result<Vec<_>, _>>()?;- Ok(RpcOutcome::single_log(rows, "memory graph queried"))+ Ok(Outcome::single_log(rows, "memory graph queried"))}#[cfg(test)]diff --git a/crates/openhuman-core/src/memory/ops/learn.rs b/crates/openhuman-core/src/memory/ops/learn.rsindex c82ec30534..d2a15a3eab 100644--- a/crates/openhuman-core/src/memory/ops/learn.rs+++ b/crates/openhuman-core/src/memory/ops/learn.rs@@ -3,7 +3,7 @@use std::collections::BTreeSet;use crate::memory::api::provider::MemoryProvider;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::guard::active_memory_guard;@@ -39,7 +39,7 @@ pub struct LearnAllParams {/// the local AI provider.pub async fn memory_learn_all(params: LearnAllParams,-) -> Result<RpcOutcome<LearnAllResult>, String> {+) -> Result<Outcome<LearnAllResult>, String> {tracing::info!("[memory.learn] memory_learn_all: entry namespaces={:?}",params.namespaces@@ -95,7 +95,7 @@ pub async fn memory_learn_all(tracing::info!("[memory.learn] memory_learn_all: no namespaces to process, returning early");- return Ok(RpcOutcome::new(+ return Ok(Outcome::new(LearnAllResult {namespaces_processed: 0,results: vec![],@@ -149,7 +149,7 @@ pub async fn memory_learn_all(.map(|r| (&r.namespace, &r.status)).collect::<Vec<_>>());- Ok(RpcOutcome::new(+ Ok(Outcome::new(LearnAllResult {namespaces_processed,results,diff --git a/crates/openhuman-core/src/memory/ops/provider.rs b/crates/openhuman-core/src/memory/ops/provider.rsindex 563f1f0d9d..462c6852ce 100644--- a/crates/openhuman-core/src/memory/ops/provider.rs+++ b/crates/openhuman-core/src/memory/ops/provider.rs@@ -18,7 +18,7 @@use crate::core::runtime::context::CoreContext;use crate::core::subsystem::{DriverHealth, SubsystemStatus};use crate::memory::binding::{to_driver_health, MemoryBinding};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// The status of the memory slot for the current dispatch context.///@@ -119,8 +119,8 @@ fn unresolved_status(reason: String) -> SubsystemStatus {}/// RPC handler body for `memory.provider_status`.-pub async fn memory_provider_status() -> RpcOutcome<SubsystemStatus> {- RpcOutcome::new(memory_subsystem_status().await, vec![])+pub async fn memory_provider_status() -> Outcome<SubsystemStatus> {+ Outcome::new(memory_subsystem_status().await, vec![])}#[cfg(test)]diff --git a/crates/openhuman-core/src/memory/ops/sync.rs b/crates/openhuman-core/src/memory/ops/sync.rsindex 5025532cd8..e068889376 100644--- a/crates/openhuman-core/src/memory/ops/sync.rs+++ b/crates/openhuman-core/src/memory/ops/sync.rs@@ -39,7 +39,7 @@use crate::config::rpc as config_rpc;use crate::config::Config;use crate::memory::sync::composio;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use tinymemory_api::sync_events::{emit_sync_stage, MemorySyncStage, MemorySyncTrigger};/// Parameters for `memory_sync_channel`.@@ -101,7 +101,7 @@ pub struct IngestionStatusResult {/// request was published, not that ingestion ran.pub async fn memory_sync_channel(params: SyncChannelParams,-) -> Result<RpcOutcome<SyncChannelResult>, String> {+) -> Result<Outcome<SyncChannelResult>, String> {// `channel_id` is a user/context identifier — keep it out of normal logs.tracing::info!("[memory.sync] memory_sync_channel: entry");crate::core::bus::BUS.publish(crate::core::events::DomainEvent::MemorySyncRequested {@@ -122,7 +122,7 @@ pub async fn memory_sync_channel(}});tracing::debug!("[memory.sync] memory_sync_channel: MemorySyncRequested published");- Ok(RpcOutcome::new(+ Ok(Outcome::new(SyncChannelResult {requested: true,channel_id: params.channel_id,@@ -136,7 +136,7 @@ pub async fn memory_sync_channel(/// Publishes `DomainEvent::MemorySyncRequested { channel_id: None }` on the/// global event bus. No consumers exist yet — this is a hook for future/// ingestion subscribers.-pub async fn memory_sync_all() -> Result<RpcOutcome<SyncAllResult>, String> {+pub async fn memory_sync_all() -> Result<Outcome<SyncAllResult>, String> {tracing::info!("[memory.sync] memory_sync_all: entry");crate::core::bus::BUS.publish(crate::core::events::DomainEvent::MemorySyncRequested { channel_id: None });@@ -154,7 +154,7 @@ pub async fn memory_sync_all() -> Result<RpcOutcome<SyncAllResult>, String> {}});tracing::debug!("[memory.sync] memory_sync_all: MemorySyncRequested(all) published");- Ok(RpcOutcome::new(SyncAllResult { requested: true }, vec![]))+ Ok(Outcome::new(SyncAllResult { requested: true }, vec![]))}async fn spawn_manual_sync(requested_connection: Option<String>) -> Result<(), String> {@@ -270,10 +270,10 @@ async fn spawn_manual_sync(requested_connection: Option<String>) -> Result<(), S/// Returns the current memory-ingestion status: whether the driver's queue is/// working, how much is waiting, and when it last settled a job. Read-only,/// safe to poll.-pub async fn memory_ingestion_status() -> Result<RpcOutcome<IngestionStatusResult>, String> {+pub async fn memory_ingestion_status() -> Result<Outcome<IngestionStatusResult>, String> {let config = config_rpc::load_config_with_timeout().await?;let status = ingestion_status_for_config(&config).await?;- Ok(RpcOutcome::new(status, vec![]))+ Ok(Outcome::new(status, vec![]))}/// The queue half of [`memory_ingestion_status`], against an explicit config.@@ -378,7 +378,7 @@ pub struct SchedulerOverrideResult {/// hour; the default asks for ten minutes.pub async fn memory_scheduler_override(seconds: Option<u64>,-) -> Result<RpcOutcome<SchedulerOverrideResult>, String> {+) -> Result<Outcome<SchedulerOverrideResult>, String> {let seconds = seconds.unwrap_or(600).min(3600);#[cfg(feature = "modules")]{@@ -401,7 +401,7 @@ pub async fn memory_scheduler_override(format!("scheduler override: {error}")}})?;- Ok(RpcOutcome::new(+ Ok(Outcome::new(SchedulerOverrideResult {overridden: true,seconds,diff --git a/crates/openhuman-core/src/memory/ops/tool_memory.rs b/crates/openhuman-core/src/memory/ops/tool_memory.rsindex a93c168b83..acf8de82ac 100644--- a/crates/openhuman-core/src/memory/ops/tool_memory.rs+++ b/crates/openhuman-core/src/memory/ops/tool_memory.rs@@ -17,7 +17,7 @@ use std::sync::Arc;use crate::memory::api::provider::MemoryProvider;use crate::memory::api::tool_memory::{ToolMemoryPriority, ToolMemoryRule, ToolMemorySource};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// Parameters for `memory_tool_rule_put`.#[derive(Debug, Deserialize)]@@ -70,7 +70,7 @@ async fn tool_memory_guard() -> Result<Arc<crate::memory::guard::MemoryGuard>, S/// Upsert a tool-scoped memory rule.pub async fn tool_rule_put(params: ToolRulePutParams,-) -> Result<RpcOutcome<ToolMemoryRule>, String> {+) -> Result<Outcome<ToolMemoryRule>, String> {log::debug!("[tool-memory] rpc tool_rule_put tool={}", params.tool_name);let mut rule = ToolMemoryRule::new(¶ms.tool_name,@@ -91,13 +91,13 @@ pub async fn tool_rule_put(.put_tool_rule(rule.clone()).await.map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(rule, "tool memory rule stored"))+ Ok(Outcome::single_log(rule, "tool memory rule stored"))}/// Fetch a tool-scoped rule by id.pub async fn tool_rule_get(params: ToolRuleRefParams,-) -> Result<RpcOutcome<Option<ToolMemoryRule>>, String> {+) -> Result<Outcome<Option<ToolMemoryRule>>, String> {log::debug!("[tool-memory] rpc tool_rule_get tool={} id={}",params.tool_name,@@ -112,7 +112,7 @@ pub async fn tool_rule_get(.map_err(|e| e.to_string())?.into_iter().find(|rule| rule.id == params.id);- Ok(RpcOutcome::single_log(rule, "tool memory rule fetched"))+ Ok(Outcome::single_log(rule, "tool memory rule fetched"))}/// The reason a guarded handler in this file cannot proceed.@@ -133,7 +133,7 @@ pub(crate) const NO_TOOL_MEMORY: &str = "memory driver does not support the tool/// `crate::memory::api::tool_memory::ToolMemoryRule`.pub async fn tool_rule_list(params: ToolRuleListParams,-) -> Result<RpcOutcome<Vec<ToolMemoryRule>>, String> {+) -> Result<Outcome<Vec<ToolMemoryRule>>, String> {log::debug!("[tool-memory] rpc tool_rule_list tool={}", params.tool_name);let guard = super::guard::active_memory_guard().await?;let rules = guard@@ -142,14 +142,14 @@ pub async fn tool_rule_list(.tool_rules(¶ms.tool_name).await.map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(rules, "tool memory rules listed"))+ Ok(Outcome::single_log(rules, "tool memory rules listed"))}/// Delete a tool-scoped rule by id.////// Routed through [`MemoryGuard`](crate::memory::guard::MemoryGuard)/// and the shared tool-memory API.-pub async fn tool_rule_delete(params: ToolRuleRefParams) -> Result<RpcOutcome<bool>, String> {+pub async fn tool_rule_delete(params: ToolRuleRefParams) -> Result<Outcome<bool>, String> {log::debug!("[tool-memory] rpc tool_rule_delete tool={} id={}",params.tool_name,@@ -162,7 +162,7 @@ pub async fn tool_rule_delete(params: ToolRuleRefParams) -> Result<RpcOutcome<bo.delete_tool_rule(¶ms.tool_name, ¶ms.id).await.map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(deleted, "tool memory rule deleted"))+ Ok(Outcome::single_log(deleted, "tool memory rule deleted"))}/// Return the rendered prompt block plus the structured rule list for@@ -179,7 +179,7 @@ pub struct ToolRulesForPromptResult {/// Pre-fetch Critical + High priority rules for prompt injection.pub async fn tool_rules_for_prompt(params: ToolRulesForPromptParams,-) -> Result<RpcOutcome<ToolRulesForPromptResult>, String> {+) -> Result<Outcome<ToolRulesForPromptResult>, String> {log::debug!("[tool-memory] rpc tool_rules_for_prompt tools={:?}",params.tools@@ -206,7 +206,7 @@ pub async fn tool_rules_for_prompt(.then_with(|| a.rule.cmp(&b.rule))});let rendered = crate::memory::tool_memory::prompt::render_tool_memory_rules(&flat);- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(ToolRulesForPromptResult {rendered,rules: flat,@@ -217,7 +217,7 @@ pub async fn tool_rules_for_prompt(/// Render the raw JSON form of a tool's rules, useful for envelope/// consumers that want the unfiltered list.-pub async fn tool_rules_json(params: ToolRuleListParams) -> Result<RpcOutcome<Value>, String> {+pub async fn tool_rules_json(params: ToolRuleListParams) -> Result<Outcome<Value>, String> {log::debug!("[tool-memory] rpc tool_rules_json tool={}",params.tool_name@@ -230,7 +230,7 @@ pub async fn tool_rules_json(params: ToolRuleListParams) -> Result<RpcOutcome<Va.await.map_err(|e| e.to_string())?;let value = serde_json::to_value(rules).map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(value, "tool memory rules json"))+ Ok(Outcome::single_log(value, "tool memory rules json"))}#[cfg(test)]diff --git a/crates/openhuman-core/src/memory/ops_tests.rs b/crates/openhuman-core/src/memory/ops_tests.rsindex 28d720f5a6..9842563245 100644--- a/crates/openhuman-core/src/memory/ops_tests.rs+++ b/crates/openhuman-core/src/memory/ops_tests.rs@@ -158,7 +158,7 @@ use super::{relation_identity, relation_metadata, timestamp_to_rfc3339, validate_memory_relative_path,};use crate::memory::{ApiEnvelope, MemoryRetrievalContext};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;#[test]fn memory_request_id_is_nonempty_and_unique() {@@ -312,7 +312,7 @@ fn validate_memory_relative_path_rejects_empty_absolute_and_traversal() {#[test]fn error_envelope_produces_api_error_with_code_and_message() {- let envelope: RpcOutcome<ApiEnvelope<serde_json::Value>> =+ let envelope: Outcome<ApiEnvelope<serde_json::Value>> =error_envelope::<serde_json::Value>("NOT_FOUND", "missing".into());let api = &envelope.value;assert!(api.data.is_none());diff --git a/crates/openhuman-core/src/memory/people/mod.rs b/crates/openhuman-core/src/memory/people/mod.rsindex 4a04c7ca0e..dac490684d 100644--- a/crates/openhuman-core/src/memory/people/mod.rs+++ b/crates/openhuman-core/src/memory/people/mod.rs@@ -1,6 +1,6 @@//! Host layer over the people domain: its JSON-RPC surface, and nothing else.//!-//! Handlers and controller schemas name OpenHuman's `RpcOutcome` and+//! Handlers and controller schemas name OpenHuman's `Outcome` and//! `ControllerSchema`, which the driver cannot see; the ranking, scoring and//! address-book work happens driver-side, behind//! [`MemoryPeople`](crate::memory::api::provider::MemoryPeople).diff --git a/crates/openhuman-core/src/memory/people/rpc.rs b/crates/openhuman-core/src/memory/people/rpc.rsindex 12de4b0df4..c2ecf73edf 100644--- a/crates/openhuman-core/src/memory/people/rpc.rs+++ b/crates/openhuman-core/src/memory/people/rpc.rs@@ -16,7 +16,7 @@use serde_json::{json, Value};use crate::memory::api::provider::{MemoryPeople, PersonHandle, PersonRecord};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// Render one person plus their score into the published `people.*` shape.fn person_json(person: &PersonRecord, score: &crate::memory::api::provider::PersonScore) -> Value {@@ -58,7 +58,7 @@ fn person_json(person: &PersonRecord, score: &crate::memory::api::provider::Perspub async fn handle_list(people: &dyn MemoryPeople,limit: usize,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let limit = limit.clamp(1, 500);let ranked = people.list_people(Some(limit))@@ -68,7 +68,7 @@ pub async fn handle_list(.iter().map(|entry| person_json(&entry.person, &entry.score)).collect();- Ok(RpcOutcome::new(json!({ "people": people_json }), vec![]))+ Ok(Outcome::new(json!({ "people": people_json }), vec![]))}/// Resolve a handle to a person id. Mints on first sight when@@ -77,12 +77,12 @@ pub async fn handle_resolve(people: &dyn MemoryPeople,handle: PersonHandle,create_if_missing: bool,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let resolved = people.resolve_handle(&handle, create_if_missing).await.map_err(|e| format!("resolve: {e}"))?;- Ok(RpcOutcome::new(+ Ok(Outcome::new(json!({"person_id": resolved.as_ref().map(|r| r.id.clone()),"created": resolved.as_ref().is_some_and(|r| r.created),@@ -105,7 +105,7 @@ pub async fn handle_resolve(/// memory-driver error.pub async fn handle_refresh_address_book(people: &dyn MemoryPeople,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let outcome = people.seed_from_address_book().await@@ -115,7 +115,7 @@ pub async fn handle_refresh_address_book(outcome.seeded,outcome.skipped);- Ok(RpcOutcome::new(+ Ok(Outcome::new(json!({"seeded": outcome.seeded,"skipped": outcome.skipped,@@ -129,13 +129,13 @@ pub async fn handle_refresh_address_book(pub async fn handle_score(people: &dyn MemoryPeople,person_id: &str,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let score = people.score_person(person_id).await.map_err(|e| format!("score: {e}"))?.ok_or_else(|| format!("person not found: {person_id}"))?;- Ok(RpcOutcome::new(+ Ok(Outcome::new(json!({"person_id": person_id,"score": score.score,diff --git a/crates/openhuman-core/src/memory/people/schemas.rs b/crates/openhuman-core/src/memory/people/schemas.rsindex 78fa985a76..85b1d66fc4 100644--- a/crates/openhuman-core/src/memory/people/schemas.rs+++ b/crates/openhuman-core/src/memory/people/schemas.rs@@ -13,7 +13,7 @@ use crate::core::{ControllerSchema, FieldSchema, TypeSchema};use crate::memory::api::provider::{MemoryProvider, PersonHandle};use crate::memory::ops::guard::active_memory_guard;use crate::memory::people::rpc;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub fn all_controller_schemas() -> Vec<ControllerSchema> {vec![@@ -389,7 +389,7 @@ fn read_optional_u64(params: &Map<String, Value>, key: &str) -> Result<Option<u6}}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/memory/read_rpc/admin.rs b/crates/openhuman-core/src/memory/read_rpc/admin.rsindex 90028b6f18..da06106c73 100644--- a/crates/openhuman-core/src/memory/read_rpc/admin.rs+++ b/crates/openhuman-core/src/memory/read_rpc/admin.rs@@ -2,7 +2,7 @@ use anyhow::{Context, Result};use crate::config::Config;use crate::memory::api::provider::ForgetSelector;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;// The KV namespace the Composio sync pipelines keep their per-connection// cursor state under, named at the **contract** (#5560).//@@ -40,7 +40,7 @@ use super::types::{/// decides where they live, and `purge_all`'s own contract says a driver must/// not reach into a host-owned path. `dirs_removed` therefore stays here,/// unchanged, and stays outside the driver call.-pub async fn wipe_all_rpc(config: &Config) -> Result<RpcOutcome<WipeAllResponse>, String> {+pub async fn wipe_all_rpc(config: &Config) -> Result<Outcome<WipeAllResponse>, String> {// No `spawn_blocking` around either driver call — the driver owns whether// its own reads block, and the module's do not run on this thread at all// (the same reasoning `flush_now_rpc` below already carries). The directory@@ -120,7 +120,7 @@ pub async fn wipe_all_rpc(config: &Config) -> Result<RpcOutcome<WipeAllResponse>"memory_tree::read: wipe_all rows={} dirs={:?} sync_state={}",resp.rows_deleted, resp.dirs_removed, resp.sync_state_cleared);- Ok(RpcOutcome::single_log(resp, log))+ Ok(Outcome::single_log(resp, log))}/// Clear the composio sync-state namespace from the bound driver's key/value@@ -207,7 +207,7 @@ pub(crate) async fn clear_composio_sync_state(config: &Config) -> Result<u64, St/// Drop everything derived from stored content and schedule its re-derivation/// via the bound driver — deletion and rebuild must be one operation, so it/// belongs to the driver that owns the derived tables.-pub async fn reset_tree_rpc(config: &Config) -> Result<RpcOutcome<ResetTreeResponse>, String> {+pub async fn reset_tree_rpc(config: &Config) -> Result<Outcome<ResetTreeResponse>, String> {// The derived-index reset — the table deletes, the chunk requeue and the// re-extraction enqueue — is the driver's now (`Maintenance::// reset_derived_index`), where the tables live. What stays here is what is@@ -274,7 +274,7 @@ pub async fn reset_tree_rpc(config: &Config) -> Result<RpcOutcome<ResetTreeRespo"memory_tree::read: reset_tree tree_rows={} chunks={} jobs={}",resp.tree_rows_deleted, resp.chunks_requeued, resp.jobs_enqueued);- Ok(RpcOutcome::single_log(resp, log))+ Ok(Outcome::single_log(resp, log))}// ── flush_source_tree ────────────────────────────────────────────────────@@ -312,7 +312,7 @@ pub async fn reset_tree_rpc(config: &Config) -> Result<RpcOutcome<ResetTreeRespopub async fn flush_source_tree_rpc(config: &Config,source_scope: &str,-) -> Result<RpcOutcome<FlushSourceTreeResponse>, String> {+) -> Result<Outcome<FlushSourceTreeResponse>, String> {use std::collections::HashSet;use std::sync::Mutex;@@ -339,7 +339,7 @@ pub async fn flush_source_tree_rpc({let mut active = ACTIVE.lock().unwrap_or_else(|e| e.into_inner());if !active.insert(scope.clone()) {- return Ok(RpcOutcome::single_log(+ return Ok(Outcome::single_log(FlushSourceTreeResponse {tree_scope: scope,seals_fired: 0,@@ -378,7 +378,7 @@ pub async fn flush_source_tree_rpc("memory_tree::read: flush_source_tree scope={} seals={}",resp.tree_scope, resp.seals_fired);- Ok(RpcOutcome::single_log(resp, log))+ Ok(Outcome::single_log(resp, log))}// ── flush_now ─────────────────────────────────────────────────────────────@@ -386,7 +386,7 @@ pub async fn flush_source_tree_rpc(/// Flush buffered work old enough to be written out, via the bound driver —/// flush deduplication is keyed engine-side, so only the driver can promise/// one enqueue per window.-pub async fn flush_now_rpc(config: &Config) -> Result<RpcOutcome<FlushNowResponse>, String> {+pub async fn flush_now_rpc(config: &Config) -> Result<Outcome<FlushNowResponse>, String> {// Asked of the driver (`Maintenance::flush_pending`): the buffer walk, the// window-keyed dedupe and the enqueue were engine mechanics the host was// re-implementing. No `spawn_blocking` — the driver owns whether its own@@ -412,7 +412,7 @@ pub async fn flush_now_rpc(config: &Config) -> Result<RpcOutcome<FlushNowRespons"memory_tree::read: flush_now enqueued={} stale_buffers={}",resp.enqueued, resp.stale_buffers);- Ok(RpcOutcome::single_log(resp, log))+ Ok(Outcome::single_log(resp, log))}// ── backfill_connector_trees ───────────────────────────────────────────────@@ -439,7 +439,7 @@ pub async fn backfill_connector_trees_rpc(config: &Config,limit: Option<u64>,dry_run: bool,-) -> Result<RpcOutcome<BackfillConnectorTreesResponse>, String> {+) -> Result<Outcome<BackfillConnectorTreesResponse>, String> {let binding = crate::memory::binding::for_config(config)?;let Some(maintenance) = binding.provider().as_maintenance() else {return Err(format!(@@ -473,7 +473,7 @@ pub async fn backfill_connector_trees_rpc(resp.skipped,resp.more_pending);- Ok(RpcOutcome::single_log(resp, log))+ Ok(Outcome::single_log(resp, log))}// ── delete_source ──────────────────────────────────────────────────────────@@ -512,7 +512,7 @@ pub async fn backfill_connector_trees_rpc(pub async fn delete_source_rpc(config: &Config,source_id: String,-) -> Result<RpcOutcome<DeleteSourceResponse>, String> {+) -> Result<Outcome<DeleteSourceResponse>, String> {let source_id = source_id.trim().to_string();if source_id.is_empty() {return Err("delete_source: source_id must be a non-empty string".to_string());@@ -558,7 +558,7 @@ pub async fn delete_source_rpc(resp.chunks_removed,outcome.trees_cleaned);- Ok(RpcOutcome::single_log(resp, log))+ Ok(Outcome::single_log(resp, log))}#[cfg(test)]diff --git a/crates/openhuman-core/src/memory/read_rpc/chunks.rs b/crates/openhuman-core/src/memory/read_rpc/chunks.rsindex b82eb069da..840057fa7f 100644--- a/crates/openhuman-core/src/memory/read_rpc/chunks.rs+++ b/crates/openhuman-core/src/memory/read_rpc/chunks.rs@@ -6,7 +6,7 @@ use crate::memory::api::provider::retrieval::{RetrievalNodeKind, RetrievalResponse, SourceRetrievalQuery,};use crate::memory::api::provider::{ChunkListRow, ChunkQuery, MemoryChunks};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use tinymemory_api::chunks::SourceKind;use super::types::{@@ -19,12 +19,12 @@ use super::types::{pub async fn list_chunks_rpc(config: &Config,filter: ChunkFilter,-) -> Result<RpcOutcome<ListChunksResponse>, String> {+) -> Result<Outcome<ListChunksResponse>, String> {let resp = list_chunks_page(config, &filter).await?;let n = resp.chunks.len();let total = resp.total;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(resp,format!("memory_tree::read: list_chunks n={n} total={total}"),))@@ -283,11 +283,11 @@ fn chunk_row_from_list_row(row: ChunkListRow) -> ChunkRow {pub async fn list_sources_rpc(config: &Config,user_email_hint: Option<String>,-) -> Result<RpcOutcome<Vec<Source>>, String> {+) -> Result<Outcome<Vec<Source>>, String> {let sources = list_sources(config, user_email_hint.as_deref()).await?;let n = sources.len();- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(sources,format!("memory_tree::read: list_sources n={n}"),))@@ -398,11 +398,11 @@ pub async fn search_rpc(config: &Config,query: String,k: u32,-) -> Result<RpcOutcome<Vec<ChunkRow>>, String> {+) -> Result<Outcome<Vec<ChunkRow>>, String> {let limit = k.clamp(1, MAX_LIST_LIMIT);let tokens = query_tokens(Some(&query));if !query.trim().is_empty() && tokens.is_empty() {- return Ok(RpcOutcome::single_log(+ return Ok(Outcome::single_log(Vec::new(),format!("memory_tree::read: search query_len={} n=0", query.len()),));@@ -424,7 +424,7 @@ pub async fn search_rpc("[memory_tree::read] search: driver '{}' does not serve Chunks; reporting empty",binding.driver_id());- return Ok(RpcOutcome::single_log(+ return Ok(Outcome::single_log(Vec::new(),format!("memory_tree::read: search query_len={query_len} n=0"),));@@ -458,7 +458,7 @@ pub async fn search_rpc(let hits: Vec<ChunkRow> = rows.into_iter().map(chunk_row_from_list_row).collect();let n = hits.len();log::debug!("[memory_tree::read] search: limit={limit} n={n}");- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(hits,format!("memory_tree::read: search query_len={query_len} n={n}"),))@@ -468,7 +468,7 @@ pub async fn recall_rpc(config: &Config,query: String,k: u32,-) -> Result<RpcOutcome<RecallResponse>, String> {+) -> Result<Outcome<RecallResponse>, String> {let limit = k.clamp(1, MAX_LIST_LIMIT) as usize;log::debug!("[memory_tree::read::recall] query_len={} k={}",@@ -612,7 +612,7 @@ pub async fn recall_rpc(scores.truncate(limit);let n = chunk_rows.len();- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(RecallResponse {chunks: chunk_rows,scores,diff --git a/crates/openhuman-core/src/memory/read_rpc/entities.rs b/crates/openhuman-core/src/memory/read_rpc/entities.rsindex 48fe910c40..de7b1b14aa 100644--- a/crates/openhuman-core/src/memory/read_rpc/entities.rs+++ b/crates/openhuman-core/src/memory/read_rpc/entities.rs@@ -2,7 +2,7 @@ use anyhow::Result;use crate::config::Config;use crate::memory::binding::MemoryBinding;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use tinymemory_api::error::MemoryError;use tinymemory_api::provider::chunks::ChunkScore;use tinymemory_api::provider::types::{EntityOccurrence, ForgetSelector};@@ -79,7 +79,7 @@ async fn chunk_entity_rows(pub async fn entity_index_for_rpc(config: &Config,chunk_id: String,-) -> Result<RpcOutcome<Vec<EntityRef>>, String> {+) -> Result<Outcome<Vec<EntityRef>>, String> {let binding = crate::memory::binding::for_config(config)?;let refs: Vec<EntityRef> = chunk_entity_rows(&binding, &chunk_id, "entity_index_for").await?@@ -88,7 +88,7 @@ pub async fn entity_index_for_rpc(.collect();let n = refs.len();- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(refs,format!("memory_tree::read: entity_index_for chunk_id={chunk_id} n={n}"),))@@ -97,7 +97,7 @@ pub async fn entity_index_for_rpc(pub async fn chunks_for_entity_rpc(config: &Config,entity_id: String,-) -> Result<RpcOutcome<Vec<String>>, String> {+) -> Result<Outcome<Vec<String>>, String> {let binding = crate::memory::binding::for_config(config)?;let chunk_ids = match binding.provider().as_entities() {// A bound appears where the SQL had none, because `entity_chunk_ids`@@ -138,7 +138,7 @@ pub async fn chunks_for_entity_rpc(binding.driver_id(),MAX_LIST_LIMIT);- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(chunk_ids,format!("memory_tree::read: chunks_for_entity entity_id={entity_id} n={n}"),))@@ -148,7 +148,7 @@ pub async fn top_entities_rpc(config: &Config,kind: Option<String>,limit: u32,-) -> Result<RpcOutcome<Vec<EntityRef>>, String> {+) -> Result<Outcome<Vec<EntityRef>>, String> {let limit = limit.clamp(1, MAX_LIST_LIMIT);let binding = crate::memory::binding::for_config(config)?;let refs: Vec<EntityRef> = match binding.provider().as_entities() {@@ -201,7 +201,7 @@ pub async fn top_entities_rpc(binding.driver_id(),kind);- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(refs,format!("memory_tree::read: top_entities n={n}"),))@@ -310,12 +310,12 @@ fn score_breakdown(row: ChunkScore) -> ScoreBreakdown {pub async fn chunk_score_rpc(config: &Config,chunk_id: String,-) -> Result<RpcOutcome<Option<ScoreBreakdown>>, String> {+) -> Result<Outcome<Option<ScoreBreakdown>>, String> {let binding = crate::memory::binding::for_config(config)?;let result = chunk_score_row(&binding, &chunk_id, "chunk_score").await?.map(score_breakdown);- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(result,format!("memory_tree::read: chunk_score id={chunk_id}"),))@@ -337,7 +337,7 @@ async fn score_row_count(binding: &MemoryBinding, chunk_id: &str) -> Result<u32,pub async fn delete_chunk_rpc(config: &Config,chunk_id: String,-) -> Result<RpcOutcome<DeleteChunkResponse>, String> {+) -> Result<Outcome<DeleteChunkResponse>, String> {let binding = crate::memory::binding::for_config(config)?;// Resolved on `provider()` and **refused** when the family is absent, not@@ -401,7 +401,7 @@ pub async fn delete_chunk_rpc(outcome.chunks_removed,outcome.trees_cleaned);- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(resp.clone(),format!("memory_tree::read: delete_chunk id={chunk_id} deleted={} score_rows={} entity_rows={}",diff --git a/crates/openhuman-core/src/memory/read_rpc/graph.rs b/crates/openhuman-core/src/memory/read_rpc/graph.rsindex fe0eb8dbbd..1009626ed8 100644--- a/crates/openhuman-core/src/memory/read_rpc/graph.rs+++ b/crates/openhuman-core/src/memory/read_rpc/graph.rs@@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};use crate::config::Config;use crate::memory::api::provider::ChunkQuery;use crate::memory::api::tree::{TreeLeaf, TreeSummary};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;// `MemoryGraph` in the contract is the key/value and relation tier, a different// graph from the one exported here: the summary forest and its leaf chunks,@@ -81,7 +81,7 @@ const CHUNK_LABEL_CHARS: usize = 72;pub async fn graph_export_rpc(config: &Config,mode: GraphMode,-) -> Result<RpcOutcome<GraphExportResponse>, String> {+) -> Result<Outcome<GraphExportResponse>, String> {log::debug!("[memory_tree::read::graph_export] mode={mode:?}");// No `spawn_blocking`: every read below is a driver call, the driver owns@@ -107,7 +107,7 @@ pub async fn graph_export_rpc(resp.edges.len(),crate::util::redact::redact(&resp.content_root_abs),);- Ok(RpcOutcome::single_log(resp, log))+ Ok(Outcome::single_log(resp, log))}// ── collect_tree_graph ───────────────────────────────────────────────────diff --git a/crates/openhuman-core/src/memory/read_rpc/vault.rs b/crates/openhuman-core/src/memory/read_rpc/vault.rsindex 794e065188..ca3ccae4ae 100644--- a/crates/openhuman-core/src/memory/read_rpc/vault.rs+++ b/crates/openhuman-core/src/memory/read_rpc/vault.rs@@ -15,14 +15,14 @@ use anyhow::Result;use crate::config::Config;use crate::memory::obsidian_registry;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::types::{ObsidianVaultStatusResponse, VaultHealthCheckResponse};pub async fn obsidian_vault_status_rpc(config: &Config,obsidian_config_dir: Option<String>,-) -> Result<RpcOutcome<ObsidianVaultStatusResponse>, String> {+) -> Result<Outcome<ObsidianVaultStatusResponse>, String> {let cfg = config.clone();let resp = tokio::task::spawn_blocking(move || -> ObsidianVaultStatusResponse {let content_root = cfg.memory_tree_content_root();@@ -48,13 +48,13 @@ pub async fn obsidian_vault_status_rpc(resp.config_found,crate::util::redact::redact(&resp.content_root_abs),);- Ok(RpcOutcome::single_log(resp, log))+ Ok(Outcome::single_log(resp, log))}pub async fn vault_health_check_rpc(config: &Config,obsidian_config_dir: Option<String>,-) -> Result<RpcOutcome<VaultHealthCheckResponse>, String> {+) -> Result<Outcome<VaultHealthCheckResponse>, String> {let cfg = config.clone();let fs_probe = tokio::task::spawn_blocking(move || {let content_root = cfg.memory_tree_content_root();@@ -111,7 +111,7 @@ pub async fn vault_health_check_rpc(resp.last_sync_ms,crate::util::redact::redact(&resp.content_root_abs),);- Ok(RpcOutcome::single_log(resp, log))+ Ok(Outcome::single_log(resp, log))}/// Whether the memory pipeline status counts as "healthy" for the Vault setupdiff --git a/crates/openhuman-core/src/memory/schema/handlers.rs b/crates/openhuman-core/src/memory/schema/handlers.rsindex 88c609b7d2..8623b70520 100644--- a/crates/openhuman-core/src/memory/schema/handlers.rs+++ b/crates/openhuman-core/src/memory/schema/handlers.rs@@ -11,7 +11,7 @@ use crate::config::rpc as config_rpc;use crate::core::all::ControllerFuture;use crate::memory::read_rpc;use crate::memory::tree::tree::rpc;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;// ── Write-side handlers (rpc::*) ─────────────────────────────────────────@@ -355,7 +355,7 @@ pub(super) fn handle_smart_walk(params: Map<String, Value>) -> ControllerFuturelet result = serde_json::to_value(&resp).map_err(|e| format!("smart_walk: serialize response failed: {e}"))?;- to_json(RpcOutcome::new(result, vec![]))+ to_json(Outcome::new(result, vec![]))})}@@ -379,6 +379,6 @@ pub(super) fn parse_value<T: DeserializeOwned>(v: Value) -> Result<T, String> {serde_json::from_value(v).map_err(|e| format!("invalid params: {e}"))}-pub(super) fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+pub(super) fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/memory/schemas/mod.rs b/crates/openhuman-core/src/memory/schemas/mod.rsindex 8c526ce41e..dab1b48583 100644--- a/crates/openhuman-core/src/memory/schemas/mod.rs+++ b/crates/openhuman-core/src/memory/schemas/mod.rs@@ -29,7 +29,7 @@ use serde_json::{Map, Value};use crate::core::all::RegisteredController;use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;mod documents;mod files;@@ -252,7 +252,7 @@ pub(super) fn parse_params<T: DeserializeOwned>(params: Map<String, Value>) -> Rserde_json::from_value(Value::Object(params)).map_err(|e| format!("invalid params: {e}"))}-pub(super) fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+pub(super) fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/memory/sources/rpc/apply_all.rs b/crates/openhuman-core/src/memory/sources/rpc/apply_all.rsindex bac38bda4d..8282c723f5 100644--- a/crates/openhuman-core/src/memory/sources/rpc/apply_all.rs+++ b/crates/openhuman-core/src/memory/sources/rpc/apply_all.rs@@ -5,7 +5,7 @@ use super::source_sync::{sync_dispatch, SyncDispatch};use crate::config::rpc as config_rpc;use crate::memory::sources::registry;use crate::memory::sources::types::MemorySourceEntry;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// Response returned by `memory_sources_apply_all_in`.#[derive(Debug, serde::Serialize)]@@ -89,7 +89,7 @@ where/// Returns immediately with the updated source list and the number of/// syncs queued. Individual syncs run in the background and publish/// `MemorySyncStageChanged` events as they progress.-pub async fn apply_all_in_rpc() -> Result<RpcOutcome<AllInResponse>, String> {+pub async fn apply_all_in_rpc() -> Result<Outcome<AllInResponse>, String> {tracing::info!("[memory_sources] apply_all_in_rpc: entry");// Enable all sources and clear caps.@@ -173,7 +173,7 @@ pub async fn apply_all_in_rpc() -> Result<RpcOutcome<AllInResponse>, String> {"[memory_sources] apply_all_in_rpc: complete");- Ok(RpcOutcome::new(+ Ok(Outcome::new(AllInResponse {sources,sync_triggered,diff --git a/crates/openhuman-core/src/memory/sources/rpc/coding_sessions.rs b/crates/openhuman-core/src/memory/sources/rpc/coding_sessions.rsindex de1b0e2cf4..dfb61bc976 100644--- a/crates/openhuman-core/src/memory/sources/rpc/coding_sessions.rs+++ b/crates/openhuman-core/src/memory/sources/rpc/coding_sessions.rs@@ -4,7 +4,7 @@ use crate::config::rpc as config_rpc;use crate::config::Config;use crate::memory::api::provider::sessions::{CodingSessionIngestReport, CodingSessionSource};use crate::memory::binding::MemoryBinding;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// The coding-session ingest request, under this domain's own name.///@@ -52,7 +52,7 @@ pub struct CodingSessionStatusResponse {/// `CodingSessionSource::scan_truncated` is how a caller learns the counts are/// a floor — the same field the engine's `CodingSessionSourceStatus` carried,/// under the same name.-pub async fn coding_session_status_rpc() -> Result<RpcOutcome<CodingSessionStatusResponse>, String>+pub async fn coding_session_status_rpc() -> Result<Outcome<CodingSessionStatusResponse>, String>{tracing::debug!("[memory_sources] coding_session_status_rpc: entry");let config = config_rpc::load_config_with_timeout().await?;@@ -80,7 +80,7 @@ pub async fn coding_session_status_rpc() -> Result<RpcOutcome<CodingSessionStatutruncated = sources.iter().any(|source| source.scan_truncated),"[memory_sources] coding_session_status_rpc: exit");- Ok(RpcOutcome::new(+ Ok(Outcome::new(CodingSessionStatusResponse { sources },vec![],))@@ -158,7 +158,7 @@ pub(crate) fn ingest_budget(max_sessions: usize) -> std::time::Duration {/// a report the run never finished writing is not progress the caller can keep.pub async fn ingest_coding_sessions_rpc(req: CodingSessionIngestRequest,-) -> Result<RpcOutcome<CodingSessionIngestReport>, String> {+) -> Result<Outcome<CodingSessionIngestReport>, String> {tracing::info!(backfill = req.backfill,max_sessions = req.max_sessions,@@ -204,5 +204,5 @@ pub async fn ingest_coding_sessions_rpc(budget_hit = report.budget_hit,"[memory_sources] ingest_coding_sessions_rpc: exit");- Ok(RpcOutcome::new(report, vec![]))+ Ok(Outcome::new(report, vec![]))}diff --git a/crates/openhuman-core/src/memory/sources/rpc/cost_reporting.rs b/crates/openhuman-core/src/memory/sources/rpc/cost_reporting.rsindex d399c47f4e..ca72ac547e 100644--- a/crates/openhuman-core/src/memory/sources/rpc/cost_reporting.rs+++ b/crates/openhuman-core/src/memory/sources/rpc/cost_reporting.rs@@ -6,7 +6,7 @@ use crate::memory::api::provider::sync::SyncAuditEntry;use crate::memory::sources::readers;use crate::memory::sources::registry;use crate::memory::sources::run_history;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;// ── Sync Audit Log ──@@ -45,7 +45,7 @@ pub struct SyncAuditLogResponse {/// ended in `unwrap_or_default()`, so an unreadable file was reported as "no/// syncs have run" — the one answer a caller cannot distinguish from the truth./// The host's log follows the same rule.-pub async fn sync_audit_log_rpc() -> Result<RpcOutcome<SyncAuditLogResponse>, String> {+pub async fn sync_audit_log_rpc() -> Result<Outcome<SyncAuditLogResponse>, String> {tracing::debug!("[memory_sources] sync_audit_log_rpc: entry");let config = config_rpc::load_config_with_timeout().await?;let binding = crate::memory::binding::for_config(&config)?;@@ -72,7 +72,7 @@ pub async fn sync_audit_log_rpc() -> Result<RpcOutcome<SyncAuditLogResponse>, Stentries = entries.len(),"[memory_sources] sync_audit_log_rpc: exit");- Ok(RpcOutcome::new(SyncAuditLogResponse { entries }, vec![]))+ Ok(Outcome::new(SyncAuditLogResponse { entries }, vec![]))}// ── Estimate Sync Cost ──@@ -102,7 +102,7 @@ pub struct EstimateSyncCostResponse {/// `0.0`, which would read as "syncing this is free".pub async fn estimate_sync_cost_rpc(req: EstimateSyncCostRequest,-) -> Result<RpcOutcome<EstimateSyncCostResponse>, String> {+) -> Result<Outcome<EstimateSyncCostResponse>, String> {tracing::debug!(source_id = %req.source_id, "[memory_sources] estimate_sync_cost_rpc: entry");let source = registry::get_source(&req.source_id)@@ -137,7 +137,7 @@ pub async fn estimate_sync_cost_rpc(estimated_cost_usd,"[memory_sources] estimate_sync_cost_rpc: exit");- Ok(RpcOutcome::new(+ Ok(Outcome::new(EstimateSyncCostResponse {source_id: req.source_id,item_count,@@ -263,7 +263,7 @@ pub(super) fn summarise_logs(}}-pub async fn monthly_cost_summary_rpc() -> Result<RpcOutcome<MonthlyCostSummaryResponse>, String> {+pub async fn monthly_cost_summary_rpc() -> Result<Outcome<MonthlyCostSummaryResponse>, String> {tracing::debug!("[memory_sources] monthly_cost_summary_rpc: entry");let config = config_rpc::load_config_with_timeout().await?;let binding = crate::memory::binding::for_config(&config)?;@@ -290,5 +290,5 @@ pub async fn monthly_cost_summary_rpc() -> Result<RpcOutcome<MonthlyCostSummaryRtotals_complete = summary.totals_complete,"[memory_sources] monthly_cost_summary_rpc: exit");- Ok(RpcOutcome::new(summary, vec![]))+ Ok(Outcome::new(summary, vec![]))}diff --git a/crates/openhuman-core/src/memory/sources/rpc/registry_crud.rs b/crates/openhuman-core/src/memory/sources/rpc/registry_crud.rsindex d72837acbd..b3a3fffbd4 100644--- a/crates/openhuman-core/src/memory/sources/rpc/registry_crud.rs+++ b/crates/openhuman-core/src/memory/sources/rpc/registry_crud.rs@@ -7,7 +7,7 @@ use crate::memory::sources::apply_kind_defaults;use crate::memory::sources::readers;use crate::memory::sources::registry::{self, MemorySourcePatch};use crate::memory::sources::types::{MemorySourceEntry, SourceKind};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;// ── List ──@@ -16,7 +16,7 @@ pub struct ListResponse {pub sources: Vec<MemorySourceEntry>,}-pub async fn list_rpc() -> Result<RpcOutcome<ListResponse>, String> {+pub async fn list_rpc() -> Result<Outcome<ListResponse>, String> {tracing::debug!("[memory_sources] list_rpc: entry");// Lazily reconcile Composio connections into the registry so users// see freshly-connected integrations as memory sources immediately,@@ -39,7 +39,7 @@ pub async fn list_rpc() -> Result<RpcOutcome<ListResponse>, String> {returned = filtered.len(),"[memory_sources] list_rpc: filtered listing to active connections");- Ok(RpcOutcome::new(ListResponse { sources: filtered }, vec![]))+ Ok(Outcome::new(ListResponse { sources: filtered }, vec![]))}/// Filter the registry listing down to the live, deduplicated set of sources.@@ -97,10 +97,10 @@ pub struct GetResponse {pub source: Option<MemorySourceEntry>,}-pub async fn get_rpc(req: GetRequest) -> Result<RpcOutcome<GetResponse>, String> {+pub async fn get_rpc(req: GetRequest) -> Result<Outcome<GetResponse>, String> {tracing::debug!(id = %req.id, "[memory_sources] get_rpc: entry");let source = registry::get_source(&req.id).await?;- Ok(RpcOutcome::new(GetResponse { source }, vec![]))+ Ok(Outcome::new(GetResponse { source }, vec![]))}// ── Add ──@@ -158,7 +158,7 @@ pub struct AddResponse {pub source: MemorySourceEntry,}-pub async fn add_rpc(req: AddRequest) -> Result<RpcOutcome<AddResponse>, String> {+pub async fn add_rpc(req: AddRequest) -> Result<Outcome<AddResponse>, String> {tracing::info!(kind = %req.kind.as_str(),label = %req.label,@@ -193,7 +193,7 @@ pub async fn add_rpc(req: AddRequest) -> Result<RpcOutcome<AddResponse>, String>apply_kind_defaults(&mut entry);let source = registry::add_source(entry).await?;- Ok(RpcOutcome::new(AddResponse { source }, vec![]))+ Ok(Outcome::new(AddResponse { source }, vec![]))}// ── Update ──@@ -210,10 +210,10 @@ pub struct UpdateResponse {pub source: MemorySourceEntry,}-pub async fn update_rpc(req: UpdateRequest) -> Result<RpcOutcome<UpdateResponse>, String> {+pub async fn update_rpc(req: UpdateRequest) -> Result<Outcome<UpdateResponse>, String> {tracing::info!(id = %req.id, "[memory_sources] update_rpc: entry");let source = registry::update_source(&req.id, req.patch).await?;- Ok(RpcOutcome::new(UpdateResponse { source }, vec![]))+ Ok(Outcome::new(UpdateResponse { source }, vec![]))}// ── Remove ──@@ -228,10 +228,10 @@ pub struct RemoveResponse {pub removed: bool,}-pub async fn remove_rpc(req: RemoveRequest) -> Result<RpcOutcome<RemoveResponse>, String> {+pub async fn remove_rpc(req: RemoveRequest) -> Result<Outcome<RemoveResponse>, String> {tracing::info!(id = %req.id, "[memory_sources] remove_rpc: entry");let removed = registry::remove_source(&req.id).await?;- Ok(RpcOutcome::new(RemoveResponse { removed }, vec![]))+ Ok(Outcome::new(RemoveResponse { removed }, vec![]))}// ── List Items ──@@ -248,7 +248,7 @@ pub struct ListItemsResponse {pub async fn list_items_rpc(req: ListItemsRequest,-) -> Result<RpcOutcome<ListItemsResponse>, String> {+) -> Result<Outcome<ListItemsResponse>, String> {tracing::debug!(source_id = %req.source_id, "[memory_sources] list_items_rpc: entry");let source = registry::get_source(&req.source_id)@@ -259,7 +259,7 @@ pub async fn list_items_rpc(let reader = readers::reader_for(&source.kind);let items = reader.list_items(&source, &config).await?;- Ok(RpcOutcome::new(ListItemsResponse { items }, vec![]))+ Ok(Outcome::new(ListItemsResponse { items }, vec![]))}// ── Read Item ──@@ -275,7 +275,7 @@ pub struct ReadItemResponse {pub content: crate::memory::sources::types::SourceContent,}-pub async fn read_item_rpc(req: ReadItemRequest) -> Result<RpcOutcome<ReadItemResponse>, String> {+pub async fn read_item_rpc(req: ReadItemRequest) -> Result<Outcome<ReadItemResponse>, String> {tracing::debug!(source_id = %req.source_id,item_id = %req.item_id,@@ -290,5 +290,5 @@ pub async fn read_item_rpc(req: ReadItemRequest) -> Result<RpcOutcome<ReadItemRelet reader = readers::reader_for(&source.kind);let content = reader.read_item(&source, &req.item_id, &config).await?;- Ok(RpcOutcome::new(ReadItemResponse { content }, vec![]))+ Ok(Outcome::new(ReadItemResponse { content }, vec![]))}diff --git a/crates/openhuman-core/src/memory/sources/rpc/source_sync.rs b/crates/openhuman-core/src/memory/sources/rpc/source_sync.rsindex d6f6a8444b..cff8b18aa6 100644--- a/crates/openhuman-core/src/memory/sources/rpc/source_sync.rs+++ b/crates/openhuman-core/src/memory/sources/rpc/source_sync.rs@@ -5,7 +5,7 @@ use super::coding_sessions::unserved;use crate::config::rpc as config_rpc;use crate::memory::sources::registry;use crate::memory::sources::types::MemorySourceEntry;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;// ── Sync ──@@ -106,7 +106,7 @@ pub(super) fn describe_source_sync_failure(}}-pub async fn sync_rpc(req: SyncRequest) -> Result<RpcOutcome<SyncResponse>, String> {+pub async fn sync_rpc(req: SyncRequest) -> Result<Outcome<SyncResponse>, String> {tracing::info!(source_id = %req.source_id, "[memory_sources] sync_rpc: entry");let config = config_rpc::load_config_with_timeout().await?;@@ -146,7 +146,7 @@ pub async fn sync_rpc(req: SyncRequest) -> Result<RpcOutcome<SyncResponse>, Strimax_items,).await?;- return Ok(RpcOutcome::new(+ return Ok(Outcome::new(SyncResponse {requested: true,source_id: req.source_id,@@ -180,7 +180,7 @@ pub async fn sync_rpc(req: SyncRequest) -> Result<RpcOutcome<SyncResponse>, Stri).await?;- Ok(RpcOutcome::new(+ Ok(Outcome::new(SyncResponse {requested: true,source_id: req.source_id,@@ -235,7 +235,7 @@ pub struct ReconcileResponse {/// The scopes themselves are still derived host-side (`derive_scopes` reads the/// registry row); what moved is the crosscheck and the repair, which are/// `MemorySourceSync::raw_archive_coverage` and `rebuild_from_raw_archive`.-pub async fn reconcile_rpc(req: ReconcileRequest) -> Result<RpcOutcome<ReconcileResponse>, String> {+pub async fn reconcile_rpc(req: ReconcileRequest) -> Result<Outcome<ReconcileResponse>, String> {use crate::memory::sources::sync::derive_scopes;tracing::info!(@@ -324,7 +324,7 @@ pub async fn reconcile_rpc(req: ReconcileRequest) -> Result<RpcOutcome<Reconcile}}- Ok(RpcOutcome::new(+ Ok(Outcome::new(ReconcileResponse { scopes: reports },vec![],))diff --git a/crates/openhuman-core/src/memory/sources/rpc/status_toolkits.rs b/crates/openhuman-core/src/memory/sources/rpc/status_toolkits.rsindex caa3c2f749..71499cdff6 100644--- a/crates/openhuman-core/src/memory/sources/rpc/status_toolkits.rs+++ b/crates/openhuman-core/src/memory/sources/rpc/status_toolkits.rs@@ -1,7 +1,7 @@//! Per-source ingest status and the supported-toolkit catalog.use crate::config::rpc as config_rpc;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;// ── Status List ──@@ -10,11 +10,11 @@ pub struct StatusListResponse {pub statuses: Vec<crate::memory::sources::status::SourceStatus>,}-pub async fn status_list_rpc() -> Result<RpcOutcome<StatusListResponse>, String> {+pub async fn status_list_rpc() -> Result<Outcome<StatusListResponse>, String> {tracing::debug!("[memory_sources] status_list_rpc: entry");let config = config_rpc::load_config_with_timeout().await?;let statuses = crate::memory::sources::status::status_list(&config).await?;- Ok(RpcOutcome::new(StatusListResponse { statuses }, vec![]))+ Ok(Outcome::new(StatusListResponse { statuses }, vec![]))}// ── Supported Toolkits ──@@ -42,7 +42,7 @@ pub struct SupportedToolkitsResponse {/// registration step (`init_default_composio_sync_providers`) is needed any/// more either: this is now a `&'static` table read, not a process-global/// `HashMap` that has to be primed first.-pub async fn supported_toolkits_rpc() -> Result<RpcOutcome<SupportedToolkitsResponse>, String> {+pub async fn supported_toolkits_rpc() -> Result<Outcome<SupportedToolkitsResponse>, String> {tracing::debug!("[memory_sources] supported_toolkits_rpc: entry");let mut toolkits: Vec<String> = crate::integrations::composio::providers::NATIVE_PROVIDERS@@ -57,7 +57,7 @@ pub async fn supported_toolkits_rpc() -> Result<RpcOutcome<SupportedToolkitsResptoolkits = ?toolkits,"[memory_sources] supported_toolkits_rpc: resolved supported toolkit set");- Ok(RpcOutcome::new(+ Ok(Outcome::new(SupportedToolkitsResponse { toolkits },vec![],))diff --git a/crates/openhuman-core/src/memory/sources/schemas.rs b/crates/openhuman-core/src/memory/sources/schemas.rsindex 7ddc0973d9..f979d25dff 100644--- a/crates/openhuman-core/src/memory/sources/schemas.rs+++ b/crates/openhuman-core/src/memory/sources/schemas.rs@@ -15,7 +15,7 @@ use serde_json::Value;use crate::core::all::RegisteredController;use crate::core::ControllerSchema;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;mod apply_all_schemas;mod coding_session_schemas;@@ -139,6 +139,6 @@ fn parse_value<T: DeserializeOwned>(v: Value) -> Result<T, String> {serde_json::from_value(v).map_err(|e| format!("invalid params: {e}"))}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/memory/sync/composio/providers/slack/rpc.rs b/crates/openhuman-core/src/memory/sync/composio/providers/slack/rpc.rsindex dc0c032f73..18544da43e 100644--- a/crates/openhuman-core/src/memory/sync/composio/providers/slack/rpc.rs+++ b/crates/openhuman-core/src/memory/sync/composio/providers/slack/rpc.rs@@ -42,7 +42,7 @@ use crate::integrations::composio::client::{use crate::integrations::composio::ops::run_sync_within_budget;use crate::integrations::composio::providers::SyncOutcome;use crate::integrations::composio::types::ComposioConnectionsResponse;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// Optional connection-id override for the trigger. When absent, all/// active Slack connections are synced (serially, one-by-one).@@ -90,7 +90,7 @@ async fn list_slack_connections(config: &Config) -> Result<ComposioConnectionsRepub async fn sync_trigger_rpc(config: &Config,req: SyncTriggerRequest,-) -> Result<RpcOutcome<SyncTriggerResponse>, String> {+) -> Result<Outcome<SyncTriggerResponse>, String> {// Route through the mode-aware factory so direct-mode users// discover slack connections from THEIR personal Composio tenant —// not the tinyhumans backend tenant. Mirrors `composio::ops`@@ -151,7 +151,7 @@ pub async fn sync_trigger_rpc(}let synced = outcomes.len();- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(SyncTriggerResponse {outcomes,connections_considered: considered,@@ -208,7 +208,7 @@ pub struct ConnectionStatus {pub async fn sync_status_rpc(config: &Config,_req: SyncStatusRequest,-) -> Result<RpcOutcome<SyncStatusResponse>, String> {+) -> Result<Outcome<SyncStatusResponse>, String> {// Route through the mode-aware factory so direct-mode users see// status rows for THEIR slack connections, not the tinyhumans// backend tenant's (#1710).@@ -232,7 +232,7 @@ pub async fn sync_status_rpc(}let count = rows.len();- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(SyncStatusResponse { connections: rows },format!("slack_ingest: status connections={count} (per-connection sync detail is no \diff --git a/crates/openhuman-core/src/memory/sync/composio/providers/slack/schemas.rs b/crates/openhuman-core/src/memory/sync/composio/providers/slack/schemas.rsindex 5e5221a706..001dbb54c0 100644--- a/crates/openhuman-core/src/memory/sync/composio/providers/slack/schemas.rs+++ b/crates/openhuman-core/src/memory/sync/composio/providers/slack/schemas.rs@@ -17,7 +17,7 @@ use super::rpc as slack_rpc;use crate::config::rpc as config_rpc;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;const NAMESPACE: &str = "slack_memory";@@ -129,6 +129,6 @@ fn parse_value<T: DeserializeOwned>(v: Value) -> Result<T, String> {serde_json::from_value(v).map_err(|e| format!("invalid params: {e}"))}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/memory/sync/mod.rs b/crates/openhuman-core/src/memory/sync/mod.rsindex 17460a13a7..5c8fc03683 100644--- a/crates/openhuman-core/src/memory/sync/mod.rs+++ b/crates/openhuman-core/src/memory/sync/mod.rs@@ -1,7 +1,7 @@//! Host layer over the memory sync domain.//!//! What lives here is the JSON-RPC surface — handlers and controller schemas-//! name OpenHuman's `RpcOutcome` and `ControllerSchema`, which no engine crate+//! name OpenHuman's `Outcome` and `ControllerSchema`, which no engine crate//! can see. The two submodules below are that surface.//!//! # Why there is no `pub use tinymemory_core::sync::*;` here any more (#5560)diff --git a/crates/openhuman-core/src/memory/sync/sync_status/rpc.rs b/crates/openhuman-core/src/memory/sync/sync_status/rpc.rsindex 6e5ddf68aa..06fe7199b1 100644--- a/crates/openhuman-core/src/memory/sync/sync_status/rpc.rs+++ b/crates/openhuman-core/src/memory/sync/sync_status/rpc.rs@@ -1,7 +1,7 @@//! OpenHuman RPC shell for memory synchronization status.use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use tinymemory_api::provider::sync::{SourceSyncStatus, SyncFreshness};@@ -47,7 +47,7 @@ pub(super) fn into_wire(status: SourceSyncStatus) -> MemorySyncStatus {}}-pub async fn status_list_rpc(config: &Config) -> Result<RpcOutcome<StatusListResponse>, String> {+pub async fn status_list_rpc(config: &Config) -> Result<Outcome<StatusListResponse>, String> {tracing::debug!("[memory_sync_status][rpc] status_list via the bound driver");// Degrading a failure to an empty list is inherited behaviour, kept@@ -79,7 +79,7 @@ pub async fn status_list_rpc(config: &Config) -> Result<RpcOutcome<StatusListRes}};- Ok(RpcOutcome::new(StatusListResponse { statuses }, Vec::new()))+ Ok(Outcome::new(StatusListResponse { statuses }, Vec::new()))}#[cfg(test)]diff --git a/crates/openhuman-core/src/memory/sync/sync_status/schemas.rs b/crates/openhuman-core/src/memory/sync/sync_status/schemas.rsindex c8a3e1afc7..d75de1563b 100644--- a/crates/openhuman-core/src/memory/sync/sync_status/schemas.rs+++ b/crates/openhuman-core/src/memory/sync/sync_status/schemas.rs@@ -15,7 +15,7 @@ use serde_json::{Map, Value};use crate::config::ops::load_config_with_timeout;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::rpc;@@ -57,7 +57,7 @@ fn handle_status_list(_params: Map<String, Value>) -> ControllerFuture {})}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/memory/tree/README.md b/crates/openhuman-core/src/memory/tree/README.mdindex ec810a02ee..0d24f3571b 100644--- a/crates/openhuman-core/src/memory/tree/README.md+++ b/crates/openhuman-core/src/memory/tree/README.md@@ -2,7 +2,7 @@Host layer over the memory tree engine, which now lives in the TinyMemorymodule (see [`memory/README.md`](../README.md) for the extraction). Every-handler and schema here names OpenHuman's `RpcOutcome` and `ControllerSchema`,+handler and schema here names OpenHuman's `Outcome` and `ControllerSchema`,which the engine crate cannot see, so this directory is what stayed behind:RPC surface, not tree mechanics.diff --git a/crates/openhuman-core/src/memory/tree/mod.rs b/crates/openhuman-core/src/memory/tree/mod.rsindex 5d092b5585..b27caa8ad2 100644--- a/crates/openhuman-core/src/memory/tree/mod.rs+++ b/crates/openhuman-core/src/memory/tree/mod.rs@@ -2,7 +2,7 @@//!//! The domain itself lives in the extracted engine crates; what stays here is//! its JSON-RPC surface — handlers and controller schemas name OpenHuman's-//! `RpcOutcome` and `ControllerSchema`, which the engine crate cannot see.+//! `Outcome` and `ControllerSchema`, which the engine crate cannot see.//!//! # The `pub use tinymemory_core::tree::*` shim is gone (#5560)//!diff --git a/crates/openhuman-core/src/memory/tree/retrieval/mod.rs b/crates/openhuman-core/src/memory/tree/retrieval/mod.rsindex 9fc16cd675..d80abbc2c5 100644--- a/crates/openhuman-core/src/memory/tree/retrieval/mod.rs+++ b/crates/openhuman-core/src/memory/tree/retrieval/mod.rs@@ -2,7 +2,7 @@//!//! The domain itself lives in the extracted crate; what stays here is its//! JSON-RPC surface — handlers and controller schemas name OpenHuman's-//! `RpcOutcome` and `ControllerSchema`, which the engine crate cannot see.+//! `Outcome` and `ControllerSchema`, which the engine crate cannot see.//!//! # The engine glob is gone — it had no production caller left (#5560)//!diff --git a/crates/openhuman-core/src/memory/tree/retrieval/rpc.rs b/crates/openhuman-core/src/memory/tree/retrieval/rpc.rsindex d2426bf5ed..99e556fd17 100644--- a/crates/openhuman-core/src/memory/tree/retrieval/rpc.rs+++ b/crates/openhuman-core/src/memory/tree/retrieval/rpc.rs@@ -63,7 +63,7 @@ use crate::memory::api::provider::retrieval::{CoverWindowQuery, EntityMatch, RetrievalHit, RetrievalResponse, SourceRetrievalQuery,};use crate::memory::source_scope::as_bus_scope;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use tinymemory_api::chunks::SourceKind;// ── query_source ──────────────────────────────────────────────────────@@ -96,7 +96,7 @@ pub struct QuerySourceRequest {pub async fn query_source_rpc(config: &Config,req: QuerySourceRequest,-) -> Result<RpcOutcome<RetrievalResponse>, String> {+) -> Result<Outcome<RetrievalResponse>, String> {// Parsed before the driver is resolved, so an unknown kind stays a caller// error naming the offending value rather than a driver round trip that// matches nothing and reads as an empty store.@@ -137,7 +137,7 @@ pub async fn query_source_rpc(};let n = resp.hits.len();// Omit scope / source_id from the log — can carry PII. Log counts only.- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(resp,format!("memory_tree: query_source has_source_id={} source_kind={:?} has_query={} hits={}",@@ -177,7 +177,7 @@ pub struct CoverWindowRequest {pub async fn cover_window_rpc(config: &Config,req: CoverWindowRequest,-) -> Result<RpcOutcome<RetrievalResponse>, String> {+) -> Result<Outcome<RetrievalResponse>, String> {log::debug!("[rpc][memory_tree] cover_window enter since_ms={} until_ms={} has_source_id={} has_source_kind={} has_limit={}",req.since_ms,@@ -232,7 +232,7 @@ pub async fn cover_window_rpc(resp.total);// Omit scope / source_id from the log — can carry PII. Counts only.- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(resp,format!("memory_tree: cover_window since_ms={} until_ms={} has_source_id={} source_kind={:?} hits={}",@@ -269,7 +269,7 @@ pub struct SearchEntitiesResponse {pub async fn search_entities_rpc(config: &Config,req: SearchEntitiesRequest,-) -> Result<RpcOutcome<SearchEntitiesResponse>, String> {+) -> Result<Outcome<SearchEntitiesResponse>, String> {// Capture logging-friendly summary BEFORE we move fields out of `req`.let query_len = req.query.len();let has_kinds = req.kinds.is_some();@@ -314,7 +314,7 @@ pub async fn search_entities_rpc(let n = matches.len();// Don't log the raw search query — can be an email, handle, etc. Log// only its length and the kind filter.- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(SearchEntitiesResponse { matches },format!("memory_tree: search_entities query_len={query_len} has_kinds={has_kinds} n={n}"),))@@ -353,7 +353,7 @@ pub struct DrillDownResponse {pub async fn drill_down_rpc(config: &Config,req: DrillDownRequest,-) -> Result<RpcOutcome<DrillDownResponse>, String> {+) -> Result<Outcome<DrillDownResponse>, String> {let depth = req.max_depth.unwrap_or(1);// The explicit scope, never `None` — see the module docs.let scope = as_bus_scope();@@ -389,7 +389,7 @@ pub async fn drill_down_rpc(.split_once(':').map(|(k, _)| k).unwrap_or("unknown");- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(DrillDownResponse { hits },format!("memory_tree: drill_down node_kind={} depth={} has_query={} limit={:?} n={}",@@ -425,7 +425,7 @@ pub struct FetchLeavesResponse {pub async fn fetch_leaves_rpc(config: &Config,req: FetchLeavesRequest,-) -> Result<RpcOutcome<FetchLeavesResponse>, String> {+) -> Result<Outcome<FetchLeavesResponse>, String> {// The explicit scope, never `None` — see the module docs. It matters most// here: this member takes ids the caller chose.let scope = as_bus_scope();@@ -447,7 +447,7 @@ pub async fn fetch_leaves_rpc(}};let n = hits.len();- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(FetchLeavesResponse { hits },format!("memory_tree: fetch_leaves n={n}"),))diff --git a/crates/openhuman-core/src/memory/tree/retrieval/rpc_tests.rs b/crates/openhuman-core/src/memory/tree/retrieval/rpc_tests.rsindex 629a851ec1..e0b8c0f3d5 100644--- a/crates/openhuman-core/src/memory/tree/retrieval/rpc_tests.rs+++ b/crates/openhuman-core/src/memory/tree/retrieval/rpc_tests.rs@@ -2,7 +2,7 @@//!//! Scope: the handler layer specifically — param parsing, default//! fallbacks, `SourceKind` / `EntityKind` validation, the scope each call-//! forwards to the contract, `RpcOutcome` envelope shape, and PII-redacted+//! forwards to the contract, `Outcome` envelope shape, and PII-redacted//! log formatting. Retrieval correctness is the driver's and is covered by//! the engine's own tests; these deliberately do NOT re-verify it.//!diff --git a/crates/openhuman-core/src/memory/tree/retrieval/schemas.rs b/crates/openhuman-core/src/memory/tree/retrieval/schemas.rsindex 6949e51df6..10e0e54e3a 100644--- a/crates/openhuman-core/src/memory/tree/retrieval/schemas.rs+++ b/crates/openhuman-core/src/memory/tree/retrieval/schemas.rs@@ -17,7 +17,7 @@ use crate::config::rpc as config_rpc;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};use crate::memory::tree::retrieval::rpc as retrieval_rpc;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;const NAMESPACE: &str = "memory_tree";@@ -362,7 +362,7 @@ fn parse_value<T: DeserializeOwned>(v: Value) -> Result<T, String> {serde_json::from_value(v).map_err(|e| format!("invalid params: {e}"))}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/memory/tree/tree/mod.rs b/crates/openhuman-core/src/memory/tree/tree/mod.rsindex f769a7b3d2..bb61c90bc6 100644--- a/crates/openhuman-core/src/memory/tree/tree/mod.rs+++ b/crates/openhuman-core/src/memory/tree/tree/mod.rs@@ -2,7 +2,7 @@//!//! The domain itself lives in the extracted crate; what stays here is its//! JSON-RPC surface — handlers and controller schemas name OpenHuman's-//! `RpcOutcome` and `ControllerSchema`, which the engine crate cannot see.+//! `Outcome` and `ControllerSchema`, which the engine crate cannot see.//!//! # The `pub use tinymemory_core::tree::tree::*` shim is gone (#5560)//!diff --git a/crates/openhuman-core/src/memory/tree/tree/rpc/backfill.rs b/crates/openhuman-core/src/memory/tree/tree/rpc/backfill.rsindex 0cbc5bb7fb..11900e4f76 100644--- a/crates/openhuman-core/src/memory/tree/tree/rpc/backfill.rs+++ b/crates/openhuman-core/src/memory/tree/tree/rpc/backfill.rs@@ -9,7 +9,7 @@use serde::{Deserialize, Serialize};use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// The driver's identifier for a re-embed backfill job.///@@ -115,7 +115,7 @@ pub struct BackfillStatusResponse {/// the user that semantic recall is reduced until it drains.pub async fn backfill_status_rpc(config: &Config,-) -> Result<RpcOutcome<BackfillStatusResponse>, String> {+) -> Result<Outcome<BackfillStatusResponse>, String> {log::debug!("[memory::rpc] backfill_status: entry");// Asked of the bound driver rather than of TinyCortex's tables. No// `spawn_blocking` here any more: the driver owns whether its own reads@@ -146,7 +146,7 @@ pub async fn backfill_status_rpc(false});let in_progress = driver_backfilling || pending_jobs > 0;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(BackfillStatusResponse {in_progress,pending_jobs,diff --git a/crates/openhuman-core/src/memory/tree/tree/rpc/chunks.rs b/crates/openhuman-core/src/memory/tree/tree/rpc/chunks.rsindex db80064f55..069b28730d 100644--- a/crates/openhuman-core/src/memory/tree/tree/rpc/chunks.rs+++ b/crates/openhuman-core/src/memory/tree/tree/rpc/chunks.rs@@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};use crate::config::Config;use crate::memory::api::provider::ChunkQuery;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use tinymemory_api::chunks::{Chunk, SourceKind};/// Query shape for the `list_chunks` RPC.@@ -41,7 +41,7 @@ pub struct ListChunksResponse {pub async fn list_chunks_rpc(config: &Config,req: ListChunksRequest,-) -> Result<RpcOutcome<ListChunksResponse>, String> {+) -> Result<Outcome<ListChunksResponse>, String> {// Parsed before the driver is resolved so an unknown kind stays a caller// error naming the offending value, rather than a driver round trip that// returns nothing and looks like an empty store.@@ -84,7 +84,7 @@ pub async fn list_chunks_rpc(};let n = rows.len();- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(ListChunksResponse { chunks: rows },format!("memory_tree: list_chunks n={n}"),))@@ -106,7 +106,7 @@ pub struct GetChunkResponse {pub async fn get_chunk_rpc(config: &Config,req: GetChunkRequest,-) -> Result<RpcOutcome<GetChunkResponse>, String> {+) -> Result<Outcome<GetChunkResponse>, String> {let binding = crate::memory::binding::for_config(config)?;let chunk = match binding.provider().as_chunks() {Some(chunks) => chunks@@ -125,7 +125,7 @@ pub async fn get_chunk_rpc(None}};- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(GetChunkResponse { chunk },format!("memory_tree: get_chunk id={}", req.id),))diff --git a/crates/openhuman-core/src/memory/tree/tree/rpc/ingest.rs b/crates/openhuman-core/src/memory/tree/tree/rpc/ingest.rsindex f7e76ada9d..07060e1b7e 100644--- a/crates/openhuman-core/src/memory/tree/tree/rpc/ingest.rs+++ b/crates/openhuman-core/src/memory/tree/tree/rpc/ingest.rs@@ -3,7 +3,7 @@//! family.use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use tinymemory_api::chunks::{DataSource, SourceKind, SourceRef};use tinymemory_api::provider::types::{IngestItem, IngestOutcome};use tinymemory_api::types::MemoryTaint;@@ -368,7 +368,7 @@ fn response_from_outcome(source_id: String, outcome: IngestOutcome) -> IngestRespub async fn ingest_rpc(config: &Config,req: IngestRequest,-) -> Result<RpcOutcome<IngestResponse>, String> {+) -> Result<Outcome<IngestResponse>, String> {let IngestRequest {source_kind,source_id,@@ -458,7 +458,7 @@ pub async fn ingest_rpc(}};- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(response,format!("memory_tree: ingest kind={} source_id={source_id}",diff --git a/crates/openhuman-core/src/memory/tree/tree/rpc/pipeline_status.rs b/crates/openhuman-core/src/memory/tree/tree/rpc/pipeline_status.rsindex 2bc807b047..eb22656039 100644--- a/crates/openhuman-core/src/memory/tree/tree/rpc/pipeline_status.rs+++ b/crates/openhuman-core/src/memory/tree/tree/rpc/pipeline_status.rs@@ -5,7 +5,7 @@use serde::{Deserialize, Serialize};use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::backfill::{queue_stats, store_stats};use super::retry_failed::latest_failed_job_failure;@@ -217,7 +217,7 @@ pub(super) fn gate_pause_state(/// runtime isn't held during SQLite or filesystem I/O.pub async fn pipeline_status_rpc(config: &Config,-) -> Result<RpcOutcome<PipelineStatusResponse>, String> {+) -> Result<Outcome<PipelineStatusResponse>, String> {use tinymemory_api::host::SchedulerGateMode;log::debug!("[memory-tree][rpc] pipeline_status: entry");@@ -391,7 +391,7 @@ pub async fn pipeline_status_rpc(f = payload.pipeline_jobs.failed,);- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(payload,format!("memory_tree: pipeline_status status={status} total_chunks={total_chunks} is_paused={is_paused} is_syncing={is_syncing}",@@ -412,7 +412,7 @@ pub async fn pipeline_status_rpc(/// is unchanged.pub async fn doctor_rpc(config: &Config,-) -> Result<RpcOutcome<crate::memory::tree::health::report::DoctorReport>, String> {+) -> Result<Outcome<crate::memory::tree::health::report::DoctorReport>, String> {let report = crate::memory::tree::health::report::run_doctor(config).await;let summary = if report.healthy {"memory_tree: doctor — healthy".to_string()@@ -426,5 +426,5 @@ pub async fn doctor_rpc(.unwrap_or("unknown"))};- Ok(RpcOutcome::single_log(report, summary))+ Ok(Outcome::single_log(report, summary))}diff --git a/crates/openhuman-core/src/memory/tree/tree/rpc/retry_failed.rs b/crates/openhuman-core/src/memory/tree/tree/rpc/retry_failed.rsindex 702639701c..26eee2dc72 100644--- a/crates/openhuman-core/src/memory/tree/tree/rpc/retry_failed.rs+++ b/crates/openhuman-core/src/memory/tree/tree/rpc/retry_failed.rs@@ -4,7 +4,7 @@use serde::{Deserialize, Serialize};use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// Response from `memory_tree_retry_failed` (#002 FR-011).#[derive(Clone, Debug, Serialize, Deserialize)]@@ -17,12 +17,12 @@ pub struct RetryFailedResponse {/// terminally-`failed` `mem_tree_jobs` row back to `ready` (fresh attempt/// budget, typed reason cleared) so jobs that failed under a now-fixed config/// re-run without re-ingesting source data. Backs the "Retry failed" button.-pub async fn retry_failed_rpc(config: &Config) -> Result<RpcOutcome<RetryFailedResponse>, String> {+pub async fn retry_failed_rpc(config: &Config) -> Result<Outcome<RetryFailedResponse>, String> {// Requeue and wake are one operation at the driver. They were two calls// here, which is one call away from a retry that moves rows and then lets// them sit until the next scheduled window.let requeued = crate::memory::ops::maintenance::retry_failed(config).await?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(RetryFailedResponse { requeued },format!("memory_tree: retry_failed requeued={requeued}"),))diff --git a/crates/openhuman-core/src/memory/tree/tree/rpc/set_enabled.rs b/crates/openhuman-core/src/memory/tree/tree/rpc/set_enabled.rsindex f068c6d113..6d58fe7df1 100644--- a/crates/openhuman-core/src/memory/tree/tree/rpc/set_enabled.rs+++ b/crates/openhuman-core/src/memory/tree/tree/rpc/set_enabled.rs@@ -4,7 +4,7 @@use serde::{Deserialize, Serialize};use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// Request shape for `memory_tree_set_enabled`. Single field — the caller/// asks to enable (auto-mode) or pause (off-mode) all LLM-bound background@@ -42,7 +42,7 @@ pub struct SetEnabledResponse {pub async fn set_enabled_rpc(config: &mut Config,req: SetEnabledRequest,-) -> Result<RpcOutcome<SetEnabledResponse>, String> {+) -> Result<Outcome<SetEnabledResponse>, String> {use tinymemory_api::host::SchedulerGateMode;let prev_mode = config.scheduler_gate.mode;@@ -64,7 +64,7 @@ pub async fn set_enabled_rpc("[memory-tree][rpc] set_enabled: no-op (mode already {})",new_mode.as_str());- return Ok(RpcOutcome::single_log(+ return Ok(Outcome::single_log(SetEnabledResponse {enabled: req.enabled,changed: false,@@ -96,7 +96,7 @@ pub async fn set_enabled_rpc(req.enabled,);- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(SetEnabledResponse {enabled: req.enabled,changed: true,diff --git a/crates/openhuman-core/src/memory/tree/tree_runtime/mod.rs b/crates/openhuman-core/src/memory/tree/tree_runtime/mod.rsindex 62c406b4eb..87088fdf20 100644--- a/crates/openhuman-core/src/memory/tree/tree_runtime/mod.rs+++ b/crates/openhuman-core/src/memory/tree/tree_runtime/mod.rs@@ -23,7 +23,7 @@//! route out, through `MemoryTree::flavour_profile`.//!//! What is left here is what could only ever have lived host-side: the handlers-//! and schemas name OpenHuman's `RpcOutcome` and `ControllerSchema`, the CLI+//! and schemas name OpenHuman's `Outcome` and `ControllerSchema`, the CLI//! names its argument parsing, and the subscriber names `DomainEvent`.// The summary-tree node model is **contract** vocabulary, not enginediff --git a/crates/openhuman-core/src/memory/tree/tree_runtime/ops.rs b/crates/openhuman-core/src/memory/tree/tree_runtime/ops.rsindex a9761bb4bc..ab47283eff 100644--- a/crates/openhuman-core/src/memory/tree/tree_runtime/ops.rs+++ b/crates/openhuman-core/src/memory/tree/tree_runtime/ops.rs@@ -22,7 +22,7 @@ use crate::memory::api::provider::{MemoryProvider, MemoryTree};// reason; see its comment on the node model.use crate::memory::api::tree::{estimate_tokens, QueryResult};use crate::memory::guard::MemoryGuard;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;// ── How these handlers reach the tree ───────────────────────────────────────//@@ -102,7 +102,7 @@ pub async fn tree_summarizer_ingest(content: &str,timestamp: Option<DateTime<Utc>>,metadata: Option<&Value>,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {// Defaulted here rather than driver-side, exactly as before: the reply// echoes the instant the content was filed under, and a timestamp the// driver resolved would disagree with the one reported here by however@@ -116,7 +116,7 @@ pub async fn tree_summarizer_ingest(.await.map_err(|error| driver_error("buffer write failed", error))?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({"buffered": true,"namespace": namespace.trim(),@@ -135,7 +135,7 @@ pub async fn tree_summarizer_ingest(pub async fn tree_summarizer_run(config: &Config,namespace: &str,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {// #002 FR-007's consent gate stays **host-side**, and this is the one thing// the door does not carry across. `runtime_summarize` builds the fold's// provider driver-side, "the way every scheduled seal builds it" — which is@@ -152,7 +152,7 @@ pub async fn tree_summarizer_run(let guard = tree_guard(config)?;match tree_of(&guard)?.runtime_summarize(namespace, ts).await {- Ok(Some(node)) => Ok(RpcOutcome::single_log(+ Ok(Some(node)) => Ok(Outcome::single_log(serde_json::to_value(&node).map_err(|e| e.to_string())?,format!("summarization completed for '{}': node {} ({} tokens)",@@ -161,7 +161,7 @@ pub async fn tree_summarizer_run(node.token_count),)),- Ok(None) => Ok(RpcOutcome::single_log(+ Ok(None) => Ok(Outcome::single_log(json!({ "skipped": true, "reason": "no buffered data" }),format!("summarization skipped for '{}': no buffered data",@@ -177,7 +177,7 @@ pub async fn tree_summarizer_query(config: &Config,namespace: &str,node_id: Option<&str>,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let target_id = node_id.unwrap_or("root");let guard = tree_guard(config)?;@@ -205,7 +205,7 @@ pub async fn tree_summarizer_query(.map_err(|error| driver_error("read children", error))?;let result = QueryResult { node, children };- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(serde_json::to_value(&result).map_err(|e| e.to_string())?,format!("queried node '{}' in namespace '{}'",@@ -219,14 +219,14 @@ pub async fn tree_summarizer_query(pub async fn tree_summarizer_status(config: &Config,namespace: &str,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let guard = tree_guard(config)?;let status = tree_of(&guard)?.runtime_tree_status(namespace).await.map_err(|error| driver_error("get status", error))?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(serde_json::to_value(&status).map_err(|e| e.to_string())?,format!("tree status for namespace '{}'", namespace.trim()),))@@ -236,7 +236,7 @@ pub async fn tree_summarizer_status(pub async fn tree_summarizer_rebuild(config: &Config,namespace: &str,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {// The consent gate, for the reason `tree_summarizer_run` gives.let _ = create_provider(config)?;@@ -246,7 +246,7 @@ pub async fn tree_summarizer_rebuild(.await.map_err(|error| driver_error("rebuild failed", error))?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(serde_json::to_value(&status).map_err(|e| e.to_string())?,format!("tree rebuilt for '{}': {} nodes",diff --git a/crates/openhuman-core/src/memory/tree/tree_runtime/schemas.rs b/crates/openhuman-core/src/memory/tree/tree_runtime/schemas.rsindex 77a6ee18a0..9495c641d4 100644--- a/crates/openhuman-core/src/memory/tree/tree_runtime/schemas.rs+++ b/crates/openhuman-core/src/memory/tree/tree_runtime/schemas.rs@@ -6,7 +6,7 @@ use serde_json::{Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub fn all_controller_schemas() -> Vec<ControllerSchema> {vec![@@ -275,7 +275,7 @@ fn read_optional_timestamp(}}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/platform/about_app/README.md b/crates/openhuman-core/src/platform/about_app/README.mdindex 05b3027dcc..2ef314d7c8 100644--- a/crates/openhuman-core/src/platform/about_app/README.md+++ b/crates/openhuman-core/src/platform/about_app/README.md@@ -18,7 +18,7 @@ The single source of truth for the OpenHuman desktop app's **user-facing capabil| `crates/openhuman-core/src/platform/about_app/mod.rs` | Export-only module root + docstring. Re-exports catalog reads, ops entry points, schema registry hooks, and types. || `crates/openhuman-core/src/platform/about_app/types.rs` | Serde domain types: `Capability`, `CapabilityCategory` (with `as_str` / `FromStr` incl. aliases), `CapabilityStatus`, `CapabilityPrivacy`, `PrivacyDataKind`. Inline serde/roundtrip tests. || `crates/openhuman-core/src/platform/about_app/catalog.rs` | Read API over the `CAPABILITIES` data it includes from `catalog_data.rs`. Implements `all_capabilities`, `capabilities_by_category`, `lookup`, `search`, and the `ensure_validated` integrity check. |-| `crates/openhuman-core/src/platform/about_app/ops.rs` | RPC-facing logic returning `RpcOutcome<T>`: `list_capabilities`, `lookup_capability`, `search_capabilities`. Thin wrappers over `catalog.rs` with summary logs. |+| `crates/openhuman-core/src/platform/about_app/ops.rs` | RPC-facing logic returning `Outcome<T>`: `list_capabilities`, `lookup_capability`, `search_capabilities`. Thin wrappers over `catalog.rs` with summary logs. || `crates/openhuman-core/src/platform/about_app/schemas.rs` | Controller schemas + `handle_*` async handlers for the three RPC methods; param structs; the `all_about_app_controller_schemas` / `all_about_app_registered_controllers` registry pair. || `crates/openhuman-core/src/platform/about_app/catalog_data.rs` | The `CAPABILITIES` data itself (`LazyLock<Vec<Capability>>`) plus the shared `CapabilityPrivacy` constants, concatenated from the `catalog_conversation_intelligence.rs`, `catalog_workflows_automation.rs`, `catalog_auth_channels_team.rs`, and `catalog_localai_settings_mobile.rs` submodules. || `crates/openhuman-core/src/platform/about_app/catalog_tests.rs` | Sibling test module (`#[path]`-included by `catalog.rs`) covering catalog behavior. |@@ -28,7 +28,7 @@ The single source of truth for the OpenHuman desktop app's **user-facing capabilRe-exported from `mod.rs`:- **Catalog reads** (`catalog`): `all_capabilities()`, `capabilities_by_category(CapabilityCategory)`, `lookup(&str)`, `search(&str)`.-- **Ops** (`ops`): `list_capabilities(Option<CapabilityCategory>) -> RpcOutcome<Vec<Capability>>`, `lookup_capability(&str) -> Result<RpcOutcome<Capability>, String>`, `search_capabilities(&str) -> RpcOutcome<Vec<Capability>>`.+- **Ops** (`ops`): `list_capabilities(Option<CapabilityCategory>) -> Outcome<Vec<Capability>>`, `lookup_capability(&str) -> Result<Outcome<Capability>, String>`, `search_capabilities(&str) -> Outcome<Vec<Capability>>`.- **Schema registry** (`schemas`): `about_app_schemas(&str)`, `all_about_app_controller_schemas()`, `all_about_app_registered_controllers()`.- **Types**: `Capability`, `CapabilityCategory`, `CapabilityPrivacy`, `CapabilityStatus`, `PrivacyDataKind`.@@ -42,7 +42,7 @@ Namespace `about_app`, registered into the global controller registry via `crate| `about_app.lookup` | `id` (string, required) | `capability: Capability` | Look up one capability by stable id (e.g. `local_ai.download_model`); errors on unknown id. || `about_app.search` | `query` (string, required) | `capabilities: Capability[]` | Keyword search; empty query returns all. |-Handlers deserialize params, log at `debug`, and emit `RpcOutcome` via `into_cli_compatible_json()`. The `category` input is schema-typed as an `Option<Enum>` of all `CapabilityCategory` wire names.+Handlers deserialize params, log at `debug`, and emit `Outcome` via `into_cli_compatible_json()`. The `category` input is schema-typed as an `Option<Enum>` of all `CapabilityCategory` wire names.## Agent tools@@ -58,7 +58,7 @@ None. No `store.rs`. The catalog is a compile-time `&'static [Capability]` const## Dependencies-- `crate::rpc::RpcOutcome` — return-type contract for ops/handlers.+- `crate::rpc::Outcome` — return-type contract for ops/handlers.- `crate::core::all::{ControllerFuture, RegisteredController}` — controller registration types (schemas.rs).- `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` — controller schema definitions (schemas.rs).diff --git a/crates/openhuman-core/src/platform/about_app/ops.rs b/crates/openhuman-core/src/platform/about_app/ops.rsindex 6084d3bfeb..ff96aa53be 100644--- a/crates/openhuman-core/src/platform/about_app/ops.rs+++ b/crates/openhuman-core/src/platform/about_app/ops.rs@@ -1,11 +1,11 @@//! RPC entry points for the about_app capability catalog.-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::types::{Capability, CapabilityCategory};use super::{all_capabilities, capabilities_by_category, lookup, search};-pub fn list_capabilities(category: Option<CapabilityCategory>) -> RpcOutcome<Vec<Capability>> {+pub fn list_capabilities(category: Option<CapabilityCategory>) -> Outcome<Vec<Capability>> {let capabilities = match category {Some(category) => capabilities_by_category(category),None => all_capabilities().to_vec(),@@ -14,23 +14,23 @@ pub fn list_capabilities(category: Option<CapabilityCategory>) -> RpcOutcome<Vec"about_app.list returned {} capabilities",capabilities.len());- RpcOutcome::single_log(capabilities, log)+ Outcome::single_log(capabilities, log)}-pub fn lookup_capability(id: &str) -> Result<RpcOutcome<Capability>, String> {+pub fn lookup_capability(id: &str) -> Result<Outcome<Capability>, String> {let capability = lookup(id).ok_or_else(|| format!("unknown capability id '{}'", id.trim()))?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(capability,format!("about_app.lookup returned {}", capability.id),))}-pub fn search_capabilities(query: &str) -> RpcOutcome<Vec<Capability>> {+pub fn search_capabilities(query: &str) -> Outcome<Vec<Capability>> {let capabilities = search(query);let log = format!("about_app.search returned {} capabilities for '{}'",capabilities.len(),query.trim());- RpcOutcome::single_log(capabilities, log)+ Outcome::single_log(capabilities, log)}diff --git a/crates/openhuman-core/src/platform/about_app/schemas.rs b/crates/openhuman-core/src/platform/about_app/schemas.rsindex f37a4c9c39..854bcfc429 100644--- a/crates/openhuman-core/src/platform/about_app/schemas.rs+++ b/crates/openhuman-core/src/platform/about_app/schemas.rs@@ -7,7 +7,7 @@ use serde_json::{Map, Value};use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};use crate::platform::about_app::CapabilityCategory;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;#[derive(Debug, Deserialize, Default)]struct AboutAppListParams {@@ -139,7 +139,7 @@ fn deserialize_params<T: DeserializeOwned>(params: Map<String, Value>) -> Resultserde_json::from_value(Value::Object(params)).map_err(|e| format!("invalid params: {e}"))}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/platform/connectivity/README.md b/crates/openhuman-core/src/platform/connectivity/README.mdindex c85e2a6563..8b44b4a2a0 100644--- a/crates/openhuman-core/src/platform/connectivity/README.md+++ b/crates/openhuman-core/src/platform/connectivity/README.md@@ -25,7 +25,7 @@ Diagnostics for the local core's reachability and the live backend Socket.IO sta- `connectivity::all_connectivity_controller_schemas()` / `all_connectivity_registered_controllers()` — registry entry points (re-exported from `schemas.rs`).- `connectivity::ops::is_port_in_use(port: u16) -> bool`.- `connectivity::rpc::ConnectivityDiagResponse` — serialized diag payload (`socket_state`, `last_ws_error`, `socket_loop_active`, `socket_loop_stopped_on_failure`, `sidecar_pid`, `listen_port`, `listen_port_in_use`). The two booleans are the core's own statement of whether its backend reconnect loop is running and, if not, whether it stopped on a terminal failure (no usable session token); the frontend's connectivity chip keys "no link wanted" vs "down, retrying" vs "stopped, sign in again" off them rather than inferring liveness from `socket_state` (#6256, #6270).-- `connectivity::rpc::snapshot() -> ConnectivityDiagResponse` and `connectivity::rpc::diag() -> Result<RpcOutcome<Value>, String>`.+- `connectivity::rpc::snapshot() -> ConnectivityDiagResponse` and `connectivity::rpc::diag() -> Result<Outcome<Value>, String>`.- `connectivity::rpc::pick_listen_port(preferred)` / `pick_listen_port_for_host(host, preferred)` → `Result<PickListenPortResult, PickListenPortError>`.- `connectivity::rpc::PickListenPortResult` (`listener`, `port`, `fallback_from`) and `PickListenPortError` (`WouldTakeOver` / `NoAvailablePort` / `BindFailed`).@@ -44,7 +44,7 @@ None — the module holds no state. The diag snapshot reads only the environment- `crate::platform::socket::manager::global_socket_manager` — read the live backend Socket.IO `ConnectionStatus` and last error for the diag snapshot.- `crate::core::all::{ControllerFuture, RegisteredController}` — controller registration types.- `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` — controller schema shape.-- `crate::rpc::RpcOutcome` — RPC return envelope (`RpcOutcome::single_log`).+- `crate::rpc::Outcome` — RPC return envelope (`Outcome::single_log`).- External crates: `reqwest` (HTTP fingerprint probe of a listener's `GET /` root), `tokio` (async `TcpListener`, retry backoff), `serde`/`serde_json`, `url`, `tracing`/`log`.## Used bydiff --git a/crates/openhuman-core/src/platform/connectivity/rpc.rs b/crates/openhuman-core/src/platform/connectivity/rpc.rsindex 3a1c325b66..4cfa559d9a 100644--- a/crates/openhuman-core/src/platform/connectivity/rpc.rs+++ b/crates/openhuman-core/src/platform/connectivity/rpc.rs@@ -14,7 +14,7 @@ use tokio::time::{sleep, Duration};use tracing::{debug, warn};use crate::platform::socket::manager::global_socket_manager;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::ops::is_port_in_use;@@ -555,7 +555,7 @@ pub fn snapshot() -> ConnectivityDiagResponse {}}-pub async fn diag() -> Result<RpcOutcome<serde_json::Value>, String> {+pub async fn diag() -> Result<Outcome<serde_json::Value>, String> {debug!("[connectivity][rpc] diag: entry");let payload = snapshot();debug!(@@ -566,7 +566,7 @@ pub async fn diag() -> Result<RpcOutcome<serde_json::Value>, String> {);let value = serde_json::to_value(&payload).map_err(|e| format!("connectivity diag: serialize failed: {e}"))?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({ "diag": value }),"connectivity diag returned",))diff --git a/crates/openhuman-core/src/platform/cost/README.md b/crates/openhuman-core/src/platform/cost/README.mdindex d785919889..b5ba223be4 100644--- a/crates/openhuman-core/src/platform/cost/README.md+++ b/crates/openhuman-core/src/platform/cost/README.md@@ -20,7 +20,7 @@ Local API-usage cost tracking for the agent. Records per-call token usage and co| `crates/openhuman-core/src/platform/cost/types.rs` | Serde domain types: `TokenUsage`, `CostSource`, `CostRecord`, `UsagePeriod`, `CostSummary`, `ModelStats`, `DailyCostEntry`, `BudgetStatus`, `CostDashboard`. Cost-calc logic lives in `TokenUsage::new`. || `crates/openhuman-core/src/platform/cost/tracker.rs` | `CostTracker` (recording, summaries, daily history, dashboard build) plus the private `CostStorage` JSONL persistence + aggregate-cache layer. Functions as both `ops` and `store`. || `crates/openhuman-core/src/platform/cost/global.rs` | Process-global `OnceCell<Arc<CostTracker>>` singleton: `init_global`, `try_global`, `record_provider_usage`, and `build_token_usage` (provider `UsageInfo` → `TokenUsage`). |-| `crates/openhuman-core/src/platform/cost/rpc.rs` | RPC-facing handlers (`dashboard`, `daily_history`, `summary`) returning `RpcOutcome<Value>`; DTO types; `resolve_tracker` with a cached fallback tracker + error-replay TTL. |+| `crates/openhuman-core/src/platform/cost/rpc.rs` | RPC-facing handlers (`dashboard`, `daily_history`, `summary`) returning `Outcome<Value>`; DTO types; `resolve_tracker` with a cached fallback tracker + error-replay TTL. || `crates/openhuman-core/src/platform/cost/schemas.rs` | Controller schemas + `handle_*` JSON-RPC dispatchers; `all_controller_schemas` / `all_registered_controllers`. || `crates/openhuman-core/src/platform/cost/tracker_tests.rs` | Sibling test suite for `tracker.rs` (`#[path]`-included). || `crates/openhuman-core/src/platform/cost/catalog.rs` | Static per-model pricing + context-window catalog (`ModelPrice`, `lookup`, `estimate_cost_usd`, `PRICING_AS_OF`) and the tinyagents model-catalog adapters. |@@ -68,7 +68,7 @@ None. The module has no `bus.rs` and no `DomainEvent` publishers/subscribers.- `crate::inference::provider::types::UsageInfo` (re-exported as `crate::inference::provider::UsageInfo`) — provider usage payload translated into `TokenUsage` in `global.rs`.- `crate::core::all` — `ControllerFuture`, `RegisteredController` for controller registration.- `crate::core` — `ControllerSchema`, `FieldSchema`, `TypeSchema`.-- `crate::rpc::RpcOutcome` — RPC return wrapper.+- `crate::rpc::Outcome` — RPC return wrapper.- External: `chrono`, `serde`/`serde_json`, `uuid`, `parking_lot`, `once_cell`, `anyhow`, `tempfile` (tests).## Used bydiff --git a/crates/openhuman-core/src/platform/cost/rpc.rs b/crates/openhuman-core/src/platform/cost/rpc.rsindex 318791674c..10431632d9 100644--- a/crates/openhuman-core/src/platform/cost/rpc.rs+++ b/crates/openhuman-core/src/platform/cost/rpc.rs@@ -18,7 +18,7 @@ use std::sync::Arc;use std::time::{Duration, Instant};use crate::config::{Config, CostConfig};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::global::try_global;use super::tracker::CostTracker;@@ -377,7 +377,7 @@ fn resolve_tracker(config: &Config) -> Result<Arc<CostTracker>> {}/// Build the dashboard payload for the current config.-pub fn dashboard(config: &Config) -> Result<RpcOutcome<Value>> {+pub fn dashboard(config: &Config) -> Result<Outcome<Value>> {log::debug!(target: "cost_rpc", "[cost_rpc] dashboard.entry");let tracker = resolve_tracker(config).inspect_err(|err| {log::warn!(target: "cost_rpc", "[cost_rpc] dashboard.resolve_failed err={err:#}");@@ -400,11 +400,11 @@ pub fn dashboard(config: &Config) -> Result<RpcOutcome<Value>> {target: "cost_rpc","[cost_rpc] dashboard.exit days={day_count} models={model_count}");- Ok(RpcOutcome::new(value, Vec::new()))+ Ok(Outcome::new(value, Vec::new()))}/// Return the per-day cost history for the requested span.-pub fn daily_history(config: &Config, days: u32) -> Result<RpcOutcome<Value>> {+pub fn daily_history(config: &Config, days: u32) -> Result<Outcome<Value>> {log::debug!(target: "cost_rpc", "[cost_rpc] daily_history.entry days={days}");let tracker = resolve_tracker(config).inspect_err(|err| {log::warn!(target: "cost_rpc", "[cost_rpc] daily_history.resolve_failed err={err:#}");@@ -419,11 +419,11 @@ pub fn daily_history(config: &Config, days: u32) -> Result<RpcOutcome<Value>> {let dto: Vec<DailyCostEntryDto> = entries.iter().map(daily_entry_to_dto).collect();let value = serde_json::to_value(dto).context("cost daily history serialize failed")?;log::debug!(target: "cost_rpc", "[cost_rpc] daily_history.exit entries={entry_count}");- Ok(RpcOutcome::new(value, Vec::new()))+ Ok(Outcome::new(value, Vec::new()))}/// Return the live session / daily / monthly summary.-pub fn summary(config: &Config) -> Result<RpcOutcome<Value>> {+pub fn summary(config: &Config) -> Result<Outcome<Value>> {log::debug!(target: "cost_rpc", "[cost_rpc] summary.entry");let tracker = resolve_tracker(config).inspect_err(|err| {log::warn!(target: "cost_rpc", "[cost_rpc] summary.resolve_failed err={err:#}");@@ -438,11 +438,11 @@ pub fn summary(config: &Config) -> Result<RpcOutcome<Value>> {let dto = summary_to_dto(&s);let value = serde_json::to_value(dto).context("cost summary serialize failed")?;log::debug!(target: "cost_rpc", "[cost_rpc] summary.exit requests={request_count}");- Ok(RpcOutcome::new(value, Vec::new()))+ Ok(Outcome::new(value, Vec::new()))}/// Return a recent, bounded usage log plus spend distribution by category.-pub fn usage_log(config: &Config, days: u32, limit: usize) -> Result<RpcOutcome<Value>> {+pub fn usage_log(config: &Config, days: u32, limit: usize) -> Result<Outcome<Value>> {log::debug!(target: "cost_rpc", "[cost_rpc] usage_log.entry days={days} limit={limit}");let tracker = resolve_tracker(config).inspect_err(|err| {log::warn!(target: "cost_rpc", "[cost_rpc] usage_log.resolve_failed err={err:#}");@@ -464,7 +464,7 @@ pub fn usage_log(config: &Config, days: u32, limit: usize) -> Result<RpcOutcome<);let value = serde_json::to_value(dto).context("cost usage log serialize failed")?;log::debug!(target: "cost_rpc", "[cost_rpc] usage_log.exit records={request_count}");- Ok(RpcOutcome::new(value, Vec::new()))+ Ok(Outcome::new(value, Vec::new()))}#[cfg(test)]diff --git a/crates/openhuman-core/src/platform/cost/schemas.rs b/crates/openhuman-core/src/platform/cost/schemas.rsindex 393d324613..58a7f6ed4d 100644--- a/crates/openhuman-core/src/platform/cost/schemas.rs+++ b/crates/openhuman-core/src/platform/cost/schemas.rs@@ -6,7 +6,7 @@ use serde_json::{Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::rpc as cost_rpc;@@ -257,7 +257,7 @@ fn handle_cost_get_usage_log(params: Map<String, Value>) -> ControllerFuture {})}-fn to_json(outcome: RpcOutcome<Value>) -> Result<Value, String> {+fn to_json(outcome: Outcome<Value>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/platform/doctor/README.md b/crates/openhuman-core/src/platform/doctor/README.mdindex a9334dbaaa..ab788a8ca9 100644--- a/crates/openhuman-core/src/platform/doctor/README.md+++ b/crates/openhuman-core/src/platform/doctor/README.md@@ -19,7 +19,7 @@ Diagnostic / self-check domain for OpenHuman. Runs a synchronous battery of prob| --- | --- || `crates/openhuman-core/src/platform/doctor/mod.rs` | Module docstring + exports. Declares `core`, `ops`, `schemas`; re-exports `core::*`, `ops::*` (also aliased `pub use ops as rpc`), and the schema controller pair. || `crates/openhuman-core/src/platform/doctor/core.rs` | All diagnostic logic + types. `run()` entry point and every `check_*` probe; `run_models()`; severity helpers; OS-specific disk/command helpers. |-| `crates/openhuman-core/src/platform/doctor/ops.rs` | Async JSON-RPC/CLI controller surface (`doctor_report`, `doctor_models`) wrapping the sync `core` logic in `spawn_blocking` and returning `RpcOutcome<T>`. |+| `crates/openhuman-core/src/platform/doctor/ops.rs` | Async JSON-RPC/CLI controller surface (`doctor_report`, `doctor_models`) wrapping the sync `core` logic in `spawn_blocking` and returning `Outcome<T>`. || `crates/openhuman-core/src/platform/doctor/schemas.rs` | Controller schemas + registry (`all_controller_schemas`, `all_registered_controllers`, `handle_report`/`handle_models`). || `crates/openhuman-core/src/platform/doctor/core_tests.rs` | Test suite for `core.rs` (via `#[path = "core_tests.rs"] mod tests`). |@@ -33,8 +33,8 @@ From `mod.rs` re-exports (`core::*`):From `ops` (also re-exported as `doctor::rpc`):-- `doctor_report(&Config) -> Result<RpcOutcome<DoctorReport>, String>`-- `doctor_models(&Config, use_cache: bool) -> Result<RpcOutcome<ModelProbeReport>, String>`+- `doctor_report(&Config) -> Result<Outcome<DoctorReport>, String>`+- `doctor_models(&Config, use_cache: bool) -> Result<Outcome<ModelProbeReport>, String>`Schema pair re-exported as `all_doctor_controller_schemas` / `all_doctor_registered_controllers`.@@ -47,7 +47,7 @@ Namespace `doctor`, two functions:| `doctor.report` | none | `DoctorReport` ("Run diagnostics for workspace and runtime configuration.") || `doctor.models` | `use_cache: Option<bool>` (default `true`) | `ModelProbeReport` ("Probe provider model availability and auth status.") |-Both handlers load config via `config_rpc::load_config_with_timeout()` and return `RpcOutcome::single_log(...)`. Wired into the global registry in `crates/openhuman-core/src/core/all.rs` (controllers, schemas, and the namespace description "Run diagnostics for workspace and runtime health.").+Both handlers load config via `config_rpc::load_config_with_timeout()` and return `Outcome::single_log(...)`. Wired into the global registry in `crates/openhuman-core/src/core/all.rs` (controllers, schemas, and the namespace description "Run diagnostics for workspace and runtime health.").## Agent tools@@ -70,7 +70,7 @@ None of its own (no `store.rs`). It only **reads** existing state owned by other- `crate::inference::{provider, local}` — `provider::list_providers` (model targets) and `local::ollama_base_url` (embedding probe).- `crate::api::{config, jwt}` — `effective_api_url` fallback resolution and `get_session_token` for sign-in state.- `crate::core::all::{ControllerFuture, RegisteredController}`, `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` — controller/schema plumbing.-- `crate::rpc::RpcOutcome` — handler return contract.+- `crate::rpc::Outcome` — handler return contract.- External: `reqwest` (blocking client + URL parse), `serde`/`serde_json`, `chrono`, `anyhow`.## Used bydiff --git a/crates/openhuman-core/src/platform/doctor/ops.rs b/crates/openhuman-core/src/platform/doctor/ops.rsindex 6e37dd7f14..2e855aaa2b 100644--- a/crates/openhuman-core/src/platform/doctor/ops.rs+++ b/crates/openhuman-core/src/platform/doctor/ops.rs@@ -6,9 +6,9 @@use crate::config::Config;use crate::platform::doctor::{self, DoctorReport, MemoryChunkCount, ModelProbeReport};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;-pub async fn doctor_report(config: &Config) -> Result<RpcOutcome<DoctorReport>, String> {+pub async fn doctor_report(config: &Config) -> Result<Outcome<DoctorReport>, String> {// Awaited before the blocking hop, not inside it: `doctor::run` may not// `.await`, and the driver call may not be blocked on from a runtime// worker. See `MemoryChunkCount`.@@ -22,7 +22,7 @@ pub async fn doctor_report(config: &Config) -> Result<RpcOutcome<DoctorReport>,.await.map_err(|e| format!("doctor task join error: {e}"))?.map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(report, "doctor report generated"))+ Ok(Outcome::single_log(report, "doctor report generated"))}/// How many chunks the workspace's bound memory driver holds.@@ -62,7 +62,7 @@ async fn memory_chunk_count(config: &Config) -> MemoryChunkCount {pub async fn doctor_models(config: &Config,use_cache: bool,-) -> Result<RpcOutcome<ModelProbeReport>, String> {+) -> Result<Outcome<ModelProbeReport>, String> {let report = doctor::run_models(config, use_cache).map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(report, "model probes completed"))+ Ok(Outcome::single_log(report, "model probes completed"))}diff --git a/crates/openhuman-core/src/platform/doctor/schemas.rs b/crates/openhuman-core/src/platform/doctor/schemas.rsindex 188482183b..923b9af225 100644--- a/crates/openhuman-core/src/platform/doctor/schemas.rs+++ b/crates/openhuman-core/src/platform/doctor/schemas.rs@@ -4,7 +4,7 @@ use serde_json::{Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub fn all_controller_schemas() -> Vec<ControllerSchema> {vec![schemas("report"), schemas("models")]@@ -96,7 +96,7 @@ fn read_optional<T: DeserializeOwned>(}}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/platform/health/README.md b/crates/openhuman-core/src/platform/health/README.mdindex ccec90d3c1..8ffc587ee0 100644--- a/crates/openhuman-core/src/platform/health/README.md+++ b/crates/openhuman-core/src/platform/health/README.md@@ -17,7 +17,7 @@ In-process health registry for the OpenHuman core. Tracks per-component liveness| --- | --- || `crates/openhuman-core/src/platform/health/mod.rs` | Export-only: declares modules, re-exports `core::*`, `ops::*`, `pub use ops as rpc`, and the controller-schema pair (`all_health_controller_schemas` / `all_health_registered_controllers`). || `crates/openhuman-core/src/platform/health/core.rs` | The registry itself: `ComponentHealth`/`HealthSnapshot` types, the `OnceLock<HealthRegistry>` singleton (`started_at` + `Mutex<BTreeMap>`), and the mutators/`snapshot`/`snapshot_json` functions. |-| `crates/openhuman-core/src/platform/health/ops.rs` | RPC handler logic returning `RpcOutcome<T>`: `health_snapshot()` and `system_info()` (+ `SystemInfo` type). |+| `crates/openhuman-core/src/platform/health/ops.rs` | RPC handler logic returning `Outcome<T>`: `health_snapshot()` and `system_info()` (+ `SystemInfo` type). || `crates/openhuman-core/src/platform/health/schemas.rs` | Controller schemas + `handle_snapshot`/`handle_system_info` async handlers that delegate to `ops` and serialize via `into_cli_compatible_json`. || `crates/openhuman-core/src/platform/health/bus.rs` | `HealthSubscriber` (`EventHandler`) and `register_health_subscriber()`; maps domain events to registry mutations. || `crates/openhuman-core/src/platform/health/tools.rs` | Read-only, default-on LLM tools `health_snapshot` / `health_system_info`, re-exported through `crates/openhuman-core/src/tools/mod.rs`. |@@ -31,7 +31,7 @@ From `core.rs` (re-exported via `pub use core::*`):The HTTP `GET /health` handler (`core::jsonrpc::health_handler`) uses `verdict()` for its status code (200 unless a critical component is unhealthy) and adds `healthy` / `degraded` / `critical_unhealthy` / `degraded_components` fields alongside the `components` map in the body. The `components` map shape is unchanged — the new fields are additive.From `ops.rs` (re-exported via `pub use ops::*`, also aliased `pub use ops as rpc`):-- `health_snapshot() -> RpcOutcome<serde_json::Value>`, `system_info() -> RpcOutcome<SystemInfo>`, and the `SystemInfo` struct.+- `health_snapshot() -> Outcome<serde_json::Value>`, `system_info() -> Outcome<SystemInfo>`, and the `SystemInfo` struct.From `bus.rs`: `HealthSubscriber`, `register_health_subscriber()`.@@ -70,7 +70,7 @@ None on disk. State lives in a process-global `OnceLock<HealthRegistry>` (lazy-i- `crate::core::bus::BUS.subscribe` (`crate::core::events::DomainEvent`, `tinybus::SubscriptionHandle`) — to receive system/channel events.- `crate::core::all` (`ControllerFuture`, `RegisteredController`) and `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` — controller registry wiring.-- `crate::rpc::RpcOutcome` — RPC handler return contract.+- `crate::rpc::Outcome` — RPC handler return contract.- External crates: `chrono` (RFC3339 timestamps), `parking_lot::Mutex`, `serde`/`serde_json`, `async_trait`.## Used bydiff --git a/crates/openhuman-core/src/platform/health/ops.rs b/crates/openhuman-core/src/platform/health/ops.rsindex 4d6bbb67a7..192de461b0 100644--- a/crates/openhuman-core/src/platform/health/ops.rs+++ b/crates/openhuman-core/src/platform/health/ops.rs@@ -3,10 +3,10 @@use serde::Serialize;use crate::platform::health;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;-pub fn health_snapshot() -> RpcOutcome<serde_json::Value> {- RpcOutcome::single_log(health::snapshot_json(), "health_snapshot requested")+pub fn health_snapshot() -> Outcome<serde_json::Value> {+ Outcome::single_log(health::snapshot_json(), "health_snapshot requested")}/// Static system information returned by `openhuman.health_system_info`.@@ -27,7 +27,7 @@ pub struct SystemInfo {/// This is the handler backing the `openhuman.health_system_info` RPC method/// (legacy callers may send `openhuman.system_info`, which the alias table/// rewrites before dispatch).-pub fn system_info() -> RpcOutcome<SystemInfo> {+pub fn system_info() -> Outcome<SystemInfo> {let info = SystemInfo {version: env!("CARGO_PKG_VERSION"),os: std::env::consts::OS,@@ -41,7 +41,7 @@ pub fn system_info() -> RpcOutcome<SystemInfo> {pid = info.pid,"[health] system_info requested");- RpcOutcome::new(info, vec![])+ Outcome::new(info, vec![])}#[cfg(test)]diff --git a/crates/openhuman-core/src/platform/health/schemas.rs b/crates/openhuman-core/src/platform/health/schemas.rsindex 9c6f2a6ba3..93a1388924 100644--- a/crates/openhuman-core/src/platform/health/schemas.rs+++ b/crates/openhuman-core/src/platform/health/schemas.rs@@ -2,7 +2,7 @@ use serde_json::{Map, Value};use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub fn all_controller_schemas() -> Vec<ControllerSchema> {vec![schemas("snapshot"), schemas("system_info")]@@ -97,7 +97,7 @@ fn handle_system_info(_params: Map<String, Value>) -> ControllerFuture {Box::pin(async { to_json(crate::platform::health::rpc::system_info()) })}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/platform/health/schemas_tests.rs b/crates/openhuman-core/src/platform/health/schemas_tests.rsindex 5bf44b6533..235e9c203c 100644--- a/crates/openhuman-core/src/platform/health/schemas_tests.rs+++ b/crates/openhuman-core/src/platform/health/schemas_tests.rs@@ -67,7 +67,7 @@ async fn handle_system_info_returns_json_object() {#[test]fn to_json_helper() {- let outcome = RpcOutcome::single_log(serde_json::json!({"ok": true}), "log");+ let outcome = Outcome::single_log(serde_json::json!({"ok": true}), "log");assert!(to_json(outcome).is_ok());}diff --git a/crates/openhuman-core/src/platform/service/README.md b/crates/openhuman-core/src/platform/service/README.mdindex b498a65f40..7e79161d41 100644--- a/crates/openhuman-core/src/platform/service/README.md+++ b/crates/openhuman-core/src/platform/service/README.md@@ -18,7 +18,7 @@ Service-management domain for the OpenHuman core daemon. It installs/uninstalls| --- | --- || `crates/openhuman-core/src/platform/service/mod.rs` | Export-focused module root; declares submodules and re-exports the public surface + controller-schema pair. || `crates/openhuman-core/src/platform/service/core.rs` | `ServiceState` / `ServiceStatus` types and the cross-platform `install`/`start`/`stop`/`status`/`uninstall` dispatchers that route to the mock or the per-OS impl via `cfg`. |-| `crates/openhuman-core/src/platform/service/ops.rs` | RPC handler layer (`service_install`, `service_start`, `service_stop`, `service_status`, `service_restart`, `service_shutdown`, `service_uninstall`, `daemon_host_get`/`set`) returning `RpcOutcome<T>`. Re-exported as `rpc`. |+| `crates/openhuman-core/src/platform/service/ops.rs` | RPC handler layer (`service_install`, `service_start`, `service_stop`, `service_status`, `service_restart`, `service_shutdown`, `service_uninstall`, `daemon_host_get`/`set`) returning `Outcome<T>`. Re-exported as `rpc`. || `crates/openhuman-core/src/platform/service/schemas.rs` | Controller schemas + `handle_*` adapters for the `service` namespace; `all_controller_schemas` / `all_registered_controllers`. || `crates/openhuman-core/src/platform/service/restart.rs` | Self-restart orchestration: `service_restart` (publishes event), `trigger_self_restart_now` (respawns current exe with original args), `apply_startup_restart_delay_from_env`, `RestartStatus`. || `crates/openhuman-core/src/platform/service/shutdown.rs` | Graceful-shutdown orchestration: `service_shutdown` (publishes event), `ShutdownStatus`. |@@ -46,7 +46,7 @@ From `mod.rs` re-exports:## RPC / controllers-Namespace `service` (called as `openhuman.service_<fn>` / `service.<fn>`). All nine handlers go through `RpcOutcome` and are wired into the registry by `crate::core::all` via `all_service_registered_controllers`.+Namespace `service` (called as `openhuman.service_<fn>` / `service.<fn>`). All nine handlers go through `Outcome` and are wired into the registry by `crate::core::all` via `all_service_registered_controllers`.| Method | Inputs | Output || --- | --- | --- |@@ -88,7 +88,7 @@ Both subscribers are registered idempotently from `crates/openhuman-core/src/cor- `crate::config` — `Config` (paths, config dir) for every lifecycle/path operation; `config::rpc::load_config_with_timeout` in the schema handlers.- `crate::core::bus::BUS` (`tinybus::OnceBus<DomainEvent>`) — `publish` / `subscribe` for restart/shutdown orchestration; `crate::core::events::DomainEvent` for the event catalog.- `crate::core` (`ControllerSchema`, `FieldSchema`, `TypeSchema`) and `crate::core::all` (`ControllerFuture`, `RegisteredController`) — controller schema/registration contract.-- `crate::rpc::RpcOutcome` — standard RPC result envelope.+- `crate::rpc::Outcome` — standard RPC result envelope.- External: `anyhow`, `serde`/`serde_json`, `tokio`, `async_trait`, plus OS CLIs (`launchctl`, `systemctl`, `schtasks`).## Used bydiff --git a/crates/openhuman-core/src/platform/service/ops.rs b/crates/openhuman-core/src/platform/service/ops.rsindex ecb4a3a4ca..d66068ddf5 100644--- a/crates/openhuman-core/src/platform/service/ops.rs+++ b/crates/openhuman-core/src/platform/service/ops.rs@@ -3,37 +3,37 @@use crate::config::Config;use crate::platform::service::daemon_host::DaemonHostConfig;use crate::platform::service::{self, daemon_host, ServiceStatus};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// Installs the OpenHuman daemon as a system service.-pub async fn service_install(config: &Config) -> Result<RpcOutcome<ServiceStatus>, String> {+pub async fn service_install(config: &Config) -> Result<Outcome<ServiceStatus>, String> {let status = service::install(config).map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(status, "service install completed"))+ Ok(Outcome::single_log(status, "service install completed"))}/// Starts the installed OpenHuman daemon service.-pub async fn service_start(config: &Config) -> Result<RpcOutcome<ServiceStatus>, String> {+pub async fn service_start(config: &Config) -> Result<Outcome<ServiceStatus>, String> {let status = service::start(config).map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(status, "service start completed"))+ Ok(Outcome::single_log(status, "service start completed"))}/// Stops the running OpenHuman daemon service.-pub async fn service_stop(config: &Config) -> Result<RpcOutcome<ServiceStatus>, String> {+pub async fn service_stop(config: &Config) -> Result<Outcome<ServiceStatus>, String> {let status = service::stop(config).map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(status, "service stop completed"))+ Ok(Outcome::single_log(status, "service stop completed"))}/// Returns the current status of the OpenHuman daemon service.-pub async fn service_status(config: &Config) -> Result<RpcOutcome<ServiceStatus>, String> {+pub async fn service_status(config: &Config) -> Result<Outcome<ServiceStatus>, String> {let status = service::status(config).map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(status, "service status fetched"))+ Ok(Outcome::single_log(status, "service status fetched"))}/// Requests an asynchronous restart of the core process.pub async fn service_restart(source: Option<String>,reason: Option<String>,-) -> Result<RpcOutcome<service::RestartStatus>, String> {+) -> Result<Outcome<service::RestartStatus>, String> {service::restart::service_restart(source, reason).await}@@ -41,41 +41,41 @@ pub async fn service_restart(pub async fn service_shutdown(source: Option<String>,reason: Option<String>,-) -> Result<RpcOutcome<service::ShutdownStatus>, String> {+) -> Result<Outcome<service::ShutdownStatus>, String> {service::shutdown::service_shutdown(source, reason).await}/// Uninstalls the OpenHuman daemon system service.-pub async fn service_uninstall(config: &Config) -> Result<RpcOutcome<ServiceStatus>, String> {+pub async fn service_uninstall(config: &Config) -> Result<Outcome<ServiceStatus>, String> {let status = service::uninstall(config).map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(status,"service uninstall completed",))}/// Reads the daemon host UI preferences from the configuration directory.-pub async fn daemon_host_get(config: &Config) -> Result<RpcOutcome<DaemonHostConfig>, String> {+pub async fn daemon_host_get(config: &Config) -> Result<Outcome<DaemonHostConfig>, String> {let config_dir = config.config_path.parent().ok_or_else(|| "failed to resolve config directory".to_string())?;let current = daemon_host::load_for_config_dir(config_dir).await;- Ok(RpcOutcome::single_log(current, "daemon host config loaded"))+ Ok(Outcome::single_log(current, "daemon host config loaded"))}/// Updates the daemon host UI preferences and saves them to disk.pub async fn daemon_host_set(config: &Config,show_tray: bool,-) -> Result<RpcOutcome<DaemonHostConfig>, String> {+) -> Result<Outcome<DaemonHostConfig>, String> {let config_dir = config.config_path.parent().ok_or_else(|| "failed to resolve config directory".to_string())?;let next = DaemonHostConfig { show_tray };daemon_host::save_for_config_dir(config_dir, &next).await?;- Ok(RpcOutcome::single_log(next, "daemon host config saved"))+ Ok(Outcome::single_log(next, "daemon host config saved"))}#[cfg(test)]diff --git a/crates/openhuman-core/src/platform/service/restart.rs b/crates/openhuman-core/src/platform/service/restart.rsindex a2d4778720..f2227a4109 100644--- a/crates/openhuman-core/src/platform/service/restart.rs+++ b/crates/openhuman-core/src/platform/service/restart.rs@@ -15,7 +15,7 @@ use serde::Serialize;use crate::core::bus::BUS;use crate::core::events::DomainEvent;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;const RESTART_DELAY_ENV: &str = "OPENHUMAN_RESTART_DELAY_MS";const DEFAULT_RESTART_DELAY_MS: u64 = 350;@@ -69,7 +69,7 @@ pub fn apply_startup_restart_delay_from_env() {pub async fn service_restart(source: Option<String>,reason: Option<String>,-) -> Result<RpcOutcome<RestartStatus>, String> {+) -> Result<Outcome<RestartStatus>, String> {let source = source.map(|value| value.trim().to_string()).filter(|value| !value.is_empty())@@ -90,7 +90,7 @@ pub async fn service_restart(reason: reason.clone(),});- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(RestartStatus {accepted: true,source,diff --git a/crates/openhuman-core/src/platform/service/schemas.rs b/crates/openhuman-core/src/platform/service/schemas.rsindex b063c2e10a..7776b9fc06 100644--- a/crates/openhuman-core/src/platform/service/schemas.rs+++ b/crates/openhuman-core/src/platform/service/schemas.rs@@ -10,7 +10,7 @@ use serde_json::{Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// Returns a collection of all available controller schemas for the service domain.///@@ -272,8 +272,8 @@ fn handle_daemon_host_set(params: Map<String, Value>) -> ControllerFuture {})}-/// Formats the RpcOutcome as an OpenHuman-standard JSON result.-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+/// Formats the Outcome as an OpenHuman-standard JSON result.+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/platform/service/shutdown.rs b/crates/openhuman-core/src/platform/service/shutdown.rsindex 5353c79d39..ebaf681958 100644--- a/crates/openhuman-core/src/platform/service/shutdown.rs+++ b/crates/openhuman-core/src/platform/service/shutdown.rs@@ -10,7 +10,7 @@ use serde::Serialize;use crate::core::bus::BUS;use crate::core::events::DomainEvent;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// JSON-serializable acknowledgement returned to CLI / JSON-RPC callers/// before the current process exits.@@ -29,7 +29,7 @@ pub struct ShutdownStatus {pub async fn service_shutdown(source: Option<String>,reason: Option<String>,-) -> Result<RpcOutcome<ShutdownStatus>, String> {+) -> Result<Outcome<ShutdownStatus>, String> {let source = source.map(|value| value.trim().to_string()).filter(|value| !value.is_empty())@@ -50,7 +50,7 @@ pub async fn service_shutdown(reason: reason.clone(),});- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(ShutdownStatus {accepted: true,source,diff --git a/crates/openhuman-core/src/platform/update/README.md b/crates/openhuman-core/src/platform/update/README.mdindex cc5c13e20d..2cb857fc8f 100644--- a/crates/openhuman-core/src/platform/update/README.md+++ b/crates/openhuman-core/src/platform/update/README.md@@ -25,7 +25,7 @@ Self-update domain for the `openhuman-core` binary. Checks GitHub Releases (`tin## Public surface- Types (`types.rs`): `UpdateInfo`, `VersionInfo`, `UpdateRunResult`, `UpdateApplyResult`, `GitHubRelease`, `GitHubAsset`.- Core fns (`core.rs`, re-exported via `core::*`): `current_version() -> &'static str`, `platform_triple() -> &'static str`, `check_available() -> Result<UpdateInfo, String>`, `download_and_stage(...)`, `download_and_stage_with_version(...)`.-- `update::rpc` (alias of `ops`): `update_version`, `update_check`, `update_apply`, `update_run` — all returning `RpcOutcome<Value>`.+- `update::rpc` (alias of `ops`): `update_version`, `update_check`, `update_apply`, `update_run` — all returning `Outcome<Value>`.- `update::scheduler::run(UpdateConfig)` — background loop entry point.- `all_update_controller_schemas()` / `all_update_registered_controllers()`.@@ -61,7 +61,7 @@ None. No `store.rs` — staged binaries are written to the filesystem (current-e- `crate::core::bus` — `BUS.publish`, `crate::core::events::DomainEvent`, and `bus::init()` to bring up the in-process broker.- `crate::core::observability` — Sentry reporting + transient-failure classifiers (`report_error`, `is_updater_transient_message`, `is_updater_transient_http_status`).- `crate::core::all` — `ControllerFuture`, `RegisteredController` (schemas wiring); `crate::core::{ControllerSchema, FieldSchema, TypeSchema}`.-- `crate::rpc::RpcOutcome` — RPC return contract.+- `crate::rpc::Outcome` — RPC return contract.- External crates: `reqwest` (HTTP), `url` (URL validation), `serde`/`serde_json`, `tokio`.## Used bydiff --git a/crates/openhuman-core/src/platform/update/ops.rs b/crates/openhuman-core/src/platform/update/ops.rsindex 378da21d99..ba5d35e62f 100644--- a/crates/openhuman-core/src/platform/update/ops.rs+++ b/crates/openhuman-core/src/platform/update/ops.rs@@ -7,7 +7,7 @@ use serde_json::Value;use crate::config::{self, UpdateConfig, UpdateRestartStrategy};use crate::platform::update;use crate::platform::update::types::{UpdateApplyResult, UpdateInfo, UpdateRunResult, VersionInfo};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;async fn load_update_policy() -> Result<UpdateConfig, String> {config::rpc::load_config_with_timeout()@@ -155,7 +155,7 @@ async fn build_run_result_from_staged_update(////// Cheap, no-network — the frontend uses this to decide whether to/// invoke the heavier `update.check` or `update.run` RPCs.-pub async fn update_version() -> RpcOutcome<Value> {+pub async fn update_version() -> Outcome<Value> {let info = VersionInfo {version: update::current_version().to_string(),target_triple: update::platform_triple().to_string(),@@ -168,7 +168,7 @@ pub async fn update_version() -> RpcOutcome<Value> {);let value = serde_json::to_value(&info).unwrap_or_else(|e| serde_json::json!({ "error": format!("serialization failed: {e}") }));- RpcOutcome::single_log(value, "update_version completed")+ Outcome::single_log(value, "update_version completed")}/// Orchestrated update flow: check → apply (if newer) → restart.@@ -177,12 +177,12 @@ pub async fn update_version() -> RpcOutcome<Value> {/// update was applied the function publishes a restart request before/// returning, so the caller will see `restart_requested: true` and the/// core process will exit shortly afterwards.-pub async fn update_run() -> RpcOutcome<Value> {+pub async fn update_run() -> Outcome<Value> {log::info!("[update:rpc] update_run invoked");let policy = match enforce_update_mutation_policy("openhuman.update_run").await {Ok(policy) => policy,Err(error) => {- return RpcOutcome::single_log(+ return Outcome::single_log(serde_json::json!({"error": error,"applied": false,@@ -198,7 +198,7 @@ pub async fn update_run() -> RpcOutcome<Value> {Ok(i) => i,Err(e) => {log::error!("[update:rpc] update_run check failed: {e}");- return RpcOutcome::single_log(+ return Outcome::single_log(serde_json::json!({"error": e,"applied": false,@@ -215,7 +215,7 @@ pub async fn update_run() -> RpcOutcome<Value> {"[update:rpc] update_run: already up to date ({})",result.current_version);- return RpcOutcome::single_log(+ return Outcome::single_log(serde_json::to_value(&result).unwrap_or(Value::Null),"update_run: already up to date",);@@ -229,7 +229,7 @@ pub async fn update_run() -> RpcOutcome<Value> {update::platform_triple());let result = missing_asset_result(info, restart_strategy);- return RpcOutcome::single_log(+ return Outcome::single_log(serde_json::to_value(&result).unwrap_or(Value::Null),"update_run: missing platform asset",);@@ -240,14 +240,14 @@ pub async fn update_run() -> RpcOutcome<Value> {// this orchestrator can't accidentally bypass the safety net.if let Err(e) = validate_download_url(&download_url) {log::error!("[update:rpc] update_run rejected download URL: {e}");- return RpcOutcome::single_log(+ return Outcome::single_log(serde_json::json!({ "error": e, "applied": false, "restart_requested": false }),format!("update_run rejected: {e}"),);}if let Err(e) = validate_asset_name(&asset_name) {log::error!("[update:rpc] update_run rejected asset name: {e}");- return RpcOutcome::single_log(+ return Outcome::single_log(serde_json::json!({ "error": e, "applied": false, "restart_requested": false }),format!("update_run rejected: {e}"),);@@ -258,7 +258,7 @@ pub async fn update_run() -> RpcOutcome<Value> {Err(e) => {log::error!("[update:rpc] update_run apply failed: {e}");let result = apply_failure_result(info, restart_strategy, &e);- return RpcOutcome::single_log(+ return Outcome::single_log(serde_json::to_value(&result).unwrap_or(Value::Null),format!("update_run: apply failed: {e}"),);@@ -271,25 +271,25 @@ pub async fn update_run() -> RpcOutcome<Value> {result.restart_requested,result.restart_strategy);- RpcOutcome::single_log(+ Outcome::single_log(serde_json::to_value(&result).unwrap_or(Value::Null),"update_run completed",)}/// Check GitHub Releases for a newer version of the core binary.-pub async fn update_check() -> RpcOutcome<Value> {+pub async fn update_check() -> Outcome<Value> {log::info!("[update:rpc] update_check invoked");match update::check_available().await {Ok(info) => {let value = serde_json::to_value(&info).unwrap_or_else(|e| serde_json::json!({ "error": format!("serialization failed: {e}") }),);- RpcOutcome::single_log(value, "update_check completed")+ Outcome::single_log(value, "update_check completed")}Err(e) => {log::error!("[update:rpc] update_check failed: {e}");- RpcOutcome::single_log(+ Outcome::single_log(serde_json::json!({ "error": e }),format!("update_check failed: {e}"),)@@ -345,7 +345,7 @@ pub async fn update_apply(download_url: String,asset_name: String,_staging_dir: Option<String>,-) -> RpcOutcome<Value> {+) -> Outcome<Value> {log::info!("[update:rpc] update_apply invoked — url={} asset={}",download_url,@@ -354,7 +354,7 @@ pub async fn update_apply(let policy = match enforce_update_mutation_policy("openhuman.update_apply").await {Ok(policy) => policy,Err(error) => {- return RpcOutcome::single_log(+ return Outcome::single_log(serde_json::json!({ "error": error }),"update_apply rejected by policy",);@@ -364,14 +364,14 @@ pub async fn update_apply(// Validate inputs at the RPC boundary.if let Err(e) = validate_download_url(&download_url) {log::error!("[update:rpc] rejected download URL: {e}");- return RpcOutcome::single_log(+ return Outcome::single_log(serde_json::json!({ "error": e }),format!("update_apply rejected: {e}"),);}if let Err(e) = validate_asset_name(&asset_name) {log::error!("[update:rpc] rejected asset name: {e}");- return RpcOutcome::single_log(+ return Outcome::single_log(serde_json::json!({ "error": e }),format!("update_apply rejected: {e}"),);@@ -385,11 +385,11 @@ pub async fn update_apply(let value = serde_json::to_value(&result).unwrap_or_else(|e| serde_json::json!({ "error": format!("serialization failed: {e}") }),);- RpcOutcome::single_log(value, "update_apply completed")+ Outcome::single_log(value, "update_apply completed")}Err(e) => {log::error!("[update:rpc] update_apply failed: {e}");- RpcOutcome::single_log(+ Outcome::single_log(serde_json::json!({ "error": e }),format!("update_apply failed: {e}"),)diff --git a/crates/openhuman-core/src/platform/update/schemas.rs b/crates/openhuman-core/src/platform/update/schemas.rsindex 20cb6a3e53..2da160de31 100644--- a/crates/openhuman-core/src/platform/update/schemas.rs+++ b/crates/openhuman-core/src/platform/update/schemas.rs@@ -2,7 +2,7 @@ use serde_json::{Map, Value};use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub fn all_controller_schemas() -> Vec<ControllerSchema> {vec![@@ -156,7 +156,7 @@ fn handle_apply(params: Map<String, Value>) -> ControllerFuture {})}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/runtime/node/rpc.rs b/crates/openhuman-core/src/runtime/node/rpc.rsindex 78ad98a978..602382ab69 100644--- a/crates/openhuman-core/src/runtime/node/rpc.rs+++ b/crates/openhuman-core/src/runtime/node/rpc.rs@@ -2,7 +2,7 @@ use serde::Deserialize;use serde_json::{json, Value};use crate::config::rpc as config_rpc;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::runtime::javascript;#[derive(Debug, Deserialize, Default)]@@ -30,7 +30,7 @@ pub(crate) async fn list_tools_handler(.map(|tools| tools.len()).unwrap_or(0))];- RpcOutcome::new(payload, log).into_cli_compatible_json()+ Outcome::new(payload, log).into_cli_compatible_json()}pub(crate) async fn execute_tool_handler(@@ -54,5 +54,5 @@ pub(crate) async fn execute_tool_handler(payload["tool_name"].as_str().unwrap_or("<unknown>"),payload["elapsed_ms"].as_u64().unwrap_or(0))];- RpcOutcome::new(payload, log).into_cli_compatible_json()+ Outcome::new(payload, log).into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/sandbox/schemas.rs b/crates/openhuman-core/src/sandbox/schemas.rsindex b7cebde511..94270f7c7a 100644--- a/crates/openhuman-core/src/sandbox/schemas.rs+++ b/crates/openhuman-core/src/sandbox/schemas.rs@@ -5,7 +5,7 @@ use serde_json::{Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub fn all_controller_schemas() -> Vec<ControllerSchema> {vec![@@ -199,7 +199,7 @@ fn handle_status(params: Map<String, Value>) -> ControllerFuture {is_remote,);let handle = super::ops::create_sandbox_backend(&policy).await;- to_json(RpcOutcome::new(handle, vec![]))+ to_json(Outcome::new(handle, vec![]))})}@@ -246,14 +246,14 @@ fn handle_resolve_policy(params: Map<String, Value>) -> ControllerFuture {&config.runtime,is_remote,);- to_json(RpcOutcome::new(policy, vec![]))+ to_json(Outcome::new(policy, vec![]))})}fn handle_cleanup_orphans(_params: Map<String, Value>) -> ControllerFuture {Box::pin(async {match super::docker::cleanup_orphaned_containers().await {- Ok(count) => to_json(RpcOutcome::new(+ Ok(count) => to_json(Outcome::new(serde_json::json!({ "cleaned": count }),vec![],)),@@ -273,11 +273,11 @@ fn handle_validate_policy(params: Map<String, Value>) -> ControllerFuture {Ok(()) => serde_json::json!({ "valid": true, "issues": [] }),Err(issues) => serde_json::json!({ "valid": false, "issues": issues }),};- to_json(RpcOutcome::new(result, vec![]))+ to_json(Outcome::new(result, vec![]))})}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/security/README.md b/crates/openhuman-core/src/security/README.mdindex bd75f8f6fa..8d55d8a91c 100644--- a/crates/openhuman-core/src/security/README.md+++ b/crates/openhuman-core/src/security/README.md@@ -71,7 +71,7 @@ AppContainer backend; the two domains are not interchangeable.redaction for logs.- `pub use ops as rpc` — `ops.rs`'s `security_policy_info_for_config(&Config)`and `load_and_get_security_policy_info()` return- `RpcOutcome<serde_json::Value>` and back the `security.policy_info` RPC+ `Outcome<serde_json::Value>` and back the `security.policy_info` RPCfunction; `tools.rs` exposes the same read to the agent.## The policy is off by defaultdiff --git a/crates/openhuman-core/src/security/approval/README.md b/crates/openhuman-core/src/security/approval/README.mdindex 3d110bea48..4a51d36e23 100644--- a/crates/openhuman-core/src/security/approval/README.md+++ b/crates/openhuman-core/src/security/approval/README.md@@ -25,7 +25,7 @@ Interactive approval workflow for supervised mode (issue #1339). `ApprovalGate`| `crates/openhuman-core/src/security/approval/store.rs` | SQLite persistence (`pending_approvals` table). `insert_pending`, `decide`, `get_decision`, `record_execution`, `list_pending`, `list_recent_decisions`, `purge_session`, `expire_stale`, plus idempotent column migration for the v1 schema. || `crates/openhuman-core/src/security/approval/types.rs` | Serde domain types: `PendingApproval`, `ApprovalAuditEntry`, `ApprovalDecision`, `GateOutcome`, `ExecutionOutcome`. || `crates/openhuman-core/src/security/approval/redact.rs` | `redact_args` (PII/chat-content key scrubbing + home-path stripping) and `summarize_action` (safe-field summary). |-| `crates/openhuman-core/src/security/approval/rpc.rs` | Domain RPC entry points returning `RpcOutcome<T>`: `approval_get_gate_state`, `approval_list_pending`, `approval_list_recent_decisions`, `approval_decide`, `approval_preauthorize_flow`. |+| `crates/openhuman-core/src/security/approval/rpc.rs` | Domain RPC entry points returning `Outcome<T>`: `approval_get_gate_state`, `approval_list_pending`, `approval_list_recent_decisions`, `approval_decide`, `approval_preauthorize_flow`. || `crates/openhuman-core/src/security/approval/schemas.rs` | Controller schemas + `handle_*` fns wiring the RPC into the registry. |## Public surface@@ -76,7 +76,7 @@ SQLite DB at `{workspace_dir}/approval/approval.db`, table `pending_approvals` (- `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::rpc::Outcome` — 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.diff --git a/crates/openhuman-core/src/security/approval/rpc.rs b/crates/openhuman-core/src/security/approval/rpc.rsindex e09b34a2cb..f5f50a65e2 100644--- a/crates/openhuman-core/src/security/approval/rpc.rs+++ b/crates/openhuman-core/src/security/approval/rpc.rs@@ -5,7 +5,7 @@use anyhow::anyhow;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::gate::{try_boot_state, ApprovalGate, ApprovalGateBootState, DecideMiss};use super::types::{@@ -25,7 +25,7 @@ const MAX_PREAUTHORIZE_TOOLS: usize = 100;/// Returns a benign "installed, no banner" default when the boot state was/// never recorded — older test paths that bring up the gate directly bypass/// `bootstrap_core_runtime` and therefore never call `record_boot_state`.-pub async fn approval_get_gate_state() -> anyhow::Result<RpcOutcome<ApprovalGateBootState>> {+pub async fn approval_get_gate_state() -> anyhow::Result<Outcome<ApprovalGateBootState>> {tracing::debug!("[rpc:approval_get_gate_state] entry");let state = try_boot_state().unwrap_or(ApprovalGateBootState {installed: ApprovalGate::try_global().is_some(),@@ -40,7 +40,7 @@ pub async fn approval_get_gate_state() -> anyhow::Result<RpcOutcome<ApprovalGatehost = state.host,"[rpc:approval_get_gate_state] exit");- Ok(RpcOutcome::new(state, vec![]))+ Ok(Outcome::new(state, vec![]))}/// List rows still awaiting a user decision in the current session.@@ -48,11 +48,11 @@ pub async fn approval_get_gate_state() -> anyhow::Result<RpcOutcome<ApprovalGate/// Returns an empty list (not an error) when the gate is not/// installed — supervised mode may be disabled, in which case there/// is nothing pending by definition.-pub async fn approval_list_pending() -> anyhow::Result<RpcOutcome<Vec<PendingApproval>>> {+pub async fn approval_list_pending() -> anyhow::Result<Outcome<Vec<PendingApproval>>> {tracing::debug!("[rpc:approval_list_pending] entry");let Some(gate) = ApprovalGate::try_global() else {tracing::debug!("[rpc:approval_list_pending] gate not installed, returning empty");- return Ok(RpcOutcome::new(Vec::new(), vec![]));+ return Ok(Outcome::new(Vec::new(), vec![]));};let rows = match gate.list_pending() {Ok(rows) => rows,@@ -63,17 +63,17 @@ pub async fn approval_list_pending() -> anyhow::Result<RpcOutcome<Vec<PendingApp};tracing::debug!(rows = rows.len(), "[rpc:approval_list_pending] exit");let log = format!("[approval] list_pending returned {} row(s)", rows.len());- Ok(RpcOutcome::single_log(rows, log))+ Ok(Outcome::single_log(rows, log))}/// List recently decided approval rows for audit/diagnostic surfaces.pub async fn approval_list_recent_decisions(limit: Option<usize>,-) -> anyhow::Result<RpcOutcome<Vec<ApprovalAuditEntry>>> {+) -> anyhow::Result<Outcome<Vec<ApprovalAuditEntry>>> {tracing::debug!("[rpc:approval_list_recent_decisions] entry");let Some(gate) = ApprovalGate::try_global() else {tracing::debug!("[rpc:approval_list_recent_decisions] gate not installed, returning empty");- return Ok(RpcOutcome::new(Vec::new(), vec![]));+ return Ok(Outcome::new(Vec::new(), vec![]));};let limit = limit.unwrap_or(50);let rows = match gate.list_recent_decisions(limit) {@@ -92,7 +92,7 @@ pub async fn approval_list_recent_decisions(limit = limit,"[rpc:approval_list_recent_decisions] exit");- Ok(RpcOutcome::single_log(rows, log))+ Ok(Outcome::single_log(rows, log))}/// Batch-grant "approve always for this flow" trust at save+enable time@@ -107,7 +107,7 @@ pub async fn approval_list_recent_decisions(pub async fn approval_preauthorize_flow(flow_id: &str,tool_names: Vec<String>,-) -> anyhow::Result<RpcOutcome<FlowPreauthorizationResult>> {+) -> anyhow::Result<Outcome<FlowPreauthorizationResult>> {tracing::debug!(flow_id = flow_id,tools = tool_names.len(),@@ -127,7 +127,7 @@ pub async fn approval_preauthorize_flow(flow_id = flow_id,"[rpc:approval_preauthorize_flow] gate not installed; nothing to grant");- return Ok(RpcOutcome::single_log(+ return Ok(Outcome::single_log(FlowPreauthorizationResult {flow_id: flow_id.to_string(),granted: vec![],@@ -176,7 +176,7 @@ pub async fn approval_preauthorize_flow(granted.len(),already_trusted.len());- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(FlowPreauthorizationResult {flow_id: flow_id.to_string(),granted,@@ -192,7 +192,7 @@ pub async fn approval_preauthorize_flow(pub async fn approval_decide(request_id: &str,decision: ApprovalDecision,-) -> anyhow::Result<RpcOutcome<PendingApproval>> {+) -> anyhow::Result<Outcome<PendingApproval>> {tracing::debug!(request_id = request_id,decision = decision.as_str(),@@ -349,5 +349,5 @@ pub async fn approval_decide(decision = decision.as_str(),"[rpc:approval_decide] exit");- Ok(RpcOutcome::new(row, logs))+ Ok(Outcome::new(row, logs))}diff --git a/crates/openhuman-core/src/security/approval/schemas.rs b/crates/openhuman-core/src/security/approval/schemas.rsindex 8fd0ee6b0b..5a9176ba7e 100644--- a/crates/openhuman-core/src/security/approval/schemas.rs+++ b/crates/openhuman-core/src/security/approval/schemas.rs@@ -7,7 +7,7 @@ use serde_json::{Map, Value};use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::rpc as approval_rpc;use super::types::ApprovalDecision;@@ -266,7 +266,7 @@ fn read_required_string(params: &Map<String, Value>, key: &str) -> Result<String}}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/security/credentials/README.md b/crates/openhuman-core/src/security/credentials/README.mdindex 105a5b7377..960a3a18d7 100644--- a/crates/openhuman-core/src/security/credentials/README.md+++ b/crates/openhuman-core/src/security/credentials/README.md@@ -24,7 +24,7 @@ Credential management for the backend credential the core authenticates with and| `core.rs` | `AuthService` facade over `AuthProfilesStore` — store/get/remove/set-active profiles, resolve bearer token, profile-id selection logic (override → active → default → any-for-provider), provider normalization, state-dir derivation. || `profiles.rs` | The persistence engine. `AuthProfile` / `TokenSet` / `AuthProfileKind` / `AuthProfilesData` types and `AuthProfilesStore` — atomic JSON read/write, keychain vs encrypted-JSON secret handling, legacy migration, corrupt-store quarantine, PID-aware stale-lock recovery. || `api_key.rs` | The `api-key` profile: `store_api_key[_in]`, `get_api_key[_in]`, `has_api_key[_in]`, `clear_api_key`. |-| `ops.rs` + `ops/` | Business logic + RPC entry points (returns `RpcOutcome<T>`). `ops/credential.rs` (`set_credential` / `clear_credential`, plus the historical `store_session` / `clear_session` names), `ops/user_scope.rs` (user-dir activation and process-global rebinding), `ops/gated_services.rs` (credential-gated services), `ops/boot_env.rs` (env seeding), `ops/session_query.rs` (`auth_get_state`, `auth_get_session_token_json`), `ops/login_tokens.rs` (channel link tokens), `ops/oauth.rs`, `ops/provider_credentials.rs`, `ops/composio.rs`, `ops/secrets.rs`. Re-exported as `rpc`. |+| `ops.rs` + `ops/` | Business logic + RPC entry points (returns `Outcome<T>`). `ops/credential.rs` (`set_credential` / `clear_credential`, plus the historical `store_session` / `clear_session` names), `ops/user_scope.rs` (user-dir activation and process-global rebinding), `ops/gated_services.rs` (credential-gated services), `ops/boot_env.rs` (env seeding), `ops/session_query.rs` (`auth_get_state`, `auth_get_session_token_json`), `ops/login_tokens.rs` (channel link tokens), `ops/oauth.rs`, `ops/provider_credentials.rs`, `ops/composio.rs`, `ops/secrets.rs`. Re-exported as `rpc`. || `schemas.rs` | `auth.*` controller schemas + `handle_*` dispatchers delegating to `ops`. Defines `all_controller_schemas` / `all_registered_controllers`. || `session_support.rs` | `CredentialKind`, `BackendCredential`, `resolve_backend_credential`, `require_live_session_token`, `has_backend_credential`, `build_session_state`, `get_session_token`, `load_app_session_profile`, `user_id_from_jwt_claims`, local-session detection/slug, field parsing. Shared by RPC and the HTTP host. || `identity.rs` | The signed-in user's identity slot (`peek_credential_user_identity`), seeded from the host-supplied payload for prompts and Sentry. |@@ -95,7 +95,7 @@ Note: `list_provider_credentials_by_prefix` and the Composio-direct/secret helpe- `crate::memory` — bind memory client to the active workspace after activation.- `crate::inference::host_runtime`, `crate::voice::{server,dictation_listener,always_on}` — credential-gated services started/stopped.- `crate::api::config`, `::jwt`, `::rest` — backend API URL, JWT `exp` decode, `BackendOAuthClient` + OAuth/handoff types.-- `crate::core::all` (`ControllerFuture`, `RegisteredController`), `crate::core` (`ControllerSchema`/`FieldSchema`/`TypeSchema`), `crate::core::events::DomainEvent` + `tinybus::EventHandler`, `crate::rpc::RpcOutcome` — controller registry + RPC envelope + event bus.+- `crate::core::all` (`ControllerFuture`, `RegisteredController`), `crate::core` (`ControllerSchema`/`FieldSchema`/`TypeSchema`), `crate::core::events::DomainEvent` + `tinybus::EventHandler`, `crate::rpc::Outcome` — controller registry + RPC envelope + event bus.## Used bydiff --git a/crates/openhuman-core/src/security/credentials/ops/composio.rs b/crates/openhuman-core/src/security/credentials/ops/composio.rsindex 9676152668..a7b2441077 100644--- a/crates/openhuman-core/src/security/credentials/ops/composio.rs+++ b/crates/openhuman-core/src/security/credentials/ops/composio.rs@@ -3,7 +3,7 @@use serde_json::json;use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::security::credentials::{AuthService, DEFAULT_AUTH_PROFILE_NAME};/// Provider slot for the user-provided Composio API key when running in@@ -26,7 +26,7 @@ pub const COMPOSIO_DIRECT_PROVIDER: &str = "composio-direct";pub async fn store_composio_api_key(config: &Config,api_key: &str,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let trimmed = api_key.trim();if trimmed.is_empty() {return Err("composio api_key must not be empty".to_string());@@ -45,7 +45,7 @@ pub async fn store_composio_api_key().map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({ "stored": true, "provider": COMPOSIO_DIRECT_PROVIDER }),"composio direct api key stored",))@@ -70,7 +70,7 @@ pub fn get_composio_api_key(config: &Config) -> Result<Option<String>, String> {pub async fn rpc_store_composio_api_key(config: &Config,api_key: &str,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {store_composio_api_key(config, api_key).await}@@ -78,13 +78,13 @@ pub async fn rpc_store_composio_api_key(/// switches back to backend mode and explicitly clears their key.pub async fn clear_composio_api_key(config: &Config,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {tracing::debug!("[composio-direct] clearing stored api key");let auth = AuthService::from_config(config);let removed = auth.remove_profile(COMPOSIO_DIRECT_PROVIDER, DEFAULT_AUTH_PROFILE_NAME).map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({ "removed": removed }),"composio direct api key cleared",))diff --git a/crates/openhuman-core/src/security/credentials/ops/credential.rs b/crates/openhuman-core/src/security/credentials/ops/credential.rsindex 563f3cc8bf..53f9c3c623 100644--- a/crates/openhuman-core/src/security/credentials/ops/credential.rs+++ b/crates/openhuman-core/src/security/credentials/ops/credential.rs@@ -14,7 +14,7 @@ use serde_json::{json, Value};use crate::api::jwt::decode_jwt_exp;use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::security::credentials::responses::AuthStateResponse;use crate::security::credentials::session_support::{build_session_state, load_app_session_profile, local_session_user_id,@@ -180,7 +180,7 @@ fn resolve(request: SetCredentialRequest) -> Result<Resolved, String> {pub async fn set_credential(config: &Config,request: SetCredentialRequest,-) -> Result<RpcOutcome<AuthStateResponse>, String> {+) -> Result<Outcome<AuthStateResponse>, String> {let resolved = resolve(request)?;let _mutation = CREDENTIAL_MUTATION_LOCK.lock().await;@@ -205,7 +205,7 @@ pub async fn set_credential("{LOG_PREFIX} api key stored");let state = build_session_state(config)?;- return Ok(RpcOutcome::single_log(state, "api key stored"));+ return Ok(Outcome::single_log(state, "api key stored"));}let user_id = resolved@@ -336,7 +336,7 @@ pub async fn set_credential();let state = build_session_state(&effective_config)?;- Ok(RpcOutcome::new(state, logs))+ Ok(Outcome::new(state, logs))}/// Remove the stored credential of `kind` — or every credential when `None`.@@ -345,7 +345,7 @@ pub async fn set_credential(pub async fn clear_credential(config: &Config,kind: Option<CredentialKind>,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let _mutation = CREDENTIAL_MUTATION_LOCK.lock().await;let mut logs = Vec::new();let mut removed_session = false;@@ -452,7 +452,7 @@ pub async fn clear_credential(logs.push("credential-gated services restarted for api key".to_string());}- Ok(RpcOutcome::new(+ Ok(Outcome::new(json!({"removed": removed_session || removed_api_key,"removedSession": removed_session,@@ -467,7 +467,7 @@ pub async fn clear_credential(/// teardown, user-dir deactivation, service stop, rebind to the signed-out/// workspace, and Sentry / identity clear. Callers hold/// [`CREDENTIAL_MUTATION_LOCK`].-async fn clear_session_credential(config: &Config) -> Result<RpcOutcome<bool>, String> {+async fn clear_session_credential(config: &Config) -> Result<Outcome<bool>, String> {let mut logs = Vec::new();crate::cron::scheduler_gate::set_signed_out(true);identity::clear_current_user();@@ -514,7 +514,7 @@ async fn clear_session_credential(config: &Config) -> Result<RpcOutcome<bool>, Ssentry_scope::clear();logs.push("session cleared".to_string());- Ok(RpcOutcome::new(removed, logs))+ Ok(Outcome::new(removed, logs))}/// Historical entry point: install a session (or local) credential from a@@ -524,7 +524,7 @@ pub async fn store_session(token: &str,user_id: Option<String>,user: Option<Value>,-) -> Result<RpcOutcome<AuthStateResponse>, String> {+) -> Result<Outcome<AuthStateResponse>, String> {set_credential(config,SetCredentialRequest {@@ -539,6 +539,6 @@ pub async fn store_session(/// Historical entry point: sign the session out. Same as/// [`clear_credential`] for the session kind.-pub async fn clear_session(config: &Config) -> Result<RpcOutcome<Value>, String> {+pub async fn clear_session(config: &Config) -> Result<Outcome<Value>, String> {clear_credential(config, Some(CredentialKind::Session)).await}diff --git a/crates/openhuman-core/src/security/credentials/ops/login_tokens.rs b/crates/openhuman-core/src/security/credentials/ops/login_tokens.rsindex a785ccf25e..193b3d10a0 100644--- a/crates/openhuman-core/src/security/credentials/ops/login_tokens.rs+++ b/crates/openhuman-core/src/security/credentials/ops/login_tokens.rs@@ -4,12 +4,12 @@ use crate::api::config::effective_backend_api_url;use crate::api::jwt::get_session_token;use crate::api::rest::BackendOAuthClient;use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub async fn auth_create_channel_link_token(config: &Config,channel: &str,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let channel = channel.trim();if channel.is_empty() {return Err("channel is required".to_string());@@ -29,7 +29,7 @@ pub async fn auth_create_channel_link_token(// keep their full anyhow chain..map_err(crate::api::flatten_authed_error)?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(payload,"channel link token created",))diff --git a/crates/openhuman-core/src/security/credentials/ops/oauth.rs b/crates/openhuman-core/src/security/credentials/ops/oauth.rsindex 36d4a95690..bb28764a1f 100644--- a/crates/openhuman-core/src/security/credentials/ops/oauth.rs+++ b/crates/openhuman-core/src/security/credentials/ops/oauth.rs@@ -6,7 +6,7 @@ use crate::api::config::effective_backend_api_url;use crate::api::jwt::get_session_token;use crate::api::rest::BackendOAuthClient;use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub async fn oauth_connect(config: &Config,@@ -14,7 +14,7 @@ pub async fn oauth_connect(skill_id: Option<&str>,response_type: Option<&str>,encryption_mode: Option<&str>,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let api_url = effective_backend_api_url(&config.api_url);let token = get_session_token(config)?.ok_or_else(|| {"session JWT required; complete login and store_session first".to_string()@@ -24,7 +24,7 @@ pub async fn oauth_connect(.connect(provider, &token, skill_id, response_type, encryption_mode).await.map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(serde_json::json!({ "oauthUrl": r.oauth_url, "state": r.state }),"oauth connect URL ready",))@@ -32,7 +32,7 @@ pub async fn oauth_connect(pub async fn oauth_list_integrations(config: &Config,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let api_url = effective_backend_api_url(&config.api_url);let token = get_session_token(config)?.ok_or_else(|| "session JWT required".to_string())?;let client = BackendOAuthClient::new(&api_url).map_err(|e| e.to_string())?;@@ -40,7 +40,7 @@ pub async fn oauth_list_integrations(.list_integrations(&token).await.map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(serde_json::to_value(&list).map_err(|e| e.to_string())?,"integrations listed",))@@ -50,7 +50,7 @@ pub async fn oauth_fetch_integration_tokens(config: &Config,integration_id: &str,encryption_key: &str,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let api_url = effective_backend_api_url(&config.api_url);let token = get_session_token(config)?.ok_or_else(|| "session JWT required".to_string())?;let client = BackendOAuthClient::new(&api_url).map_err(|e| e.to_string())?;@@ -58,7 +58,7 @@ pub async fn oauth_fetch_integration_tokens(.fetch_integration_tokens_handoff(integration_id, &token, encryption_key).await.map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(serde_json::to_value(&tokens).map_err(|e| e.to_string())?,"integration tokens retrieved",))@@ -67,7 +67,7 @@ pub async fn oauth_fetch_integration_tokens(pub async fn oauth_fetch_client_key(config: &Config,integration_id: &str,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let api_url = effective_backend_api_url(&config.api_url);let token = get_session_token(config)?.ok_or_else(|| "session JWT required".to_string())?;let client = BackendOAuthClient::new(&api_url).map_err(|e| e.to_string())?;@@ -79,7 +79,7 @@ pub async fn oauth_fetch_client_key("[credentials] client key retrieved for integration {}",integration_id);- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({ "clientKey": client_key, "integrationId": integration_id }),"client key retrieved (one-time handoff)",))@@ -88,7 +88,7 @@ pub async fn oauth_fetch_client_key(pub async fn oauth_revoke_integration(config: &Config,integration_id: &str,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let api_url = effective_backend_api_url(&config.api_url);let token = get_session_token(config)?.ok_or_else(|| "session JWT required".to_string())?;let client = BackendOAuthClient::new(&api_url).map_err(|e| e.to_string())?;@@ -96,7 +96,7 @@ pub async fn oauth_revoke_integration(.revoke_integration(integration_id, &token).await.map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(serde_json::json!({ "revoked": true, "integrationId": integration_id }),"integration revoked",))diff --git a/crates/openhuman-core/src/security/credentials/ops/provider_credentials.rs b/crates/openhuman-core/src/security/credentials/ops/provider_credentials.rsindex 644a1dc59e..491a9eba58 100644--- a/crates/openhuman-core/src/security/credentials/ops/provider_credentials.rs+++ b/crates/openhuman-core/src/security/credentials/ops/provider_credentials.rs@@ -3,7 +3,7 @@use serde_json::json;use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::security::credentials::session_support::{parse_fields_value, profile_name_or_default, summarize_auth_profile,};@@ -16,7 +16,7 @@ pub async fn store_provider_credentials(token: Option<String>,fields: Option<serde_json::Value>,set_active: Option<bool>,-) -> Result<RpcOutcome<super::super::responses::AuthProfileSummary>, String> {+) -> Result<Outcome<super::super::responses::AuthProfileSummary>, String> {let provider = provider.trim().to_string();if provider.is_empty() {return Err("provider is required".to_string());@@ -52,7 +52,7 @@ pub async fn store_provider_credentials(// notify again). Credentials are keyed `provider:<slug>`; the auth-error// registry is keyed by the bare provider slug used by the chat factory.clear_provider_auth_error(&provider);- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(summarize_auth_profile(&stored),"provider credentials stored",))@@ -70,7 +70,7 @@ pub async fn remove_provider_credentials(config: &Config,provider: &str,profile: Option<&str>,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let profile_name = profile_name_or_default(profile);let auth = AuthService::from_config(config);let removed = auth@@ -79,7 +79,7 @@ pub async fn remove_provider_credentials(// Removing the key clears any recorded BYO auth error for this provider —// there is no longer a key to be "rejected", so the stale notice must go.clear_provider_auth_error(provider);- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({"removed": removed,"provider": provider,@@ -92,7 +92,7 @@ pub async fn remove_provider_credentials(pub async fn list_provider_credentials(config: &Config,provider_filter: Option<String>,-) -> Result<RpcOutcome<Vec<super::super::responses::AuthProfileSummary>>, String> {+) -> Result<Outcome<Vec<super::super::responses::AuthProfileSummary>>, String> {let auth = AuthService::from_config(config);let provider_filter = provider_filter.map(|provider| normalize_provider(&provider))@@ -116,7 +116,7 @@ pub async fn list_provider_credentials(.then_with(|| a.profile_name.cmp(&b.profile_name))});- Ok(RpcOutcome::single_log(items, "provider credentials listed"))+ Ok(Outcome::single_log(items, "provider credentials listed"))}/// List credentials whose provider key starts with `prefix`.diff --git a/crates/openhuman-core/src/security/credentials/ops/secrets.rs b/crates/openhuman-core/src/security/credentials/ops/secrets.rsindex eb1c0df611..002a27d94e 100644--- a/crates/openhuman-core/src/security/credentials/ops/secrets.rs+++ b/crates/openhuman-core/src/security/credentials/ops/secrets.rs@@ -1,7 +1,7 @@//! Encrypt / decrypt arbitrary secrets with the config's `SecretStore`.use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::security::keyring::SecretStore;pub(crate) fn secret_store_for_config(config: &Config) -> SecretStore {@@ -15,17 +15,17 @@ pub(crate) fn secret_store_for_config(config: &Config) -> SecretStore {pub async fn encrypt_secret(config: &Config,plaintext: &str,-) -> Result<RpcOutcome<String>, String> {+) -> Result<Outcome<String>, String> {let store = secret_store_for_config(config);let ciphertext = store.encrypt(plaintext).map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(ciphertext, "secret encrypted"))+ Ok(Outcome::single_log(ciphertext, "secret encrypted"))}pub async fn decrypt_secret(config: &Config,ciphertext: &str,-) -> Result<RpcOutcome<String>, String> {+) -> Result<Outcome<String>, String> {let store = secret_store_for_config(config);let plaintext = store.decrypt(ciphertext).map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(plaintext, "secret decrypted"))+ Ok(Outcome::single_log(plaintext, "secret decrypted"))}diff --git a/crates/openhuman-core/src/security/credentials/ops/session_query.rs b/crates/openhuman-core/src/security/credentials/ops/session_query.rsindex 9eb73977df..9c8e6d4eb5 100644--- a/crates/openhuman-core/src/security/credentials/ops/session_query.rs+++ b/crates/openhuman-core/src/security/credentials/ops/session_query.rs@@ -4,21 +4,21 @@ use serde_json::json;use crate::api::jwt::get_session_token;use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::security::credentials::session_support::build_session_state;pub async fn auth_get_state(config: &Config,-) -> Result<RpcOutcome<super::super::responses::AuthStateResponse>, String> {+) -> Result<Outcome<super::super::responses::AuthStateResponse>, String> {let state = build_session_state(config)?;- Ok(RpcOutcome::single_log(state, "session state fetched"))+ Ok(Outcome::single_log(state, "session state fetched"))}pub async fn auth_get_session_token_json(config: &Config,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {let token = get_session_token(config)?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({ "token": token }),"session token fetched",))diff --git a/crates/openhuman-core/src/security/credentials/schemas.rs b/crates/openhuman-core/src/security/credentials/schemas.rsindex 9d56c1cae2..135a0e4390 100644--- a/crates/openhuman-core/src/security/credentials/schemas.rs+++ b/crates/openhuman-core/src/security/credentials/schemas.rs@@ -5,7 +5,7 @@ use serde_json::{Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;#[derive(Debug, Deserialize)]#[serde(rename_all = "camelCase")]@@ -538,7 +538,7 @@ fn json_output(name: &'static str, comment: &'static str) -> FieldSchema {}}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/security/credentials/schemas_tests.rs b/crates/openhuman-core/src/security/credentials/schemas_tests.rsindex ec2dbf6abe..6cb699599e 100644--- a/crates/openhuman-core/src/security/credentials/schemas_tests.rs+++ b/crates/openhuman-core/src/security/credentials/schemas_tests.rs@@ -213,9 +213,9 @@ fn deserialize_params_parses_optional_provider_filter() {#[test]fn to_json_emits_logs_and_result_envelope() {- let outcome = RpcOutcome::single_log(serde_json::json!({"ok": true}), "my-log");+ let outcome = Outcome::single_log(serde_json::json!({"ok": true}), "my-log");let v = to_json(outcome).unwrap();- // `into_cli_compatible_json` wraps RpcOutcome as `{logs, result}`.+ // `into_cli_compatible_json` wraps Outcome as `{logs, result}`.assert!(v.get("logs").is_some(), "expected a `logs` field: {v}");assert!(v.get("result").is_some(),diff --git a/crates/openhuman-core/src/security/devices/README.md b/crates/openhuman-core/src/security/devices/README.mdindex 9535a462f7..fff87dce38 100644--- a/crates/openhuman-core/src/security/devices/README.md+++ b/crates/openhuman-core/src/security/devices/README.md@@ -90,7 +90,7 @@ Separately, encrypted X25519 private keys are persisted as `enc2:` strings (via- `crate::platform::socket::global_socket_manager` — reuse the shared backend Socket.IO connection to emit `tunnel:*` events (no second WebSocket).- `crate::core::bus::BUS` (`.publish`, `.subscribe`) + `crate::core::events::DomainEvent` + `tinybus::EventHandler` — pub/sub for device tunnel events.- `crate::core::all` (`ControllerFuture`, `RegisteredController`) and `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` — controller registry contract.-- `crate::rpc::RpcOutcome` — RPC handler return type.+- `crate::rpc::Outcome` — RPC handler return type.- External crates: `rusqlite`, `chacha20poly1305`, `x25519-dalek`, `base64`, `sha2`, `chrono`, `once_cell`, `tokio`, `async_trait`, `anyhow`.## Used bydiff --git a/crates/openhuman-core/src/security/devices/rpc.rs b/crates/openhuman-core/src/security/devices/rpc.rsindex b9bef72426..0a317d9de6 100644--- a/crates/openhuman-core/src/security/devices/rpc.rs+++ b/crates/openhuman-core/src/security/devices/rpc.rs@@ -14,7 +14,7 @@ use std::collections::HashMap;use std::sync::{Arc, Mutex};use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::security::devices::crypto::{base64url_decode, base64url_encode, DeviceKeypair, TunnelCipher,};@@ -69,7 +69,7 @@ pub(crate) static ACTIVE_CIPHERS: once_cell::sync::Lazy<pub async fn devices_create_pairing(_config: &Config,label: Option<String>,-) -> Result<RpcOutcome<CreatePairingResponse>, String> {+) -> Result<Outcome<CreatePairingResponse>, String> {log::info!("[devices/rpc] devices_create_pairing entry label={:?}",label@@ -160,7 +160,7 @@ pub async fn devices_create_pairing(reg.channel_id);- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(CreatePairingResponse {channel_id: reg.channel_id,pairing_token: reg.pairing_token,@@ -177,7 +177,7 @@ pub async fn devices_create_pairing(// ---------------------------------------------------------------------------/// `openhuman.devices_list`-pub async fn devices_list(config: &Config) -> Result<RpcOutcome<ListDevicesResponse>, String> {+pub async fn devices_list(config: &Config) -> Result<Outcome<ListDevicesResponse>, String> {log::debug!("[devices/rpc] devices_list entry");let mut devices = store::list_devices(config).map_err(|e| format!("[devices/rpc] list_devices failed: {e}"))?;@@ -195,7 +195,7 @@ pub async fn devices_list(config: &Config) -> Result<RpcOutcome<ListDevicesRespo"[devices/rpc] devices_list returning {} device(s)",devices.len());- Ok(RpcOutcome::new(ListDevicesResponse { devices }, vec![]))+ Ok(Outcome::new(ListDevicesResponse { devices }, vec![]))}// ---------------------------------------------------------------------------@@ -206,7 +206,7 @@ pub async fn devices_list(config: &Config) -> Result<RpcOutcome<ListDevicesRespopub async fn devices_revoke(config: &Config,channel_id: String,-) -> Result<RpcOutcome<RevokeDeviceResponse>, String> {+) -> Result<Outcome<RevokeDeviceResponse>, String> {log::info!("[devices/rpc] devices_revoke channel_id={}", channel_id);let revoked = store::revoke_device(config, &channel_id)@@ -232,7 +232,7 @@ pub async fn devices_revoke(revoked);- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(RevokeDeviceResponse { success: revoked },format!("device {channel_id} revoked"),))diff --git a/crates/openhuman-core/src/security/devices/schemas.rs b/crates/openhuman-core/src/security/devices/schemas.rsindex b9b5673097..d03b799667 100644--- a/crates/openhuman-core/src/security/devices/schemas.rs+++ b/crates/openhuman-core/src/security/devices/schemas.rs@@ -8,7 +8,7 @@ use serde_json::{Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;// ---------------------------------------------------------------------------// Public registry functions@@ -195,7 +195,7 @@ fn read_optional_string(params: &Map<String, Value>, key: &str) -> Result<Option}}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/security/encryption/README.md b/crates/openhuman-core/src/security/encryption/README.mdindex 23d59d22f0..4b1cc4d6d4 100644--- a/crates/openhuman-core/src/security/encryption/README.md+++ b/crates/openhuman-core/src/security/encryption/README.md@@ -8,8 +8,8 @@ AES-256-GCM at-rest crypto for AI memory storage and the encrypt/decrypt RPC sur- `pub struct EncryptionKey` — `core.rs:29-32` — `[u8; 32]` AES-256 key wrapper.- `impl EncryptionKey::derive(password: &str, salt: &[u8]) -> Result<Self, String>` — `core.rs:35` — Argon2id with parameters `m=65536, t=3, p=1`.- `pub fn get_data_dir() -> Result<PathBuf, String>` — `core.rs` — resolve the encrypted-data directory under the openhuman workspace.-- `pub async fn encrypt_secret(config: &Config, plaintext: &str) -> Result<RpcOutcome<String>, String>` — `ops.rs:6` — RPC handler, delegates to `credentials::rpc::encrypt_secret`.-- `pub async fn decrypt_secret(config: &Config, ciphertext: &str) -> Result<RpcOutcome<String>, String>` — `ops.rs:13` — RPC handler, delegates to `credentials::rpc::decrypt_secret`.+- `pub async fn encrypt_secret(config: &Config, plaintext: &str) -> Result<Outcome<String>, String>` — `ops.rs:6` — RPC handler, delegates to `credentials::rpc::encrypt_secret`.+- `pub async fn decrypt_secret(config: &Config, ciphertext: &str) -> Result<Outcome<String>, String>` — `ops.rs:13` — RPC handler, delegates to `credentials::rpc::decrypt_secret`.- RPC `encryption.{encrypt_secret, decrypt_secret}` — `schemas.rs` (re-exported via `all_encryption_controller_schemas` / `all_encryption_registered_controllers`).- Constants: `SALT_LENGTH = 16`, `NONCE_LENGTH = 12`, `KEY_LENGTH = 32` (private but stable parameters).diff --git a/crates/openhuman-core/src/security/encryption/ops.rs b/crates/openhuman-core/src/security/encryption/ops.rsindex 584bcba2fb..ca8b77ca27 100644--- a/crates/openhuman-core/src/security/encryption/ops.rs+++ b/crates/openhuman-core/src/security/encryption/ops.rs@@ -1,18 +1,18 @@//! JSON-RPC / CLI controller surface for encryption-focused helpers.use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub async fn encrypt_secret(config: &Config,plaintext: &str,-) -> Result<RpcOutcome<String>, String> {+) -> Result<Outcome<String>, String> {crate::security::credentials::rpc::encrypt_secret(config, plaintext).await}pub async fn decrypt_secret(config: &Config,ciphertext: &str,-) -> Result<RpcOutcome<String>, String> {+) -> Result<Outcome<String>, String> {crate::security::credentials::rpc::decrypt_secret(config, ciphertext).await}diff --git a/crates/openhuman-core/src/security/encryption/schemas.rs b/crates/openhuman-core/src/security/encryption/schemas.rsindex a76feea137..639dce8450 100644--- a/crates/openhuman-core/src/security/encryption/schemas.rs+++ b/crates/openhuman-core/src/security/encryption/schemas.rs@@ -4,7 +4,7 @@ use serde_json::{Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub fn all_controller_schemas() -> Vec<ControllerSchema> {vec![schemas("encrypt_secret"), schemas("decrypt_secret")]@@ -98,7 +98,7 @@ fn read_required<T: DeserializeOwned>(params: &Map<String, Value>, key: &str) ->serde_json::from_value(value).map_err(|e| format!("invalid '{key}': {e}"))}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/security/keyring_consent/ops.rs b/crates/openhuman-core/src/security/keyring_consent/ops.rsindex d1fa9decd0..ec20e7b79c 100644--- a/crates/openhuman-core/src/security/keyring_consent/ops.rs+++ b/crates/openhuman-core/src/security/keyring_consent/ops.rs@@ -1,13 +1,13 @@//! RPC handler implementations for keyring consent.-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::policy;use super::types::{ConsentPreference, KeyringStatus};const LOG_PREFIX: &str = "[keyring_consent]";-pub async fn keyring_status() -> Result<RpcOutcome<KeyringStatus>, String> {+pub async fn keyring_status() -> Result<Outcome<KeyringStatus>, String> {let status = policy::current_status();log::debug!("{LOG_PREFIX} keyring_status available={} mode={} backend={}",@@ -15,10 +15,10 @@ pub async fn keyring_status() -> Result<RpcOutcome<KeyringStatus>, String> {status.active_mode,status.backend_name,);- Ok(RpcOutcome::single_log(status, "keyring status fetched"))+ Ok(Outcome::single_log(status, "keyring status fetched"))}-pub async fn keyring_consent_decide(mode: String) -> Result<RpcOutcome<ConsentPreference>, String> {+pub async fn keyring_consent_decide(mode: String) -> Result<Outcome<ConsentPreference>, String> {if mode != "local_encrypted" && mode != "declined" {return Err(format!("invalid mode '{mode}': expected 'local_encrypted' or 'declined'"@@ -36,16 +36,16 @@ pub async fn keyring_consent_decide(mode: String) -> Result<RpcOutcome<ConsentPr// Only update the in-memory cache after a successful persist.policy::apply_consent(&pref);- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(pref,format!("keyring consent recorded: {mode}"),))}-pub async fn keyring_retry_probe() -> Result<RpcOutcome<KeyringStatus>, String> {+pub async fn keyring_retry_probe() -> Result<Outcome<KeyringStatus>, String> {log::info!("{LOG_PREFIX} keyring_retry_probe");let status = policy::retry_probe();- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(status,"keyring probe retried".to_string(),))diff --git a/crates/openhuman-core/src/security/keyring_consent/types_tests.rs b/crates/openhuman-core/src/security/keyring_consent/types_tests.rsindex 3e558cdc3c..01bf1793e6 100644--- a/crates/openhuman-core/src/security/keyring_consent/types_tests.rs+++ b/crates/openhuman-core/src/security/keyring_consent/types_tests.rs@@ -18,7 +18,7 @@ fn storage_mode_serialization_roundtrip() {}/// `Display` and the serde representation must agree: `activeMode` reaches the-/// frontend as the serialized string, while logs and `RpcOutcome` messages use+/// frontend as the serialized string, while logs and `Outcome` messages use/// `Display`, and `SecurityPanel` keys its badge variant + i18n lookup off the/// serialized form. A variant whose two spellings diverge renders as an unstyled/// unknown mode.diff --git a/crates/openhuman-core/src/security/ops.rs b/crates/openhuman-core/src/security/ops.rsindex aa12e68a17..b46fdb7849 100644--- a/crates/openhuman-core/src/security/ops.rs+++ b/crates/openhuman-core/src/security/ops.rs@@ -3,7 +3,7 @@use serde_json::json;use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::security::SecurityPolicy;fn policy_info_payload(policy: SecurityPolicy) -> serde_json::Value {@@ -17,14 +17,14 @@ fn policy_info_payload(policy: SecurityPolicy) -> serde_json::Value {})}-pub fn security_policy_info_for_config(config: &Config) -> RpcOutcome<serde_json::Value> {+pub fn security_policy_info_for_config(config: &Config) -> Outcome<serde_json::Value> {let policy =SecurityPolicy::from_config(&config.autonomy, &config.workspace_dir, &config.action_dir);let payload = policy_info_payload(policy);- RpcOutcome::single_log(payload, "security_policy_info computed from active config")+ Outcome::single_log(payload, "security_policy_info computed from active config")}-pub async fn load_and_get_security_policy_info() -> Result<RpcOutcome<serde_json::Value>, String> {+pub async fn load_and_get_security_policy_info() -> Result<Outcome<serde_json::Value>, String> {let config = crate::config::ops::load_config_with_timeout().await?;Ok(security_policy_info_for_config(&config))}diff --git a/crates/openhuman-core/src/security/schemas.rs b/crates/openhuman-core/src/security/schemas.rsindex c1e8551ed8..815b3484da 100644--- a/crates/openhuman-core/src/security/schemas.rs+++ b/crates/openhuman-core/src/security/schemas.rs@@ -2,7 +2,7 @@ use serde_json::{Map, Value};use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub fn all_controller_schemas() -> Vec<ControllerSchema> {vec![schemas("policy_info")]@@ -55,6 +55,6 @@ fn handle_policy_info(_params: Map<String, Value>) -> ControllerFuture {})}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/skills/catalog/schemas/handlers.rs b/crates/openhuman-core/src/skills/catalog/schemas/handlers.rsindex e027349f18..dc135ab654 100644--- a/crates/openhuman-core/src/skills/catalog/schemas/handlers.rs+++ b/crates/openhuman-core/src/skills/catalog/schemas/handlers.rs@@ -3,7 +3,7 @@use serde_json::{Map, Value};use crate::core::all::ControllerFuture;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::skills::catalog::ops;use super::controller_schemas::all_skill_registry_controller_schemas;@@ -18,7 +18,7 @@ fn deserialize_params<T: serde::de::DeserializeOwned>(serde_json::from_value(Value::Object(params)).map_err(|e| format!("invalid params: {e}"))}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}@@ -31,7 +31,7 @@ pub(super) fn handle_browse(params: Map<String, Value>) -> ControllerFuture {);let entries = ops::browse_catalog(p.force_refresh).await?;tracing::debug!(count = entries.len(), "[skill_registry][rpc] browse result");- to_json(RpcOutcome::new(BrowseResult { entries }, Vec::new()))+ to_json(Outcome::new(BrowseResult { entries }, Vec::new()))})}@@ -47,7 +47,7 @@ pub(super) fn handle_search(params: Map<String, Value>) -> ControllerFuture {let entries =ops::search_catalog(&p.query, p.source.as_deref(), p.category.as_deref()).await?;tracing::debug!(count = entries.len(), "[skill_registry][rpc] search result");- to_json(RpcOutcome::new(SearchResult { entries }, Vec::new()))+ to_json(Outcome::new(SearchResult { entries }, Vec::new()))})}@@ -55,7 +55,7 @@ pub(super) fn handle_sources(params: Map<String, Value>) -> ControllerFuture {Box::pin(async move {let _ = params;let sources = ops::list_sources().await?;- to_json(RpcOutcome::new(SourcesResult { sources }, Vec::new()))+ to_json(Outcome::new(SourcesResult { sources }, Vec::new()))})}@@ -63,7 +63,7 @@ pub(super) fn handle_categories(params: Map<String, Value>) -> ControllerFutureBox::pin(async move {let _ = params;let categories = ops::list_categories().await?;- to_json(RpcOutcome::new(CategoriesResult { categories }, Vec::new()))+ to_json(Outcome::new(CategoriesResult { categories }, Vec::new()))})}@@ -81,7 +81,7 @@ pub(super) fn handle_install(params: Map<String, Value>) -> ControllerFuture {let workspace = crate::skills::schemas::resolve_workspace_dir().await;let outcome = ops::install_from_catalog(&workspace, entry).await?;- to_json(RpcOutcome::new(+ to_json(Outcome::new(InstallResult {url: outcome.url,stdout: outcome.stdout,@@ -96,7 +96,7 @@ pub(super) fn handle_install(params: Map<String, Value>) -> ControllerFuture {pub(super) fn handle_schemas(params: Map<String, Value>) -> ControllerFuture {Box::pin(async move {let _ = params;- to_json(RpcOutcome::new(+ to_json(Outcome::new(SchemasResult {schemas: all_skill_registry_controller_schemas(),},@@ -115,7 +115,7 @@ pub(super) fn handle_uninstall(params: Map<String, Value>) -> ControllerFuture {let workflow_params =crate::skills::ops_install::UninstallWorkflowParams { name: payload.name };let outcome = crate::skills::ops_install::uninstall_workflow(workflow_params, None)?;- to_json(RpcOutcome::new(+ to_json(Outcome::new(UninstallResult {name: outcome.name,removed_path: outcome.removed_path,diff --git a/crates/openhuman-core/src/skills/runtime/schemas.rs b/crates/openhuman-core/src/skills/runtime/schemas.rsindex 433043d82a..b8908e010d 100644--- a/crates/openhuman-core/src/skills/runtime/schemas.rs+++ b/crates/openhuman-core/src/skills/runtime/schemas.rs@@ -10,7 +10,7 @@ use serde_json::{Map, Value};use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::skills::run_log;use crate::skills::schemas::resolve_workspace_dir;@@ -58,7 +58,7 @@ fn deserialize_params<T: serde::de::DeserializeOwned>(serde_json::from_value(Value::Object(params)).map_err(|e| format!("invalid params: {e}"))}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}@@ -268,7 +268,7 @@ fn handle_run(params: Map<String, Value>) -> ControllerFuture {let payload = deserialize_params::<RunParams>(params)?;tracing::info!(skill_id = %payload.skill_id, "[skill_runtime][rpc] run");let started = spawn_workflow_run_background(payload.skill_id, payload.inputs).await?;- to_json(RpcOutcome::new(+ to_json(Outcome::new(serde_json::json!({"run_id": started.run_id,"status": "started",@@ -285,7 +285,7 @@ fn handle_cancel(params: Map<String, Value>) -> ControllerFuture {let payload = deserialize_params::<CancelParams>(params)?;let cancelled = run_log::cancel_run(&payload.run_id);tracing::info!(run_id = %payload.run_id, cancelled, "[skill_runtime][rpc] cancel");- to_json(RpcOutcome::new(+ to_json(Outcome::new(serde_json::json!({ "run_id": payload.run_id, "cancelled": cancelled }),Vec::new(),))@@ -304,7 +304,7 @@ fn handle_recent_runs(params: Map<String, Value>) -> ControllerFuture {limit,"[skill_runtime][rpc] recent_runs");- to_json(RpcOutcome::new(+ to_json(Outcome::new(serde_json::json!({ "runs": runs }),Vec::new(),))@@ -325,7 +325,7 @@ fn handle_read_run_log(params: Map<String, Value>) -> ControllerFuture {let max_bytes = payload.max_bytes.unwrap_or(64 * 1024).min(256 * 1024) as usize;let slice = run_log::read_run_log_slice(&path, offset, max_bytes).map_err(|e| format!("skill_runtime_read_run_log: read failed: {e}"))?;- to_json(RpcOutcome::new(slice, Vec::new()))+ to_json(Outcome::new(slice, Vec::new()))})}@@ -337,14 +337,14 @@ fn handle_resolve_runtimes(params: Map<String, Value>) -> ControllerFuture {.await.map_err(|error| format!("skill_runtime_resolve_runtimes: load config: {error:#}"))?;let outcome = resolve_runtimes(&config, requirement).await;- to_json(RpcOutcome::new(outcome, Vec::new()))+ to_json(Outcome::new(outcome, Vec::new()))})}fn handle_schemas(params: Map<String, Value>) -> ControllerFuture {Box::pin(async move {let _ = params;- to_json(RpcOutcome::new(+ to_json(Outcome::new(serde_json::json!({ "schemas": all_skill_runtime_controller_schemas() }),Vec::new(),))diff --git a/crates/openhuman-core/src/skills/schemas/handlers.rs b/crates/openhuman-core/src/skills/schemas/handlers.rsindex c982354064..dacb37bb57 100644--- a/crates/openhuman-core/src/skills/schemas/handlers.rs+++ b/crates/openhuman-core/src/skills/schemas/handlers.rs@@ -10,7 +10,7 @@ use std::path::Path;use serde_json::{Map, Value};use crate::core::all::ControllerFuture;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::skills::ops::{create_workflow, discover_automations, discover_workflows, install_workflow_from_url,is_workspace_trusted, read_workflow_resource, uninstall_workflow, CreateWorkflowParams,@@ -56,7 +56,7 @@ pub(super) fn handle_skills_list(params: Map<String, Value>) -> ControllerFuture"[skills][rpc] list result");let summaries = listed.into_iter().map(WorkflowSummary::from).collect();- to_json(RpcOutcome::new(+ to_json(Outcome::new(WorkflowsListResult {workflows: summaries,},@@ -93,7 +93,7 @@ pub(super) fn handle_skills_describe(params: Map<String, Value>) -> ControllerFu.display_name.clone().unwrap_or_else(|| skill.definition.id.clone());- to_json(RpcOutcome::new(+ to_json(Outcome::new(WorkflowsDescribeResult {id: skill.definition.id.clone(),display_name,@@ -122,7 +122,7 @@ pub(super) fn handle_skills_read_run_log(params: Map<String, Value>) -> Controll// to page through larger logs.let max_bytes = payload.max_bytes.unwrap_or(64 * 1024).min(256 * 1024) as usize;match run_log::read_run_log_slice(&path, offset, max_bytes) {- Ok(slice) => to_json(RpcOutcome::new(slice, Vec::new())),+ Ok(slice) => to_json(Outcome::new(slice, Vec::new())),Err(e) => Err(format!("skills_read_run_log: read failed: {e}")),}})@@ -144,7 +144,7 @@ pub(super) fn handle_skills_recent_runs(params: Map<String, Value>) -> Controllelimit,"[skills][rpc] recent_runs");- to_json(RpcOutcome::new(+ to_json(Outcome::new(WorkflowsRecentRunsResult { runs },Vec::new(),))@@ -159,7 +159,7 @@ pub(super) fn handle_skills_run(params: Map<String, Value>) -> ControllerFutureOk(s) => s,Err(e) => return Err(e),};- to_json(RpcOutcome::new(+ to_json(Outcome::new(serde_json::json!({"run_id": started.run_id,"status": "started",@@ -180,7 +180,7 @@ pub(super) fn handle_skills_cancel(params: Map<String, Value>) -> ControllerFutulet payload = deserialize_params::<WorkflowsCancelParams>(params)?;let cancelled = run_log::cancel_run(&payload.run_id);tracing::info!(run_id = %payload.run_id, cancelled, "[skills][rpc] cancel");- to_json(RpcOutcome::new(+ to_json(Outcome::new(serde_json::json!({ "run_id": payload.run_id, "cancelled": cancelled }),Vec::new(),))@@ -200,7 +200,7 @@ pub(super) fn handle_skills_read_resource(params: Map<String, Value>) -> Controlmatch read_workflow_resource(workspace.as_path(), &payload.workflow_id, relative) {Ok(content) => {let bytes = content.len();- to_json(RpcOutcome::new(+ to_json(Outcome::new(WorkflowsReadResourceResult {workflow_id: payload.workflow_id,relative_path: payload.relative_path,@@ -237,7 +237,7 @@ pub(super) fn handle_skills_create(params: Map<String, Value>) -> ControllerFutulocation = ?skill.location,"[skills][rpc] create: ok");- to_json(RpcOutcome::new(+ to_json(Outcome::new(WorkflowsCreateResult {workflow: WorkflowSummary::from(skill),},@@ -267,7 +267,7 @@ pub(super) fn handle_skills_update(params: Map<String, Value>) -> ControllerFutulet mut create_params: CreateWorkflowParams = payload.into();create_params.overwrite = true;match create_workflow(workspace.as_path(), create_params) {- Ok(skill) => to_json(RpcOutcome::new(+ Ok(skill) => to_json(Outcome::new(WorkflowsCreateResult {workflow: WorkflowSummary::from(skill),},@@ -299,7 +299,7 @@ pub(super) fn handle_skills_install_from_url(params: Map<String, Value>) -> Contnew_count = outcome.new_skills.len(),"[skills][rpc] install_from_url: ok");- to_json(RpcOutcome::new(+ to_json(Outcome::new(WorkflowsInstallFromUrlResult {url: outcome.url,stdout: outcome.stdout,@@ -328,7 +328,7 @@ pub(super) fn handle_skills_uninstall(params: Map<String, Value>) -> ControllerFremoved_path = %outcome.removed_path,"[skills][rpc] uninstall: ok");- to_json(RpcOutcome::new(+ to_json(Outcome::new(WorkflowsUninstallResult {name: outcome.name,removed_path: outcome.removed_path,diff --git a/crates/openhuman-core/src/skills/schemas/helpers.rs b/crates/openhuman-core/src/skills/schemas/helpers.rsindex 1517bd9e1b..9727fd4f4e 100644--- a/crates/openhuman-core/src/skills/schemas/helpers.rs+++ b/crates/openhuman-core/src/skills/schemas/helpers.rs@@ -9,7 +9,7 @@ use serde::de::DeserializeOwned;use serde_json::{Map, Value};use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;// ── Config / workspace resolution ────────────────────────────────────────────@@ -76,6 +76,6 @@ pub(super) fn deserialize_params<T: DeserializeOwned>(serde_json::from_value(Value::Object(params)).map_err(|e| format!("invalid params: {e}"))}-pub(super) fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+pub(super) fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/skills/webhooks/README.md b/crates/openhuman-core/src/skills/webhooks/README.mdindex c8d449c7e3..7110d474f2 100644--- a/crates/openhuman-core/src/skills/webhooks/README.md+++ b/crates/openhuman-core/src/skills/webhooks/README.md@@ -20,7 +20,7 @@ Client-side webhook **tunnel routing** for OpenHuman. The backend provisions and| `crates/openhuman-core/src/skills/webhooks/mod.rs` | Export-only: module docstring, `pub mod` decls, re-exports of `WebhookRouter`, types, and the `all_webhooks_*` controller pair. || `crates/openhuman-core/src/skills/webhooks/types.rs` | Serde domain types: `WebhookRequest`, `WebhookResponseData`, `TunnelRegistration`, `WebhookActivityEntry`, `WebhookDebugLogEntry`, debug result wrappers, `WebhookDebugEvent`. || `crates/openhuman-core/src/skills/webhooks/router.rs` | `WebhookRouter` — route map + ownership rules, disk persistence (generation-counter, spawn_blocking offload), bounded debug log ring (`MAX_DEBUG_LOG_ENTRIES = 250`), debug-event broadcast channel. |-| `crates/openhuman-core/src/skills/webhooks/ops.rs` | RPC handler logic returning `RpcOutcome<T>`: local routing ops (`list_registrations`, `list_logs`, `clear_logs`, `register_echo`, `unregister_echo`, `register_agent`, `trigger_agent`), `build_echo_response`, and backend-proxied tunnel CRUD (`list/create/get/update/delete_tunnel`, `get_bandwidth`). |+| `crates/openhuman-core/src/skills/webhooks/ops.rs` | RPC handler logic returning `Outcome<T>`: local routing ops (`list_registrations`, `list_logs`, `clear_logs`, `register_echo`, `unregister_echo`, `register_agent`, `trigger_agent`), `build_echo_response`, and backend-proxied tunnel CRUD (`list/create/get/update/delete_tunnel`, `get_bandwidth`). || `crates/openhuman-core/src/skills/webhooks/schemas.rs` | Controller schemas + `handle_*` fns + `all_controller_schemas` / `all_registered_controllers`; deserializes params, delegates to `ops.rs`. || `crates/openhuman-core/src/skills/webhooks/bus.rs` | `WebhookRequestSubscriber` (`EventHandler`) — the incoming-request routing flow; helpers `decode_webhook_body`, `run_agent_trigger`, `build_agent_response`. || `crates/openhuman-core/src/skills/webhooks/{webhooks_tests,bus_tests,ops_tests,router_tests,schemas_tests,types_tests}.rs` | Test suites, each pulled into its sibling source file via `#[cfg(test)] #[path = "..."] mod tests;` (no inline test modules). |@@ -88,7 +88,7 @@ Note that nothing in the production startup path currently constructs a `Webhook- `crate::agent::triage` — `TriggerEnvelope`, `run_triage`, `apply_decision`, `TriageOutcome` for agent-tunnel routing and `trigger_agent`.- `crate::config::{Config, rpc::load_config_with_timeout}` — config for backend-proxy RPCs.- `crate::api::{BackendOAuthClient, config::effective_backend_api_url, jwt::get_session_token}` — authenticated backend tunnel CRUD/bandwidth calls.-- `crate::rpc::RpcOutcome` — handler return contract.+- `crate::rpc::Outcome` — handler return contract.## Used bydiff --git a/crates/openhuman-core/src/skills/webhooks/ops.rs b/crates/openhuman-core/src/skills/webhooks/ops.rsindex d862b8d1d3..6e8086ca94 100644--- a/crates/openhuman-core/src/skills/webhooks/ops.rs+++ b/crates/openhuman-core/src/skills/webhooks/ops.rs@@ -2,7 +2,7 @@ use crate::api::config::effective_backend_api_url;use crate::api::jwt::get_session_token;use crate::api::BackendOAuthClient;use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::skills::webhooks::{WebhookDebugLogListResult, WebhookDebugLogsClearedResult, WebhookDebugRegistrationsResult,WebhookRequest, WebhookResponseData,@@ -49,19 +49,19 @@ fn get_router() -> Result<std::sync::Arc<crate::skills::webhooks::WebhookRouter>.ok_or_else(|| "webhook router not initialized".to_string())}-pub async fn list_registrations() -> Result<RpcOutcome<WebhookDebugRegistrationsResult>, String> {+pub async fn list_registrations() -> Result<Outcome<WebhookDebugRegistrationsResult>, String> {match get_router() {Ok(router) => {let registrations = router.list_all();let count = registrations.len();- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(WebhookDebugRegistrationsResult { registrations },format!("webhooks.list_registrations returned {count} registration(s)"),))}Err(_) => {// Router not yet initialized — return empty list (not an error in RPC).- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(WebhookDebugRegistrationsResult {registrations: Vec::new(),},@@ -74,33 +74,33 @@ pub async fn list_registrations() -> Result<RpcOutcome<WebhookDebugRegistrationspub async fn list_logs(limit: Option<usize>,-) -> Result<RpcOutcome<WebhookDebugLogListResult>, String> {+) -> Result<Outcome<WebhookDebugLogListResult>, String> {match get_router() {Ok(router) => {let logs = router.list_logs(limit);let count = logs.len();- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(WebhookDebugLogListResult { logs },format!("webhooks.list_logs returned {count} log entrie(s)"),))}- Err(_) => Ok(RpcOutcome::single_log(+ Err(_) => Ok(Outcome::single_log(WebhookDebugLogListResult { logs: Vec::new() },"webhooks.list_logs returned 0 log entrie(s) (router not initialized)".to_string(),)),}}-pub async fn clear_logs() -> Result<RpcOutcome<WebhookDebugLogsClearedResult>, String> {+pub async fn clear_logs() -> Result<Outcome<WebhookDebugLogsClearedResult>, String> {match get_router() {Ok(router) => {let cleared = router.clear_logs();- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(WebhookDebugLogsClearedResult { cleared },format!("webhooks.clear_logs removed {cleared} log entrie(s)"),))}- Err(_) => Ok(RpcOutcome::single_log(+ Err(_) => Ok(Outcome::single_log(WebhookDebugLogsClearedResult { cleared: 0 },"webhooks.clear_logs removed 0 log entrie(s) (router not initialized)".to_string(),)),@@ -111,11 +111,11 @@ pub async fn register_echo(tunnel_uuid: &str,tunnel_name: Option<String>,backend_tunnel_id: Option<String>,-) -> Result<RpcOutcome<WebhookDebugRegistrationsResult>, String> {+) -> Result<Outcome<WebhookDebugRegistrationsResult>, String> {let router = get_router().map_err(|e| format!("webhooks.register_echo failed: {e}"))?;router.register_echo(tunnel_uuid, tunnel_name, backend_tunnel_id)?;let registrations = router.list_all();- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(WebhookDebugRegistrationsResult { registrations },format!("webhooks.register_echo registered tunnel {tunnel_uuid}"),))@@ -123,7 +123,7 @@ pub async fn register_echo(pub async fn unregister_echo(tunnel_uuid: &str,-) -> Result<RpcOutcome<WebhookDebugRegistrationsResult>, String> {+) -> Result<Outcome<WebhookDebugRegistrationsResult>, String> {let router = get_router().map_err(|e| format!("webhooks.unregister_echo failed: {e}"))?;let removed = router.unregister(tunnel_uuid, "echo")?;let registrations = router.list_all();@@ -137,7 +137,7 @@ pub async fn unregister_echo("webhooks.unregister_echo: no registration for tunnel {tunnel_uuid}, nothing removed")};- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(WebhookDebugRegistrationsResult { registrations },log,))@@ -152,11 +152,11 @@ pub async fn register_agent(agent_id: Option<String>,tunnel_name: Option<String>,backend_tunnel_id: Option<String>,-) -> Result<RpcOutcome<WebhookDebugRegistrationsResult>, String> {+) -> Result<Outcome<WebhookDebugRegistrationsResult>, String> {let router = get_router().map_err(|e| format!("webhooks.register_agent failed: {e}"))?;router.register_agent(tunnel_uuid, agent_id, tunnel_name, backend_tunnel_id)?;let registrations = router.list_all();- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(WebhookDebugRegistrationsResult { registrations },format!("webhooks.register_agent registered agent tunnel {tunnel_uuid}"),))@@ -169,7 +169,7 @@ pub async fn trigger_agent(caller_id: &str,reason: &str,payload: serde_json::Value,-) -> Result<RpcOutcome<serde_json::Value>, String> {+) -> Result<Outcome<serde_json::Value>, String> {use crate::agent::triage::TriggerEnvelope;let envelope = match source {@@ -213,7 +213,7 @@ pub async fn trigger_agent(.map_err(|_| "apply_decision timed out after 60s".to_string())?.map_err(|e| format!("apply_decision failed: {e}"))?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(serde_json::json!({"decision": run.decision.action.as_str(),"target_agent": run.decision.target_agent,@@ -227,7 +227,7 @@ pub async fn trigger_agent(crate::agent::triage::TriageOutcome::Deferred {defer_until_ms,reason,- } => Ok(RpcOutcome::single_log(+ } => Ok(Outcome::single_log(serde_json::json!({"decision": "deferred","resolution_path": "deferred",@@ -267,16 +267,16 @@ pub fn build_echo_response(request: &WebhookRequest) -> WebhookResponseData {}}-pub async fn list_tunnels(config: &Config) -> Result<RpcOutcome<Value>, String> {+pub async fn list_tunnels(config: &Config) -> Result<Outcome<Value>, String> {let data = get_authed_value(config, Method::GET, "/webhooks/core", None).await?;- Ok(RpcOutcome::single_log(data, "webhook tunnels fetched"))+ Ok(Outcome::single_log(data, "webhook tunnels fetched"))}pub async fn create_tunnel(config: &Config,name: &str,description: Option<String>,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let name = name.trim();if name.is_empty() {return Err("name is required".to_string());@@ -294,10 +294,10 @@ pub async fn create_tunnel(}let body = serde_json::Value::Object(body_map);let data = get_authed_value(config, Method::POST, "/webhooks/core", Some(body)).await?;- Ok(RpcOutcome::single_log(data, "webhook tunnel created"))+ Ok(Outcome::single_log(data, "webhook tunnel created"))}-pub async fn get_tunnel(config: &Config, id: &str) -> Result<RpcOutcome<Value>, String> {+pub async fn get_tunnel(config: &Config, id: &str) -> Result<Outcome<Value>, String> {let id = id.trim();if id.is_empty() {return Err("id is required".to_string());@@ -310,14 +310,14 @@ pub async fn get_tunnel(config: &Config, id: &str) -> Result<RpcOutcome<Value>,None,).await?;- Ok(RpcOutcome::single_log(data, "webhook tunnel fetched"))+ Ok(Outcome::single_log(data, "webhook tunnel fetched"))}pub async fn update_tunnel(config: &Config,id: &str,payload: Value,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let id = id.trim();if id.is_empty() {return Err("id is required".to_string());@@ -330,10 +330,10 @@ pub async fn update_tunnel(Some(payload),).await?;- Ok(RpcOutcome::single_log(data, "webhook tunnel updated"))+ Ok(Outcome::single_log(data, "webhook tunnel updated"))}-pub async fn delete_tunnel(config: &Config, id: &str) -> Result<RpcOutcome<Value>, String> {+pub async fn delete_tunnel(config: &Config, id: &str) -> Result<Outcome<Value>, String> {let id = id.trim();if id.is_empty() {return Err("id is required".to_string());@@ -346,12 +346,12 @@ pub async fn delete_tunnel(config: &Config, id: &str) -> Result<RpcOutcome<ValueNone,).await?;- Ok(RpcOutcome::single_log(data, "webhook tunnel deleted"))+ Ok(Outcome::single_log(data, "webhook tunnel deleted"))}-pub async fn get_bandwidth(config: &Config) -> Result<RpcOutcome<Value>, String> {+pub async fn get_bandwidth(config: &Config) -> Result<Outcome<Value>, String> {let data = get_authed_value(config, Method::GET, "/webhooks/core/bandwidth", None).await?;- Ok(RpcOutcome::single_log(data, "webhook bandwidth fetched"))+ Ok(Outcome::single_log(data, "webhook bandwidth fetched"))}#[cfg(test)]diff --git a/crates/openhuman-core/src/skills/webhooks/schemas.rs b/crates/openhuman-core/src/skills/webhooks/schemas.rsindex ab9db3aa87..a6cbaa38ab 100644--- a/crates/openhuman-core/src/skills/webhooks/schemas.rs+++ b/crates/openhuman-core/src/skills/webhooks/schemas.rs@@ -4,7 +4,7 @@ use serde_json::{Map, Value};use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;#[derive(Debug, Deserialize)]struct WebhookListLogsParams {@@ -516,7 +516,7 @@ fn deserialize_params<T: DeserializeOwned>(params: Map<String, Value>) -> Resultserde_json::from_value(Value::Object(params)).map_err(|e| format!("invalid params: {e}"))}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/skills/webhooks/schemas_tests.rs b/crates/openhuman-core/src/skills/webhooks/schemas_tests.rsindex 01e0a170ee..e3d1dbda47 100644--- a/crates/openhuman-core/src/skills/webhooks/schemas_tests.rs+++ b/crates/openhuman-core/src/skills/webhooks/schemas_tests.rs@@ -270,10 +270,10 @@ fn json_output_builds_required_json_field() {#[test]fn to_json_renders_rpc_outcome_in_cli_compatible_shape() {- // `to_json` is a thin wrapper over `RpcOutcome::into_cli_compatible_json`.+ // `to_json` is a thin wrapper over `Outcome::into_cli_compatible_json`.// We exercise it here so coverage follows the real shape the// adapters produce, rather than asserting on implementation details.- let outcome: RpcOutcome<serde_json::Value> = RpcOutcome::new(json!({"ok": true}), vec![]);+ let outcome: Outcome<serde_json::Value> = Outcome::new(json!({"ok": true}), vec![]);let value = to_json(outcome).unwrap();assert!(value.is_object());}diff --git a/crates/openhuman-core/src/test_support/README.md b/crates/openhuman-core/src/test_support/README.mdindex 53174d97cd..502f429fa9 100644--- a/crates/openhuman-core/src/test_support/README.md+++ b/crates/openhuman-core/src/test_support/README.md@@ -19,7 +19,7 @@ Test-support domain: wipe-and-reset plus read-only introspection RPCs that let E| `crates/openhuman-core/src/test_support/rpc_tests.rs` | Tests for the `OPENHUMAN_E2E_MODE` guard (`reset` rejects when unset; `1`/`true`/`yes` accepted) and for `wipe_memory_tree` removing content dirs. || `crates/openhuman-core/src/test_support/introspect.rs` | Read-only introspection RPCs: `workspace_root`, `list_workspace_files`, `read_workspace_file`, `in_flight_chats`, `wallet_prepared_quotes`, plus the `resolve_workspace_relative` path guard and the iterative `walk_dir`. || `crates/openhuman-core/src/test_support/introspect_tests.rs` | Tests for `resolve_workspace_relative` only: `..` traversal (missing and existing targets), leading `/` and `./` handling, and (unix) a symlink pointing out of the workspace. The RPC functions themselves have no unit tests here; E2E specs exercise them. |-| `crates/openhuman-core/src/test_support/schemas.rs` | `ControllerSchema` definitions, the registered-controller list, and `handle_*` dispatchers that delegate to `rpc`/`introspect` and serialize via `RpcOutcome::into_cli_compatible_json`. |+| `crates/openhuman-core/src/test_support/schemas.rs` | `ControllerSchema` definitions, the registered-controller list, and `handle_*` dispatchers that delegate to `rpc`/`introspect` and serialize via `Outcome::into_cli_compatible_json`. |## Public surface@@ -28,7 +28,7 @@ From `mod.rs`:- `all_test_support_registered_controllers()` — `Vec<RegisteredController>` (schema + handler pairs).From `rpc` / `introspect` (used by handlers, also `pub`):-- `rpc::reset() -> RpcOutcome<ResetSummary>`, `rpc::reset_json()` (raw JSON envelope convenience; currently `#[allow(dead_code)]`, no caller).+- `rpc::reset() -> Outcome<ResetSummary>`, `rpc::reset_json()` (raw JSON envelope convenience; currently `#[allow(dead_code)]`, no caller).- `introspect::workspace_root()`, `list_workspace_files(rel_root, max_depth)`, `read_workspace_file(rel_path, max_bytes)`, `in_flight_chats()`, `wallet_prepared_quotes()`.- Result types: `ResetSummary`, `WorkspaceRoot`, `ListEntry`/`ListResult`, `ReadFileResult`, `InFlightEntryView`/`InFlightResult`, `PreparedQuotesResult`.@@ -62,7 +62,7 @@ This module owns no state of its own — it mutates/reads state owned by other d- `crate::web3::wallet` — `prepared_quotes_for_test` and `PreparedTransaction` to snapshot prepared quotes.- `crate::core::all` — `ControllerFuture`, `RegisteredController` for handler wiring.- `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` — controller schema types.-- `crate::rpc::RpcOutcome` — standard RPC result envelope; `crate::rpc` is the `openhuman-rpc` crate re-exported by `pub use openhuman_rpc as rpc;` in `crates/openhuman-core/src/lib.rs`.+- `crate::rpc::Outcome` — standard RPC result envelope; `crate::rpc` is the `openhuman-rpc` crate re-exported by `pub use openhuman_rpc as rpc;` in `crates/openhuman-core/src/lib.rs`.## Used bydiff --git a/crates/openhuman-core/src/test_support/introspect.rs b/crates/openhuman-core/src/test_support/introspect.rsindex 002bcf21f0..e9fb057c20 100644--- a/crates/openhuman-core/src/test_support/introspect.rs+++ b/crates/openhuman-core/src/test_support/introspect.rs@@ -15,7 +15,7 @@ use serde::Serialize;use tokio::fs;use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::web3::wallet::prepared_quotes_for_test;use crate::web_chat::in_flight_entries_for_test;@@ -112,10 +112,10 @@ pub struct WorkspaceRoot {pub exists: bool,}-pub async fn workspace_root() -> Result<RpcOutcome<WorkspaceRoot>, String> {+pub async fn workspace_root() -> Result<Outcome<WorkspaceRoot>, String> {let dir = current_workspace_dir().await?;let exists = fs::try_exists(&dir).await.unwrap_or(false);- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(WorkspaceRoot {path: dir.display().to_string(),exists,@@ -199,7 +199,7 @@ async fn walk_dir(pub async fn list_workspace_files(rel_root: Option<String>,max_depth: Option<u32>,-) -> Result<RpcOutcome<ListResult>, String> {+) -> Result<Outcome<ListResult>, String> {let workspace = current_workspace_dir().await?;let root = match rel_root.as_deref().filter(|s| !s.is_empty()) {Some(r) => resolve_workspace_relative(&workspace, r)?,@@ -209,7 +209,7 @@ pub async fn list_workspace_files(let mut entries = Vec::new();let truncated = walk_dir(&root, &root, depth, &mut entries, 2_000).await?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(ListResult {root: root.display().to_string(),entries: entries.to_vec(),@@ -248,7 +248,7 @@ pub struct ReadFileResult {pub async fn read_workspace_file(rel_path: String,max_bytes: Option<u64>,-) -> Result<RpcOutcome<ReadFileResult>, String> {+) -> Result<Outcome<ReadFileResult>, String> {let workspace = current_workspace_dir().await?;let abs = resolve_workspace_relative(&workspace, &rel_path)?;let meta = fs::metadata(&abs)@@ -276,7 +276,7 @@ pub async fn read_workspace_file(// assert against this value to verify byte-accurate truncation.let returned_bytes = returned.len() as u64;let content_utf8 = String::from_utf8_lossy(&returned).into_owned();- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(ReadFileResult {rel_path: rel_path.clone(),size_on_disk,@@ -303,14 +303,14 @@ pub struct InFlightResult {pub entries: Vec<InFlightEntryView>,}-pub async fn in_flight_chats() -> Result<RpcOutcome<InFlightResult>, String> {+pub async fn in_flight_chats() -> Result<Outcome<InFlightResult>, String> {let entries: Vec<InFlightEntryView> = in_flight_entries_for_test().await.into_iter().map(|(key, request_id)| InFlightEntryView { key, request_id }).collect();let count = entries.len();- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(InFlightResult { entries },format!("in_flight_chats: {count} entries"),))@@ -325,10 +325,10 @@ pub struct PreparedQuotesResult {pub quotes: Vec<crate::web3::wallet::PreparedTransaction>,}-pub async fn wallet_prepared_quotes() -> Result<RpcOutcome<PreparedQuotesResult>, String> {+pub async fn wallet_prepared_quotes() -> Result<Outcome<PreparedQuotesResult>, String> {let quotes = prepared_quotes_for_test();let count = quotes.len();- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(PreparedQuotesResult { count, quotes },format!("wallet_prepared_quotes: {count} quotes"),))diff --git a/crates/openhuman-core/src/test_support/rpc.rs b/crates/openhuman-core/src/test_support/rpc.rsindex ac52198d61..bd7c8af31f 100644--- a/crates/openhuman-core/src/test_support/rpc.rs+++ b/crates/openhuman-core/src/test_support/rpc.rs@@ -16,7 +16,7 @@ use crate::config::Config;use crate::config::{clear_active_user, default_root_openhuman_dir};use crate::cron;use crate::memory::read_rpc;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;const E2E_MODE_ENV_VAR: &str = "OPENHUMAN_E2E_MODE";@@ -57,7 +57,7 @@ fn ensure_e2e_mode_value(raw: Option<&str>) -> Result<(), String> {/// Errors at any individual wipe step short-circuit and surface back to the/// caller — partial resets are worse than a clear failure, because they let/// downstream tests pass on contaminated state.-pub async fn reset() -> Result<RpcOutcome<ResetSummary>, String> {+pub async fn reset() -> Result<Outcome<ResetSummary>, String> {log::debug!("[test_reset] entry");ensure_e2e_mode_enabled().map_err(|e| {log::debug!("[test_reset] rejected: {e}");@@ -131,7 +131,7 @@ pub async fn reset() -> Result<RpcOutcome<ResetSummary>, String> {serde_json::to_string(&summary).unwrap_or_default());- Ok(RpcOutcome::new(+ Ok(Outcome::new(summary,vec![format!("removed {cron_jobs_removed} cron jobs"),diff --git a/crates/openhuman-core/src/test_support/schemas.rs b/crates/openhuman-core/src/test_support/schemas.rsindex 27bce14b4c..1045751e8e 100644--- a/crates/openhuman-core/src/test_support/schemas.rs+++ b/crates/openhuman-core/src/test_support/schemas.rs@@ -2,7 +2,7 @@ use serde_json::{Map, Value};use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::test_support::{introspect, rpc};pub fn all_controller_schemas() -> Vec<ControllerSchema> {@@ -329,6 +329,6 @@ fn handle_wallet_prepared_quotes(_params: Map<String, Value>) -> ControllerFuturBox::pin(async move { to_json(introspect::wallet_prepared_quotes().await?) })}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/threads/error.rs b/crates/openhuman-core/src/threads/error.rsindex 5d6de52f34..59620db7c5 100644--- a/crates/openhuman-core/src/threads/error.rs+++ b/crates/openhuman-core/src/threads/error.rs@@ -2,7 +2,7 @@use serde_json::json;-use crate::rpc::StructuredRpcError;+use crate::core::StructuredRpcError;/// Stable JSON-RPC discriminator used by the frontend to handle stale thread/// references without string matching or user-facing error toasts.diff --git a/crates/openhuman-core/src/threads/error_tests.rs b/crates/openhuman-core/src/threads/error_tests.rsindex 15aa77d1f1..3b8fae83bb 100644--- a/crates/openhuman-core/src/threads/error_tests.rs+++ b/crates/openhuman-core/src/threads/error_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::rpc::StructuredRpcError;+use crate::core::StructuredRpcError;#[test]fn not_found_display_is_stable() {diff --git a/crates/openhuman-core/src/threads/ops/crud.rs b/crates/openhuman-core/src/threads/ops/crud.rsindex de4a82f0f9..5845825e03 100644--- a/crates/openhuman-core/src/threads/ops/crud.rs+++ b/crates/openhuman-core/src/threads/ops/crud.rs@@ -15,7 +15,7 @@ use crate::memory::{UpdateConversationMessageRequest, UpdateConversationThreadLabelsRequest,UpdateConversationThreadTitleRequest, UpsertConversationThreadRequest,};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::threads::turn_state;use crate::threads::ThreadsError;use crate::web_chat as web_channel;@@ -24,7 +24,7 @@ use std::path::PathBuf;/// Lists all conversation threads.pub async fn threads_list(_request: EmptyRequest,-) -> Result<RpcOutcome<ApiEnvelope<ConversationThreadsListResponse>>, String> {+) -> Result<Outcome<ApiEnvelope<ConversationThreadsListResponse>>, String> {let dir = workspace_dir().await?;let threads = conversations::blocking::list_threads(dir).await?@@ -42,7 +42,7 @@ pub async fn threads_list(/// Creates or refreshes a conversation thread.pub async fn thread_upsert(request: UpsertConversationThreadRequest,-) -> Result<RpcOutcome<ApiEnvelope<ConversationThreadSummary>>, String> {+) -> Result<Outcome<ApiEnvelope<ConversationThreadSummary>>, String> {let dir = workspace_dir().await?;let thread = conversations::blocking::ensure_thread(dir,@@ -66,7 +66,7 @@ pub async fn thread_upsert(/// Creates a new conversation thread with auto-generated ID and title.pub async fn thread_create_new(request: CreateConversationThreadRequest,-) -> Result<RpcOutcome<ApiEnvelope<ConversationThreadSummary>>, String> {+) -> Result<Outcome<ApiEnvelope<ConversationThreadSummary>>, String> {let dir = workspace_dir().await?;let id = format!("thread-{}", uuid::Uuid::new_v4());let now = chrono::Local::now();@@ -102,7 +102,7 @@ pub async fn thread_create_new(/// Lists messages for a conversation thread.pub async fn messages_list(request: ConversationMessagesRequest,-) -> Result<RpcOutcome<ApiEnvelope<ConversationMessagesResponse>>, String> {+) -> Result<Outcome<ApiEnvelope<ConversationMessagesResponse>>, String> {let dir = workspace_dir().await?;let messages = conversations::blocking::get_messages(dir, request.thread_id.clone()).await?@@ -150,7 +150,7 @@ pub async fn transcript_search(/// Appends a message to a conversation thread.pub async fn message_append(request: AppendConversationMessageRequest,-) -> Result<RpcOutcome<ApiEnvelope<ConversationMessageRecord>>, ThreadsError> {+) -> Result<Outcome<ApiEnvelope<ConversationMessageRecord>>, ThreadsError> {let dir = workspace_dir().await?;let message = conversations::blocking::append_message(dir,@@ -173,7 +173,7 @@ pub async fn message_append(/// ensure this is intentional.pub async fn thread_update_labels(request: UpdateConversationThreadLabelsRequest,-) -> Result<RpcOutcome<ApiEnvelope<ConversationThreadSummary>>, String> {+) -> Result<Outcome<ApiEnvelope<ConversationThreadSummary>>, String> {let dir = workspace_dir().await?;let thread = conversations::blocking::update_thread_labels(dir,@@ -197,7 +197,7 @@ pub async fn thread_update_labels(/// Sets a user-specified title on a conversation thread, bypassing AI generation.pub async fn thread_update_title(request: UpdateConversationThreadTitleRequest,-) -> Result<RpcOutcome<ApiEnvelope<ConversationThreadSummary>>, String> {+) -> Result<Outcome<ApiEnvelope<ConversationThreadSummary>>, String> {let dir = workspace_dir().await?;let title = request.title.trim().to_string();if title.is_empty() {@@ -226,7 +226,7 @@ pub async fn thread_update_title(/// Updates metadata on an existing conversation message.pub async fn message_update(request: UpdateConversationMessageRequest,-) -> Result<RpcOutcome<ApiEnvelope<ConversationMessageRecord>>, String> {+) -> Result<Outcome<ApiEnvelope<ConversationMessageRecord>>, String> {let dir = workspace_dir().await?;let message = conversations::blocking::update_message(dir,@@ -275,7 +275,7 @@ pub async fn delete_after(/// snapshot still live.pub async fn thread_delete(request: DeleteConversationThreadRequest,-) -> Result<RpcOutcome<ApiEnvelope<DeleteConversationThreadResponse>>, String> {+) -> Result<Outcome<ApiEnvelope<DeleteConversationThreadResponse>>, String> {let dir = workspace_dir().await?;run_to_completion("thread_delete", thread_delete_inner(dir, request)).await}@@ -283,7 +283,7 @@ pub async fn thread_delete(async fn thread_delete_inner(dir: PathBuf,request: DeleteConversationThreadRequest,-) -> Result<RpcOutcome<ApiEnvelope<DeleteConversationThreadResponse>>, String> {+) -> Result<Outcome<ApiEnvelope<DeleteConversationThreadResponse>>, String> {let deleted = conversations::blocking::delete_thread(dir.clone(),request.thread_id.clone(),diff --git a/crates/openhuman-core/src/threads/ops/edit.rs b/crates/openhuman-core/src/threads/ops/edit.rsindex 325f5c1f60..db133d21a2 100644--- a/crates/openhuman-core/src/threads/ops/edit.rs+++ b/crates/openhuman-core/src/threads/ops/edit.rs@@ -47,7 +47,7 @@ use tinyagents_session::transcript::{};use crate::memory::conversations::{self, reply_run_id, run_reply_message_id};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::threads::ThreadsError;use super::support::workspace_dir;@@ -80,7 +80,7 @@ pub struct EditOrRegenerateResponse {/// Edit a past user message: cancel the in-flight turn (if any), fork the/// session transcript and message log to drop that message and everything/// after it, then restart the turn with `content` in its place.-pub async fn edit_message(request: EditMessageRequest) -> Result<RpcOutcome<Value>, ThreadsError> {+pub async fn edit_message(request: EditMessageRequest) -> Result<Outcome<Value>, ThreadsError> {let client_id = request.client_id.unwrap_or_else(|| "system".to_string());let thread_id = request.thread_id;let dir = workspace_dir().await.map_err(ThreadsError::Message)?;@@ -132,7 +132,7 @@ pub async fn edit_message(request: EditMessageRequest) -> Result<RpcOutcome<Valu.await.map_err(|e| ThreadsError::Message(e.to_string()))?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!(EditOrRegenerateResponse {request_id: new_request_id,}),@@ -144,7 +144,7 @@ pub async fn edit_message(request: EditMessageRequest) -> Result<RpcOutcome<Valu/// last turn): cancel the in-flight turn (if any), fork the session/// transcript and message log to drop the answer and everything after it,/// then restart the turn with the same user prompt that produced it.-pub async fn regenerate(request: RegenerateRequest) -> Result<RpcOutcome<Value>, ThreadsError> {+pub async fn regenerate(request: RegenerateRequest) -> Result<Outcome<Value>, ThreadsError> {let client_id = request.client_id.unwrap_or_else(|| "system".to_string());let thread_id = request.thread_id;let dir = workspace_dir().await.map_err(ThreadsError::Message)?;@@ -199,7 +199,7 @@ pub async fn regenerate(request: RegenerateRequest) -> Result<RpcOutcome<Value>,.await.map_err(|e| ThreadsError::Message(e.to_string()))?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!(EditOrRegenerateResponse {request_id: new_request_id,}),diff --git a/crates/openhuman-core/src/threads/ops/live_state.rs b/crates/openhuman-core/src/threads/ops/live_state.rsindex 086c98accd..6c61e6a783 100644--- a/crates/openhuman-core/src/threads/ops/live_state.rs+++ b/crates/openhuman-core/src/threads/ops/live_state.rs@@ -10,7 +10,7 @@ use super::support::{envelope, workspace_dir};use crate::agent::goals::goal_to_value;use crate::agent::todos::ops::{self as todos_ops, TodoScope};use crate::memory::ApiEnvelope;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// Request for [`goal_get`] / [`todos_get`]: the thread to read.#[derive(Debug, Clone, serde::Deserialize)]@@ -39,7 +39,7 @@ pub struct ThreadTodosGetResponse {/// user reopens a thread that already had a goal in flight).pub async fn goal_get(request: ThreadLiveStateRequest,-) -> Result<RpcOutcome<ApiEnvelope<ThreadGoalGetResponse>>, String> {+) -> Result<Outcome<ApiEnvelope<ThreadGoalGetResponse>>, String> {let dir = workspace_dir().await?;let thread_id = request.thread_id.trim();if thread_id.is_empty() {@@ -56,7 +56,7 @@ pub async fn goal_get(/// waiting for the next `thread_todos_changed` push.pub async fn todos_get(request: ThreadLiveStateRequest,-) -> Result<RpcOutcome<ApiEnvelope<ThreadTodosGetResponse>>, String> {+) -> Result<Outcome<ApiEnvelope<ThreadTodosGetResponse>>, String> {let dir = workspace_dir().await?;let thread_id = request.thread_id.trim();if thread_id.is_empty() {diff --git a/crates/openhuman-core/src/threads/ops/purge.rs b/crates/openhuman-core/src/threads/ops/purge.rsindex 650857bb82..ef33320153 100644--- a/crates/openhuman-core/src/threads/ops/purge.rs+++ b/crates/openhuman-core/src/threads/ops/purge.rs@@ -3,7 +3,7 @@use super::support::{envelope, run_to_completion, workspace_dir};use crate::memory::conversations;use crate::memory::{ApiEnvelope, EmptyRequest, PurgeConversationThreadsResponse};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::threads::turn_state;use std::path::PathBuf;@@ -14,14 +14,14 @@ use std::path::PathBuf;/// caller cannot leave every thread wiped while their sub-agents keep running.pub async fn threads_purge(_request: EmptyRequest,-) -> Result<RpcOutcome<ApiEnvelope<PurgeConversationThreadsResponse>>, String> {+) -> Result<Outcome<ApiEnvelope<PurgeConversationThreadsResponse>>, String> {let dir = workspace_dir().await?;run_to_completion("threads_purge", threads_purge_inner(dir)).await}async fn threads_purge_inner(dir: PathBuf,-) -> Result<RpcOutcome<ApiEnvelope<PurgeConversationThreadsResponse>>, String> {+) -> Result<Outcome<ApiEnvelope<PurgeConversationThreadsResponse>>, String> {let stats = conversations::blocking::purge_threads(dir.clone()).await?;// No parent thread survives a purge, so cancel every detached sub-agent and// wipe every queued result. Same ordering as `thread_delete`: abort thediff --git a/crates/openhuman-core/src/threads/ops/support.rs b/crates/openhuman-core/src/threads/ops/support.rsindex 4e6f307d5b..522c2119cc 100644--- a/crates/openhuman-core/src/threads/ops/support.rs+++ b/crates/openhuman-core/src/threads/ops/support.rs@@ -9,7 +9,7 @@ use crate::memory::conversations::{ConversationMessage, ConversationThread};use crate::memory::{ApiEnvelope, ApiMeta, ConversationMessageRecord, ConversationThreadSummary, PaginationMeta,};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::threads::title::{title_from_user_message, title_log_fingerprint, THREAD_TITLE_LOG_PREFIX,};@@ -34,8 +34,8 @@ pub(super) fn envelope<T: Serialize>(data: T,counts: Option<BTreeMap<String, usize>>,pagination: Option<PaginationMeta>,-) -> RpcOutcome<ApiEnvelope<T>> {- RpcOutcome::new(+) -> Outcome<ApiEnvelope<T>> {+ Outcome::new(ApiEnvelope {data: Some(data),error: None,diff --git a/crates/openhuman-core/src/threads/ops/title_generation.rs b/crates/openhuman-core/src/threads/ops/title_generation.rsindex 4a02a5ff48..7e28199950 100644--- a/crates/openhuman-core/src/threads/ops/title_generation.rs+++ b/crates/openhuman-core/src/threads/ops/title_generation.rs@@ -8,7 +8,7 @@ use crate::memory::conversations;use crate::memory::{ApiEnvelope, ConversationThreadSummary, GenerateConversationThreadTitleRequest,};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::threads::title::{build_title_request, is_auto_generated_thread_title, sanitize_generated_title,title_log_fingerprint, THREAD_TITLE_LOG_PREFIX,@@ -18,7 +18,7 @@ use crate::threads::ThreadsError;/// Generates a durable thread title from the first user message and assistant reply.pub async fn thread_generate_title(request: GenerateConversationThreadTitleRequest,-) -> Result<RpcOutcome<ApiEnvelope<ConversationThreadSummary>>, ThreadsError> {+) -> Result<Outcome<ApiEnvelope<ConversationThreadSummary>>, ThreadsError> {let config = Config::load_or_init().await.map_err(|e| format!("load config: {e}"))?;diff --git a/crates/openhuman-core/src/threads/ops/transcript.rs b/crates/openhuman-core/src/threads/ops/transcript.rsindex 3925a60d70..3c7f563704 100644--- a/crates/openhuman-core/src/threads/ops/transcript.rs+++ b/crates/openhuman-core/src/threads/ops/transcript.rs@@ -2,7 +2,7 @@use super::support::{counts, envelope, workspace_dir};use crate::memory::{ApiEnvelope, PaginationMeta};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// Request for [`transcript_get`]: the thread to project, plus newest-first/// pagination controls. `cursor` is the opaque token from a prior page's@@ -21,7 +21,7 @@ pub struct TranscriptGetRequest {/// `hasTranscript: false` when the thread has no persisted transcript yet.pub async fn transcript_get(request: TranscriptGetRequest,-) -> Result<RpcOutcome<ApiEnvelope<crate::threads::transcript_view::TranscriptPage>>, String> {+) -> Result<Outcome<ApiEnvelope<crate::threads::transcript_view::TranscriptPage>>, String> {let dir = workspace_dir().await?;let thread_id = request.thread_id.trim();if thread_id.is_empty() {diff --git a/crates/openhuman-core/src/threads/ops/turn_state_ops.rs b/crates/openhuman-core/src/threads/ops/turn_state_ops.rsindex 31da9fb1de..2a31ba6626 100644--- a/crates/openhuman-core/src/threads/ops/turn_state_ops.rs+++ b/crates/openhuman-core/src/threads/ops/turn_state_ops.rs@@ -2,7 +2,7 @@use super::support::{counts, envelope, workspace_dir};use crate::memory::{ApiEnvelope, EmptyRequest};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::threads::turn_state::{self, ClearTurnStateRequest, ClearTurnStateResponse, GetTurnStateForRequestRequest,GetTurnStateRequest, GetTurnStateResponse, ListTurnStatesResponse,@@ -11,7 +11,7 @@ use crate::threads::turn_state::{/// Returns the persisted in-flight turn snapshot for a thread, if any.pub async fn turn_state_get(request: GetTurnStateRequest,-) -> Result<RpcOutcome<ApiEnvelope<GetTurnStateResponse>>, String> {+) -> Result<Outcome<ApiEnvelope<GetTurnStateResponse>>, String> {let dir = workspace_dir().await?;let turn_state = turn_state::store::get(dir, &request.thread_id)?;let present = turn_state.is_some();@@ -26,7 +26,7 @@ pub async fn turn_state_get(/// surface interrupted turns from a previous process.pub async fn turn_state_list(_request: EmptyRequest,-) -> Result<RpcOutcome<ApiEnvelope<ListTurnStatesResponse>>, String> {+) -> Result<Outcome<ApiEnvelope<ListTurnStatesResponse>>, String> {let dir = workspace_dir().await?;let turn_states = turn_state::store::list(dir)?;let count = turn_states.len();@@ -41,7 +41,7 @@ pub async fn turn_state_list(/// per-turn history that lets the UI render each answer's own process trail.pub async fn turn_state_history(request: GetTurnStateRequest,-) -> Result<RpcOutcome<ApiEnvelope<ListTurnStatesResponse>>, String> {+) -> Result<Outcome<ApiEnvelope<ListTurnStatesResponse>>, String> {let dir = workspace_dir().await?;let turn_states = turn_state::store::list_thread(dir, &request.thread_id)?;let count = turn_states.len();@@ -57,7 +57,7 @@ pub async fn turn_state_history(/// first expanded.pub async fn turn_state_get_turn(request: GetTurnStateForRequestRequest,-) -> Result<RpcOutcome<ApiEnvelope<GetTurnStateResponse>>, String> {+) -> Result<Outcome<ApiEnvelope<GetTurnStateResponse>>, String> {let dir = workspace_dir().await?;let turn_state = turn_state::store::get_turn(dir, &request.thread_id, &request.request_id)?;let present = turn_state.is_some();@@ -72,7 +72,7 @@ pub async fn turn_state_get_turn(/// dismisses an "interrupted" banner).pub async fn turn_state_clear(request: ClearTurnStateRequest,-) -> Result<RpcOutcome<ApiEnvelope<ClearTurnStateResponse>>, String> {+) -> Result<Outcome<ApiEnvelope<ClearTurnStateResponse>>, String> {let dir = workspace_dir().await?;let cleared = turn_state::store::delete(dir, &request.thread_id)?;Ok(envelope(ClearTurnStateResponse { cleared }, None, None))diff --git a/crates/openhuman-core/src/threads/ops/usage.rs b/crates/openhuman-core/src/threads/ops/usage.rsindex 1ad3802e58..a0962d1c9e 100644--- a/crates/openhuman-core/src/threads/ops/usage.rs+++ b/crates/openhuman-core/src/threads/ops/usage.rs@@ -2,7 +2,7 @@use super::support::{counts, envelope, workspace_dir};use crate::memory::ApiEnvelope;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use std::collections::BTreeMap;use std::path::Path;use tinyagents_session::transcript::{@@ -255,7 +255,7 @@ pub(super) fn thread_spend(workspace_dir: &Path, thread_id: &str) -> ThreadSpend/// Total a thread's persisted token/cost usage across its root transcripts.pub async fn token_usage(request: ThreadTokenUsageRequest,-) -> Result<RpcOutcome<ApiEnvelope<ThreadTokenUsageResponse>>, String> {+) -> Result<Outcome<ApiEnvelope<ThreadTokenUsageResponse>>, String> {let dir = workspace_dir().await?;let spend = thread_spend(&dir, &request.thread_id);diff --git a/crates/openhuman-core/src/threads/schemas/handlers.rs b/crates/openhuman-core/src/threads/schemas/handlers.rsindex a9056d83ad..d536ed8e69 100644--- a/crates/openhuman-core/src/threads/schemas/handlers.rs+++ b/crates/openhuman-core/src/threads/schemas/handlers.rs@@ -167,6 +167,6 @@ pub(super) fn parse<T: DeserializeOwned>(params: Map<String, Value>) -> Result<Tserde_json::from_value(Value::Object(params)).map_err(|e| format!("invalid params: {e}"))}-fn to_json<T: serde::Serialize>(outcome: crate::rpc::RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: crate::core::Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/tools/README.md b/crates/openhuman-core/src/tools/README.mdindex 19fa42b374..95227dcdc0 100644--- a/crates/openhuman-core/src/tools/README.md+++ b/crates/openhuman-core/src/tools/README.md@@ -70,7 +70,7 @@ Namespace `tools` (wired into `crates/openhuman-core/src/core/all.rs` via `all_t| `openhuman.tools_searxng_search` | Self-hosted SearXNG search (gated on `searxng.enabled`). || `openhuman.tools_apify_linkedin_scrape` | Apify LinkedIn profile scrape → raw JSON + rendered markdown. |-Handlers load config via `config::rpc::load_config_with_timeout`, build the backend integration client where needed, and return `RpcOutcome`.+Handlers load config via `config::rpc::load_config_with_timeout`, build the backend integration client where needed, and return `Outcome`.## Agent toolsdiff --git a/crates/openhuman-core/src/tools/impl/system/update_apply.rs b/crates/openhuman-core/src/tools/impl/system/update_apply.rsindex dda87bfda7..07ade78343 100644--- a/crates/openhuman-core/src/tools/impl/system/update_apply.rs+++ b/crates/openhuman-core/src/tools/impl/system/update_apply.rs@@ -121,7 +121,7 @@ impl Tool for UpdateApplyTool {tracing::debug!(target: "update_apply", "{log}");}let body = serde_json::to_string_pretty(&outcome.value)?;- // `RpcOutcome<Value>` does not carry an explicit status flag, so+ // `Outcome<Value>` does not carry an explicit status flag, so// we have to read the shape: a `{"error": …}` body is the obvious// failure case, but `update_run`'s soft-failure paths// ("already current", "no platform asset for this target",diff --git a/crates/openhuman-core/src/tools/registry/README.md b/crates/openhuman-core/src/tools/registry/README.mdindex 64d4f81f52..9f4b82e95d 100644--- a/crates/openhuman-core/src/tools/registry/README.md+++ b/crates/openhuman-core/src/tools/registry/README.md@@ -41,7 +41,7 @@ Namespace `tool_registry`, registered via `all_tool_registry_registered_controll| `tool_registry.get` (`openhuman.tool_registry_get`) | `tool_id` (required string) | `tool`: one registry entry || `tool_registry.diagnostics` (`openhuman.tool_registry_diagnostics`) | none | `diagnostics`: redacted counts/posture/allowlists/denials/providers |-All handlers return `RpcOutcome<T>` serialized via `into_cli_compatible_json()`.+All handlers return `Outcome<T>` serialized via `into_cli_compatible_json()`.## Persistence@@ -55,7 +55,7 @@ No owned persistence. `diagnostics()` reads the MCP write-audit log through `cra- `crate::mcp::server` (`McpToolSpec`, `tool_specs()`) — MCP stdio tool source for registry entries.- `crate::mcp::registry::connections` (`all_connected_tools()` / `all_connected_tools_for_config()`, defined inside `mcp/registry/mod.rs`; empty-returning stubs in `mcp/registry/stub.rs` when the `mcp` feature is disabled) — live MCP client server tools, fetched via `block_in_place` only on the multi-thread runtime.- `crate::mcp::audit` (`list_writes`, `McpWriteListQuery`; stubbed under `mcp/audit/stub.rs` without the `mcp` feature) — write-audit health.-- `crate::rpc::RpcOutcome` — RPC result envelope.+- `crate::rpc::Outcome` — RPC result envelope.## Used bydiff --git a/crates/openhuman-core/src/tools/registry/ops.rs b/crates/openhuman-core/src/tools/registry/ops.rsindex 74b9e6e7fe..7eb3a8bf2e 100644--- a/crates/openhuman-core/src/tools/registry/ops.rs+++ b/crates/openhuman-core/src/tools/registry/ops.rs@@ -7,7 +7,7 @@ use crate::core::all;use crate::core::{ControllerSchema, FieldSchema, TypeSchema};use crate::mcp::audit::McpWriteListQuery;use crate::mcp::server::McpToolSpec;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::providers::capability_provider_diagnostics;use super::types::{@@ -28,17 +28,17 @@ const POLICY_SURFACES: &[&str] = &[];/// Return the current read-only tool registry snapshot.-pub fn list_tools() -> RpcOutcome<ToolRegistryList> {+pub fn list_tools() -> Outcome<ToolRegistryList> {let tools = registry_entries();log::debug!("[tool_registry] list_tools completed entries={}",tools.len());- RpcOutcome::new(ToolRegistryList { tools }, vec![])+ Outcome::new(ToolRegistryList { tools }, vec![])}/// Return redacted diagnostics for policy/tool visibility reviews.-pub async fn diagnostics() -> Result<RpcOutcome<ToolPolicyDiagnostics>, String> {+pub async fn diagnostics() -> Result<Outcome<ToolPolicyDiagnostics>, String> {log::debug!("[tool_registry] diagnostics loading_config");let config = Config::load_or_init().await.map_err(|err| {log::warn!("[tool_registry] diagnostics config_load_failed error={err}");@@ -48,7 +48,7 @@ pub async fn diagnostics() -> Result<RpcOutcome<ToolPolicyDiagnostics>, String>}/// Return redacted diagnostics using a specific config snapshot.-pub fn diagnostics_for_config(config: &Config) -> RpcOutcome<ToolPolicyDiagnostics> {+pub fn diagnostics_for_config(config: &Config) -> Outcome<ToolPolicyDiagnostics> {log::debug!("[tool_registry] diagnostics_for_config start");let tools = registry_entries_for_config(config);@@ -111,7 +111,7 @@ pub fn diagnostics_for_config(config: &Config) -> RpcOutcome<ToolPolicyDiagnostidiagnostics.capability_providers.trusted_enabled_providers,diagnostics.capability_providers.registry_errors.len());- RpcOutcome::new(diagnostics, vec![])+ Outcome::new(diagnostics, vec![])}fn posture_from_config(config: &Config) -> ToolPolicyPosture {@@ -194,7 +194,7 @@ fn mcp_write_audit_health(config: &Config) -> McpWriteAuditHealth {}/// Look up one registry entry by stable `tool_id`.-pub fn get_tool(tool_id: &str) -> Result<RpcOutcome<ToolRegistryEntry>, String> {+pub fn get_tool(tool_id: &str) -> Result<Outcome<ToolRegistryEntry>, String> {let normalized = tool_id.trim();if normalized.is_empty() {return Err("tool_id must be a non-empty string".to_string());@@ -210,7 +210,7 @@ pub fn get_tool(tool_id: &str) -> Result<RpcOutcome<ToolRegistryEntry>, String>tool.tool_id,tool.transport);- Ok(RpcOutcome::new(tool, vec![]))+ Ok(Outcome::new(tool, vec![]))}/// Build sorted registry entries from the current MCP and controller metadata.diff --git a/crates/openhuman-core/src/tools/registry/schemas.rs b/crates/openhuman-core/src/tools/registry/schemas.rsindex 478f5c8c6c..a1d2030894 100644--- a/crates/openhuman-core/src/tools/registry/schemas.rs+++ b/crates/openhuman-core/src/tools/registry/schemas.rs@@ -2,7 +2,7 @@ use serde_json::{Map, Value};use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// Declared controller schemas for the `tool_registry` namespace.pub fn all_controller_schemas() -> Vec<ControllerSchema> {@@ -130,7 +130,7 @@ fn required_tool_id(params: &Map<String, Value>) -> Result<&str, String> {.ok_or_else(|| "tool_id must be a non-empty string".to_string())}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-core/src/tools/schemas/apify.rs b/crates/openhuman-core/src/tools/schemas/apify.rsindex d1ca0304ce..fd028f82e0 100644--- a/crates/openhuman-core/src/tools/schemas/apify.rs+++ b/crates/openhuman-core/src/tools/schemas/apify.rs@@ -4,7 +4,7 @@ use serde_json::{json, Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::ControllerFuture;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub(super) fn handle_apify_linkedin_scrape(params: Map<String, Value>) -> ControllerFuture {Box::pin(async move {@@ -38,6 +38,6 @@ pub(super) fn handle_apify_linkedin_scrape(params: Map<String, Value>) -> Contro"tools.apify_linkedin_scrape: url={profile_url} markdown_chars={}",markdown.chars().count())];- RpcOutcome::new(payload, log).into_cli_compatible_json()+ Outcome::new(payload, log).into_cli_compatible_json()})}diff --git a/crates/openhuman-core/src/tools/schemas/composio.rs b/crates/openhuman-core/src/tools/schemas/composio.rsindex a93ee3da73..e0a4fac7e0 100644--- a/crates/openhuman-core/src/tools/schemas/composio.rs+++ b/crates/openhuman-core/src/tools/schemas/composio.rs@@ -4,7 +4,7 @@ use serde_json::{json, Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::ControllerFuture;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub(super) fn handle_composio_execute(params: Map<String, Value>) -> ControllerFuture {Box::pin(async move {@@ -71,6 +71,6 @@ pub(super) fn handle_composio_execute(params: Map<String, Value>) -> ControllerF"tools.composio_execute: action={action} successful={}",resp.successful)];- RpcOutcome::new(payload, log).into_cli_compatible_json()+ Outcome::new(payload, log).into_cli_compatible_json()})}diff --git a/crates/openhuman-core/src/tools/schemas/web_search.rs b/crates/openhuman-core/src/tools/schemas/web_search.rsindex ae1accbb6b..9bc23db5cf 100644--- a/crates/openhuman-core/src/tools/schemas/web_search.rs+++ b/crates/openhuman-core/src/tools/schemas/web_search.rs@@ -5,7 +5,7 @@ use serde_json::{json, Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::ControllerFuture;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::search::tools::SEARXNG_MAX_RESULTS;use tinytools::Tool;@@ -75,7 +75,7 @@ pub(super) fn handle_web_search(params: Map<String, Value>) -> ControllerFuture"tools.web_search: query_len={} results={count} provider={provider}",query.chars().count())];- RpcOutcome::new(payload, log).into_cli_compatible_json()+ Outcome::new(payload, log).into_cli_compatible_json()})}@@ -151,7 +151,7 @@ pub(super) fn handle_seltz_search(params: Map<String, Value>) -> ControllerFuturquery.chars().count(),max_results)];- RpcOutcome::new(payload, log).into_cli_compatible_json()+ Outcome::new(payload, log).into_cli_compatible_json()})}@@ -232,7 +232,7 @@ pub(super) fn handle_querit_search(params: Map<String, Value>) -> ControllerFutuquery.chars().count(),max_results)];- RpcOutcome::new(payload, log).into_cli_compatible_json()+ Outcome::new(payload, log).into_cli_compatible_json()})}@@ -300,7 +300,7 @@ pub(super) fn handle_searxng_search(params: Map<String, Value>) -> ControllerFutlet log = vec![format!("[rpc][tools.searxng_search] success results={result_count}")];- RpcOutcome::new(payload, log).into_cli_compatible_json()+ Outcome::new(payload, log).into_cli_compatible_json()})}diff --git a/crates/openhuman-core/src/voice/README.md b/crates/openhuman-core/src/voice/README.mdindex 2e13e1bb0e..5c73954470 100644--- a/crates/openhuman-core/src/voice/README.md+++ b/crates/openhuman-core/src/voice/README.md@@ -37,7 +37,7 @@ Keeping the two surfaces in lockstep is enforced by the disabled-build check| --- | --- || `mod.rs` | Module docstring, feature gate, and exports; re-exports inference-side voice submodules (`cloud_transcribe`, `local_speech`, `postprocess`, `streaming`); defines `cloud_transcribe_default_model()` (`"whisper-v1"`). || `types.rs` | RPC DTOs: `VoiceSpeechResult`, `VoiceTtsResult`, `VoiceStatus` + `From<LocalAi*>` conversions. |-| `ops.rs` | Business logic returning `RpcOutcome<T>`: `voice_status`, `voice_transcribe`, `voice_transcribe_bytes`, `voice_tts`, `normalize_extension`. |+| `ops.rs` | Business logic returning `Outcome<T>`: `voice_status`, `voice_transcribe`, `voice_transcribe_bytes`, `voice_tts`, `normalize_extension`. || `factory/` | `SttProvider` / `TtsProvider` traits; cloud/piper/external implementations; `create_stt_provider` / `create_tts_provider`; `effective_*_provider`; slug:model parsing; `DEFAULT_STT_MODEL`, `DEFAULT_PIPER_VOICE`. Split into `entry.rs` (public entry points + constants), `traits.rs`, `stt_providers.rs` (`CloudSttProvider`, `ExternalSttProvider`), `tts_providers.rs` (`CloudTtsProvider`, `PiperTtsProvider`, `ExternalTtsProvider`), `helpers.rs` (`split_slug_model`, `effective_*_provider`, slug-keyed lookup in `config.voice_providers`). || `schemas/` | Controller schemas, registry exports, and all `handle_voice_*` / `handle_overlay_stt_notify` RPC handlers. Split into `registry.rs`, `params.rs`, `helpers.rs`, `handlers.rs` (+ `handlers/provider_server.rs`, `handlers/transcribe_tts.rs`). || `server.rs` (+ `server/runtime.rs`, `server/pipeline.rs`, `server/hotkey_listener.rs`, `server/singleton.rs`, `server/types.rs`) | The `VoiceServer` dictation runtime: hotkey event loop, recording lifecycle, duration/silence/hallucination gates, background processing, global singleton (`global_server` / `try_global_server` / `start_if_enabled` / `run_standalone`, all in `server/singleton.rs`). |@@ -144,7 +144,7 @@ transcription count, rolling recent-transcript buffer for context) behind a- `crate::desktop::accessibility` (macOS only) — focused-text inspection (`focused_text_context_verbose`) and the Swift globe-key listener (`globe_listener_start` / `globe_listener_poll`) used in place of rdev for the Fn key.- `crate::api` — `BackendOAuthClient`, `effective_backend_api_url`, `get_session_token` for backend-proxied reply-speech and the realtime signed-URL bootstrap.- `crate::modules::voice` (`tinyvoice`) — see Contract crates above.-- `crate::core::all` (`ControllerFuture`, `RegisteredController`), `crate::core::{ControllerSchema, FieldSchema, TypeSchema}`, `crate::core::bus::BUS` + `crate::core::events` (event publishing), `crate::core::logging` (CLI run init), and `crate::rpc::RpcOutcome`.+- `crate::core::all` (`ControllerFuture`, `RegisteredController`), `crate::core::{ControllerSchema, FieldSchema, TypeSchema}`, `crate::core::bus::BUS` + `crate::core::events` (event publishing), `crate::core::logging` (CLI run init), and `crate::rpc::Outcome`.- External crates: `cpal` (capture), `rdev` (hotkeys), `enigo` + `arboard` (paste insertion), `reqwest` (external provider HTTP + realtime bootstrap), `tokio`/`tokio-util`, `once_cell`.## Used bydiff --git a/crates/openhuman-core/src/voice/audio_toolkit/README.md b/crates/openhuman-core/src/voice/audio_toolkit/README.mdindex fed3c7cbd6..61e4126999 100644--- a/crates/openhuman-core/src/voice/audio_toolkit/README.md+++ b/crates/openhuman-core/src/voice/audio_toolkit/README.md@@ -26,7 +26,7 @@ Text-to-speech "podcast" toolkit. Synthesizes text into a workspace audio file vFrom `mod.rs`:-- **ops**: `generate_podcast`, `email_podcast`, `generate_and_email_podcast`, `resolve_email_capture_dir` — all take `&Config` and return `Result<RpcOutcome<T>, String>` (except `resolve_email_capture_dir → Option<PathBuf>`).+- **ops**: `generate_podcast`, `email_podcast`, `generate_and_email_podcast`, `resolve_email_capture_dir` — all take `&Config` and return `Result<Outcome<T>, String>` (except `resolve_email_capture_dir → Option<PathBuf>`).- **schemas**: `all_audio_toolkit_controller_schemas`, `all_audio_toolkit_registered_controllers`.- **types**: `AudioFormat` (`Mp3`/`Wav`, with `extension()` / `mime()`), `AudioGenerateRequest`, `EmailPodcastRequest`, `AudioGeneratedArtifact`, `AudioEmailDeliveryResult`, `AudioToolkitGenerateAndEmailResult`.- **tools** (`pub mod tools`): `AudioGeneratePodcastTool`, `AudioEmailPodcastTool`, `AudioGenerateAndEmailPodcastTool`.@@ -70,7 +70,7 @@ No durable domain store. Side effects are filesystem writes within the workspace- `crate::security` — `SecurityPolicy` / `ToolOperation` to gate the agent tools.- `tinytools` — `Tool`, `ToolResult`, `PermissionLevel`.- `crate::core::all` / `crate::core` — `RegisteredController`, `ControllerFuture`, `ControllerSchema`, `FieldSchema`, `TypeSchema` for RPC registration.-- `crate::rpc::RpcOutcome` — controller/op return contract.+- `crate::rpc::Outcome` — controller/op return contract.- External crates: `lettre` (email message + attachment), `base64`, `chrono`, `uuid`.## Used bydiff --git a/crates/openhuman-core/src/voice/audio_toolkit/ops.rs b/crates/openhuman-core/src/voice/audio_toolkit/ops.rsindex 0ea467ac0b..ac8e20b1de 100644--- a/crates/openhuman-core/src/voice/audio_toolkit/ops.rs+++ b/crates/openhuman-core/src/voice/audio_toolkit/ops.rs@@ -5,7 +5,7 @@ use lettre::message::{header::ContentType, Attachment, Mailbox, MultiPart, Singluse lettre::Message;use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::voice::{create_tts_provider, DEFAULT_PIPER_VOICE};use tinychannels::providers::email_channel::EmailChannel;@@ -22,7 +22,7 @@ const EMAIL_CAPTURE_ENV: &str = "OPENHUMAN_EMAIL_CAPTURE_DIR";pub async fn generate_podcast(config: &Config,request: AudioGenerateRequest,-) -> Result<RpcOutcome<AudioGeneratedArtifact>, String> {+) -> Result<Outcome<AudioGeneratedArtifact>, String> {let trimmed = request.text.trim();if trimmed.is_empty() {return Err("text is required".to_string());@@ -77,7 +77,7 @@ pub async fn generate_podcast(chars_synthesized: trimmed.chars().count(),};- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(result,"audio podcast synthesized to workspace file",))@@ -86,7 +86,7 @@ pub async fn generate_podcast(pub async fn email_podcast(config: &Config,request: EmailPodcastRequest,-) -> Result<RpcOutcome<AudioEmailDeliveryResult>, String> {+) -> Result<Outcome<AudioEmailDeliveryResult>, String> {let to = request.to.trim();let subject = request.subject.trim();let body = request.body.trim();@@ -154,7 +154,7 @@ pub async fn email_podcast(mode: "capture".to_string(),capture_path: Some(capture_rel),};- return Ok(RpcOutcome::single_log(+ return Ok(Outcome::single_log(result,"audio email captured to workspace file",));@@ -170,7 +170,7 @@ pub async fn email_podcast(.send_message(email).map_err(|e| format!("failed to send email attachment: {e}"))?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(AudioEmailDeliveryResult {to: to.to_string(),subject: subject.to_string(),@@ -186,14 +186,14 @@ pub async fn generate_and_email_podcast(config: &Config,generate_request: AudioGenerateRequest,email_request: EmailPodcastRequest,-) -> Result<RpcOutcome<AudioToolkitGenerateAndEmailResult>, String> {+) -> Result<Outcome<AudioToolkitGenerateAndEmailResult>, String> {let generated = generate_podcast(config, generate_request).await?;let email_request = EmailPodcastRequest {audio_path: generated.value.output_path.clone(),..email_request};let emailed = email_podcast(config, email_request).await?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(AudioToolkitGenerateAndEmailResult {audio: generated.value,email: emailed.value,diff --git a/crates/openhuman-core/src/voice/audio_toolkit/schemas.rs b/crates/openhuman-core/src/voice/audio_toolkit/schemas.rsindex 8514f3cd3d..d39463436a 100644--- a/crates/openhuman-core/src/voice/audio_toolkit/schemas.rs+++ b/crates/openhuman-core/src/voice/audio_toolkit/schemas.rs@@ -4,7 +4,7 @@ use serde_json::{Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::voice::audio_toolkit::types::{AudioFormat, AudioGenerateRequest, EmailPodcastRequest};#[derive(Debug, Deserialize)]@@ -169,7 +169,7 @@ fn handle_generate_and_email_podcast(params: Map<String, Value>) -> ControllerFu})}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {serde_json::to_value(outcome.value).map_err(|e| format!("serialize error: {e}"))}diff --git a/crates/openhuman-core/src/voice/cloud_transcribe.rs b/crates/openhuman-core/src/voice/cloud_transcribe.rsindex bb22ba972d..de8b6831c9 100644--- a/crates/openhuman-core/src/voice/cloud_transcribe.rs+++ b/crates/openhuman-core/src/voice/cloud_transcribe.rs@@ -4,7 +4,7 @@ use crate::api::config::effective_backend_api_url;use crate::api::jwt::get_session_token;use crate::api::BackendOAuthClient;use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;pub use tinyinference_voice::cloud::{CloudTranscribeOptions, CloudTranscribeResult};@@ -13,7 +13,7 @@ pub async fn transcribe_cloud(config: &Config,audio_base64: &str,options: &CloudTranscribeOptions,-) -> Result<RpcOutcome<CloudTranscribeResult>, String> {+) -> Result<Outcome<CloudTranscribeResult>, String> {let token = get_session_token(config).map_err(|error| error.to_string())?.filter(|token| !token.trim().is_empty())@@ -28,7 +28,7 @@ pub async fn transcribe_cloud(.map_err(crate::api::flatten_authed_error)?;let result =tinyinference_voice::cloud::transcribe(&http, url, &token, audio_base64, options).await?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(result,"cloud STT via POST /openai/v1/audio/transcriptions",))diff --git a/crates/openhuman-core/src/voice/factory/stt_providers.rs b/crates/openhuman-core/src/voice/factory/stt_providers.rsindex a02f60cdfb..fc9bc35444 100644--- a/crates/openhuman-core/src/voice/factory/stt_providers.rs+++ b/crates/openhuman-core/src/voice/factory/stt_providers.rs@@ -16,7 +16,7 @@ use super::helpers::{base64_decode, extension_for_mime};use super::traits::{SttProvider, SttResult};use crate::config::schema::voice_providers::SttApiStyle;use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;const LOG_PREFIX: &str = "[voice-factory]";@@ -50,7 +50,7 @@ impl SttProvider for CloudSttProvider {mime_type: Option<&str>,file_name: Option<&str>,language: Option<&str>,- ) -> Result<RpcOutcome<SttResult>, String> {+ ) -> Result<Outcome<SttResult>, String> {debug!("{LOG_PREFIX} cloud STT dispatch model={} bytes_b64={}",self.model,@@ -64,7 +64,7 @@ impl SttProvider for CloudSttProvider {};let outcome = transcribe_cloud(config, audio_base64, &opts).await?;let CloudTranscribeResult { text } = outcome.value;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(SttResult {text,provider: "cloud".to_string(),@@ -119,7 +119,7 @@ impl SttProvider for ExternalSttProvider {mime_type: Option<&str>,file_name: Option<&str>,language: Option<&str>,- ) -> Result<RpcOutcome<SttResult>, String> {+ ) -> Result<Outcome<SttResult>, String> {debug!("{LOG_PREFIX} external STT dispatch slug={} model={} style={:?} bytes_b64={}",self.slug,@@ -146,7 +146,7 @@ impl SttProvider for ExternalSttProvider {}};- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(SttResult {text: result,provider: self.slug.clone(),diff --git a/crates/openhuman-core/src/voice/factory/traits.rs b/crates/openhuman-core/src/voice/factory/traits.rsindex 858618f610..e27e324652 100644--- a/crates/openhuman-core/src/voice/factory/traits.rs+++ b/crates/openhuman-core/src/voice/factory/traits.rs@@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize};use super::super::reply_speech::ReplySpeechResult;use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;// ---------------------------------------------------------------------------// Shared result type@@ -45,7 +45,7 @@ pub trait SttProvider: Send + Sync {mime_type: Option<&str>,file_name: Option<&str>,language: Option<&str>,- ) -> Result<RpcOutcome<SttResult>, String>;+ ) -> Result<Outcome<SttResult>, String>;/// The model selected when the provider was constructed.///@@ -73,7 +73,7 @@ pub trait TtsProvider: Send + Sync {config: &Config,text: &str,voice: Option<&str>,- ) -> Result<RpcOutcome<ReplySpeechResult>, String>;+ ) -> Result<Outcome<ReplySpeechResult>, String>;/// The voice this provider was constructed with, or `None` when it defers/// to a downstream default (cloud omits `voice_id` so the backend picks).diff --git a/crates/openhuman-core/src/voice/factory/tts_providers.rs b/crates/openhuman-core/src/voice/factory/tts_providers.rsindex e37d21cf73..dc78ed01ae 100644--- a/crates/openhuman-core/src/voice/factory/tts_providers.rs+++ b/crates/openhuman-core/src/voice/factory/tts_providers.rs@@ -8,7 +8,7 @@ use super::super::reply_speech::{synthesize_reply, ReplySpeechOptions, ReplySpeeuse super::traits::TtsProvider;use crate::config::schema::voice_providers::TtsApiStyle;use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;const LOG_PREFIX: &str = "[voice-factory]";@@ -38,7 +38,7 @@ impl TtsProvider for CloudTtsProvider {config: &Config,text: &str,voice: Option<&str>,- ) -> Result<RpcOutcome<ReplySpeechResult>, String> {+ ) -> Result<Outcome<ReplySpeechResult>, String> {let resolved_voice = voice.map(str::to_string).or_else(|| self.voice.clone())@@ -91,7 +91,7 @@ impl TtsProvider for PiperTtsProvider {config: &Config,text: &str,voice: Option<&str>,- ) -> Result<RpcOutcome<ReplySpeechResult>, String> {+ ) -> Result<Outcome<ReplySpeechResult>, String> {let resolved_voice = voice.map(str::to_string).filter(|s| !s.trim().is_empty())@@ -156,7 +156,7 @@ impl TtsProvider for ExternalTtsProvider {_config: &Config,text: &str,voice: Option<&str>,- ) -> Result<RpcOutcome<ReplySpeechResult>, String> {+ ) -> Result<Outcome<ReplySpeechResult>, String> {let resolved_voice = voice.filter(|s| !s.trim().is_empty()).unwrap_or(&self.default_voice);@@ -177,7 +177,7 @@ impl TtsProvider for ExternalTtsProvider {use base64::Engine;let audio_base64 = base64::engine::general_purpose::STANDARD.encode(&audio_bytes);- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(ReplySpeechResult {audio_base64,audio_mime,diff --git a/crates/openhuman-core/src/voice/local_speech.rs b/crates/openhuman-core/src/voice/local_speech.rsindex 848244534e..7ecd179af3 100644--- a/crates/openhuman-core/src/voice/local_speech.rs+++ b/crates/openhuman-core/src/voice/local_speech.rs@@ -1,7 +1,7 @@//! OpenHuman configuration adapter for local Piper text-to-speech.use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::voice::reply_speech::{ReplySpeechResult, VisemeFrame};#[cfg(test)]use tinyinference_voice::piper::synthetic_viseme_timeline;@@ -21,7 +21,7 @@ pub async fn synthesize_piper(config: &Config,text: &str,options: &PiperOptions,-) -> Result<RpcOutcome<ReplySpeechResult>, String> {+) -> Result<Outcome<ReplySpeechResult>, String> {if text.trim().is_empty() {return Err("text is required".to_string());}@@ -37,7 +37,7 @@ pub async fn synthesize_piper(.unwrap_or(DEFAULT_PIPER_VOICE);log::debug!("[voice-tts] synthesizing voice={voice}");let speech = tinyinference_voice::piper::synthesize(&binary, model.as_ref(), text).await?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(ReplySpeechResult {audio_base64: speech.audio_base64,audio_mime: speech.audio_mime,diff --git a/crates/openhuman-core/src/voice/ops.rs b/crates/openhuman-core/src/voice/ops.rsindex 4a65744f80..51f298d915 100644--- a/crates/openhuman-core/src/voice/ops.rs+++ b/crates/openhuman-core/src/voice/ops.rs@@ -1,6 +1,6 @@//! Voice domain business logic — hosted STT and local piper TTS.//!-//! Each public function follows the `RpcOutcome<T>` pattern used by other+//! Each public function follows the `Outcome<T>` pattern used by other//! domain modules (billing, health, etc.).use chrono::Utc;@@ -9,7 +9,7 @@ use std::time::Instant;use crate::config::Config;use crate::inference::host_runtime as local_ai;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use tinyinference_local::models as model_ids;use super::factory::{create_stt_provider, effective_stt_provider};@@ -21,7 +21,7 @@ const LOG_PREFIX: &str = "[voice]";/// Check availability of the STT engine and the TTS binary/model without/// executing them.-pub async fn voice_status(config: &Config) -> Result<RpcOutcome<VoiceStatus>, String> {+pub async fn voice_status(config: &Config) -> Result<Outcome<VoiceStatus>, String> {debug!("{LOG_PREFIX} checking voice status");let runtime = crate::inference::local_runtime_config(config);@@ -81,7 +81,7 @@ pub async fn voice_status(config: &Config) -> Result<RpcOutcome<VoiceStatus>, Sttts_provider,};- Ok(RpcOutcome::single_log(status, "voice status checked"))+ Ok(Outcome::single_log(status, "voice status checked"))}/// Transcribe audio from a file path through the configured STT engine.@@ -93,7 +93,7 @@ pub async fn voice_transcribe(audio_path: &str,context: Option<&str>,skip_cleanup: bool,-) -> Result<RpcOutcome<VoiceSpeechResult>, String> {+) -> Result<Outcome<VoiceSpeechResult>, String> {let started = Instant::now();debug!("{LOG_PREFIX} transcribing audio_path={audio_path}");@@ -130,7 +130,7 @@ pub async fn voice_transcribe(started.elapsed().as_millis());- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(VoiceSpeechResult {text,raw_text,@@ -150,7 +150,7 @@ pub async fn voice_transcribe_bytes(extension: Option<String>,context: Option<&str>,skip_cleanup: bool,-) -> Result<RpcOutcome<VoiceSpeechResult>, String> {+) -> Result<Outcome<VoiceSpeechResult>, String> {let started = Instant::now();let ext = normalize_extension(extension)?;debug!(@@ -222,7 +222,7 @@ pub async fn voice_transcribe_bytes(};if hallucinated {debug!("{LOG_PREFIX} transcribe_bytes: hallucination detected, returning empty result");- return Ok(RpcOutcome::single_log(+ return Ok(Outcome::single_log(VoiceSpeechResult {text: String::new(),raw_text,@@ -245,7 +245,7 @@ pub async fn voice_transcribe_bytes(started.elapsed().as_millis());- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(VoiceSpeechResult {text,raw_text,@@ -260,7 +260,7 @@ pub async fn voice_tts(config: &Config,text: &str,output_path: Option<&str>,-) -> Result<RpcOutcome<VoiceTtsResult>, String> {+) -> Result<Outcome<VoiceTtsResult>, String> {debug!("{LOG_PREFIX} tts text_length={} output_path={:?}",text.len(),@@ -274,7 +274,7 @@ pub async fn voice_tts(debug!("{LOG_PREFIX} tts completed, output={}", output.output_path);- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(VoiceTtsResult::from(output),"voice tts completed",))diff --git a/crates/openhuman-core/src/voice/realtime.rs b/crates/openhuman-core/src/voice/realtime.rsindex f16173550e..4ce7c4ccd5 100644--- a/crates/openhuman-core/src/voice/realtime.rs+++ b/crates/openhuman-core/src/voice/realtime.rs@@ -17,7 +17,7 @@ use crate::api::config::effective_backend_api_url;use crate::api::jwt::get_session_token;use crate::api::BackendOAuthClient;use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;const LOG_PREFIX: &str = "[voice-realtime]";@@ -82,7 +82,7 @@ fn authority_host(rest: &str) -> &str {/// than leaking as a raw error string.pub async fn mint_voice_agent_signed_url(config: &Config,-) -> Result<RpcOutcome<VoiceAgentSignedUrl>, String> {+) -> Result<Outcome<VoiceAgentSignedUrl>, String> {let token = get_session_token(config).map_err(|e| e.to_string())?.and_then(|t| {@@ -106,7 +106,7 @@ pub async fn mint_voice_agent_signed_url(let result = parse_signed_url_response(&raw)?;debug!("{LOG_PREFIX} minted signed url agent={}", result.agent_id);- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(result,"voice agent signed url minted via GET /voice-agent/get-signed-url",))diff --git a/crates/openhuman-core/src/voice/reply_speech.rs b/crates/openhuman-core/src/voice/reply_speech.rsindex 025c6e45f1..ed5712034c 100644--- a/crates/openhuman-core/src/voice/reply_speech.rs+++ b/crates/openhuman-core/src/voice/reply_speech.rs@@ -24,7 +24,7 @@ use crate::api::config::effective_backend_api_url;use crate::api::jwt::get_session_token;use crate::api::BackendOAuthClient;use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;const LOG_PREFIX: &str = "[voice_reply]";@@ -126,7 +126,7 @@ pub async fn synthesize_reply(config: &Config,text: &str,opts: &ReplySpeechOptions,-) -> Result<RpcOutcome<ReplySpeechResult>, String> {+) -> Result<Outcome<ReplySpeechResult>, String> {let trimmed = text.trim();if trimmed.is_empty() {return Err("text is required".to_string());@@ -146,7 +146,7 @@ pub async fn synthesize_reply(.lock().unwrap().push(trimmed.to_string());- return Ok(RpcOutcome::single_log(+ return Ok(Outcome::single_log(ReplySpeechResult {audio_base64: String::new(),audio_mime: "audio/mpeg".to_string(),@@ -238,7 +238,7 @@ pub async fn synthesize_reply(result.alignment.as_ref().map_or(0, Vec::len));- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(result,"voice reply synthesized via POST /openai/v1/audio/speech",))diff --git a/crates/openhuman-core/src/voice/schemas/helpers.rs b/crates/openhuman-core/src/voice/schemas/helpers.rsindex 7cd362cf18..7a29d8c845 100644--- a/crates/openhuman-core/src/voice/schemas/helpers.rs+++ b/crates/openhuman-core/src/voice/schemas/helpers.rs@@ -4,9 +4,9 @@ use serde::de::DeserializeOwned;use serde_json::{Map, Value};use crate::core::{FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;-pub(super) fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+pub(super) fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {let json_val =serde_json::to_value(outcome.value).map_err(|e| format!("serialize error: {e}"))?;Ok(json_val)diff --git a/crates/openhuman-core/src/voice/schemas/mod.rs b/crates/openhuman-core/src/voice/schemas/mod.rsindex 9cf8556c8e..342c8f7039 100644--- a/crates/openhuman-core/src/voice/schemas/mod.rs+++ b/crates/openhuman-core/src/voice/schemas/mod.rs@@ -41,7 +41,7 @@ use params::{};#[cfg(test)]-use crate::rpc::RpcOutcome;+use crate::core::Outcome;#[cfg(test)]use serde_json::Map;#[cfg(test)]diff --git a/crates/openhuman-core/src/voice/schemas_tests.rs b/crates/openhuman-core/src/voice/schemas_tests.rsindex 80dab0a2cb..390920368a 100644--- a/crates/openhuman-core/src/voice/schemas_tests.rs+++ b/crates/openhuman-core/src/voice/schemas_tests.rs@@ -139,7 +139,7 @@ fn deserialize_params_rejects_wrong_type() {#[test]fn to_json_returns_inner_value() {let json =- to_json(RpcOutcome::single_log(json!({"ok": true}), "done")).expect("serialize outcome");+ to_json(Outcome::single_log(json!({"ok": true}), "done")).expect("serialize outcome");assert_eq!(json["ok"], true);}diff --git a/crates/openhuman-core/src/voice/stub.rs b/crates/openhuman-core/src/voice/stub.rsindex 5f46ef1e29..b680827814 100644--- a/crates/openhuman-core/src/voice/stub.rs+++ b/crates/openhuman-core/src/voice/stub.rs@@ -16,7 +16,7 @@ use async_trait::async_trait;use serde::{Deserialize, Serialize};use crate::config::Config;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// Error text returned by every disabled-path operation that must yield a/// `Result`. Shared so callers/log-greps see one stable string.@@ -48,7 +48,7 @@ pub trait SttProvider: Send + Sync {mime_type: Option<&str>,file_name: Option<&str>,language: Option<&str>,- ) -> Result<RpcOutcome<SttResult>, String>;+ ) -> Result<Outcome<SttResult>, String>;#[cfg(test)]fn configured_model(&self) -> Option<&str> {@@ -217,7 +217,7 @@ pub mod reply_speech {use serde_json::Value;use crate::config::Config;- use crate::rpc::RpcOutcome;+ use crate::core::Outcome;/// One frame on the viseme timeline. Mirrors the real type.#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]@@ -260,7 +260,7 @@ pub mod reply_speech {_config: &Config,_text: &str,_opts: &ReplySpeechOptions,- ) -> Result<RpcOutcome<ReplySpeechResult>, String> {+ ) -> Result<Outcome<ReplySpeechResult>, String> {Err(super::DISABLED_MSG.to_string())}}@@ -274,7 +274,7 @@ pub mod cloud_transcribe {use serde::{Deserialize, Serialize};use crate::config::Config;- use crate::rpc::RpcOutcome;+ use crate::core::Outcome;/// Caller-tunable knobs. Mirrors the real type (fields + `Default`).#[derive(Debug, Default, Clone)]@@ -296,7 +296,7 @@ pub mod cloud_transcribe {_config: &Config,_audio_base64: &str,_opts: &CloudTranscribeOptions,- ) -> Result<RpcOutcome<CloudTranscribeResult>, String> {+ ) -> Result<Outcome<CloudTranscribeResult>, String> {Err(super::DISABLED_MSG.to_string())}}diff --git a/crates/openhuman-core/src/web3/mod.rs b/crates/openhuman-core/src/web3/mod.rsindex f67b5211df..f08080c440 100644--- a/crates/openhuman-core/src/web3/mod.rs+++ b/crates/openhuman-core/src/web3/mod.rs@@ -56,7 +56,7 @@ use crate::core::all::RegisteredController;#[cfg(feature = "web3")]use crate::core::{ControllerSchema, FieldSchema, TypeSchema};#[cfg(feature = "web3")]-use crate::rpc::RpcOutcome;+use crate::core::Outcome;#[cfg(feature = "web3")]use tinytools::{Tool, ToolResult};@@ -130,7 +130,7 @@ pub(crate) fn execute_tool_schema() -> serde_json::Value {/// Convert an op result into a `ToolResult` with pretty-printed JSON on success.#[cfg(feature = "web3")]-pub(crate) fn to_tool_result<T: Serialize>(result: Result<RpcOutcome<T>, String>) -> ToolResult {+pub(crate) fn to_tool_result<T: Serialize>(result: Result<Outcome<T>, String>) -> ToolResult {match result {Ok(outcome) => match serde_json::to_string_pretty(&outcome.value) {Ok(s) => ToolResult::success(s),diff --git a/crates/openhuman-core/src/web3/ops.rs b/crates/openhuman-core/src/web3/ops.rsindex d759967f17..1589cb42a1 100644--- a/crates/openhuman-core/src/web3/ops.rs+++ b/crates/openhuman-core/src/web3/ops.rs@@ -7,7 +7,7 @@use serde_json::{json, Value};use crate::config::rpc as config_rpc;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use crate::web3::wallet::{self, EvmNetwork, WalletChain};use super::client::CryptoClient;@@ -79,11 +79,11 @@ fn unsigned_from_response(resp: &Value, family: ChainFamily) -> Result<UnsignedT}/// List the chains deBridge can swap/bridge between.-pub async fn routes() -> Result<RpcOutcome<Value>, String> {+pub async fn routes() -> Result<Outcome<Value>, String> {let config = config_rpc::load_config_with_timeout().await?;let client = CryptoClient::from_config(&config)?;let data = client.routes().await?;- Ok(RpcOutcome::new(+ Ok(Outcome::new(data,vec!["web3 supported routes listed".to_string()],))@@ -91,7 +91,7 @@ pub async fn routes() -> Result<RpcOutcome<Value>, String> {/// Prepare a single-chain swap. Cross-chain requests are rejected here with a/// pointer to `web3_bridge` (deBridge `/swap` is single-chain only).-pub async fn quote_swap(params: SwapQuoteParams) -> Result<RpcOutcome<Web3Quote>, String> {+pub async fn quote_swap(params: SwapQuoteParams) -> Result<Outcome<Web3Quote>, String> {let family = chain_family(params.chain_id).ok_or_else(|| {format!("chain id {} is not signable by the local wallet (no EVM/Solana signer)",@@ -121,7 +121,7 @@ pub async fn quote_swap(params: SwapQuoteParams) -> Result<RpcOutcome<Web3Quote>params.token_in,params.token_out);- Ok(RpcOutcome::new(+ Ok(Outcome::new(store::store_quote(Web3QuoteKind::Swap, unsigned, resp),vec!["web3 swap prepared".to_string()],))@@ -129,7 +129,7 @@ pub async fn quote_swap(params: SwapQuoteParams) -> Result<RpcOutcome<Web3Quote>/// Prepare a cross-chain bridge. Same-chain requests are rejected (mirrors the/// backend) — use `web3_swap` for single-chain swaps.-pub async fn quote_bridge(params: BridgeQuoteParams) -> Result<RpcOutcome<Web3Quote>, String> {+pub async fn quote_bridge(params: BridgeQuoteParams) -> Result<Outcome<Web3Quote>, String> {if params.src_chain_id == params.dst_chain_id {return Err("bridge requires different source and destination chains; use web3_swap for same-chain swaps"@@ -184,14 +184,14 @@ pub async fn quote_bridge(params: BridgeQuoteParams) -> Result<RpcOutcome<Web3Quparams.src_chain_id,params.dst_chain_id);- Ok(RpcOutcome::new(+ Ok(Outcome::new(store::store_quote(Web3QuoteKind::Bridge, unsigned, resp),vec!["web3 bridge prepared".to_string()],))}/// Prepare a generic EVM dapp contract call from caller-supplied calldata.-pub async fn prepare_dapp_call(params: DappCallParams) -> Result<RpcOutcome<Web3Quote>, String> {+pub async fn prepare_dapp_call(params: DappCallParams) -> Result<Outcome<Web3Quote>, String> {let network = params.evm_network.unwrap_or(EvmNetwork::EthereumMainnet);let contract = params.contract_address.trim();if contract.is_empty() {@@ -226,7 +226,7 @@ pub async fn prepare_dapp_call(params: DappCallParams) -> Result<RpcOutcome<Web3network.as_str(),contract);- Ok(RpcOutcome::new(+ Ok(Outcome::new(store::store_quote(Web3QuoteKind::DappCall, unsigned, summary),vec!["web3 dapp call prepared".to_string()],))diff --git a/crates/openhuman-core/src/web3/store.rs b/crates/openhuman-core/src/web3/store.rsindex a76596dac1..dcede9a152 100644--- a/crates/openhuman-core/src/web3/store.rs+++ b/crates/openhuman-core/src/web3/store.rs@@ -154,7 +154,7 @@ pub(crate) fn stored_quote_count() -> usize {/// so it stays retryable.pub async fn execute_quote(params: ExecuteQuoteParams,-) -> Result<crate::rpc::RpcOutcome<Web3ExecutionResult>, String> {+) -> Result<crate::core::Outcome<Web3ExecutionResult>, String> {if !params.confirmed {return Err("execute requires `confirmed: true`".to_string());}@@ -193,7 +193,7 @@ pub async fn execute_quote(}};- Ok(crate::rpc::RpcOutcome::new(+ Ok(crate::core::Outcome::new(Web3ExecutionResult {quote_id: params.quote_id,kind,diff --git a/crates/openhuman-core/src/web3/wallet/README.md b/crates/openhuman-core/src/web3/wallet/README.mdindex 184c1af5bd..548dced401 100644--- a/crates/openhuman-core/src/web3/wallet/README.md+++ b/crates/openhuman-core/src/web3/wallet/README.md@@ -118,7 +118,7 @@ None. The module publishes/subscribes no `DomainEvent`s and has no `bus.rs`. Cha- `crate::security::approval::APPROVAL_CHAT_CONTEXT` — task-local chat owner (`thread_id`/`client_id`) used to bind quotes to their originating thread.- `tinytools` — `Tool`/`ToolResult`/`ToolCallOptions` for the agent tools.- `crate::core::all` (`ControllerFuture`, `RegisteredController`) and `crate::core` (`ControllerSchema`, `FieldSchema`, `TypeSchema`) — RPC controller registry wiring.-- `crate::rpc::RpcOutcome` — standard RPC return shape.+- `crate::rpc::Outcome` — standard RPC return shape.- `tinywallet-bus` (`vendor/tinywallet/crates/tinywallet-bus`, optional, gated by the `web3` feature; features `btc`, `evm`, `solana`, `tron`, `keccak`, `net`, `wire`, `eip712`, `abi`, `tx-codec`) — the contract crate. It owns address formats (parsing/validation/conversion) and the wire types crossing the `Transport` seam (`SecretMaterial`, `TransactionSpec`, `NetworkId`), the ERC-20/EIP-712 encoders, and the Tron verifier. Per Cargo.toml's own rationale: taken as the contract crate and NOT the root `tinywallet` crate — key derivation, transaction building, signing and the chain clients (including the `bitcoin` crate and its native secp256k1 build) live inside that loaded module now, so this binary links none of it. The root `tinywallet` crate is still a dev-dependency, used only so test fixtures can derive a known account from a BIP-39 vector phrase.- Other external crates: `curve25519-dalek` (optional, pulled in by the `web3` feature; Solana off-curve ATA check), `bs58` (Solana base58 program ids/addresses), `sha2` (Solana ATA/PDA derivation), `hex`, `reqwest`, `serde`/`serde_json`, `tempfile`, `parking_lot`, `once_cell`. `k256`, `coins-bip39`, `ed25519-dalek` and the root `tinywallet` crate are test-only here (the `web3` feature does not enable `k256`/`coins-bip39`): they back the `cfg(test)` local signers in `chains/solana.rs`, `execution.rs` and the test fixtures, so unit tests can run without a loaded module.diff --git a/crates/openhuman-core/src/web3/wallet/execution/broadcast.rs b/crates/openhuman-core/src/web3/wallet/execution/broadcast.rsindex 80d19b2336..4bf6038f44 100644--- a/crates/openhuman-core/src/web3/wallet/execution/broadcast.rs+++ b/crates/openhuman-core/src/web3/wallet/execution/broadcast.rs@@ -4,7 +4,7 @@use log::warn;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::super::chains::{btc as chain_btc, evm as chain_evm, solana as chain_sol, tron as chain_tron,@@ -37,7 +37,7 @@ pub(crate) async fn sign_and_broadcast_solana(pub async fn execute_prepared(params: ExecutePreparedParams,-) -> Result<RpcOutcome<ExecutionResult>, String> {+) -> Result<Outcome<ExecutionResult>, String> {if !params.confirmed {return Err("execute_prepared requires `confirmed: true`".to_string());}@@ -84,7 +84,7 @@ pub async fn execute_prepared(if final_result.explorer_url.is_none() {final_result.explorer_url = explorer_fallback;}- Ok(RpcOutcome::new(+ Ok(Outcome::new(final_result,vec!["wallet transaction broadcast".to_string()],))diff --git a/crates/openhuman-core/src/web3/wallet/execution/queries.rs b/crates/openhuman-core/src/web3/wallet/execution/queries.rsindex 4aab7781d4..7931cc08dd 100644--- a/crates/openhuman-core/src/web3/wallet/execution/queries.rs+++ b/crates/openhuman-core/src/web3/wallet/execution/queries.rs@@ -3,7 +3,7 @@use log::{debug, warn};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::super::chains::{btc as chain_btc, evm as chain_evm, solana as chain_sol, tron as chain_tron,@@ -29,16 +29,16 @@ pub(super) fn asset_to_supported(asset: WalletAssetDefinition) -> SupportedAsset}}-pub async fn network_defaults() -> Result<RpcOutcome<Vec<WalletNetworkDefaults>>, String> {+pub async fn network_defaults() -> Result<Outcome<Vec<WalletNetworkDefaults>>, String> {let rows = default_networks();debug!("{LOG_PREFIX} network_defaults count={}", rows.len());- Ok(RpcOutcome::new(+ Ok(Outcome::new(rows,vec!["wallet network defaults listed".to_string()],))}-pub async fn supported_assets() -> Result<RpcOutcome<Vec<SupportedAsset>>, String> {+pub async fn supported_assets() -> Result<Outcome<Vec<SupportedAsset>>, String> {let mut assets: Vec<SupportedAsset> = Vec::new();for network in EvmNetwork::ALL {for asset in evm_asset_catalog(network) {@@ -51,13 +51,13 @@ pub async fn supported_assets() -> Result<RpcOutcome<Vec<SupportedAsset>>, Strin}}debug!("{LOG_PREFIX} supported_assets count={}", assets.len());- Ok(RpcOutcome::new(+ Ok(Outcome::new(assets,vec!["wallet supported_assets listed".to_string()],))}-pub async fn chain_status() -> Result<RpcOutcome<Vec<ChainStatus>>, String> {+pub async fn chain_status() -> Result<Outcome<Vec<ChainStatus>>, String> {let status = wallet_status().await?.value;let mut rows = Vec::new();for network in EvmNetwork::ALL {@@ -92,7 +92,7 @@ pub async fn chain_status() -> Result<RpcOutcome<Vec<ChainStatus>>, String> {});}debug!("{LOG_PREFIX} chain_status reported chains={}", rows.len());- Ok(RpcOutcome::new(+ Ok(Outcome::new(rows,vec!["wallet chain_status listed".to_string()],))@@ -149,7 +149,7 @@ fn evm_native_asset(network: EvmNetwork) -> Result<WalletAssetDefinition, String})}-pub async fn balances() -> Result<RpcOutcome<Vec<BalanceInfo>>, String> {+pub async fn balances() -> Result<Outcome<Vec<BalanceInfo>>, String> {let status = wallet_status().await?.value;if !status.configured {return Err(WALLET_NOT_CONFIGURED_MESSAGE.to_string());@@ -255,7 +255,7 @@ pub async fn balances() -> Result<RpcOutcome<Vec<BalanceInfo>>, String> {}}debug!("{LOG_PREFIX} balances returned rows={}", out.len());- Ok(RpcOutcome::new(+ Ok(Outcome::new(out,vec!["wallet balances listed".to_string()],))diff --git a/crates/openhuman-core/src/web3/wallet/execution/transfer.rs b/crates/openhuman-core/src/web3/wallet/execution/transfer.rsindex 5331b4cbf8..99e04337f0 100644--- a/crates/openhuman-core/src/web3/wallet/execution/transfer.rs+++ b/crates/openhuman-core/src/web3/wallet/execution/transfer.rs@@ -4,7 +4,7 @@use log::debug;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::super::defaults::{evm_asset_catalog, find_asset_for_network, EvmNetwork};use super::super::ops::WalletChain;@@ -18,7 +18,7 @@ use super::LOG_PREFIX;pub async fn prepare_transfer(params: PrepareTransferParams,-) -> Result<RpcOutcome<PreparedTransaction>, String> {+) -> Result<Outcome<PreparedTransaction>, String> {let to = validate_address(params.chain, ¶ms.to_address)?;let amount = validate_amount(¶ms.amount_raw)?;if amount == 0 {@@ -102,7 +102,7 @@ pub async fn prepare_transfer(quote.amount_raw,quote.asset_symbol);- Ok(RpcOutcome::new(+ Ok(Outcome::new(store_quote(quote),vec!["wallet transfer prepared".to_string()],))diff --git a/crates/openhuman-core/src/web3/wallet/execution/tx_lookup.rs b/crates/openhuman-core/src/web3/wallet/execution/tx_lookup.rsindex b42a0b08c5..9b7562f400 100644--- a/crates/openhuman-core/src/web3/wallet/execution/tx_lookup.rs+++ b/crates/openhuman-core/src/web3/wallet/execution/tx_lookup.rs@@ -3,7 +3,7 @@use log::debug;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::super::chains::{btc as chain_btc, evm as chain_evm, solana as chain_sol, tron as chain_tron,@@ -28,7 +28,7 @@ pub async fn tx_status(chain: WalletChain,evm_network: Option<EvmNetwork>,hash: &str,-) -> Result<RpcOutcome<TxStatusInfo>, String> {+) -> Result<Outcome<TxStatusInfo>, String> {let hash = hash.trim();if hash.is_empty() {return Err("tx hash is empty".to_string());@@ -47,7 +47,7 @@ pub async fn tx_status(hash,info.state);- Ok(RpcOutcome::new(+ Ok(Outcome::new(info,vec!["wallet tx status fetched".to_string()],))@@ -58,7 +58,7 @@ pub async fn tx_receipt(chain: WalletChain,evm_network: Option<EvmNetwork>,hash: &str,-) -> Result<RpcOutcome<TxReceiptInfo>, String> {+) -> Result<Outcome<TxReceiptInfo>, String> {let hash = hash.trim();if hash.is_empty() {return Err("tx hash is empty".to_string());@@ -77,7 +77,7 @@ pub async fn tx_receipt(hash,info.found);- Ok(RpcOutcome::new(+ Ok(Outcome::new(info,vec!["wallet tx receipt fetched".to_string()],))@@ -88,7 +88,7 @@ pub async fn lookup_tx(chain: WalletChain,evm_network: Option<EvmNetwork>,hash: &str,-) -> Result<RpcOutcome<TxLookupInfo>, String> {+) -> Result<Outcome<TxLookupInfo>, String> {let hash = hash.trim();if hash.is_empty() {return Err("tx hash is empty".to_string());@@ -107,7 +107,7 @@ pub async fn lookup_tx(hash,info.found);- Ok(RpcOutcome::new(+ Ok(Outcome::new(info,vec!["wallet tx looked up".to_string()],))diff --git a/crates/openhuman-core/src/web3/wallet/ops.rs b/crates/openhuman-core/src/web3/wallet/ops.rsindex d44eedb20a..3bff63913a 100644--- a/crates/openhuman-core/src/web3/wallet/ops.rs+++ b/crates/openhuman-core/src/web3/wallet/ops.rs@@ -17,7 +17,7 @@ pub use types::{use log::debug;use crate::config::rpc as config_rpc;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use state::{keychain_load_mnemonic, load_stored_wallet_state_unlocked, save_stored_wallet_state_unlocked,@@ -92,7 +92,7 @@ fn validate_setup(params: &WalletSetupParams) -> Result<Vec<WalletAccount>, StriOk(normalized)}-pub async fn status() -> Result<RpcOutcome<WalletStatus>, String> {+pub async fn status() -> Result<Outcome<WalletStatus>, String> {let config = config_rpc::load_config_with_timeout().await?;let _guard = WALLET_STATE_FILE_LOCK.lock();let status = to_status(&config, load_stored_wallet_state_unlocked(&config)?);@@ -104,13 +104,13 @@ pub async fn status() -> Result<RpcOutcome<WalletStatus>, String> {status.accounts.len());- Ok(RpcOutcome::new(+ Ok(Outcome::new(status,vec!["wallet status fetched".to_string()],))}-pub async fn setup(params: WalletSetupParams) -> Result<RpcOutcome<WalletStatus>, String> {+pub async fn setup(params: WalletSetupParams) -> Result<Outcome<WalletStatus>, String> {let config = config_rpc::load_config_with_timeout().await?;let accounts = validate_setup(¶ms)?;let encrypted_mnemonic = params@@ -154,7 +154,7 @@ pub async fn setup(params: WalletSetupParams) -> Result<RpcOutcome<WalletStatus>status.secret_stored);- Ok(RpcOutcome::new(+ Ok(Outcome::new(status,vec!["wallet setup saved".to_string()],))@@ -165,7 +165,7 @@ pub async fn setup(params: WalletSetupParams) -> Result<RpcOutcome<WalletStatus>/// This is a read-only operation — it never writes to disk or the keychain./// The plaintext phrase is returned only in the RPC response and must be kept/// in transient React state on the frontend; it must never be logged or persisted.-pub async fn reveal_recovery_phrase() -> Result<RpcOutcome<RevealRecoveryPhraseResult>, String> {+pub async fn reveal_recovery_phrase() -> Result<Outcome<RevealRecoveryPhraseResult>, String> {debug!("{LOG_PREFIX} reveal_recovery_phrase ENTRY");let config = config_rpc::load_config_with_timeout().await.map_err(|e| {@@ -237,7 +237,7 @@ pub async fn reveal_recovery_phrase() -> Result<RpcOutcome<RevealRecoveryPhraseRword_count);- Ok(RpcOutcome::new(+ Ok(Outcome::new(RevealRecoveryPhraseResult { phrase, word_count },vec!["recovery phrase revealed".to_string()],))diff --git a/crates/openhuman-core/src/web3/wallet/stub.rs b/crates/openhuman-core/src/web3/wallet/stub.rsindex daf3f4df31..9f25ca588b 100644--- a/crates/openhuman-core/src/web3/wallet/stub.rs+++ b/crates/openhuman-core/src/web3/wallet/stub.rs@@ -22,7 +22,7 @@ use serde::Serialize;use crate::core::all::RegisteredController;use crate::core::ControllerSchema;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;/// Error text returned by every disabled-path operation that must yield a/// `Result`. Shared so callers/log-greps see one stable string.@@ -74,9 +74,9 @@ pub(crate) struct WalletSecretMaterial {/// Disabled: no wallet is configured, so the status carries no accounts. Kept/// `Ok` (not `Err`) so wallet-signed callers degrade to the clean "run wallet setup"/// message instead of a decrypt-context error.-pub async fn status() -> Result<RpcOutcome<WalletStatus>, String> {+pub async fn status() -> Result<Outcome<WalletStatus>, String> {log::debug!("[wallet-stub] status requested (web3 disabled) — no accounts");- Ok(RpcOutcome::new(+ Ok(Outcome::new(WalletStatus::default(),vec!["wallet disabled at compile time".to_string()],))@@ -133,7 +133,7 @@ pub struct ExecutionResult {/// Disabled: no transfer can be prepared with the wallet compiled out.pub async fn prepare_transfer(_params: PrepareTransferParams,-) -> Result<RpcOutcome<PreparedTransaction>, String> {+) -> Result<Outcome<PreparedTransaction>, String> {log::debug!("[wallet-stub] prepare_transfer requested (web3 disabled) — returning disabled error");@@ -143,7 +143,7 @@ pub async fn prepare_transfer(/// Disabled: no prepared transfer can be executed with the wallet compiled out.pub async fn execute_prepared(_params: ExecutePreparedParams,-) -> Result<RpcOutcome<ExecutionResult>, String> {+) -> Result<Outcome<ExecutionResult>, String> {log::debug!("[wallet-stub] execute_prepared requested (web3 disabled) — returning disabled error");diff --git a/crates/openhuman-core/src/web_chat/ops/channel_ops.rs b/crates/openhuman-core/src/web_chat/ops/channel_ops.rsindex cdd996bd90..1e0f95fed9 100644--- a/crates/openhuman-core/src/web_chat/ops/channel_ops.rs+++ b/crates/openhuman-core/src/web_chat/ops/channel_ops.rs@@ -5,7 +5,7 @@use serde_json::{json, Value};use crate::core::socketio::WebChannelEvent;-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::super::event_bus::publish_web_channel_event;use super::super::types::ChatRequestMetadata;@@ -181,7 +181,7 @@ pub async fn channel_web_chat(queue_mode: Option<String>,run_mode: Option<String>,metadata: ChatRequestMetadata,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {// Mirrors the socket `chat:start` payload's `run_mode` handling// (`core::socketio`): apply it before starting the turn so// `plan_mode_middleware` sees the requested mode from the first tool@@ -212,10 +212,10 @@ pub async fn channel_web_chat(.await?;if let Ok(parsed) = serde_json::from_str::<Value>(&result) {- return Ok(RpcOutcome::single_log(parsed, "web channel message queued"));+ return Ok(Outcome::single_log(parsed, "web channel message queued"));}- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({"accepted": true,"client_id": client_id.trim(),@@ -239,7 +239,7 @@ fn queue_item_json(})}-pub async fn channel_web_queue_status(thread_id: &str) -> Result<RpcOutcome<Value>, String> {+pub async fn channel_web_queue_status(thread_id: &str) -> Result<Outcome<Value>, String> {let map_key = key_for(thread_id);let in_flight = IN_FLIGHT.lock().await;if let Some(entry) = in_flight.get(&map_key) {@@ -251,7 +251,7 @@ pub async fn channel_web_queue_status(thread_id: &str) -> Result<RpcOutcome<Valu.iter().map(|(lane, item)| queue_item_json(*lane, item)).collect();- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({"thread_id": thread_id.trim(),"active": true,@@ -265,7 +265,7 @@ pub async fn channel_web_queue_status(thread_id: &str) -> Result<RpcOutcome<Valu"queue status retrieved",))} else {- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({"thread_id": thread_id.trim(),"active": false,@@ -289,7 +289,7 @@ pub async fn channel_web_queue_remove(client_id: &str,thread_id: &str,item_id: &str,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let client_id = client_id.trim();let thread_id = thread_id.trim();let item_id = item_id.trim();@@ -299,7 +299,7 @@ pub async fn channel_web_queue_remove(let map_key = key_for(thread_id);let in_flight = IN_FLIGHT.lock().await;let Some(entry) = in_flight.get(&map_key) else {- return Ok(RpcOutcome::single_log(+ return Ok(Outcome::single_log(json!({"thread_id": thread_id,"item_id": item_id,@@ -327,7 +327,7 @@ pub async fn channel_web_queue_remove(..Default::default()});}- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({"thread_id": thread_id,"item_id": item_id,@@ -337,7 +337,7 @@ pub async fn channel_web_queue_remove())}-pub async fn channel_web_queue_clear(thread_id: &str) -> Result<RpcOutcome<Value>, String> {+pub async fn channel_web_queue_clear(thread_id: &str) -> Result<Outcome<Value>, String> {let map_key = key_for(thread_id);let in_flight = IN_FLIGHT.lock().await;if let Some(entry) = in_flight.get(&map_key) {@@ -347,7 +347,7 @@ pub async fn channel_web_queue_clear(thread_id: &str) -> Result<RpcOutcome<Valuethread_id,dropped);- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({"thread_id": thread_id.trim(),"cleared": true,@@ -356,7 +356,7 @@ pub async fn channel_web_queue_clear(thread_id: &str) -> Result<RpcOutcome<Value"queue cleared",))} else {- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({"thread_id": thread_id.trim(),"cleared": false,@@ -371,7 +371,7 @@ pub async fn channel_web_cancel(client_id: &str,thread_id: &str,request_id: Option<&str>,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let outcome = cancel_chat_inner(client_id, thread_id, request_id).await?;// `request_id` is set only when a turn was torn down, and only then does a@@ -379,7 +379,7 @@ pub async fn channel_web_cancel(// no terminal event is coming and must settle its own running state.let cancelled = outcome.request_id.is_some() || outcome.subagents_cancelled > 0;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(json!({"cancelled": cancelled,"client_id": client_id.trim(),diff --git a/crates/openhuman-core/src/web_chat/schemas.rs b/crates/openhuman-core/src/web_chat/schemas.rsindex 269fd616a8..efc5b5fc42 100644--- a/crates/openhuman-core/src/web_chat/schemas.rs+++ b/crates/openhuman-core/src/web_chat/schemas.rs@@ -6,7 +6,7 @@ use serde_json::{Map, Value};use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-use crate::rpc::RpcOutcome;+use crate::core::Outcome;use super::ops::{channel_web_cancel, channel_web_chat, channel_web_queue_clear, channel_web_queue_remove,@@ -265,6 +265,6 @@ pub(crate) fn json_output(name: &'static str, comment: &'static str) -> FieldSch}}-fn to_json<T: serde::Serialize>(outcome: RpcOutcome<T>) -> Result<Value, String> {+fn to_json<T: serde::Serialize>(outcome: Outcome<T>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-embed/README.md b/crates/openhuman-embed/README.mdindex 3cca3715d9..40aaa1d40d 100644--- a/crates/openhuman-embed/README.md+++ b/crates/openhuman-embed/README.md@@ -320,7 +320,7 @@ time. Run them with `cargo test -p openhuman-embed --features inference,mcp,skilIts only in-repo dependency is `openhuman-core` (package `openhuman`) with`default-features = false` — every capability comes from a feature forwardedabove. It does not depend on `openhuman-rpc` directly; the shared-`RpcOutcome` and `StructuredRpcError` types reach it through+`Outcome` and `StructuredRpcError` types reach it through`openhuman_core::rpc`. `openhuman-app` and `openhuman-tui` depend on`openhuman-rpc` for its HTTP client and on `openhuman-core`; neither uses`openhuman-embed`.diff --git a/crates/openhuman-embed/src/call.rs b/crates/openhuman-embed/src/call.rsindex 57a1bcd651..d517bae4b1 100644--- a/crates/openhuman-embed/src/call.rs+++ b/crates/openhuman-embed/src/call.rs@@ -22,7 +22,7 @@//! # The response envelope//!//! Controller handlers serialize through-//! [`RpcOutcome::into_cli_compatible_json`](openhuman_core::rpc::RpcOutcome), which emits+//! [`Outcome::into_cli_compatible_json`](openhuman_core::core::Outcome), which emits//! a **variable shape**://!//! - no logs → the value itselfdiff --git a/crates/openhuman-embed/src/error.rs b/crates/openhuman-embed/src/error.rsindex 31dde37ddd..7aa15f9fc7 100644--- a/crates/openhuman-embed/src/error.rs+++ b/crates/openhuman-embed/src/error.rs@@ -21,7 +21,7 @@//! scary red error where it should simply hide a tab.use openhuman_core::core::dispatch::UNKNOWN_METHOD_PREFIX;-use openhuman_core::rpc::StructuredRpcError;+use openhuman_core::core::StructuredRpcError;/// Error returned by every typed facade call.#[derive(Debug, thiserror::Error)]diff --git a/crates/openhuman-tinyhumans/src/hosted/announcements/README.md b/crates/openhuman-tinyhumans/src/hosted/announcements/README.mdindex 38ef998774..744784aacc 100644--- a/crates/openhuman-tinyhumans/src/hosted/announcements/README.md+++ b/crates/openhuman-tinyhumans/src/hosted/announcements/README.md@@ -52,7 +52,7 @@ anything. Dismissal is tracked client-side by announcement idcall.- `crate::api::flatten_authed_error` — flattens any non-404 backend/sessionerror for the RPC caller.-- `crate::rpc::RpcOutcome` (re-export of `openhuman_rpc`) — return wrapper+- `crate::rpc::Outcome` (re-export of `openhuman_rpc`) — return wrappercarrying value + log line.## Gatingdiff --git a/crates/openhuman-tinyhumans/src/hosted/announcements/ops.rs b/crates/openhuman-tinyhumans/src/hosted/announcements/ops.rsindex 0f01bdf7be..c4ec0020c4 100644--- a/crates/openhuman-tinyhumans/src/hosted/announcements/ops.rs+++ b/crates/openhuman-tinyhumans/src/hosted/announcements/ops.rs@@ -12,7 +12,7 @@ use serde_json::Value;use openhuman_core::api::config::effective_backend_api_url;use openhuman_core::api::{BackendApiError, BackendOAuthClient};use openhuman_core::config::Config;-use openhuman_core::rpc::RpcOutcome;+use openhuman_core::core::Outcome;/// Canonical authed-session guard — rejects an expired token locally instead of/// firing a doomed backend 401 (see `billing/ops.rs` / #3297).@@ -42,7 +42,7 @@ fn is_announcement_not_found(err: &anyhow::Error) -> bool {/// flooded Sentry with no actionable signal (TAURI-RUST-HW0, TAURI-RUST-KHX)./// Any other error (5xx, malformed response, session expiry, …) still/// propagates via `flatten_authed_error` and still reaches Sentry.-pub async fn get_latest_announcement(config: &Config) -> Result<RpcOutcome<Value>, String> {+pub async fn get_latest_announcement(config: &Config) -> Result<Outcome<Value>, String> {let token = require_token(config)?;let api_url = effective_backend_api_url(&config.api_url);let client = BackendOAuthClient::new(&api_url).map_err(|e| e.to_string())?;@@ -51,8 +51,8 @@ pub async fn get_latest_announcement(config: &Config) -> Result<RpcOutcome<Value.authed_json(&token, Method::GET, "/announcements/latest", None).await{- Ok(data) => Ok(RpcOutcome::single_log(data, "latest announcement fetched")),- Err(err) if is_announcement_not_found(&err) => Ok(RpcOutcome::single_log(+ Ok(data) => Ok(Outcome::single_log(data, "latest announcement fetched")),+ Err(err) if is_announcement_not_found(&err) => Ok(Outcome::single_log(Value::Null,"no announcement available (404)",)),diff --git a/crates/openhuman-tinyhumans/src/hosted/announcements/schemas.rs b/crates/openhuman-tinyhumans/src/hosted/announcements/schemas.rsindex bdb08bfce6..bb0f50be7c 100644--- a/crates/openhuman-tinyhumans/src/hosted/announcements/schemas.rs+++ b/crates/openhuman-tinyhumans/src/hosted/announcements/schemas.rs@@ -3,7 +3,7 @@ use serde_json::{Map, Value};use openhuman_core::config::rpc as config_rpc;use openhuman_core::core::all::{ControllerFuture, RegisteredController};use openhuman_core::core::{ControllerSchema, FieldSchema, TypeSchema};-use openhuman_core::rpc::RpcOutcome;+use openhuman_core::core::Outcome;pub fn all_announcements_controller_schemas() -> Vec<ControllerSchema> {vec![announcements_schemas("announcements_get_latest")]@@ -50,7 +50,7 @@ fn handle_announcements_get_latest(_params: Map<String, Value>) -> ControllerFut})}-fn to_json(outcome: RpcOutcome<Value>) -> Result<Value, String> {+fn to_json(outcome: Outcome<Value>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-tinyhumans/src/hosted/billing/README.md b/crates/openhuman-tinyhumans/src/hosted/billing/README.mdindex 7cfcd1fd2c..3b0620cfab 100644--- a/crates/openhuman-tinyhumans/src/hosted/billing/README.md+++ b/crates/openhuman-tinyhumans/src/hosted/billing/README.md@@ -17,7 +17,7 @@ Thin RPC adapter domain over the hosted backend's payment API. It exposes plan l| File | Role || --- | --- || `crates/openhuman-tinyhumans/src/hosted/billing/mod.rs` | Export-focused module root; re-exports `ops::*` and the schemas/controllers pair. |-| `crates/openhuman-tinyhumans/src/hosted/billing/ops.rs` | Business logic: one async fn per backend endpoint; auth helper (`require_token`, `get_authed_value`); input validation + gateway normalization. Returns `RpcOutcome<Value>`. |+| `crates/openhuman-tinyhumans/src/hosted/billing/ops.rs` | Business logic: one async fn per backend endpoint; auth helper (`require_token`, `get_authed_value`); input validation + gateway normalization. Returns `Outcome<Value>`. || `crates/openhuman-tinyhumans/src/hosted/billing/schemas.rs` | Controller schemas, `all_billing_controller_schemas` / `all_billing_registered_controllers`, param structs, and `handle_billing_*` handlers delegating to `ops`. || `crates/openhuman-tinyhumans/src/hosted/billing/schemas_tests.rs` | Sibling test suite for `schemas.rs` (wired via `#[path]` mod). |@@ -25,7 +25,7 @@ Thin RPC adapter domain over the hosted backend's payment API. It exposes plan lFrom `mod.rs`:-- `ops::*` — async handlers: `get_summary`, `get_current_plan`, `get_balance`, `get_transactions`, `get_auto_recharge`, `update_auto_recharge`, `get_cards`, `create_setup_intent`, `update_card`, `delete_card`, `purchase_plan`, `create_portal_session`, `top_up_credits`, `create_coinbase_charge`, `redeem_coupon`, `get_user_coupons`. Each takes `&Config` (plus typed params) and returns `Result<RpcOutcome<Value>, String>`.+- `ops::*` — async handlers: `get_summary`, `get_current_plan`, `get_balance`, `get_transactions`, `get_auto_recharge`, `update_auto_recharge`, `get_cards`, `create_setup_intent`, `update_card`, `delete_card`, `purchase_plan`, `create_portal_session`, `top_up_credits`, `create_coinbase_charge`, `redeem_coupon`, `get_user_coupons`. Each takes `&Config` (plus typed params) and returns `Result<Outcome<Value>, String>`.- `all_billing_controller_schemas()`, `all_billing_registered_controllers()`, `billing_schemas(function: &str)` — registry wiring.## RPC / controllers@@ -51,7 +51,7 @@ Namespace `billing` (16 methods, exposed as `openhuman.billing_*`):| `billing_redeem_coupon` | `POST /coupons/redeem` || `billing_get_coupons` | `GET /coupons/me` |-Handlers load `Config` via `config::rpc::load_config_with_timeout()`, deserialize camelCase params, call the matching `ops` fn, and emit CLI-compatible JSON via `RpcOutcome::into_cli_compatible_json()`.+Handlers load `Config` via `config::rpc::load_config_with_timeout()`, deserialize camelCase params, call the matching `ops` fn, and emit CLI-compatible JSON via `Outcome::into_cli_compatible_json()`.## Agent tools@@ -71,7 +71,7 @@ None of its own; stateless adapter. The only state it reads is the backend sessi- `crate::api::jwt::get_session_token` — reads the stored app-session JWT.- `crate::api::BackendOAuthClient` — performs the authenticated JSON HTTP request (`authed_json`).- `crate::config::Config` — config struct (`api_url`); `config::rpc::load_config_with_timeout` in handlers.-- `crate::rpc::RpcOutcome` — standard RPC return/logging wrapper.+- `crate::rpc::Outcome` — standard RPC return/logging wrapper.- `crate::core::all::{ControllerFuture, RegisteredController}` and `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` — controller registry types.- External crates: `reqwest` (`Method`), `serde`/`serde_json`, `urlencoding` (path-segment encoding for `paymentMethodId`).diff --git a/crates/openhuman-tinyhumans/src/hosted/billing/ops.rs b/crates/openhuman-tinyhumans/src/hosted/billing/ops.rsindex 9e69c0e8d9..6e73cd1bd7 100644--- a/crates/openhuman-tinyhumans/src/hosted/billing/ops.rs+++ b/crates/openhuman-tinyhumans/src/hosted/billing/ops.rs@@ -16,7 +16,7 @@ use serde_json::{json, Value};use openhuman_core::api::config::effective_backend_api_url;use openhuman_core::api::BackendOAuthClient;use openhuman_core::config::Config;-use openhuman_core::rpc::RpcOutcome;+use openhuman_core::core::Outcome;/// Canonical authed-session guard. Delegates to `require_live_session_token`,/// which rejects an expired token locally (publishing `SessionExpired`) instead@@ -47,15 +47,15 @@ async fn get_authed_value(.map_err(openhuman_core::api::flatten_authed_error)}-pub async fn get_current_plan(config: &Config) -> Result<RpcOutcome<Value>, String> {+pub async fn get_current_plan(config: &Config) -> Result<Outcome<Value>, String> {let data = get_authed_value(config, Method::GET, "/payments/stripe/currentPlan", None).await?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(data,"current plan fetched from backend",))}-pub async fn get_summary(config: &Config) -> Result<RpcOutcome<Value>, String> {+pub async fn get_summary(config: &Config) -> Result<Outcome<Value>, String> {let token = require_token(config)?;let api_url = effective_backend_api_url(&config.api_url);let client = BackendOAuthClient::new(&api_url).map_err(|e| e.to_string())?;@@ -63,30 +63,30 @@ pub async fn get_summary(config: &Config) -> Result<RpcOutcome<Value>, String> {.fetch_billing_summary(&token).await.map_err(openhuman_core::api::flatten_authed_error)?;- Ok(RpcOutcome::single_log(data, "billing summary fetched"))+ Ok(Outcome::single_log(data, "billing summary fetched"))}-pub async fn get_balance(config: &Config) -> Result<RpcOutcome<Value>, String> {+pub async fn get_balance(config: &Config) -> Result<Outcome<Value>, String> {let data = get_authed_value(config, Method::GET, "/payments/credits/balance", None).await?;- Ok(RpcOutcome::single_log(data, "credit balance fetched"))+ Ok(Outcome::single_log(data, "credit balance fetched"))}pub async fn get_transactions(config: &Config,limit: Option<u64>,offset: Option<u64>,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let limit = limit.unwrap_or(20);let offset = offset.unwrap_or(0);let path = format!("/payments/credits/transactions?limit={limit}&offset={offset}");let data = get_authed_value(config, Method::GET, &path, None).await?;- Ok(RpcOutcome::single_log(data, "credit transactions fetched"))+ Ok(Outcome::single_log(data, "credit transactions fetched"))}-pub async fn get_auto_recharge(config: &Config) -> Result<RpcOutcome<Value>, String> {+pub async fn get_auto_recharge(config: &Config) -> Result<Outcome<Value>, String> {let data =get_authed_value(config, Method::GET, "/payments/credits/auto-recharge", None).await?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(data,"auto recharge settings fetched",))@@ -95,7 +95,7 @@ pub async fn get_auto_recharge(config: &Config) -> Result<RpcOutcome<Value>, Strpub async fn update_auto_recharge(config: &Config,payload: Value,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let data = get_authed_value(config,Method::PATCH,@@ -103,13 +103,13 @@ pub async fn update_auto_recharge(Some(payload),).await?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(data,"auto recharge settings updated",))}-pub async fn get_cards(config: &Config) -> Result<RpcOutcome<Value>, String> {+pub async fn get_cards(config: &Config) -> Result<Outcome<Value>, String> {let data = get_authed_value(config,Method::GET,@@ -117,10 +117,10 @@ pub async fn get_cards(config: &Config) -> Result<RpcOutcome<Value>, String> {None,).await?;- Ok(RpcOutcome::single_log(data, "saved cards fetched"))+ Ok(Outcome::single_log(data, "saved cards fetched"))}-pub async fn create_setup_intent(config: &Config) -> Result<RpcOutcome<Value>, String> {+pub async fn create_setup_intent(config: &Config) -> Result<Outcome<Value>, String> {let data = get_authed_value(config,Method::POST,@@ -128,14 +128,14 @@ pub async fn create_setup_intent(config: &Config) -> Result<RpcOutcome<Value>, SNone,).await?;- Ok(RpcOutcome::single_log(data, "setup intent created"))+ Ok(Outcome::single_log(data, "setup intent created"))}pub async fn update_card(config: &Config,payment_method_id: &str,payload: Value,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let payment_method_id = payment_method_id.trim();if payment_method_id.is_empty() {return Err("paymentMethodId is required".to_string());@@ -145,13 +145,13 @@ pub async fn update_card(urlencoding::encode(payment_method_id));let data = get_authed_value(config, Method::PATCH, &path, Some(payload)).await?;- Ok(RpcOutcome::single_log(data, "saved card updated"))+ Ok(Outcome::single_log(data, "saved card updated"))}pub async fn delete_card(config: &Config,payment_method_id: &str,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let payment_method_id = payment_method_id.trim();if payment_method_id.is_empty() {return Err("paymentMethodId is required".to_string());@@ -161,7 +161,7 @@ pub async fn delete_card(urlencoding::encode(payment_method_id));let data = get_authed_value(config, Method::DELETE, &path, None).await?;- Ok(RpcOutcome::single_log(data, "saved card deleted"))+ Ok(Outcome::single_log(data, "saved card deleted"))}#[derive(Debug, Serialize)]@@ -170,7 +170,7 @@ struct PurchasePlanBody<'a> {plan: &'a str,}-pub async fn purchase_plan(config: &Config, plan: &str) -> Result<RpcOutcome<Value>, String> {+pub async fn purchase_plan(config: &Config, plan: &str) -> Result<Outcome<Value>, String> {let plan = plan.trim();if plan.is_empty() {return Err("plan is required".to_string());@@ -185,15 +185,15 @@ pub async fn purchase_plan(config: &Config, plan: &str) -> Result<RpcOutcome<Val).await?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(data,"plan purchase session created",))}-pub async fn create_portal_session(config: &Config) -> Result<RpcOutcome<Value>, String> {+pub async fn create_portal_session(config: &Config) -> Result<Outcome<Value>, String> {let data = get_authed_value(config, Method::POST, "/payments/stripe/portal", None).await?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(data,"customer portal session created",))@@ -230,7 +230,7 @@ pub async fn top_up_credits(config: &Config,amount_usd: f64,gateway: Option<String>,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {if !amount_usd.is_finite() || amount_usd <= 0.0 {return Err("amountUsd must be a finite number greater than 0".to_string());}@@ -249,7 +249,7 @@ pub async fn top_up_credits().await?;- Ok(RpcOutcome::single_log(data, "credit top-up initiated"))+ Ok(Outcome::single_log(data, "credit top-up initiated"))}#[derive(Debug, Serialize)]@@ -265,7 +265,7 @@ pub async fn create_coinbase_charge(config: &Config,plan: &str,interval: Option<String>,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let plan = plan.trim();if plan.is_empty() {return Err("plan is required".to_string());@@ -290,7 +290,7 @@ pub async fn create_coinbase_charge().await?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(data,"Coinbase payment link created",))@@ -305,7 +305,7 @@ struct RedeemCouponBody<'a> {/// Redeem a coupon code to add credits to the user's account./// Maps to `POST /coupons/redeem`.-pub async fn redeem_coupon(config: &Config, code: &str) -> Result<RpcOutcome<Value>, String> {+pub async fn redeem_coupon(config: &Config, code: &str) -> Result<Outcome<Value>, String> {let code = code.trim();if code.is_empty() {return Err("code is required".to_string());@@ -314,14 +314,14 @@ pub async fn redeem_coupon(config: &Config, code: &str) -> Result<RpcOutcome<Vallet body = json!(RedeemCouponBody { code });let data = get_authed_value(config, Method::POST, "/coupons/redeem", Some(body)).await?;- Ok(RpcOutcome::single_log(data, "coupon redeemed"))+ Ok(Outcome::single_log(data, "coupon redeemed"))}/// List coupons redeemed by the current user./// Maps to `GET /coupons/me`.-pub async fn get_user_coupons(config: &Config) -> Result<RpcOutcome<Value>, String> {+pub async fn get_user_coupons(config: &Config) -> Result<Outcome<Value>, String> {let data = get_authed_value(config, Method::GET, "/coupons/me", None).await?;- Ok(RpcOutcome::single_log(data, "user coupons fetched"))+ Ok(Outcome::single_log(data, "user coupons fetched"))}#[cfg(test)]diff --git a/crates/openhuman-tinyhumans/src/hosted/billing/schemas.rs b/crates/openhuman-tinyhumans/src/hosted/billing/schemas.rsindex 3cf057dd3c..f122ec8dc2 100644--- a/crates/openhuman-tinyhumans/src/hosted/billing/schemas.rs+++ b/crates/openhuman-tinyhumans/src/hosted/billing/schemas.rs@@ -5,7 +5,7 @@ use serde_json::{Map, Value};use openhuman_core::config::rpc as config_rpc;use openhuman_core::core::all::{ControllerFuture, RegisteredController};use openhuman_core::core::{ControllerSchema, FieldSchema, TypeSchema};-use openhuman_core::rpc::RpcOutcome;+use openhuman_core::core::Outcome;#[derive(Debug, Deserialize)]#[serde(rename_all = "camelCase")]@@ -539,7 +539,7 @@ fn handle_billing_get_coupons(_params: Map<String, Value>) -> ControllerFuture {})}-fn to_json(outcome: RpcOutcome<Value>) -> Result<Value, String> {+fn to_json(outcome: Outcome<Value>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-tinyhumans/src/hosted/referral/README.md b/crates/openhuman-tinyhumans/src/hosted/referral/README.mdindex 2d77541fad..29ca1e558d 100644--- a/crates/openhuman-tinyhumans/src/hosted/referral/README.md+++ b/crates/openhuman-tinyhumans/src/hosted/referral/README.md@@ -8,7 +8,7 @@ Thin RPC adapter domain for the referral program. It does **not** own any busine- Claim a referral code for the current user via `POST /referral/claim`, with an optional device fingerprint for abuse signals.- Resolve and require a backend session token before any call; fail closed with a clear error when no token is stored.- Trim the referral `code`; trim and drop whitespace-only `deviceFingerprint` before forwarding.-- Wrap backend responses in `RpcOutcome<Value>` with grep-friendly log lines.+- Wrap backend responses in `Outcome<Value>` with grep-friendly log lines.## Key files@@ -22,8 +22,8 @@ Thin RPC adapter domain for the referral program. It does **not** own any busineFrom `mod.rs` re-exports:-- `get_stats(config: &Config) -> Result<RpcOutcome<Value>, String>` (via `ops::*`).-- `claim_referral(config: &Config, code: &str, device_fingerprint: Option<&str>) -> Result<RpcOutcome<Value>, String>` (via `ops::*`).+- `get_stats(config: &Config) -> Result<Outcome<Value>, String>` (via `ops::*`).+- `claim_referral(config: &Config, code: &str, device_fingerprint: Option<&str>) -> Result<Outcome<Value>, String>` (via `ops::*`).- `all_referral_controller_schemas() -> Vec<ControllerSchema>`.- `all_referral_registered_controllers() -> Vec<RegisteredController>`.- `referral_schemas(function: &str) -> ControllerSchema`.@@ -39,7 +39,7 @@ Two controllers in the `referral` namespace, registered into the global registry| `referral_get_stats` (`referral.get_stats`) | none | `stats` (JSON) | `GET /referral/stats` || `referral_claim` (`referral.claim`) | `code` (string, required), `deviceFingerprint` (string, optional) | `result` (JSON) | `POST /referral/claim` |-An unrecognized `function` name returns an `unknown` placeholder schema with an `error` output. Handlers load `Config` via `config_rpc::load_config_with_timeout()` and return CLI-compatible JSON through `RpcOutcome::into_cli_compatible_json()`.+An unrecognized `function` name returns an `unknown` placeholder schema with an `error` output. Handlers load `Config` via `config_rpc::load_config_with_timeout()` and return CLI-compatible JSON through `Outcome::into_cli_compatible_json()`.## Persistence@@ -52,7 +52,7 @@ None of its own. The domain is stateless — it reads the backend session token- `crate::api::BackendOAuthClient` — issues authenticated JSON requests (`authed_json`) to the backend.- `crate::config::Config` — config struct passed into ops; `config::rpc::load_config_with_timeout` is used by the schema handlers.- `crate::core::all::{ControllerFuture, RegisteredController}` and `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` — controller registry types.-- `crate::rpc::RpcOutcome` — return wrapper carrying value + logs.+- `crate::rpc::Outcome` — return wrapper carrying value + logs.- Test-only: `crate::security::credentials::{AuthService, APP_SESSION_PROVIDER, DEFAULT_AUTH_PROFILE_NAME}` for seeding session tokens in unit tests.## Used bydiff --git a/crates/openhuman-tinyhumans/src/hosted/referral/ops.rs b/crates/openhuman-tinyhumans/src/hosted/referral/ops.rsindex 0cfc079978..7998dee6a4 100644--- a/crates/openhuman-tinyhumans/src/hosted/referral/ops.rs+++ b/crates/openhuman-tinyhumans/src/hosted/referral/ops.rs@@ -10,7 +10,7 @@ use openhuman_core::api::config::effective_backend_api_url;use openhuman_core::api::jwt::get_session_token;use openhuman_core::api::BackendOAuthClient;use openhuman_core::config::Config;-use openhuman_core::rpc::RpcOutcome;+use openhuman_core::core::Outcome;fn require_token(config: &Config) -> Result<String, String> {get_session_token(config)?@@ -25,7 +25,7 @@ fn require_token(config: &Config) -> Result<String, String> {.ok_or_else(|| "no backend session token; run auth_store_session first".to_string())}-pub async fn get_stats(config: &Config) -> Result<RpcOutcome<Value>, String> {+pub async fn get_stats(config: &Config) -> Result<Outcome<Value>, String> {let token = require_token(config)?;let api_url = effective_backend_api_url(&config.api_url);let client = BackendOAuthClient::new(&api_url).map_err(|e| e.to_string())?;@@ -33,7 +33,7 @@ pub async fn get_stats(config: &Config) -> Result<RpcOutcome<Value>, String> {.authed_json(&token, Method::GET, "/referral/stats", None).await.map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(data,"referral stats fetched from backend GET /referral/stats",))@@ -43,7 +43,7 @@ pub async fn claim_referral(config: &Config,code: &str,device_fingerprint: Option<&str>,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let token = require_token(config)?;let api_url = effective_backend_api_url(&config.api_url);let client = BackendOAuthClient::new(&api_url).map_err(|e| e.to_string())?;@@ -64,7 +64,7 @@ pub async fn claim_referral(.await.map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(data,"referral claim accepted by backend POST /referral/claim",))diff --git a/crates/openhuman-tinyhumans/src/hosted/referral/schemas.rs b/crates/openhuman-tinyhumans/src/hosted/referral/schemas.rsindex d8aebc9190..226a1c5455 100644--- a/crates/openhuman-tinyhumans/src/hosted/referral/schemas.rs+++ b/crates/openhuman-tinyhumans/src/hosted/referral/schemas.rs@@ -5,7 +5,7 @@ use serde_json::{Map, Value};use openhuman_core::config::rpc as config_rpc;use openhuman_core::core::all::{ControllerFuture, RegisteredController};use openhuman_core::core::{ControllerSchema, FieldSchema, TypeSchema};-use openhuman_core::rpc::RpcOutcome;+use openhuman_core::core::Outcome;#[derive(Debug, Deserialize)]#[serde(rename_all = "camelCase")]@@ -107,7 +107,7 @@ fn handle_referral_claim(params: Map<String, Value>) -> ControllerFuture {})}-fn to_json(outcome: RpcOutcome<Value>) -> Result<Value, String> {+fn to_json(outcome: Outcome<Value>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-tinyhumans/src/hosted/referral/schemas_tests.rs b/crates/openhuman-tinyhumans/src/hosted/referral/schemas_tests.rsindex eaac653315..1c5df877ee 100644--- a/crates/openhuman-tinyhumans/src/hosted/referral/schemas_tests.rs+++ b/crates/openhuman-tinyhumans/src/hosted/referral/schemas_tests.rs@@ -86,6 +86,6 @@ fn json_output_builds_required_json_field() {#[test]fn to_json_wraps_result_and_logs() {- let v = to_json(RpcOutcome::single_log(json!({"ok": true}), "log")).unwrap();+ let v = to_json(Outcome::single_log(json!({"ok": true}), "log")).unwrap();assert!(v.get("result").is_some() || v.get("logs").is_some());}diff --git a/crates/openhuman-tinyhumans/src/hosted/team/README.md b/crates/openhuman-tinyhumans/src/hosted/team/README.mdindex bd3bcb6417..695525b9ee 100644--- a/crates/openhuman-tinyhumans/src/hosted/team/README.md+++ b/crates/openhuman-tinyhumans/src/hosted/team/README.md@@ -17,7 +17,7 @@ Team management RPC adapters. This domain is a **thin proxy to the hosted backen| File | Role || --- | --- || `crates/openhuman-tinyhumans/src/hosted/team/mod.rs` | Export-only: declares `ops`/`schemas`, re-exports all ops fns and the controller-schema pair. |-| `crates/openhuman-tinyhumans/src/hosted/team/ops.rs` | Business logic — async fns that build a path, attach the session JWT, call the backend, and wrap the response in `RpcOutcome::single_log`. Contains URL-path builder + id-normalization helpers and their unit tests. |+| `crates/openhuman-tinyhumans/src/hosted/team/ops.rs` | Business logic — async fns that build a path, attach the session JWT, call the backend, and wrap the response in `Outcome::single_log`. Contains URL-path builder + id-normalization helpers and their unit tests. || `crates/openhuman-tinyhumans/src/hosted/team/schemas.rs` | Controller schemas (`all_team_controller_schemas`, `all_team_registered_controllers`, `team_schemas`), param structs, and `handle_*` adapters that load config, deserialize params, and delegate to `ops`. || `crates/openhuman-tinyhumans/src/hosted/team/schemas_tests.rs` | Sibling test module for `schemas.rs` (wired via `#[path]`). |@@ -25,7 +25,7 @@ Team management RPC adapters. This domain is a **thin proxy to the hosted backenRe-exported from `mod.rs`:-- **Ops (all `async fn(... ) -> Result<RpcOutcome<Value>, String>`):** `get_usage` (re-exported from `integrations::client::budget_gate`, which owns the `/teams/me/usage` probe, its failure backoff and the managed-tool budget gate — the integrations client is its main consumer), `list_members`, `list_teams`, `get_team`, `create_team`, `update_team`, `delete_team`, `switch_team`, `leave_team`, `join_team`, `create_invite`, `remove_member`, `change_member_role`, `list_invites`, `revoke_invite`.+- **Ops (all `async fn(... ) -> Result<Outcome<Value>, String>`):** `get_usage` (re-exported from `integrations::client::budget_gate`, which owns the `/teams/me/usage` probe, its failure backoff and the managed-tool budget gate — the integrations client is its main consumer), `list_members`, `list_teams`, `get_team`, `create_team`, `update_team`, `delete_team`, `switch_team`, `leave_team`, `join_team`, `create_invite`, `remove_member`, `change_member_role`, `list_invites`, `revoke_invite`.- **Schemas:** `all_team_controller_schemas`, `all_team_registered_controllers`, `team_schemas`.Internal helpers in `ops.rs` (`require_token`, `normalize_id`, `build_api_path`, `get_authed_value`) are private.@@ -73,7 +73,7 @@ None local. State lives in the hosted backend. The only stored value it reads is- `crate::api::BackendOAuthClient` — HTTP client; `authed_json(token, method, path, body)` performs the authed call.- `crate::config::Config` — config passed into every op; `config::rpc::load_config_with_timeout` loads it inside each `handle_*`.- `crate::core::all::{ControllerFuture, RegisteredController}` and `crate::core::{ControllerSchema, FieldSchema, TypeSchema}` — controller registry types.-- `crate::rpc::RpcOutcome` — return wrapper (`single_log`).+- `crate::rpc::Outcome` — return wrapper (`single_log`).- `reqwest` (`Method`, `Url`) for HTTP + path building; `serde` / `serde_json` for params and bodies.## Used bydiff --git a/crates/openhuman-tinyhumans/src/hosted/team/ops.rs b/crates/openhuman-tinyhumans/src/hosted/team/ops.rsindex 5102cf1a2a..5a084f26d7 100644--- a/crates/openhuman-tinyhumans/src/hosted/team/ops.rs+++ b/crates/openhuman-tinyhumans/src/hosted/team/ops.rs@@ -16,7 +16,7 @@ use serde_json::{json, Value};use openhuman_core::api::config::effective_backend_api_url;use openhuman_core::api::BackendOAuthClient;use openhuman_core::config::Config;-use openhuman_core::rpc::RpcOutcome;+use openhuman_core::core::Outcome;/// Canonical authed-session guard. Delegates to `require_live_session_token`,/// which rejects an expired token locally (publishing `SessionExpired`) instead@@ -79,26 +79,26 @@ async fn get_authed_value(.map_err(openhuman_core::api::flatten_authed_error)}-pub async fn list_members(config: &Config, team_id: &str) -> Result<RpcOutcome<Value>, String> {+pub async fn list_members(config: &Config, team_id: &str) -> Result<Outcome<Value>, String> {let team_id = normalize_id(team_id, "teamId")?;let path = build_api_path(&["teams", &team_id, "members"])?;let data = get_authed_value(config, Method::GET, &path, None).await?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(data,"team members fetched from backend",))}-pub async fn list_teams(config: &Config) -> Result<RpcOutcome<Value>, String> {+pub async fn list_teams(config: &Config) -> Result<Outcome<Value>, String> {let data = get_authed_value(config, Method::GET, "/teams", None).await?;- Ok(RpcOutcome::single_log(data, "teams fetched from backend"))+ Ok(Outcome::single_log(data, "teams fetched from backend"))}-pub async fn get_team(config: &Config, team_id: &str) -> Result<RpcOutcome<Value>, String> {+pub async fn get_team(config: &Config, team_id: &str) -> Result<Outcome<Value>, String> {let team_id = normalize_id(team_id, "teamId")?;let path = build_api_path(&["teams", &team_id])?;let data = get_authed_value(config, Method::GET, &path, None).await?;- Ok(RpcOutcome::single_log(data, "team fetched from backend"))+ Ok(Outcome::single_log(data, "team fetched from backend"))}#[derive(Debug, Serialize)]@@ -106,7 +106,7 @@ struct TeamNameBody<'a> {name: &'a str,}-pub async fn create_team(config: &Config, name: &str) -> Result<RpcOutcome<Value>, String> {+pub async fn create_team(config: &Config, name: &str) -> Result<Outcome<Value>, String> {let trimmed = name.trim();if trimmed.is_empty() {return Err("name is required".to_string());@@ -118,14 +118,14 @@ pub async fn create_team(config: &Config, name: &str) -> Result<RpcOutcome<ValueSome(json!(TeamNameBody { name: trimmed })),).await?;- Ok(RpcOutcome::single_log(data, "team created via backend"))+ Ok(Outcome::single_log(data, "team created via backend"))}pub async fn update_team(config: &Config,team_id: &str,name: Option<&str>,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let team_id = normalize_id(team_id, "teamId")?;let path = build_api_path(&["teams", &team_id])?;let mut body = serde_json::Map::new();@@ -133,34 +133,34 @@ pub async fn update_team(body.insert("name".to_string(), Value::String(name.to_string()));}let data = get_authed_value(config, Method::PUT, &path, Some(Value::Object(body))).await?;- Ok(RpcOutcome::single_log(data, "team updated via backend"))+ Ok(Outcome::single_log(data, "team updated via backend"))}-pub async fn delete_team(config: &Config, team_id: &str) -> Result<RpcOutcome<Value>, String> {+pub async fn delete_team(config: &Config, team_id: &str) -> Result<Outcome<Value>, String> {let team_id = normalize_id(team_id, "teamId")?;let path = build_api_path(&["teams", &team_id])?;let data = get_authed_value(config, Method::DELETE, &path, None).await?;- Ok(RpcOutcome::single_log(data, "team deleted via backend"))+ Ok(Outcome::single_log(data, "team deleted via backend"))}-pub async fn switch_team(config: &Config, team_id: &str) -> Result<RpcOutcome<Value>, String> {+pub async fn switch_team(config: &Config, team_id: &str) -> Result<Outcome<Value>, String> {let team_id = normalize_id(team_id, "teamId")?;let path = build_api_path(&["teams", &team_id, "switch"])?;let data = get_authed_value(config, Method::POST, &path, Some(json!({}))).await?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(data,"active team switched via backend",))}-pub async fn leave_team(config: &Config, team_id: &str) -> Result<RpcOutcome<Value>, String> {+pub async fn leave_team(config: &Config, team_id: &str) -> Result<Outcome<Value>, String> {let team_id = normalize_id(team_id, "teamId")?;let path = build_api_path(&["teams", &team_id, "leave"])?;let data = get_authed_value(config, Method::POST, &path, Some(json!({}))).await?;- Ok(RpcOutcome::single_log(data, "team left via backend"))+ Ok(Outcome::single_log(data, "team left via backend"))}-pub async fn join_team(config: &Config, code: &str) -> Result<RpcOutcome<Value>, String> {+pub async fn join_team(config: &Config, code: &str) -> Result<Outcome<Value>, String> {let trimmed = code.trim();if trimmed.is_empty() {return Err("code is required".to_string());@@ -172,7 +172,7 @@ pub async fn join_team(config: &Config, code: &str) -> Result<RpcOutcome<Value>,Some(json!({ "code": trimmed })),).await?;- Ok(RpcOutcome::single_log(data, "team joined via backend"))+ Ok(Outcome::single_log(data, "team joined via backend"))}#[derive(Debug, Serialize)]@@ -189,7 +189,7 @@ pub async fn create_invite(team_id: &str,max_uses: Option<u64>,expires_in_days: Option<u64>,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let team_id = normalize_id(team_id, "teamId")?;let path = build_api_path(&["teams", &team_id, "invites"])?;let body = json!(InviteBody {@@ -197,7 +197,7 @@ pub async fn create_invite(expires_in_days,});let data = get_authed_value(config, Method::POST, &path, Some(body)).await?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(data,"team invite created via backend",))@@ -207,12 +207,12 @@ pub async fn remove_member(config: &Config,team_id: &str,user_id: &str,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let team_id = normalize_id(team_id, "teamId")?;let user_id = normalize_id(user_id, "userId")?;let path = build_api_path(&["teams", &team_id, "members", &user_id])?;let data = get_authed_value(config, Method::DELETE, &path, None).await?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(data,"team member removed via backend",))@@ -223,14 +223,14 @@ pub async fn change_member_role(team_id: &str,user_id: &str,role: &str,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let team_id = normalize_id(team_id, "teamId")?;let user_id = normalize_id(user_id, "userId")?;let role = normalize_id(role, "role")?;let path = build_api_path(&["teams", &team_id, "members", &user_id, "role"])?;let body = json!({ "role": role });let data = get_authed_value(config, Method::PUT, &path, Some(body)).await?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(data,"team member role updated via backend",))@@ -238,11 +238,11 @@ pub async fn change_member_role(/// List all active invites for a team./// Maps to `GET /teams/:teamId/invites` — matches `teamApi.getInvites`.-pub async fn list_invites(config: &Config, team_id: &str) -> Result<RpcOutcome<Value>, String> {+pub async fn list_invites(config: &Config, team_id: &str) -> Result<Outcome<Value>, String> {let team_id = normalize_id(team_id, "teamId")?;let path = build_api_path(&["teams", &team_id, "invites"])?;let data = get_authed_value(config, Method::GET, &path, None).await?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(data,"team invites listed from backend",))@@ -254,12 +254,12 @@ pub async fn revoke_invite(config: &Config,team_id: &str,invite_id: &str,-) -> Result<RpcOutcome<Value>, String> {+) -> Result<Outcome<Value>, String> {let team_id = normalize_id(team_id, "teamId")?;let invite_id = normalize_id(invite_id, "inviteId")?;let path = build_api_path(&["teams", &team_id, "invites", &invite_id])?;let data = get_authed_value(config, Method::DELETE, &path, None).await?;- Ok(RpcOutcome::single_log(+ Ok(Outcome::single_log(data,"team invite revoked via backend",))diff --git a/crates/openhuman-tinyhumans/src/hosted/team/schemas.rs b/crates/openhuman-tinyhumans/src/hosted/team/schemas.rsindex 010f52896b..b6dc07e5b9 100644--- a/crates/openhuman-tinyhumans/src/hosted/team/schemas.rs+++ b/crates/openhuman-tinyhumans/src/hosted/team/schemas.rs@@ -5,7 +5,7 @@ use serde_json::{Map, Value};use openhuman_core::config::rpc as config_rpc;use openhuman_core::core::all::{ControllerFuture, RegisteredController};use openhuman_core::core::{ControllerSchema, FieldSchema, TypeSchema};-use openhuman_core::rpc::RpcOutcome;+use openhuman_core::core::Outcome;#[derive(Debug, Deserialize)]#[serde(rename_all = "camelCase")]@@ -482,7 +482,7 @@ fn handle_team_revoke_invite(params: Map<String, Value>) -> ControllerFuture {})}-fn to_json(outcome: RpcOutcome<Value>) -> Result<Value, String> {+fn to_json(outcome: Outcome<Value>) -> Result<Value, String> {outcome.into_cli_compatible_json()}diff --git a/crates/openhuman-tui/src/runner.rs b/crates/openhuman-tui/src/runner.rsindex 23547e7043..e7db569d3a 100644--- a/crates/openhuman-tui/src/runner.rs+++ b/crates/openhuman-tui/src/runner.rs@@ -240,7 +240,7 @@ async fn resolve_thread(}/// Pull a thread id out of a `threads.create_new` / `threads.list` response,-/// tolerant of the `RpcOutcome` log-envelope wrapping (`{result, logs}`) and the+/// tolerant of the `Outcome` log-envelope wrapping (`{result, logs}`) and the/// `ApiEnvelope` data wrapping (`{data, meta}`).pub(super) fn extract_thread_id(value: &Value) -> Option<String> {// Unwrap the optional `{result, logs}` log envelope first.diff --git a/gitbooks/developing/architecture.md b/gitbooks/developing/architecture.mdindex 89cdded83a..caccfd8857 100644--- a/gitbooks/developing/architecture.md+++ b/gitbooks/developing/architecture.md@@ -18,7 +18,7 @@ OpenHuman is a cross-platform communication and automation platform purpose-buil| **`app/`** | pnpm workspace **`openhuman-app`**: Vite/React UI (`app/src/`), Vitest and WDIO tests. The Tauri shell itself is the Rust crate `crates/openhuman-app/` (below). || **`crates/openhuman-app/`** | Thin Tauri v2 desktop host (Cargo package `openhuman-app`). Built from its own manifest and lockfile, excluded from the root workspace; hosts the core as an in-process tokio task (`src/core_process.rs`). || **`crates/openhuman-core/`** | Cargo package **`openhuman`**: library **`openhuman_core`**, with no `tinyhumans-sdk` dependency — the hosted backend is reached only through the `api::transport::BackendTransport` port. Flat domain modules directly under `src/` (`agent`, `api`, `channels`, `config`, `cron`, `desktop`, `flows`, `hooks`, `hosting`, `http_host`, `inference`, `integrations`, `json_schema`, `mcp`, `media`, `memory`, `modules`, `platform`, `runtime`, `sandbox`, `search`, `security`, `skills`, `threads`, `tools`, `util`, `voice`, `web3`, `web_chat`, …). `src/core/` holds the JSON-RPC server (`jsonrpc/`), CLI (`cli.rs`), dispatch, controller registry (`all.rs`), event bus (`bus.rs`), `runtime/` (`CoreBuilder`/`CoreRuntime`) and `subsystem/`. There is no `src/rpc/` or `src/embed/` inside this crate any more. |-| **`crates/openhuman-rpc/`** | Shared JSON-RPC contracts: `RpcOutcome`, `unwrap_rpc`, `apply_log_envelope`, `StructuredRpcError`. The `http-client` feature (default on; off for root-workspace consumers) adds `post_json_rpc`, `bearer_header`, `redact_url_for_log`, `HttpRpcResponse`. Used by the Tauri shell (`core_rpc.rs` → `relay_http_rpc`) and the TUI (envelope decoding); re-exported by the core as `openhuman_core::rpc`. |+| **`crates/openhuman-rpc/`** | Shared JSON-RPC contracts: `Outcome`, `unwrap_rpc`, `apply_log_envelope`, `StructuredRpcError`. The `http-client` feature (default on; off for root-workspace consumers) adds `post_json_rpc`, `bearer_header`, `redact_url_for_log`, `HttpRpcResponse`. Used by the Tauri shell (`core_rpc.rs` → `relay_http_rpc`) and the TUI (envelope decoding); re-exported by the core as `openhuman_core::rpc`. || **`crates/openhuman-embed/`** | Typed library facade (`openhuman_embed::{Harness, Core, CoreBuilder, DomainSet, ServiceSet, HostKind}`) for embedding the core in another product; forwards the core's feature gates. Installs no backend transport itself. || **`crates/openhuman-tinyhumans/`** | The TinyHumans layer above embed: `SdkBackendTransport` (the only crate that depends on the vendored `tinyhumans-sdk`), `install()` for hosts that boot the core themselves, a `RuntimeBuilder` that boots an embed runtime connected, the hosted RPC proxies (`hosted/`: billing, team, referral, announcements — registered into the core's controller registry as an extension), and the host-side login/session owner (`session/`). || **`crates/openhuman-cli/`** | The `openhuman-core` binary (installs the tinyhumans transport, then `run_core_from_args`), the developer/benchmark bins, and every root `tests/*.rs` / `examples/*.rs` target. |diff --git a/gitbooks/developing/architecture/README.md b/gitbooks/developing/architecture/README.mdindex f2205ea1d3..fbb797e54f 100644--- a/gitbooks/developing/architecture/README.md+++ b/gitbooks/developing/architecture/README.md@@ -49,7 +49,7 @@ OpenHuman is a **React + Tauri v2 desktop app** with a **Rust core** that does t- `crates/openhuman-app/` — Tauri v2 desktop host; excluded from the root workspace, built from its own manifest.- `crates/openhuman-core/` — Cargo package `openhuman`: business domains, JSON-RPC server, CLI, `CoreBuilder`/`CoreRuntime`.- `crates/openhuman-embed/` — typed library facade (`openhuman_embed::Harness`) for embedding the core in another product.-- `crates/openhuman-rpc/` — shared RPC contracts (`RpcOutcome`, `unwrap_rpc`, `StructuredRpcError`) and the HTTP client used by the app and TUI.+- `crates/openhuman-rpc/` — shared RPC contracts (`Outcome`, `unwrap_rpc`, `StructuredRpcError`) and the HTTP client used by the app and TUI.- `crates/openhuman-tui/` — standalone terminal frontend that boots the core in-process.The full table is under "Repository layout" in the [deep architecture reference](../architecture.md).diff --git a/gitbooks/developing/architecture/mcp-registry.md b/gitbooks/developing/architecture/mcp-registry.mdindex 4a14f082e2..00c66a6882 100644--- a/gitbooks/developing/architecture/mcp-registry.md+++ b/gitbooks/developing/architecture/mcp-registry.md@@ -61,7 +61,7 @@ Installed servers are connected as the core comes up, and `mcp::registry::superv| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- || `mod.rs` | Module docs, `types`/`connections` re-export shims over `tinymcp_bus`/`super::host`, the reconnect-supervisor loop, the OAuth-callback completion helper, and `tools_safe_for_agent` (the prompt-injection scan applied to every remote tool definition). || `host.rs` (parent `mcp/`) | One `tinymcp` service per workspace, opened on first use; proxy resolution for MCP traffic (`proxy_for_mcp`). |-| `helpers.rs` | Shared RPC-handler plumbing: `RpcOutcome` encoding, identifier guards, workspace-service resolution, credential-name injection. |+| `helpers.rs` | Shared RPC-handler plumbing: `Outcome` encoding, identifier guards, workspace-service resolution, credential-name injection. || `ops.rs` | `mcp_clients_*` RPC handler implementations (uninstall, list, browse, connect/disconnect, tool call, `update_env`, registry settings). One-to-one with `schemas.rs` handlers; publishes `DomainEvent`s `tinymcp` does not. || `config_doc.rs` | The `mcp.json` contract: `render` (store → document, credential names only), `parse` (document → declarations, refusing what the store cannot carry), `same_dial`, `to_installed`, `merge_credentials`. || `config_ops.rs` | `mcp_clients_config_get` / `config_set`: replace the store with what the document declares — add, rewrite in place under the same `server_id`, or uninstall — merging write-only credentials and connecting new enabled servers in the background. |diff --git a/gitbooks/developing/architecture/memory-tree.md b/gitbooks/developing/architecture/memory-tree.mdindex 7198be68cb..a941cb7964 100644--- a/gitbooks/developing/architecture/memory-tree.md+++ b/gitbooks/developing/architecture/memory-tree.md@@ -13,7 +13,7 @@ icon: diagram-project> (`tinymemory-core`, with `tinycortex` vendored beneath it) and are reached> through the `tinymemory-api` contract. `crates/openhuman-core/src/memory/tree/`> is OpenHuman's **host layer** over that engine: RPC handlers and controller-> schemas that name OpenHuman's `RpcOutcome` and `ControllerSchema`, which the+> schemas that name OpenHuman's `Outcome` and `ControllerSchema`, which the> engine crate cannot see. Nothing here opens SQLite or branches on tree kind.The user-facing feature is described in [Memory Tree](../../features/obsidian-wiki/memory-tree.md).@@ -44,7 +44,7 @@ vendor/tinymemory (engine: tinymemory-core / tinycortex — persistence,## Layer rules-- **No tree mechanics here.** Seal cascades, summarisation, scoring, embedding and entity extraction happen inside the engine. This directory converts RPC requests into contract calls and contract results into `RpcOutcome`.+- **No tree mechanics here.** Seal cascades, summarisation, scoring, embedding and entity extraction happen inside the engine. This directory converts RPC requests into contract calls and contract results into `Outcome`.- **No persistence here.** The engine owns the tree tables; the host never opens them directly.- **Scope is explicit.** Task-local state does not cross the module boundary, so every scoped call passes its source scope and self-echo exclusions as arguments.diff --git a/gitbooks/developing/architecture/security.md b/gitbooks/developing/architecture/security.mdindex 369378411d..cda9a581c8 100644--- a/gitbooks/developing/architecture/security.md+++ b/gitbooks/developing/architecture/security.md@@ -31,7 +31,7 @@ This module is the place to look first when asking "is this agent action allowed| `AuditLogger`, `AuditEventType`, `AuditEvent`, `Actor`, `Action`, `ExecutionResult`, `SecurityContext`, `CommandExecutionLog` | `audit.rs` | Append-only audit trail. || `PairingGuard`, `constant_time_eq`, `is_public_bind` | `pairing.rs` (`PairingGuard` and `constant_time_eq` are re-exported from `tinychannels_bus::security`) | Pairing-token check before binding the RPC server publicly. || `redact(value: &str) -> String` | `core.rs` | Uniform 4-char-prefix redaction for logs. |-| `security_policy_info_for_config(&Config) -> RpcOutcome<serde_json::Value>` | `ops.rs` | RPC handler for the doctor / settings UI. |+| `security_policy_info_for_config(&Config) -> Outcome<serde_json::Value>` | `ops.rs` | RPC handler for the doctor / settings UI. |## Sandbox backend selectiondiff --git a/scripts/debug/goals-live.mjs b/scripts/debug/goals-live.mjsindex b12ff694ac..ac86fca4b7 100644--- a/scripts/debug/goals-live.mjs+++ b/scripts/debug/goals-live.mjs@@ -211,7 +211,7 @@ async function rpc(coreUrl, token, method, params, timeoutMs = 600_000) {return body.result;}-// RpcOutcome serializes either as the bare value (no logs) or { result, logs }.+// Outcome serializes either as the bare value (no logs) or { result, logs }.function unwrap(result) {if (result && typeof result === "object" && "result" in result && "logs" in result) {return { value: result.result, logs: result.logs || [] };diff --git a/scripts/shortcuts/review/prompts/fix.md b/scripts/shortcuts/review/prompts/fix.mdindex cf4d496959..842ac02e01 100644--- a/scripts/shortcuts/review/prompts/fix.md+++ b/scripts/shortcuts/review/prompts/fix.md@@ -56,7 +56,7 @@ For every file in the diff, read the **whole file** (not just the hunk). ContextRun a CodeRabbit-style review against these axes:-**Correctness** — logic bugs, off-by-one, null/undefined, async/await misuse, race conditions, error propagation (`Result<T>` / `RpcOutcome<T>`).+**Correctness** — logic bugs, off-by-one, null/undefined, async/await misuse, race conditions, error propagation (`Result<T>` / `Outcome<T>`).**Project standards** (from `CLAUDE.md`)- New Rust functionality under `crates/openhuman-core/src/<domain>/`, not root-level `.rs` files.diff --git a/scripts/shortcuts/review/prompts/review.md b/scripts/shortcuts/review/prompts/review.mdindex ae907a52a9..55b835919e 100644--- a/scripts/shortcuts/review/prompts/review.md+++ b/scripts/shortcuts/review/prompts/review.md@@ -33,7 +33,7 @@ Skipping this produces shallow reviews that miss architectural issues.## 3. Analyze against these axes-**Correctness** — logic bugs, off-by-one, null/undefined, async/await misuse, race conditions, error propagation (`Result<T>` / `RpcOutcome<T>` / thrown errors).+**Correctness** — logic bugs, off-by-one, null/undefined, async/await misuse, race conditions, error propagation (`Result<T>` / `Outcome<T>` / thrown errors).**Project standards** (from `CLAUDE.md`)- New Rust functionality lives in a subdirectory under `crates/openhuman-core/src/`, not root-level `.rs` files.@@ -126,7 +126,7 @@ Review body structure:- `path/to/file.ts:88` — <question>## Verified / looks good-- Error paths in `foo.rs` propagate `RpcOutcome<T>` correctly.+- Error paths in `foo.rs` propagate `Outcome<T>` correctly.- New Vitest in `Foo.test.tsx` exercises empty + error states.````diff --git a/scripts/shortcuts/work/prompts/start.md b/scripts/shortcuts/work/prompts/start.mdindex 8165936764..37ef3df7ab 100644--- a/scripts/shortcuts/work/prompts/start.md+++ b/scripts/shortcuts/work/prompts/start.md@@ -29,7 +29,7 @@ Ground the change in the existing codebase before writing any code:- Domain `mod.rs` is export-focused; operational code in `ops.rs` / `store.rs` / `types.rs` / `schemas.rs`.- Expose features through the controller registry — never add domain branches in `crates/openhuman-core/src/core/cli.rs` / `crates/openhuman-core/src/core/jsonrpc/`.- Use the event bus singletons (`publish_global` / `subscribe_global` / `register_native_global` / `request_native_global`); never construct `EventBus` / `NativeRegistry` directly.-- Return `RpcOutcome<T>` per `AGENTS.md`.+- Return `Outcome<T>` per `AGENTS.md`.## 3. JSON-RPC E2Ediff --git a/tests/agent_approval_memory_coverage_e2e.rs b/tests/agent_approval_memory_coverage_e2e.rsindex 2927d84abb..fe6ab197bf 100644--- a/tests/agent_approval_memory_coverage_e2e.rs+++ b/tests/agent_approval_memory_coverage_e2e.rs@@ -211,7 +211,7 @@ fn ok<'a>(value: &'a Value, context: &str) -> &'a Value {.unwrap_or_else(|| panic!("{context}: missing result: {value}"))}-/// Peel the conditional `RpcOutcome` envelope. A handler that emits no log+/// Peel the conditional `Outcome` envelope. A handler that emits no log/// lines returns the bare value; one that emits any returns/// `{ result, logs }`. Both shapes are valid for the same method, so every/// consumer has to tolerate both — see `crates/openhuman-rpc/src/mod.rs`.diff --git a/tests/composio_post_oauth_retry_e2e.rs b/tests/composio_post_oauth_retry_e2e.rsindex a580aaf716..d8f1dcbd28 100644--- a/tests/composio_post_oauth_retry_e2e.rs+++ b/tests/composio_post_oauth_retry_e2e.rs@@ -387,7 +387,7 @@ async fn post_oauth_gap_retries_and_returns_real_data() {.await;let envelope = assert_no_jsonrpc_error(&exec, "composio_execute");- // RpcOutcome serialises as {"result": <ComposioExecuteResponse>, "logs": [...]}+ // Outcome serialises as {"result": <ComposioExecuteResponse>, "logs": [...]}// when logs are present. Unwrap one level to reach the composio payload.let result = envelope.get("result").unwrap_or(envelope);@@ -527,7 +527,7 @@ async fn revoked_token_surfaces_without_retry() {);} else {let envelope = result_opt.expect("expected result or error");- // RpcOutcome wraps the composio payload under a "result" key when logs+ // Outcome wraps the composio payload under a "result" key when logs// are present; fall back to the envelope itself for the no-logs case.let result = envelope.get("result").unwrap_or(envelope);let successful = resultdiff --git a/tests/domain_modules_e2e.rs b/tests/domain_modules_e2e.rsindex 01bc6268c3..d0a4269b3b 100644--- a/tests/domain_modules_e2e.rs+++ b/tests/domain_modules_e2e.rs@@ -640,10 +640,10 @@ async fn target_domain_read_paths_round_trip_through_json_rpc_transport() {/// `channels.set_default` and `channels.get_default` differ in WIRE SHAPE.////// Nothing else pins this, and the difference is invisible to every helper that-/// unwraps tolerantly. `set_default_channel` returns `RpcOutcome::single_log(...)`+/// unwraps tolerantly. `set_default_channel` returns `Outcome::single_log(...)`/// (`channels/controllers/ops/connect/status.rs:101-104`), so its payload arrives/// ENVELOPED as `{ result, logs }`. `get_default_channel` returns-/// `RpcOutcome::new(_, vec![])` (`:115`), so its payload arrives BARE. Adding or+/// `Outcome::new(_, vec![])` (`:115`), so its payload arrives BARE. Adding or/// removing a single log line in either handler silently changes what every/// caller must parse — the §6 log-envelope rule, on a live pair of methods.///@@ -735,7 +735,7 @@ async fn cron_update_applies_a_partial_patch_without_clobbering_unset_fields() {}),).await;- // `handle_add` ends in `to_json(RpcOutcome::single_log(job, ...))`, so the+ // `handle_add` ends in `to_json(Outcome::single_log(job, ...))`, so the// CronJob is the payload itself — there is no `job` wrapper key, despite what// the declared output schema names.let job = payload(&added, "cron_add").clone();diff --git a/tests/json_rpc_e2e.rs b/tests/json_rpc_e2e.rsindex b0b93ddb52..538b8539e4 100644--- a/tests/json_rpc_e2e.rs+++ b/tests/json_rpc_e2e.rs@@ -1143,7 +1143,7 @@ fn extract_string_outcome(result: &Value) -> String {}/// Peel the `{"result": inner, "logs": [...]}` envelope that-/// `RpcOutcome::into_cli_compatible_json` adds when logs are present.+/// `Outcome::into_cli_compatible_json` adds when logs are present.fn peel_logs_envelope(v: &Value) -> &Value {if v.get("logs").is_some() {v.get("result").unwrap_or(v)@@ -7803,7 +7803,7 @@ async fn credentials_crud_roundtrip() {).await;// assert_no_jsonrpc_error returns the JSON-RPC `result` field which is the- // RpcOutcome envelope: {"logs": [...], "result": { <AuthProfileSummary> }}.+ // Outcome envelope: {"logs": [...], "result": { <AuthProfileSummary> }}.let store_outer = assert_no_jsonrpc_error(&store, "auth_store_provider_credentials");let store_result = store_outer.get("result").unwrap_or(store_outer);assert_eq!(diff --git a/tests/memory_sources_e2e.rs b/tests/memory_sources_e2e.rsindex 1c0ef09de6..baf8085a4e 100644--- a/tests/memory_sources_e2e.rs+++ b/tests/memory_sources_e2e.rs@@ -164,7 +164,7 @@ fn ok(v: &Value, ctx: &str) -> Value {let outer = v.get("result").unwrap_or_else(|| panic!("{ctx}: missing result: {v}"));- // RpcOutcome wraps the payload under an inner "result" key alongside "logs".+ // Outcome wraps the payload under an inner "result" key alongside "logs".if let Some(inner) = outer.get("result") {inner.clone()} else {diff --git a/tests/memory_tree_health_e2e.rs b/tests/memory_tree_health_e2e.rsindex 0ddcfd68fe..7153a94be2 100644--- a/tests/memory_tree_health_e2e.rs+++ b/tests/memory_tree_health_e2e.rs@@ -184,7 +184,7 @@ fn ok(v: &Value, ctx: &str) -> Value {let outer = v.get("result").unwrap_or_else(|| panic!("{ctx}: missing result: {v}"));- // RpcOutcome wraps the payload under an inner "result" key alongside "logs".+ // Outcome wraps the payload under an inner "result" key alongside "logs".if let Some(inner) = outer.get("result") {inner.clone()} else {@@ -712,7 +712,7 @@ async fn memory_tree_smart_walk_answers_over_ingested_content() {/// covers the same ground one layer down by calling/// `openhuman_core::memory::ops::memory_namespace_summaries` directly. Both are/// worth having and only this one exercises dispatch, parameter decoding and the-/// `RpcOutcome` envelope.+/// `Outcome` envelope.#[tokio::test]async fn memory_namespace_summaries_counts_each_namespace_it_was_given() {let _guard = env_lock();diff --git a/tests/raw_coverage/learning_facets_e2e.rs b/tests/raw_coverage/learning_facets_e2e.rsindex 91658dc307..8c057b6f22 100644--- a/tests/raw_coverage/learning_facets_e2e.rs+++ b/tests/raw_coverage/learning_facets_e2e.rs@@ -273,7 +273,7 @@ async fn rpc(rpc_base: &str, id: i64, method: &str, params: Value) -> Value {.unwrap_or_else(|err| panic!("json for {method}: {err}"))}-/// The payload of a successful dispatch, unwrapping the `RpcOutcome`+/// The payload of a successful dispatch, unwrapping the `Outcome`/// `{ result, logs }` envelope when the handler produced one.fn payload(value: &Value, context: &str) -> Value {if let Some(error) = value.get("error") {diff --git a/tests/raw_coverage/memory_goals_people_e2e.rs b/tests/raw_coverage/memory_goals_people_e2e.rsindex e0c8281b0a..d1a129a880 100644--- a/tests/raw_coverage/memory_goals_people_e2e.rs+++ b/tests/raw_coverage/memory_goals_people_e2e.rs@@ -263,7 +263,7 @@ async fn rpc(rpc_base: &str, id: i64, method: &str, params: Value) -> Value {.unwrap_or_else(|err| panic!("json for {method}: {err}"))}-/// The payload of a successful dispatch, unwrapping the `RpcOutcome`+/// The payload of a successful dispatch, unwrapping the `Outcome`/// `{ result, logs }` envelope when the handler produced one.fn payload(value: &Value, context: &str) -> Value {if let Some(error) = value.get("error") {diff --git a/tests/raw_coverage/sandbox_runtime_platform_e2e.rs b/tests/raw_coverage/sandbox_runtime_platform_e2e.rsindex e831d45d7a..46c6df7c66 100644--- a/tests/raw_coverage/sandbox_runtime_platform_e2e.rs+++ b/tests/raw_coverage/sandbox_runtime_platform_e2e.rs@@ -288,7 +288,7 @@ fn err_message(value: &Value, context: &str) -> String {.to_string()}-/// Controllers wrap their payload in `RpcOutcome::into_cli_compatible_json`,+/// Controllers wrap their payload in `Outcome::into_cli_compatible_json`,/// which nests the value under `result` and carries `logs` alongside. Handlers/// that return a bare `serde_json::json!` do not. Unwrap one level when it is/// there so a case can assert on the payload either way.diff --git a/tests/raw_coverage/session_store_e2e.rs b/tests/raw_coverage/session_store_e2e.rsindex dbd8bc3c30..ff905285c1 100644--- a/tests/raw_coverage/session_store_e2e.rs+++ b/tests/raw_coverage/session_store_e2e.rs@@ -247,7 +247,7 @@ fn catalog_has(catalog: &Value, method: &str) -> bool {.any(|entry| entry.get("method").and_then(Value::as_str) == Some(method))}-/// The payload of a successful dispatch, unwrapping the `RpcOutcome`+/// The payload of a successful dispatch, unwrapping the `Outcome`/// `{ result, logs }` envelope when the handler produced one.fn payload(value: &Value, context: &str) -> Value {if let Some(error) = value.get("error") {diff --git a/tests/raw_coverage/skill_runtime_e2e.rs b/tests/raw_coverage/skill_runtime_e2e.rsindex 6364b456ab..90e47e54c3 100644--- a/tests/raw_coverage/skill_runtime_e2e.rs+++ b/tests/raw_coverage/skill_runtime_e2e.rs@@ -247,7 +247,7 @@ fn ok<'a>(value: &'a Value, context: &str) -> &'a Value {/// The controller payload, unwrapping the `{result, logs}` envelope when one/// is present.///-/// `RpcOutcome::into_cli_compatible_json` (`crates/openhuman-rpc/src/mod.rs:54-62`) wraps the+/// `Outcome::into_cli_compatible_json` (`crates/openhuman-rpc/src/mod.rs:54-62`) wraps the/// value in `{result, logs}` **only when the handler emitted at least one log/// line**, and returns it bare otherwise. So the response shape of a single/// namespace varies with whether its handler happened to log — `javascript_*`diff --git a/tests/raw_coverage/webhooks_ingress_e2e.rs b/tests/raw_coverage/webhooks_ingress_e2e.rsindex 2caa9ed3c3..9ca9514e0a 100644--- a/tests/raw_coverage/webhooks_ingress_e2e.rs+++ b/tests/raw_coverage/webhooks_ingress_e2e.rs@@ -419,7 +419,7 @@ fn jsonrpc_error_message(v: &Value, ctx: &str) -> String {.to_string()}-/// Peel the `{"result": inner, "logs": [...]}` envelope `RpcOutcome` adds when logs are present.+/// Peel the `{"result": inner, "logs": [...]}` envelope `Outcome` adds when logs are present.fn peel<'a>(v: &'a Value) -> &'a Value {if v.get("logs").is_some() {v.get("result").unwrap_or(v)diff --git a/tests/tree_summarizer_e2e.rs b/tests/tree_summarizer_e2e.rsindex d69b79852c..75310c7c3c 100644--- a/tests/tree_summarizer_e2e.rs+++ b/tests/tree_summarizer_e2e.rs@@ -194,7 +194,7 @@ fn ok(v: &Value, ctx: &str) -> Value {let outer = v.get("result").unwrap_or_else(|| panic!("{ctx}: missing result: {v}"));- // RpcOutcome wraps its payload under an inner "result" alongside "logs".+ // Outcome wraps its payload under an inner "result" alongside "logs".outer.get("result").cloned()