Skip to content

refactor(memory): finish TinyCortex consolidation - #5140

Merged
senamakel merged 20 commits into
tinyhumansai:mainfrom
senamakel:feat/tinycortex-migration-2026-07-22
Jul 23, 2026
Merged

refactor(memory): finish TinyCortex consolidation#5140
senamakel merged 20 commits into
tinyhumansai:mainfrom
senamakel:feat/tinycortex-migration-2026-07-22

Conversation

@senamakel

@senamakel senamakel commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

  • Finishes the post-cutover TinyCortex consolidation described in the July 22 migration plan.
  • Rehomes the host-owned namespace/document store and removes obsolete archivist, search, tool-memory, queue, tree-tool, and embedding-provider facades.
  • Routes provider embedding transport through TinyAgents while retaining OpenHuman configuration, credentials, privacy, RPC, and product policy.
  • Confirms the default sync path is already TinyCortex-backed, removes the dead Gmail parser, and records the host/crate ownership boundary.
  • Aligns vendor dependency identity and expands TinyCortex CI coverage to the persona feature.

Problem

  • OpenHuman still carried duplicate provider implementations and compatibility shims after the TinyCortex engine cutover.
  • The memory migration documentation described an incomplete state, contained stale paths, and did not reflect the live crate-backed sync route.
  • The host and nested crates had inconsistent TinyAgents requirements, while CI omitted a feature enabled by the shipped host.

Solution

  • Keep the ten-table product namespace store host-owned under memory_store/namespace_store while deleting engine-shaped staging terminology.
  • Import canonical TinyCortex scoring, retrieval, archivist, and tool-memory APIs directly and retain only product orchestration seams.
  • Add a ProviderEmbedder bridge over TinyAgents models; move Ollama context/batch options and missing-model guidance into TinyAgents.
  • Preserve schedulers, credentials, redaction, source-scope policy, RPC, event publishing, and product normalization in OpenHuman.
  • Close D4.1-D4.4, update the deletion ledger, and stamp the migration plan complete with validation evidence.

Submission Checklist

If a section does not apply to this change, mark the item as N/A with a one-line reason. Do not delete items.

  • Tests added or updated (happy path + at least one failure / edge case) per Testing Strategy — provider option/default/error tests updated; existing namespace, sync, parity, and E2E coverage retargeted.
  • Diff coverage ≥ 80% — changed lines (Vitest + cargo-llvm-cov merged via diff-cover) meet the gate enforced by .github/workflows/ci-lite.yml. CI Lite is the authoritative diff-coverage gate; the pre-PR CI Full run is green.
  • Coverage matrix updated — paths for feature rows 8.4.3 and 8.4.6 now point at namespace_store.
  • All affected feature IDs from the matrix are listed in the PR description under ## Related.
  • No new external network dependencies introduced (mock backend used per Testing Strategy).
  • N/A: manual smoke checklist unchanged because this is an internal engine/provider consolidation with no new release-cut UI surface.
  • N/A: no tracking issue was filed for this dated migration plan.

Impact

  • Desktop, CLI, and embedded-core behavior retain the same RPC and product-policy boundaries.
  • Ollama embeddings can explicitly request the recommended 8192-token context and batch size through TinyAgents.
  • Removes 2,739 net lines from the host diff, leaves zero sqlite_conn escape references, and reduces the TinyCortex seam to 2,229 pre-test lines.
  • On-disk namespace and security-sensitive MemoryTaint formats remain pinned by existing parity coverage.

Related


AI Authored PR Metadata (required for Codex/Linear PRs)

Linear Issue

  • Key: N/A
  • URL: N/A

Commit & Branch

  • Branch: feat/tinycortex-migration-2026-07-22
  • Commit SHA: 28983e5

Validation Run

  • pnpm --filter openhuman-app format:check — N/A: no frontend source change; formatting is covered by CI Lite.
  • pnpm typecheck — N/A: no frontend TypeScript change.
  • Focused tests: namespace store 153 passed; sync providers 301 passed; TinyAgents embeddings 38 passed; TinyCortex 1284 unit tests plus integration/doc tests passed; TinyFlows 340 passed.
  • Rust fmt/check (if changed): GGML_NATIVE=OFF cargo check --lib passed; the no-default-features tokenjuice-treesitter check passed.
  • Tauri fmt/check (if changed): CI Full Rust Tauri Shell Tests passed.

