Files
memind/memory-v2-phase-a-ready.test.mjs
T
john 6f3e53a56a feat(memory-v2): close Phase A with auto-review, product events, and H5 recall UI.
Add candidate auto-review pipeline, shadow audit tooling, admin metrics page,
and user-visible memory recall hints in chat with phase-a readiness checks.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-01 17:14:06 +08:00

41 lines
1.6 KiB
JavaScript

import assert from 'node:assert/strict';
import test from 'node:test';
import { evaluateMemoryV2PhaseAReadiness } from './memory-v2-phase-a-ready.mjs';
test('evaluateMemoryV2PhaseAReadiness passes aligned canary config', () => {
const report = evaluateMemoryV2PhaseAReadiness({
MEMORY_ENABLED: '1',
MEMORY_CANDIDATE_ENABLED: '1',
MEMORY_CANDIDATE_MODE: 'canary',
MEMORY_CANDIDATE_PERSISTENCE_ENABLED: '1',
MEMORY_CANDIDATE_AUTO_ACCEPT_ALL: '0',
MEMORY_AGENT_RESOLVE_ENABLED: '1',
MEMORY_AGENT_INJECTION_MODE: 'canary',
MEMORY_AGENT_CANARY_USER_IDS: 'user-a,user-b',
MEMORY_LIFECYCLE_ENABLED: '1',
MEMORY_LIFECYCLE_ROLLOUT_MODE: 'canary',
MEMORY_LIFECYCLE_ROLLOUT_USER_IDS: 'user-a,user-b',
MEMORY_PROMOTION_ENABLED: '1',
MEMORY_LIFECYCLE_FORGETTING_ENABLED: '0',
MEMORY_LIFECYCLE_DECAY_ENABLED: '0',
MEMORY_PGVECTOR_DATABASE_URL: 'postgresql://local/memory',
MEMORY_PGVECTOR_EMBEDDING_MODULE: './scripts/embed-memory-v2-local-hash.mjs',
});
assert.equal(report.ok, true);
assert.equal(report.warnings.length, 0);
});
test('evaluateMemoryV2PhaseAReadiness blocks auto accept all and user mismatch', () => {
const report = evaluateMemoryV2PhaseAReadiness({
MEMORY_ENABLED: '1',
MEMORY_CANDIDATE_ENABLED: '1',
MEMORY_CANDIDATE_MODE: 'active',
MEMORY_CANDIDATE_AUTO_ACCEPT_ALL: '1',
MEMORY_AGENT_CANARY_USER_IDS: 'user-a',
MEMORY_LIFECYCLE_ROLLOUT_USER_IDS: 'user-b',
});
assert.equal(report.ok, false);
assert.ok(report.issues.some((item) => item.code === 'auto_accept_all'));
assert.ok(report.issues.some((item) => item.code === 'canary_user_mismatch'));
});