Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
9f7d180
refactor(memory): rehome host namespace store
senamakel Jul 22, 2026
2f7439c
refactor(memory-sync): retire host Gmail sync parser
senamakel Jul 22, 2026
c30398c
fix(flows): persist flow id on rejected resume
senamakel Jul 22, 2026
730f905
chore(vendor): align TinyAgents 2.1 dependency graph
senamakel Jul 22, 2026
20bc938
ci(tinycortex): cover persona feature
senamakel Jul 22, 2026
a14f95f
docs(tinycortex): refresh post-cutover migration state
senamakel Jul 22, 2026
d2386c8
refactor(embeddings): retire host provider duplicates
senamakel Jul 22, 2026
b09c4e8
refactor(memory): retire archivist compatibility domain
senamakel Jul 22, 2026
2f2723b
refactor(memory-search): import crate scoring directly
senamakel Jul 22, 2026
9e2fb9a
refactor(memory-tools): collapse crate forwarding files
senamakel Jul 22, 2026
19ef860
refactor(memory-queue): retire memory jobs alias
senamakel Jul 22, 2026
dd8d84b
refactor(tinycortex): remove unused type and tool facades
senamakel Jul 22, 2026
0c175b0
docs(memory): record TinyCortex consolidation results
senamakel Jul 22, 2026
137329f
docs(memory): remove stale facade references
senamakel Jul 22, 2026
3af0388
docs(tinycortex): stamp migration plan complete
senamakel Jul 22, 2026
e394d1c
Merge remote-tracking branch 'upstream/main' into feat/tinycortex-mig…
senamakel Jul 22, 2026
7f3f5b1
docs(memory-tree): remove retired tools link
senamakel Jul 22, 2026
0b52ad7
refactor(memory-tools): isolate store adapter
senamakel Jul 22, 2026
b20ac30
test(composio): exercise invalid contract gate input
senamakel Jul 22, 2026
28983e5
fix(memory-tools): preserve public types module
senamakel Jul 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-lite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ jobs:
key: tinycortex

- name: Run TinyCortex engine and Composio sync tests
run: bash scripts/ci-cancel-aware.sh cargo test --manifest-path vendor/tinycortex/Cargo.toml --features git-diff,sync
run: bash scripts/ci-cancel-aware.sh cargo test --manifest-path vendor/tinycortex/Cargo.toml --features git-diff,sync,persona

pr-ci-gate:
name: PR CI Gate
Expand Down
27 changes: 5 additions & 22 deletions Cargo.lock

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

14 changes: 5 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,12 @@ tinyagents = { version = "2.1", features = ["sqlite"] }
# queue/ingest/score + long tail), vendored as a git submodule and patched
# below to `vendor/tinycortex`. OpenHuman's memory subsystem migrates onto this
# crate through the adapter seam in `src/openhuman/tinycortex/` (mirroring the
# tinyagents seam): engine logic in the crate; RPC, agent tools, live sync,
# security gating, and the global singleton stay host-side. rusqlite/git2 are
# tinyagents seam): engine logic (including provider sync pipelines) in the
# crate; RPC, agent tools, sync scheduling/credentials/events, security gating,
# and the global singleton stay host-side. rusqlite/git2 are
# aligned to the host pins (=0.40 / 0.21) so one bundled SQLite + one libgit2
# link. Keep the version pin in lockstep with the submodule tag.
# link. The submodule intentionally tracks reviewed upstream main commits;
# keep this semver requirement compatible with the vendored crate version.
tinycortex = { version = "0.1", features = ["git-diff", "persona", "sync"] }
tinychannels = { version = "0.1", features = ["relay-websocket"] }
serde = { version = "1", features = ["derive"] }
Expand Down Expand Up @@ -704,12 +706,6 @@ tinyjuice = { path = "vendor/tinyjuice" }
tinychannels = { path = "vendor/tinychannels" }
tinyplace = { path = "vendor/tinyplace/sdk/rust" }

# TinyCortex temporarily pins the embedding API port while tinyagents #58 is
# pending. Resolve that git source to the same vendored crate so host adapters
# and TinyCortex share one `EmbeddingModel` trait identity.
[patch."https://github.com/senamakel/tinyagents"]
tinyagents = { path = "vendor/tinyagents" }

