





















@@ -98,10 +98,12 @@ describe("root memory repair", () => {
9898} as unknown as DoctorPrompter;
9999100100await noteWorkspaceMemoryHealth(cfg);
101-expect(note).toHaveBeenCalledWith(
102-expect.stringContaining("Split root durable memory"),
103-"Workspace memory",
104-);
101+const detection = await detectRootMemoryFiles(tmpDir);
102+const expectedWarning = formatRootMemoryFilesWarning(detection);
103+if (!expectedWarning) {
104+throw new Error("expected split root memory warning");
105+}
106+expect(note).toHaveBeenCalledWith(expectedWarning, "Workspace memory");
105107note.mockClear();
106108107109await maybeRepairWorkspaceMemoryHealth({ cfg, prompter });
@@ -113,9 +115,15 @@ describe("root memory repair", () => {
113115const canonical = await fs.readFile(path.join(tmpDir, "MEMORY.md"), "utf8");
114116expect(canonical).toContain("# Legacy");
115117await expectPathMissing(path.join(tmpDir, "memory.md"));
116-expect(note).toHaveBeenCalledWith(
117-expect.stringContaining("Workspace memory root merged:"),
118-"Doctor changes",
118+expect(note).toHaveBeenCalledTimes(1);
119+const repairMessage = String(note.mock.calls[0]?.[0] ?? "");
120+const repairLines = repairMessage.split("\n");
121+expect(repairLines[0]).toBe("Workspace memory root merged:");
122+expect(repairLines).toContain(`- canonical: ${path.join(tmpDir, "MEMORY.md")}`);
123+expect(repairLines).toContain(
124+`- merged legacy content from: ${path.join(tmpDir, "memory.md")}`,
119125);
126+expect(repairLines).toContain(`- removed legacy file: ${path.join(tmpDir, "memory.md")}`);
127+expect(note.mock.calls[0]?.[1]).toBe("Doctor changes");
120128});
121129});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。