





















@@ -2,27 +2,13 @@ import fs from "node:fs/promises";
22import path from "node:path";
33import { describe, expect, it } from "vitest";
445-// Mirrored constants in src/commands/doctor-cron-dreaming-payload-migration.ts
6-// must match the source-of-truth values in
7-// extensions/memory-core/src/dreaming.ts. There is no shared module today
8-// because src/ does not import from extensions/, so this drift check stands
9-// in for that boundary: rename either side without updating the other and
10-// this test fails before the doctor migration silently stops matching jobs.
115const MIRROR_PATH = path.resolve(__dirname, "doctor-cron-dreaming-payload-migration.ts");
12-const SOURCE_PATH = path.resolve(
13-__dirname,
14-"..",
15-"..",
16-"extensions",
17-"memory-core",
18-"src",
19-"dreaming.ts",
20-);
6+const SOURCE_PATH = path.resolve(__dirname, "..", "..", "src", "memory-host-sdk", "dreaming.ts");
217228const NAMES = [
23-"MANAGED_DREAMING_CRON_NAME",
24-"MANAGED_DREAMING_CRON_TAG",
25-"DREAMING_SYSTEM_EVENT_TEXT",
9+"MANAGED_MEMORY_DREAMING_CRON_NAME",
10+"MANAGED_MEMORY_DREAMING_CRON_TAG",
11+"MEMORY_DREAMING_SYSTEM_EVENT_TEXT",
2612] as const;
27132814function extractStringConst(source: string, name: string): string {
@@ -35,19 +21,17 @@ function extractStringConst(source: string, name: string): string {
3521}
36223723describe("dreaming payload-migration constants drift", () => {
38-it("matches the source-of-truth values from extensions/memory-core/src/dreaming.ts", async () => {
24+it("imports the source-of-truth values from the memory host SDK", async () => {
3925const [mirror, source] = await Promise.all([
4026fs.readFile(MIRROR_PATH, "utf-8"),
4127fs.readFile(SOURCE_PATH, "utf-8"),
4228]);
43294430for (const name of NAMES) {
45-const mirrorValue = extractStringConst(mirror, name);
4631const sourceValue = extractStringConst(source, name);
47-expect(
48-mirrorValue,
49-`${name} drift: mirror in src/commands does not match extensions/memory-core/src/dreaming.ts`,
50-).toBe(sourceValue);
32+expect(sourceValue).toBeTruthy();
33+expect(mirror).toContain(name);
34+expect(mirror).not.toMatch(new RegExp(`\\bconst ${name}\\b`));
5135}
5236});
5337});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。