# Emit just enough DWARF in release builds for Sentry to symbolicate Rust
# panics + render surrounding source lines. `line-tables-only` keeps the
# binary small (only file+line tables, no full type info) while still
Expand Down
49 changes: 16 additions & 33 deletions app/src-tauri/Cargo.lock

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

4 changes: 2 additions & 2 deletions docs/TEST-COVERAGE-MATRIX.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,10 @@ End-to-end coverage of the agent harness via the web-chat RPC surface against an
| ----- | ------------------------------------------ | ----- | -------------------------------------------------------------------------------------------------------------- | ------ | ----------------------------------------------------------------------- |
| 8.4.1 | Save Preference (general / situational) | RU | `src/openhuman/agent/tools/save_preference_tests.rs` | ✅ | `save_preference` tool → `user_pref_{general,situational}`, topic-keyed |
| 8.4.2 | Lane A — Standing Prefs in System Prompt | RU | `src/openhuman/learning/prompt_sections.rs`, `src/openhuman/agent/harness/session/turn_tests.rs` | ✅ | General prefs rendered into the system prompt at thread start |
| 8.4.3 | Lane B — Situational Recall (vector-gated) | RU | `src/openhuman/memory/store/unified/query_tests.rs::recall_relevant_by_vector_gates_on_similarity` | ✅ | Per-turn; relevant query injects, unrelated suppresses |
| 8.4.3 | Lane B — Situational Recall (vector-gated) | RU | `src/openhuman/memory_store/namespace_store/query_tests.rs::recall_relevant_by_vector_gates_on_similarity` | ✅ | Per-turn; relevant query injects, unrelated suppresses |
| 8.4.4 | Same-Topic Contradiction (replace) | RU | `src/openhuman/agent/tools/save_preference_tests.rs::recategorising_moves_pref_between_namespaces` | ✅ | `ON CONFLICT REPLACE`; a topic lives in exactly one scope |
| 8.4.5 | Cross-Topic Contradiction Surfacing | RU | `src/openhuman/agent/tools/save_preference_tests.rs::save_surfaces_related_preference_for_contradiction_check` | ✅ | Related prefs surfaced in the tool result for the chat agent to resolve |
| 8.4.6 | vector_chunks Model-Signature Recall Guard | RU | `src/openhuman/memory/store/unified/query_tests.rs::vector_recall_excludes_other_model_signature` | ✅ | Excludes cross-model vectors; dim-guards legacy rows |
| 8.4.6 | vector_chunks Model-Signature Recall Guard | RU | `src/openhuman/memory_store/namespace_store/query_tests.rs::vector_recall_excludes_other_model_signature` | ✅ | Excludes cross-model vectors; dim-guards legacy rows |

### 8.5 Long-term Goals

Expand Down
17 changes: 11 additions & 6 deletions docs/tinycortex-api-gap-audit.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# TinyCortex API Gap Audit (Phase 0.2)

**Status (2026-07-22):** Historical gap inventory for the completed engine
cutover. Counts and source anchors below describe the audit base; unresolved
host consolidation work, including G1 re-homing and sync dedupe, is tracked in
`tinycortex-migration-plan-2026-07-22.md`.

