Skip to content

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

fix(app): make the RPC drift guard follow file splits; correct ratchet prose

Shanuf6007acebca5
diff --git a/AGENTS.md b/AGENTS.md
index 1f157740f1..2f53f92da3 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -1055,8 +1055,11 @@ named `tinycortex-api` found") before anything compiles.
`memory/direct_engine_refs_tests.rs` is still the ratchet over direct
`tinymemory_core::` references, but **its non-empty list no longer implies a
-linked engine** — it scans source text and cannot see `cfg`, and all nine
-remaining entries are test-only. Draining them is a correctness goal (a second,
+linked engine** — it scans source text and cannot see `cfg`, and none of its
+ten remaining entries is in the product build: seven are `#[cfg(test)]`-only,
+one is `memory/host_impls.rs` behind the default-only `memory-engine-seams`
+feature, and two are the `rss-bench` bins, behind a feature the product set
+never enables. Draining them is a correctness goal (a second,
unpoliced door into the subsystem), not a binary-size one.
**Most of what remains is blocked upstream, not here.** `modules::registry` pins
diff --git a/app/src/services/__tests__/rpcMethods.test.ts b/app/src/services/__tests__/rpcMethods.test.ts
index 6435051abf..7e501257c4 100644
--- a/app/src/services/__tests__/rpcMethods.test.ts
+++ b/app/src/services/__tests__/rpcMethods.test.ts
@@ -123,59 +123,37 @@ describe('rpcMethods catalog', () => {
});
test('catalog canonical methods exist in core schema registry (drift guard)', () => {
+ // Read a schema file PLUS every `*_part_*.rs` sibling in its directory.
+ //
+ // The repo's 750-line layout limit keeps splitting schema files into
+ // `include!`-stitched parts (schema_defs.rs → schemas_schema_part_01.rs,
+ // inference/schemas.rs → schemas_part_01.rs, …), and each split silently
+ // moved the `function: "…"` literals this guard greps out of the file it
+ // was reading. Sweeping the siblings makes the corpus follow the splits.
+ // Over-inclusion is harmless — the guard only searches for substrings —
+ // and `readFileSync` still throws if a listed base file moves entirely,
+ // which is the loud failure we want.
+ const readWithParts = (relFile: string): string => {
+ const abs = path.resolve(__dirname, relFile);
+ const dir = path.dirname(abs);
+ const parts = fs
+ .readdirSync(dir)
+ .filter(name => name.endsWith('.rs') && name.includes('_part_'))
+ .sort()
+ .map(name => fs.readFileSync(path.join(dir, name), 'utf8'));
+ return [fs.readFileSync(abs, 'utf8'), ...parts].join('\n');
+ };
+
const schemaSources = [
- fs.readFileSync(
- path.resolve(__dirname, '../../../../src/openhuman/config/schemas/schema_defs.rs'),
- 'utf8'
- ),
- // The config controller registrations split out of schema_defs.rs; the
- // `function: "…"` strings this guard greps live in the parts now.
- fs.readFileSync(
- path.resolve(
- __dirname,
- '../../../../src/openhuman/config/schemas/controllers_part_01.rs'
- ),
- 'utf8'
- ),
- fs.readFileSync(
- path.resolve(
- __dirname,
- '../../../../src/openhuman/config/schemas/controllers_part_02.rs'
- ),
- 'utf8'
- ),
- fs.readFileSync(
- path.resolve(__dirname, '../../../../src/openhuman/inference/provider/schemas.rs'),
- 'utf8'
- ),
- fs.readFileSync(
- path.resolve(__dirname, '../../../../src/openhuman/inference/schemas.rs'),
- 'utf8'
- ),
- fs.readFileSync(
- path.resolve(__dirname, '../../../../src/openhuman/inference/local/schemas.rs'),
- 'utf8'
- ),
- fs.readFileSync(
- path.resolve(__dirname, '../../../../src/openhuman/inference/embeddings/schemas.rs'),
- 'utf8'
- ),
- fs.readFileSync(
- path.resolve(__dirname, '../../../../src/openhuman/mcp/registry/schemas.rs'),
- 'utf8'
- ),
- fs.readFileSync(
- path.resolve(__dirname, '../../../../src/openhuman/tools/registry/schemas.rs'),
- 'utf8'
- ),
- fs.readFileSync(
- path.resolve(__dirname, '../../../../src/openhuman/platform/health/schemas.rs'),
- 'utf8'
- ),
- fs.readFileSync(
- path.resolve(__dirname, '../../../../src/openhuman/channels/controllers/schemas.rs'),
- 'utf8'
- ),
+ readWithParts('../../../../src/openhuman/config/schemas/schema_defs.rs'),
+ readWithParts('../../../../src/openhuman/inference/provider/schemas.rs'),
+ readWithParts('../../../../src/openhuman/inference/schemas.rs'),
+ readWithParts('../../../../src/openhuman/inference/local/schemas.rs'),
+ readWithParts('../../../../src/openhuman/inference/embeddings/schemas.rs'),
+ readWithParts('../../../../src/openhuman/mcp/registry/schemas.rs'),
+ readWithParts('../../../../src/openhuman/tools/registry/schemas.rs'),
+ readWithParts('../../../../src/openhuman/platform/health/schemas.rs'),
+ readWithParts('../../../../src/openhuman/channels/controllers/schemas.rs'),
// The channels_* namespace/function literals now live in the vendored
// tinychannels workspace (`ChannelControllerSchema`), not in the thin
// `src/openhuman/channels/controllers/schemas.rs` adapter above, which