refactor: align dreaming status with sqlite labels

This commit is contained in:
Peter Steinberger
2026-05-09 06:42:30 +01:00
parent eb3c4817d3
commit 232af1d4a5
2 changed files with 10 additions and 6 deletions

View File

@@ -76,6 +76,8 @@ describe("dreaming controller", () => {
remPhaseHitCount: 4,
promotedTotal: 21,
promotedToday: 2,
storeLabel: "sqlite:plugin_state_entries/memory-core/dreaming.short-term-recall",
phaseSignalLabel: "sqlite:plugin_state_entries/memory-core/dreaming.phase-signals",
shortTermEntries: [
{
key: "memory:memory/2026-04-05.md:1:2",
@@ -171,6 +173,8 @@ describe("dreaming controller", () => {
totalSignalCount: 20,
phaseSignalCount: 11,
promotedToday: 2,
storeLabel: "sqlite:plugin_state_entries/memory-core/dreaming.short-term-recall",
phaseSignalLabel: "sqlite:plugin_state_entries/memory-core/dreaming.phase-signals",
shortTermEntries: [
expect.objectContaining({
snippet: "Emma prefers shorter, lower-pressure check-ins.",

View File

@@ -67,8 +67,8 @@ export type DreamingStatus = {
remPhaseHitCount: number;
promotedTotal: number;
promotedToday: number;
storePath?: string;
phaseSignalPath?: string;
storeLabel?: string;
phaseSignalLabel?: string;
storeError?: string;
phaseSignalError?: string;
shortTermEntries: DreamingEntry[];
@@ -683,8 +683,8 @@ function normalizeDreamingStatus(raw: unknown): DreamingStatus | null {
}
: undefined;
const timezone = normalizeTrimmedString(record.timezone);
const storePath = normalizeTrimmedString(record.storePath);
const phaseSignalPath = normalizeTrimmedString(record.phaseSignalPath);
const storeLabel = normalizeTrimmedString(record.storeLabel);
const phaseSignalLabel = normalizeTrimmedString(record.phaseSignalLabel);
const storeError = normalizeTrimmedString(record.storeError);
const phaseSignalError = normalizeTrimmedString(record.phaseSignalError);
@@ -704,8 +704,8 @@ function normalizeDreamingStatus(raw: unknown): DreamingStatus | null {
remPhaseHitCount: normalizeFiniteInt(record.remPhaseHitCount, 0),
promotedTotal: normalizeFiniteInt(record.promotedTotal, 0),
promotedToday: normalizeFiniteInt(record.promotedToday, 0),
...(storePath ? { storePath } : {}),
...(phaseSignalPath ? { phaseSignalPath } : {}),
...(storeLabel ? { storeLabel } : {}),
...(phaseSignalLabel ? { phaseSignalLabel } : {}),
...(storeError ? { storeError } : {}),
...(phaseSignalError ? { phaseSignalError } : {}),
shortTermEntries: normalizeDreamingEntries(record.shortTermEntries),