**Purpose.** Map every host call site into the engine-mapping modules
(`memory_store`, `memory_tree`, `memory_queue`, and the long tail) onto a TinyCortex
public API. Where no crate API covers a host need, record a **gap** — each gap becomes a
Expand Down Expand Up @@ -48,16 +53,16 @@ The crate exposes every seam the plan expects, plus more. Host implements these:
| `Summariser` (time-tree, string) | `tree/runtime/engine.rs:29` | **divergent — see G6** |
| `EntityExtractor` (regex + LLM) | `score/extract/composite.rs:16` | `tinycortex/chat.rs` (LLM variant) |
| `QueueDelegates` | `queue/handlers.rs:96` | `tinycortex/queue_driver.rs` |
| `TreeJobSink` | `ingest/types.rs:15` | `tinycortex/sinks.rs` |
| `TreeLeafSink` | `archivist/sink.rs:44` | `tinycortex/sinks.rs` |
| `SnapshotItemSource` | `diff/source.rs:28` | `tinycortex/sinks.rs` |
| `EntityOccurrenceIndex` | `graph/types.rs:44` | `tinycortex/sinks.rs` |
| `TreeJobSink` | `ingest/types.rs:15` | `tinycortex/ingest.rs` |
| `TreeLeafSink` | `archivist/sink.rs:44` | `tinycortex/ingest.rs` |
| `SnapshotItemSource` | `diff/source.rs:28` | host diff adapter |
| `EntityOccurrenceIndex` | `graph/types.rs:44` | host graph adapter |
| `SelfIdentity` | `store/entity_index/store.rs:25` | host identity registry |
| `GoalsGenerator` | `goals/reflect.rs:57` | `tinycortex/chat.rs` |
| `SourceReader` | `sources/readers/mod.rs:1732` | local readers only *(amended: live-sync readers join the crate in W-SYNC, plan §8)* |
| `SyncEventSink` *(new, W-SYNC)* | `sync/traits.rs` (planned) | `tinycortex/sync_sink.rs` → `MemorySyncStage` bus events |
| `SkillDocSink` *(new, W-SYNC)* | `sync/traits.rs` (planned) | forwards to `MemoryClient::store_skill_sync` (host-retained unified tier) |
| `ConversationEventBus` / `ChannelEventHandler` | `conversations/bus.rs:106/95` | `tinycortex/bus.rs` (translate to `DomainEvent`) |
| `ConversationEventBus` / `ChannelEventHandler` | `conversations/bus.rs:106/95` | host `memory_conversations/bus.rs` (translate to `DomainEvent`) |

Config seam: `MemoryConfig{workspace, embedding: EmbeddingConfig{dim,model,strict},
tree: TreeConfig{input_token_budget,output_token_budget,summary_fanout,flush_age_secs},
Expand Down Expand Up @@ -86,7 +91,7 @@ retrieval: RetrievalConfig{default_profile}, sync_budget: SyncBudgetConfig}` +

### G2 — Graph relation-edge persistence (E2GraphRAG accumulation) — **HARD**

- **Host:** `memory_store/unified/graph.rs`, `unified/query.rs` persist and query co-occurrence
- **Host:** `memory_store/namespace_store/{graph,query}.rs` persist and query co-occurrence
/ LLM-triple relations; `NamespaceMemoryHit.supporting_relations: Vec<GraphRelationRecord>`
is populated at retrieval.
- **Crate:** persists the **entity occurrence index** at persist time
Expand Down
40 changes: 22 additions & 18 deletions docs/tinycortex-drift-ledger.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ touched an engine-mapping memory module after the port line, and classifies each
| Host audit SHA | `7850cf363559bcbb7ba688cbc4fccdb6bd9ce754` (`main`, 2026-07-04) |
| TinyCortex submodule | `vendor/tinycortex` → `tinyhumansai/tinycortex` |
| TinyCortex audit SHA | `d1a8c7be2babc8fff7a72ed93861f459f3d6fa58` |
| **TinyCortex pinned SHA (current)** | `a8e10f7dd8ebdb9b0905e1380fefcc6bf5a65207` — audit SHA **+ #59** (native-dep alignment, §0.4) **+ #63/#64** (D2/D1 drift ports) merged; this is the live gitlink |
| TinyCortex historical cutover SHA | `a8e10f7dd8ebdb9b0905e1380fefcc6bf5a65207` — audit SHA **+ #59** (native-dep alignment, §0.4) **+ #63/#64** (D2/D1 drift ports) merged |
| **TinyCortex reviewed gitlink (2026-07-22)** | `daaaf6ba5f02635c08deae2b2b2ed7fcc8c06b6a` — includes OpenHuman #4794/#4820/#4863-era crate work; upstream currently has no tags |
| **TinyCortex migration branch (current)** | `7b4b115` — TinyAgents 2.1 dependency alignment, standalone patch configuration, and corrected sync ownership docs |
| TinyCortex crate version | `0.1.1` |
| **Port line (derived)** | **after 2026-06-25, before 2026-06-28** (see below) |

Expand All @@ -38,6 +40,11 @@ touched an engine-mapping memory module after the port line, and classifies each
> (conversations) are now unblocked per the gate rule. D4 (memory_sync corpus,
> W-SYNC) remains its own separate track.

