import test from 'node:test'; import assert from 'node:assert/strict'; import { readFileSync } from 'node:fs'; const source = readFileSync(new URL('../src/apps/strategy-engine.mjs', import.meta.url), 'utf8'); test('strategy duplicate quote tracking is bounded and state-safe', () => { assert.match(source, /createRecentIdCache\(\{ limit: 5000 \}\)/); assert.match(source, /seenQuotes\.has/); assert.match(source, /seenQuotes\.getState\(\)/); assert.doesNotMatch(source, /seen_quotes:\s*\{\}/); }); test('strategy execute commands use decision timestamp as durable observed time', () => { assert.match( source, /observedAt:\s*evaluation\.command\.decision_at\s*\|\|\s*event\.observed_at\s*\|\|\s*event\.ingested_at/, ); });