diff --git a/apps/web/src/components/os/apps/MemoryCenterApp.tsx b/apps/web/src/components/os/apps/MemoryCenterApp.tsx
index 6832fbf..c053747 100644
--- a/apps/web/src/components/os/apps/MemoryCenterApp.tsx
+++ b/apps/web/src/components/os/apps/MemoryCenterApp.tsx
@@ -1,6 +1,6 @@
import { useState } from 'react';
import { motion, useReducedMotion } from 'framer-motion';
-import { Brain, Clock, Network, Download, Activity, BookOpen, User, Briefcase, ShieldCheck, SlidersHorizontal, ChevronDown } from 'lucide-react';
+import { Brain, Clock, Network, Download, BookOpen, User, Briefcase, ShieldCheck, SlidersHorizontal, ChevronDown } from 'lucide-react';
import type { KGNode, KGEdge } from '@/lib/types';
import { HintTooltip } from '@/components/ui/hint-tooltip';
import { SPRING } from '@/lib/motion/tokens';
@@ -8,13 +8,12 @@ import { cn } from '@/lib/utils';
import MemoryTrust from './MemoryTrust';
import KnowledgeGraphViewer from './memory/KnowledgeGraphViewer';
import HarvestTab from './memory/HarvestTab';
-import WeaverPanel from './memory/WeaverPanel';
import WikiTab from './memory/WikiTab';
import MemoryCenterTab from './memory/MemoryCenterTab';
import TimelineTab, { type TimelineTabProps } from './memory/TimelineTab';
import ImportReminderBanner from './memory/ImportReminderBanner';
import { useOnboarding } from '@/hooks/useOnboarding';
-import { hasMemoryFeature, isMemoryViewAvailable } from '@/lib/memory-features';
+import { hasMemoryFeature, isMemoryViewAvailable, useMemoryCapabilities } from '@/lib/memory-features';
/**
* Memory Center (P3/D2) — the standalone memory surface (ArtifactCenterApp
@@ -23,9 +22,10 @@ import { hasMemoryFeature, isMemoryViewAvailable } from '@/lib/memory-features';
* Top-level structure is the ratified TWO-MIND SPLIT: "About you" reads the
* Personal Mind; "About this work" reads the active workspace's Mind. The
* per-mind list is MemoryCenterTab (reused, parameterized — D2). The legacy
- * MemoryApp views (Timeline / Graph / Harvest / Weaver / Wiki)
- * survive as secondary tabs after a divider — capability preserved, entry
- * restructured. Mind pills render only on the Memories tab: the legacy tabs
+ * MemoryApp views (Timeline / Graph / Harvest / Wiki) survive as secondary
+ * tabs after a divider; Graph, Harvest and Wiki are hidden in v1 (ADR-0002).
+ * The Weaver maintenance view is gone: mem0 indexes on write and nothing
+ * consolidates in the background. Mind pills render only on the Memories tab: the legacy tabs
* keep their own scoping (Graph has a scope selector; Harvest writes to the
* personal mind by design).
*
@@ -35,12 +35,12 @@ import { hasMemoryFeature, isMemoryViewAvailable } from '@/lib/memory-features';
*/
export type MindScope = 'personal' | 'workspace';
-export type MemoryView = 'trust' | 'memories' | 'timeline' | 'graph' | 'harvest' | 'weaver' | 'wiki';
+export type MemoryView = 'trust' | 'memories' | 'timeline' | 'graph' | 'harvest' | 'wiki';
// PR3.5: 'trust' (screen 19) is the new PRIMARY front door — first + default;
// the legacy views demote to secondary (after the divider).
export const MEMORY_VIEWS: readonly MemoryView[] = [
- 'trust', 'memories', 'timeline', 'graph', 'harvest', 'weaver', 'wiki',
+ 'trust', 'memories', 'timeline', 'graph', 'harvest', 'wiki',
];
interface MemoryTabDef {
@@ -50,9 +50,9 @@ interface MemoryTabDef {
tooltip: string;
}
-// UX gold-standard H1: 7 equal-weight tabs regrouped into 4 primary + an
-// "Advanced" flyout (display-level IA only — every view id, route and
-// ?tab= deep-link is unchanged; MEMORY_VIEWS still validates all 7).
+// UX gold-standard H1: the tabs are regrouped into 4 primary + an "Advanced"
+// flyout (display-level IA only — every view id, route and ?tab= deep-link is
+// unchanged; MEMORY_VIEWS validates them all).
const PRIMARY_TABS: MemoryTabDef[] = [
{ id: 'trust', label: 'Trust', icon: ShieldCheck, tooltip: 'Memory Trust — confidence & freshness, forget / correct / confirm, and "why did you do that?"' },
{ id: 'memories', label: 'Memories', icon: Brain, tooltip: 'Memory Center — inspect, edit, review, merge' },
@@ -62,7 +62,6 @@ const PRIMARY_TABS: MemoryTabDef[] = [
const ADVANCED_TABS: MemoryTabDef[] = [
{ id: 'harvest', label: 'Imports', icon: Download, tooltip: 'Import conversations from other AIs' },
- { id: 'weaver', label: 'Maintenance', icon: Activity, tooltip: 'Memory distillation and consolidation' },
{ id: 'wiki', label: 'Wiki', icon: BookOpen, tooltip: 'Compiled knowledge pages' },
];
@@ -93,6 +92,8 @@ const MemoryCenterApp = ({
}: MemoryCenterAppProps) => {
// Reminder-banner eligibility (carried over from the retired MemoryApp shell).
const { state: onboardingState } = useOnboarding();
+ // Re-render once the server's capability map arrives (graph visibility).
+ useMemoryCapabilities();
// ADR-0002: views of hidden memory features (graph, imports, wiki) are not
// offered; a hidden view requested anyway falls back to the default.
@@ -286,8 +287,6 @@ const MemoryCenterApp = ({
}} />
) : view === 'harvest' ? (
- ) : view === 'weaver' ? (
-
) : view === 'wiki' ? (
) : null}
diff --git a/apps/web/src/components/os/apps/MemoryTrust.tsx b/apps/web/src/components/os/apps/MemoryTrust.tsx
index da9e0cc..43c26c2 100644
--- a/apps/web/src/components/os/apps/MemoryTrust.tsx
+++ b/apps/web/src/components/os/apps/MemoryTrust.tsx
@@ -3,6 +3,7 @@ import { ShieldCheck, Info } from 'lucide-react';
import { adapter } from '@/lib/adapter';
import MemoryTrustManage from './memory/MemoryTrustManage';
import MemoryTrustWhy from './memory/MemoryTrustWhy';
+import { memoryLabel } from './memory/memory-label';
import { cn } from '@/lib/utils';
/**
@@ -137,7 +138,6 @@ export default function MemoryTrust({ mind, workspaceId }: MemoryTrustProps) {
const [traceMemoryId, setTraceMemoryId] = useState(null);
const [pendingOpenId, setPendingOpenId] = useState(null);
const toastTimer = useRef | undefined>(undefined);
- const wsParam = mind === 'workspace' ? workspaceId : undefined;
const showToast = useCallback((msg: string) => {
setToast(msg);
@@ -154,14 +154,14 @@ export default function MemoryTrust({ mind, workspaceId }: MemoryTrustProps) {
const correctFromTrace = useCallback((id: string) => { setPendingOpenId(id); setView('manage'); }, []);
const forgetFromTrace = useCallback(async (id: string) => {
try {
- await adapter.deleteMemoryById(id, wsParam, mind);
- showToast(`Forgotten M-${id} — removed from recall`);
+ await adapter.deleteMemoryById(id);
+ showToast(`Forgotten ${memoryLabel(id)} — removed from recall`);
setTraceMemoryId(null);
setView('manage');
} catch {
showToast('Could not forget that memory');
}
- }, [wsParam, mind, showToast]);
+ }, [showToast]);
// Segmented Manage/Why switch — rendered INLINE on the hero eyebrow row (one
// register; the old labelled strip + helper sentence doubled what the hero and
@@ -213,8 +213,6 @@ export default function MemoryTrust({ mind, workspaceId }: MemoryTrustProps) {
<>
{
const [backupBusy, setBackupBusy] = useState(false);
const [pendingApproval, setPendingApproval] = useState(null);
const [approvalBusy, setApprovalBusy] = useState(false);
+ // Background fact extraction from chats (ADR-0007, decision 6).
+ const memoryCaps = useMemoryCapabilities();
+ const extractionAvailable = memoryCaps?.capabilities.extraction === true;
+ const extractionOn = extractionAvailable && memoryCaps?.settings.extraction === true;
+ const [extractionSaving, setExtractionSaving] = useState(false);
+ const [extractionError, setExtractionError] = useState(null);
+ const toggleExtraction = async () => {
+ setExtractionSaving(true);
+ setExtractionError(null);
+ try {
+ setMemoryCapabilities(await adapter.setMemoryExtraction(!extractionOn));
+ } catch {
+ setExtractionError('Could not save the memory setting. Try again.');
+ } finally {
+ setExtractionSaving(false);
+ }
+ };
// Load settings
useEffect(() => {
@@ -435,6 +452,45 @@ const SettingsApp = () => {
+ {/* Memory: background fact extraction from chats (ADR-0007). Shown at
+ every level, because it decides what Waggle keeps about the user. */}
+
+
+
+ Memory
+
+
+ While you chat, Waggle can pick out facts about you, like your role or how you like answers, and save them to your personal memory. It does this every few messages or when a chat goes quiet, with the model you chat with. You can confirm, correct or forget these facts in Memory.
+
+
+
+
Learn facts about me from chats
+
+ {!memoryCaps
+ ? 'Checking memory settings...'
+ : !extractionAvailable
+ ? 'Not available: no model is set up for it.'
+ : extractionOn
+ ? 'On'
+ : 'Off. Waggle keeps only what you or the agent save on purpose.'}
+
+
+
+
+ {extractionError && (
+
{extractionError}
+ )}
+
+
{/* M2-7: Privacy & Telemetry — Phase 4.1: hidden at Essential per ux-disclosure-levels.md
§"Settings at Essential" (telemetry surfaced only at Standard+, where the user is
already opting into more advanced surface area). ADR-0006: shown at every level
diff --git a/apps/web/src/components/os/apps/memory/MemoryCard.test.tsx b/apps/web/src/components/os/apps/memory/MemoryCard.test.tsx
index 41251c8..08db28e 100644
--- a/apps/web/src/components/os/apps/memory/MemoryCard.test.tsx
+++ b/apps/web/src/components/os/apps/memory/MemoryCard.test.tsx
@@ -18,7 +18,6 @@ const memory: Memory = {
confidence: 91,
tags: ['research'],
evidence: [],
- hasOriginalSource: false,
createdAt: '2026-07-08T08:00:00.000Z',
updatedAt: '2026-07-08T09:00:00.000Z',
};
diff --git a/apps/web/src/components/os/apps/memory/MemoryCard.tsx b/apps/web/src/components/os/apps/memory/MemoryCard.tsx
index bea67a3..c160544 100644
--- a/apps/web/src/components/os/apps/memory/MemoryCard.tsx
+++ b/apps/web/src/components/os/apps/memory/MemoryCard.tsx
@@ -40,7 +40,8 @@ interface MemoryCardProps {
export function MemoryCard({ memory, onClick, selected, onSelect, className, duplicateCount }: MemoryCardProps) {
const status = statusMeta(memory.status);
- const isProvisional = memory.importance === 'temporary';
+ // Archiving also sets importance 'temporary' (hidden from recall); that is not provisional.
+ const isProvisional = memory.importance === 'temporary' && memory.status !== 'archived';
const showTitle = memory.title && memory.title !== memory.content;
const selectionLabel = memory.title || memory.content.slice(0, 80) || memory.id;
diff --git a/apps/web/src/components/os/apps/memory/MemoryCenterTab.tsx b/apps/web/src/components/os/apps/memory/MemoryCenterTab.tsx
index 1ec1934..5b4746b 100644
--- a/apps/web/src/components/os/apps/memory/MemoryCenterTab.tsx
+++ b/apps/web/src/components/os/apps/memory/MemoryCenterTab.tsx
@@ -1,6 +1,6 @@
import { useState, useEffect, useCallback, useRef, useMemo } from 'react';
import { useReducedMotion } from 'framer-motion';
-import { Search, Loader2, Brain, Archive, Trash2, GitMerge, RotateCcw, Check, Save, AlertTriangle, ShieldOff } from 'lucide-react';
+import { Search, Loader2, Brain, Archive, Trash2, GitMerge, RotateCcw, Check, Save, ShieldOff } from 'lucide-react';
import { adapter } from '@/lib/adapter';
import { DATE_LOCALE } from '@/lib/date-locale';
import { consumeDeepLink } from '@/lib/app-deeplink';
@@ -20,16 +20,15 @@ import { cn } from '@/lib/utils';
/**
* Memory Center (UX-Refactor Phase 2, S04). Self-contained tab (like HarvestTab):
- * fetches the shared Memory entity via the new /api/memory* adapter methods and
- * exposes source / confidence / evidence / scope + edit / archive / delete / merge
- * (PRD §12.4, DoD #4; C11 merge). The 'Needs review' filter surfaces C33 imports
- * (status=unreviewed).
+ * fetches the shared Memory entity via the /api/memory* adapter methods and
+ * exposes source / evidence / scope + edit / archive / delete / erase / merge
+ * (PRD §12.4, DoD #4; C11 merge). The 'Needs review' filter surfaces facts
+ * extracted from chats in the background and not yet confirmed (status=unreviewed).
*
* P3/D2 two-mind split: the tab is the per-mind LIST, parameterized by `mind`
* (+ `workspaceId` for the workspace mind). Defaults to personal — the J08 deep
- * link and pre-P3 call sites keep their behavior. Workspace-mind mutations MUST
- * carry workspaceId or the server's candidateStores lookup misses the frame
- * (personal-store-only search → 404).
+ * link and pre-P3 call sites keep their behavior. Memory ids are unique across
+ * scopes, so mutations need only the id.
*/
export interface MemoryCenterTabProps {
@@ -52,13 +51,6 @@ const STATUS_FILTERS: { value: '' | MemoryStatus; label: string }[] = [
{ value: 'unreviewed', label: 'Needs review' },
{ value: 'active', label: 'Active' },
{ value: 'archived', label: 'Archived' },
- { value: 'deprecated', label: 'Deprecated' },
-];
-
-const CONFIDENCE_FILTERS: { value: number; label: string }[] = [
- { value: 0, label: 'Any confidence' },
- { value: 40, label: 'Medium+' },
- { value: 75, label: 'High only' },
];
const CONTROL_FOCUS_CLASS = 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring)] focus-visible:ring-offset-1 focus-visible:ring-offset-background';
@@ -68,7 +60,7 @@ export default function MemoryCenterTab({
workspaceId,
consumeDeepLinks = true,
}: MemoryCenterTabProps = {}) {
- // Workspace-mind ops carry the workspace param; personal ops must not.
+ // The workspace list reads the workspace's memory; the personal list must not.
const wsParam = mind === 'workspace' ? workspaceId : undefined;
const reduceMotion = !!useReducedMotion();
// Wave T Lane D (item 2): seed the initial list from the session cache so a
@@ -76,7 +68,7 @@ export default function MemoryCenterTab({
// spinning (R13-V1 finding). A fresh remount always lands on the default
// filters, so the initial seed keys on those; the live key (below) also folds
// in the active filters for the mid-session mind-switch path.
- const initialCacheKey = memoryListCacheKey(['mc', mind, wsParam, '', '', 0, '']);
+ const initialCacheKey = memoryListCacheKey(['mc', mind, wsParam, '', '', '']);
const [memories, setMemories] = useState(() => readMemoryListCache(initialCacheKey) ?? []);
const [loading, setLoading] = useState(() => readMemoryListCache(initialCacheKey) === undefined);
const [error, setError] = useState(null);
@@ -88,13 +80,12 @@ export default function MemoryCenterTab({
// fresh open reading as "one card in a dark field". 'All' is now the honest
// default; the curated 'active' view stays one click away as a labeled chip.
const [status, setStatus] = useState<'' | MemoryStatus>('');
- const [minConfidence, setMinConfidence] = useState(0);
// Wave T Lane D (item 2): the live cache key folds in the server-side filters
// (this list fetches filtered). Held in a ref (updated every render) so the
// mind-switch reset effect can reseed without taking a filter dependency —
// reseeding on every keystroke would fight the debounced fetch.
- const cacheKey = memoryListCacheKey(['mc', mind, wsParam, status, kind, minConfidence, q.trim()]);
+ const cacheKey = memoryListCacheKey(['mc', mind, wsParam, status, kind, q.trim()]);
const cacheKeyRef = useRef(cacheKey);
cacheKeyRef.current = cacheKey;
@@ -104,36 +95,15 @@ export default function MemoryCenterTab({
const [draftContent, setDraftContent] = useState('');
const [draftKind, setDraftKind] = useState('fact');
- // #7 "View original source": inline expandable verbatim-source view in the
- // detail drawer (not a nested modal). A frame can link MULTIPLE verbatim
- // sources (metadata.archiveUids) → render each in its own escaped block;
- // sourceRows is empty when the frame has no linked source → friendly empty state.
- type ArchiveRow = { content: string; source: string; sourceRef: string | null; injectionFlagged: boolean; injectionFlags: string };
- const [sourceExpanded, setSourceExpanded] = useState(false);
- const [sourceRows, setSourceRows] = useState([]);
- const [sourceLoading, setSourceLoading] = useState(false);
- const [sourceError, setSourceError] = useState(null);
- // #7 P1 GDPR erasure receipt — a transient, dismissible confirmation of what
- // the last Art.17 erase actually purged (compliance-grade transparency; the
- // drawer closes on success, so the receipt lives at the list level).
+ // Erase receipt: a transient, dismissible confirmation of how many memories
+ // the last erase removed (the drawer closes on success, so the receipt lives
+ // at the list level).
const [eraseNotice, setEraseNotice] = useState(null);
- // #7 sticky erasure — the re-consent surface. A collapsible panel listing the
- // (source, sourceRef) subjects a prior Art.17 erasure recorded; a re-import of any
- // of them is skipped. "Allow re-import" lifts the suppression (deliberate re-consent).
- type SuppressedRow = { source: string; sourceRef: string; erasedAt: string; reason: string | null };
type PendingApproval =
| { kind: 'delete'; memory: Memory }
- | { kind: 'erase'; memory: Memory }
- | { kind: 'allow-reimport'; row: SuppressedRow };
- const [suppressionOpen, setSuppressionOpen] = useState(false);
- const [suppressed, setSuppressed] = useState([]);
- const [suppressionLoading, setSuppressionLoading] = useState(false);
+ | { kind: 'erase'; memory: Memory; sessionId: string };
const [pendingApproval, setPendingApproval] = useState(null);
const [approvalBusy, setApprovalBusy] = useState(false);
- // Latest source-fetch token: the id whose fetch is allowed to write state. A
- // selection change (reset effect → undefined) or a newer fetch invalidates any
- // in-flight request so a stale result can't land on the wrong memory.
- const sourceReqIdRef = useRef(undefined);
// J08: Home's "N memories need review" banner deep-links here with
// {appId:'memory', filter:'unreviewed'}. Two paths (AutomationCenterApp
@@ -192,7 +162,6 @@ export default function MemoryCenterTab({
q: q.trim() || undefined,
kind: kind || undefined,
status: status || undefined,
- minConfidence: minConfidence || undefined,
limit: 200,
});
if (seq === loadSeq.current) { setMemories(res); writeMemoryListCache(cacheKey, res); }
@@ -201,7 +170,7 @@ export default function MemoryCenterTab({
} finally {
if (seq === loadSeq.current) setLoading(false);
}
- }, [q, kind, status, minConfidence, mind, wsParam, cacheKey]);
+ }, [q, kind, status, mind, wsParam, cacheKey]);
useEffect(() => {
const t = setTimeout(load, q ? 250 : 0); // debounce text search only
@@ -210,8 +179,8 @@ export default function MemoryCenterTab({
// Mind switch invalidates EVERYTHING in flight and on screen (keyed on the
// EFFECTIVE scope, so personal-mind instances ignore workspace churn):
- // - selection/checklist: a drawer or merge set carried across minds would
- // mutate the wrong store (ids collide across the per-mind SQLite DBs);
+ // - selection/checklist: a drawer or merge set from the other list must not
+ // act on memories that are no longer shown;
// - the list: stale rows must not render under the new mind's pill;
// - loadSeq: an in-flight old-mind response must not commit into the window
// between this reset and the (debounced) next load starting;
@@ -229,8 +198,6 @@ export default function MemoryCenterTab({
setMemories(cached ?? []);
setLoading(cached === undefined);
setEraseNotice(null); // a receipt for the prior mind must not persist across the switch
- setSuppressionOpen(false); // the erased-source list is per-mind — collapse + drop stale rows
- setSuppressed([]);
setPendingApproval(null);
setApprovalBusy(false);
}, [mind, wsParam]);
@@ -241,37 +208,6 @@ export default function MemoryCenterTab({
setDraftKind(m.kind);
};
- // Reset the verbatim-source view whenever the selected memory changes (incl.
- // closing the drawer) so a previously-opened source can't leak into another row.
- useEffect(() => {
- setSourceExpanded(false);
- setSourceRows([]);
- setSourceError(null);
- setSourceLoading(false);
- sourceReqIdRef.current = undefined; // invalidate any in-flight fetch for the prior memory
- }, [selected?.id]);
-
- // Toggle the inline source view; lazy-fetch the verbatim row on first open.
- const viewOriginalSource = async () => {
- if (!selected) return;
- if (sourceExpanded) { setSourceExpanded(false); return; }
- const reqId = selected.id;
- sourceReqIdRef.current = reqId;
- setSourceExpanded(true);
- setSourceLoading(true);
- setSourceError(null);
- try {
- const res = await adapter.getMemoryOriginalSource(reqId, wsParam, mind);
- if (sourceReqIdRef.current !== reqId) return; // selection changed mid-flight — drop stale result
- setSourceRows(res.archiveRows);
- } catch (e) {
- if (sourceReqIdRef.current !== reqId) return;
- setSourceError(e instanceof Error ? e.message : 'Failed to load original source');
- } finally {
- if (sourceReqIdRef.current === reqId) setSourceLoading(false);
- }
- };
-
const toggleChecked = (id: string, on: boolean) => {
setChecked((prev) => {
const next = new Set(prev);
@@ -281,7 +217,7 @@ export default function MemoryCenterTab({
};
const mutate = async (fn: () => Promise, closeDrawer = false) => {
- setEraseNotice(null); // drop any stale receipt; erase()'s own fn re-sets it on success
+ setEraseNotice(null); // drop any stale erase receipt
setBusy(true);
try {
await fn();
@@ -302,48 +238,27 @@ export default function MemoryCenterTab({
if (draftContent !== selected.content) patch.content = draftContent;
if (draftKind !== selected.kind) patch.kind = draftKind;
if (Object.keys(patch).length === 0) { setSelected(null); return; }
- void mutate(() => adapter.patchMemory(selected.id, patch, wsParam, mind), true);
+ void mutate(() => adapter.patchMemory(selected.id, patch), true);
};
- const archive = (m: Memory) => void mutate(() => adapter.archiveMemory(m.id, wsParam, mind), true);
- const unarchive = (m: Memory) => void mutate(() => adapter.patchMemory(m.id, { status: 'active' }, wsParam, mind), true);
- const markReviewed = (m: Memory) => void mutate(() => adapter.patchMemory(m.id, { status: 'active' }, wsParam, mind), true);
+ const archive = (m: Memory) => void mutate(() => adapter.archiveMemory(m.id), true);
+ const unarchive = (m: Memory) => void mutate(() => adapter.patchMemory(m.id, { status: 'active' }), true);
+ const markReviewed = (m: Memory) => void mutate(() => adapter.patchMemory(m.id, { status: 'active' }), true);
const remove = (m: Memory) => setPendingApproval({ kind: 'delete', memory: m });
- // #7 P1 GDPR Art.17 "right to erasure" — the FULL sweep (this memory + its
- // original source text + every search-index entry + knowledge-graph facts
- // derived solely from it + the verbatim conversation turns behind it). Runs
- // server-side in one atomic transaction. Distinct from Delete (removes just
- // this one record) and Archive (hides it). Irreversible → strong confirm +
- // a receipt of exactly what was purged.
- const erase = (m: Memory) => setPendingApproval({ kind: 'erase', memory: m });
+ // Erase: forget every memory saved from the chat this memory came from.
+ // Offered only for memories with a chat session; Delete covers the rest.
+ const erase = (m: Memory) => {
+ if (m.sessionId) setPendingApproval({ kind: 'erase', memory: m, sessionId: m.sessionId });
+ };
const mergeSelected = () => {
const ids = [...checked];
if (ids.length < 2) return;
void mutate(async () => {
- await adapter.mergeMemories(ids, { workspaceId: wsParam, mind });
+ await adapter.mergeMemories(ids);
setChecked(new Set());
});
};
- // #7 sticky erasure re-consent surface — lazy-loaded when the panel opens.
- const loadSuppression = useCallback(async () => {
- setSuppressionLoading(true);
- try {
- const res = await adapter.listSuppression({ workspaceId: wsParam, mind });
- setSuppressed(res.suppressed);
- } catch {
- setSuppressed([]);
- } finally {
- setSuppressionLoading(false);
- }
- }, [wsParam, mind]);
- const toggleSuppression = () => {
- const next = !suppressionOpen;
- setSuppressionOpen(next);
- if (next) void loadSuppression();
- };
- const allowReimport = (row: SuppressedRow) => setPendingApproval({ kind: 'allow-reimport', row });
-
const approvalRequest = useMemo(() => {
if (!pendingApproval) return null;
if (pendingApproval.kind === 'delete') {
@@ -357,32 +272,20 @@ export default function MemoryCenterTab({
riskLevel: 'high',
};
}
- if (pendingApproval.kind === 'erase') {
- return {
- action: `Erase memory and derived data: ${pendingApproval.memory.title}`,
- scope: [
- 'This permanently removes the memory, its original source text, search index entries, related conversation turns, and derived knowledge facts.',
- 'This is a GDPR Art.17 erasure action and cannot be undone.',
- 'Use Archive to hide it, or Delete to remove only this one record.',
- ],
- riskLevel: 'critical',
- };
- }
return {
- action: `Allow source to be re-imported: ${pendingApproval.row.sourceRef}`,
+ action: 'Erase everything remembered from this chat',
scope: [
- `Source: ${pendingApproval.row.source} / ${pendingApproval.row.sourceRef}`,
- 'This lifts the GDPR Art.17 erasure suppression for this source.',
- 'A future import can re-materialize it; use this only when the data subject has re-consented.',
+ 'This removes this memory and every other memory Waggle saved from the same chat, in personal and workspace memory, so it no longer recalls them.',
+ 'The chat transcript itself is kept.',
+ 'This cannot be undone. Use Delete to remove only this memory.',
],
- riskLevel: 'high',
+ riskLevel: 'critical',
};
}, [pendingApproval]);
const approvalLabel =
pendingApproval?.kind === 'delete' ? (approvalBusy ? 'Deleting...' : 'Delete memory')
- : pendingApproval?.kind === 'erase' ? (approvalBusy ? 'Erasing...' : 'Erase memory')
- : approvalBusy ? 'Allowing...' : 'Allow re-import';
+ : approvalBusy ? 'Erasing...' : 'Erase memories';
const confirmTrustAction = async () => {
if (!pendingApproval) return;
@@ -390,37 +293,20 @@ export default function MemoryCenterTab({
setApprovalBusy(true);
setEraseNotice(null);
try {
+ setBusy(true);
if (current.kind === 'delete') {
- setBusy(true);
- await adapter.deleteMemoryById(current.memory.id, wsParam, mind);
- setSelected(null);
- setPendingApproval(null);
- setReloadTick((t) => t + 1);
- return;
+ await adapter.deleteMemoryById(current.memory.id);
+ } else {
+ const { deleted } = await adapter.eraseMemory({ sessionId: current.sessionId });
+ setEraseNotice(`Erased ${deleted} ${deleted === 1 ? 'memory' : 'memories'} from that chat.`);
}
- if (current.kind === 'erase') {
- setBusy(true);
- const { result } = await adapter.eraseMemory({ frameId: current.memory.id }, { workspaceId: wsParam, mind });
- const parts = [
- `${result.framesDeleted} ${result.framesDeleted === 1 ? 'memory' : 'memories'} erased`,
- result.archiveRedacted > 0 ? `${result.archiveRedacted} source ${result.archiveRedacted === 1 ? 'record' : 'records'} redacted` : null,
- result.entitiesErased > 0 ? `${result.entitiesErased} knowledge ${result.entitiesErased === 1 ? 'entity' : 'entities'} removed` : null,
- ].filter(Boolean);
- setEraseNotice(`Erased "${current.memory.title}": ${parts.join(' · ')}.`);
- setSelected(null);
- setPendingApproval(null);
- setReloadTick((t) => t + 1);
- return;
- }
- setSuppressionLoading(true);
- await adapter.allowReimport({ source: current.row.source, sourceRef: current.row.sourceRef }, { workspaceId: wsParam, mind });
+ setSelected(null);
setPendingApproval(null);
- await loadSuppression();
+ setReloadTick((t) => t + 1);
} catch (e) {
setError(e instanceof Error ? e.message : 'Action failed');
} finally {
- if (current.kind === 'allow-reimport') setSuppressionLoading(false);
- else setBusy(false);
+ setBusy(false);
setApprovalBusy(false);
}
};
@@ -437,12 +323,10 @@ export default function MemoryCenterTab({
const statusLabel = STATUS_FILTERS.find((s) => s.value === status)?.label;
if (status && statusLabel) parts.push(statusLabel);
if (kind) parts.push(memoryKindLabel(kind));
- const confLabel = CONFIDENCE_FILTERS.find((c) => c.value === minConfidence)?.label;
- if (minConfidence && confLabel) parts.push(confLabel);
const query = q.trim();
if (query) parts.push(`matching "${query}"`);
return parts.join(' · ');
- }, [status, kind, minConfidence, q]);
+ }, [status, kind, q]);
return (
// Wave U Lane E (item 4): a ~150ms fade-slide when this panel mounts on the
@@ -467,16 +351,6 @@ export default function MemoryCenterTab({
className="flex-1 bg-transparent text-xs h-auto border-0 p-0 focus-visible:ring-0 focus-visible:ring-offset-0"
/>
-
@@ -527,7 +401,7 @@ export default function MemoryCenterTab({
)}
- {/* #7 P1 GDPR erasure receipt — dismissible confirmation of what was purged. */}
+ {/* Erase receipt — dismissible confirmation of what was removed. */}
{eraseNotice && (
@@ -536,42 +410,6 @@ export default function MemoryCenterTab({
- No erased sources are suppressed. Erasing a source keeps it from re-materializing if it's re-imported later.
-
- ) : (
- suppressed.map((row) => (
-
- {row.source}
- {row.sourceRef}
-
-
- ))
- )}
-
- )}
-
-
{/* Wave V Lane A (item 2): result-count header — Trust-hero parity. Rendered
only when there are rows to frame; the skeleton / empty / error branches
own the empty-list surface below. When a background refresh is in flight
@@ -627,11 +465,11 @@ export default function MemoryCenterTab({
{mind === 'workspace' && !workspaceId
? 'No workspace selected — open a workspace to see what it has learned.'
- : q || kind || status || minConfidence
+ : q || kind || status
? 'No memories match these filters.'
: mind === 'workspace'
? 'Nothing learned in this workspace yet — memories appear here as you work.'
- : 'No memories yet — import or capture some to get started.'}
+ : 'No memories yet. They appear here as you chat, or when you capture a note.'}
- ) : sourceRows.length > 0 ? (
- /* One frame can be distilled from MULTIPLE verbatim sources — render
- each in its own React-escaped
(NEVER dangerouslySetInnerHTML:
- the archive is hostile-by-assumption) with its own provenance label
- and advisory injection badge. */
- sourceRows.map((row, i) => (
-