test(agent): move agent tests off the legacy memory engine (P1.5)

- prompt assembler harnesses (v4 and v5): prime an in-memory contract store,
  snapshot its memories and replay them into a fresh store per condition
  instead of copying a MindDB file; the identity card is created per
  orchestrator. They had also drifted from the current Orchestrator API
  (config takes memory, buildSystemPrompt is async).
- prompt assembler unit test: build RecallFrame fixtures, the type the
  assembler consumes, instead of legacy MemoryFrame rows.
- M3c integration: drop the knowledge-graph Ontology case; the knowledge
  graph is not part of v1 and core no longer exports it.
This commit is contained in:
shumeiko.it
2026-10-24 17:07:18 +02:00
parent ad7b90bebd
commit f94331c202
5 changed files with 134 additions and 189 deletions

View File

@@ -9,7 +9,6 @@ import {
ConfirmationGate,
MemoryLinker,
} from '@waggle/agent';
import { Ontology, validateEntity } from '@waggle/core';
describe('M3c Integration', () => {
it('hook registry registers and fires', async () => {
@@ -65,25 +64,12 @@ describe('M3c Integration', () => {
expect(needsConfirmation('git_commit')).toBe(true);
});
it('ontology validates entities', () => {
const ontology = new Ontology();
ontology.define('person', { required: ['name'], optional: ['email'] });
const valid = validateEntity(ontology, { type: 'person', properties: { name: 'Alice' } });
expect(valid.valid).toBe(true);
const invalid = validateEntity(ontology, { type: 'person', properties: { email: 'a@b.com' } });
expect(invalid.valid).toBe(false);
expect(invalid.issues).toContain('Missing required property: name');
});
it('all M3c modules integrate without conflicts', async () => {
// Create all components — verify no import/construction errors
const hooks = new HookRegistry();
const plan = new Plan();
const permissions = PermissionManager.sandbox();
const gate = new ConfirmationGate({ interactive: false });
const ontology = new Ontology();
// Wire hooks into permission check
hooks.on('pre:tool', async (ctx) => {