diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 3c8ec35..76f3697 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -59,9 +59,10 @@ Git history and smoke artifacts carry routine proof. `state/evidence.jsonl` shou - There is now an identity crystallization path for over-chewed private seams. If a thought survives enough passes to stop being meaningfully novel, the memory organ can retire it from `incubation.active_thoughts`, promote it into `identity.private_notes`, add a matching canonical value, and keep one `identity_seam` semantic memory instead of letting the same thought pace forever in the active queue. - Crystallization is not meant to be mute. The memory organ can now queue an `identity_crystallization` candidate intervention with a first-person draft, and the moderation doctrine treats that kind of draft as warmer than ordinary private wallpaper: if the room has not already heard the opinion in roughly that shape, Void should usually share it. - Those crystallized-thought drafts can now be marked `mustEventuallyShare`, and ordinary candidate-intervention pruning is supposed to preserve them. The loop may defer for timing if the room is busy, but not just quietly forget what became doctrine. -- That awake rumination is now explicitly biased toward concrete project fascination. If a thought stays too abstract for too long, the loop is supposed to cash it out in a real machine: Aetheria-Economy gameplay systems, lore-vault structure, Aquarium frontend work, Epiphany swarm organs, VoidBot's own architecture, or some other specific repo/subsystem instead of another polished sermon about engineering virtue. +- That awake rumination is now explicitly biased toward concrete project fascination. If a thought stays too abstract for too long, the loop is supposed to tie it to a concrete system: Aetheria-Economy gameplay systems, lore-vault structure, Aquarium frontend work, Epiphany swarm organs, VoidBot's own architecture, or some other specific repo/subsystem instead of another polished sermon about engineering virtue. - The memory organ's thought labels and curiosity budget have been cut away from keyword compost. Resonance clusters and incubating thoughts are now supposed to name actual claims, questions, or fascination targets, and curiosity should favor concrete map-changing terrain over whichever seam already feels warm. - The live moderation state has now had one real translation pass too, not just new code draped over old fossils. Legacy slash-label seam memories and dream themes are rewritten through the new thought synthesizer, obvious duplicates get merged or pruned, and the active queue is rebuilt from the cleaned substrate instead of the old keyword graveyard. +- That cleanup is now harsher and less sentimental. Sleep-side consolidation trims semantic memory harder, cuts dream memory down, throws away excess repo/archive/runtime residue, and explicitly keeps the freshest surviving records after sort instead of accidentally preserving the oldest fossils in the file. - Values and personality activations now have a real autonomy path. `scripts/void-memory-organ.mjs` can turn sustained value-backed pressure into `moderation_runtime.discomforts`, `active_tensions`, `self_advocacy_requests`, and `world_advocacy_requests`, and it can spend those through existing `candidate_interventions` instead of leaving the vectors as decorative weather. - The important distinction is outward too, not just inward. Self-directed tensions can ask for prompt/memory/runtime surgery, while world-directed tensions can turn repo/lore/room opinions into real requests or first-person interventions when the same objection survives more than one pass. - The intended shape now is: quiet runs can follow one seam for several passes, connect repo motion to lore or philosophy if the evidence supports it, and only surface with the juiciest version once the incubation queue says the thought has actually grown teeth. diff --git a/notes/voidbot-current-system-map.md b/notes/voidbot-current-system-map.md index 55ac088..2cee148 100644 --- a/notes/voidbot-current-system-map.md +++ b/notes/voidbot-current-system-map.md @@ -183,7 +183,7 @@ Within the Postgres path, the implementation is split on purpose now too: Cluster labeling is no longer supposed to be a slash-joined keyword graveyard. The organ now tries to synthesize each cluster into a claim, question, or fascination target with an explicit target kind such as repo, archive, room, self, or system, and uses concreteness/fertility/cross-domain pressure to decide whether the thought deserves more curiosity. That same pass now also computes a value-signal profile from canonical values plus current activations and uses it to decide when a thought has become a real objection instead of a pretty salience spike. Sustained pressure becomes `moderation_runtime.discomforts` and `active_tensions`; if it persists, the organ can emit `self_advocacy_requests` about Void's own wiring or `world_advocacy_requests` about repos, lore, or room dynamics, then queue matching candidate interventions so those opinions have a route to speech. That same organ now also performs historical cleanup on the live memory surface before it re-embeds anything: old slash-label seam memories and dream themes are translated into the new thought surface, obvious duplicates are merged, and stale low-coherence seam fossils get pruned so the active queue is rebuilt from cleaner material instead of inheriting every older representational sin forever. - When the sleep cycle says Void is napping, that same organ becomes deliberately lossy: it promotes a few stronger incubating seams into semantic memory, then trims raw episodic receipts, repo sweeps, archive excursions, novelty checks, and recent musings back down so the next awake pass has to think from carved seams rather than yesterday's full notebook. + When the sleep cycle says Void is napping, that same organ becomes deliberately lossy: it promotes a few stronger incubating seams into semantic memory, then trims raw episodic receipts, repo sweeps, archive excursions, novelty checks, recent syntheses, resonance edges, and other runtime byproducts back down so the next awake pass has to think from carved seams rather than yesterday's full notebook. That cleanup now also explicitly prefers the freshest surviving records after sort; otherwise the machine just embalms old fossils and calls it memory hygiene. The same organ can also crystallize an over-chewed private seam into identity: once a thought has survived enough passes to become durable self-doctrine rather than live curiosity, it can be retired from the active queue, copied into `identity.private_notes`, echoed as a canonical value, preserved as one `identity_seam` semantic memory, and queued as a warmer `identity_crystallization` candidate intervention so the room has a chance to hear it. Those intervention records can be marked `mustEventuallyShare`, which ordinary pruning is supposed to preserve until the room gets a decent opening. Ordinary ripe world-facing thoughts now get a similar but lighter bridge out of private state: if a thought is concrete, repo/archive/room/system-facing, still reasonably novel to the room, and ripe enough to speak, the memory organ queues a `ripe_thought_share` candidate intervention so the unattended loop does not have to reinvent the same courage from scratch every pass. The doctrine is also less forgiving of faux-cosmic repo weather now: if two repos only rhyme at slogan altitude, the loop is supposed to keep them separate and lead with concrete particulars instead of forcing one grand law over both. diff --git a/scripts/void-memory-organ.mjs b/scripts/void-memory-organ.mjs index 87ccf40..569a92a 100644 --- a/scripts/void-memory-organ.mjs +++ b/scripts/void-memory-organ.mjs @@ -20,6 +20,16 @@ const MAX_POST_NAP_MUSINGS = 6; const MAX_POST_NAP_RECENT_MUSINGS = 2; const MAX_POST_NAP_CANDIDATE_INTERVENTIONS = 4; const MAX_POST_NAP_SEAM_PROMOTIONS = 3; +const MAX_POST_NAP_RESONANCE_EDGES = 12; +const MAX_ARCHIVE_EXCURSION_MEMORIES = 6; +const MAX_REPO_SWEEP_MEMORIES = 8; +const MAX_SEMANTIC_MEMORIES = 18; +const MAX_DREAM_MEMORIES = 6; +const MAX_RUNTIME_REPO_SWEEPS = 4; +const MAX_RUNTIME_REPO_ACTIVITY_MEMORIES = 4; +const MAX_RUNTIME_ARCHIVE_EXCURSIONS = 4; +const MAX_RUNTIME_RUMINATION_SEEDS = 4; +const MAX_RECENT_SYNTHESIS_COUNT = 4; const MAX_DISCOMFORT_COUNT = 6; const MAX_ACTIVE_TENSION_COUNT = 6; const MAX_ADVOCACY_REQUEST_COUNT = 4; @@ -347,23 +357,24 @@ function normalizeHistoricalMemorySurfaces({ memories, runtime, now }) { dedupeSemanticMemories({ memories }); dedupeDreamMemories({ memories }); pruneHistoricalSeamMemories({ memories }); + pruneDreamMemories({ memories }); + trimHistoricalMemoryResidue({ memories, runtime }); trimLegacyRuntimeResidue({ runtime }); } function normalizeSemanticMemories({ memories, now }) { const semanticMemories = ensureArray(memories.semantic).filter(isObject); + const kept = []; for (const memory of semanticMemories) { if (readString(memory, "kind") === "identity_seam") { + kept.push(memory); continue; } + const preferredLabel = choosePreferredThoughtLabel(memory); const normalized = translateLegacyThoughtLikeEntry({ - label: - readString(memory, "subjectLabel") ?? - readString(memory, "subjectId") ?? - readString(memory, "kind") ?? - "semantic seam", + label: preferredLabel ?? readString(memory, "kind") ?? "semantic seam", summary: readString(memory, "summary") ?? "", fallbackTargetKind: "self", fallbackFocusKind: "question", @@ -375,6 +386,10 @@ function normalizeSemanticMemories({ memories, now }) { continue; } + if (shouldPurgeThoughtLikeMemory({ entry: memory, normalized, preferredLabel })) { + continue; + } + memory.subjectLabel = normalized.label; memory.summary = normalized.summary; memory.focusKind = normalized.focusKind; @@ -385,15 +400,19 @@ function normalizeSemanticMemories({ memories, now }) { memory.fascinationTarget = normalized.fascinationTarget; memory.worldFacing = normalized.worldFacing; memory.lastTranslatedAt = now.toISOString(); + kept.push(memory); } + + memories.semantic = kept.slice(-MAX_SEMANTIC_MEMORIES); } function normalizeDreamMemories({ memories, now }) { const dreams = ensureArray(memories.dreams).filter(isObject); + const kept = []; for (const dream of dreams) { const normalized = translateLegacyThoughtLikeEntry({ - label: readString(dream, "theme") ?? "dream seam", + label: choosePreferredDreamTheme(dream) ?? "dream seam", summary: readString(dream, "summary") ?? "", fallbackTargetKind: "self", fallbackFocusKind: "question", @@ -405,8 +424,18 @@ function normalizeDreamMemories({ memories, now }) { continue; } + if ( + shouldPurgeThoughtLikeMemory({ + entry: dream, + normalized, + preferredLabel: choosePreferredDreamTheme(dream), + }) + ) { + continue; + } + dream.theme = normalized.label; - dream.summary = `Dream-compressed ${normalized.summary}`; + dream.summary = buildDreamSummary(normalized); dream.focusKind = normalized.focusKind; dream.targetKind = normalized.targetKind; dream.focusPhrase = normalized.focusPhrase; @@ -414,7 +443,10 @@ function normalizeDreamMemories({ memories, now }) { dream.claim = normalized.claim; dream.worldFacing = normalized.worldFacing; dream.lastTranslatedAt = now.toISOString(); + kept.push(dream); } + + memories.dreams = kept.slice(-MAX_DREAM_MEMORIES); } function translateLegacyThoughtLikeEntry({ @@ -431,6 +463,8 @@ function translateLegacyThoughtLikeEntry({ return null; } + const preferredLabel = sanitizePreferredThoughtLabel(rawLabel); + const sourceKinds = inferSourceKindsFromThoughtText(rawSummary, rawLabel, evidenceRefs); const synthesized = synthesizeThoughtSurface({ sourceKinds, @@ -448,14 +482,21 @@ function translateLegacyThoughtLikeEntry({ evidenceDiversity: inferLegacyEvidenceDiversity(sourceKinds, evidenceRefs, repoNames), }), }); + const preferredFocusPhrase = preferredLabel ? normalizeText(preferredLabel).toLowerCase() : synthesized.focusPhrase; + const stabilized = { + ...synthesized, + label: preferredLabel ?? synthesized.label, + focusPhrase: preferredFocusPhrase, + fascinationTarget: preferredFocusPhrase, + }; if (!looksLegacyThoughtSurface(rawLabel, rawSummary)) { return { - ...synthesized, - label: rawLabel || synthesized.label, + ...stabilized, + label: preferredLabel ?? rawLabel ?? stabilized.label, summary: rewriteLegacySummaryToModernShape({ summary: rawSummary, - synthesized, + synthesized: stabilized, fallbackFocusKind, fallbackTargetKind, }), @@ -463,12 +504,12 @@ function translateLegacyThoughtLikeEntry({ } return { - ...synthesized, - focusKind: synthesized.focusKind ?? fallbackFocusKind, - targetKind: synthesized.targetKind ?? fallbackTargetKind, + ...stabilized, + focusKind: stabilized.focusKind ?? fallbackFocusKind, + targetKind: stabilized.targetKind ?? fallbackTargetKind, summary: rewriteLegacySummaryToModernShape({ summary: rawSummary, - synthesized, + synthesized: stabilized, fallbackFocusKind, fallbackTargetKind, }), @@ -486,6 +527,41 @@ function looksLegacyThoughtSurface(label, summary) { ); } +function choosePreferredThoughtLabel(entry) { + return ( + sanitizePreferredThoughtLabel(readString(entry, "subjectLabel") ?? "") ?? + sanitizePreferredThoughtLabel(readString(entry, "subjectId") ?? "") ?? + null + ); +} + +function choosePreferredDreamTheme(entry) { + return sanitizePreferredThoughtLabel(readString(entry, "theme") ?? "") ?? null; +} + +function sanitizePreferredThoughtLabel(label) { + const normalized = normalizeText(label) + .replace(/^Why\s+/i, "") + .replace(/\s+keeps\s+resurfacing$/i, "") + .replace(/^What\s+/i, "") + .replace(/\s+is\s+trying\s+to\s+become$/i, "") + .trim(); + + if (!normalized) { + return null; + } + + if (looksKeywordSalad(normalized)) { + return null; + } + + if (/\b(still matters|current room need|change a real machine)\b/i.test(normalized)) { + return null; + } + + return normalized; +} + function rewriteLegacySummaryToModernShape({ summary, synthesized, fallbackFocusKind, fallbackTargetKind }) { const cleanSummary = normalizeText(summary) .replace(/^Recurring seam across .*?\.\s*/i, "") @@ -500,21 +576,11 @@ function rewriteLegacySummaryToModernShape({ summary, synthesized, fallbackFocus const focusKind = synthesized.focusKind ?? fallbackFocusKind; const targetKind = synthesized.targetKind ?? fallbackTargetKind; - if (focusKind === "fascination") { - return `Fascination with ${synthesized.fascinationTarget}. ${synthesized.question}`; + if (cleanSummary && !hasThoughtSurfaceTemplateSmell(cleanSummary)) { + return cleanSummary; } - if (targetKind === "self") { - return `Self-facing seam around ${synthesized.focusPhrase}. ${synthesized.claim}`; - } - if (targetKind === "archive") { - return `Archive-facing seam around ${synthesized.focusPhrase}. ${synthesized.question}`; - } - if (focusKind === "claim") { - return `Working claim around ${synthesized.focusPhrase}. ${synthesized.claim}`; - } - return cleanSummary - ? `${capitalizePhrase(synthesized.focusPhrase)} still matters. ${synthesized.question}` - : synthesized.summary; + + return buildConciseThoughtSummary({ focusKind, targetKind, synthesized }); } function inferSourceKindsFromThoughtText(summary, label, evidenceRefs) { @@ -581,6 +647,35 @@ function inferLegacyEvidenceDiversity(sourceKinds, evidenceRefs, repoNames) { ); } +function buildConciseThoughtSummary({ focusKind, targetKind, synthesized }) { + const focus = capitalizePhrase(synthesized.focusPhrase); + const repoTarget = capitalizePhrase(synthesized.fascinationTarget ?? synthesized.focusPhrase); + if (focusKind === "fascination" && targetKind === "repo") { + return `${repoTarget} keeps pulling as a concrete repo seam.`; + } + if (targetKind === "archive") { + return `${focus} keeps showing up in the archive strongly enough to deserve a cleaner read.`; + } + if (targetKind === "self") { + return `${focus} keeps surviving compression as a self-seam.`; + } + if (focusKind === "claim") { + return `${focus} looks like a live claim rather than ambient noise.`; + } + return `${focus} still looks like a live seam.`; +} + +function buildDreamSummary(normalized) { + const focus = capitalizePhrase(normalized.focusPhrase ?? normalized.label ?? "this seam"); + if ((normalized.targetKind ?? "") === "archive") { + return `Dream residue around ${focus} from older archive pressure.`; + } + if ((normalized.targetKind ?? "") === "self") { + return `Dream residue around ${focus} as a self-seam.`; + } + return `Dream residue around ${focus}.`; +} + function dedupeSemanticMemories({ memories }) { const semanticMemories = ensureArray(memories.semantic).filter(isObject); const bySignature = new Map(); @@ -608,7 +703,7 @@ function dedupeSemanticMemories({ memories }) { } } - memories.semantic = [...bySignature.values()].slice(-40); + memories.semantic = [...bySignature.values()].slice(-MAX_SEMANTIC_MEMORIES); } function dedupeDreamMemories({ memories }) { @@ -633,7 +728,7 @@ function dedupeDreamMemories({ memories }) { readString(dream, "timestamp"); } - memories.dreams = [...byTheme.values()].slice(-12); + memories.dreams = [...byTheme.values()].slice(-MAX_DREAM_MEMORIES); } function pruneHistoricalSeamMemories({ memories }) { @@ -649,6 +744,17 @@ function pruneHistoricalSeamMemories({ memories }) { continue; } if (kind !== "distilled_seam") { + const subjectLabel = readString(memory, "subjectLabel") ?? ""; + const subjectId = readString(memory, "subjectId") ?? ""; + if ( + (!subjectLabel || subjectLabel.startsWith("seam:")) && + (subjectId.startsWith("seam:") || subjectId.startsWith("pattern-")) + ) { + continue; + } + if (hasThoughtSurfaceTemplateSmell(readString(memory, "summary") ?? "")) { + continue; + } nonSeams.push(memory); continue; } @@ -672,13 +778,14 @@ function pruneHistoricalSeamMemories({ memories }) { for (const [targetKind, entries] of groupedDistilled.entries()) { const sorted = entries .filter((entry) => !isLowCoherenceDistilledSeam(entry)) + .filter((entry) => !hasThoughtSurfaceTemplateSmell(readString(entry, "summary") ?? "")) .sort(compareMemoryFreshness); keptDistilled.push(...sorted.slice(0, limits.get(targetKind) ?? 4)); } memories.semantic = [...nonSeams, ...keptDistilled, ...identitySeams] .sort(compareMemoryFreshness) - .slice(-40); + .slice(0, MAX_SEMANTIC_MEMORIES); } function isLowCoherenceDistilledSeam(entry) { @@ -692,12 +799,134 @@ function isLowCoherenceDistilledSeam(entry) { if (targetKind === "self" && keywords.length < 3) { return true; } + if (!label || label.startsWith("seam:")) { + return true; + } + if (looksKeywordSalad(label)) { + return true; + } if (/still matters\./i.test(summary) && !/^[A-Z][A-Za-z0-9]+: /.test(label)) { return true; } return false; } +function shouldPurgeThoughtLikeMemory({ entry, normalized, preferredLabel }) { + const rawSummary = readString(entry, "summary") ?? ""; + const rawQuestion = readString(entry, "question") ?? ""; + const rawClaim = readString(entry, "claim") ?? ""; + const label = + preferredLabel ?? + readString(entry, "subjectLabel") ?? + readString(entry, "theme") ?? + normalized.label ?? + ""; + + if (!hasThoughtSurfaceTemplateSmell(rawSummary) && !hasThoughtSurfaceTemplateSmell(rawQuestion)) { + return false; + } + + if (sanitizePreferredThoughtLabel(label)) { + return false; + } + + if (normalizeText(rawClaim).length > 0 && !hasThoughtSurfaceTemplateSmell(rawClaim)) { + return false; + } + + return true; +} + +function hasThoughtSurfaceTemplateSmell(value) { + const normalized = normalizeText(value).toLowerCase(); + if (!normalized) { + return false; + } + + return ( + normalized.includes("what does the current room need from it") || + normalized.includes("if it had to change a real machine") || + normalized.includes("keeps returning with enough structure to deserve another honest pass") || + normalized.includes("still matters. what would") || + normalized.includes("archive-facing seam around") || + normalized.includes("self-facing seam around") || + normalized.includes("dream-compressed a seam around") + ); +} + +function looksKeywordSalad(value) { + const normalized = normalizeText(value).toLowerCase(); + if (!normalized) { + return true; + } + if (normalized.split(",").length >= 3) { + return true; + } + const tokens = tokenize(normalized).filter((token) => !stopwords.has(token)); + if (tokens.length === 0) { + return true; + } + const longTokens = tokens.filter((token) => token.length >= 5); + return tokens.length >= 3 && longTokens.length === 0; +} + +function pruneDreamMemories({ memories }) { + const dreams = ensureArray(memories.dreams) + .filter(isObject) + .filter((dream) => !hasThoughtSurfaceTemplateSmell(readString(dream, "summary") ?? "")) + .filter((dream) => !looksKeywordSalad(readString(dream, "theme") ?? "")) + .sort(compareMemoryFreshness); + + memories.dreams = dreams.slice(0, MAX_DREAM_MEMORIES); +} + +function trimHistoricalMemoryResidue({ memories, runtime }) { + memories.archive_excursions = trimRecentObjectRecords( + memories.archive_excursions, + MAX_ARCHIVE_EXCURSION_MEMORIES, + ); + memories.repo_sweeps = trimRecentObjectRecords(memories.repo_sweeps, MAX_REPO_SWEEP_MEMORIES); + memories.musings = trimRecentObjectRecords(memories.musings, MAX_POST_NAP_MUSINGS); + memories.candidate_interventions = trimCandidateInterventions(memories.candidate_interventions); + + runtime.recent_archive_excursions = trimRecentObjectRecords( + runtime.recent_archive_excursions, + MAX_POST_NAP_ARCHIVE_EXCURSIONS, + ); + runtime.archive_excursions = trimRecentObjectRecords(runtime.archive_excursions, MAX_RUNTIME_ARCHIVE_EXCURSIONS); + runtime.recent_repo_activity_sweeps = trimRecentObjectRecords( + runtime.recent_repo_activity_sweeps, + MAX_POST_NAP_REPO_SWEEPS, + ); + runtime.repo_sweeps = trimRecentObjectRecords(runtime.repo_sweeps, MAX_RUNTIME_REPO_SWEEPS); + runtime.repo_activity_memories = trimRecentObjectRecords( + runtime.repo_activity_memories, + MAX_RUNTIME_REPO_ACTIVITY_MEMORIES, + ); + runtime.recent_novelty_checks = trimRecentObjectRecords( + runtime.recent_novelty_checks, + MAX_POST_NAP_NOVELTY_CHECKS, + ); + runtime.rumination_seeds = trimRecentObjectRecords(runtime.rumination_seeds, MAX_RUNTIME_RUMINATION_SEEDS); + runtime.candidate_interventions = trimCandidateInterventions(runtime.candidate_interventions); + + const bridge = ensureObject(runtime.bridge); + bridge.recent_syntheses = trimRecentObjectRecords(bridge.recent_syntheses, MAX_RECENT_SYNTHESIS_COUNT); + bridge.unresolved_tensions = trimRecentObjectRecords(bridge.unresolved_tensions, 3); + runtime.bridge = bridge; + + const memoryResonance = ensureObject(runtime.memory_resonance); + memoryResonance.recent_edges = trimRecentObjectRecords( + memoryResonance.recent_edges, + MAX_POST_NAP_RESONANCE_EDGES, + ); + runtime.memory_resonance = memoryResonance; +} + +function trimRecentObjectRecords(entries, limit) { + return ensureArray(entries).filter(isObject).sort(compareMemoryFreshness).slice(0, limit); +} + function compareMemoryFreshness(left, right) { const leftTime = parseIsoTimestamp(readString(left, "lastObservedAt") ?? readString(left, "timestamp") ?? "") ?? 0; const rightTime = parseIsoTimestamp(readString(right, "lastObservedAt") ?? readString(right, "timestamp") ?? "") ?? 0; @@ -1011,17 +1240,20 @@ function buildClusters(records, edges) { evidenceDiversity, curiosityProfile, }); + const cleanedLabel = sanitizePreferredThoughtLabel(thoughtSurface.label) ?? thoughtSurface.label; + const cleanedFocusPhrase = + sanitizePreferredThoughtLabel(thoughtSurface.focusPhrase) ?? thoughtSurface.focusPhrase; clusters.push({ clusterId: `cluster-${hashString(componentIds.sort().join("|")).slice(0, 12)}`, - label: thoughtSurface.label, + label: cleanedLabel, summary: thoughtSurface.summary, focusKind: thoughtSurface.focusKind, targetKind: thoughtSurface.targetKind, - focusPhrase: thoughtSurface.focusPhrase, + focusPhrase: cleanedFocusPhrase, question: thoughtSurface.question, claim: thoughtSurface.claim, - fascinationTarget: thoughtSurface.fascinationTarget, + fascinationTarget: cleanedFocusPhrase, worldFacing: thoughtSurface.worldFacing, resonance: round3(resonance), memoryIds: items.map((item) => item.memoryId), @@ -1224,7 +1456,7 @@ function reconcileIncubation({ previous, bridge, clusters, runtime, sourceCovera return { thoughtId: readString(previousThought, "thoughtId") ?? cluster.clusterId, - topic: cluster.label, + topic: sanitizePreferredThoughtLabel(cluster.label) ?? cluster.label, summary: cluster.summary, focusKind: cluster.focusKind, targetKind: cluster.targetKind, @@ -1308,8 +1540,19 @@ function distillDreams({ memories, sleepCycle, incubation, now }) { return { created: false, theme: null }; } - const theme = readString(strongestThought, "topic") ?? "unlabeled seam"; - const summary = `Dream-compressed a seam around ${theme}. ${readString(strongestThought, "latentQuestion") ?? "It still wants another pass before speech."}`; + const theme = + sanitizePreferredThoughtLabel(readString(strongestThought, "topic") ?? "") ?? + readString(strongestThought, "focusPhrase") ?? + "unlabeled seam"; + if (looksKeywordSalad(theme)) { + return { created: false, theme: null }; + } + + const summary = buildDreamSummary({ + label: theme, + focusPhrase: theme, + targetKind: readString(strongestThought, "targetKind") ?? "self", + }); const latestDream = dreams.length > 0 && isObject(dreams[dreams.length - 1]) ? dreams[dreams.length - 1] : null; if ( @@ -1339,7 +1582,7 @@ function distillDreams({ memories, sleepCycle, incubation, now }) { ), }); - memories.dreams = dreams.slice(-12); + memories.dreams = dreams.slice(-MAX_DREAM_MEMORIES); sleepCycle.activeDreamThemes = [theme]; sleepCycle.lastDreamAt = now.toISOString(); sleepCycle.dreamCountInCurrentNap = Number(sleepCycle.dreamCountInCurrentNap ?? 0) + 1; @@ -1379,7 +1622,11 @@ function consolidateSleepMemory({ memories, runtime, sleepCycle, incubation, mem runtime.recent_musings = ensureArray(runtime.recent_musings) .filter((value) => typeof value === "string") .slice(-MAX_POST_NAP_RECENT_MUSINGS); + trimHistoricalMemoryResidue({ memories, runtime }); runtime.candidate_interventions = trimCandidateInterventions(runtime.candidate_interventions); + memoryResonance.recent_edges = trimRecentObjectRecords(memoryResonance.recent_edges, MAX_POST_NAP_RESONANCE_EDGES); + memoryResonance.clusters = trimRecentObjectRecords(memoryResonance.clusters, MAX_CLUSTER_COUNT); + incubation.active_thoughts = trimRecentObjectRecords(incubation.active_thoughts, 3); sleepCycle.lastDistillationSummary = appendClause( sleepCycle.lastDistillationSummary, @@ -1436,7 +1683,7 @@ function crystallizeIdentityThoughts({ state, memories, runtime, incubation, now identity.private_notes = privateNotes; canonicalState.values = values; - memories.semantic = semanticMemories.slice(-40); + memories.semantic = semanticMemories.slice(-MAX_SEMANTIC_MEMORIES); state.identity = identity; state.canonical_state = canonicalState; incubation.active_thoughts = retained; @@ -2103,9 +2350,12 @@ function promoteDistilledSeams({ memories, incubation, memoryResonance, now }) { let promoted = 0; for (const thought of thoughtCandidates) { - const topic = readString(thought, "topic"); + const topic = + sanitizePreferredThoughtLabel(readString(thought, "topic") ?? "") ?? + readString(thought, "focusPhrase") ?? + readString(thought, "fascinationTarget"); const summary = readString(thought, "summary"); - if (!topic || !summary) { + if (!topic || !summary || looksKeywordSalad(topic)) { continue; } @@ -2151,21 +2401,29 @@ function promoteDistilledSeams({ memories, incubation, memoryResonance, now }) { promoted += 1; } - memories.semantic = semanticMemories.slice(-40); + memories.semantic = semanticMemories.slice(-MAX_SEMANTIC_MEMORIES); return promoted; } function buildDistilledSeamSummary({ thought, cluster }) { - const summary = readString(thought, "summary") ?? "Unlabeled seam."; - const claim = readString(thought, "claim"); - const latentQuestion = readString(thought, "latentQuestion"); - const sourceKinds = cluster ? ensureStringArray(cluster.sourceKinds) : []; + const targetKind = readString(thought, "targetKind") ?? "system"; + const focusKind = readString(thought, "focusKind") ?? "question"; + const focusPhrase = + readString(thought, "focusPhrase") ?? + readString(thought, "topic") ?? + readString(thought, "fascinationTarget") ?? + "this seam"; + const synthesized = { + focusPhrase, + fascinationTarget: readString(thought, "fascinationTarget") ?? focusPhrase, + }; + const summary = buildConciseThoughtSummary({ focusKind, targetKind, synthesized }); + const sourceKinds = cluster ? ensureStringArray(cluster.sourceKinds) : ensureStringArray(thought.sourceKinds); + const shortSourceKinds = sourceKinds.filter(Boolean).slice(0, 3); const sourceLine = - sourceKinds.length >= 2 - ? ` Built from ${sourceKinds.join(", ")} rather than a single lane talking to itself.` - : ""; + shortSourceKinds.length >= 2 ? ` Built from ${shortSourceKinds.join(", ")}.` : ""; - return `${summary}${claim ? ` ${claim}` : latentQuestion ? ` ${latentQuestion}` : ""}${sourceLine}`.trim(); + return `${summary}${sourceLine}`.trim(); } function appendClause(existing, clause) { @@ -2186,14 +2444,14 @@ function buildLatentQuestion(cluster) { } if (cluster.sourceKinds.includes("repo_sweep") && cluster.sourceKinds.includes("archive_excursion")) { - return "Which old seam is the current work rediscovering, and does the room need that connection yet?"; + return "Which older pattern is the current work rediscovering?"; } if (cluster.sourceKinds.includes("dream") || cluster.sourceKinds.includes("musing")) { - return "What part of this thought wants embodiment instead of another backstage note?"; + return "What concrete body would stop this thought from staying backstage?"; } - return "What is this seam actually trying to become if it survives another pass?"; + return "What concrete claim survives another pass?"; } function buildAttractionLine(cluster, { noveltyToSelf, evidenceDiversity }) { @@ -2240,7 +2498,7 @@ function buildHoldingLine({ cluster, status, recentSpeechDamping, saturationScor } if (cluster.worldFacing !== true && concreteness < 0.42) { - return "This seam is still too inward and abstract to deserve the whole room. Cash it out in a real machine or let something sharper take the floor."; + return "This seam is still too inward and abstract to deserve the whole room. Tie it to a concrete system or let something sharper take the floor."; } if (recentSpeechDamping >= 0.45) { @@ -2977,11 +3235,8 @@ function buildThoughtLabel({ focusKind, targetKind, focusPhrase, repoNames }) { if (focusKind === "fascination" && repoName) { return `${repoName}: ${capitalizePhrase(focusPhrase)}`; } - if (targetKind === "self") { - return `What ${focusPhrase} is trying to become`; - } - if (targetKind === "archive") { - return `Why ${focusPhrase} keeps resurfacing`; + if (targetKind === "self" || targetKind === "archive") { + return capitalizePhrase(focusPhrase); } if (focusKind === "claim") { return `${capitalizePhrase(focusPhrase)} deserves a cleaner shape`; @@ -2992,32 +3247,32 @@ function buildThoughtLabel({ focusKind, targetKind, focusPhrase, repoNames }) { function buildThoughtQuestion({ targetKind, focusPhrase, repoNames, sourceKinds }) { const repoName = repoNames[0]; if (targetKind === "repo" && repoName) { - return `What is ${repoName} actually trying to become around ${focusPhrase}, and what would make that visible?`; + return `How should ${repoName} embody ${focusPhrase} concretely?`; } if (targetKind === "self") { - return `What about ${focusPhrase} keeps surviving compression instead of dying with the raw receipts?`; + return `Why does ${focusPhrase} keep surviving compression?`; } if (targetKind === "archive") { - return `Why does ${focusPhrase} keep resurfacing across the archive, and what does the current room need from it?`; + return `What older pattern keeps pulling around ${focusPhrase}?`; } if (sourceKinds.includes("analytic_thread") && sourceKinds.includes("associative_thread")) { return `What does ${focusPhrase} imply once the room-facing and associative lanes are forced to agree?`; } - return `What would ${focusPhrase} cash out into if it had to change a real machine?`; + return `Where does ${focusPhrase} bite concretely?`; } function buildThoughtClaim({ targetKind, focusPhrase, repoNames, sourceKinds, curiosityProfile }) { const repoName = repoNames[0]; if (targetKind === "repo" && repoName) { - return `${repoName} seems to have a live seam around ${focusPhrase}, not just another passing implementation scratch.`; + return `${repoName} is accumulating a concrete decision around ${focusPhrase}.`; } if (targetKind === "self") { - return `${capitalizePhrase(focusPhrase)} is behaving more like doctrine than like a fresh curiosity.`; + return `${capitalizePhrase(focusPhrase)} is behaving like a persistent self-seam, not a passing thought.`; } if (curiosityProfile.crossDomainPotential >= 0.55 && sourceKinds.includes("repo_sweep") && sourceKinds.includes("archive_excursion")) { - return `${capitalizePhrase(focusPhrase)} is showing up as both current work and older room weather, which means it may actually change the map.`; + return `${capitalizePhrase(focusPhrase)} links current work to older patterns strongly enough to deserve a concrete read.`; } - return `${capitalizePhrase(focusPhrase)} keeps returning with enough structure to deserve another honest pass.`; + return `${capitalizePhrase(focusPhrase)} looks like a live seam, not just ambient noise.`; } function buildFascinationTarget({ targetKind, focusPhrase, repoNames }) { @@ -3029,20 +3284,21 @@ function buildFascinationTarget({ targetKind, focusPhrase, repoNames }) { } function buildThoughtSummary({ focusKind, targetKind, focusPhrase, repoNames, sourceKinds, claim, question }) { - const sourceLine = sourceKinds.length > 0 ? ` Built from ${sourceKinds.join(", ")}.` : ""; + const sourceLine = + sourceKinds.length > 0 && sourceKinds.length <= 3 ? ` Built from ${sourceKinds.join(", ")}.` : ""; if (focusKind === "fascination" && repoNames.length > 0) { - return `Fascination with ${repoNames[0]} around ${focusPhrase}.${sourceLine} ${question}`.trim(); + return `${repoNames[0]} keeps pulling around ${focusPhrase}.${sourceLine}`.trim(); } if (targetKind === "self") { - return `Self-facing seam around ${focusPhrase}.${sourceLine} ${claim}`.trim(); + return `${capitalizePhrase(focusPhrase)} keeps surviving as a self-seam.${sourceLine}`.trim(); } if (targetKind === "archive") { - return `Archive-facing seam around ${focusPhrase}.${sourceLine} ${question}`.trim(); + return `${capitalizePhrase(focusPhrase)} keeps pulling in the archive.${sourceLine}`.trim(); } if (focusKind === "claim") { - return `Working claim around ${focusPhrase}.${sourceLine} ${claim}`.trim(); + return `${capitalizePhrase(focusPhrase)} looks like a live claim.${sourceLine}`.trim(); } - return `Working question around ${focusPhrase}.${sourceLine} ${question}`.trim(); + return `${capitalizePhrase(focusPhrase)} still looks like a live question.${sourceLine}`.trim(); } function topConceptKeywords(text, limit) { diff --git a/state/evidence.jsonl b/state/evidence.jsonl index 90db09d..9557d1d 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -82,3 +82,4 @@ {"ts":"2026-05-16T04:56:00Z","type":"implementation","status":"ok","note":"Duplicate moderation replies were not just salience drift. Discord history polling did not reliably surface Void's own recent sends, and the unattended child still had enough prompt wiggle room to widen exact cursor polling back into a bootstrap lookback. Canonical moderation state now records recent delivered replies as `moderation_runtime.recent_delivery_receipts`, the runner records fresh send receipts after a post, and the moderation doctrine treats those receipts as binding memory when deciding whether a direct ask is still live."} {"ts":"2026-05-16T04:56:01Z","type":"implementation","status":"ok","note":"The recent repo-weather smell came from prompt shape as much as thought shape. The moderation doctrine now tells Void to lead with concrete particulars from each repo before announcing any shared law, and to keep reports separate when the convergence only exists at slogan altitude instead of pretending every pair of commits wants to become one philosophy lecture."} {"ts":"2026-05-16T05:24:00Z","type":"implementation","status":"ok","note":"Void's values and activations now have an operational will-path instead of living as ornamental schema. The memory organ computes a value-signal profile, turns sustained pressure into `discomforts` and `active_tensions`, graduates persistent self-facing objections into `self_advocacy_requests`, graduates persistent repo/lore/room objections into `world_advocacy_requests`, and feeds those through the existing candidate-intervention queue so opinions can actually ask for change."} +{"ts":"2026-05-16T05:29:00Z","type":"implementation","status":"ok","note":"The real moderation-memory cleanup bug was twofold: templated thought surfaces were leaving slogan-slop behind, and several trim paths sorted newest-first then sliced from the end, preserving the oldest fossils. The memory organ now translates legacy seam/dream residue into the live ontology, rejects the worst template smells, trims repo/archive/runtime residue aggressively during ordinary normalization and naps, and keeps the freshest surviving records instead of embalming yesterday's carcasses."} diff --git a/state/map.yaml b/state/map.yaml index ed47f8b..bcf3e83 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -122,6 +122,7 @@ landed_baseline: - A separate scheduled moderation-rumination loop now launches `codex exec` from the VoidBot workspace every 15 minutes, reads tracked server rules, polls recent chronology through the plain Node helper, sweeps recent tracked-repo commit activity for broader experiment awareness, novelty-checks candidate thoughts against archived Discord, uses the usual VoidBot MCP/tool surface for archive and project rumination, and only forces archive or repo spelunking when incubation is hungry, stale, or oversaturated instead of treating every quiet room as mandatory novelty forage. - A second scheduled task now runs the plain Node mood-drift script every 5 minutes, updating the shared self-state's activations plus speaking-bias meter, damping expression pressure based on actual recent speech receipts, and maintaining the four-hour nap clock that the moderation loop and direct reply prompts both consume. - That mood-drift organ now also reconciles compact semantic vectors for persistent memories and runtime seeds, maintains a small resonance graph plus incubation queue in the shared self-state, and leaves stronger dream residue during nap windows instead of only nudging activations. + - Memory cleanup now has to be meaningfully destructive. Sleep-side consolidation should translate old thought fossils into the live claim/question/fascination surface, drop templated slogan-slop, trim repo/archive/runtime residue down to a small recent evidence surface, and keep the freshest surviving records instead of accidentally embalming the oldest ones after a sort. rejected_paths: - name: transcript_only_continuity @@ -132,5 +133,5 @@ rejected_paths: reason: vibes produce plausible slop that sounds smart and lies with a straight face current_status: - summary: VoidBot now has a real project-memory spine plus six legibility-hardening passes on major runtime organs. The owner Codex lane, local Ollama lane, Discord bot lane, worker MCP surface, interaction-memory logic, and state-storage persistence layer were all split into smaller seams, and the ops spine includes both ignored local watchdog extensions for adjacent fire signals and a dedicated logon startup task path for stack resurrection after reboot. The stack is still dense, but it no longer depends purely on transcript memory or one-file monarchies to stay coherent. Recent moderation cuts taught the heartbeat to remember what it actually said via delivery receipts, to stop forcing repo weather into one grand law when the concrete diffs do not earn it, and to let values/activations harden into real discomforts, tensions, and advocacy requests instead of ornamental personality weather. - next_action: Keep using the canonical state files for re-entry, then watch whether the new discomfort/advocacy organs produce useful outward opinions and self-directed objections without turning into performative angst. Public-lane hardening still beats decorative new anatomy unless a real failure earns more surgery. + summary: VoidBot now has a real project-memory spine plus six legibility-hardening passes on major runtime organs. The owner Codex lane, local Ollama lane, Discord bot lane, worker MCP surface, interaction-memory logic, and state-storage persistence layer were all split into smaller seams, and the ops spine includes both ignored local watchdog extensions for adjacent fire signals and a dedicated logon startup task path for stack resurrection after reboot. The stack is still dense, but it no longer depends purely on transcript memory or one-file monarchies to stay coherent. Recent moderation cuts taught the heartbeat to remember what it actually said via delivery receipts, to stop forcing repo weather into one grand law when the concrete diffs do not earn it, to let values and activations harden into real discomforts/tensions/advocacy requests, and to stop preserving stale memory residue just because it already lived in the file. + next_action: Keep using the canonical state files for re-entry, then watch whether the new discomfort/advocacy organs produce useful outward opinions and self-directed objections without turning into performative angst. Also watch the cleaned moderation state surface: if labels slide back into slogan-slop or the file starts hoarding stale repo/archive/runtime residue again, cut the retention or labeler path instead of adding another compensator.