






















@@ -746,6 +746,206 @@ describe("memory cli", () => {
746746});
747747});
748748749+it("reports light-only dreaming as active during status", async () => {
750+getRuntimeConfig.mockReturnValue({
751+plugins: {
752+entries: {
753+"memory-core": {
754+config: {
755+dreaming: {
756+enabled: true,
757+frequency: "5 * * * *",
758+timezone: "UTC",
759+phases: {
760+light: {
761+enabled: true,
762+limit: 4,
763+lookbackDays: 2,
764+},
765+deep: {
766+enabled: false,
767+},
768+rem: {
769+enabled: false,
770+},
771+},
772+},
773+},
774+},
775+},
776+},
777+});
778+const close = vi.fn(async () => {});
779+mockManager({
780+probeVectorAvailability: vi.fn(async () => true),
781+status: () => makeMemoryStatus(),
782+ close,
783+});
784+785+const log = spyRuntimeLogs(defaultRuntime);
786+await runMemoryCli(["status"]);
787+788+expectLogged(log, "Dreaming: light=5 * * * * (UTC) · limit=4 · lookbackDays=2");
789+expect(close).toHaveBeenCalled();
790+});
791+792+it("reports rem-only dreaming as active during status", async () => {
793+getRuntimeConfig.mockReturnValue({
794+plugins: {
795+entries: {
796+"memory-core": {
797+config: {
798+dreaming: {
799+enabled: true,
800+frequency: "0 6 * * 0",
801+timezone: "UTC",
802+phases: {
803+light: {
804+enabled: false,
805+},
806+deep: {
807+enabled: false,
808+},
809+rem: {
810+enabled: true,
811+limit: 3,
812+lookbackDays: 9,
813+minPatternStrength: 0.81,
814+},
815+},
816+},
817+},
818+},
819+},
820+},
821+});
822+const close = vi.fn(async () => {});
823+mockManager({
824+probeVectorAvailability: vi.fn(async () => true),
825+status: () => makeMemoryStatus(),
826+ close,
827+});
828+829+const log = spyRuntimeLogs(defaultRuntime);
830+await runMemoryCli(["status"]);
831+832+expectLogged(
833+log,
834+"Dreaming: rem=0 6 * * 0 (UTC) · limit=3 · lookbackDays=9 · minPatternStrength=0.81",
835+);
836+expect(close).toHaveBeenCalled();
837+});
838+839+it("labels deep dreaming when multiple phases are active during status", async () => {
840+getRuntimeConfig.mockReturnValue({
841+plugins: {
842+entries: {
843+"memory-core": {
844+config: {
845+dreaming: {
846+enabled: true,
847+frequency: "15 2 * * *",
848+timezone: "UTC",
849+phases: {
850+light: {
851+enabled: true,
852+limit: 5,
853+lookbackDays: 1,
854+},
855+deep: {
856+enabled: true,
857+limit: 7,
858+minScore: 0.72,
859+minRecallCount: 4,
860+minUniqueQueries: 2,
861+recencyHalfLifeDays: 10,
862+maxAgeDays: 45,
863+maxPromotedSnippetTokens: 512,
864+},
865+rem: {
866+enabled: true,
867+limit: 2,
868+lookbackDays: 14,
869+minPatternStrength: 0.67,
870+},
871+},
872+},
873+},
874+},
875+},
876+},
877+});
878+const close = vi.fn(async () => {});
879+mockManager({
880+probeVectorAvailability: vi.fn(async () => true),
881+status: () => makeMemoryStatus(),
882+ close,
883+});
884+885+const log = spyRuntimeLogs(defaultRuntime);
886+await runMemoryCli(["status"]);
887+888+expectLogged(log, "Dreaming: light=15 2 * * * (UTC) · limit=5 · lookbackDays=1");
889+expectLogged(log, "rem=15 2 * * * (UTC) · limit=2 · lookbackDays=14 · minPatternStrength=0.67");
890+expectLogged(log, "deep=15 2 * * * (UTC) · limit=7 · minScore=0.72");
891+expectLogged(log, "minRecallCount=4");
892+expectLogged(log, "maxPromotedSnippetTokens=512");
893+expect(close).toHaveBeenCalled();
894+});
895+896+it("preserves deep dreaming diagnostics during status", async () => {
897+getRuntimeConfig.mockReturnValue({
898+plugins: {
899+entries: {
900+"memory-core": {
901+config: {
902+dreaming: {
903+enabled: true,
904+frequency: "0 4 * * *",
905+timezone: "UTC",
906+phases: {
907+light: {
908+enabled: false,
909+},
910+deep: {
911+enabled: true,
912+limit: 6,
913+minScore: 0.88,
914+minRecallCount: 5,
915+minUniqueQueries: 3,
916+recencyHalfLifeDays: 12,
917+maxAgeDays: 30,
918+maxPromotedSnippetTokens: 640,
919+},
920+rem: {
921+enabled: false,
922+},
923+},
924+},
925+},
926+},
927+},
928+},
929+});
930+const close = vi.fn(async () => {});
931+mockManager({
932+probeVectorAvailability: vi.fn(async () => true),
933+status: () => makeMemoryStatus(),
934+ close,
935+});
936+937+const log = spyRuntimeLogs(defaultRuntime);
938+await runMemoryCli(["status"]);
939+940+expectLogged(log, "Dreaming: 0 4 * * * (UTC) · limit=6 · minScore=0.88");
941+expectLogged(log, "minRecallCount=5");
942+expectLogged(log, "minUniqueQueries=3");
943+expectLogged(log, "recencyHalfLifeDays=12");
944+expectLogged(log, "maxAgeDays=30");
945+expectLogged(log, "maxPromotedSnippetTokens=640");
946+expect(close).toHaveBeenCalled();
947+});
948+749949it("repairs invalid recall metadata and stale locks with status --fix", async () => {
750950await withTempWorkspace(async (workspaceDir) => {
751951await shortTermTesting.writeRawRecallStore(workspaceDir, {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。