Skip to content

test(memory): migrate engine coverage to TinyCortex - #4820

Merged
senamakel merged 5 commits into
tinyhumansai:mainfrom
senamakel:fix/tinycortex-memory-test-migration
Jul 13, 2026
Merged

senamakel merged 5 commits into
tinyhumansai:mainfrom
senamakel:fix/tinycortex-memory-test-migration

Conversation

@senamakel

@senamakel senamakel commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary

  • Remove 31 redundant OpenHuman unit tests for memory behavior now owned by TinyCortex.
  • Retain OpenHuman coverage for RPC, credentials/config, event bus, persistence, source side effects, and the fail-closed MemoryTaint seam.
  • Run TinyCortex's engine and Composio sync suites when its gitlink or test workflows change in CI Lite.
  • Run the TinyCortex suite in a separate parallel job in the reusable full workflow.
  • Document the audited test-ownership boundary and focused verification commands.

Problem

  • Cargo does not execute dependency test targets when testing openhuman, so migrated TinyCortex memory and Composio sync tests were absent from OpenHuman's merge gates.
  • Pure OpenHuman re-export shims still duplicated engine assertions, obscuring which repository owned those behaviors.

Solution

  • Delete duplicate shim-level assertions after verifying equivalent or stronger coverage exists in TinyCortex.
  • Keep host tests where behavior crosses an OpenHuman product or security boundary.
  • Add a dedicated TinyCortex CI job rather than extending the already long OpenHuman Rust job timeout.

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
  • Diff coverage ≥ 80% — changed lines (Vitest + cargo-llvm-cov merged via diff-cover) meet the gate enforced by .github/workflows/ci-lite.yml. Run pnpm test:coverage and pnpm test:rust locally; PRs below 80% on changed lines will not merge.
  • N/A: no feature row was added, removed, or renamed in docs/TEST-COVERAGE-MATRIX.md.
  • N/A: no affected feature IDs; this changes test ownership and CI execution only.
  • No new external network dependencies introduced (mock backend used per Testing Strategy)
  • N/A: no release-cut surface changed.
  • N/A: no tracking issue was provided for this audit.

Impact

  • No runtime or user-visible behavior change.
  • TinyCortex memory and mocked Composio sync regressions now block relevant CI Lite runs and every full Rust workflow run.
  • The TinyCortex full suite runs in parallel to avoid consuming the OpenHuman Rust job's timeout.

Related

  • Closes: N/A — no tracking issue provided.
  • Follow-up PR(s)/TODOs: N/A.

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

Keep this section for AI-authored PRs. For human-only PRs, mark each field N/A.

Linear Issue

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

Commit & Branch

  • Branch: fix/tinycortex-memory-test-migration
  • Commit SHA: ff6c6efab

Validation Run

  • pnpm --filter openhuman-app format:check
  • pnpm typecheck
  • Focused tests: TinyCortex full suite (1,181 unit tests plus integration/doc tests); mocked Composio sync suite (12 tests)
  • Rust fmt/check (if changed): cargo fmt --all -- --check; pre-push Tauri cargo check
  • Tauri fmt/check (if changed): pre-push hook passed

Validation Blocked

  • command: cargo test --test raw_coverage_all memory_sync -- --test-threads=1
  • error: local compiler stopped making progress under unrelated host-wide Rust build and memory pressure; terminated without a test result.
  • impact: OpenHuman memory E2E remains for authoritative CI execution; TinyCortex's full and focused Composio suites passed locally.

Behavior Changes

  • Intended behavior change: none; test ownership and CI gating only.
  • User-visible effect: none.

Parity Contract

  • Legacy behavior preserved: OpenHuman product-boundary and security seam tests remain in place.
  • Guard/fallback/dispatch parity checks: TinyCortex engine coverage plus OpenHuman RPC, configuration, persistence, event-bus, and taint tests.

Duplicate / Superseded PR Handling

  • Duplicate PR(s): none found for this head branch.
  • Canonical PR: this PR.
  • Resolution (closed/superseded/updated): N/A.

Summary by CodeRabbit

  • New Features

    • Added a dedicated TinyCortex memory/synchronization test job to CI and integrated it into the merge gate.
    • CI now detects when vendored TinyCortex changes occur and emits corresponding lane output to drive the extra checks.
  • Documentation

    • Expanded the TinyCortex parity checklist with clearer test ownership details and updated CI/local verification guidance.
  • Tests

    • Consolidated TinyCortex-related validation into the dedicated CI lane, reducing redundant internal unit test coverage.

