test(server): build cron, trace and held-action stores on WaggleDB (P1.5)

These stores take Waggle's own database since ADR-0007; the tests still
handed them a MindDB. Only the store construction changes.
This commit is contained in:
shumeiko.it
2026-10-24 12:37:43 +02:00
parent 424b46db19
commit 88fbc0a9e7
8 changed files with 30 additions and 30 deletions

View File

@@ -16,7 +16,7 @@ import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import { CostTracker, runAgentLoop } from '@waggle/agent';
import { ExecutionTraceStore, MindDB } from '@waggle/core';
import { ExecutionTraceStore, WaggleDB } from '@waggle/core';
import { AgentRunRegistry } from '../../src/local/agent-run-registry.js';
import { anthropicProxyRoutes } from '../../src/local/routes/anthropic-proxy.js';
import { securityMiddleware, type RunTokenAuthResult } from '../../src/local/security-middleware.js';
@@ -702,8 +702,8 @@ describe('Anthropic Proxy Routes', () => {
it('persists an AgentLoop handoff before provider dispatch and settles it once', async () => {
const dataDir = fs.mkdtempSync(path.join(os.tmpdir(), 'waggle-proxy-spend-restart-'));
const dbPath = path.join(dataDir, 'personal.mind');
const mind = new MindDB(dbPath);
const dbPath = path.join(dataDir, 'waggle.db');
const mind = new WaggleDB(dbPath);
const traceStore = new ExecutionTraceStore(mind);
const traceId = traceStore.start({
sessionId: 'caller-session',
@@ -749,7 +749,7 @@ describe('Anthropic Proxy Routes', () => {
try {
await providerStarted;
const restartedMind = new MindDB(dbPath);
const restartedMind = new WaggleDB(dbPath);
const restartedStore = new ExecutionTraceStore(restartedMind);
const pendingTotal = restartedStore.getTotalCostSince('2000-01-01T00:00:00.000Z');
const pendingRows = restartedMind.getDatabase().prepare(`