Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

fix: make every tracked source file greppable, and guard it repo-wide

fudjia15baa23a8d53
diff --git a/api/_lib/memory-entities.js b/api/_lib/memory-entities.js
index af59eabb9..f54981083 100644
Binary files a/api/_lib/memory-entities.js and b/api/_lib/memory-entities.js differ
diff --git a/api/_lib/memory-store.js b/api/_lib/memory-store.js
index 881ac9427..2f058ad97 100644
--- a/api/_lib/memory-store.js
+++ b/api/_lib/memory-store.js
@@ -260,12 +260,12 @@ export async function ensureEntities(agentId, cap = ENTITY_CAP) {
// 2. Insert the (entity, memory) links, resolving entity ids from the upsert's
// RETURNING, with ON CONFLICT DO NOTHING.
// 3. Mark the processed memories entities_extracted.
- const byKey = new Map(); // "kindnormalized" → { kind, label, normalized, meta, count }
+ const byKey = new Map(); // "kind\u0000normalized" → { kind, label, normalized, meta, count }
const mentions = []; // { key, memoryId } per occurrence — drives the links
for (const row of batch) {
const entities = extractEntities(row.content, row.tags || [], row.context || {});
for (const e of entities) {
- const key = `${e.kind}${e.normalized}`;
+ const key = `${e.kind}\u0000${e.normalized}`;
const agg = byKey.get(key);
if (agg) {
agg.count += 1;
@@ -308,7 +308,7 @@ export async function ensureEntities(agentId, cap = ENTITY_CAP) {
`;
const idByKey = new Map();
- for (const r of upserted) idByKey.set(`${r.kind}${r.normalized}`, r.id);
+ for (const r of upserted) idByKey.set(`${r.kind}\u0000${r.normalized}`, r.id);
// Dedup link pairs (the PK is (entity_id, memory_id)) before the bulk insert.
const linkSet = new Set();
@@ -316,7 +316,7 @@ export async function ensureEntities(agentId, cap = ENTITY_CAP) {
for (const m of mentions) {
const entityId = idByKey.get(m.key);
if (!entityId) continue;
- const pair = `${entityId}${m.memoryId}`;
+ const pair = `${entityId}\u0000${m.memoryId}`;
if (linkSet.has(pair)) continue;
linkSet.add(pair);
linkRows.push([entityId, m.memoryId]);
diff --git a/api/_lib/reasoning-ledger.js b/api/_lib/reasoning-ledger.js
index 14fa2a3e4..c713227be 100644
Binary files a/api/_lib/reasoning-ledger.js and b/api/_lib/reasoning-ledger.js differ
diff --git a/api/_lib/solana-token-meta.js b/api/_lib/solana-token-meta.js
index a59d92946..31779f47c 100644
Binary files a/api/_lib/solana-token-meta.js and b/api/_lib/solana-token-meta.js differ
diff --git a/api/loom.js b/api/loom.js
index 9296a0570..9910a6390 100644
Binary files a/api/loom.js and b/api/loom.js differ
diff --git a/multiplayer/src/irl-reactions.js b/multiplayer/src/irl-reactions.js
index 6e07cac53..22cfad441 100644
Binary files a/multiplayer/src/irl-reactions.js and b/multiplayer/src/irl-reactions.js differ
diff --git a/multiplayer/src/rooms/ClashRoom.js b/multiplayer/src/rooms/ClashRoom.js
index f5ece505c..6c31d4761 100644
Binary files a/multiplayer/src/rooms/ClashRoom.js and b/multiplayer/src/rooms/ClashRoom.js differ
diff --git a/tests/auto-rig-completion.test.js b/tests/auto-rig-completion.test.js
index 1839ab36b..88d8f470f 100644
Binary files a/tests/auto-rig-completion.test.js and b/tests/auto-rig-completion.test.js differ
diff --git a/tests/rate-limit-durable-fallback.test.js b/tests/rate-limit-durable-fallback.test.js
index cc07f6345..c64170e08 100644
Binary files a/tests/rate-limit-durable-fallback.test.js and b/tests/rate-limit-durable-fallback.test.js differ
diff --git a/tests/vanity-mnemonic.test.js b/tests/vanity-mnemonic.test.js
index 6bc15d542..fbc23b50c 100644
--- a/tests/vanity-mnemonic.test.js
+++ b/tests/vanity-mnemonic.test.js
@@ -68,10 +68,22 @@ describe('generateMnemonic / validateMnemonic', () => {
}
});
+ // Fixed BIP-39 vectors, NOT a freshly generated mnemonic. The final word packs
+ // the checksum bits (4 of its 11 bits at 12-word strength), so swapping it for
+ // an arbitrary other word lands on a valid checksum 1 time in 16. Tampering a
+ // random mnemonic therefore fails this assertion ~6% of runs — measured at
+ // 118/2000. Deterministic vectors keep the check meaningful and reproducible.
it('rejects a mnemonic with a tampered word (bad checksum)', () => {
- const words = generateMnemonic().split(' ');
- words[words.length - 1] = words[words.length - 1] === 'zoo' ? 'zone' : 'zoo';
- expect(validateMnemonic(words.join(' '))).toBe(false);
+ const valid = 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about';
+ expect(validateMnemonic(valid)).toBe(true);
+
+ // last word carries the checksum → wrong checksum
+ const tamperedLast = valid.replace(/about$/, 'abandon');
+ expect(validateMnemonic(tamperedLast)).toBe(false);
+
+ // an interior word changes the entropy the checksum was computed over
+ const tamperedMiddle = 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon zoo about';
+ expect(validateMnemonic(tamperedMiddle)).toBe(false);
});
it('rejects an out-of-list word and a wrong word count', () => {