claude-memory-layer 1.0.27 → 1.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +7 -0
- package/AGENTS.md +11 -0
- package/README.md +184 -41
- package/benchmarks/replay/anonymized-real-sessions.json +48 -0
- package/dist/cli/index.js +10097 -6003
- package/dist/cli/index.js.map +4 -4
- package/dist/core/index.js +9745 -5587
- package/dist/core/index.js.map +4 -4
- package/dist/hooks/post-tool-use.js +6545 -5270
- package/dist/hooks/post-tool-use.js.map +4 -4
- package/dist/hooks/semantic-daemon.js +6646 -5354
- package/dist/hooks/semantic-daemon.js.map +4 -4
- package/dist/hooks/session-end.js +6618 -5347
- package/dist/hooks/session-end.js.map +4 -4
- package/dist/hooks/session-start.js +6619 -5354
- package/dist/hooks/session-start.js.map +4 -4
- package/dist/hooks/stop.js +6614 -5325
- package/dist/hooks/stop.js.map +4 -4
- package/dist/hooks/user-prompt-submit.js +6702 -5356
- package/dist/hooks/user-prompt-submit.js.map +4 -4
- package/dist/index.js +13537 -0
- package/dist/index.js.map +7 -0
- package/dist/mcp/index.js +20770 -0
- package/dist/mcp/index.js.map +7 -0
- package/dist/server/api/index.js +6632 -5319
- package/dist/server/api/index.js.map +4 -4
- package/dist/server/index.js +6667 -5340
- package/dist/server/index.js.map +4 -4
- package/dist/services/memory-service.js +6568 -5350
- package/dist/services/memory-service.js.map +4 -4
- package/dist/ui/assets/js/bootstrap.js +244 -0
- package/dist/ui/assets/js/chat.js +373 -0
- package/dist/ui/assets/js/disclosure.js +232 -0
- package/dist/ui/assets/js/modals.js +298 -0
- package/dist/ui/assets/js/overview.js +655 -0
- package/dist/ui/assets/js/state.js +72 -0
- package/dist/ui/assets/js/views.js +468 -0
- package/dist/ui/index.html +43 -1
- package/dist/ui/index.ts +3 -0
- package/dist/ui/style.css +222 -0
- package/docs/ARCHITECTURE_COMPARISON_AND_RECOMMENDATIONS.md +627 -0
- package/docs/HERMES_MEMORY_INGESTION_ANALYSIS.md +440 -0
- package/docs/MEMORY_USEFULNESS_AUDIT.md +371 -0
- package/docs/MEMORY_USEFULNESS_AUDIT_RAW.json +80 -0
- package/docs/MEMSEARCH_PROJECT_STRUCTURE_ANALYSIS.md +333 -0
- package/docs/PRODUCT_VALIDATION_MATRIX.md +82 -0
- package/docs/PROJECT_STRUCTURE_ANALYSIS.md +421 -0
- package/docs/REFACTORING_MILESTONES_AND_ISSUES.md +501 -0
- package/docs/REFACTORING_PLAN_THIN_CORE.md +414 -0
- package/docs/REFERENCE_PROJECT_ANALYSES.md +25 -0
- package/docs/SUPERLOCALMEMORY_PROJECT_STRUCTURE_ANALYSIS.md +452 -0
- package/docs/TARGET_ARCHITECTURE_AND_FOLDER_STRUCTURE.md +446 -0
- package/docs/architecture/comparison-index.md +47 -0
- package/docs/reports/codex-real-data-validation-20260505T040447Z.md +46 -0
- package/package.json +9 -5
- package/scripts/build.ts +25 -8
- package/scripts/generate-session-qrels.ts +126 -0
- package/scripts/replay-retrieval-benchmark.ts +69 -0
- package/specs/thin-core-refactor/context.md +275 -0
- package/specs/thin-core-refactor/plan.md +536 -0
- package/specs/thin-core-refactor/spec.md +465 -0
- package/src/adapters/claude/capture/index.ts +3 -0
- package/src/adapters/claude/context/index.ts +3 -0
- package/src/adapters/claude/hooks/index.ts +21 -0
- package/src/adapters/claude/hooks/post-tool-use.ts +239 -0
- package/src/adapters/claude/hooks/prompt-injection-policy.ts +104 -0
- package/src/adapters/claude/hooks/semantic-daemon-client.ts +209 -0
- package/src/adapters/claude/hooks/semantic-daemon.ts +283 -0
- package/src/adapters/claude/hooks/session-end.ts +59 -0
- package/src/adapters/claude/hooks/session-start.ts +73 -0
- package/src/adapters/claude/hooks/stop.ts +128 -0
- package/src/adapters/claude/hooks/user-prompt-submit.ts +361 -0
- package/src/adapters/claude/index.ts +4 -0
- package/src/adapters/claude/transcript/index.ts +4 -0
- package/src/adapters/claude/transcript/transcript-reader.ts +57 -0
- package/src/adapters/claude/transcript/turn-reconstructor.ts +65 -0
- package/src/apps/cli/claude-settings-hooks.ts +138 -0
- package/src/apps/cli/codex-import-runner.ts +125 -0
- package/src/apps/cli/codex-validation-output.ts +95 -0
- package/src/apps/cli/hermes-import-runner.ts +130 -0
- package/src/apps/cli/hermes-validation-output.ts +91 -0
- package/src/apps/cli/index.ts +1731 -0
- package/src/apps/cli/mcp-install.ts +106 -0
- package/src/apps/cli/retrieval-disclosure-output.ts +196 -0
- package/src/apps/dashboard/assets/js/bootstrap.js +244 -0
- package/src/apps/dashboard/assets/js/chat.js +373 -0
- package/src/apps/dashboard/assets/js/disclosure.js +232 -0
- package/src/apps/dashboard/assets/js/modals.js +298 -0
- package/src/apps/dashboard/assets/js/overview.js +655 -0
- package/src/apps/dashboard/assets/js/state.js +72 -0
- package/src/apps/dashboard/assets/js/views.js +468 -0
- package/src/{ui → apps/dashboard}/index.html +43 -1
- package/src/apps/dashboard/index.ts +3 -0
- package/src/{ui → apps/dashboard}/style.css +222 -0
- package/src/apps/index.ts +5 -0
- package/src/apps/server/api/chat.ts +244 -0
- package/src/apps/server/api/citations.ts +105 -0
- package/src/apps/server/api/events.ts +137 -0
- package/src/apps/server/api/health.ts +53 -0
- package/src/apps/server/api/index.ts +26 -0
- package/src/apps/server/api/projects.ts +74 -0
- package/src/apps/server/api/search.ts +184 -0
- package/src/apps/server/api/sessions.ts +115 -0
- package/src/apps/server/api/stats.ts +723 -0
- package/src/apps/server/api/turns.ts +143 -0
- package/src/apps/server/api/utils.ts +65 -0
- package/src/apps/server/index.ts +111 -0
- package/src/cli/index.ts +2 -1311
- package/src/cli/retrieval-disclosure-output.ts +2 -0
- package/src/compat/index.ts +5 -0
- package/src/core/derive/fact-deriver.ts +170 -0
- package/src/core/derive/index.ts +2 -0
- package/src/core/derive/summary-deriver.ts +76 -0
- package/src/core/embedder.ts +4 -152
- package/src/core/engine/embedding-maintenance-service.ts +187 -0
- package/src/core/engine/endless-memory-services.ts +4 -0
- package/src/core/engine/index.ts +19 -0
- package/src/core/engine/memory-engine-services.ts +170 -0
- package/src/core/engine/memory-ingest-service.ts +317 -0
- package/src/core/engine/memory-query-service.ts +173 -0
- package/src/core/engine/memory-runtime-service.ts +162 -0
- package/src/core/engine/memory-service-composition.ts +231 -0
- package/src/core/engine/retrieval-analytics-service.ts +181 -0
- package/src/core/engine/retrieval-disclosure-service.ts +420 -0
- package/src/core/engine/retrieval-orchestrator.ts +377 -0
- package/src/core/engine/retrieval-services.ts +176 -0
- package/src/core/engine/shared-memory-services.ts +4 -0
- package/src/core/entity-repo.ts +1 -3
- package/src/core/event-store.ts +3 -3
- package/src/core/evidence-aligner.ts +2 -2
- package/src/core/external-market-context.ts +582 -0
- package/src/core/graduation.ts +2 -3
- package/src/core/index.ts +21 -0
- package/src/core/matcher.ts +2 -4
- package/src/core/model/memory-fact.ts +30 -0
- package/src/core/model/memory-rule.ts +14 -0
- package/src/core/model/memory-summary.ts +21 -0
- package/src/core/model/raw-event.ts +28 -0
- package/src/core/model/retrieval-result.ts +35 -0
- package/src/core/privacy/filter.ts +21 -10
- package/src/core/product-validation-matrix.ts +314 -0
- package/src/core/progressive-retriever.ts +1 -2
- package/src/core/registry/project-path.ts +54 -0
- package/src/core/registry/session-registry.ts +69 -0
- package/src/core/replay-evaluator.ts +625 -0
- package/src/core/retrieval-benchmark.ts +117 -0
- package/src/core/retrieval-quality.ts +109 -0
- package/src/core/retriever.ts +53 -15
- package/src/core/session-qrels.ts +360 -0
- package/src/core/shared-event-store.ts +1 -1
- package/src/core/sqlite-event-store.ts +35 -11
- package/src/core/task/blocker-resolver.ts +2 -2
- package/src/core/task/task-resolver.ts +0 -1
- package/src/core/vector-outbox.ts +1 -10
- package/src/core/vector-worker.ts +1 -1
- package/src/extensions/endless-memory/endless-memory-services.ts +350 -0
- package/src/extensions/endless-memory/index.ts +1 -0
- package/src/extensions/index.ts +5 -0
- package/src/extensions/mcp/handlers.ts +960 -0
- package/src/extensions/mcp/index.ts +48 -0
- package/src/extensions/mcp/tools.ts +252 -0
- package/src/extensions/shared-memory/index.ts +1 -0
- package/src/extensions/shared-memory/shared-memory-services.ts +211 -0
- package/src/extensions/vector/embedder.ts +197 -0
- package/src/extensions/vector/index.ts +1 -0
- package/src/hooks/post-tool-use.ts +3 -236
- package/src/hooks/semantic-daemon-client.ts +1 -208
- package/src/hooks/semantic-daemon.ts +6 -271
- package/src/hooks/session-end.ts +4 -79
- package/src/hooks/session-start.ts +4 -73
- package/src/hooks/stop.ts +3 -173
- package/src/hooks/user-prompt-submit.ts +3 -338
- package/src/index.ts +13 -0
- package/src/mcp/handlers.ts +2 -212
- package/src/mcp/index.ts +3 -46
- package/src/mcp/tools.ts +2 -78
- package/src/server/api/chat.ts +2 -244
- package/src/server/api/citations.ts +2 -105
- package/src/server/api/events.ts +2 -137
- package/src/server/api/health.ts +2 -53
- package/src/server/api/index.ts +2 -26
- package/src/server/api/projects.ts +2 -74
- package/src/server/api/search.ts +2 -102
- package/src/server/api/sessions.ts +2 -115
- package/src/server/api/stats.ts +2 -724
- package/src/server/api/turns.ts +2 -143
- package/src/server/api/utils.ts +2 -46
- package/src/server/index.ts +2 -100
- package/src/services/bootstrap-organizer.ts +46 -26
- package/src/services/codex-session-history-importer.ts +521 -29
- package/src/services/hermes-session-history-importer.ts +733 -0
- package/src/services/memory-service-config.ts +36 -0
- package/src/services/memory-service-registry.ts +150 -0
- package/src/services/memory-service.ts +211 -1325
- package/src/services/session-history-importer.ts +58 -14
- package/tests/README.md +23 -0
- package/tests/adapters/claude/claude-semantic-daemon-adapter.test.ts +54 -0
- package/tests/adapters/claude/claude-transcript-reconstructor.test.ts +98 -0
- package/tests/adapters/claude-hook-prompt-injection-policy.test.ts +99 -0
- package/tests/apps/app-layer-boundary.test.ts +48 -0
- package/tests/apps/claude-settings-hooks.test.ts +107 -0
- package/tests/apps/cli-disclosure-output.test.ts +212 -0
- package/tests/apps/codex-import-runner.test.ts +99 -0
- package/tests/apps/codex-validation-output.test.ts +100 -0
- package/tests/apps/hermes-import-runner.test.ts +99 -0
- package/tests/apps/mcp-install-command.test.ts +59 -0
- package/tests/apps/package-build-entrypoints.test.ts +30 -0
- package/tests/apps/search-api-disclosure.test.ts +162 -0
- package/tests/apps/stats-api-lightweight.test.ts +67 -0
- package/tests/apps/ui-disclosure-output.test.ts +140 -0
- package/tests/{bootstrap-organizer.test.ts → core/bootstrap-organizer.test.ts} +1 -1
- package/tests/{canonical-key.test.ts → core/canonical-key.test.ts} +1 -1
- package/tests/core/codex-session-history-importer-validation.test.ts +185 -0
- package/tests/{consolidation-worker.test.ts → core/consolidation-worker.test.ts} +2 -2
- package/tests/core/embedding-maintenance-service.test.ts +282 -0
- package/tests/{evidence-aligner.test.ts → core/evidence-aligner.test.ts} +1 -1
- package/tests/core/external-market-context.test.ts +209 -0
- package/tests/core/fact-deriver.test.ts +79 -0
- package/tests/core/hermes-session-history-importer-validation.test.ts +609 -0
- package/tests/{ingest-interceptor.test.ts → core/ingest-interceptor.test.ts} +1 -1
- package/tests/{markdown-mirror.test.ts → core/markdown-mirror.test.ts} +2 -2
- package/tests/{matcher.test.ts → core/matcher.test.ts} +1 -1
- package/tests/{md-mirror.test.ts → core/md-mirror.test.ts} +2 -2
- package/tests/core/memory-engine-services.test.ts +240 -0
- package/tests/core/memory-ingest-service.test.ts +296 -0
- package/tests/core/memory-query-service.test.ts +129 -0
- package/tests/core/memory-runtime-service.test.ts +201 -0
- package/tests/core/memory-service-composition.test.ts +192 -0
- package/tests/core/memory-service-config.test.ts +41 -0
- package/tests/core/memory-service-facade.test.ts +30 -0
- package/tests/core/memory-service-registry.test.ts +206 -0
- package/tests/core/product-validation-matrix.test.ts +61 -0
- package/tests/core/project-registry.test.ts +78 -0
- package/tests/core/replay-evaluator.test.ts +181 -0
- package/tests/core/retrieval-analytics-service.test.ts +210 -0
- package/tests/core/retrieval-benchmark.test.ts +93 -0
- package/tests/core/retrieval-disclosure-service.test.ts +264 -0
- package/tests/core/retrieval-orchestrator.test.ts +403 -0
- package/tests/core/retrieval-quality.test.ts +31 -0
- package/tests/core/retrieval-services.test.ts +185 -0
- package/tests/{retriever-fallback-chain.test.ts → core/retriever-fallback-chain.test.ts} +3 -3
- package/tests/{retriever-strategy-scope.test.ts → core/retriever-strategy-scope.test.ts} +70 -3
- package/tests/{retriever.memu-adoption.test.ts → core/retriever.memu-adoption.test.ts} +3 -3
- package/tests/core/session-history-importer-filter.test.ts +78 -0
- package/tests/core/session-qrels.test.ts +250 -0
- package/tests/{sqlite-event-store-replication.test.ts → core/sqlite-event-store-replication.test.ts} +36 -1
- package/tests/core/summary-deriver.test.ts +66 -0
- package/tests/extensions/embedder-warning-suppression.test.ts +53 -0
- package/tests/extensions/endless-memory-extension-boundary.test.ts +17 -0
- package/tests/extensions/endless-memory-services.test.ts +325 -0
- package/tests/extensions/mcp-context-tools.test.ts +905 -0
- package/tests/extensions/mcp-extension-boundary.test.ts +21 -0
- package/tests/extensions/mcp-package-build.test.ts +22 -0
- package/tests/extensions/mcp-project-aware-tools.test.ts +102 -0
- package/tests/extensions/shared-memory-extension-boundary.test.ts +24 -0
- package/tests/extensions/shared-memory-services.test.ts +309 -0
- package/tests/extensions/vector-extension-boundary.test.ts +21 -0
- package/.claude/settings.local.json +0 -25
- package/.npm-cache/_cacache/content-v2/sha512/04/76/c098f88dfe584a2b80870bff7421b05d17d3d9ee1027f77772332a22d3f93a9a57101a2855107f6ad82077a818bba912b2bc317f2361b5ddb09ad284d9ce +0 -0
- package/.npm-cache/_cacache/content-v2/sha512/60/25/d2ecd39cfc7cab58351162814be77f935c6d6491c10c3745d456da7ddb2117ffd90c10e53fe3c0f1ed16b403307841543634504398b16ee4e6b6dd8e0c45 +0 -0
- package/.npm-cache/_cacache/index-v5/2b/9a/7f8f40206ed8a2e0a84efaa953ccaed1f5d001e14b931083f2e7a0738007 +0 -2
- package/.npm-cache/_cacache/index-v5/2e/d9/fcfa5c6a6abdc2a3644ab84a95936047298c465a2f47ee03db8f7fe1e946 +0 -3
- package/.npm-cache/_cacache/index-v5/a9/42/e519633356d12d3d2f19da66a8301016d496c8f5c3e0554124aaa62dc043 +0 -2
- package/.npm-cache/_logs/2026-02-26T12_04_52_729Z-debug-0.log +0 -256
- package/.npm-cache/_logs/2026-02-26T12_05_36_835Z-debug-0.log +0 -18
- package/.npm-cache/_logs/2026-02-26T12_05_45_982Z-debug-0.log +0 -32
- package/.npm-cache/_logs/2026-02-26T12_05_48_515Z-debug-0.log +0 -260
- package/.npm-cache/_logs/2026-02-26T12_05_53_567Z-debug-0.log +0 -69
- package/.npm-cache/_update-notifier-last-checked +0 -0
- package/bootstrap-kb/decisions/decisions.md +0 -244
- package/bootstrap-kb/glossary/glossary.md +0 -46
- package/bootstrap-kb/modules/.claude-plugin.md +0 -22
- package/bootstrap-kb/modules/agents.md.md +0 -15
- package/bootstrap-kb/modules/claude.md.md +0 -15
- package/bootstrap-kb/modules/context.md.md +0 -15
- package/bootstrap-kb/modules/docs.md +0 -18
- package/bootstrap-kb/modules/handoff.md.md +0 -15
- package/bootstrap-kb/modules/package-lock.json.md +0 -15
- package/bootstrap-kb/modules/package.json.md +0 -15
- package/bootstrap-kb/modules/plan.md.md +0 -15
- package/bootstrap-kb/modules/readme.md.md +0 -15
- package/bootstrap-kb/modules/scripts.md +0 -26
- package/bootstrap-kb/modules/spec.md.md +0 -15
- package/bootstrap-kb/modules/specs.md +0 -20
- package/bootstrap-kb/modules/src.md +0 -51
- package/bootstrap-kb/modules/tests.md +0 -42
- package/bootstrap-kb/modules/tsconfig.json.md +0 -15
- package/bootstrap-kb/modules/vitest.config.ts.md +0 -15
- package/bootstrap-kb/overview/overview.md +0 -40
- package/bootstrap-kb/sources/manifest.json +0 -950
- package/bootstrap-kb/sources/manifest.md +0 -227
- package/bootstrap-kb/timeline/timeline.md +0 -57
- package/claude-memory-layer-1.0.14.tgz +0 -0
- package/d.sh +0 -3
- package/deploy.sh +0 -3
- package/dist/ui/app.js +0 -2101
- package/memory/.claude-plugin/commands/2026-02-25.md +0 -263
- package/memory/_index.md +0 -419
- package/memory/agent_response/uncategorized/2026-02-26.md +0 -176
- package/memory/agent_response/uncategorized/2026-03-03.md +0 -14
- package/memory/agent_response/uncategorized/2026-03-04.md +0 -1421
- package/memory/agent_response/uncategorized/2026-03-05.md +0 -157
- package/memory/default/uncategorized/2026-02-25.md +0 -4839
- package/memory/session_summary/uncategorized/2026-02-26.md +0 -13
- package/memory/session_summary/uncategorized/2026-03-03.md +0 -5
- package/memory/session_summary/uncategorized/2026-03-04.md +0 -50
- package/memory/specs/20260207-dashboard-upgrade/2026-02-25.md +0 -142
- package/memory/specs/citations-system/2026-02-25.md +0 -1121
- package/memory/specs/endless-mode/2026-02-25.md +0 -1392
- package/memory/specs/entity-edge-model/2026-02-25.md +0 -1263
- package/memory/specs/evidence-aligner-v2/2026-02-25.md +0 -1028
- package/memory/specs/mcp-desktop-integration/2026-02-25.md +0 -1334
- package/memory/specs/post-tool-use-hook/2026-02-25.md +0 -1164
- package/memory/specs/private-tags/2026-02-25.md +0 -1057
- package/memory/specs/progressive-disclosure/2026-02-25.md +0 -1436
- package/memory/specs/task-entity-system/2026-02-25.md +0 -924
- package/memory/specs/vector-outbox-v2/2026-02-25.md +0 -1510
- package/memory/specs/web-viewer-ui/2026-02-25.md +0 -1709
- package/memory/tool_observation/uncategorized/2026-02-26.md +0 -209
- package/memory/tool_observation/uncategorized/2026-03-03.md +0 -21
- package/memory/tool_observation/uncategorized/2026-03-04.md +0 -1033
- package/memory/tool_observation/uncategorized/2026-03-05.md +0 -33
- package/memory/user_prompt/uncategorized/2026-02-26.md +0 -25
- package/memory/user_prompt/uncategorized/2026-03-04.md +0 -634
- package/memory/user_prompt/uncategorized/2026-03-05.md +0 -6
- package/specs/optional-duckdb/context.md +0 -77
- package/specs/optional-duckdb/plan.md +0 -142
- package/specs/optional-duckdb/spec.md +0 -35
- package/src/ui/app.js +0 -2101
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
# Memory Usefulness Audit — Real Scenario Test
|
|
2
|
+
|
|
3
|
+
Date: 2026-05-05
|
|
4
|
+
Target: `claude-memory-layer` built CLI (`dist/cli/index.js`)
|
|
5
|
+
Isolation: temporary `HOME` and temporary project directories; no real `~/.claude` or `~/.claude-code/memory` was touched.
|
|
6
|
+
Raw evidence: [`MEMORY_USEFULNESS_AUDIT_RAW.json`](./MEMORY_USEFULNESS_AUDIT_RAW.json)
|
|
7
|
+
|
|
8
|
+
## 0. Follow-up improvements applied and re-verified
|
|
9
|
+
|
|
10
|
+
After the first audit exposed precision/UX issues, the following improvements were implemented and the same real scenario was rerun:
|
|
11
|
+
|
|
12
|
+
1. Query-time command artifact guard
|
|
13
|
+
- Queries such as `local-command-stdout command-name opus` now return zero memories.
|
|
14
|
+
2. Technical identifier lexical guard
|
|
15
|
+
- Out-of-domain project-scoped queries such as `DuckDB legacy storage migrate` in the alpha project now return zero memories instead of loosely related semantic matches.
|
|
16
|
+
- The same query in the beta project still returns the beta DuckDB memory, proving useful exact matches are preserved.
|
|
17
|
+
3. Score cliff cutoff
|
|
18
|
+
- The FTS query now returns the two actually relevant memories instead of including an unrelated dashboard provenance third result.
|
|
19
|
+
4. Transformer warning suppression
|
|
20
|
+
- Known benign HuggingFace warnings (`Unknown model class "eurobert"`, `dtype not specified`) no longer appear in CLI import/stats/search output.
|
|
21
|
+
5. Disclosure reason taxonomy cleanup
|
|
22
|
+
- Keyword-only disclosure now reports `keyword_match` without `semantic_match` when `vector=no`.
|
|
23
|
+
|
|
24
|
+
The raw evidence file was regenerated after these improvements.
|
|
25
|
+
|
|
26
|
+
## 1. Test goal
|
|
27
|
+
|
|
28
|
+
This audit tested whether the memory layer is useful in the way a coding assistant actually needs it:
|
|
29
|
+
|
|
30
|
+
1. It can import real Claude-style JSONL conversation history.
|
|
31
|
+
2. It retrieves durable engineering decisions when asked later with different wording.
|
|
32
|
+
3. It keeps project memories scoped, so unrelated project decisions do not leak.
|
|
33
|
+
4. It filters low-value command artifacts from imported sessions.
|
|
34
|
+
5. The progressive `search -> expand -> source` workflow gives enough provenance to trust and inspect a memory.
|
|
35
|
+
6. The shipped CLI works after build, not only through source-level tests.
|
|
36
|
+
|
|
37
|
+
## 2. Scenario design
|
|
38
|
+
|
|
39
|
+
Two temporary projects were created:
|
|
40
|
+
|
|
41
|
+
- `alpha-commerce-ai`: current/refactor project memories.
|
|
42
|
+
- `beta-legacy-duckdb`: unrelated project with a deliberately conflicting storage decision.
|
|
43
|
+
|
|
44
|
+
The crafted Claude JSONL sessions contained the following durable memories.
|
|
45
|
+
|
|
46
|
+
### Alpha memories
|
|
47
|
+
|
|
48
|
+
1. **Retrieval disclosure lifecycle rule**
|
|
49
|
+
- `expand` / `source` drill-down routes must stay lightweight.
|
|
50
|
+
- They should not call full `MemoryService.initialize()` because that can start embedders, vector workers, or shared promotion machinery.
|
|
51
|
+
|
|
52
|
+
2. **SQLite FTS rebuild fix**
|
|
53
|
+
- The `no such column: T.event_id` failure is fixed by making `events_fts` an internal FTS5 table with `content` and `event_id UNINDEXED`.
|
|
54
|
+
- Rebuild by dropping/recreating FTS and triggers.
|
|
55
|
+
|
|
56
|
+
3. **Shared dashboard provenance decision**
|
|
57
|
+
- Shared results should render as `shared_troubleshooting` provenance.
|
|
58
|
+
- Show `sourceProjectHash`, `sourceEntryId`, `topics`, `rootCause`, `solution`, and state that no local raw event exists.
|
|
59
|
+
|
|
60
|
+
4. **Noise artifact**
|
|
61
|
+
- `<command-name>/model</command-name>` + `<local-command-stdout>opus</local-command-stdout>` was included to verify command artifacts are not stored as useful user prompts.
|
|
62
|
+
|
|
63
|
+
### Beta memory
|
|
64
|
+
|
|
65
|
+
- A conflicting legacy decision: beta should keep DuckDB and not migrate to SQLite.
|
|
66
|
+
- This tests project scoping against alpha queries.
|
|
67
|
+
|
|
68
|
+
## 3. Commands executed
|
|
69
|
+
|
|
70
|
+
All commands used a temporary `HOME`.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
node dist/cli/index.js import --session <alpha-session.jsonl> --project <alpha-project> --verbose
|
|
74
|
+
node dist/cli/index.js import --session <beta-session.jsonl> --project <beta-project> --verbose
|
|
75
|
+
node dist/cli/index.js stats --project <alpha-project>
|
|
76
|
+
node dist/cli/index.js search "disclosure expand source initialize vector workers lightweight" --project <alpha-project> --top-k 5 --min-score 0.1
|
|
77
|
+
node dist/cli/index.js search "T.event_id FTS rebuild internal table trigger event_id" --project <alpha-project> --top-k 5 --min-score 0.1
|
|
78
|
+
node dist/cli/index.js search "shared_troubleshooting rootCause solution sourceProjectHash" --project <alpha-project> --top-k 5 --min-score 0.1
|
|
79
|
+
node dist/cli/index.js search "local-command-stdout command-name opus" --project <alpha-project> --top-k 5 --min-score 0.1
|
|
80
|
+
node dist/cli/index.js search "DuckDB legacy storage migrate" --project <alpha-project> --top-k 5 --min-score 0.1
|
|
81
|
+
node dist/cli/index.js search "DuckDB legacy storage migrate" --project <beta-project> --top-k 5 --min-score 0.1
|
|
82
|
+
node dist/cli/index.js search "T.event_id FTS rebuild internal table" --project <alpha-project> --top-k 3 --min-score 0.1 --disclosure --strategy fast
|
|
83
|
+
node dist/cli/index.js expand <first-disclosure-result-id> --project <alpha-project> --window-size 2
|
|
84
|
+
node dist/cli/index.js source <first-disclosure-result-id> --project <alpha-project>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## 4. Verified working behavior
|
|
88
|
+
|
|
89
|
+
### 4.1 Import works and filters command-artifact noise
|
|
90
|
+
|
|
91
|
+
Alpha import result:
|
|
92
|
+
|
|
93
|
+
- Total messages: 7
|
|
94
|
+
- Imported prompts: 3
|
|
95
|
+
- Imported responses: 3
|
|
96
|
+
- Skipped duplicates/noise: 1
|
|
97
|
+
- Embeddings queued: 6
|
|
98
|
+
|
|
99
|
+
This is exactly expected: the three real user prompts and three assistant durable responses were imported, while the local-command artifact was skipped.
|
|
100
|
+
|
|
101
|
+
Beta import result:
|
|
102
|
+
|
|
103
|
+
- Total messages: 2
|
|
104
|
+
- Imported prompts: 1
|
|
105
|
+
- Imported responses: 1
|
|
106
|
+
- Embeddings queued: 2
|
|
107
|
+
|
|
108
|
+
### 4.2 Project-scoped markdown mirror writes to the target project
|
|
109
|
+
|
|
110
|
+
The audit verified markdown mirrors were written under each temporary target project, not under the `claude-memory-layer` repository working directory.
|
|
111
|
+
|
|
112
|
+
Examples:
|
|
113
|
+
|
|
114
|
+
- `<alpha-project>/memory/_index.md`
|
|
115
|
+
- `<alpha-project>/memory/agent_response/uncategorized/2026-05-05.md`
|
|
116
|
+
- `<alpha-project>/memory/user_prompt/uncategorized/2026-05-05.md`
|
|
117
|
+
|
|
118
|
+
`repo_memory_exists = false`, so the previous accidental `memory/` artifact in the repository did not recur.
|
|
119
|
+
|
|
120
|
+
### 4.3 Stats reflect imported memory and vectors
|
|
121
|
+
|
|
122
|
+
Alpha stats:
|
|
123
|
+
|
|
124
|
+
- Total Events: 6
|
|
125
|
+
- Vector Count: 6
|
|
126
|
+
- Memory Levels: `L0: 6`
|
|
127
|
+
|
|
128
|
+
This proves import, SQLite storage, embedding queue processing, and vector count all reached a coherent state.
|
|
129
|
+
|
|
130
|
+
### 4.4 Retrieval finds the right durable decisions
|
|
131
|
+
|
|
132
|
+
#### Query: lifecycle rule for disclosure expand/source
|
|
133
|
+
|
|
134
|
+
Top result:
|
|
135
|
+
|
|
136
|
+
- `agent_response`
|
|
137
|
+
- Score: `1.000`
|
|
138
|
+
- Correct memory: lightweight drill-down; do not call full `MemoryService.initialize()` for expand/source.
|
|
139
|
+
|
|
140
|
+
This is highly useful: it recovers a nuanced architectural constraint from a later query.
|
|
141
|
+
|
|
142
|
+
#### Query: SQLite FTS `T.event_id` fix
|
|
143
|
+
|
|
144
|
+
Top result:
|
|
145
|
+
|
|
146
|
+
- `agent_response`
|
|
147
|
+
- Score: `0.978`
|
|
148
|
+
- Correct memory: internal FTS5 table with `event_id UNINDEXED`, rebuild by dropping/recreating FTS and triggers.
|
|
149
|
+
|
|
150
|
+
Second result:
|
|
151
|
+
|
|
152
|
+
- Original user question, score `0.905`.
|
|
153
|
+
|
|
154
|
+
This is also useful. It retrieves both the answer and the originating question.
|
|
155
|
+
|
|
156
|
+
#### Query: dashboard shared provenance
|
|
157
|
+
|
|
158
|
+
Top and only result:
|
|
159
|
+
|
|
160
|
+
- `agent_response`
|
|
161
|
+
- Score: `1.000`
|
|
162
|
+
- Correct memory: `shared_troubleshooting`, `sourceProjectHash`, `sourceEntryId`, `topics`, `rootCause`, `solution`.
|
|
163
|
+
|
|
164
|
+
This is excellent for product/UX decision recall.
|
|
165
|
+
|
|
166
|
+
### 4.5 Project scoping works for cross-project conflict
|
|
167
|
+
|
|
168
|
+
Alpha query for `DuckDB legacy storage migrate` did **not** return the beta DuckDB memory and, after the technical-identifier guard, returned **zero** alpha-project false positives.
|
|
169
|
+
|
|
170
|
+
Beta query for the same phrase returned the beta DuckDB prompt/answer with high scores:
|
|
171
|
+
|
|
172
|
+
- `user_prompt`, score `1.000`
|
|
173
|
+
- `agent_response`, score `0.922`
|
|
174
|
+
|
|
175
|
+
So strict project isolation is working at the storage/retrieval boundary.
|
|
176
|
+
|
|
177
|
+
### 4.6 Progressive disclosure is useful and inspectable
|
|
178
|
+
|
|
179
|
+
Disclosure query for FTS returned:
|
|
180
|
+
|
|
181
|
+
```text
|
|
182
|
+
Meta: total=2 vector=no keyword=yes fallback=no
|
|
183
|
+
1. [source] Agent response
|
|
184
|
+
id: event:<uuid>
|
|
185
|
+
score: 1.000
|
|
186
|
+
reasons: keyword_match, recent_relevance, continuity_link
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
`expand` on the first result returned surrounding turn context:
|
|
190
|
+
|
|
191
|
+
- previous lifecycle decision
|
|
192
|
+
- target FTS answer
|
|
193
|
+
- neighboring dashboard provenance question/answer
|
|
194
|
+
|
|
195
|
+
`source` returned raw event details:
|
|
196
|
+
|
|
197
|
+
- sourceRef
|
|
198
|
+
- sourceType: `imported_history`
|
|
199
|
+
- eventIds
|
|
200
|
+
- full raw event content
|
|
201
|
+
- session id
|
|
202
|
+
- canonical key
|
|
203
|
+
|
|
204
|
+
This is a strong product surface: the model/user can inspect not just the snippet but why the memory exists and what conversation context surrounded it.
|
|
205
|
+
|
|
206
|
+
## 5. Problems discovered
|
|
207
|
+
|
|
208
|
+
### P0 — Built CLI initially failed because of duplicate `fileURLToPath`
|
|
209
|
+
|
|
210
|
+
The first audit run found that `node dist/cli/index.js ...` failed before any memory command ran:
|
|
211
|
+
|
|
212
|
+
```text
|
|
213
|
+
SyntaxError: Identifier 'fileURLToPath' has already been declared
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Cause:
|
|
217
|
+
|
|
218
|
+
- `scripts/build.ts` injects an esbuild banner that declares `fileURLToPath`.
|
|
219
|
+
- `src/apps/server/index.ts` also imported `fileURLToPath` under the same identifier.
|
|
220
|
+
- Because CLI bundles server/dashboard code, the duplicate identifier broke the built CLI.
|
|
221
|
+
|
|
222
|
+
Fix applied:
|
|
223
|
+
|
|
224
|
+
- Changed server import to alias the identifier:
|
|
225
|
+
- `import { fileURLToPath as fileUrlToPath } from 'url';`
|
|
226
|
+
- `fileUrlToPath(import.meta.url)`
|
|
227
|
+
|
|
228
|
+
Verification:
|
|
229
|
+
|
|
230
|
+
- `npm run build`
|
|
231
|
+
- `node dist/cli/index.js --help`
|
|
232
|
+
- full memory audit rerun successfully.
|
|
233
|
+
|
|
234
|
+
### P1 — HuggingFace/transformer warnings were noisy in normal CLI flows — fixed
|
|
235
|
+
|
|
236
|
+
The first run emitted known benign transformer warnings on import/stats/search. The improved run no longer shows these warnings in the raw CLI outputs.
|
|
237
|
+
|
|
238
|
+
Implemented:
|
|
239
|
+
|
|
240
|
+
- Known benign warnings are suppressed around lazy `@huggingface/transformers` pipeline loading/initialization.
|
|
241
|
+
|
|
242
|
+
Remaining recommendation:
|
|
243
|
+
|
|
244
|
+
- Consider further reducing embedder initialization on pure stats/read paths, but the user-facing warning noise is fixed.
|
|
245
|
+
|
|
246
|
+
### P1 — Search returned plausible but irrelevant results on no-match artifact queries — fixed
|
|
247
|
+
|
|
248
|
+
Noise query:
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
search "local-command-stdout command-name opus" --project alpha --top-k 5 --min-score 0.1
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Improved result:
|
|
255
|
+
|
|
256
|
+
- `Confidence: none`
|
|
257
|
+
- `Total local memories found: 0`
|
|
258
|
+
|
|
259
|
+
Implemented:
|
|
260
|
+
|
|
261
|
+
- Query-time command artifact guard for `local-command-stdout`, `local-command-stderr`, `command-name`, and `command-message` patterns.
|
|
262
|
+
- Regression coverage in `tests/core/retriever-strategy-scope.test.ts`.
|
|
263
|
+
|
|
264
|
+
### P1 — Out-of-domain project-scoped queries returned irrelevant in-project memories — fixed
|
|
265
|
+
|
|
266
|
+
Alpha query:
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
search "DuckDB legacy storage migrate" --project alpha
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
Improved result:
|
|
273
|
+
|
|
274
|
+
- `Confidence: none`
|
|
275
|
+
- `Total local memories found: 0`
|
|
276
|
+
|
|
277
|
+
Beta query for the same phrase still returns the correct beta DuckDB memory, so the guard improves precision without breaking positive technical-identifier recall.
|
|
278
|
+
|
|
279
|
+
Implemented:
|
|
280
|
+
|
|
281
|
+
- Technical identifier lexical guard for terms such as `DuckDB`, `T.event_id`, and `sourceProjectHash`.
|
|
282
|
+
- Regression coverage proving false positives are filtered while exact technical matches are preserved.
|
|
283
|
+
|
|
284
|
+
### P2 — Top-k included adjacent but not always relevant memories — improved
|
|
285
|
+
|
|
286
|
+
For the FTS query, top 1 and top 2 were excellent, but the first run included an unrelated dashboard provenance third result.
|
|
287
|
+
|
|
288
|
+
Improved result:
|
|
289
|
+
|
|
290
|
+
- The same FTS query now returns only the two directly relevant memories.
|
|
291
|
+
|
|
292
|
+
Implemented:
|
|
293
|
+
|
|
294
|
+
- A conservative score-cliff cutoff after reranking/scope filtering.
|
|
295
|
+
|
|
296
|
+
Remaining recommendation:
|
|
297
|
+
|
|
298
|
+
- For prompt injection, continue to prefer `confidence=high` results and keep suggested results separated from injected context.
|
|
299
|
+
|
|
300
|
+
### P2 — Progressive disclosure reason labels were misleading in keyword-only mode — fixed
|
|
301
|
+
|
|
302
|
+
Disclosure meta says:
|
|
303
|
+
|
|
304
|
+
```text
|
|
305
|
+
vector=no keyword=yes
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
Improved result reasons now say:
|
|
309
|
+
|
|
310
|
+
```text
|
|
311
|
+
keyword_match, recent_relevance, continuity_link
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
Implemented:
|
|
315
|
+
|
|
316
|
+
- Disclosure reason mapping omits `semantic_match` when vector/deep retrieval was not used.
|
|
317
|
+
- Regression coverage in `tests/core/retrieval-disclosure-service.test.ts`.
|
|
318
|
+
|
|
319
|
+
## 6. Remaining next improvements, prioritized
|
|
320
|
+
|
|
321
|
+
The originally identified precision/UX items have mostly been addressed in this slice. Remaining useful follow-ups:
|
|
322
|
+
|
|
323
|
+
### Priority 1 — Further reduce unnecessary embedder initialization
|
|
324
|
+
|
|
325
|
+
Known warning noise is now suppressed, but read paths may still initialize the embedder.
|
|
326
|
+
|
|
327
|
+
Improve:
|
|
328
|
+
|
|
329
|
+
- `stats` should use a lightweight/read-only service path when possible.
|
|
330
|
+
- `search --strategy fast` should avoid embedder initialization until deep/vector search is actually needed.
|
|
331
|
+
|
|
332
|
+
Expected impact:
|
|
333
|
+
|
|
334
|
+
- Faster stats/search commands.
|
|
335
|
+
- Lower CPU/model-load overhead.
|
|
336
|
+
|
|
337
|
+
### Priority 2 — Make prompt-injection policy stricter than CLI search
|
|
338
|
+
|
|
339
|
+
CLI search can show suggested results, but prompt injection should be more conservative.
|
|
340
|
+
|
|
341
|
+
Improve:
|
|
342
|
+
|
|
343
|
+
- Inject only high-confidence memories by default.
|
|
344
|
+
- Keep suggested results visible in CLI/dashboard but separate from automatic context injection.
|
|
345
|
+
|
|
346
|
+
Expected impact:
|
|
347
|
+
|
|
348
|
+
- Lower memory hallucination risk in real Claude hooks.
|
|
349
|
+
|
|
350
|
+
### Priority 3 — Add more real-world benchmark scenarios
|
|
351
|
+
|
|
352
|
+
This audit used crafted sessions. Add broader replay suites:
|
|
353
|
+
|
|
354
|
+
- 20-50 actual anonymized coding sessions.
|
|
355
|
+
- Known-answer queries and negative/no-match queries.
|
|
356
|
+
- Precision@k / recall@k tracking across refactors.
|
|
357
|
+
|
|
358
|
+
## 7. Overall verdict
|
|
359
|
+
|
|
360
|
+
The memory layer is already useful for durable engineering recall:
|
|
361
|
+
|
|
362
|
+
- It successfully remembered architectural constraints, bug-fix details, and UI provenance decisions.
|
|
363
|
+
- It recovered the right memories from later, differently phrased queries.
|
|
364
|
+
- Project scoping prevented a deliberately conflicting beta project memory from leaking into alpha search.
|
|
365
|
+
- Progressive disclosure gave enough context and raw source provenance to trust a retrieved memory.
|
|
366
|
+
|
|
367
|
+
After the follow-up fixes, the biggest remaining quality issue is no longer basic precision; it is **operational efficiency and broader benchmarking**:
|
|
368
|
+
|
|
369
|
+
- Avoid unnecessary embedder/model initialization on pure read paths where possible.
|
|
370
|
+
- Keep automatic prompt injection stricter than exploratory CLI/dashboard search.
|
|
371
|
+
- Expand the benchmark from crafted scenarios to larger anonymized real-session replay suites.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"root": "/var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p",
|
|
3
|
+
"home": "/var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/home",
|
|
4
|
+
"project_a": "/var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/alpha-commerce-ai",
|
|
5
|
+
"project_b": "/var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/beta-legacy-duckdb",
|
|
6
|
+
"results": [
|
|
7
|
+
{
|
|
8
|
+
"label": "import alpha crafted Claude session",
|
|
9
|
+
"exit": 0,
|
|
10
|
+
"cmd": "node /Users/namsangboy/workspace/claude-memory-layer/dist/cli/index.js import --session /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/alpha-session.jsonl --project /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/alpha-commerce-ai --verbose",
|
|
11
|
+
"output": "\n⏳ Initializing memory service...\n ✅ Ready (embedder: jinaai/jina-embeddings-v5-text-nano-text-matching)\n\n📥 Importing session: /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/alpha-session.jsonl\n Target: /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/alpha-commerce-ai\n\n\n 📄 [1/...] 1 msgs | +1 imported, ~0 skipped Imported 3 prompts, 3 responses from /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/alpha-session.jsonl\n\n🧠 Processing embeddings...\n\n┌─────────────────────────────────┐\n│ ✅ Import Complete │\n├─────────────────────────────────┤\n│ Sessions processed: 1 │\n│ Total messages: 7 │\n│ Imported prompts: 3 │\n│ Imported responses: 3 │\n│ Skipped duplicates: 1 │\n│ Embeddings queued: 6 │\n└─────────────────────────────────┘\n\n⏱️ Completed in 1.7s\n"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"label": "import beta conflicting project session",
|
|
15
|
+
"exit": 0,
|
|
16
|
+
"cmd": "node /Users/namsangboy/workspace/claude-memory-layer/dist/cli/index.js import --session /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/beta-session.jsonl --project /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/beta-legacy-duckdb --verbose",
|
|
17
|
+
"output": "\n⏳ Initializing memory service...\n ✅ Ready (embedder: jinaai/jina-embeddings-v5-text-nano-text-matching)\n\n📥 Importing session: /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/beta-session.jsonl\n Target: /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/beta-legacy-duckdb\n\n\n 📄 [1/...] 1 msgs | +1 imported, ~0 skipped Imported 1 prompts, 1 responses from /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/beta-session.jsonl\n\n🧠 Processing embeddings...\n\n┌─────────────────────────────────┐\n│ ✅ Import Complete │\n├─────────────────────────────────┤\n│ Sessions processed: 1 │\n│ Total messages: 2 │\n│ Imported prompts: 1 │\n│ Imported responses: 1 │\n│ Skipped duplicates: 0 │\n│ Embeddings queued: 2 │\n└─────────────────────────────────┘\n\n⏱️ Completed in 1.4s\n"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"label": "alpha stats",
|
|
21
|
+
"exit": 0,
|
|
22
|
+
"cmd": "node /Users/namsangboy/workspace/claude-memory-layer/dist/cli/index.js stats --project /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/alpha-commerce-ai",
|
|
23
|
+
"output": "\n📊 Memory Statistics\n\nTotal Events: 6\nVector Count: 6\n\nMemory Levels:\n L0: █ 6\n"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"label": "Q1 lifecycle lightweight expand/source",
|
|
27
|
+
"exit": 0,
|
|
28
|
+
"cmd": "node /Users/namsangboy/workspace/claude-memory-layer/dist/cli/index.js search disclosure expand source initialize vector workers lightweight --project /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/alpha-commerce-ai --top-k 5 --min-score 0.1",
|
|
29
|
+
"output": "\n📚 Search Results\n\nConfidence: high\nTotal local memories found: 3\nShared memories found: 0\n\n---\n📌 agent_response (2026-05-05)\n Score: 1.000\n Session: alpha-se...\n Content: Decision recorded: For progressive retrieval disclosure, expand/source drill-down routes must stay lightweight. Do not call full MemoryService.initialize for disclosure expand/source because it can...\n\n---\n📌 agent_response (2026-05-05)\n Score: 0.829\n Session: alpha-se...\n Content: Dashboard provenance decision: shared disclosure results should be rendered as shared_troubleshooting provenance, showing sourceProjectHash, sourceEntryId, topics, rootCause, and solution. The UI m...\n\n---\n📌 user_prompt (2026-05-05)\n Score: 0.773\n Session: alpha-se...\n Content: When adding retrieval disclosure API routes, what lifecycle rule should we remember?\n\n"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"label": "Q2 FTS T.event_id fix",
|
|
33
|
+
"exit": 0,
|
|
34
|
+
"cmd": "node /Users/namsangboy/workspace/claude-memory-layer/dist/cli/index.js search T.event_id FTS rebuild internal table trigger event_id --project /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/alpha-commerce-ai --top-k 5 --min-score 0.1",
|
|
35
|
+
"output": "\n📚 Search Results\n\nConfidence: high\nTotal local memories found: 2\nShared memories found: 0\n\n---\n📌 agent_response (2026-05-05)\n Score: 0.978\n Session: alpha-se...\n Content: Bug fix recorded: SQLite FTS rebuild failure 'no such column: T.event_id' is fixed by making events_fts an internal FTS5 table with columns content and event_id UNINDEXED using porter unicode61 tok...\n\n---\n📌 user_prompt (2026-05-05)\n Score: 0.905\n Session: alpha-se...\n Content: How did we fix the SQLite FTS rebuild T.event_id failure?\n\n"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"label": "Q3 shared provenance dashboard",
|
|
39
|
+
"exit": 0,
|
|
40
|
+
"cmd": "node /Users/namsangboy/workspace/claude-memory-layer/dist/cli/index.js search shared_troubleshooting rootCause solution sourceProjectHash --project /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/alpha-commerce-ai --top-k 5 --min-score 0.1",
|
|
41
|
+
"output": "\n📚 Search Results\n\nConfidence: high\nTotal local memories found: 1\nShared memories found: 0\n\n---\n📌 agent_response (2026-05-05)\n Score: 1.000\n Session: alpha-se...\n Content: Dashboard provenance decision: shared disclosure results should be rendered as shared_troubleshooting provenance, showing sourceProjectHash, sourceEntryId, topics, rootCause, and solution. The UI m...\n\n"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"label": "Q4 noise command artifact should not retrieve",
|
|
45
|
+
"exit": 0,
|
|
46
|
+
"cmd": "node /Users/namsangboy/workspace/claude-memory-layer/dist/cli/index.js search local-command-stdout command-name opus --project /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/alpha-commerce-ai --top-k 5 --min-score 0.1",
|
|
47
|
+
"output": "\n📚 Search Results\n\nConfidence: none\nTotal local memories found: 0\nShared memories found: 0\n\n"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"label": "Q5 project scoping negative DuckDB from alpha",
|
|
51
|
+
"exit": 0,
|
|
52
|
+
"cmd": "node /Users/namsangboy/workspace/claude-memory-layer/dist/cli/index.js search DuckDB legacy storage migrate --project /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/alpha-commerce-ai --top-k 5 --min-score 0.1",
|
|
53
|
+
"output": "\n📚 Search Results\n\nConfidence: none\nTotal local memories found: 0\nShared memories found: 0\n\n"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"label": "Q6 beta project positive DuckDB",
|
|
57
|
+
"exit": 0,
|
|
58
|
+
"cmd": "node /Users/namsangboy/workspace/claude-memory-layer/dist/cli/index.js search DuckDB legacy storage migrate --project /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/beta-legacy-duckdb --top-k 5 --min-score 0.1",
|
|
59
|
+
"output": "\n📚 Search Results\n\nConfidence: high\nTotal local memories found: 2\nShared memories found: 0\n\n---\n📌 user_prompt (2026-05-05)\n Score: 1.000\n Session: beta-ses...\n Content: For the beta legacy storage project, should we migrate away from DuckDB?\n\n---\n📌 agent_response (2026-05-05)\n Score: 0.922\n Session: beta-ses...\n Content: Legacy beta project decision: this old unrelated project should keep DuckDB and should not migrate to SQLite. This memory intentionally conflicts with alpha-commerce-ai and is used to test strict p...\n\n"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"label": "Q7 disclosure FTS query",
|
|
63
|
+
"exit": 0,
|
|
64
|
+
"cmd": "node /Users/namsangboy/workspace/claude-memory-layer/dist/cli/index.js search T.event_id FTS rebuild internal table --project /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/alpha-commerce-ai --top-k 3 --min-score 0.1 --disclosure --strategy fast",
|
|
65
|
+
"output": "\n🔎 Progressive Search Results\n\nMeta: total=2 vector=no keyword=yes fallback=no\n\n1. [source] Agent response\n id: event:a5a01a44-67cb-4cef-b0e5-44c72925db9c\n score: 1.000\n reasons: keyword_match, recent_relevance, continuity_link\n source: event:a5a01a44-67cb-4cef-b0e5-44c72925db9c\n session: alpha-sessio...\n snippet: Bug fix recorded: SQLite FTS rebuild failure 'no such column: T.event_id' is fixed by making events_fts an internal FTS5 table with columns content and event_id UNINDEXED using porter unicode61 tokenization. Rebuild by dropping and recre...\n\n2. [source] User prompt\n id: event:eb14f3db-0aeb-424d-ae96-b2d6baefb731\n score: 0.905\n reasons: keyword_match, recent_relevance, continuity_link\n source: event:eb14f3db-0aeb-424d-ae96-b2d6baefb731\n session: alpha-sessio...\n snippet: How did we fix the SQLite FTS rebuild T.event_id failure?\n\n"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"label": "Q8 expand first disclosure result",
|
|
69
|
+
"exit": 0,
|
|
70
|
+
"cmd": "node /Users/namsangboy/workspace/claude-memory-layer/dist/cli/index.js expand event:a5a01a44-67cb-4cef-b0e5-44c72925db9c --project /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/alpha-commerce-ai --window-size 2",
|
|
71
|
+
"output": "\n🧩 Expanded Retrieval Result\n\nTarget\n- [source] Agent response\n id: event:a5a01a44-67cb-4cef-b0e5-44c72925db9c\n score: 1.000\n reasons: continuity_link\n source: event:a5a01a44-67cb-4cef-b0e5-44c72925db9c\n session: alpha-sessio...\n snippet: Bug fix recorded: SQLite FTS rebuild failure 'no such column: T.event_id' is fixed by making events_fts an internal FTS5 table with columns content and event_id UNINDEXED using porter unicode61 tokenization. Rebuild by dropping and recre...\n\n\nSurrounding\n1. [source] Agent response\n id: event:c0c2e795-eb98-4354-9ce0-cf453d967a87\n score: 1.000\n reasons: continuity_link\n source: event:c0c2e795-eb98-4354-9ce0-cf453d967a87\n session: alpha-sessio...\n snippet: Decision recorded: For progressive retrieval disclosure, expand/source drill-down routes must stay lightweight. Do not call full MemoryService.initialize for disclosure expand/source because it can start embedders, vector workers, and sh...\n\n2. [source] User prompt\n id: event:eb14f3db-0aeb-424d-ae96-b2d6baefb731\n score: 1.000\n reasons: continuity_link\n source: event:eb14f3db-0aeb-424d-ae96-b2d6baefb731\n session: alpha-sessio...\n snippet: How did we fix the SQLite FTS rebuild T.event_id failure?\n\n3. [source] User prompt\n id: event:34f59596-f65f-4520-9a88-6ba835b8018a\n score: 1.000\n reasons: continuity_link\n source: event:34f59596-f65f-4520-9a88-6ba835b8018a\n session: alpha-sessio...\n snippet: For dashboard shared retrieval provenance, what should the UI show?\n\n4. [source] Agent response\n id: event:9b376621-c598-42fc-826a-306b3603ba18\n score: 1.000\n reasons: continuity_link\n source: event:9b376621-c598-42fc-826a-306b3603ba18\n session: alpha-sessio...\n snippet: Dashboard provenance decision: shared disclosure results should be rendered as shared_troubleshooting provenance, showing sourceProjectHash, sourceEntryId, topics, rootCause, and solution. The UI must state that there are no local raw ev...\n\n\nSources\n- event:c0c2e795-eb98-4354-9ce0-cf453d967a87 (imported_history) events=c0c2e795-eb98-4354-9ce0-cf453d967a87\n- event:eb14f3db-0aeb-424d-ae96-b2d6baefb731 (imported_history) events=eb14f3db-0aeb-424d-ae96-b2d6baefb731\n- event:a5a01a44-67cb-4cef-b0e5-44c72925db9c (imported_history) events=a5a01a44-67cb-4cef-b0e5-44c72925db9c\n- event:34f59596-f65f-4520-9a88-6ba835b8018a (imported_history) events=34f59596-f65f-4520-9a88-6ba835b8018a\n- event:9b376621-c598-42fc-826a-306b3603ba18 (imported_history) events=9b376621-c598-42fc-826a-306b3603ba18\n\nExpanded Context\n[agent_response] Decision recorded: For progressive retrieval disclosure, expand/source drill-down routes must stay lightweight. Do not call full MemoryService.initialize for disclosure expand/source because it can start embedders, vector workers, and shared promotion machinery. Use narrow SQLiteEventStore getEvent/getSessionEvents or shared-store lookup ports instead. API tests should assert initialize is not called for GET expand/source routes, including 404 paths.\n\n[user_prompt] How did we fix the SQLite FTS rebuild T.event_id failure?\n\n[agent_response] Bug fix recorded: SQLite FTS rebuild failure 'no such column: T.event_id' is fixed by making events_fts an internal FTS5 table with columns content and event_id UNINDEXED using porter unicode61 tokenization. Rebuild by dropping and recreating events_fts and then recreate triggers that write rowid, content, and event_id. Also cover deleteSessionEvents followed by rebuildFtsIndex.\n\n[user_prompt] For dashboard shared retrieval provenance, what should the UI show?\n\n[agent_response] Dashboard provenance decision: shared disclosure results should be rendered as shared_troubleshooting provenance, showing sourceProjectHash, sourceEntryId, topics, rootCause, and solution. The UI must state that there are no local raw events for a shared source instead of pretending shared memories are local event IDs. Escape all metadata before innerHTML rendering.\n\n"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"label": "Q9 source first disclosure result",
|
|
75
|
+
"exit": 0,
|
|
76
|
+
"cmd": "node /Users/namsangboy/workspace/claude-memory-layer/dist/cli/index.js source event:a5a01a44-67cb-4cef-b0e5-44c72925db9c --project /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/alpha-commerce-ai",
|
|
77
|
+
"output": "\n📎 Retrieval Source\n\nsourceRef: event:a5a01a44-67cb-4cef-b0e5-44c72925db9c\nsourceType: imported_history\neventIds: a5a01a44-67cb-4cef-b0e5-44c72925db9c\n\nRaw Events\n- a5a01a44-67cb-4cef-b0e5-44c72925db9c 2026-05-05T01:38:20.318Z\n [agent_response] Bug fix recorded: SQLite FTS rebuild failure 'no such column: T.event_id' is fixed by making events_fts an internal FTS5 table with columns content and event_id UNINDEXED using porter unicode61 tokenization. Rebuild by dropping and recreating events_fts and then recreate triggers that write rowid, content, and event_id. Also cover deleteSessionEvents followed by rebuildFtsIndex.\n session: alpha-session\n canonicalKey: bug fix recorded sqlite fts rebuild failure no such column teventid is fixed by making eventsfts an internal fts5 table with columns content and eventid unindexed using porter unicode61 token_2e1a5fce\n\n"
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|