@lossless-claude/lcm 0.2.0

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.
Files changed (292) hide show
  1. package/.claude-plugin/commands/lcm-compact.md +31 -0
  2. package/.claude-plugin/commands/lcm-curate.md +31 -0
  3. package/.claude-plugin/commands/lcm-diagnose.md +29 -0
  4. package/.claude-plugin/commands/lcm-doctor.md +23 -0
  5. package/.claude-plugin/commands/lcm-dogfood.md +101 -0
  6. package/.claude-plugin/commands/lcm-import.md +48 -0
  7. package/.claude-plugin/commands/lcm-promote.md +29 -0
  8. package/.claude-plugin/commands/lcm-sensitive.md +55 -0
  9. package/.claude-plugin/commands/lcm-stats.md +19 -0
  10. package/.claude-plugin/commands/lcm-status.md +27 -0
  11. package/.claude-plugin/hooks/README.md +47 -0
  12. package/.claude-plugin/marketplace.json +20 -0
  13. package/.claude-plugin/mcp.mjs +12 -0
  14. package/.claude-plugin/plugin.json +46 -0
  15. package/.claude-plugin/skills/lcm-context/SKILL.md +107 -0
  16. package/.claude-plugin/skills/lcm-dogfood/SKILL.md +102 -0
  17. package/.claude-plugin/skills/lcm-dogfood/references/checks.md +239 -0
  18. package/.claude-plugin/skills/lcm-dogfood/references/known-issues.md +11 -0
  19. package/.claude-plugin/skills/lcm-dogfood/scripts/db-integrity.js +40 -0
  20. package/.claude-plugin/skills/lcm-dogfood/scripts/prompt-search-test.js +35 -0
  21. package/.claude-plugin/skills/lcm-e2e/SKILL.md +61 -0
  22. package/.claude-plugin/skills/lcm-e2e/checklist.md +367 -0
  23. package/.claude-plugin/skills/lossless-claude-upgrade/SKILL.md +47 -0
  24. package/LICENSE +21 -0
  25. package/README.md +231 -0
  26. package/dist/bin/lcm.d.ts +2 -0
  27. package/dist/bin/lcm.js +461 -0
  28. package/dist/bin/lcm.js.map +1 -0
  29. package/dist/installer/dry-run-deps.d.ts +23 -0
  30. package/dist/installer/dry-run-deps.js +66 -0
  31. package/dist/installer/dry-run-deps.js.map +1 -0
  32. package/dist/installer/install.d.ts +39 -0
  33. package/dist/installer/install.js +236 -0
  34. package/dist/installer/install.js.map +1 -0
  35. package/dist/installer/uninstall.d.ts +11 -0
  36. package/dist/installer/uninstall.js +80 -0
  37. package/dist/installer/uninstall.js.map +1 -0
  38. package/dist/src/batch-compact.d.ts +16 -0
  39. package/dist/src/batch-compact.js +121 -0
  40. package/dist/src/batch-compact.js.map +1 -0
  41. package/dist/src/compaction.d.ts +198 -0
  42. package/dist/src/compaction.js +964 -0
  43. package/dist/src/compaction.js.map +1 -0
  44. package/dist/src/connectors/constants.d.ts +5 -0
  45. package/dist/src/connectors/constants.js +6 -0
  46. package/dist/src/connectors/constants.js.map +1 -0
  47. package/dist/src/connectors/installer.d.ts +16 -0
  48. package/dist/src/connectors/installer.js +200 -0
  49. package/dist/src/connectors/installer.js.map +1 -0
  50. package/dist/src/connectors/registry.d.ts +4 -0
  51. package/dist/src/connectors/registry.js +264 -0
  52. package/dist/src/connectors/registry.js.map +1 -0
  53. package/dist/src/connectors/template-service.d.ts +5 -0
  54. package/dist/src/connectors/template-service.js +54 -0
  55. package/dist/src/connectors/template-service.js.map +1 -0
  56. package/dist/src/connectors/templates/base.md +1 -0
  57. package/dist/src/connectors/templates/mcp-base.md +1 -0
  58. package/dist/src/connectors/templates/sections/command-reference.md +15 -0
  59. package/dist/src/connectors/templates/sections/mcp-workflow.md +18 -0
  60. package/dist/src/connectors/templates/sections/workflow.md +29 -0
  61. package/dist/src/connectors/templates/skill/SKILL.md +74 -0
  62. package/dist/src/connectors/types.d.ts +19 -0
  63. package/dist/src/connectors/types.js +10 -0
  64. package/dist/src/connectors/types.js.map +1 -0
  65. package/dist/src/daemon/client.d.ts +9 -0
  66. package/dist/src/daemon/client.js +28 -0
  67. package/dist/src/daemon/client.js.map +1 -0
  68. package/dist/src/daemon/config.d.ts +48 -0
  69. package/dist/src/daemon/config.js +67 -0
  70. package/dist/src/daemon/config.js.map +1 -0
  71. package/dist/src/daemon/lifecycle.d.ts +19 -0
  72. package/dist/src/daemon/lifecycle.js +102 -0
  73. package/dist/src/daemon/lifecycle.js.map +1 -0
  74. package/dist/src/daemon/orientation.d.ts +1 -0
  75. package/dist/src/daemon/orientation.js +9 -0
  76. package/dist/src/daemon/orientation.js.map +1 -0
  77. package/dist/src/daemon/project-queue.d.ts +1 -0
  78. package/dist/src/daemon/project-queue.js +17 -0
  79. package/dist/src/daemon/project-queue.js.map +1 -0
  80. package/dist/src/daemon/project.d.ts +7 -0
  81. package/dist/src/daemon/project.js +25 -0
  82. package/dist/src/daemon/project.js.map +1 -0
  83. package/dist/src/daemon/proxy-manager.d.ts +21 -0
  84. package/dist/src/daemon/proxy-manager.js +205 -0
  85. package/dist/src/daemon/proxy-manager.js.map +1 -0
  86. package/dist/src/daemon/routes/compact.d.ts +13 -0
  87. package/dist/src/daemon/routes/compact.js +195 -0
  88. package/dist/src/daemon/routes/compact.js.map +1 -0
  89. package/dist/src/daemon/routes/describe.d.ts +3 -0
  90. package/dist/src/daemon/routes/describe.js +39 -0
  91. package/dist/src/daemon/routes/describe.js.map +1 -0
  92. package/dist/src/daemon/routes/expand.d.ts +3 -0
  93. package/dist/src/daemon/routes/expand.js +41 -0
  94. package/dist/src/daemon/routes/expand.js.map +1 -0
  95. package/dist/src/daemon/routes/grep.d.ts +3 -0
  96. package/dist/src/daemon/routes/grep.js +43 -0
  97. package/dist/src/daemon/routes/grep.js.map +1 -0
  98. package/dist/src/daemon/routes/ingest.d.ts +3 -0
  99. package/dist/src/daemon/routes/ingest.js +101 -0
  100. package/dist/src/daemon/routes/ingest.js.map +1 -0
  101. package/dist/src/daemon/routes/promote.d.ts +4 -0
  102. package/dist/src/daemon/routes/promote.js +104 -0
  103. package/dist/src/daemon/routes/promote.js.map +1 -0
  104. package/dist/src/daemon/routes/prompt-search.d.ts +3 -0
  105. package/dist/src/daemon/routes/prompt-search.js +65 -0
  106. package/dist/src/daemon/routes/prompt-search.js.map +1 -0
  107. package/dist/src/daemon/routes/recent.d.ts +3 -0
  108. package/dist/src/daemon/routes/recent.js +37 -0
  109. package/dist/src/daemon/routes/recent.js.map +1 -0
  110. package/dist/src/daemon/routes/restore.d.ts +3 -0
  111. package/dist/src/daemon/routes/restore.js +120 -0
  112. package/dist/src/daemon/routes/restore.js.map +1 -0
  113. package/dist/src/daemon/routes/search.d.ts +2 -0
  114. package/dist/src/daemon/routes/search.js +66 -0
  115. package/dist/src/daemon/routes/search.js.map +1 -0
  116. package/dist/src/daemon/routes/status.d.ts +3 -0
  117. package/dist/src/daemon/routes/status.js +80 -0
  118. package/dist/src/daemon/routes/status.js.map +1 -0
  119. package/dist/src/daemon/routes/store.d.ts +2 -0
  120. package/dist/src/daemon/routes/store.js +46 -0
  121. package/dist/src/daemon/routes/store.js.map +1 -0
  122. package/dist/src/daemon/server.d.ts +19 -0
  123. package/dist/src/daemon/server.js +183 -0
  124. package/dist/src/daemon/server.js.map +1 -0
  125. package/dist/src/daemon/summarizer.d.ts +11 -0
  126. package/dist/src/daemon/summarizer.js +51 -0
  127. package/dist/src/daemon/summarizer.js.map +1 -0
  128. package/dist/src/db/config.d.ts +31 -0
  129. package/dist/src/db/config.js +83 -0
  130. package/dist/src/db/config.js.map +1 -0
  131. package/dist/src/db/connection.d.ts +3 -0
  132. package/dist/src/db/connection.js +62 -0
  133. package/dist/src/db/connection.js.map +1 -0
  134. package/dist/src/db/features.d.ts +11 -0
  135. package/dist/src/db/features.js +36 -0
  136. package/dist/src/db/features.js.map +1 -0
  137. package/dist/src/db/migration.d.ts +4 -0
  138. package/dist/src/db/migration.js +499 -0
  139. package/dist/src/db/migration.js.map +1 -0
  140. package/dist/src/db/promoted.d.ts +47 -0
  141. package/dist/src/db/promoted.js +96 -0
  142. package/dist/src/db/promoted.js.map +1 -0
  143. package/dist/src/db/redaction-stats.d.ts +6 -0
  144. package/dist/src/db/redaction-stats.js +16 -0
  145. package/dist/src/db/redaction-stats.js.map +1 -0
  146. package/dist/src/diagnose.d.ts +39 -0
  147. package/dist/src/diagnose.js +432 -0
  148. package/dist/src/diagnose.js.map +1 -0
  149. package/dist/src/doctor/doctor.d.ts +4 -0
  150. package/dist/src/doctor/doctor.js +378 -0
  151. package/dist/src/doctor/doctor.js.map +1 -0
  152. package/dist/src/doctor/types.d.ts +24 -0
  153. package/dist/src/doctor/types.js +2 -0
  154. package/dist/src/doctor/types.js.map +1 -0
  155. package/dist/src/expansion.d.ts +100 -0
  156. package/dist/src/expansion.js +268 -0
  157. package/dist/src/expansion.js.map +1 -0
  158. package/dist/src/hooks/auto-heal.d.ts +12 -0
  159. package/dist/src/hooks/auto-heal.js +49 -0
  160. package/dist/src/hooks/auto-heal.js.map +1 -0
  161. package/dist/src/hooks/compact.d.ts +5 -0
  162. package/dist/src/hooks/compact.js +22 -0
  163. package/dist/src/hooks/compact.js.map +1 -0
  164. package/dist/src/hooks/dispatch.d.ts +7 -0
  165. package/dist/src/hooks/dispatch.js +36 -0
  166. package/dist/src/hooks/dispatch.js.map +1 -0
  167. package/dist/src/hooks/probe-precompact.d.ts +2 -0
  168. package/dist/src/hooks/probe-precompact.js +17 -0
  169. package/dist/src/hooks/probe-precompact.js.map +1 -0
  170. package/dist/src/hooks/probe-sessionstart.d.ts +2 -0
  171. package/dist/src/hooks/probe-sessionstart.js +18 -0
  172. package/dist/src/hooks/probe-sessionstart.js.map +1 -0
  173. package/dist/src/hooks/restore.d.ts +5 -0
  174. package/dist/src/hooks/restore.js +19 -0
  175. package/dist/src/hooks/restore.js.map +1 -0
  176. package/dist/src/hooks/session-end.d.ts +16 -0
  177. package/dist/src/hooks/session-end.js +73 -0
  178. package/dist/src/hooks/session-end.js.map +1 -0
  179. package/dist/src/hooks/user-prompt.d.ts +5 -0
  180. package/dist/src/hooks/user-prompt.js +31 -0
  181. package/dist/src/hooks/user-prompt.js.map +1 -0
  182. package/dist/src/import.d.ts +24 -0
  183. package/dist/src/import.js +119 -0
  184. package/dist/src/import.js.map +1 -0
  185. package/dist/src/large-files.d.ts +28 -0
  186. package/dist/src/large-files.js +413 -0
  187. package/dist/src/large-files.js.map +1 -0
  188. package/dist/src/llm/anthropic.d.ts +9 -0
  189. package/dist/src/llm/anthropic.js +54 -0
  190. package/dist/src/llm/anthropic.js.map +1 -0
  191. package/dist/src/llm/claude-process.d.ts +2 -0
  192. package/dist/src/llm/claude-process.js +55 -0
  193. package/dist/src/llm/claude-process.js.map +1 -0
  194. package/dist/src/llm/codex-process.d.ts +15 -0
  195. package/dist/src/llm/codex-process.js +142 -0
  196. package/dist/src/llm/codex-process.js.map +1 -0
  197. package/dist/src/llm/mock-summarizer.d.ts +9 -0
  198. package/dist/src/llm/mock-summarizer.js +17 -0
  199. package/dist/src/llm/mock-summarizer.js.map +1 -0
  200. package/dist/src/llm/openai.d.ts +10 -0
  201. package/dist/src/llm/openai.js +52 -0
  202. package/dist/src/llm/openai.js.map +1 -0
  203. package/dist/src/llm/types.d.ts +6 -0
  204. package/dist/src/llm/types.js +2 -0
  205. package/dist/src/llm/types.js.map +1 -0
  206. package/dist/src/mcp/server.d.ts +9 -0
  207. package/dist/src/mcp/server.js +128 -0
  208. package/dist/src/mcp/server.js.map +1 -0
  209. package/dist/src/mcp/tools/lcm-describe.d.ts +14 -0
  210. package/dist/src/mcp/tools/lcm-describe.js +12 -0
  211. package/dist/src/mcp/tools/lcm-describe.js.map +1 -0
  212. package/dist/src/mcp/tools/lcm-doctor.d.ts +8 -0
  213. package/dist/src/mcp/tools/lcm-doctor.js +9 -0
  214. package/dist/src/mcp/tools/lcm-doctor.js.map +1 -0
  215. package/dist/src/mcp/tools/lcm-expand.d.ts +18 -0
  216. package/dist/src/mcp/tools/lcm-expand.js +13 -0
  217. package/dist/src/mcp/tools/lcm-expand.js.map +1 -0
  218. package/dist/src/mcp/tools/lcm-grep.d.ts +27 -0
  219. package/dist/src/mcp/tools/lcm-grep.js +15 -0
  220. package/dist/src/mcp/tools/lcm-grep.js.map +1 -0
  221. package/dist/src/mcp/tools/lcm-search.d.ts +33 -0
  222. package/dist/src/mcp/tools/lcm-search.js +15 -0
  223. package/dist/src/mcp/tools/lcm-search.js.map +1 -0
  224. package/dist/src/mcp/tools/lcm-stats.d.ts +14 -0
  225. package/dist/src/mcp/tools/lcm-stats.js +11 -0
  226. package/dist/src/mcp/tools/lcm-stats.js.map +1 -0
  227. package/dist/src/mcp/tools/lcm-store.d.ts +26 -0
  228. package/dist/src/mcp/tools/lcm-store.js +22 -0
  229. package/dist/src/mcp/tools/lcm-store.js.map +1 -0
  230. package/dist/src/memory/index.d.ts +22 -0
  231. package/dist/src/memory/index.js +21 -0
  232. package/dist/src/memory/index.js.map +1 -0
  233. package/dist/src/promotion/dedup.d.ts +19 -0
  234. package/dist/src/promotion/dedup.js +42 -0
  235. package/dist/src/promotion/dedup.js.map +1 -0
  236. package/dist/src/promotion/detector.d.ts +15 -0
  237. package/dist/src/promotion/detector.js +31 -0
  238. package/dist/src/promotion/detector.js.map +1 -0
  239. package/dist/src/prompts/condensed-d1.yaml +38 -0
  240. package/dist/src/prompts/condensed-d2.yaml +32 -0
  241. package/dist/src/prompts/condensed-d3plus.yaml +32 -0
  242. package/dist/src/prompts/leaf-aggressive.yaml +34 -0
  243. package/dist/src/prompts/leaf-normal.yaml +34 -0
  244. package/dist/src/prompts/loader.d.ts +9 -0
  245. package/dist/src/prompts/loader.js +37 -0
  246. package/dist/src/prompts/loader.js.map +1 -0
  247. package/dist/src/prompts/promoted-merge.yaml +18 -0
  248. package/dist/src/prompts/system.yaml +5 -0
  249. package/dist/src/retrieval.d.ts +122 -0
  250. package/dist/src/retrieval.js +214 -0
  251. package/dist/src/retrieval.js.map +1 -0
  252. package/dist/src/scrub.d.ts +46 -0
  253. package/dist/src/scrub.js +184 -0
  254. package/dist/src/scrub.js.map +1 -0
  255. package/dist/src/sensitive.d.ts +4 -0
  256. package/dist/src/sensitive.js +258 -0
  257. package/dist/src/sensitive.js.map +1 -0
  258. package/dist/src/stats.d.ts +34 -0
  259. package/dist/src/stats.js +260 -0
  260. package/dist/src/stats.js.map +1 -0
  261. package/dist/src/store/conversation-store.d.ts +115 -0
  262. package/dist/src/store/conversation-store.js +447 -0
  263. package/dist/src/store/conversation-store.js.map +1 -0
  264. package/dist/src/store/fts5-sanitize.d.ts +23 -0
  265. package/dist/src/store/fts5-sanitize.js +30 -0
  266. package/dist/src/store/fts5-sanitize.js.map +1 -0
  267. package/dist/src/store/full-text-fallback.d.ts +16 -0
  268. package/dist/src/store/full-text-fallback.js +60 -0
  269. package/dist/src/store/full-text-fallback.js.map +1 -0
  270. package/dist/src/store/index.d.ts +4 -0
  271. package/dist/src/store/index.js +3 -0
  272. package/dist/src/store/index.js.map +1 -0
  273. package/dist/src/store/summary-store.d.ts +118 -0
  274. package/dist/src/store/summary-store.js +570 -0
  275. package/dist/src/store/summary-store.js.map +1 -0
  276. package/dist/src/summarize.d.ts +59 -0
  277. package/dist/src/summarize.js +619 -0
  278. package/dist/src/summarize.js.map +1 -0
  279. package/dist/src/transcript.d.ts +7 -0
  280. package/dist/src/transcript.js +51 -0
  281. package/dist/src/transcript.js.map +1 -0
  282. package/dist/src/types.d.ts +116 -0
  283. package/dist/src/types.js +8 -0
  284. package/dist/src/types.js.map +1 -0
  285. package/docs/agent-tools.md +187 -0
  286. package/docs/architecture.md +224 -0
  287. package/docs/configuration.md +168 -0
  288. package/docs/fts5.md +161 -0
  289. package/docs/hook-protocol.md +41 -0
  290. package/docs/privacy.md +101 -0
  291. package/mcp.mjs +17 -0
  292. package/package.json +79 -0
