Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[patch.crates-io]
# Keep standalone TinyCortex builds offline-friendly and pinned to the nested
# submodule. Embedding hosts ignore this config and may patch the same registry
# requirement to their own TinyAgents checkout.
tinyagents = { path = "vendor/tinyagents" }
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ jobs:
flags: --no-default-features --features git-diff
- name: sync
flags: --no-default-features --features sync
- name: persona
flags: --no-default-features --features persona
- name: all features
flags: --all-features
steps:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

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

8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ serde_json = "1"
schemars = "1"
sha2 = "0.10"
thiserror = "2"
# Kept in lockstep with OpenHuman's vendored TinyAgents checkout. Initialize it
# after cloning with `git submodule update --init vendor/tinyagents`.
tinyagents = { version = "2", path = "vendor/tinyagents" }
# Kept in lockstep with OpenHuman's vendored TinyAgents checkout. Standalone
# development resolves this requirement to `vendor/tinyagents` through
# `.cargo/config.toml`; embedding hosts may supply their own crates.io patch so
# the host and TinyCortex share one `EmbeddingModel` trait identity.
tinyagents = "2.1"
toml = "0.8"
uuid = { version = "1", features = ["serde", "v4"] }
walkdir = "2"
Expand Down
2 changes: 1 addition & 1 deletion docs/openhuman-memory-engine-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This document captures the OpenHuman memory engine as the target functional
specification for TinyCortex. It is source-derived from
`/Users/enamakel/work/tinyhumansai/openhuman-workflow/openhuman/src/openhuman`.
the vendoring host's `src/openhuman/` tree.

## Scope

Expand Down
29 changes: 16 additions & 13 deletions docs/openhuman-memory-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ This repository now has a Rust crate rooted at the repository root. The first
migration target is the memory core: stable contracts, storage primitives, and
testable in-process behavior before API or UI integrations.

TinyCortex will not own memory sync. OpenHuman owns the sync module and
decides when data is ingested on demand. TinyCortex should assume OpenHuman
supplies source-scoped payloads or canonical ingest requests, then process them
through TinyCortex contracts.
TinyCortex owns the generic sync engine and provider pipelines behind its
optional `sync` feature. OpenHuman retains scheduling, credentials, RPC,
source-scope/redaction policy, and event-bus publishing, and supplies those
product concerns through the sync adapter traits.

## Source Modules

Use `/Users/enamakel/work/tinyhumansai/openhuman-workflow/openhuman/src/openhuman`
as the current source checkout unless a later branch is chosen.
Compare against the vendoring host's `src/openhuman/` tree; do not encode a
developer-specific absolute checkout path in migration notes.

- `memory/`: orchestration for query, remember, OpenHuman-triggered ingest, and
RPC surfaces.
Expand Down Expand Up @@ -41,17 +41,19 @@ The memory engine now lives under `src/memory/` as cohesive modules:
`conversations/`, `archivist/`: specialized memory surfaces.

Future host adapters should keep OpenHuman's layer rule: orchestration depends
on storage, but storage does not depend upward on orchestration. The OpenHuman
memory sync module remains outside this crate.
on storage, but storage does not depend upward on orchestration. Generic sync
fetch/pagination/canonical-record mechanics live in this crate behind injected
traits; OpenHuman retains scheduling, credentials, source policy, event-bus
translation, RPC, and product projections.

## Migration Order

1. Port pure data types and tests that do not depend on OpenHuman runtime state.
2. Port content and chunk storage behind the `MemoryStore` contract.
3. Port tree IO and bucket-seal mechanics with storage injected by traits.
4. Port queue workers only after persistence and deterministic drain tests exist.
5. Add OpenHuman-facing on-demand ingest adapters; do not port the live sync
scheduler into TinyCortex.
5. Add OpenHuman-facing ingest and sync adapters; keep the live scheduler in
OpenHuman.

## Port Status

Expand Down Expand Up @@ -79,9 +81,10 @@ are the current validation gates).
| `conversations` | `memory_conversations` | JSONL transcript store, inverted index, persistence bus. |
| `archivist` | `memory_archivist` | Conversation turns → one tree leaf (tool-JSON stripped). Tree-leaf sink injected. |

Per the ownership boundary, the live sync runner, OAuth/webhook callbacks, and
real LLM/embedding/network backends remain host-owned (OpenHuman) and are
represented here as injectable traits. Known follow-ups: consolidate legacy
Per the ownership boundary, the live sync scheduler, OAuth/webhook callbacks,
credentials, and real LLM/embedding/network backends remain host-owned
(OpenHuman) and are represented here as injectable traits. Generic provider
pipelines and workspace reconciliation are crate-owned. Known follow-ups: consolidate legacy
`score::store` entity-index helpers around `store::entity_index`; restore the
deferred peripheral surfaces (tree `health`/`nlp`, retrieval RPC/fast paths,
obsidian/wiki-git content, controller/tool registries) as host adapters land.
2 changes: 1 addition & 1 deletion docs/openhuman-memory/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ owns the sync module and decides when data is ingested on demand. These specs
describe the contracts TinyCortex exposes after OpenHuman supplies source data.

Source checkout used for this pass:
`/Users/enamakel/work/tinyhumansai/openhuman-workflow/openhuman/src/openhuman`.
the vendoring host's `src/openhuman/` tree.

## Documents

Expand Down
6 changes: 3 additions & 3 deletions docs/openhuman-memory/openhuman-code-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This document is a source-grounded reference for porting OpenHuman's memory
engine into TinyCortex. It records the observed module responsibilities,
contract types, operation boundaries, and implementation invariants from:

`/Users/enamakel/work/tinyhumansai/openhuman-workflow/openhuman/src/openhuman`.
the vendoring host's `src/openhuman/` tree.

The goal is not to copy OpenHuman wholesale. TinyCortex should preserve the
contracts and failure semantics first, then reimplement storage and workers with
Expand Down Expand Up @@ -733,8 +733,8 @@ and wire-stable types for future adapters.
3. Port goals, tool memory, entities, graph edges, and source validation first.
4. Add storage traits around namespace documents, chunks, trees, vectors, KV,
and archive records.
5. Implement source reader shapes and optional sync adapters behind the
`SyncPipeline` trait; keep the live sync runner in OpenHuman.
5. Implement source reader shapes and provider pipelines behind sync traits;
keep scheduling, credentials, policy, and product events in OpenHuman.
6. Implement tree registry and tree IO before queue workers.
7. Add queue dedupe keys, status transitions, and deferred outcomes.
8. Add diff snapshots/checkpoints as a separate ledger.
Expand Down
4 changes: 2 additions & 2 deletions docs/openhuman-memory/sources-registry-sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,5 +191,5 @@ src/memory/ingest/canonicalize/

Port order: source kind/types/validation, registry patch semantics, reader
trait and static reader contracts, canonicalizer pure functions, then
OpenHuman-facing on-demand ingest adapters. Do not port the live sync scheduler
into TinyCortex.
OpenHuman-facing ingest and sync adapters. The provider pipeline is crate-owned;
the live scheduler, credentials, policy, and product events stay in OpenHuman.
9 changes: 4 additions & 5 deletions docs/plan/05-openhuman-compat-matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,10 @@ kind fields + sync budgets `types.rs:68-146`; discriminator validation
reconciliation with `source_kind = raw_file` so interrupted syncs don't
strand raw files (spec: sources-registry-sync.md §Raw Archive Coverage).

Network fetchers (composio/github/rss/web/twitter) are **⏸ host-owned by
design** — the TinyCortex boundary is the on-demand ingest call. Their only
compatibility obligation is that the `reader_for` seam returns `None` so the
host routes them through its own sync runner. **Do not port the live sync
scheduler.**
Generic Composio provider fetch/pagination pipelines are crate-owned behind
injected network and persistence traits. Provider credentials, the scheduler,
source policy, RPC, events, and non-Composio product integrations remain
host-owned. **Do not port the live sync scheduler.**

---

Expand Down