@senamakel
senamakel requested a review from a team July 13, 2026 12:35
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

TinyCortex receives dedicated reusable and CI Lite test jobs with submodule setup, caching, feature-enabled Cargo tests, and PR-gate enforcement. Related OpenHuman unit tests are removed, and the parity checklist documents the new test-ownership boundary and verification commands.

Changes

TinyCortex CI and test ownership

Layer / File(s) Summary
Test ownership boundary
docs/tinycortex-parity-checklist.md, src/openhuman/memory_queue/ops.rs, src/openhuman/memory_search/scoring.rs, src/openhuman/memory_store/chunks/types.rs, src/openhuman/memory_store/trees/types.rs, src/openhuman/memory_tree/score/*
Migrated OpenHuman unit tests are removed, compatibility documentation is updated, and TinyCortex ownership plus local verification commands are documented.
Reusable TinyCortex test job
.github/workflows/test-reusable.yml
Adds a conditional job that initializes TinyCortex, caches its build target, and runs cargo test with git-diff,sync.
CI Lite detection and gate
.github/workflows/ci-lite.yml
Detects TinyCortex changes, runs dedicated memory tests, and requires their result in the PR CI gate.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Changes as CI Lite changes
  participant Tests as tinycortex-tests
  participant Cargo
  participant Gate as pr-ci-gate
  Changes->>Tests: Detect vendor/tinycortex changes
  Tests->>Cargo: Run cargo test with git-diff,sync
  Cargo-->>Tests: Return test status
  Tests-->>Gate: Report TinyCortex Memory Tests
Loading

Possibly related PRs

Suggested labels: rust-core, working

Poem

A bunny hops through CI’s lane,
TinyCortex tests now bloom again.
Submodules wake, caches hum,
Cargo drums a sync-time drum.
The gate checks every glowing ear!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: migrating memory engine test coverage to TinyCortex.

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

@coderabbitai coderabbitai Bot added feature Net-new user-facing capability or product behavior. rust-core Core Rust runtime in src/: CLI, core_server, shared infrastructure. labels Jul 13, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci-lite.yml:
- Around line 166-169: Update the tinycortex path filter used by the
tinycortex-tests job to include .gitmodules and scripts/ci-cancel-aware.sh
alongside the existing workflow and vendor paths, ensuring setup or runner
changes trigger the tests instead of skipping them.

In `@src/openhuman/memory_store/chunks/types.rs`:
- Line 15: Update the ownership documentation near the DataSource re-export to
match the actual exported API: either state that DataSource is sourced from and
re-exported by TinyCortex, or remove the re-export if host ownership remains
intended. Keep the comment and DataSource export consistent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2bfa77a4-83d1-4c0f-ad11-35ea7919c762

📥 Commits

Reviewing files that changed from the base of the PR and between f2abbc5 and 1894dbe.

📒 Files selected for processing (9)
  • .github/workflows/ci-lite.yml
  • .github/workflows/test-reusable.yml
  • docs/tinycortex-parity-checklist.md
  • src/openhuman/memory_queue/ops.rs
  • src/openhuman/memory_search/scoring.rs
  • src/openhuman/memory_store/chunks/types.rs
  • src/openhuman/memory_store/trees/types.rs
  • src/openhuman/memory_tree/score/mod.rs
  • src/openhuman/memory_tree/score/mod_tests.rs
💤 Files with no reviewable changes (5)
  • src/openhuman/memory_store/trees/types.rs
  • src/openhuman/memory_tree/score/mod.rs
  • src/openhuman/memory_search/scoring.rs
  • src/openhuman/memory_tree/score/mod_tests.rs
  • src/openhuman/memory_queue/ops.rs

Comment thread .github/workflows/ci-lite.yml
Comment thread src/openhuman/memory_store/chunks/types.rs
@coderabbitai coderabbitai Bot added working A PR that is being worked on by the team. and removed feature Net-new user-facing capability or product behavior. labels Jul 13, 2026
@senamakel
senamakel merged commit e38e81d into tinyhumansai:main Jul 13, 2026
17 of 29 checks passed
senamakel added a commit to nocstah/openhuman that referenced this pull request Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust-core Core Rust runtime in src/: CLI, core_server, shared infrastructure. working A PR that is being worked on by the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant