The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
docs(config): document schema 14 migration and provider retirement
Steven Enamakel0c966f4b0530
diff --git a/crates/openhuman-core/src/config/migrations/README.md b/crates/openhuman-core/src/config/migrations/README.mdindex 89bd837939..1f43c9a35c 100644--- a/crates/openhuman-core/src/config/migrations/README.md+++ b/crates/openhuman-core/src/config/migrations/README.md@@ -16,33 +16,34 @@ Startup data-migration runner gated by `Config::schema_version`. Each migration## Key files-| File | Role |-| --- | --- |-| [`crates/openhuman-core/src/config/migrations/mod.rs`](./mod.rs) | Module docstring + the `run_pending` runner, `seed_new_workspace`, and the `CURRENT_SCHEMA_VERSION` constant; declares each migration as a private `mod`. The 10→11 step (`reseed_cloud_providers`) is written inline here rather than as its own module. |-| [`crates/openhuman-core/src/config/migrations/phase_out_profile_md.rs`](./phase_out_profile_md.rs) | **0→1.** Deletes `{workspace}/PROFILE.md` and strips `### PROFILE.md` blocks from persisted JSONL session transcripts (`session_raw/**`) and `.md` companions (`sessions/**`). Blocking fs I/O. |-| [`crates/openhuman-core/src/config/migrations/unify_ai_provider_settings.rs`](./unify_ai_provider_settings.rs) | **1→2.** Consolidates scattered AI-provider settings into per-workload provider strings; seeds `cloud_providers` (always an `Openhuman` entry) and migrates a non-backend `inference_url` into a `Custom` cloud entry. Pure in-memory. |-| [`crates/openhuman-core/src/config/migrations/retire_chat_v1_model.rs`](./retire_chat_v1_model.rs) | **2→3.** Legacy `chat-v1` migration hook retained for schema-version progression; a no-op (the slug itself is retired by 12→13). Pure in-memory. |-| [`crates/openhuman-core/src/config/migrations/expand_autonomy_defaults.rs`](./expand_autonomy_defaults.rs) | **3→4.** Additively merges expanded `autonomy.allowed_commands` / `auto_approve` defaults (PR #2500) and bumps `max_actions_per_hour` from the old `20` to `u32::MAX` only when still exactly `20`. Pure in-memory. |-| [`crates/openhuman-core/src/config/migrations/remove_write_auto_approve.rs`](./remove_write_auto_approve.rs) | **4→5.** Removes `file_write` / `edit_file` from `autonomy.auto_approve` so Supervised mode resumes its ask-before-edit prompt. Pure in-memory. |-| [`crates/openhuman-core/src/config/migrations/repair_http_request_limits.rs`](./repair_http_request_limits.rs) | **5→6 (a).** Coerces stale-zero `[http_request]` `timeout_secs` / `max_response_size` to schema defaults (30s / 1 MB); a persisted `0` is an instant timeout / empty-body cap that serde defaults don't repair. Pure in-memory. |-| [`crates/openhuman-core/src/config/migrations/reconcile_orphaned_providers.rs`](./reconcile_orphaned_providers.rs) | **5→6 (b).** Resets per-workload `*_provider` strings (and a dangling `primary_cloud`) that point at a cloud provider no longer in `cloud_providers`, which the inference factory hard-errors on; mirrors the factory's exact grammar. Pure in-memory. |-| [`crates/openhuman-core/src/config/migrations/migrate_legacy_embedding_provider.rs`](./migrate_legacy_embedding_provider.rs) | **6→7.** Rewrites the removed `memory.embedding_provider = "fastembed"` to `ollama` + `bge-m3` when a local Ollama is reachable (`prefer_local`), else to the `managed` cloud default; resets model/dimensions to 1024. Pure in-memory apart from the runner's reachability probe. |-| [`crates/openhuman-core/src/config/migrations/normalize_default_model_tier.rs`](./normalize_default_model_tier.rs) | **7→8.** Rewrites a persisted `default_model` of `reasoning-v1` or `reasoning-quick-v1` to the managed default model; every other value (custom/BYOK ids, `None`) is left untouched. Pure in-memory. |-| [`crates/openhuman-core/src/config/migrations/enable_session_shadow_reads.rs`](./enable_session_shadow_reads.rs) | **8→9.** Flips a persisted `agent.session_shadow_reads = false` to `true` once, because `Config::save` writes every field and the new serde default would never apply to upgraded workspaces. Pure in-memory. |-| [`crates/openhuman-core/src/config/migrations/retire_local_whisper_stt.rs`](./retire_local_whisper_stt.rs) | **9→10.** Rewrites `stt_provider` (top-level or legacy `local_ai`) values naming the removed local whisper engine (`"whisper"`, `"local"`) to `"cloud"`, which defers to `voice_server.stt_engine`. Pure in-memory. |-| *(inline in `mod.rs`)* | **10→11.** `reseed_cloud_providers`: backfills the managed `openhuman` entry for workspaces that were born past the `== 1` gate with `cloud_providers = []`; reuses `unify_ai_provider_settings::seed_cloud_providers`, which is a no-op on a populated list. On save failure rolls back both the version and the seeded entries. |-| `crates/openhuman-core/src/config/migrations/mod.rs` | **11→12.** Reserializes the config; the retired background-engine block it once rewrote no longer exists, so the save drops it. |-| [`crates/openhuman-core/src/config/migrations/retire_managed_tier_slugs.rs`](./retire_managed_tier_slugs.rs) | **12→13.** Retires the managed tier slugs (`chat-v1`, `agentic-v1`, …): every persisted one (`default_model`, orchestrator/team/delegate pins, `model_routes[].model`) becomes the managed default model (`openrouter/deepseek/deepseek-v4-flash`). Concrete ids and `hint:*` markers are untouched. Pure in-memory. |-| [`crates/openhuman-core/src/config/migrations/mod_tests.rs`](./mod_tests.rs) | Tests for `run_pending` ordering, gating, rollback-on-save-failure. |-| `crates/openhuman-core/src/config/migrations/*_tests.rs` | Per-migration unit tests; every migration module mounts its own `<name>_tests.rs` via `#[cfg(test)] #[path]`. |+| File | Role |+| ---------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| [`crates/openhuman-core/src/config/migrations/mod.rs`](./mod.rs) | Module docstring + the `run_pending` runner, `seed_new_workspace`, and the `CURRENT_SCHEMA_VERSION` constant; declares each migration as a private `mod`. The 10→11 step (`reseed_cloud_providers`) is written inline here rather than as its own module. |+| [`crates/openhuman-core/src/config/migrations/phase_out_profile_md.rs`](./phase_out_profile_md.rs) | **0→1.** Deletes `{workspace}/PROFILE.md` and strips `### PROFILE.md` blocks from persisted JSONL session transcripts (`session_raw/**`) and `.md` companions (`sessions/**`). Blocking fs I/O. |+| [`crates/openhuman-core/src/config/migrations/unify_ai_provider_settings.rs`](./unify_ai_provider_settings.rs) | **1→2.** Consolidates scattered AI-provider settings into per-workload provider strings; seeds `cloud_providers` (always an `Openhuman` entry) and migrates a non-backend `inference_url` into a `Custom` cloud entry. Pure in-memory. |+| [`crates/openhuman-core/src/config/migrations/retire_chat_v1_model.rs`](./retire_chat_v1_model.rs) | **2→3.** Legacy `chat-v1` migration hook retained for schema-version progression; a no-op (the slug itself is retired by 12→13). Pure in-memory. |+| [`crates/openhuman-core/src/config/migrations/expand_autonomy_defaults.rs`](./expand_autonomy_defaults.rs) | **3→4.** Additively merges expanded `autonomy.allowed_commands` / `auto_approve` defaults (PR #2500) and bumps `max_actions_per_hour` from the old `20` to `u32::MAX` only when still exactly `20`. Pure in-memory. |+| [`crates/openhuman-core/src/config/migrations/remove_write_auto_approve.rs`](./remove_write_auto_approve.rs) | **4→5.** Removes `file_write` / `edit_file` from `autonomy.auto_approve` so Supervised mode resumes its ask-before-edit prompt. Pure in-memory. |+| [`crates/openhuman-core/src/config/migrations/repair_http_request_limits.rs`](./repair_http_request_limits.rs) | **5→6 (a).** Coerces stale-zero `[http_request]` `timeout_secs` / `max_response_size` to schema defaults (30s / 1 MB); a persisted `0` is an instant timeout / empty-body cap that serde defaults don't repair. Pure in-memory. |+| [`crates/openhuman-core/src/config/migrations/reconcile_orphaned_providers.rs`](./reconcile_orphaned_providers.rs) | **5→6 (b).** Resets per-workload `*_provider` strings (and a dangling `primary_cloud`) that point at a cloud provider no longer in `cloud_providers`, which the inference factory hard-errors on; mirrors the factory's exact grammar. Pure in-memory. |+| [`crates/openhuman-core/src/config/migrations/migrate_legacy_embedding_provider.rs`](./migrate_legacy_embedding_provider.rs) | **6→7.** Rewrites the removed `memory.embedding_provider = "fastembed"` to `ollama` + `bge-m3` when a local Ollama is reachable (`prefer_local`), else to the `managed` cloud default; resets model/dimensions to 1024. Pure in-memory apart from the runner's reachability probe. |+| [`crates/openhuman-core/src/config/migrations/normalize_default_model_tier.rs`](./normalize_default_model_tier.rs) | **7→8.** Rewrites a persisted `default_model` of `reasoning-v1` or `reasoning-quick-v1` to the managed default model; every other value (custom/BYOK ids, `None`) is left untouched. Pure in-memory. |+| [`crates/openhuman-core/src/config/migrations/enable_session_shadow_reads.rs`](./enable_session_shadow_reads.rs) | **8→9.** Flips a persisted `agent.session_shadow_reads = false` to `true` once, because `Config::save` writes every field and the new serde default would never apply to upgraded workspaces. Pure in-memory. |+| [`crates/openhuman-core/src/config/migrations/retire_local_whisper_stt.rs`](./retire_local_whisper_stt.rs) | **9→10.** Rewrites `stt_provider` (top-level or legacy `local_ai`) values naming the removed local whisper engine (`"whisper"`, `"local"`) to `"cloud"`, which defers to `voice_server.stt_engine`. Pure in-memory. |+| _(inline in `mod.rs`)_ | **10→11.** `reseed_cloud_providers`: backfills the managed `openhuman` entry for workspaces that were born past the `== 1` gate with `cloud_providers = []`; reuses `unify_ai_provider_settings::seed_cloud_providers`, which is a no-op on a populated list. On save failure rolls back both the version and the seeded entries. |+| `crates/openhuman-core/src/config/migrations/mod.rs` | **11→12.** Reserializes the config; the retired background-engine block it once rewrote no longer exists, so the save drops it. |+| [`crates/openhuman-core/src/config/migrations/retire_managed_tier_slugs.rs`](./retire_managed_tier_slugs.rs) | **12→13.** Retires the managed tier slugs (`chat-v1`, `agentic-v1`, …): every persisted one (`default_model`, orchestrator/team/delegate pins, `model_routes[].model`) becomes the managed default model (`openrouter/deepseek/deepseek-v4-flash`). Concrete ids and `hint:*` markers are untouched. Pure in-memory. |+| [`retire_cloud_provider_type.rs`](./retire_cloud_provider_type.rs) | **13→14.** Normalizes legacy provider discriminators before typed decoding, preserving explicit fields and provider-native models. The versioned runner persists the normalized config once and restores version 13 if saving fails. |+| [`crates/openhuman-core/src/config/migrations/mod_tests.rs`](./mod_tests.rs) | Tests for `run_pending` ordering, gating, rollback-on-save-failure. |+| `crates/openhuman-core/src/config/migrations/*_tests.rs` | Per-migration unit tests; every migration module mounts its own `<name>_tests.rs` via `#[cfg(test)] #[path]`. |## Public surface- `migrations::run_pending(config: &mut Config) -> impl Future<Output = ()>`: the only `pub` entry point; called by `Config::load_or_init`.-- `migrations::CURRENT_SCHEMA_VERSION: u32`: target schema version (`11`).+- `migrations::CURRENT_SCHEMA_VERSION: u32`: target schema version (`14`).- `migrations::seed_new_workspace(config: &mut Config)`: `pub(crate)`; called by `Config::load_or_init` when it creates a fresh `config.toml`.-All individual migration modules (`phase_out_profile_md`, `unify_ai_provider_settings`, …) are **private** to the module; each exposes a `run(...)` fn and a `*Stats` struct used internally by the runner for diagnostics logging.+Except for the crate-visible pre-decode bridge in `retire_cloud_provider_type`, individual migration modules (`phase_out_profile_md`, `unify_ai_provider_settings`, …) are **private** to the module; each exposes a `run(...)` fn and a `*Stats` struct used internally by the runner for diagnostics logging.## RPC / controllers@@ -79,8 +80,9 @@ Does not own a `store.rs`. Its effects are written through other layers:## Notes / gotchas- **Best-effort, never blocks startup.** A migration error or a `spawn_blocking` join failure is logged at WARN and `run_pending` returns; the gate stays at the failing version and retries next launch.+- **Pre-decode compatibility.** The TOML decoder calls `retire_cloud_provider_type::rewrite_document` for pre-schema-14 documents; the runner's 13→14 step persists that upgrade. Its dated retirement boundary also covers offline imports.- **Save-failure rollback.** Each step bumps `config.schema_version` in memory, then `Config::save().await`; if the save fails the version is rolled back to `previous_version` so disk and memory stay consistent.-- **Exact `==` gating (except 0→1).** Steps 1→2 through 12→13 guard on `schema_version == N`, not `< N+1`, so a failed earlier migration cannot be silently skipped. The first step uses `< 1`.+- **Exact `==` gating (except 0→1).** Steps 1→2 through 13→14 guard on `schema_version == N`, not `< N+1`, so a failed earlier migration cannot be silently skipped. The first step uses `< 1`.- Idempotency is guaranteed twice over: externally by the `schema_version` gate, and internally, since every migration is a no-op when re-run on already-migrated data (for example, additive merges guarded by `contains`, `is_none()` field checks, absence of a `### PROFILE.md` block).- **5→6 shares one version bump for two modules.** Both `repair_http_request_limits` and `reconcile_orphaned_providers` run; the gate advances to 6 only if both succeed. Re-running the one that already succeeded on the next launch is a no-op.- Adding a migration: add a `mod` with a `<name>_tests.rs`, bump `CURRENT_SCHEMA_VERSION`, and add a `if config.schema_version == N` branch in `run_pending` that calls the module and bumps and saves on success (see the mod.rs docstring). Do not rely on a migration to initialise fresh workspaces; they never cross any gate. Put creation-time seeding in `seed_new_workspace` instead.diff --git a/docs/dep-audit/2026-10-11-compatibility-retirement.md b/docs/dep-audit/2026-10-11-compatibility-retirement.mdindex 0f8e0f35bb..03f1c92fd0 100644--- a/docs/dep-audit/2026-10-11-compatibility-retirement.md+++ b/docs/dep-audit/2026-10-11-compatibility-retirement.md@@ -5,23 +5,23 @@ The contributor build is v0.64.15. Retained OpenHuman entries are reviewed after2027-01-11 for removal in v0.66; that is a review boundary, not an automaticpromise to discard old user data. Removal requires the evidence stated below.-| Item | Decision and retirement evidence |-| --- | --- |-| Server and frontend legacy RPC tables | Keep together until v0.66. Successful calls grouped by raw incoming method and shipped client version must establish that old names are unused. Error-only telemetry cannot establish that. |-| CloudProviderType and provider type | Remove the enum and typed discriminator. Decode old TOML through the schema-14 migration before typed deserialization; persist the normalized config once. Explicit endpoint/auth/slug/label values win. |-| Provider default_model | Keep until v0.66: this is an active BYOK model fallback, including abstract-model remapping in factory/cloud_slug.rs, and an accepted inference settings input. Persist it instead of dropping it on every save. Removing it requires a replacement model contract and migration of all workload routes. |-| Deprecated local-AI usage helpers | Remove; update callers to Config::workload_uses_local, whose provider route is authoritative. Legacy usage booleans remain input to older config migrations. |-| Tool-policy request mirrors | Remove session_id, channel, and agent_definition_id copies; consumers use request.context. Retain the existing sensitive-field debug redaction. |-| Skill metadata discovery entry | Keep until v0.66. It now caches results and applies ambient user-root visibility, trust and tenant scope; replacing it with raw discovery would change behavior. Existing scope/cache tests cover it. |-| Integration-cache expiry alias | Remove; callers use cached_active_integrations, which already preserves the same last-known credential-scoped snapshot without a time expiry. |-| Credential-gated service historical names | Remove; migrate all direct callers to start_credential_gated_services / stop_credential_gated_services. |-| skill_manage tool-family alias | Keep until v0.66. Persisted opt-in snapshots require a one-shot skill_manage -> workflow_manage migration before this default-off family can disappear. |-| Subagent archetype parameter | Keep until v0.66. Current prompts use agent_id, but resumed sessions freeze tool schemas and existing native tests pin old argument acceptance. Local source searches cannot establish the contents of every user's durable transcript. |-| Unscoped cancel wrapper | Remove the wrapper; current callers explicitly pass None to cancel_chat_scoped, preserving whole-thread cancellation and existing stale-request tests. |-| Legacy inference_url route fallback | Keep until v0.66. The URL remains accepted by config.update and headless settings, and active completion logic pins BYOK roles. Dropping the fallback without completing upgrades can change which account pays for inference. |-| voice_cloud_transcribe | Keep until v0.66. app/src/features/human/voice/sttClient.ts still sends it, with frontend and JSON-RPC regressions. Migrate that shipped caller before evaluating removal. |-| Legacy Ready artifact migration | Keep until v0.66, pending an explicit pre-files upgrade/import boundary for offline workspaces. Crash-safe copy/metadata handling and idempotence remain intact. |-| Legacy timestamped session adoption | Owned by TinyAgents, not core. [TinyAgents #390](https://github.com/tinyhumansai/tinyagents/pull/390) dates review to 2027-01-11 and removal to v3.0, requiring an explicit host upgrade/import boundary. No unpublished gitlink is consumed here. |+| Item | Decision and retirement evidence |+| ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| Server and frontend legacy RPC tables | Keep together until v0.66. Successful calls grouped by raw incoming method and shipped client version must establish that old names are unused. Error-only telemetry cannot establish that. |+| CloudProviderType and provider type | Remove the enum and typed discriminator. Decode old TOML through the schema-14 migration before typed deserialization; persist the normalized config once. Explicit endpoint/auth/slug/label values win. |+| Provider default_model | Keep until v0.66: this is an active BYOK model fallback, including abstract-model remapping in factory/cloud_slug.rs, and an accepted inference settings input. Persist it instead of dropping it on every save. Removing it requires a replacement model contract and migration of all workload routes. |+| Deprecated local-AI usage helpers | Remove; update callers to Config::workload_uses_local, whose provider route is authoritative. Legacy usage booleans remain input to older config migrations. |+| Tool-policy request mirrors | Remove session_id, channel, and agent_definition_id copies; consumers use request.context. Retain the existing sensitive-field debug redaction. |+| Skill metadata discovery entry | Keep until v0.66. It now caches results and applies ambient user-root visibility, trust and tenant scope; replacing it with raw discovery would change behavior. Existing scope/cache tests cover it. |+| Integration-cache expiry alias | Remove; callers use cached_active_integrations, which already preserves the same last-known credential-scoped snapshot without a time expiry. |+| Credential-gated service historical names | Remove; migrate all direct callers to start_credential_gated_services / stop_credential_gated_services. |+| skill_manage tool-family alias | Keep until v0.66. Persisted opt-in snapshots require a one-shot skill_manage -> workflow_manage migration before this default-off family can disappear. |+| Subagent archetype parameter | Keep until v0.66. Current prompts use agent_id, but resumed sessions freeze tool schemas and existing native tests pin old argument acceptance. Local source searches cannot establish the contents of every user's durable transcript. |+| Unscoped cancel wrapper | Remove the wrapper; current callers explicitly pass None to cancel_chat_scoped, preserving whole-thread cancellation and existing stale-request tests. |+| Legacy inference_url route fallback | Keep until v0.66. The URL remains accepted by config.update and headless settings, and active completion logic pins BYOK roles. Dropping the fallback without completing upgrades can change which account pays for inference. |+| voice_cloud_transcribe | Keep until v0.66. app/src/features/human/voice/sttClient.ts still sends it, with frontend and JSON-RPC regressions. Migrate that shipped caller before evaluating removal. |+| Legacy Ready artifact migration | Keep until v0.66, pending an explicit pre-files upgrade/import boundary for offline workspaces. Crash-safe copy/metadata handling and idempotence remain intact. |+| Legacy timestamped session adoption | Owned by TinyAgents, not core. [TinyAgents #390](https://github.com/tinyhumansai/tinyagents/pull/390) dates review to 2027-01-11 and removal to v3.0, requiring an explicit host upgrade/import boundary. No unpublished gitlink is consumed here. |## Production evidence limits