Validation Blocked

  • command: local pnpm rust:check
  • error: this box has CMake 3.19 while CEF requires 3.21, and GGML native flags require the documented macOS workaround
  • impact: none; the GitHub Actions Tauri shell suite and all three desktop builds passed

Behavior Changes

  • Intended behavior change: use one canonical embedding transport implementation and preserve the crate-backed memory/sync paths without compatibility shims.
  • User-visible effect: clearer Ollama missing-model remediation; otherwise no intended user-visible change.

Parity Contract

  • Legacy behavior preserved: yes; host policy/RPC/event surfaces and namespace-store formats remain intact.
  • Guard/fallback/dispatch parity checks: MemoryTaint/format pins, namespace tests, sync provider tests, mock-backend Rust E2E, and the full desktop matrix passed.

Duplicate / Superseded PR Handling

  • Duplicate PR(s): N/A
  • Canonical PR: this PR
  • Resolution (closed/superseded/updated): N/A

@senamakel
senamakel requested a review from a team July 22, 2026 17:00
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 13 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6cc599fa-3780-430e-8615-8e541ff4049b

📥 Commits

Reviewing files that changed from the base of the PR and between fb1f909 and 28983e5.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • app/src-tauri/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (103)
  • .github/workflows/ci-lite.yml
  • Cargo.toml
  • docs/TEST-COVERAGE-MATRIX.md
  • docs/tinycortex-api-gap-audit.md
  • docs/tinycortex-drift-ledger.md
  • docs/tinycortex-memory-migration-plan.md
  • docs/tinycortex-migration-plan-2026-07-22.md
  • docs/tinycortex-migration-spec.md
  • docs/tinycortex-parity-checklist.md
  • gitbooks/developing/architecture.md
  • src/core/observability.rs
  • src/openhuman/agent/harness/archivist/hook_impl.rs
  • src/openhuman/agent/harness/archivist/recap.rs
  • src/openhuman/embeddings/README.md
  • src/openhuman/embeddings/cohere_adapter.rs
  • src/openhuman/embeddings/mod.rs
  • src/openhuman/embeddings/mod_tests.rs
  • src/openhuman/embeddings/noop.rs
  • src/openhuman/embeddings/ollama_adapter.rs
  • src/openhuman/embeddings/openai_adapter.rs
  • src/openhuman/embeddings/voyage_adapter.rs
  • src/openhuman/inference/local/model_requirements.rs
  • src/openhuman/learning/README.md
  • src/openhuman/learning/cache.rs
  • src/openhuman/memory/README.md
  • src/openhuman/memory/mod.rs
  • src/openhuman/memory/read_rpc_tests.rs
  • src/openhuman/memory_archivist/mod.rs
  • src/openhuman/memory_queue/mod.rs
  • src/openhuman/memory_search/mod.rs
  • src/openhuman/memory_search/scoring.rs
  • src/openhuman/memory_search/tools/hybrid_search.rs
  • src/openhuman/memory_search/tools/vector_search.rs
  • src/openhuman/memory_search/vector/mmr.rs
  • src/openhuman/memory_search/vector/mod.rs
  • src/openhuman/memory_store/README.md
  • src/openhuman/memory_store/client.rs
  • src/openhuman/memory_store/factories.rs
  • src/openhuman/memory_store/kv.rs
  • src/openhuman/memory_store/memory_trait.rs
  • src/openhuman/memory_store/mod.rs
  • src/openhuman/memory_store/namespace_store/README.md
  • src/openhuman/memory_store/namespace_store/documents.rs
  • src/openhuman/memory_store/namespace_store/documents_tests.rs
  • src/openhuman/memory_store/namespace_store/events.rs
  • src/openhuman/memory_store/namespace_store/events_tests.rs
  • src/openhuman/memory_store/namespace_store/fts5.rs
  • src/openhuman/memory_store/namespace_store/graph.rs
  • src/openhuman/memory_store/namespace_store/helpers.rs
  • src/openhuman/memory_store/namespace_store/init.rs
  • src/openhuman/memory_store/namespace_store/mod.rs
  • src/openhuman/memory_store/namespace_store/profile.rs
  • src/openhuman/memory_store/namespace_store/profile_tests.rs
  • src/openhuman/memory_store/namespace_store/query.rs
  • src/openhuman/memory_store/namespace_store/query_tests.rs
  • src/openhuman/memory_store/namespace_store/segments.rs
  • src/openhuman/memory_store/namespace_store/segments_tests.rs
  • src/openhuman/memory_sync/README.md
  • src/openhuman/memory_sync/composio/providers/clickup/mod.rs
  • src/openhuman/memory_sync/composio/providers/clickup/normalization.rs
  • src/openhuman/memory_sync/composio/providers/clickup/provider.rs
  • src/openhuman/memory_sync/composio/providers/clickup/tests.rs
  • src/openhuman/memory_sync/composio/providers/github/mod.rs
  • src/openhuman/memory_sync/composio/providers/github/normalization.rs
  • src/openhuman/memory_sync/composio/providers/github/provider.rs
  • src/openhuman/memory_sync/composio/providers/github/tests.rs
  • src/openhuman/memory_sync/composio/providers/gmail/mod.rs
  • src/openhuman/memory_sync/composio/providers/gmail/sync.rs
  • src/openhuman/memory_sync/composio/providers/gmail/tests.rs
  • src/openhuman/memory_sync/composio/providers/linear/mod.rs
  • src/openhuman/memory_sync/composio/providers/linear/normalization.rs
  • src/openhuman/memory_sync/composio/providers/linear/provider.rs
  • src/openhuman/memory_sync/composio/providers/linear/tests.rs
  • src/openhuman/memory_sync/composio/providers/notion/mod.rs
  • src/openhuman/memory_sync/composio/providers/notion/normalization.rs
  • src/openhuman/memory_sync/composio/providers/notion/provider.rs
  • src/openhuman/memory_sync/composio/providers/notion/tests.rs
  • src/openhuman/memory_sync/workspace/mod.rs
  • src/openhuman/memory_tools/README.md
  • src/openhuman/memory_tools/capture.rs
  • src/openhuman/memory_tools/prompt.rs
  • src/openhuman/memory_tools/store.rs
  • src/openhuman/memory_tools/types.rs
  • src/openhuman/memory_tree/README.md
  • src/openhuman/memory_tree/mod.rs
  • src/openhuman/memory_tree/score/embed/README.md
  • src/openhuman/memory_tree/score/embed/cloud.rs
  • src/openhuman/memory_tree/score/embed/factory.rs
  • src/openhuman/memory_tree/score/embed/mod.rs
  • src/openhuman/memory_tree/score/embed/ollama.rs
  • src/openhuman/memory_tree/tools.rs
  • src/openhuman/mod.rs
  • src/openhuman/scheduler_gate/gate.rs
  • src/openhuman/tinycortex/mod.rs
  • src/openhuman/tinycortex/queue_driver.rs
  • tests/agent_retrieval_e2e.rs
  • tests/memory_golden_parity_e2e.rs
  • tests/raw_coverage/composio_credentials_state_raw_coverage_e2e.rs
  • tests/raw_coverage/embeddings_ollama_raw_coverage_e2e.rs
  • tests/raw_coverage/memory_sync_providers_raw_coverage_e2e.rs
  • tests/raw_coverage/memory_tree_embed_round25_raw_coverage_e2e.rs
  • vendor/tinyagents
  • vendor/tinycortex

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e394d1c901

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/openhuman/memory_tools/mod.rs Outdated
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 22, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0b52ad7f1a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/openhuman/memory_tools/mod.rs Outdated
@senamakel
senamakel merged commit 2bcd344 into tinyhumansai:main Jul 23, 2026
22 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant