mirror of
https://github.com/sortedcord/omnia.git
synced 2026-07-22 03:52:48 +05:30
feat: Implement tier 1 memory buffer
This commit is contained in:
@@ -41,5 +41,35 @@ describe("IntentDecoder Live Eval (Tier 3)", () => {
|
||||
expect(actionIntent).toBeDefined();
|
||||
expect(actionIntent!.actorId).toBe("alice");
|
||||
expect(actionIntent!.originalText).toContain("slipped the silver key");
|
||||
});
|
||||
}, 15000);
|
||||
|
||||
test("resolves targets correctly using the actor's subjective alias map", async () => {
|
||||
expect(llmConfig.GOOGLE_API_KEY).toBeDefined();
|
||||
|
||||
const provider = new GeminiProvider(llmConfig.GOOGLE_API_KEY);
|
||||
const decoder = new IntentDecoder(provider);
|
||||
|
||||
const world = new WorldState("world-xyz");
|
||||
const alice = new Entity("alice");
|
||||
const bob = new Entity("bob");
|
||||
|
||||
// Register alias mapping: Bob is known to Alice as "the hooded stranger"
|
||||
alice.aliases.set("bob", "the hooded stranger");
|
||||
|
||||
world.addEntity(alice);
|
||||
world.addEntity(bob);
|
||||
|
||||
// Narrative prose referring to Bob only by the subjective alias
|
||||
const narrativeProse = "Alice handed the silver key to the hooded stranger.";
|
||||
|
||||
const result = await decoder.decode(world, "alice", narrativeProse);
|
||||
|
||||
expect(result.intents).toHaveLength(1);
|
||||
const intent = result.intents[0];
|
||||
|
||||
expect(intent.type).toBe("action");
|
||||
expect(intent.actorId).toBe("alice");
|
||||
// Verify target resolution resolved the alias back to the correct system entity ID
|
||||
expect(intent.targetIds).toContain("bob");
|
||||
}, 15000);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user