claude-memory-layer 1.0.30 → 1.0.32
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/README.md +12 -5
- package/dist/cli/index.js +4 -3
- package/dist/cli/index.js.map +2 -2
- package/dist/core/index.js +3 -2
- package/dist/core/index.js.map +2 -2
- package/dist/hooks/post-tool-use.js +3 -2
- package/dist/hooks/post-tool-use.js.map +2 -2
- package/dist/hooks/semantic-daemon.js +3 -2
- package/dist/hooks/semantic-daemon.js.map +2 -2
- package/dist/hooks/session-end.js +3 -2
- package/dist/hooks/session-end.js.map +2 -2
- package/dist/hooks/session-start.js +3 -2
- package/dist/hooks/session-start.js.map +2 -2
- package/dist/hooks/stop.js +3 -2
- package/dist/hooks/stop.js.map +2 -2
- package/dist/hooks/user-prompt-submit.js +3 -2
- package/dist/hooks/user-prompt-submit.js.map +2 -2
- package/dist/index.js +3 -2
- package/dist/index.js.map +2 -2
- package/dist/mcp/index.js +3 -2
- package/dist/mcp/index.js.map +2 -2
- package/dist/server/api/index.js +3 -2
- package/dist/server/api/index.js.map +2 -2
- package/dist/server/index.js +3 -2
- package/dist/server/index.js.map +2 -2
- package/dist/services/memory-service.js +3 -2
- package/dist/services/memory-service.js.map +2 -2
- package/package.json +10 -3
- package/scripts/postinstall-embedding-backend.cjs +18 -16
- package/AGENTS.md +0 -71
- package/CLAUDE.md +0 -30
- package/HANDOFF.md +0 -92
- package/Memo.txt +0 -558
- package/benchmarks/replay/anonymized-real-sessions.json +0 -48
- package/config/kpi-thresholds.json +0 -7
- package/context.md +0 -636
- package/docs/ARCHITECTURE_COMPARISON_AND_RECOMMENDATIONS.md +0 -627
- package/docs/HERMES_MEMORY_INGESTION_ANALYSIS.md +0 -440
- package/docs/MCP_MEMORY_SERVICE_COMPARATIVE_REVIEW.md +0 -271
- package/docs/MEMORY_USEFULNESS_AUDIT.md +0 -371
- package/docs/MEMORY_USEFULNESS_AUDIT_RAW.json +0 -80
- package/docs/MEMSEARCH_PROJECT_STRUCTURE_ANALYSIS.md +0 -333
- package/docs/MEMU_ADOPTION.md +0 -40
- package/docs/OPERATIONS.md +0 -18
- package/docs/PRODUCT_VALIDATION_MATRIX.md +0 -82
- package/docs/PROJECT_STRUCTURE_ANALYSIS.md +0 -421
- package/docs/REFACTORING_MILESTONES_AND_ISSUES.md +0 -501
- package/docs/REFACTORING_PLAN_THIN_CORE.md +0 -414
- package/docs/REFERENCE_PROJECT_ANALYSES.md +0 -25
- package/docs/SUPERLOCALMEMORY_PROJECT_STRUCTURE_ANALYSIS.md +0 -452
- package/docs/TARGET_ARCHITECTURE_AND_FOLDER_STRUCTURE.md +0 -446
- package/docs/architecture/comparison-index.md +0 -47
- package/docs/reports/codex-real-data-validation-20260505T040447Z.md +0 -46
- package/plan.md +0 -1642
- package/scripts/build.ts +0 -159
- package/scripts/bump-patch-version.sh +0 -18
- package/scripts/delete-unknown-projects.js +0 -154
- package/scripts/fix-sync-gap.js +0 -32
- package/scripts/generate-session-qrels.ts +0 -126
- package/scripts/heartbeat-memory-orchestrator.sh +0 -28
- package/scripts/replay-retrieval-benchmark.ts +0 -69
- package/scripts/report-sync-gap.js +0 -26
- package/scripts/review-queue-auto-resolve.js +0 -21
- package/scripts/sync-gap-auto-heal.sh +0 -17
- package/spec.md +0 -624
- package/specs/20260207-dashboard-upgrade/context.md +0 -38
- package/specs/20260207-dashboard-upgrade/spec.md +0 -96
- package/specs/citations-system/context.md +0 -243
- package/specs/citations-system/plan.md +0 -495
- package/specs/citations-system/spec.md +0 -371
- package/specs/endless-mode/context.md +0 -305
- package/specs/endless-mode/plan.md +0 -620
- package/specs/endless-mode/spec.md +0 -455
- package/specs/entity-edge-model/context.md +0 -401
- package/specs/entity-edge-model/plan.md +0 -459
- package/specs/entity-edge-model/spec.md +0 -391
- package/specs/evidence-aligner-v2/context.md +0 -401
- package/specs/evidence-aligner-v2/plan.md +0 -303
- package/specs/evidence-aligner-v2/spec.md +0 -312
- package/specs/mcp-desktop-integration/context.md +0 -278
- package/specs/mcp-desktop-integration/plan.md +0 -550
- package/specs/mcp-desktop-integration/spec.md +0 -494
- package/specs/memory-utilization-improvements/context.md +0 -145
- package/specs/memory-utilization-improvements/plan.md +0 -361
- package/specs/memory-utilization-improvements/spec.md +0 -361
- package/specs/post-tool-use-hook/context.md +0 -319
- package/specs/post-tool-use-hook/plan.md +0 -469
- package/specs/post-tool-use-hook/spec.md +0 -364
- package/specs/private-tags/context.md +0 -288
- package/specs/private-tags/plan.md +0 -412
- package/specs/private-tags/spec.md +0 -345
- package/specs/progressive-disclosure/context.md +0 -346
- package/specs/progressive-disclosure/plan.md +0 -663
- package/specs/progressive-disclosure/spec.md +0 -415
- package/specs/selective-tool-observation/context.md +0 -100
- package/specs/selective-tool-observation/plan.md +0 -158
- package/specs/selective-tool-observation/spec.md +0 -127
- package/specs/task-entity-system/context.md +0 -297
- package/specs/task-entity-system/plan.md +0 -301
- package/specs/task-entity-system/spec.md +0 -314
- package/specs/thin-core-refactor/context.md +0 -275
- package/specs/thin-core-refactor/plan.md +0 -536
- package/specs/thin-core-refactor/spec.md +0 -465
- package/specs/vector-outbox-v2/context.md +0 -470
- package/specs/vector-outbox-v2/plan.md +0 -562
- package/specs/vector-outbox-v2/spec.md +0 -466
- package/specs/web-viewer-ui/context.md +0 -384
- package/specs/web-viewer-ui/plan.md +0 -797
- package/specs/web-viewer-ui/spec.md +0 -516
- package/src/adapters/claude/capture/index.ts +0 -3
- package/src/adapters/claude/context/index.ts +0 -3
- package/src/adapters/claude/hooks/index.ts +0 -21
- package/src/adapters/claude/hooks/post-tool-use.ts +0 -239
- package/src/adapters/claude/hooks/prompt-injection-policy.ts +0 -104
- package/src/adapters/claude/hooks/semantic-daemon-client.ts +0 -209
- package/src/adapters/claude/hooks/semantic-daemon.ts +0 -283
- package/src/adapters/claude/hooks/session-end.ts +0 -59
- package/src/adapters/claude/hooks/session-start.ts +0 -73
- package/src/adapters/claude/hooks/stop.ts +0 -128
- package/src/adapters/claude/hooks/user-prompt-submit.ts +0 -361
- package/src/adapters/claude/index.ts +0 -4
- package/src/adapters/claude/transcript/index.ts +0 -4
- package/src/adapters/claude/transcript/transcript-reader.ts +0 -57
- package/src/adapters/claude/transcript/turn-reconstructor.ts +0 -65
- package/src/apps/cli/claude-settings-hooks.ts +0 -138
- package/src/apps/cli/codex-import-runner.ts +0 -125
- package/src/apps/cli/codex-validation-output.ts +0 -95
- package/src/apps/cli/hermes-import-runner.ts +0 -130
- package/src/apps/cli/hermes-validation-output.ts +0 -91
- package/src/apps/cli/index.ts +0 -1735
- package/src/apps/cli/mcp-install.ts +0 -106
- package/src/apps/cli/retrieval-disclosure-output.ts +0 -196
- package/src/apps/dashboard/assets/js/bootstrap.js +0 -244
- package/src/apps/dashboard/assets/js/chat.js +0 -373
- package/src/apps/dashboard/assets/js/disclosure.js +0 -232
- package/src/apps/dashboard/assets/js/modals.js +0 -298
- package/src/apps/dashboard/assets/js/overview.js +0 -655
- package/src/apps/dashboard/assets/js/state.js +0 -72
- package/src/apps/dashboard/assets/js/views.js +0 -468
- package/src/apps/dashboard/index.html +0 -543
- package/src/apps/dashboard/index.ts +0 -3
- package/src/apps/dashboard/style.css +0 -1750
- package/src/apps/index.ts +0 -5
- package/src/apps/server/api/chat.ts +0 -244
- package/src/apps/server/api/citations.ts +0 -105
- package/src/apps/server/api/events.ts +0 -137
- package/src/apps/server/api/health.ts +0 -53
- package/src/apps/server/api/index.ts +0 -26
- package/src/apps/server/api/projects.ts +0 -74
- package/src/apps/server/api/search.ts +0 -184
- package/src/apps/server/api/sessions.ts +0 -115
- package/src/apps/server/api/stats.ts +0 -723
- package/src/apps/server/api/turns.ts +0 -143
- package/src/apps/server/api/utils.ts +0 -65
- package/src/apps/server/index.ts +0 -111
- package/src/cli/index.ts +0 -3
- package/src/cli/retrieval-disclosure-output.ts +0 -2
- package/src/compat/index.ts +0 -5
- package/src/core/canonical-key.ts +0 -186
- package/src/core/citation-generator.ts +0 -63
- package/src/core/consolidated-store.ts +0 -356
- package/src/core/consolidation-worker.ts +0 -493
- package/src/core/context-formatter.ts +0 -276
- package/src/core/continuity-manager.ts +0 -341
- package/src/core/db-wrapper.ts +0 -64
- package/src/core/derive/fact-deriver.ts +0 -170
- package/src/core/derive/index.ts +0 -2
- package/src/core/derive/summary-deriver.ts +0 -76
- package/src/core/edge-repo.ts +0 -333
- package/src/core/embedder.ts +0 -4
- package/src/core/engine/embedding-maintenance-service.ts +0 -187
- package/src/core/engine/endless-memory-services.ts +0 -4
- package/src/core/engine/index.ts +0 -19
- package/src/core/engine/memory-engine-services.ts +0 -170
- package/src/core/engine/memory-ingest-service.ts +0 -317
- package/src/core/engine/memory-query-service.ts +0 -173
- package/src/core/engine/memory-runtime-service.ts +0 -162
- package/src/core/engine/memory-service-composition.ts +0 -231
- package/src/core/engine/retrieval-analytics-service.ts +0 -181
- package/src/core/engine/retrieval-disclosure-service.ts +0 -420
- package/src/core/engine/retrieval-orchestrator.ts +0 -377
- package/src/core/engine/retrieval-services.ts +0 -176
- package/src/core/engine/shared-memory-services.ts +0 -4
- package/src/core/entity-repo.ts +0 -349
- package/src/core/event-store.ts +0 -779
- package/src/core/evidence-aligner.ts +0 -635
- package/src/core/external-market-context.ts +0 -582
- package/src/core/graduation-worker.ts +0 -171
- package/src/core/graduation.ts +0 -377
- package/src/core/index.ts +0 -64
- package/src/core/ingest-interceptor.ts +0 -80
- package/src/core/markdown-mirror.ts +0 -70
- package/src/core/matcher.ts +0 -208
- package/src/core/md-mirror.ts +0 -92
- package/src/core/metadata-extractor.ts +0 -203
- package/src/core/model/memory-fact.ts +0 -30
- package/src/core/model/memory-rule.ts +0 -14
- package/src/core/model/memory-summary.ts +0 -21
- package/src/core/model/raw-event.ts +0 -28
- package/src/core/model/retrieval-result.ts +0 -35
- package/src/core/mongo-sync-config.ts +0 -165
- package/src/core/mongo-sync-worker.ts +0 -381
- package/src/core/privacy/filter.ts +0 -190
- package/src/core/privacy/index.ts +0 -20
- package/src/core/privacy/tag-parser.ts +0 -145
- package/src/core/product-validation-matrix.ts +0 -314
- package/src/core/progressive-retriever.ts +0 -414
- package/src/core/registry/project-path.ts +0 -54
- package/src/core/registry/session-registry.ts +0 -69
- package/src/core/replay-evaluator.ts +0 -625
- package/src/core/retrieval-benchmark.ts +0 -117
- package/src/core/retrieval-quality.ts +0 -109
- package/src/core/retriever.ts +0 -800
- package/src/core/session-qrels.ts +0 -360
- package/src/core/shared-event-store.ts +0 -114
- package/src/core/shared-promoter.ts +0 -249
- package/src/core/shared-store.ts +0 -289
- package/src/core/shared-vector-store.ts +0 -203
- package/src/core/sqlite-event-store.ts +0 -1846
- package/src/core/sqlite-wrapper.ts +0 -116
- package/src/core/sync-worker.ts +0 -228
- package/src/core/tag-taxonomy.ts +0 -51
- package/src/core/task/blocker-resolver.ts +0 -333
- package/src/core/task/index.ts +0 -9
- package/src/core/task/task-matcher.ts +0 -240
- package/src/core/task/task-projector.ts +0 -358
- package/src/core/task/task-resolver.ts +0 -421
- package/src/core/turn-state.ts +0 -207
- package/src/core/types.ts +0 -952
- package/src/core/vector-outbox.ts +0 -299
- package/src/core/vector-store.ts +0 -231
- package/src/core/vector-worker.ts +0 -521
- package/src/core/working-set-store.ts +0 -257
- package/src/extensions/endless-memory/endless-memory-services.ts +0 -350
- package/src/extensions/endless-memory/index.ts +0 -1
- package/src/extensions/index.ts +0 -5
- package/src/extensions/mcp/handlers.ts +0 -960
- package/src/extensions/mcp/index.ts +0 -48
- package/src/extensions/mcp/tools.ts +0 -252
- package/src/extensions/shared-memory/index.ts +0 -1
- package/src/extensions/shared-memory/shared-memory-services.ts +0 -211
- package/src/extensions/vector/embedder.ts +0 -233
- package/src/extensions/vector/index.ts +0 -1
- package/src/hooks/post-tool-use.ts +0 -9
- package/src/hooks/semantic-daemon-client.ts +0 -1
- package/src/hooks/semantic-daemon.ts +0 -11
- package/src/hooks/session-end.ts +0 -9
- package/src/hooks/session-start.ts +0 -9
- package/src/hooks/stop.ts +0 -9
- package/src/hooks/user-prompt-submit.ts +0 -9
- package/src/index.ts +0 -13
- package/src/mcp/handlers.ts +0 -2
- package/src/mcp/index.ts +0 -4
- package/src/mcp/tools.ts +0 -2
- package/src/server/api/chat.ts +0 -2
- package/src/server/api/citations.ts +0 -2
- package/src/server/api/events.ts +0 -2
- package/src/server/api/health.ts +0 -2
- package/src/server/api/index.ts +0 -2
- package/src/server/api/projects.ts +0 -2
- package/src/server/api/search.ts +0 -2
- package/src/server/api/sessions.ts +0 -2
- package/src/server/api/stats.ts +0 -2
- package/src/server/api/turns.ts +0 -2
- package/src/server/api/utils.ts +0 -2
- package/src/server/index.ts +0 -2
- package/src/services/bootstrap-organizer.ts +0 -463
- package/src/services/codex-session-history-importer.ts +0 -966
- package/src/services/hermes-session-history-importer.ts +0 -733
- package/src/services/memory-service-config.ts +0 -36
- package/src/services/memory-service-registry.ts +0 -150
- package/src/services/memory-service.ts +0 -688
- package/src/services/session-history-importer.ts +0 -629
- package/tests/README.md +0 -23
- package/tests/adapters/claude/claude-semantic-daemon-adapter.test.ts +0 -54
- package/tests/adapters/claude/claude-transcript-reconstructor.test.ts +0 -98
- package/tests/adapters/claude-hook-prompt-injection-policy.test.ts +0 -99
- package/tests/apps/app-layer-boundary.test.ts +0 -48
- package/tests/apps/claude-settings-hooks.test.ts +0 -107
- package/tests/apps/cli-disclosure-output.test.ts +0 -212
- package/tests/apps/codex-import-runner.test.ts +0 -99
- package/tests/apps/codex-validation-output.test.ts +0 -100
- package/tests/apps/hermes-import-runner.test.ts +0 -99
- package/tests/apps/mcp-install-command.test.ts +0 -59
- package/tests/apps/package-build-entrypoints.test.ts +0 -30
- package/tests/apps/postinstall-embedding-backend.test.ts +0 -175
- package/tests/apps/search-api-disclosure.test.ts +0 -162
- package/tests/apps/stats-api-lightweight.test.ts +0 -67
- package/tests/apps/ui-disclosure-output.test.ts +0 -140
- package/tests/core/bootstrap-organizer.test.ts +0 -111
- package/tests/core/canonical-key.test.ts +0 -101
- package/tests/core/codex-session-history-importer-validation.test.ts +0 -185
- package/tests/core/consolidation-worker.test.ts +0 -75
- package/tests/core/embedding-maintenance-service.test.ts +0 -282
- package/tests/core/evidence-aligner.test.ts +0 -152
- package/tests/core/external-market-context.test.ts +0 -209
- package/tests/core/fact-deriver.test.ts +0 -79
- package/tests/core/hermes-session-history-importer-validation.test.ts +0 -609
- package/tests/core/ingest-interceptor.test.ts +0 -38
- package/tests/core/markdown-mirror.test.ts +0 -85
- package/tests/core/matcher.test.ts +0 -112
- package/tests/core/md-mirror.test.ts +0 -50
- package/tests/core/memory-engine-services.test.ts +0 -240
- package/tests/core/memory-ingest-service.test.ts +0 -296
- package/tests/core/memory-query-service.test.ts +0 -129
- package/tests/core/memory-runtime-service.test.ts +0 -201
- package/tests/core/memory-service-composition.test.ts +0 -192
- package/tests/core/memory-service-config.test.ts +0 -41
- package/tests/core/memory-service-facade.test.ts +0 -30
- package/tests/core/memory-service-registry.test.ts +0 -206
- package/tests/core/product-validation-matrix.test.ts +0 -61
- package/tests/core/project-registry.test.ts +0 -78
- package/tests/core/replay-evaluator.test.ts +0 -181
- package/tests/core/retrieval-analytics-service.test.ts +0 -210
- package/tests/core/retrieval-benchmark.test.ts +0 -93
- package/tests/core/retrieval-disclosure-service.test.ts +0 -264
- package/tests/core/retrieval-orchestrator.test.ts +0 -403
- package/tests/core/retrieval-quality.test.ts +0 -31
- package/tests/core/retrieval-services.test.ts +0 -185
- package/tests/core/retriever-fallback-chain.test.ts +0 -223
- package/tests/core/retriever-strategy-scope.test.ts +0 -164
- package/tests/core/retriever.memu-adoption.test.ts +0 -122
- package/tests/core/session-history-importer-filter.test.ts +0 -78
- package/tests/core/session-qrels.test.ts +0 -250
- package/tests/core/sqlite-event-store-replication.test.ts +0 -127
- package/tests/core/summary-deriver.test.ts +0 -66
- package/tests/extensions/embedder-warning-suppression.test.ts +0 -83
- package/tests/extensions/endless-memory-extension-boundary.test.ts +0 -17
- package/tests/extensions/endless-memory-services.test.ts +0 -325
- package/tests/extensions/mcp-context-tools.test.ts +0 -905
- package/tests/extensions/mcp-extension-boundary.test.ts +0 -21
- package/tests/extensions/mcp-package-build.test.ts +0 -22
- package/tests/extensions/mcp-project-aware-tools.test.ts +0 -102
- package/tests/extensions/shared-memory-extension-boundary.test.ts +0 -24
- package/tests/extensions/shared-memory-services.test.ts +0 -309
- package/tests/extensions/vector-extension-boundary.test.ts +0 -21
- package/tsconfig.json +0 -24
- package/vitest.config.ts +0 -15
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
# mcp-memory-service 코드 리뷰 기반 개선 제안서
|
|
2
|
-
|
|
3
|
-
작성일: 2026-02-26
|
|
4
|
-
대상:
|
|
5
|
-
- 참고 레포: `~/workspace/mcp-memory-service` (commit `8d7e582`)
|
|
6
|
-
- 개선 대상: `~/workspace/claude-memory-layer`
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## 0) 결론 요약
|
|
11
|
-
|
|
12
|
-
`claude-memory-layer`는 이미 구조가 매우 좋고(프로젝트 해시 격리, scoped retrieval, outbox, endless mode, shared store 실험), **핵심 기능은 충분히 경쟁력 있음**.
|
|
13
|
-
|
|
14
|
-
다만 `mcp-memory-service`를 기준으로 봤을 때 실제 운영 관점에서 보강하면 체감이 큰 포인트는 아래 5가지:
|
|
15
|
-
|
|
16
|
-
1. **멀티-repo 스코프 강제 정책**(기본 격리 + 명시적 cross-repo)
|
|
17
|
-
2. **태그 taxonomy 표준화**(`proj:`, `agent:`, `topic:`, `q:` 등) + 자동 주입
|
|
18
|
-
3. **HTTP/SSE API 레이어**(운영/관측/통합성 증가)
|
|
19
|
-
4. **하이브리드 검색(BM25+Vector) 공식화** 및 점수 퓨전 표준화
|
|
20
|
-
5. **운영 안정성 레이어**(헬스체크, 백업/복구, 보존정책, 인증)
|
|
21
|
-
|
|
22
|
-
즉, 지금은 “강한 코어 엔진” 단계고, 다음 단계는 “**운영형 메모리 플랫폼**”으로 가는 게 맞음.
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## 1) 조사 방식
|
|
27
|
-
|
|
28
|
-
### 확인한 핵심 파일(참고 레포)
|
|
29
|
-
- `README.md`
|
|
30
|
-
- `docs/architecture.md`
|
|
31
|
-
- `docs/agents/README.md`
|
|
32
|
-
- `docs/mastery/configuration-guide.md`
|
|
33
|
-
- `src/mcp_memory_service/models/tag_taxonomy.py`
|
|
34
|
-
- `src/mcp_memory_service/web/api/memories.py`
|
|
35
|
-
- `src/mcp_memory_service/web/api/search.py`
|
|
36
|
-
|
|
37
|
-
### 확인한 핵심 파일(현재 레포)
|
|
38
|
-
- `README.md`
|
|
39
|
-
- `package.json`
|
|
40
|
-
- `src/services/memory-service.ts`
|
|
41
|
-
- `src/core/retriever.ts`
|
|
42
|
-
- `src/core/event-store.ts`
|
|
43
|
-
- `docs/OPERATIONS.md`
|
|
44
|
-
- `docs/MEMU_ADOPTION.md`
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
## 2) 현재 `claude-memory-layer` 강점 (유지해야 할 것)
|
|
49
|
-
|
|
50
|
-
1. **프로젝트 격리 설계가 이미 있음**
|
|
51
|
-
- `hashProjectPath()` + `~/.claude-code/memory/projects/{hash}`
|
|
52
|
-
- 세션 레지스트리로 session→project 매핑
|
|
53
|
-
|
|
54
|
-
2. **검색 전략 설계가 좋음**
|
|
55
|
-
- `fast/deep/auto`, fallback chain, scope filter, rerank, graph-hop
|
|
56
|
-
- 실전성 높은 토큰/정확도 트레이드오프
|
|
57
|
-
|
|
58
|
-
3. **쓰기 파이프라인 안정성 의식이 강함**
|
|
59
|
-
- SQLite primary, outbox, background worker
|
|
60
|
-
- hook 경량 모드(lightweightMode)
|
|
61
|
-
|
|
62
|
-
4. **고급 메모리 기능이 이미 구현/실험됨**
|
|
63
|
-
- graduation, endless mode, shared store, markdown mirror
|
|
64
|
-
|
|
65
|
-
=> 요약: 엔진 레벨은 이미 상당히 앞서 있음.
|
|
66
|
-
|
|
67
|
-
---
|
|
68
|
-
|
|
69
|
-
## 3) `mcp-memory-service` 대비 갭 분석
|
|
70
|
-
|
|
71
|
-
### A. 멀티-repo 운영 규칙의 “정책 강제력”
|
|
72
|
-
|
|
73
|
-
- 현 상태: 프로젝트 해시 분리는 있으나, 교차 검색/주입 정책이 코드/문서에서 강하게 표준화되어 있지는 않음
|
|
74
|
-
- 참고 레포 포인트:
|
|
75
|
-
- `agent:` 태그 자동 주입(`X-Agent-ID`)
|
|
76
|
-
- 태그 namespace 체계 명시(`proj:`, `topic:`, `q:` ...)
|
|
77
|
-
|
|
78
|
-
**리스크**
|
|
79
|
-
- 여러 repo를 운용할수록 검색 누수(다른 repo 기억 주입) 가능성 증가
|
|
80
|
-
|
|
81
|
-
**개선안**
|
|
82
|
-
- 기본 policy: `same-project-only`
|
|
83
|
-
- cross-project는 explicit flag + 이유(required reason) 필요
|
|
84
|
-
- retrieval 요청 시 project_id 부재면 hard-fail(옵션)
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
### B. 태그 체계 표준화 부족
|
|
89
|
-
|
|
90
|
-
- 현 상태: metadata/scope가 강하지만 태그 네임스페이스 규약은 상대적으로 약함
|
|
91
|
-
- 참고 레포 포인트:
|
|
92
|
-
- `TagTaxonomy`를 별도 모델로 정의하고 namespace 유효성 관리
|
|
93
|
-
|
|
94
|
-
**개선안**
|
|
95
|
-
- `src/core/tag-taxonomy.ts` 신설
|
|
96
|
-
- 표준 namespace:
|
|
97
|
-
- `proj:` repository identifier
|
|
98
|
-
- `agent:` 실행 주체
|
|
99
|
-
- `topic:` 주제
|
|
100
|
-
- `q:` 품질/신뢰 등급
|
|
101
|
-
- `t:` 시간/스프린트
|
|
102
|
-
- `sys:` 시스템 자동 태그
|
|
103
|
-
- ingest 시 최소 `proj:<hash>` 자동 부착
|
|
104
|
-
|
|
105
|
-
---
|
|
106
|
-
|
|
107
|
-
### C. HTTP/SSE 운용 계층 부재(또는 약함)
|
|
108
|
-
|
|
109
|
-
- 현 상태: CLI/hooks 중심 구조가 강점이지만, 외부 오케스트레이터/다중 클라이언트 연동은 제한적
|
|
110
|
-
- 참고 레포 포인트:
|
|
111
|
-
- REST API + SSE + dashboard 연동
|
|
112
|
-
|
|
113
|
-
**개선안**
|
|
114
|
-
- 최소 API부터 시작:
|
|
115
|
-
- `POST /api/memories`
|
|
116
|
-
- `POST /api/memories/search`
|
|
117
|
-
- `GET /api/memories?project=...`
|
|
118
|
-
- `GET /api/health`
|
|
119
|
-
- SSE 이벤트:
|
|
120
|
-
- memory_stored
|
|
121
|
-
- memory_deleted
|
|
122
|
-
- search_completed
|
|
123
|
-
|
|
124
|
-
---
|
|
125
|
-
|
|
126
|
-
### D. Hybrid search 점수 체계 공식화 필요
|
|
127
|
-
|
|
128
|
-
- 현 상태: fast/deep + rerank는 이미 훌륭함
|
|
129
|
-
- 부족한 점: “BM25 + Vector + Recency + Quality”를 운영상 조정 가능한 공식으로 고정 문서화한 수준은 약함
|
|
130
|
-
- 참고 레포 포인트:
|
|
131
|
-
- hybrid 검색을 제품 기능으로 명시
|
|
132
|
-
|
|
133
|
-
**개선안**
|
|
134
|
-
- `score = w_semantic*S + w_lexical*L + w_recency*R + w_quality*Q`
|
|
135
|
-
- env/config에서 가중치 조정 가능하게
|
|
136
|
-
- quality 점수 부재 시 graceful fallback
|
|
137
|
-
|
|
138
|
-
---
|
|
139
|
-
|
|
140
|
-
### E. 운영/보안 레이어
|
|
141
|
-
|
|
142
|
-
- 현 상태: runbook/ops 스크립트 존재(좋음)
|
|
143
|
-
- 참고 레포 포인트:
|
|
144
|
-
- 인증, 헬스/환경 점검, 상세 config 가이드
|
|
145
|
-
|
|
146
|
-
**개선안**
|
|
147
|
-
- 최소 추가:
|
|
148
|
-
- `MEMORY_API_KEY` 인증(HTTP 도입 시)
|
|
149
|
-
- `/api/health` + 저장소 상태 + outbox backlog 노출
|
|
150
|
-
- 백업/복구 명령 표준화
|
|
151
|
-
- 보존정책(TTL, 중요도 기반 정리) 명문화
|
|
152
|
-
|
|
153
|
-
---
|
|
154
|
-
|
|
155
|
-
## 4) 우선순위 로드맵 (실행 순서)
|
|
156
|
-
|
|
157
|
-
## P0 (당장 효과 큼, 1~3일)
|
|
158
|
-
1. 멀티-repo 스코프 기본 정책 강제
|
|
159
|
-
2. `proj:` 자동 태깅
|
|
160
|
-
3. 검색 기본값 same-project-only
|
|
161
|
-
4. 교차 검색은 명시적 옵션 필요
|
|
162
|
-
|
|
163
|
-
## P1 (1~2주)
|
|
164
|
-
1. tag taxonomy 모듈화
|
|
165
|
-
2. hybrid scoring 공식화 + 설정화
|
|
166
|
-
3. health endpoint/metrics 정리
|
|
167
|
-
|
|
168
|
-
## P2 (2~4주)
|
|
169
|
-
1. HTTP API + SSE 추가
|
|
170
|
-
2. 인증(OAuth까지는 아니어도 API key)
|
|
171
|
-
3. 팀/멀티클라이언트 운영 문서화
|
|
172
|
-
|
|
173
|
-
---
|
|
174
|
-
|
|
175
|
-
## 5) 구체 구현 제안 (코드 레벨)
|
|
176
|
-
|
|
177
|
-
### 5.1 Retrieval 옵션 확장
|
|
178
|
-
`src/core/retriever.ts`에 아래 정책 필드 추가 권장:
|
|
179
|
-
|
|
180
|
-
- `projectScopeMode: 'strict' | 'prefer' | 'global'`
|
|
181
|
-
- `allowedProjectHashes?: string[]`
|
|
182
|
-
- `crossProjectReason?: string`
|
|
183
|
-
|
|
184
|
-
`strict`일 때 현재 프로젝트 hash 불일치 결과는 필터링.
|
|
185
|
-
|
|
186
|
-
---
|
|
187
|
-
|
|
188
|
-
### 5.2 자동 태깅 훅
|
|
189
|
-
`MemoryService.storeUserPrompt/storeAgentResponse/storeToolObservation`에서 metadata 병합 시:
|
|
190
|
-
|
|
191
|
-
- `scope.project.hash`
|
|
192
|
-
- `scope.project.path`
|
|
193
|
-
- `tags` 개념을 도입하면 `proj:${projectHash}` 자동 주입
|
|
194
|
-
|
|
195
|
-
---
|
|
196
|
-
|
|
197
|
-
### 5.3 정책 파일 도입
|
|
198
|
-
`claude-memory-layer/policies/memory-scope-policy.json` 예:
|
|
199
|
-
|
|
200
|
-
```json
|
|
201
|
-
{
|
|
202
|
-
"defaultMode": "strict",
|
|
203
|
-
"allowCrossProject": false,
|
|
204
|
-
"requireReasonForCrossProject": true,
|
|
205
|
-
"alwaysIncludeTags": ["sys:auto", "proj:auto"]
|
|
206
|
-
}
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
---
|
|
210
|
-
|
|
211
|
-
### 5.4 운영 API 최소셋
|
|
212
|
-
향후 `src/server`에 라우트 추가:
|
|
213
|
-
|
|
214
|
-
- `GET /api/health`
|
|
215
|
-
- db 연결 상태
|
|
216
|
-
- vector worker backlog
|
|
217
|
-
- failed outbox 개수
|
|
218
|
-
- `POST /api/memories/search`
|
|
219
|
-
- projectHash 필수(운영 모드에서)
|
|
220
|
-
|
|
221
|
-
---
|
|
222
|
-
|
|
223
|
-
## 6) 여러 repository 관리 관점 평가
|
|
224
|
-
|
|
225
|
-
질문의 핵심(“여러 repo 관리 용이?”)에 대해:
|
|
226
|
-
|
|
227
|
-
- `claude-memory-layer` 현재 구조는 **잠재적으로 매우 유리**
|
|
228
|
-
- 프로젝트 해시 분리 구조가 이미 있기 때문
|
|
229
|
-
- 하지만 운영 안정성은 “격리 정책 강제 + 표준 태깅 + API 관측”이 있어야 완성
|
|
230
|
-
|
|
231
|
-
즉, **아키텍처 방향은 맞고, 운영 레이어 보강이 필요**.
|
|
232
|
-
|
|
233
|
-
---
|
|
234
|
-
|
|
235
|
-
## 7) 추천 최종 전략
|
|
236
|
-
|
|
237
|
-
`/Users/namsangboy/workspace/claude-memory-layer`를 계속 중심으로 가져가되:
|
|
238
|
-
|
|
239
|
-
1. P0/P1 개선 먼저 적용해서 “멀티-repo 안 섞이는 안정성” 확보
|
|
240
|
-
2. 그 다음 HTTP/SSE/API key 붙여서 외부 자동화/다중 클라이언트 지원
|
|
241
|
-
3. 마지막에 공유 지식(shared store) 룰을 엄격히(검증된 것만 승격)
|
|
242
|
-
|
|
243
|
-
이 순서가 리스크/효율 밸런스가 가장 좋음.
|
|
244
|
-
|
|
245
|
-
---
|
|
246
|
-
|
|
247
|
-
## 8) 보너스: 바로 체크할 TODO
|
|
248
|
-
|
|
249
|
-
- [x] `projectScopeMode` 옵션 추가
|
|
250
|
-
- [x] 기본 검색 strict project filter 적용
|
|
251
|
-
- [x] `proj:<hash>` 자동 태깅
|
|
252
|
-
- [x] tag taxonomy 모듈 생성
|
|
253
|
-
- [x] health API에 outbox failed/pending 수치 노출 (`GET /api/health`)
|
|
254
|
-
- [ ] 문서에 cross-project 허용 조건 명시
|
|
255
|
-
|
|
256
|
-
### P1 적용 메모 (이번 반영)
|
|
257
|
-
|
|
258
|
-
- 태그 taxonomy 파일 추가: `src/core/tag-taxonomy.ts`
|
|
259
|
-
- namespace 유효성 검증(`sys:, q:, proj:, topic:, t:, user:, agent:`)
|
|
260
|
-
- tags 정규화(`normalizeTags`)로 ingest 시 품질 보정
|
|
261
|
-
- rerank 가중치 설정화
|
|
262
|
-
- 환경변수 지원:
|
|
263
|
-
- `MEMORY_RERANK_WEIGHT_SEMANTIC`
|
|
264
|
-
- `MEMORY_RERANK_WEIGHT_LEXICAL`
|
|
265
|
-
- `MEMORY_RERANK_WEIGHT_RECENCY`
|
|
266
|
-
- 3개가 모두 유효하면 정규화해서 고정값 사용
|
|
267
|
-
- 없으면 기존 adaptive/기본 동작 fallback
|
|
268
|
-
|
|
269
|
-
---
|
|
270
|
-
|
|
271
|
-
원하면 다음 단계로 health endpoint/운영 지표(outbox backlog, failed 카운트)까지 이어서 붙일 수 있음.
|
|
@@ -1,371 +0,0 @@
|
|
|
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.
|