Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

Commits on main

bc1cd15
fix(scoring): address second-reviewer findings\n\nFour issues from the independent review pass on PR #5825.\n\n**runner.rs — entity guard polarity (blocking)**\nAll three non-success branches (extract_entities error, as_scoring() None,\nbinding unavailable) returned `false`, meaning `entities_empty = false` →\nthe fast path ran regardless of whether grounding was verified. This inverted\nthe relevance guard: any failure silently bypassed the #4677 optimisation\ngating logic. The pre-scoring behaviour was fail-safe — an unavailable\nextractor returned empty entities → `entities_empty = true` → fast path\nskipped. The bus-based path must preserve that contract: all error branches\nnow return `true` (defer to model walk). Also removed the unreachable\nARTIFACT_CAPABILITIES branch in the None arm; since Scoring is in the pinned\nconstant, `as_scoring()` never returns None for ModuleMemoryProvider, making\nthe warn! dead code that checked a constant against itself.\n\n**archivist_tests.rs — defanged negative tests**\nBoth `embed_segment_recap_skips_empty_summary` and `…_whitespace_summary`\nused `seg::segment_embedding_get(&conn, segment_id, "any-model")`. That\nfunction queries `WHERE segment_id = ? AND model_signature = ?` — "any-model"\nnever matches a real write (slug used is the configured model signature), so\nthe `row.is_none()` assertion was always vacuously true and could not detect\na regression. Replaced with `RecordingProvider` + assert `scoring.embed_text`\nabsent from calls: the actual invariant is that the guard fires before the\nscoring path, not merely that a DB row with the wrong key is missing.\n\n**archivist_tests.rs — non-interpolating .expect()**\n`.expect("…; got {methods:?}")` — curly braces are not interpolated in a\nstring literal, so a failure would have printed the literal text rather than\nthe method list. Changed to `.unwrap_or_else(|| panic!("…; got {methods:?}"))`.\n\n**driver_tests.rs — stale version comment**\nComment said "v1.13.1 adding Scoring". v1.13.1 was released 95 minutes before\nPR #110 (which added scoring to tinymemory) merged; v1.13.2 is the first\nartifact to include it. Updated to v1.13.2.\n\n**inference/embeddings/rpc.rs — drift hazard explanation**\nAdded explicit comment explaining why `MemoryScoring::embedder_slug()` is not\nused here: `get_settings` is a sync config-reading handler; the bus call is\nasync and requires a running module binding. This function answers "what slug\nwill be used?" — a config-derived prediction that must work before the module\nloads.\n\n**Cargo.lock — tinymemory root workspace version**\nThe submodule was moved to v1.13.2 in a prior commit but the root Cargo.lock\nwas not regenerated. Updated to match.\n
shanu committed 3 months ago
788a7ff
feat: wire MemoryScoring bus family into openhuman (#5560)\n\nRoutes three tinymemory-core engine calls through the memory bus,\neliminating the last direct engine deps for entity extraction and embedding.\n\nBus contract (tinymemory feat/5560-memory-scoring):\n- extract_entities(query) -> Vec<String>\n- embed_text(text) -> Vec<f32>\n- embedder_slug() -> String\n\nHost wiring:\n- modules/memory.rs: ModuleMemoryProvider implements MemoryScoring via\n module_call! (ExtractEntities / EmbedText / EmbedderSlug)\n- memory/guard/families.rs: GuardedScoring decorator + MemoryScoring impl\n- memory/guard/provider.rs: scoring field wired into MemoryGuard\n- memory/guard/test_support.rs: RecordingProvider implements MemoryScoring\n\nCall-site migrations:\n- archivist/lifecycle.rs: embed_segment_recap uses provider.as_scoring()\n instead of building an embedder directly from tinymemory-core\n- runner.rs: extract_query_entities routed through provider.as_scoring()\n with fail-open on missing Scoring family\n- inference/embeddings/rpc.rs: effective_embedder_slug resolved host-side\n from config ladder without calling the engine\n\nCompat fixes (v1.13.0 API changes landed with vendor bump):\n- memory/host.rs + memory_host.rs: StoreCorruptQuarantined arm added\n- memory/sources/rpc.rs: SyncAuditEntry gains tree_ingest_failures/tree_error\n- all_tests.rs: Capability::Scoring -> false in has_rpc_surface\n- ops/provider.rs: 'scoring' added to capability list assertion\n\n762 tests pass, clippy -D warnings clean\n
shanu committed 3 months ago
0f6d76f
Close three review findings: a fail-open probe, divergence, and comments\n\nAll three are the gate failing open or failing wrong, which for a gate whose\nwhole purpose is to stop silent drift is worse than not having it.\n\n**The submodule probe walked up to the superproject (Codex P1).**\n`git -C vendor/tinymemory rev-parse --git-dir` does not answer "is this a\nchecked-out submodule". Git walks upward, so from an uninitialised — or\nmerely empty — directory it answers the SUPERPROJECT's `.git` and exits 0.\nThe probe reported "present" having checked nothing, enabling a case whose\nCLI then failed for exactly the reason the probe was meant to detect. That\nis this gate's own failure mode reproduced inside its test helper.\n\nReplaced with `--show-toplevel`, which answers the root of whichever\nrepository owns the directory: only when that root IS the directory is the\nsubmodule really there. Extracted as `toplevelProvesSubmodule` so it is\ntestable rather than living in a test-local helper, and compared through\n`realpathSync` on both sides — macOS resolves /tmp to /private/tmp, and\ncomparing a resolved path against an unresolved one is its own false\nnegative.\n\n**A divergent pin was classified as forward (Codex P2).**\n`merge-base --is-ancestor head base` exiting 1 means "head is not an\nancestor of base", which covers BOTH a genuine fast-forward and two commits\nthat have diverged — a side branch, or a submodule whose history was\nrebased. Reading the single failed query as forward let divergence through.\nDivergence drops whatever the base branch had just as surely as a rewind\ndoes; it only does it sideways, and a rewind onto a sibling is one rebase\naway from 3fd1de32e's shape.\n\nBoth directions are asked now, in `classifyMove`, and only a genuine\ndescendant is forward. A divergent move is reported as SIDEWAYS with the\ncount of base-side commits the new pin cannot reach.\n\n**A comment in `ALL` swallowed the record beneath it (CodeRabbit).**\n`parseAllList` split on commas and then filtered tokens beginning with `//`,\nso a standalone comment line and the record under it shared one token and\nboth were discarded. A dropped record reads downstream as "missing from\nPIN_MAP" — CI fails while pointing at the wrong thing entirely. Comments are\nstripped before splitting now. `ALL` carries no comments today so this was\nlatent, not live; the records it lists are individually well commented and\nthe list is where a "why is this one eager" note would naturally go.\n\n24 tests. Each fix revert-checked, and each failure names its own\nassertion: the probe on "must not read as a checked-out submodule", the\nclassifier on 'forward' where 'divergent' was expected, and the parser on\nthe deep-equal of the record list.\n
M3gA-Mind committed 3 months ago
b7c1ba4
Tie each module's registry pin to its submodule pin, and catch rewinds\n\nNine subsystems load as downloaded cdylib modules. Each is pinned twice and\nindependently: once as a git submodule (the source this repo compiles the\nwire contract against) and once as a version + per-platform SHA-256 in\n`modules/registry.rs` (the artifact actually loaded at runtime). Nothing\ncompared them, so a stale pin compiled clean, passed every lane, and lost a\ncapability at runtime on a user's machine — #5598 (capability bitmask 8191\nvs 262143), #5623 (missing ListAllFacets), #5641 (missing profile family).\nAll three were fixed by bumping a pin; none added a check.\n\nThe module ABI gate cannot catch this. It checks magic, ABI revision,\npointer width, target triple, endianness, feature bits and panic strategy —\nnone of which encodes WHICH RELEASE the artifact is. A correctly built older\nartifact is admitted without complaint.\n\nTwo gates, because one cannot cover the class.\n\n`check-module-pins.mjs` asserts each of the nine records sits on the tag its\n`version` names, that ARTIFACT_CAPABILITIES_PIN agrees with the tinymemory\nrecord, and that every memory_version / memory_sha256 pair in the three\nworkflows describes that same release. Changing one character of the\ntinymemory version raises ten findings across all five pin sites.\n\n`check-submodule-monotonic.mjs` asserts no `vendor/*` gitlink moves onto an\nancestor of the pin the base branch had. This is the half that catches what\nhas actually bitten, and it is a separate gate rather than an assertion in\nthe first because it must cover crates that have no registry record at all:\n\n 3fd1de32e vendor/tinyagents e0f3210 -> bbcd0a6\n $ git -C vendor/tinyagents merge-base --is-ancestor bbcd0a6 e0f3210\n (true — the new pin is an ancestor)\n\ne0f3210 is tinyagents#122 (2026-08-25), bbcd0a6 is #121 (2026-08-22). That\nbump silently removed a shipped fix until #5796 put it back, and #5725 did\nthe same eight-commit rewind (undone by #5787). Both commits were internally\nCONSISTENT — consistent with an older release — so an equality check between\nthe two pins would have passed them both. And `tinyagents` has no record in\n`ALL`: one pin, nothing to compare. Only direction catches it. The gate\nfails on both commits today.\n\nCoverage is 7 module crates / 9 records for the first gate and all 16\nsubmodules for the second, and neither enumerates a fixed list. Every record\nin `ALL` must be named in PIN_MAP or the gate fails, so crate 17 cannot\ninherit an unchecked pin — six vendored crates landed in the week before\nthis, and a guard listing the modules of the day would already be behind.\n\ntinymcp (15 commits past v0.3.1) and tinywallet (8 past v0.5.0) are drifted\ntoday, so they are declared in module-pin-exemptions.json with reasons. An\nexemption is not a mute button: `expect` pins the exact `git describe`\noutput, so an exempt record cannot drift FURTHER without failing, and an\nexemption whose drift has been fixed fails too. Both are tested.\n\nFail-closed throughout, because two gates here have swallowed a git error\nand reported clean having scanned nothing. An uninitialised submodule, an\nunparseable or missing registry, an unresolvable base ref, a commit missing\nfrom a submodule's object store, a `merge-base` that errors rather than\nanswering, zero submodules, zero workflow blocks, or any uncaught throw all\nexit non-zero with a legible message. `[pin-rewind]` waives a declared\nrewind only — never an unverifiable pin.\n\n21 tests under `node --test`, picked up by the existing Scripts Self-Tests\nlane. The `scripts` path filter now also watches `scripts/lib/**` and this\ngate's own files, which it did not: without that a change to the checking\nlogic would skip the lane that tests it.\n\nCloses tinyhumansai/openhuman#5727\n
M3gA-Mind committed 3 months ago
5f398b1
test(memory): mirror Scoring in the guard and driver tables; one shared workspace for the driver-routed raw cases\n\nCI Lite on the re-pin surfaced two more things the v1.13.2 contract needs.\n\nFour lib tests: the memory guard wrapper, the core subsystem driver's\ncapability-string map and the ops provider status all enumerate the contract\nfamilies, and `Scoring` was missing from each. Mirrored here in the same shape\nas #5825 (a `GuardedScoring` family, `scoring` in the string map, the status\ncount) so the two branches reconcile on rebase.\n\n`memory_threads_raw_coverage_e2e`: six cases read or write through the bound\nmemory driver, and two of them published the module boot policy from their own\n`TempDir`. The policy is first-call-wins and the module captures its workspace\nat load, so whichever case published first bound the module to a directory\nthat was deleted when that case returned; every later read answered from the\ndead store (0 rows where the case had just seeded 1), and the disabled-source\ncheck never saw the registry the case had written. The module now shares one\nleaked workspace the way `tests/json_rpc_e2e.rs` does: `module_workspace`\npublishes the policy once, with `config_path` beside it (`Config::default()`\nnames the developer's real `~/.openhuman/config.toml`) and embeddings off;\ncases point their config and `OPENHUMAN_WORKSPACE` at it, wipe the shared\nrows (never the file: the module holds its connection open) before counting,\nseed `has_embedding` through the embeddings table rather than the legacy\ncolumn, persist the entries a driver-run sync resolves by id, and bind the\nprocess-global memory client to the same workspace for the in-process folder\npipeline.\n\n`sync_rpc` refuses a disabled source again. The check lived in\n`sources::sync::sync_source` and the periodic loop; the driver's\n`run_source_sync` runs whatever id it is handed, so the RPC behind the Sync\nbutton, its third caller, gates on the registry entry with the same words.\n\nVerified locally with the CI feature set, `RUST_MIN_STACK=64M` and\n`TINYMEMORY_TEST_MODULE`: memory_threads 35/35, the guard/driver/ops/module\nsuites 115/115, `memory::sources::rpc` 19/19, clippy clean.\n\nClaude-Session: https://claude.ai/code/session_01Ufhq47VCos7Tw9zCyYEXmR\n
Shanu committed 3 months ago
92c2bb3