// Memory Core tests cover config plugin behavior. import fs from "node:fs"; import { type JsonSchemaObject, validateJsonSchemaValue, } from "openclaw/plugin-sdk/json-schema-runtime"; import { describe, expect, it } from "vitest"; const manifest = JSON.parse( fs.readFileSync(new URL("../openclaw.plugin.json", import.meta.url), "utf-8"), ) as { configSchema: JsonSchemaObject }; describe("memory-core manifest config schema", () => { it("publishes the canonical promotion gate defaults", () => { expect(manifest.configSchema).toMatchObject({ properties: { dreaming: { properties: { phases: { properties: { deep: { properties: { minScore: { default: 0.75 }, minRecallCount: { default: 3 }, minUniqueQueries: { default: 3 }, }, }, }, }, }, }, }, }); }); it("accepts dreaming phase thresholds used by QA and runtime", () => { const result = validateJsonSchemaValue({ schema: manifest.configSchema, cacheKey: "memory-core.manifest.dreaming-phase-thresholds", value: { dreaming: { enabled: true, timezone: "Europe/London", verboseLogging: true, storage: { mode: "inline", separateReports: false, }, phases: { light: { enabled: true, lookbackDays: 2, limit: 20, dedupeSimilarity: 0.9, }, deep: { enabled: true, limit: 10, minScore: 0, minRecallCount: 3, minUniqueQueries: 3, recencyHalfLifeDays: 14, maxAgeDays: 30, maxPriorEntryLossFraction: 0.25, }, rem: { enabled: true, lookbackDays: 7, limit: 10, minPatternStrength: 0.75, }, }, }, }, }); expect(result.ok).toBe(true); }); });