> **Consolidation status (2026-07-22): D1–D4 CLOSED.** D1–D3 remain closed.
> D4 was re-audited against the crate sync implementation and the live host
> dispatch path. The host schedulers, credentials, RPC, source-scope/redaction
> policy, product task normalizers, and event-bus adapters remain host-owned.

### How the port line was located

The port commits in `vendor/tinycortex` are all dated **2026-06-29**, but that is the date the
Expand Down Expand Up @@ -132,26 +139,23 @@ its `tools/` stay host (agent tools), its `vector`/`scoring` are engine (W5) —

## D4 — memory_sync corpus (2026-07-09 reclassification, W-SYNC)

The plan's §8 amendment moves the sync engine into the crate, so the blanket **HOST-OWNED
"live sync"** classification above is superseded for engine-mapping sync code. Unlike D1–D3 there
is **no existing crate port to diff against** — the entire `memory_sync/` engine (plus the
`memory_sources` dispatcher/reconcile parts) is port scope. The port baseline for W-SYNC is taken
**fresh from host `main` at W-SYNC.1 branch time**, so ordinary drift cannot accumulate; this entry
exists to (a) record the reclassification and (b) pin the post-port-line commits that already
touched the corpus, so the W-SYNC.1 port provably includes them:
The plan's §8 amendment moved the generic sync engine into the crate, so the
blanket **HOST-OWNED "live sync"** classification above is superseded for
engine-mapping sync code. The crate port landed in `0333d10` and is the path
called by `memory_sync::composio::run_connection_sync` and the default
`ComposioProvider::sync` implementation.

| # | Host commit | Files in corpus | Note |
| --- | --- | --- | --- |
| D4.1 | `c43f79641` (07-03) | `composio/providers/{sync_state,traits}.rs` | TinyAgents-cutover import churn |
| D4.2 | `27b00b539` (07-05) | `sources/rebuild.rs` | test-parity cleanup (1 line) |
| D4.3 | `653e6e143` (07-06) | `memory_sources/sync.rs` (+312) | self-heal drifted content-sha tokens + prune vanished folder items |
| D4.4 | `e456b7799` (07-07) | `memory_sources/{rpc,sync}.rs`, `canonicalize/email.rs`, `composio/providers/{gmail/post_process,notion/source,orchestrator}.rs`, `sources/github.rs` | orchestration-fixes wave |

**Gate:** W-SYNC.1 (crate scaffolding PR) requires this enumeration current as of its branch point
(re-run the scan: `git log --since=2026-06-25 --oneline -- src/openhuman/memory_sync
src/openhuman/memory_sources`); the W-SYNC.3 host flip requires D4 **CLOSED** — every listed commit
(and any accrued since) verifiably contained in the crate port or explicitly waived. Host-retained
parts (schedulers, bus subscribers, RPC wrappers, keychain/OAuth) remain HOST-OWNED as before.
| D4.1 | `c43f79641` (07-03) | `composio/providers/{sync_state,traits}.rs` | ✅ **CLOSED.** Import churn only; persistence and provider dispatch are implemented by the `SyncStateStore` seam and crate dispatcher. |
| D4.2 | `27b00b539` (07-05) | `sources/rebuild.rs` | ✅ **CLOSED.** Test-only parity cleanup; no engine semantic delta. |
| D4.3 | `653e6e143` (07-06) | `memory_sources/sync.rs` (+312) | ✅ **CLOSED.** Crate `sync/workspace.rs` updates changed items and prunes vanished items through `LocalDocumentSink::delete`; covered by workspace sync tests. |
| D4.4 | `e456b7799` (07-07) | `memory_sources/{rpc,sync}.rs`, `canonicalize/email.rs`, `composio/providers/{gmail/post_process,notion/source,orchestrator}.rs`, `sources/github.rs` | ✅ **CLOSED.** Generic provider fetch/pagination/canonical memory records are in the crate port; orchestration, product task normalization, action-result presentation, and RPC fixes are host policy by design. |

**Gate result:** D4 is **CLOSED**. Gmail's Composio 413 mitigation is additionally
present in crate commit `ba9e12e` (25-message fetch pages). Host-retained parts
(schedulers, bus subscribers, RPC wrappers, keychain/OAuth, action tools and
product task/profile projections) remain HOST-OWNED.

## Closing the ledger (procedure)

Expand Down
Loading
Loading