Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

Let memory feedback guide matching recall (#544)

Dee73eba182c6c4
diff --git a/cli/scripts/memory-benchmark.ts b/cli/scripts/memory-benchmark.ts
index da7c47ce0..232e678a1 100644
--- a/cli/scripts/memory-benchmark.ts
+++ b/cli/scripts/memory-benchmark.ts
@@ -12,10 +12,11 @@ import type { RecallPacket, RecallRequest } from '../src/memory/types.js'
const receiptMode = process.argv.includes('--receipts')
const notebookMode = process.argv.includes('--notebooks')
-if (receiptMode && notebookMode) throw new Error('Choose one benchmark mode')
+const feedbackMode = process.argv.includes('--feedback')
+if ([receiptMode, notebookMode, feedbackMode].filter(Boolean).length > 1) throw new Error('Choose one benchmark mode')
const directory = await mkdtemp(join(tmpdir(), 'harness-memory-benchmark-'))
const binding = { engine: 'codex' as const, sessionId: 'synthetic_session', projectId: 'project_1', route: 'prompt_hook' as const }
-const access = { profileId: 'benchmark', projectIds: ['project_1'], includeProfile: receiptMode }
+const access = { profileId: 'benchmark', projectIds: ['project_1'], includeProfile: receiptMode || feedbackMode }
const query = { query: 'fixture_5321', conditions: { taskType: 'debugging' } }
let client: MemoryClient | undefined
async function recall(request: RecallRequest): Promise<RecallPacket> {
@@ -52,6 +53,17 @@ try {
for (let i = 0; i < 5_000; i++) store.prepareRecall(query, binding, access)
if (store.recallEmitted(first.id, binding, access)) throw new Error('receipt_cap_not_applied')
}
+ if (feedbackMode) {
+ for (let index = 0; index < 5_000; index++) {
+ const received = store.prepareRecall(query, { ...binding, sessionId: `rated_${index}` }, access)
+ const record = received.packet.items.find(item => item.claim.includes('fixture_5321'))
+ if (!received.receipt || !record) throw new Error('feedback_recall_missing')
+ const command = { kind: 'feedback' as const, id: record.id, revision: record.revision,
+ receiptId: received.receipt.id, value: index % 3 ? 'helpful' as const : 'unhelpful' as const, expected: 0 }
+ const preview = store.libraryPreview('benchmark', command)
+ store.libraryApply('benchmark', command, preview.version, false)
+ }
+ }
} finally { store.close() }
const seedMs = performance.now() - seededAt
const bundle = await build({ entryPoints: [fileURLToPath(new URL('../src/memory/worker.ts', import.meta.url))],
@@ -141,8 +153,8 @@ try {
values.sort((a, b) => a - b)
return { p50Ms: values[Math.ceil(values.length * .5) - 1], p95Ms: values[Math.ceil(values.length * .95) - 1], maxMs: values.at(-1) }
}
- console.log(JSON.stringify({ kind: 'synthetic-memory-performance', mode: receiptMode ? 'prepare-with-full-receipt-history' : 'recall',
- retainedReceipts: receiptMode ? 5_000 : 0, records: count, projects: 10, node: process.version,
+ console.log(JSON.stringify({ kind: 'synthetic-memory-performance', mode: feedbackMode ? 'recall-with-contextual-feedback' : receiptMode ? 'prepare-with-full-receipt-history' : 'recall',
+ retainedReceipts: receiptMode || feedbackMode ? 5_000 : 0, ratedContexts: feedbackMode ? 5_000 : 0, records: count, projects: 10, node: process.version,
platform: platform(), arch: arch(), seedMs, cold: summary(cold), warm: summary(warm), requests: cold.length + warm.length,
timeouts, largestPacketBytes: largestPacket, parentEventLoopP95Ms: lag.percentile(95) / 1e6,
limitations: ['Synthetic lexical matches, not a retrieval-quality benchmark.', 'Cold means a new worker, not an emptied OS disk cache.',
diff --git a/cli/src/memory/receipts.ts b/cli/src/memory/receipts.ts
index 2e78f4f07..f842cd178 100644
--- a/cli/src/memory/receipts.ts
+++ b/cli/src/memory/receipts.ts
@@ -4,7 +4,7 @@ import { z } from 'zod'
import { digest } from './admission.js'
import type { Database } from './database.js'
import { visibleEvidenceSql } from './visibility.js'
-import { MemoryError, parse, type MemoryAccess, type MemoryRecord, type RecallPacket, type RecallRequest } from './types.js'
+import { MemoryError, parse, type Conditions, type MemoryAccess, type MemoryRecord, type RecallPacket, type RecallRequest } from './types.js'
const id = z.string().min(1).max(200).regex(/^[A-Za-z0-9_.:-]+$/)
const bindingSchema = z.object({ engine: z.enum(['claude', 'codex']), sessionId: id, projectId: id.nullable(),
@@ -32,6 +32,7 @@ export interface MemoryRecallUse {
receiptId: string; revision: number; engine: MemoryDeliveryBinding['engine']; projectId: string | null
route: MemoryDeliveryBinding['route']; preparedAt: number; emittedAt: number | null; delivery: 'unverified'
feedback: RecallFeedback
+ canGuideRecall: boolean
}
interface Deps {
db: Database; profileId: string; now(): number
@@ -60,6 +61,10 @@ export const RECEIPT_SCHEMA = `
context_key TEXT NOT NULL, session_key TEXT NOT NULL, engine TEXT NOT NULL, project_id TEXT
);
CREATE INDEX IF NOT EXISTS memory_receipt_session ON memory_receipt_context(session_key);
+ CREATE TABLE IF NOT EXISTS memory_receipt_relevance (
+ receipt_id TEXT PRIMARY KEY REFERENCES memory_receipt_context(receipt_id) ON DELETE CASCADE,
+ relevance_key TEXT NOT NULL
+ );
CREATE TABLE IF NOT EXISTS memory_recall_feedback (
memory_id TEXT NOT NULL REFERENCES memories(id) ON DELETE CASCADE, revision INTEGER NOT NULL,
context_key TEXT NOT NULL, receipt_id TEXT NOT NULL REFERENCES memory_receipt_context(receipt_id) ON DELETE CASCADE,
@@ -108,6 +113,10 @@ export class MemoryReceipts {
digest([this.deps.profileId, binding.engine, binding.sessionId, binding.projectId,
access.taskId ?? null, access.branchId ?? null, request.conditions ?? {}]),
this.sessionKey(binding.engine, binding.sessionId), binding.engine, binding.projectId)
+ // Compatibility across frameworks must not guess scope or conditions from legacy hashes.
+ // This key excludes engine/session/route but keeps the exact receiving project and context.
+ const relevance = this.relevanceKey(access, request.conditions ?? {})
+ if (relevance) this.deps.db.prepare('INSERT INTO memory_receipt_relevance VALUES(?,?)').run(receiptId, relevance)
this.prune()
return { packet, receipt: { id: receiptId, route: binding.route, preparedAt, emittedAt: null, delivery: 'unverified',
queryDigest, contextDigest, packetDigest, bytes, estimatedTokens: packet.estimatedTokens,
@@ -159,7 +168,10 @@ export class MemoryReceipts {
WHERE i.memory_id=? AND i.revision=? AND r.prepared_at>?
AND c.session_key NOT IN (SELECT value FROM json_each(?))
AND (c.project_id IS NULL OR EXISTS (SELECT 1 FROM projects p WHERE p.id=c.project_id AND p.included=1)))
- SELECT r.*,f.value,f.version,f.updated_at FROM recent r LEFT JOIN memory_recall_feedback f
+ SELECT r.*,f.value,f.version,f.updated_at,
+ EXISTS (SELECT 1 FROM memory_receipt_relevance eligibility WHERE eligibility.receipt_id=
+ CASE WHEN f.value IS NULL THEN r.id ELSE f.receipt_id END) AS can_guide_recall
+ FROM recent r LEFT JOIN memory_recall_feedback f
ON f.memory_id=? AND f.revision=? AND f.context_key=r.context_key
AND EXISTS (SELECT 1 FROM memory_receipts rated WHERE rated.id=f.receipt_id AND rated.prepared_at>?)
WHERE r.position=1 ORDER BY r.prepared_at DESC,r.id DESC LIMIT 10`)
@@ -168,7 +180,7 @@ export class MemoryReceipts {
receiptId: String(row.id), revision, engine: row.engine as MemoryDeliveryBinding['engine'],
projectId: row.project_id === null ? null : String(row.project_id), route: row.route as MemoryDeliveryBinding['route'],
preparedAt: Number(row.prepared_at), emittedAt: row.emitted_at === null ? null : Number(row.emitted_at),
- delivery: 'unverified', feedback: feedbackFrom(row),
+ delivery: 'unverified', feedback: feedbackFrom(row), canGuideRecall: row.can_guide_recall === 1,
})))
}
@@ -195,11 +207,42 @@ export class MemoryReceipts {
return next
}
+ /** A bounded owner-reported utility adjustment, never evidence or an eligibility override.
+ * Call only for already eligible lexical candidates. No rating is inferred from repeat recall.
+ * One stored rating per receiving context survives; source revisions and receiver privacy remain
+ * separate gates. Missing legacy context and ambiguous multi-project requests stay neutral.
+ */
+ usefulness(records: Array<Pick<MemoryRecord, 'id' | 'revision'>>, access: MemoryAccess, conditions: Conditions): Map<string, number> {
+ const relevance = this.relevanceKey(access, conditions)
+ if (!records.length || !relevance) return new Map()
+ return this.deps.transaction(() => {
+ const rows = this.deps.db.prepare(`SELECT f.memory_id,
+ SUM(CASE WHEN f.value='helpful' THEN 1 ELSE -1 END) AS utility, COUNT(*) AS ratings
+ FROM json_each(?) candidate CROSS JOIN memory_recall_feedback f
+ ON f.memory_id=json_extract(candidate.value,'$.id') AND f.revision=json_extract(candidate.value,'$.revision')
+ JOIN memory_receipt_context c ON c.receipt_id=f.receipt_id
+ JOIN memory_receipt_relevance eligibility ON eligibility.receipt_id=f.receipt_id AND eligibility.relevance_key=?
+ JOIN memory_receipts r ON r.id=f.receipt_id
+ WHERE f.value IS NOT NULL AND r.prepared_at>? AND r.prepared_at<=?
+ AND c.session_key NOT IN (SELECT value FROM json_each(?))
+ AND (c.project_id IS NULL OR EXISTS (SELECT 1 FROM projects p WHERE p.id=c.project_id AND p.included=1))
+ GROUP BY f.memory_id`).all(JSON.stringify(records), relevance,
+ this.deps.now() - RETENTION_MS, this.deps.now(), this.privateSessionKeys())
+ // Shrink sparse ratings toward neutral and cap their influence below 12.5% of lexical score.
+ // This is a provisional ranking policy to evaluate, not a learned probability of correctness.
+ return new Map(rows.map(row => [String(row.memory_id), .125 * Number(row.utility) / (Number(row.ratings) + 4)]))
+ })
+ }
+
/** Keep opaque withdrawal receipts, but remove receiver activity and its feedback permanently. */
withholdSession(engine: string, sessionId: string): void {
this.deps.db.prepare('DELETE FROM memory_receipt_context WHERE session_key=?').run(this.sessionKey(engine, sessionId))
}
+ withholdProject(projectId: string): void {
+ this.deps.db.prepare('DELETE FROM memory_receipt_context WHERE project_id=?').run(projectId)
+ }
+
prune(): void {
this.deps.db.prepare('DELETE FROM memory_receipts WHERE prepared_at<=?').run(this.deps.now() - RETENTION_MS)
this.deps.db.prepare(`DELETE FROM memory_receipts WHERE id IN
@@ -221,6 +264,11 @@ export class MemoryReceipts {
}
private key(binding: MemoryDeliveryBinding): string { return digest([this.deps.profileId, binding]) }
+ private relevanceKey(access: MemoryAccess, conditions: Conditions): string | null {
+ if (access.profileId !== this.deps.profileId || access.projectIds.length > 1) return null
+ return digest(['recall-usefulness-v1', this.deps.profileId, access.projectIds[0] ?? null,
+ access.taskId ?? null, access.branchId ?? null, conditions])
+ }
private sessionKey(engine: string, sessionId: string): string { return digest([this.deps.profileId, engine, sessionId]) }
private privateSessionKeys(): string {
// Read the original policy, including changes made by an earlier daemon version that does
diff --git a/cli/src/memory/store.ts b/cli/src/memory/store.ts
index 1f0bec026..1b215dc0d 100644
--- a/cli/src/memory/store.ts
+++ b/cli/src/memory/store.ts
@@ -262,7 +262,11 @@ export class CodingMemoryStore {
setProjectIncluded(projectId: string, included: boolean): void {
if (typeof included !== 'boolean' || !this.db.prepare('SELECT id FROM projects WHERE id = ?').get(projectId)) throw new MemoryError('unknown_project')
this.transaction(() => {
- if (this.included(projectId) === included) return
+ const previous = this.included(projectId)
+ // An older writer may have changed privacy without removing receiver activity.
+ // Reinclusion must not revive ratings from the excluded period.
+ if (!previous || !included) this.receipts.withholdProject(projectId)
+ if (previous === included) return
this.db.prepare('UPDATE projects SET included = ? WHERE id = ?').run(included ? 1 : 0, projectId)
this.db.prepare(`INSERT INTO memory_project_policy(project_id,epoch,live_from) VALUES(?,1,?)
ON CONFLICT(project_id) DO UPDATE SET epoch=epoch+1,live_from=excluded.live_from`).run(projectId, this.now())
@@ -298,6 +302,7 @@ export class CodingMemoryStore {
if (typeof included !== 'boolean') throw new MemoryError('invalid_input')
this.transaction(() => {
const previous = this.sessionPolicy(engine, sessionId)
+ if (!previous.included || !included) this.receipts.withholdSession(engine, sessionId)
if (previous.included === included) return
this.db.prepare(`INSERT INTO memory_session_policy(engine,session_id,included,epoch,live_from) VALUES(?,?,?,?,?)
ON CONFLICT(engine,session_id) DO UPDATE SET included=excluded.included, epoch=excluded.epoch, live_from=excluded.live_from`)
@@ -308,7 +313,6 @@ export class CodingMemoryStore {
last_error='session_privacy_changed', updated_at=? WHERE stream_id IN
(SELECT id FROM memory_streams WHERE engine=? AND session_id=?) AND state NOT IN ${TERMINAL_JOB_STATES}`)
.run(this.now(), engine, sessionId)
- if (!included) this.receipts.withholdSession(engine, sessionId)
// Derived input can belong to a different stream while retaining this session's source roots.
if (!included) this.cancelHiddenSources()
else this.reconcileVisibleConflicts()
@@ -741,7 +745,7 @@ export class CodingMemoryStore {
// Drive the join from FTS once. A scope-index-first plan reruns MATCH for every project row
// (measured at ~160 ms for 10k rows); the fixed join order still filters access before LIMIT.
const rows = this.db.prepare(`WITH context(actual) AS (VALUES (?))
- SELECT m.data FROM memory_fts CROSS JOIN memories m ON m.rowid = memory_fts.rowid
+ SELECT m.id,m.revision,m.data,bm25(memory_fts, 4, 1, 3) AS lexical_rank FROM memory_fts CROSS JOIN memories m ON m.rowid = memory_fts.rowid
WHERE memory_fts MATCH ? AND m.state = 'active' AND ${filter.sql}
AND ${visibleEvidenceSql()}
AND ${applicabilitySql("json_extract(m.data, '$.applicability')")}
@@ -765,6 +769,11 @@ export class CodingMemoryStore {
${excluded.length ? `AND m.id NOT IN (${excluded.map(() => '?').join(',')})` : ''}
ORDER BY bm25(memory_fts, 4, 1, 3), m.rowid DESC LIMIT 120`)
.all(JSON.stringify(actual), terms.map(term => `"${term}"`).join(' OR '), ...filter.params, now, now, ...specific.params, now, now, ...excluded)
+ const utility = this.receipts.usefulness(rows.map(row => ({ id: String(row.id), revision: Number(row.revision) })), access, actual)
+ if (utility.size) {
+ const score = (row: Record<string, unknown>) => Number(row.lexical_rank) * (1 + (utility.get(String(row.id)) ?? 0))
+ rows.sort((left, right) => score(left) - score(right))
+ }
const packet = EMPTY()
const maxBytes = bounded(request.maxBytes, 3_000, 0, 16_000)
const maxItems = bounded(request.maxItems, 6, 0, 6)
diff --git a/cli/src/memory/usefulness.spec.ts b/cli/src/memory/usefulness.spec.ts
new file mode 100644
index 000000000..643112b1b
--- /dev/null
+++ b/cli/src/memory/usefulness.spec.ts
@@ -0,0 +1,178 @@
+import { mkdtempSync, rmSync, readFileSync } from 'node:fs'
+import { tmpdir } from 'node:os'
+import { join } from 'node:path'
+import { afterEach, beforeEach, expect, it } from 'vitest'
+import { builtinSqlite } from '../lib/sqliteRead.js'
+import type { Database } from './database.js'
+import { CodingMemoryStore } from './store.js'
+import type { MemoryDeliveryBinding } from './receipts.js'
+import type { Conditions, MemoryAccess, MemoryDraft, MemoryRecord, SourceEvent } from './types.js'
+
+let directory: string, store: CodingMemoryStore, now: number, tests: MemoryRecord, docs: MemoryRecord
+const access: MemoryAccess = { profileId: 'owner', projectIds: ['project'], includeProfile: true }
+const binding: MemoryDeliveryBinding = { engine: 'claude', sessionId: 'rated_session', projectId: 'project', route: 'prompt_hook' }
+const conditions: Conditions = { task: 'bug_fix', language: 'TypeScript' }
+const query = { query: 'review changes', conditions, maxBytes: 16_000 }
+
+function remember(id: string, claim: string, cues = ['review', 'changes'],
+ changes: Partial<Pick<MemoryDraft, 'scope' | 'conflictKey'>> = {}): MemoryRecord {
+ const source: SourceEvent = { id, profileId: 'owner', projectId: changes.scope?.projectId ?? null, engine: 'claude', sessionId: `source_${id}`,
+ nativeEventId: id, role: 'user', eligibility: 'coding', observedAt: now, rootIds: [id], text: claim }
+ const draft: MemoryDraft = { kind: 'working_preference', facet: 'review', assertionType: 'stated_preference',
+ scope: { profileId: 'owner' }, claim, rationale: null, futureAction: claim, applicability: {}, exceptions: [],
+ retrievalCues: cues, evidenceClass: 'user_stated', conflictKey: id,
+ evidence: [{ sourceEventId: id, quote: claim, paths: ['/claim', '/futureAction', '/applicability'] }],
+ validity: { validFrom: null, validUntil: null, recheckWhen: [] }, ...changes }
+ store.ingest(source)
+ return store.propose(draft, access).record
+}
+function open() {
+ const result = CodingMemoryStore.open({ directory, profileId: 'owner', now: () => now })
+ if (!result.ok) throw new Error(result.reason)
+ store = result.store
+}
+beforeEach(() => {
+ directory = mkdtempSync(join(tmpdir(), 'memory-usefulness-'))
+ now = 1_000
+ open()
+ store.registerProject('project'); store.registerProject('other_project')
+ store.setControls({ learn: true, recall: true })
+ tests = remember('tests', 'For changes, review the tests before merging.')
+ docs = remember('docs', 'For changes, review the docs before merging.')
+})
+afterEach(() => { store.close(); rmSync(directory, { recursive: true, force: true }) })
+
+function order(request = query, scope = access) { return store.recall(request, scope).items.map(item => item.id) }
+function rate(receiptId: string, value: 'helpful' | 'unhelpful' | null, expected = 0, record = tests) {
+ const command = { kind: 'feedback' as const, id: record.id, revision: record.revision, receiptId, value, expected }
+ const preview = store.libraryPreview('owner', command)
+ return store.libraryApply('owner', command, preview.version, false)
+}
+function receive(next = binding, scope = access, request = query) {
+ ++now
+ return store.prepareRecall(request, next, scope).receipt!
+}
+function legacyWrite(sql: string) {
+ const Native = builtinSqlite()!
+ const db = new Native(join(directory, 'memory.sqlite'), { readOnly: false }) as unknown as Database
+ try { db.exec(sql) } finally { db.close() }
+}
+
+it('uses explicit feedback across frameworks without changing facts, evidence or delivery claims', () => {
+ expect(order()).toEqual([docs.id, tests.id])
+ const support = store.support(tests.id, access)
+ const received = receive()
+ rate(received.id, 'helpful')
+ expect(order()).toEqual([tests.id, docs.id])
+ const next = store.prepareRecall(query, { ...binding, engine: 'codex', sessionId: 'new_session' }, access)
+ expect(next.packet.items.map(item => item.id)).toEqual([tests.id, docs.id])
+ expect(next.receipt!.delivery).toBe('unverified')
+ expect(store.read(tests.id, access)).toEqual(tests)
+ expect(store.support(tests.id, access)).toEqual(support)
+ expect(store.libraryDetail('owner', tests.id)!.recalls.find(use => use.receiptId === received.id))
+ .toMatchObject({ feedback: { value: 'helpful' }, canGuideRecall: true })
+ rate(received.id, 'unhelpful', 1)
+ expect(order()).toEqual([docs.id, tests.id])
+ rate(received.id, null, 2)
+ expect(order()).toEqual([docs.id, tests.id])
+})
+
+it('keeps changed conditions, project, task, branch, missing context and foreign owners separate', () => {
+ rate(receive().id, 'helpful')
+ expect(order({ ...query, conditions: { language: 'TypeScript', task: 'bug_fix' } })).toEqual([tests.id, docs.id])
+ const variants: Conditions[] = [{}, { task: 'feature', language: 'TypeScript' }, { ...conditions, platform: 'mac' }]
+ for (const variant of variants) {
+ expect(order({ ...query, conditions: variant })).toEqual([docs.id, tests.id])
+ }
+ for (const scope of [
+ { ...access, projectIds: ['other_project'] }, { ...access, projectIds: [] },
+ { ...access, projectIds: ['project', 'other_project'] },
+ { ...access, taskId: 'different_task' }, { ...access, branchId: 'different_branch' },
+ ]) expect(order(query, scope)).toEqual([docs.id, tests.id])
+ expect(order(query, { ...access, profileId: 'foreign' })).toEqual([])
+})
+
+it('does not reinforce repeated recalls or transport retries without another explicit rating', () => {
+ const first = receive()
+ for (let index = 0; index < 30; index++) receive({ ...binding, route: index % 2 ? 'mcp' : 'manual' })
+ expect(order()).toEqual([docs.id, tests.id])
+ rate(first.id, 'helpful')
+ for (let index = 0; index < 30; index++) {
+ const again = receive({ ...binding, route: 'mcp' })
+ rate(again.id, 'helpful', 1)
+ }
+ expect(store.libraryDetail('owner', tests.id)!.recalls).toHaveLength(1)
+ rate(receive().id, null, 1)
+ expect(order()).toEqual([docs.id, tests.id])
+})
+
+it('cannot make an irrelevant or substantially weaker lexical match outrank better evidence', () => {
+ const strongest = remember('merge', 'For changes, review tests and merge only after verification.', ['review', 'merge'])
+ const rated = remember('unrelated', 'When tending orchids, keep the room humid.', ['orchids'])
+ const unrelated = receive(binding, access, { ...query, query: 'orchids' })
+ rate(unrelated.id, 'helpful', 0, rated)
+ for (let index = 0; index < 30; index++) rate(receive({ ...binding, sessionId: `rated_${index}` }).id, 'helpful')
+ expect(order({ ...query, query: 'review merge' })[0]).toBe(strongest.id)
+ expect(order()).not.toContain(rated.id)
+ expect(order({ ...query, query: 'aardvark' })).toEqual([])
+ expect(store.recall({ ...query, maxBytes: 20 }, access).items).toEqual([])
+})
+
+it('drops a private receiver’s influence permanently and honors policy changes from older writers', () => {
+ rate(receive().id, 'helpful')
+ expect(order()[0]).toBe(tests.id)
+ legacyWrite("INSERT INTO memory_session_policy(engine,session_id,included,epoch,live_from) VALUES('claude','rated_session',0,1,1000)")
+ expect(order()).toEqual([docs.id, tests.id])
+ store.setSessionIncluded('claude', 'rated_session', false)
+ store.setSessionIncluded('claude', 'rated_session', true)
+ expect(order()).toEqual([docs.id, tests.id])
+})
+
+it('does not let a helpful personal default override a project requirement', () => {
+ rate(receive().id, 'helpful')
+ expect(order()[0]).toBe(tests.id)
+ const requirement = remember('project_tests', 'For changes, review the production tests before merging.',
+ ['review', 'changes'], { scope: { profileId: 'owner', projectId: 'project' }, conflictKey: tests.conflictKey })
+ expect(order()).toContain(requirement.id)
+ expect(order()).not.toContain(tests.id)
+ expect(order(query, { ...access, projectIds: ['other_project'] })).toEqual([docs.id, tests.id])
+})
+
+it('removes receiving-project activity and influence before reinclusion, including an older writer', () => {
+ rate(receive().id, 'helpful')
+ store.setProjectIncluded('project', false)
+ expect(order()).toEqual([docs.id, tests.id])
+ store.setProjectIncluded('project', true)
+ expect(order()).toEqual([docs.id, tests.id])
+ rate(receive({ ...binding, sessionId: 'fresh' }).id, 'helpful')
+ expect(order()[0]).toBe(tests.id)
+ legacyWrite("UPDATE projects SET included=0 WHERE id='project'")
+ store.setProjectIncluded('project', true)
+ expect(order()).toEqual([docs.id, tests.id])
+})
+
+it('ignores expired and legacy ratings while leaving retained owner history inspectable', () => {
+ rate(receive().id, 'helpful')
+ store.close()
+ legacyWrite('DROP TABLE memory_receipt_relevance')
+ open()
+ expect(order()).toEqual([docs.id, tests.id])
+ expect(store.libraryDetail('owner', tests.id)!.recalls[0])
+ .toMatchObject({ feedback: { value: 'helpful' }, canGuideRecall: false })
+ rate(receive({ ...binding, sessionId: 'fresh_session' }).id, 'helpful')
+ expect(order()[0]).toBe(tests.id)
+ now += 30 * 86_400_000
+ expect(order()).toEqual([docs.id, tests.id])
+ expect(readFileSync(join(directory, 'memory.sqlite')).includes(Buffer.from('fresh_session'))).toBe(false)
+})
+
+it('does not transfer ratings to a corrected revision or expose excluded source memories', () => {
+ rate(receive().id, 'helpful')
+ const { claim, rationale, futureAction, applicability, exceptions, retrievalCues, validity } = tests
+ store.libraryCorrect('owner', tests.id, tests.revision, { claim, rationale, futureAction, applicability, exceptions, retrievalCues, validity })
+ expect(order()).toEqual([docs.id, tests.id])
+ store.setSessionIncluded('claude', 'source_docs', false)
+ expect(order()).not.toContain(docs.id)
+ store.forget(tests.id, 2, access)
+ expect(order()).toEqual([])
+})
diff --git a/desktop/lib/companions/coding_memory_recall_history.dart b/desktop/lib/companions/coding_memory_recall_history.dart
index 402ee5f62..d6df447b3 100644
--- a/desktop/lib/companions/coding_memory_recall_history.dart
+++ b/desktop/lib/companions/coding_memory_recall_history.dart
@@ -72,6 +72,8 @@ class _CodingMemoryRecallHistoryState extends State<CodingMemoryRecallHistory> {
Text(
widget.recalls.isEmpty
? 'No recent recall history is available for this version.'
+ : widget.recalls.any((recall) => recall['canGuideRecall'] == true)
+ ? 'Was this useful in that session? Feedback helps choose memories for matching work. Correct the memory separately if the fact is wrong.'
: 'Was this useful in that session? Your feedback stays with this version. Correct the memory separately if the fact is wrong.',
style: AppType.caption(color: AppPalette.textSecondary, height: 1.5),
),
@@ -155,6 +157,22 @@ class _CodingMemoryRecallHistoryState extends State<CodingMemoryRecallHistory> {
height: 1.5,
),
),
+ if (recall['canGuideRecall'] == true)
+ Text(
+ 'Guides recall for this version in the same project and matching conditions. Clear feedback to remove its effect.',
+ style: AppType.caption(
+ color: AppPalette.textSecondary,
+ height: 1.5,
+ ),
+ )
+ else if (recall['canGuideRecall'] == false && value != null)
+ Text(
+ 'Saved in history. This earlier rating does not affect future recall.',
+ style: AppType.caption(
+ color: AppPalette.textSecondary,
+ height: 1.5,
+ ),
+ ),
const SizedBox(height: 8),
Wrap(
spacing: 8,
diff --git a/desktop/test/coding_memory_view_test.dart b/desktop/test/coding_memory_view_test.dart
index 5d2d2664c..39da25111 100644
--- a/desktop/test/coding_memory_view_test.dart
+++ b/desktop/test/coding_memory_view_test.dart
@@ -316,6 +316,7 @@ void main() {
await mount(tester);
await tap(tester, 'Read memory');
expect(find.textContaining('Delivery not confirmed'), findsOneWidget);
+ expect(find.textContaining('matching conditions'), findsOneWidget);
expect(transport.calls.where((c) => c['action'] == 'apply'), isEmpty);
final revision = transport.record['revision'];
final evidence = transport.record['evidence'];
@@ -351,6 +352,25 @@ void main() {
},
);
+ testWidgets('legacy feedback stays visibly separate from recall guidance', (
+ tester,
+ ) async {
+ transport.recalls.add({
+ ...syntheticRecall(value: 'helpful'),
+ 'canGuideRecall': false,
+ });
+ await mount(tester);
+ await tap(tester, 'Read memory');
+ expect(
+ find.textContaining('earlier rating does not affect'),
+ findsOneWidget,
+ );
+ expect(find.textContaining('matching conditions'), findsNothing);
+ await tap(tester, 'Clear feedback');
+ expect(find.textContaining('earlier rating does not affect'), findsNothing);
+ expect(find.textContaining('Delivery not confirmed'), findsOneWidget);
+ });
+
testWidgets(
'pending feedback disables controls and a changed owner prevents apply',
(tester) async {
diff --git a/desktop/test/support/coding_memory_fixture.dart b/desktop/test/support/coding_memory_fixture.dart
index c194fc68a..2b3207893 100644
--- a/desktop/test/support/coding_memory_fixture.dart
+++ b/desktop/test/support/coding_memory_fixture.dart
@@ -15,6 +15,7 @@ Map<String, dynamic> syntheticRecall({
'preparedAt': 1790762400000,
'emittedAt': 1790762401000,
'canFeedback': true,
+ 'canGuideRecall': true,
'project': {
'id': 'synthetic-project',
'name': 'editor',
diff --git a/docs/plans/2026-09-30-coding-memory-product.md b/docs/plans/2026-09-30-coding-memory-product.md
index 5873ef9af..207d25029 100644
--- a/docs/plans/2026-09-30-coding-memory-product.md
+++ b/docs/plans/2026-09-30-coding-memory-product.md
@@ -4,7 +4,7 @@ Build memory that helps any supported coding agent work like a colleague who und
This document defines the coding-specific product model. The [architecture](2026-09-30-tim-memory.md) defines storage, learning, recall, adapters, and controls. The examples below are illustrative, not a profile inferred about the current user. A development-gated runtime prototype now exists; the [review log](2026-09-30-coding-memory-review-log.md) tracks what has been implemented and tested. An initial owner library is integrated into the companion viewer; native production integration, richer project/receipt views and behavioral evaluation remain incomplete.
-The owner library now connects a memory to its recent recall history and accepts helpful/unhelpful feedback for a specific version and receiving context. That feedback is reversible and separate from the remembered fact. Real-model usefulness, automatic ranking from feedback, and direct navigation back to the receiving task remain unverified or unfinished.
+The owner library now connects a memory to its recent recall history and accepts helpful/unhelpful feedback for a specific version and receiving context. That feedback is reversible and separate from the remembered fact. In the development implementation it makes a bounded adjustment to recall ordering for the same project and matching task/branch scope and conditions, across Claude and Codex. It cannot override eligibility or project requirements, and repeated recall earns no reward. Real-model usefulness and direct navigation back to the receiving task remain unverified or unfinished.
The [historical design council](2026-09-30-coding-memory-council.md) applies ten complementary engineering perspectives to this model. Its central addition is memory of engineering judgment: how someone approaches a problem, why a decision made sense, what evidence supports it, and what would warrant changing it. These perspectives inform our design; they are not preset personalities assigned to developers.
diff --git a/docs/plans/2026-09-30-coding-memory-review-log.md b/docs/plans/2026-09-30-coding-memory-review-log.md
index 92cbe0dca..48c2d4f95 100644
--- a/docs/plans/2026-09-30-coding-memory-review-log.md
+++ b/docs/plans/2026-09-30-coding-memory-review-log.md
@@ -356,3 +356,49 @@ and 10.910 ms for a page; fresh-worker index p95 was 66.106 ms, with zero reques
local-only diagnostic without that socket or elevated access. No actual user data or inference was
used. This measures queued-page browsing, not generated-prose cost, model latency or semantic benefit.
Reproduce with `cd cli && node --import tsx scripts/memory-benchmark.ts --notebooks`.
+
+## Round 21 — explicit usefulness without automatic self-reinforcement
+
+The published-practitioner review asks whether feedback changes a future decision without becoming
+evidence that a fact is true. The development implementation now uses the owner's Helpful / Not
+helpful rating to adjust ordering among already eligible lexical candidates. It shares that signal
+across Claude and Codex only for the exact receiving project, explicit task/branch scope and known
+conditions. A changed memory revision, different context, ambiguous multi-project request or legacy
+receipt without captured relevance stays neutral. Repeated recall and transport retries earn no
+additional vote. No actual practitioner participated in this review.
+
+The adjustment is `0.125 * (helpful - unhelpful) / (ratings + 4)`, applied to the lexical score.
+This shrinks sparse feedback toward neutral and bounds its influence below 12.5%; it is a provisional
+policy to evaluate, not a calibrated probability or evidence of improved coding outcomes. Existing
+scope, source visibility, applicability, exceptions, validity and more-specific project requirements
+are checked before ranking. The same byte/item limits remain. Clearing feedback removes its effect;
+correcting or forgetting the claim also removes the old revision's influence. A rated receipt still
+does not prove that a native model received or used its content.
+
+The new relevance metadata uses an additive table so an older writer's receipt inserts continue to
+work. One-way keys do not retain prompt text or native receiver session IDs. Existing ratings remain
+inspectable; the UI explicitly identifies earlier ratings that cannot guide future recall. The
+[normal light view](../research/2026-10-01-memory-usefulness/feedback-light-1.0x.png) and
+[200% dark view](../research/2026-10-01-memory-usefulness/feedback-dark-2.0x.png) were inspected.
+These synthetic renders establish layout behavior, not native VoiceOver or physical IME behavior.
+
+Regression review found two privacy bugs before the fix: a repeated session exclusion after an
+older writer's policy change skipped cleanup, and receiving-project reinclusion could revive its
+old ratings. Both regressions failed first. Exclusion, repeated exclusion and reinclusion now discard
+that receiver activity before an equality early return, preserving only the opaque withdrawal
+receipt. Later activity can begin afresh. Source visibility is checked independently.
+
+Validation passed 317 memory/intelligence checks, then all nine focused usefulness cases including
+the additional rated-personal-default versus project-requirement case. All 40 memory viewer checks,
+scoped Flutter analysis, CLI type checking and a separate strict benchmark-runner type check passed.
+Initial fixture errors (missing required legacy policy columns and an inferred optional condition)
+were corrected separately from the two actual privacy failures. The follow-up is restacked on
+`3d55daff9`; the final whole CLI run and exact-commit manual CI results are recorded in its PR.
+
+The [scale diagnostic](../research/2026-10-01-memory-usefulness/performance.json) used 10,000 synthetic
+memories and 5,000 explicitly rated receiving contexts. Across 310 requests, warm recall p95 was
+22.127 ms and fresh-worker p95 was 64.780 ms, with zero timeouts. Reproduce with
+`cd cli && node --import tsx scripts/memory-benchmark.ts --feedback`. This measures local performance,
+not retrieval quality or real hook latency. No personal store was seeded, native model called,
+running app replaced or release published. The held-out real-history and task-benefit requirements,
+real notebook faithfulness, native lifecycle coverage and fuller task/session navigation remain open.
diff --git a/docs/plans/2026-09-30-tim-memory.md b/docs/plans/2026-09-30-tim-memory.md
index e8509abec..717abfba0 100644
--- a/docs/plans/2026-09-30-tim-memory.md
+++ b/docs/plans/2026-09-30-tim-memory.md
@@ -2,7 +2,7 @@
Status: implementation in progress, 2026-09-30. The memory core, native transcript reader, durable learning loop, restricted inference adapters, worker isolation and owner library have executable tests. Development-gated host capture, scoped collection recall, native prompt adapters and the desktop Memories viewer are connected. Synthetic native probes demonstrated one hook-delivery path in Claude 2.1.286 and trusted interactive Codex 0.159.0. Local synthetic recall performance has been measured; real extraction quality, full native lifecycles and production integration remain unverified. The [sequential review log](2026-09-30-coding-memory-review-log.md) records findings, fixes, and remaining completion evidence.
-The executable [six-case extraction diagnostic](../research/2026-09-30-memory-extraction-cases.json) now exercises the actual learner, admission and recall. Its [first native attempt](../research/2026-09-30-memory-extraction-baseline.json) stopped with the selected Claude login unavailable: **zero completed extractions**, no quality score. This is separate from the 64 design scenarios and from the required held-out evaluation.
+The executable [six-case extraction diagnostic](../research/2026-09-30-memory-extraction-cases.json) now exercises the actual learner, admission and recall. Its [first native attempt](../research/2026-09-30-memory-extraction-baseline.json) stopped with native login unavailable. That result was traced to missing OS login names in the restricted adapter environment and fixed. The [latest attempt](../research/2026-10-01-memory-native-quality-blocked.json) then stopped at the selected Claude account’s weekly usage limit: **zero completed extractions**, no quality score. This is separate from the 64 design scenarios and from the required held-out evaluation.
The review build now exposes the local opt-in in **Settings → Experimental → Coding memory**.
It defaults off per account on this computer; the existing environment flag supplies only an unsaved
@@ -128,9 +128,9 @@ Separate `selected`, `delivered`, `read`, `agent_reported_applied`, `outcome_obs
An agent's report of use can link to a diff/test result, but it is not independent proof of causation. Evaluate benefit using controlled tasks and explicit user feedback. Corrections reduce confidence or supersede a claim. Do not reward memory generation or encourage agents to announce every recollection.
-Implementation checkpoint: the owner can inspect recent recall in a memory's detail view and mark one memory revision helpful or unhelpful, change the rating, or clear it. The rating is bound to an actual retained receipt and receiving engine/session/project, explicit task/branch scope and known conditions. Repeated recall across transport routes in that same context shares one rating. It is owner-reported usefulness, not a new source supporting the claim, proof of model-context delivery, or a causal task-outcome measurement. Retrieval ranking does not yet reward these labels automatically.
+Implementation checkpoint: the owner can inspect recent recall in a memory's detail view and mark one memory revision helpful or unhelpful, change the rating, or clear it. The rating is bound to an actual retained receipt and receiving engine/session/project, explicit task/branch scope and known conditions. Repeated recall across transport routes in that same context shares one rating. It is owner-reported usefulness, not a new source supporting the claim, proof of model-context delivery, or a causal task-outcome measurement. For a matching receiving project, explicit task/branch scope and exact known conditions, these labels now make a small, reversible adjustment to lexical ordering across Claude and Codex. The adjustment applies only to already eligible candidates at the rated revision; it cannot admit a hidden, expired, unrelated or overridden memory. Sparse ratings are shrunk toward neutral and their maximum influence is below 12.5% of the lexical score. This is an experimental policy, not a calibrated confidence or proven task improvement.
-The owner history uses one-way session/context keys without copying native session IDs or prompt text into receipt metadata. It checks both source visibility and the receiving session/project before limiting results, including privacy changes written by an earlier daemon. Making a receiving session private removes its owner-visible activity and feedback; reinclusion starts new activity. Corrected memory revisions do not inherit old ratings, and forgotten memories lose their feedback through deletion dependencies. Feedback expires with its receipt under the existing thirty-day/5,000-receipt retention bound. Legacy receipts without captured receiver authority remain unavailable for owner feedback rather than having their context guessed.
+The owner history uses one-way session/context keys without copying native session IDs or prompt text into receipt metadata. It checks both source visibility and the receiving session/project before limiting results, including privacy changes written by an earlier daemon. Making a receiving session private or excluding its project removes its owner-visible activity and feedback; reinclusion starts new activity. Repeating an exclusion or reincluding a policy changed by an older writer also removes the old activity before returning. Corrected memory revisions do not inherit old ratings, and forgotten memories lose their feedback through deletion dependencies. Feedback expires with its receipt under the existing thirty-day/5,000-receipt retention bound. Legacy receipts without captured receiver authority remain unavailable for owner feedback rather than having their context guessed. Retained ratings from before the separate relevance key was captured stay inspectable but do not influence ranking. Missing or ambiguous multi-project relevance also stays neutral.
### Continuous learning and improvement
@@ -142,7 +142,7 @@ Separate three feedback loops:
2. **Usefulness:** attach selection, verified delivery, reported use, outcomes, and direct user feedback to particular memory revisions and task contexts. An episode-wide success must not increase every recalled memory's standing. Irrelevant guidance can be correct yet unhelpful. A failed task can still contain a valid discovery. Keep truth support, contextual usefulness, and recency separate.
3. **System quality:** collect failure cases, propose a versioned extraction/retrieval change, evaluate it against a frozen baseline and held-out cases, then promote or roll back the configuration. The candidate may not rewrite its acceptance tests or promote itself using its own success narrative. Improvements must preserve scope isolation, correction, forgetting, no-recall behavior, budget, and task correctness before optimizing utility.
-The initial reinforcement implementation keeps independent source/session counts as provenance, not a model-generated confidence percentage or an automatic ranking reward. Context-specific usefulness ranking should follow real delivery receipts and labeled outcomes. Shared skills or repository instructions remain explicit engineering changes within the existing authorization model; background learning is not a permanent permission to edit every workspace.
+The initial reinforcement implementation keeps independent source/session counts as provenance, not a model-generated confidence percentage or an automatic ranking reward. Context-specific ranking uses explicit owner ratings attached to actual retained preparation receipts; native model-context delivery remains unverified unless separately established. Repeated recall alone creates no utility reward. Controlled task outcomes are still required to evaluate the provisional ranking policy. Shared skills or repository instructions remain explicit engineering changes within the existing authorization model; background learning is not a permanent permission to edit every workspace.
Research supports testing these distinctions, without proving this implementation. ACE studies incrementally curated context rather than repeated wholesale rewriting; our application is to retain granular claims and regenerate dependent views. [ACE, v3](https://arxiv.org/abs/2510.04618v3). RoMeRL identifies misleading credit assigned to irrelevant memories retrieved alongside useful ones; we therefore require feedback attribution rather than rewarding an entire packet. [RoMeRL, v3](https://arxiv.org/abs/2608.02508v3). EDV studies separating experience generation, distillation, and verification; our verification contract still requires native evidence or user confirmation, because agreement among models alone is not proof. [EDV, v1](https://arxiv.org/abs/2606.24428v1).
@@ -296,7 +296,7 @@ Keep the actual DSH terminal on the right. The left viewer's Memories area has t
- **Helping now:** memories selected for the active task, why their conditions match, relevant conflicts/unknowns, and precise delivery status. “Provided to Codex” is distinct from “You confirmed this helped.” Accepted examples open at their reviewed revision with the approved attributes identified.
- **Learning:** quiet status such as caught up, reviewing completed work, waiting for the selected model, or missing source history. Rejected generic candidates are diagnostic detail, not an inbox demanding attention.
-Implementation checkpoint: the viewer currently offers How you work, Project knowledge and Learning, with retained evidence, owner corrections, project scope narrowing, dependent-forget previews and separate Learn/Recall preferences. The project picker and detail view show persisted names and folder paths. Memory details include recent recall and explicit helpful/unhelpful feedback; ratings keep the detail open, support clearing, and offer a fresh read after an uncertain reply without automatically retrying the write. The agent terminal remains unchanged. Work-in-progress grouping, a collection-wide Helping now view, task/session navigation, automatic usefulness-based ranking and the maintained notebook view remain planned. The legacy approved-lesson list remains available; the 24-hour test action is hidden when the new memory service is available.
+Implementation checkpoint: the viewer currently offers How you work, Project knowledge and Learning, with retained evidence, owner corrections, project scope narrowing, dependent-forget previews and separate Learn/Recall preferences. The project picker and detail view show persisted names and folder paths. Memory details include recent recall and explicit helpful/unhelpful feedback; ratings keep the detail open, support clearing, and offer a fresh read after an uncertain reply without automatically retrying the write. The agent terminal remains unchanged. Project knowledge now includes a maintained notebook index and topic pages with source links, conditions, unresolved records and correction/forget controls. Individual memories remain available while notebook synthesis is queued or paused. Feedback-based ranking is implemented as an experimental bounded adjustment. Work-in-progress grouping, a collection-wide Helping now view and task/session navigation remain planned. The legacy approved-lesson list remains available; the 24-hour test action is hidden when the new memory service is available.
Tim can answer “Why did you remember that?” using the same evidence API the viewer uses. He must not invent shared experiences. A corrected memory updates its story rather than adding another repetitive lesson. A small optional recent-learning digest replaces repeated interruption, and no memory-count reward is attached to growth.
@@ -310,7 +310,7 @@ Include matched style cases: same task, code, requirements, model, and budget, w
The modern practitioner cases additionally cover stale canonical guidance, host discovery, task-dependent interaction, working-example compatibility, failed experiment scores, changed evaluators/budgets, branch provenance, operational evidence, and notebook lineage/invalidation. The design fixture set now contains 64 synthetic scenarios; this count does not satisfy the separate held-out-history requirement or constitute a passing behavioral benchmark.
-The first executable development diagnostic contains six frozen synthetic episodes: a conditional debugging preference, a scoped database decision, routine assistant activity, a quoted third-party opinion, an unstated rationale, and a repository fact without a verified project binding. Run `node --import tsx scripts/memory-extraction-eval.ts` from `cli` to inspect the fixture hash without invoking a model. Adding `--run-native --output <new-report.json>` uses the current companion's supported native model/account, at most six calls and no retries or fallback, with a disposable store. The runner checks selection before each call, after the native version probe and after the result, preserves existing reports, records source/prompt hashes and native diagnostic counters, and leaves semantic review explicitly pending. Incomplete extraction makes recall and quality checks inconclusive; it is never scored as successful abstention. Native calls can consume the selected provider's allowance. A signed-in selected model is required to proceed; the first attempt found the configured Claude account signed out. No held-out user histories or completed model responses have been evaluated yet.
+The first executable development diagnostic contains six frozen synthetic episodes: a conditional debugging preference, a scoped database decision, routine assistant activity, a quoted third-party opinion, an unstated rationale, and a repository fact without a verified project binding. Run `node --import tsx scripts/memory-extraction-eval.ts` from `cli` to inspect the fixture hash without invoking a model. Adding `--run-native --output <new-report.json>` uses the current companion's supported native model/account, at most six calls and no retries or fallback, with a disposable store. The runner checks selection before each call, after the native version probe and after the result, preserves existing reports, records source/prompt hashes and native diagnostic counters, and leaves semantic review explicitly pending. Incomplete extraction makes recall and quality checks inconclusive; it is never scored as successful abstention. Native calls can consume the selected provider's allowance. A signed-in selected model with remaining allowance is required to proceed. The first apparent sign-out was traced to the adapter environment and fixed; the subsequent native attempt was rejected by the selected account’s weekly quota. No held-out user histories or completed model responses have been evaluated yet.
Add `--batch` to select the separate [frozen multi-episode diagnostic](../research/2026-09-30-memory-batch-extraction-cases.json). Its two cases combine useful personal preferences with quoted/unbound material, and test whether an acknowledgement in a separate conversation is falsely attached to an assistant's experiment. Each captured episode retains its own session and evidence IDs. The grader requires every episode in the case to reach a successful terminal review state before scoring record counts, recall or abstention. If input limits leave part of the batch queued, quality checks stay inconclusive and semantic review is unavailable. These cases have not yet been executed against a real model; synthetic provider-output checks establish evaluation mechanics only.
diff --git a/docs/research/2026-10-01-memory-usefulness/feedback-dark-2.0x.png b/docs/research/2026-10-01-memory-usefulness/feedback-dark-2.0x.png
new file mode 100644
index 000000000..377a88d24
Binary files /dev/null and b/docs/research/2026-10-01-memory-usefulness/feedback-dark-2.0x.png differ
diff --git a/docs/research/2026-10-01-memory-usefulness/feedback-light-1.0x.png b/docs/research/2026-10-01-memory-usefulness/feedback-light-1.0x.png
new file mode 100644
index 000000000..9b7e2fcd6
Binary files /dev/null and b/docs/research/2026-10-01-memory-usefulness/feedback-light-1.0x.png differ
diff --git a/docs/research/2026-10-01-memory-usefulness/performance.json b/docs/research/2026-10-01-memory-usefulness/performance.json
new file mode 100644
index 000000000..18fa1e04a
--- /dev/null
+++ b/docs/research/2026-10-01-memory-usefulness/performance.json
@@ -0,0 +1,31 @@
+{
+ "kind": "synthetic-memory-performance",
+ "mode": "recall-with-contextual-feedback",
+ "retainedReceipts": 5000,
+ "ratedContexts": 5000,
+ "records": 10000,
+ "projects": 10,
+ "node": "v22.23.2",
+ "platform": "darwin",
+ "arch": "arm64",
+ "seedMs": 87431.508583,
+ "cold": {
+ "p50Ms": 62.035791999995126,
+ "p95Ms": 64.7803750000021,
+ "maxMs": 64.7803750000021
+ },
+ "warm": {
+ "p50Ms": 20.01929100000416,
+ "p95Ms": 22.12674999999581,
+ "maxMs": 25.0564999999915
+ },
+ "requests": 310,
+ "timeouts": 0,
+ "largestPacketBytes": 2591,
+ "parentEventLoopP95Ms": 1.277951,
+ "limitations": [
+ "Synthetic lexical matches, not a retrieval-quality benchmark.",
+ "Cold means a new worker, not an emptied OS disk cache.",
+ "One local machine; provider extraction and native hook delivery are not measured."
+ ]
+}