@@ -0,0 +1,102 @@
1
+ ---
2
+ name: lcm-dogfood
3
+ description: "This skill should be used when the user asks to \"run lcm dogfood\", \"self-test lcm\", \"validate lcm build\", \"test lcm hooks\", \"check lcm mcp tools\", or mentions lcm QA, regression testing, or pre-release validation. Runs a comprehensive 39-check self-test across all CLI commands, hooks, MCP tools, and resilience."
4
+ user_invocable: true
5
+ argument: "[phase]"
6
+ ---
7
+
8
+ # lcm Dogfood — Live Self-Test Suite
9
+
10
+ Comprehensive self-test for the lcm system in a live Claude Code session. Covers all 9 CLI commands, 4 hooks, 8 MCP tools, and resilience scenarios across 39 checks in 10 phases.
11
+
12
+ **Arguments:** `all` (default), `health`, `import`, `compact`, `promote`, `sensitive`, `pipeline`, `hooks`, `mcp`, `resilience`, `debug`
13
+
14
+ ## Procedure
15
+
16
+ Execute each phase in order (or just the requested phase). For each check:
17
+
18
+ 1. Run the command or verify the condition
19
+ 2. Record: ✅ PASS, ❌ FAIL, or ⚠️ SKIP (with reason)
20
+ 3. On FAIL: capture error, check daemon logs (`~/.lossless-claude/daemon.log`), continue
21
+ 4. Produce the **Scorecard** at the end
22
+ 5. Write failures to `.xgh/reviews/dogfood-YYYY-MM-DD.md`
23
+
24
+ **Routing:** Use `ctx_execute` (context-mode sandbox) for commands producing large output. Use Bash for short-output commands. Use MCP tools directly for Phase 8.
25
+
26
+ Consult `references/checks.md` for detailed pass/fail criteria for each check.
27
+
28
+ ## Phase Overview
29
+
30
+ | # | Phase | Checks | What it tests |
31
+ |---|-------|--------|---------------|
32
+ | 1 | Health | 3 | Daemon status, doctor, version |
33
+ | 2 | Import | 3 | Transcript ingestion + idempotency |
34
+ | 3 | Compact | 3 | Summarization + idempotency |
35
+ | 4 | Promote | 2 | Insight extraction + stats consistency |
36
+ | 5 | Sensitive | 5 | Pattern list/test/add/remove cycle |
37
+ | 6 | Pipeline | 2 | Full curate + diagnose |
38
+ | 7 | Hooks | 6 | Wiring verification + live tests |
39
+ | 8 | MCP | 8 | All 7 MCP tools + store-retrieve roundtrip |
40
+ | 9 | Resilience | 3 | Kill/restart/graceful degradation |
41
+ | 10 | Debug | 4 | Logs, PWD, DB existence, integrity |
42
+
43
+ ## Key Commands
44
+
45
+ All CLI checks use `node dist/bin/lcm.js <subcommand>`. If `lcm` is on PATH, use that instead.
46
+
47
+ ### Hook Verification
48
+
49
+ Hooks are registered in `.claude-plugin/plugin.json`, NOT `~/.claude/settings.json`. Verify all 4:
50
+ - `SessionStart` → `lcm restore`
51
+ - `UserPromptSubmit` → `lcm user-prompt`
52
+ - `PreCompact` → `lcm compact`
53
+ - `SessionEnd` → `lcm session-end`
54
+
55
+ For live hook testing, pipe JSON to stdin:
56
+ ```bash
57
+ echo '{}' | node dist/bin/lcm.js restore
58
+ ```
59
+
60
+ The UserPromptSubmit hook requires `prompt` and `cwd` fields:
61
+ ```bash
62
+ node -e 'console.log(JSON.stringify({prompt:"test query",cwd:process.cwd()}))' | node dist/bin/lcm.js user-prompt
63
+ ```
64
+
65
+ ### MCP Tool Testing
66
+
67
+ Call lcm MCP tools directly from the session. All 8 tools to test:
68
+ `lcm_doctor`, `lcm_stats`, `lcm_search`, `lcm_grep`, `lcm_store`, `lcm_expand`, `lcm_describe` + store-retrieve roundtrip.
69
+
70
+ ## Scorecard Template
71
+
72
+ ```
73
+ | Phase | Checks | ✅ Pass | ❌ Fail | ⚠️ Skip/Known |
74
+ |-------------|--------|---------|---------|---------------|
75
+ | Health | 3 | | | |
76
+ | Import | 3 | | | |
77
+ | Compact | 3 | | | |
78
+ | Promote | 2 | | | |
79
+ | Sensitive | 5 | | | |
80
+ | Pipeline | 2 | | | |
81
+ | Hooks | 6 | | | |
82
+ | MCP | 8 | | | |
83
+ | Resilience | 3 | | | |
84
+ | Debug | 4 | | | |
85
+ | **TOTAL** | **39** | | | |
86
+ ```
87
+
88
+ For ❌ FAIL items, include: error message, daemon log excerpt, suggested fix.
89
+ For ⚠️ KNOWN items, reference the bug number from `references/known-issues.md`.
90
+
91
+ ## Bundled Resources
92
+
93
+ ### Scripts
94
+
95
+ Utility scripts for checks that require custom logic:
96
+ - **`scripts/prompt-search-test.js`** — Test the daemon `/prompt-search` endpoint directly. Usage: `node scripts/prompt-search-test.js "query" [cwd]`
97
+ - **`scripts/db-integrity.js`** — Check PRAGMA integrity_check on all project databases. Usage: `node scripts/db-integrity.js`
98
+
99
+ ### Reference Files
100
+
101
+ - **`references/checks.md`** — All 39 checks with detailed pass/fail criteria, organized by phase
102
+ - **`references/known-issues.md`** — Known bugs with root causes, affected checks, and fix status
@@ -0,0 +1,239 @@
1
+ # lcm Dogfood — Detailed Check Reference
2
+
3
+ All 39 checks organized by phase. Each check includes the command to run and pass/fail criteria.
4
+
5
+ ## Phase 1: Health — 3 checks
6
+
7
+ ### 1.1 Daemon status
8
+ ```bash
9
+ node dist/bin/lcm.js status
10
+ ```
11
+ Pass if: daemon shows "up", project registered for current cwd, port 3737.
12
+
13
+ ### 1.2 Doctor
14
+ ```bash
15
+ node dist/bin/lcm.js doctor
16
+ ```
17
+ Pass if: all checks pass (8 passed, 0 failed). Record any warnings.
18
+
19
+ ### 1.3 Version
20
+ ```bash
21
+ node dist/bin/lcm.js --version
22
+ ```
23
+ Pass if: prints version string matching package.json.
24
+
25
+ ## Phase 2: Import — 3 checks
26
+
27
+ ### 2.1 Import session transcripts
28
+ ```bash
29
+ node dist/bin/lcm.js import --all --verbose
30
+ ```
31
+ Pass if: message count > 0, no errors. Use `ctx_execute` — output can be large.
32
+
33
+ ### 2.2 Status after import
34
+ ```bash
35
+ node dist/bin/lcm.js status
36
+ ```
37
+ Pass if: messages > 0, last ingest timestamp updated.
38
+
39
+ ### 2.3 Idempotent re-import
40
+ Run import again immediately.
41
+ Pass if: message count unchanged or only current-session messages added (small delta).
42
+
43
+ ## Phase 3: Compact — 3 checks
44
+
45
+ ### 3.1 Compact messages
46
+ ```bash
47
+ node dist/bin/lcm.js compact --all --verbose
48
+ ```
49
+ Pass if: summaries created, compression ratio reported. Note: calls LLM summarizer, may take minutes. Use 5-minute timeout.
50
+
51
+ ### 3.2 Status after compact
52
+ ```bash
53
+ node dist/bin/lcm.js status
54
+ ```
55
+ Pass if: summaries > 0.
56
+
57
+ ### 3.3 Idempotent re-compact
58
+ Run compact again immediately.
59
+ Pass if: no new summaries created.
60
+
61
+ ## Phase 4: Promote — 2 checks
62
+
63
+ ### 4.1 Promote insights
64
+ ```bash
65
+ node dist/bin/lcm.js promote --all --verbose
66
+ ```
67
+ Pass if: promoted count increments OR "no promotable content" (valid if summaries too short).
68
+
69
+ ### 4.2 Stats
70
+ ```bash
71
+ node dist/bin/lcm.js stats --verbose
72
+ ```
73
+ Pass if: shows messages, summaries, promoted counts, compression ratios. Numbers consistent with previous checks.
74
+
75
+ ## Phase 5: Sensitive Patterns — 5 checks
76
+
77
+ ### 5.1 List patterns
78
+ ```bash
79
+ node dist/bin/lcm.js sensitive list
80
+ ```
81
+ Pass if: shows 7 built-in patterns.
82
+
83
+ ### 5.2 Test scrubbing
84
+ ```bash
85
+ node dist/bin/lcm.js sensitive test "my api key is sk-1234567890abcdefghij and password=hunter2"
86
+ ```
87
+ Pass if: both API key and password are `[REDACTED]`.
88
+
89
+ ### 5.3 Add custom pattern
90
+ ```bash
91
+ node dist/bin/lcm.js sensitive add "DOGFOOD_SECRET_\w+"
92
+ ```
93
+ Pass if: pattern added.
94
+
95
+ ### 5.4 Test custom pattern
96
+ ```bash
97
+ node dist/bin/lcm.js sensitive test "the value is DOGFOOD_SECRET_abc123"
98
+ ```
99
+ Pass if: `DOGFOOD_SECRET_abc123` is `[REDACTED]`.
100
+
101
+ ### 5.5 Remove custom pattern
102
+ ```bash
103
+ node dist/bin/lcm.js sensitive remove "DOGFOOD_SECRET_\w+"
104
+ ```
105
+ Pass if: pattern removed. Run `sensitive list` to confirm.
106
+
107
+ ## Phase 6: Full Pipeline — 2 checks
108
+
109
+ ### 6.1 Curate (import + compact + promote)
110
+ ```bash
111
+ node dist/bin/lcm.js import --all && node dist/bin/lcm.js compact --all && node dist/bin/lcm.js promote --all
112
+ ```
113
+ Pass if: all three stages complete without error.
114
+
115
+ ### 6.2 Diagnose
116
+ ```bash
117
+ node dist/bin/lcm.js diagnose --verbose
118
+ ```
119
+ Pass if: no hook failures or ingestion gaps detected.
120
+
121
+ ## Phase 7: Hook Verification — 6 checks
122
+
123
+ Hooks are registered in `.claude-plugin/plugin.json`, NOT `~/.claude/settings.json`.
124
+
125
+ ### 7.1 Hook wiring in plugin.json
126
+ Read `.claude-plugin/plugin.json` and verify all 4 hooks:
127
+ - `SessionStart` → `lcm restore`
128
+ - `UserPromptSubmit` → `lcm user-prompt`
129
+ - `PreCompact` → `lcm compact`
130
+ - `SessionEnd` → `lcm session-end`
131
+
132
+ Pass if: all 4 present with correct commands.
133
+
134
+ ### 7.2 SessionStart live test
135
+ ```bash
136
+ echo '{}' | node dist/bin/lcm.js restore
137
+ ```
138
+ Pass if: returns `<memory-orientation>` block.
139
+
140
+ ### 7.3 UserPromptSubmit live test
141
+ ```bash
142
+ node -e 'console.log(JSON.stringify({prompt:"what changes were made to the summarizer",cwd:process.cwd()}))' | node dist/bin/lcm.js user-prompt
143
+ ```
144
+ Pass if: returns `<memory-context>` block with hints.
145
+ **Known issue (Bug 1):** Currently only searches promoted store. If empty, record as ⚠️ KNOWN.
146
+
147
+ ### 7.4 UserPromptSubmit daemon endpoint
148
+ ```bash
149
+ node .claude-plugin/skills/lcm-dogfood/scripts/prompt-search-test.js "summarizer"
150
+ ```
151
+ Pass if: returns hints (may be empty — see Bug 1).
152
+
153
+ ### 7.5 Hook timeout
154
+ ```bash
155
+ time node -e 'console.log(JSON.stringify({prompt:"test",cwd:process.cwd()}))' | node dist/bin/lcm.js user-prompt
156
+ ```
157
+ Pass if: completes in < 5 seconds.
158
+
159
+ ### 7.6 SessionEnd wiring (read-only)
160
+ Cannot trigger without ending session. Verify wiring in plugin.json (covered by 7.1).
161
+
162
+ ## Phase 8: MCP Tools — 8 checks
163
+
164
+ Call lcm MCP tools directly from the session.
165
+
166
+ ### 8.1 lcm_doctor via MCP
167
+ Pass if: returns diagnostic results.
168
+
169
+ ### 8.2 lcm_stats via MCP (verbose: true)
170
+ Pass if: returns stats with counts.
171
+
172
+ ### 8.3 lcm_search (query: "summarizer")
173
+ Pass if: episodic results > 0.
174
+
175
+ ### 8.4 lcm_grep (query: "compact", scope: "all")
176
+ Pass if: returns matching entries.
177
+
178
+ ### 8.5 lcm_store (text: "dogfood test memory — <date>", tags: ["dogfood","test"])
179
+ Pass if: returns stored UUID.
180
+
181
+ ### 8.6 lcm_search retrieval ("dogfood test memory")
182
+ Pass if: memory from 8.5 appears in results.
183
+
184
+ ### 8.7 lcm_expand (nodeId from prior results)
185
+ Pass if: returns expanded content. ⚠️ SKIP if no summary IDs.
186
+
187
+ ### 8.8 lcm_describe (same nodeId)
188
+ Pass if: returns metadata. ⚠️ SKIP if no node.
189
+
190
+ ## Phase 9: Resilience — 3 checks
191
+
192
+ ### 9.1 Kill daemon
193
+ ```bash
194
+ pkill -f "lcm.*daemon" || true
195
+ sleep 1
196
+ node dist/bin/lcm.js status
197
+ ```
198
+ Pass if: reports daemon down (no crash/hang).
199
+
200
+ ### 9.2 Auto-recovery
201
+ ```bash
202
+ node dist/bin/lcm.js daemon start --detach
203
+ sleep 2
204
+ node dist/bin/lcm.js status
205
+ ```
206
+ Pass if: daemon back up.
207
+
208
+ ### 9.3 Graceful degradation
209
+ Kill daemon, then:
210
+ ```bash
211
+ timeout 10 sh -c 'node -e "console.log(JSON.stringify({prompt:\"test\",cwd:process.cwd()}))" | node dist/bin/lcm.js user-prompt'
212
+ ```
213
+ Pass if: returns within 10s, no crash. Restart daemon after.
214
+
215
+ ## Phase 10: Debug Diagnostics — 4 checks
216
+
217
+ ### 10.1 Daemon logs
218
+ ```bash
219
+ tail -50 ~/.lossless-claude/daemon.log
220
+ ```
221
+ Pass if: no ERROR entries.
222
+
223
+ ### 10.2 PWD matches cwd
224
+ ```bash
225
+ echo "PWD=$PWD" && echo "cwd=$(pwd)"
226
+ ```
227
+ Pass if: identical.
228
+
229
+ ### 10.3 Project DB exists
230
+ ```bash
231
+ ls -la ~/.lossless-claude/projects/*/lcm.db 2>/dev/null
232
+ ```
233
+ Pass if: at least one .db file exists.
234
+
235
+ ### 10.4 DB integrity
236
+ ```bash
237
+ node .claude-plugin/skills/lcm-dogfood/scripts/db-integrity.js
238
+ ```
239
+ Pass if: all DBs report "ok".
@@ -0,0 +1,11 @@
1
+ # lcm Dogfood — Known Issues
2
+
3
+ Track bugs at: `.xgh/plans/2026-03-22-dogfood-findings.md`
4
+
5
+ | Bug | Summary | Affects | Status |
6
+ |-----|---------|---------|--------|
7
+ | 1 | prompt-search only queries promoted store, not summaries or messages | Check 7.3, 7.4 | Open |
8
+ | 2 | `env: node: No such file or directory` in daemon.log — PATH not set in spawned processes | Check 10.1 | Open |
9
+ | 3 | No request logging in daemon — zero visibility into runtime requests | Check 10.1 | Open |
10
+ | 4 | Config file has stale restoration fields (semanticTopK vs promptSearchMaxResults) | N/A (defaults work) | Low |
11
+ | 5 | Skill checked settings.json instead of plugin.json for hooks | Check 7.1 | Fixed |
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env node
2
+ // Check integrity of all lcm project databases
3
+ import { DatabaseSync } from "node:sqlite";
4
+ import fs from "node:fs";
5
+ import path from "node:path";
6
+ import os from "node:os";
7
+
8
+ const projectsDir = path.join(os.homedir(), ".lossless-claude", "projects");
9
+ if (!fs.existsSync(projectsDir)) {
10
+ console.log("No projects directory found");
11
+ process.exit(0);
12
+ }
13
+
14
+ const dirs = fs.readdirSync(projectsDir).filter((d) => {
15
+ const dbPath = path.join(projectsDir, d, "lcm.db");
16
+ return fs.existsSync(dbPath);
17
+ });
18
+
19
+ if (dirs.length === 0) {
20
+ console.log("No project databases found");
21
+ process.exit(0);
22
+ }
23
+
24
+ let allOk = true;
25
+ for (const d of dirs) {
26
+ const dbPath = path.join(projectsDir, d, "lcm.db");
27
+ try {
28
+ const db = new DatabaseSync(dbPath);
29
+ const result = db.prepare("PRAGMA integrity_check").get();
30
+ const status = result.integrity_check === "ok" ? "ok" : "FAIL";
31
+ if (status !== "ok") allOk = false;
32
+ console.log(`${d.slice(0, 16)}... ${status}`);
33
+ db.close();
34
+ } catch (e) {
35
+ console.log(`${d.slice(0, 16)}... ERROR: ${e.message}`);
36
+ allOk = false;
37
+ }
38
+ }
39
+
40
+ process.exit(allOk ? 0 : 1);
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env node
2
+ // Test the daemon's /prompt-search endpoint directly
3
+ import http from "node:http";
4
+ const query = process.argv[2] || "summarizer";
5
+ const cwd = process.argv[3] || process.cwd();
6
+ const data = JSON.stringify({ query, cwd });
7
+
8
+ const req = http.request(
9
+ {
10
+ hostname: "127.0.0.1",
11
+ port: 3737,
12
+ path: "/prompt-search",
13
+ method: "POST",
14
+ headers: { "Content-Type": "application/json", "Content-Length": Buffer.byteLength(data) },
15
+ },
16
+ (res) => {
17
+ let body = "";
18
+ res.on("data", (c) => (body += c));
19
+ res.on("end", () => {
20
+ console.log(`Status: ${res.statusCode}`);
21
+ try {
22
+ const parsed = JSON.parse(body);
23
+ console.log(`Hints: ${parsed.hints?.length ?? 0}`);
24
+ if (parsed.hints?.length > 0) {
25
+ parsed.hints.forEach((h, i) => console.log(` ${i + 1}. ${h.slice(0, 120)}`));
26
+ }
27
+ } catch {
28
+ console.log(`Raw: ${body}`);
29
+ }
30
+ });
31
+ }
32
+ );
33
+ req.on("error", (e) => console.log(`Error: ${e.message}`));
34
+ req.write(data);
35
+ req.end();
@@ -0,0 +1,61 @@
1
+ ---
2
+ name: lcm-e2e
3
+ description: Run the E2E validation checklist against a real lcm installation. Tests daemon, hooks, import, compact, promote, retrieval, and resilience. Pass a flow name for a subset (import, compact, promote, curate, retrieval, hooks, doctor, cleanup), or omit for the full suite.
4
+ allowed-tools: Bash, Read
5
+ user-invocable: true
6
+ ---
7
+
8
+ ## Current state
9
+
10
+ ### lcm binary
11
+ !`lcm --version 2>/dev/null || echo "ERROR: lcm not in PATH"`
12
+
13
+ ### Daemon status
14
+ !`lcm status 2>/dev/null || echo "Daemon not running"`
15
+
16
+ ## Task
17
+
18
+ Run the E2E validation checklist from `.claude-plugin/skills/lcm-e2e/checklist.md`.
19
+
20
+ **Arguments:** `$ARGUMENTS`
21
+
22
+ - If `$ARGUMENTS` is empty → run all flows in order
23
+ - If `$ARGUMENTS` is `import` → run Flows 1, 2, 3, 4
24
+ - If `$ARGUMENTS` is `compact` → run Flows 1, 2, 5
25
+ - If `$ARGUMENTS` is `promote` → run Flows 1, 2, 5, 6
26
+ - If `$ARGUMENTS` is `curate` → run Flows 1, 2, 5, 6, 7
27
+ - If `$ARGUMENTS` is `retrieval` → run Flows 1, 2, 5, 6, 8
28
+ - If `$ARGUMENTS` is `hooks` → run Flows 1, 2, 9, 10, 14, 15, 16, 18
29
+ - If `$ARGUMENTS` is `doctor` → run Flows 1, 11, 12, 19
30
+ - If `$ARGUMENTS` is `cleanup` → run Flow 13 only
31
+
32
+ ## Steps
33
+
34
+ 1. Read the checklist: `.claude-plugin/skills/lcm-e2e/checklist.md`
35
+ 2. Determine which flows to run based on arguments
36
+ 3. For each step in each flow:
37
+ a. Print the step description
38
+ b. Run the command
39
+ c. Evaluate against expected output
40
+ d. Mark ✓ (pass) or ✗ (fail) with a one-line explanation
41
+ 4. If a flow fails a critical step, note it and continue (don't abort)
42
+ 5. Always run Flow 13 (cleanup) at the end of the full suite
43
+ 6. Print the summary table with actual ✓/✗ results
44
+
45
+ ## CRITICAL: Data Isolation
46
+
47
+ **Live mode NEVER touches user data.**
48
+
49
+ All operations use an isolated temp directory as `cwd`:
50
+ - Create: `mktemp -d /tmp/lcm-e2e-test-XXXXXX`
51
+ - This temp cwd creates a separate project database under `~/.lossless-claude/projects/<hash>/`
52
+ - The user's real project data is never accessed
53
+ - Cleanup removes both the temp dir AND the project under `~/.lossless-claude/projects/`
54
+
55
+ ## Important notes
56
+
57
+ - This modifies ONLY temp/test directories — never the user's real project
58
+ - Auto-heal flow (16) is READ-ONLY in live mode: verify hooks exist, don't break them
59
+ - If lcm is not in PATH, show an error and stop
60
+ - If daemon is not running, try `lcm daemon start --detach` first
61
+ - Do not abort on first failure — the goal is a complete picture