@theglitchking/semantic-memory 1.6.0 → 1.7.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 (149) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +90 -0
  4. package/LICENSES/Apache-2.0.txt +202 -0
  5. package/README.md +49 -29
  6. package/THIRD_PARTY_NOTICES.md +17 -0
  7. package/commands/jev-mode.md +18 -0
  8. package/commands/skill-loop.md +23 -0
  9. package/dist/{chunk-7PNF3AP2.js → chunk-34VN47IW.js} +2 -2
  10. package/dist/chunk-3FPUBAEW.js +113 -0
  11. package/dist/chunk-3FPUBAEW.js.map +1 -0
  12. package/dist/{chunk-WZEKIUYG.js → chunk-6TIKWOY4.js} +10 -8
  13. package/dist/{chunk-WZEKIUYG.js.map → chunk-6TIKWOY4.js.map} +1 -1
  14. package/dist/{chunk-NBY4TRP7.js → chunk-7M34JDTH.js} +3 -3
  15. package/dist/{chunk-FTRXH2WC.js → chunk-7UAVDOI6.js} +15 -12
  16. package/dist/chunk-7UAVDOI6.js.map +1 -0
  17. package/dist/{chunk-BBP3DG2U.js → chunk-AIXQFTSB.js} +25 -26
  18. package/dist/{chunk-BBP3DG2U.js.map → chunk-AIXQFTSB.js.map} +1 -1
  19. package/dist/chunk-BEACL25M.js +224 -0
  20. package/dist/chunk-BEACL25M.js.map +1 -0
  21. package/dist/chunk-CATPGINC.js +186 -0
  22. package/dist/chunk-CATPGINC.js.map +1 -0
  23. package/dist/{chunk-IGHCVAAL.js → chunk-CJUY55GG.js} +6 -3
  24. package/dist/{chunk-IGHCVAAL.js.map → chunk-CJUY55GG.js.map} +1 -1
  25. package/dist/chunk-DBFD3MTT.js +130 -0
  26. package/dist/chunk-DBFD3MTT.js.map +1 -0
  27. package/dist/{chunk-XAXK7NM4.js → chunk-EXAUVIGW.js} +9 -7
  28. package/dist/{chunk-XAXK7NM4.js.map → chunk-EXAUVIGW.js.map} +1 -1
  29. package/dist/{chunk-LGQPP5FQ.js → chunk-EYVFC745.js} +2 -2
  30. package/dist/chunk-GYR7U6KA.js +80 -0
  31. package/dist/chunk-GYR7U6KA.js.map +1 -0
  32. package/dist/{chunk-OEF5U5GV.js → chunk-H2BES6FU.js} +10 -2
  33. package/dist/{chunk-OEF5U5GV.js.map → chunk-H2BES6FU.js.map} +1 -1
  34. package/dist/chunk-IEZVFKUT.js +157 -0
  35. package/dist/chunk-IEZVFKUT.js.map +1 -0
  36. package/dist/chunk-J7LYDRML.js +9 -0
  37. package/dist/chunk-J7LYDRML.js.map +1 -0
  38. package/dist/chunk-MQS7JEBD.js +137 -0
  39. package/dist/chunk-MQS7JEBD.js.map +1 -0
  40. package/dist/chunk-NCGM36NX.js +118 -0
  41. package/dist/chunk-NCGM36NX.js.map +1 -0
  42. package/dist/chunk-NIZLBNH4.js +165 -0
  43. package/dist/chunk-NIZLBNH4.js.map +1 -0
  44. package/dist/chunk-OT3MV7XF.js +123 -0
  45. package/dist/chunk-OT3MV7XF.js.map +1 -0
  46. package/dist/chunk-P3GLY42T.js +291 -0
  47. package/dist/chunk-P3GLY42T.js.map +1 -0
  48. package/dist/chunk-PJXYCCI2.js +177 -0
  49. package/dist/chunk-PJXYCCI2.js.map +1 -0
  50. package/dist/chunk-R6GNP7DS.js +87 -0
  51. package/dist/chunk-R6GNP7DS.js.map +1 -0
  52. package/dist/{chunk-44BQDRXD.js → chunk-SHSOCFJH.js} +4 -1
  53. package/dist/chunk-SHSOCFJH.js.map +1 -0
  54. package/dist/chunk-TKHWVISV.js +71 -0
  55. package/dist/chunk-TKHWVISV.js.map +1 -0
  56. package/dist/{chunk-CAX46XLY.js → chunk-VBLCUWT4.js} +23 -12
  57. package/dist/chunk-VBLCUWT4.js.map +1 -0
  58. package/dist/chunk-VQCNWRTL.js +121 -0
  59. package/dist/chunk-VQCNWRTL.js.map +1 -0
  60. package/dist/{chunk-SX427M2R.js → chunk-XKGK643R.js} +2 -2
  61. package/dist/{chunk-FURCIJBO.js → chunk-Y7H76Q7F.js} +6 -3
  62. package/dist/chunk-Y7H76Q7F.js.map +1 -0
  63. package/dist/chunk-ZSWI3Y4Y.js +232 -0
  64. package/dist/chunk-ZSWI3Y4Y.js.map +1 -0
  65. package/dist/cli/index.js +389 -60
  66. package/dist/cli/index.js.map +1 -1
  67. package/dist/core/features.d.ts +38 -0
  68. package/dist/core/features.js +28 -0
  69. package/dist/core/index.d.ts +285 -2
  70. package/dist/core/index.js +170 -20
  71. package/dist/core/index.js.map +1 -1
  72. package/dist/core/jev.d.ts +35 -0
  73. package/dist/core/jev.js +20 -0
  74. package/dist/core/redact.js +1 -1
  75. package/dist/core/skill-curator.d.ts +1 -0
  76. package/dist/core/skill-curator.js +41 -0
  77. package/dist/core/skill-evidence.d.ts +25 -0
  78. package/dist/core/skill-evidence.js +23 -0
  79. package/dist/core/skill-queue.d.ts +40 -0
  80. package/dist/core/skill-queue.js +38 -0
  81. package/dist/core/skill-review.d.ts +3 -0
  82. package/dist/core/skill-review.js +29 -0
  83. package/dist/core/skill-worker.d.ts +21 -0
  84. package/dist/core/skill-worker.js +70 -0
  85. package/dist/core/skill-worker.js.map +1 -0
  86. package/dist/{dossier-RWTIMGZN.js → dossier-RXBLQOXC.js} +5 -4
  87. package/dist/failure-eval-IUJO47UC.js +18 -0
  88. package/dist/healthcheck-S7D6YNTA.js +21 -0
  89. package/dist/indexer-RZPH2PVL.js +9 -0
  90. package/dist/{lexicon-IVNJTMWE.js → lexicon-SEJSLBHO.js} +6 -5
  91. package/dist/lexicon-SEJSLBHO.js.map +1 -0
  92. package/dist/lint-3JNLRM5U.js +18 -0
  93. package/dist/lint-3JNLRM5U.js.map +1 -0
  94. package/dist/log-RM2NDNPH.js +11 -0
  95. package/dist/log-RM2NDNPH.js.map +1 -0
  96. package/dist/matter-SNJ2WDL6.js +8 -0
  97. package/dist/matter-SNJ2WDL6.js.map +1 -0
  98. package/dist/mcp/server.js +43 -38
  99. package/dist/mcp/server.js.map +1 -1
  100. package/dist/{profile-UE4YVTDC.js → profile-SNULTJ27.js} +6 -5
  101. package/dist/profile-SNULTJ27.js.map +1 -0
  102. package/dist/{schema-LY6533NJ.js → schema-RDYUK6CC.js} +3 -2
  103. package/dist/schema-RDYUK6CC.js.map +1 -0
  104. package/dist/{search-MZC4DC7H.js → search-325ULY57.js} +4 -3
  105. package/dist/{search-MZC4DC7H.js.map → search-325ULY57.js.map} +1 -1
  106. package/dist/skill-curator-D7HHZaUI.d.ts +71 -0
  107. package/dist/skill-land-XU2APPBJ.js +31 -0
  108. package/dist/skill-land-XU2APPBJ.js.map +1 -0
  109. package/dist/skill-ledger-AYXVNFX7.js +18 -0
  110. package/dist/skill-ledger-AYXVNFX7.js.map +1 -0
  111. package/dist/skill-merge-GXBQLBZA.js +24 -0
  112. package/dist/skill-merge-GXBQLBZA.js.map +1 -0
  113. package/dist/skill-review-BaW5n0Zg.d.ts +179 -0
  114. package/dist/skill-schema-RVB3EHEF.js +30 -0
  115. package/dist/skill-schema-RVB3EHEF.js.map +1 -0
  116. package/dist/{telemetry-B4KP3UVE.js → telemetry-YAG3VA4Y.js} +4 -4
  117. package/dist/telemetry-YAG3VA4Y.js.map +1 -0
  118. package/docs/regression-snapshot.md +5 -5
  119. package/hooks/hooks.json +26 -1
  120. package/hooks/jev-bridge.py +109 -0
  121. package/hooks/session-start.js +5 -0
  122. package/hooks/skill-loop.js +65 -0
  123. package/hooks/vault-context.js +104 -6
  124. package/package.json +4 -2
  125. package/dist/chunk-44BQDRXD.js.map +0 -1
  126. package/dist/chunk-5F5ZIAW2.js +0 -79
  127. package/dist/chunk-5F5ZIAW2.js.map +0 -1
  128. package/dist/chunk-CAX46XLY.js.map +0 -1
  129. package/dist/chunk-FTRXH2WC.js.map +0 -1
  130. package/dist/chunk-FURCIJBO.js.map +0 -1
  131. package/dist/failure-eval-37JRNTIW.js +0 -10
  132. package/dist/healthcheck-3FSNL2U7.js +0 -20
  133. package/dist/indexer-RAKJ7JR3.js +0 -8
  134. package/dist/lint-36WTW762.js +0 -17
  135. package/dist/log-YIXF6CYM.js +0 -11
  136. /package/dist/{chunk-7PNF3AP2.js.map → chunk-34VN47IW.js.map} +0 -0
  137. /package/dist/{chunk-NBY4TRP7.js.map → chunk-7M34JDTH.js.map} +0 -0
  138. /package/dist/{chunk-LGQPP5FQ.js.map → chunk-EYVFC745.js.map} +0 -0
  139. /package/dist/{chunk-SX427M2R.js.map → chunk-XKGK643R.js.map} +0 -0
  140. /package/dist/{dossier-RWTIMGZN.js.map → core/features.js.map} +0 -0
  141. /package/dist/{failure-eval-37JRNTIW.js.map → core/jev.js.map} +0 -0
  142. /package/dist/{healthcheck-3FSNL2U7.js.map → core/skill-curator.js.map} +0 -0
  143. /package/dist/{indexer-RAKJ7JR3.js.map → core/skill-evidence.js.map} +0 -0
  144. /package/dist/{lexicon-IVNJTMWE.js.map → core/skill-queue.js.map} +0 -0
  145. /package/dist/{lint-36WTW762.js.map → core/skill-review.js.map} +0 -0
  146. /package/dist/{log-YIXF6CYM.js.map → dossier-RXBLQOXC.js.map} +0 -0
  147. /package/dist/{profile-UE4YVTDC.js.map → failure-eval-IUJO47UC.js.map} +0 -0
  148. /package/dist/{schema-LY6533NJ.js.map → healthcheck-S7D6YNTA.js.map} +0 -0
  149. /package/dist/{telemetry-B4KP3UVE.js.map → indexer-RZPH2PVL.js.map} +0 -0
@@ -3,7 +3,7 @@ import {
3
3
  initSpeakerProfile,
4
4
  readSpeakerProfile,
5
5
  updateProfileSection
6
- } from "../chunk-WZEKIUYG.js";
6
+ } from "../chunk-6TIKWOY4.js";
7
7
  import {
8
8
  FrontmatterManager,
9
9
  NoteCrud,
@@ -17,19 +17,19 @@ import {
17
17
  regenDirectoryIndex,
18
18
  regenIndexesForPaths,
19
19
  regenerateAgentsContract
20
- } from "../chunk-BBP3DG2U.js";
20
+ } from "../chunk-AIXQFTSB.js";
21
21
  import {
22
22
  Embedder,
23
23
  GraphBuilder,
24
24
  TextSearch,
25
25
  VectorIndex
26
- } from "../chunk-44BQDRXD.js";
26
+ } from "../chunk-SHSOCFJH.js";
27
27
  import {
28
28
  lintVault
29
- } from "../chunk-CAX46XLY.js";
29
+ } from "../chunk-VBLCUWT4.js";
30
30
  import {
31
31
  installDefaultSchema
32
- } from "../chunk-FURCIJBO.js";
32
+ } from "../chunk-Y7H76Q7F.js";
33
33
  import {
34
34
  computeDecay,
35
35
  loadDecayConfig,
@@ -40,14 +40,14 @@ import {
40
40
  readSelectionLog,
41
41
  recordSearchForCorrelation,
42
42
  wasRecentlySearched
43
- } from "../chunk-NBY4TRP7.js";
43
+ } from "../chunk-7M34JDTH.js";
44
44
  import {
45
45
  addAlias,
46
46
  compileLexicon,
47
47
  expandQuery,
48
48
  loadLexiconCache,
49
49
  removeAlias
50
- } from "../chunk-FTRXH2WC.js";
50
+ } from "../chunk-7UAVDOI6.js";
51
51
  import {
52
52
  appendIncident,
53
53
  compileDossiers,
@@ -56,22 +56,25 @@ import {
56
56
  listDossiers,
57
57
  resolveDossierPath,
58
58
  setCurrentState
59
- } from "../chunk-XAXK7NM4.js";
59
+ } from "../chunk-EXAUVIGW.js";
60
60
  import {
61
61
  SessionManager,
62
62
  deriveProjectRoot,
63
63
  deriveSessionDir
64
- } from "../chunk-LGQPP5FQ.js";
64
+ } from "../chunk-EYVFC745.js";
65
65
  import {
66
66
  Indexer
67
- } from "../chunk-IGHCVAAL.js";
67
+ } from "../chunk-CJUY55GG.js";
68
+ import {
69
+ matter_default
70
+ } from "../chunk-J7LYDRML.js";
68
71
  import {
69
72
  logEvent,
70
73
  logQuery
71
- } from "../chunk-SX427M2R.js";
74
+ } from "../chunk-XKGK643R.js";
72
75
  import {
73
76
  redactedNote
74
- } from "../chunk-OEF5U5GV.js";
77
+ } from "../chunk-H2BES6FU.js";
75
78
  import {
76
79
  __export
77
80
  } from "../chunk-PZ5AY32C.js";
@@ -4501,9 +4504,7 @@ function registerSearchTools(server, ctx) {
4501
4504
  async ({ query, limit, modifiedAfter, modifiedBefore, status, tier, domain }) => {
4502
4505
  const vectorIndex = ctx.getVectorIndex();
4503
4506
  if (!vectorIndex) {
4504
- return ctx.textResponse(
4505
- ctx.getIndexState() === "empty" ? ctx.indexingMessage() : "Index not built. Run reindex first."
4506
- );
4507
+ return ctx.textResponse(ctx.indexingMessage());
4507
4508
  }
4508
4509
  const queryEmbed = await ctx.embedder.embed(query);
4509
4510
  await ctx.refreshUsageBoost();
@@ -4579,9 +4580,7 @@ function registerSearchTools(server, ctx) {
4579
4580
  async ({ query, limit, modifiedAfter, modifiedBefore, status, tier, domain }) => {
4580
4581
  const vectorIndex = ctx.getVectorIndex();
4581
4582
  if (!vectorIndex) {
4582
- return ctx.textResponse(
4583
- ctx.getIndexState() === "empty" ? ctx.indexingMessage() : "Index not built. Run reindex first."
4584
- );
4583
+ return ctx.textResponse(ctx.indexingMessage());
4585
4584
  }
4586
4585
  const queryEmbed = await ctx.embedder.embed(query);
4587
4586
  await ctx.refreshUsageBoost();
@@ -4737,7 +4736,6 @@ function registerWriteTools(server, ctx) {
4737
4736
  // src/mcp/tools/patch.ts
4738
4737
  import { readFile as readFile2 } from "fs/promises";
4739
4738
  import { join as join4 } from "path";
4740
- import matter from "gray-matter";
4741
4739
  function registerPatchTools(server, ctx) {
4742
4740
  if (ctx.options.readOnly) return;
4743
4741
  server.tool(
@@ -4918,7 +4916,7 @@ ${verifLines.join("\n")}
4918
4916
  error: `Proposal file not found: ${args.proposal_path}`
4919
4917
  }, null, 2));
4920
4918
  }
4921
- const parsed = matter(raw);
4919
+ const parsed = matter_default(raw);
4922
4920
  const fm = parsed.data;
4923
4921
  if (fm.status !== "proposal") {
4924
4922
  return ctx.textResponse(JSON.stringify({
@@ -5202,7 +5200,8 @@ var RULE_KEY_FOR_CHECK = {
5202
5200
  decay_candidates: "decay_candidates",
5203
5201
  alias_conflicts: "alias_conflicts",
5204
5202
  decoys: "decoys",
5205
- secrets: "secrets"
5203
+ secrets: "secrets",
5204
+ skills: "skills"
5206
5205
  };
5207
5206
  function registerLintTools(server, ctx) {
5208
5207
  server.tool(
@@ -5243,10 +5242,10 @@ function registerLintTools(server, ctx) {
5243
5242
  );
5244
5243
  server.tool(
5245
5244
  "lint_vault",
5246
- "Run lint rules across the vault. Default returns the full LintReport with all findings grouped by rule. Pass `checks` to filter to specific rules (schema, provenance, stale, broken_links, code_symbols, decay_candidates) \u2014 when filtered, byRule contains only the requested rules. Two checks are opt-in only (never in the default report): `code_symbols` flags inline-code file-path references that no longer exist under the project root (no-op outside a code repo); `decay_candidates` cross-references the selection log against current decay to surface frequently-retrieved-but-decayed notes (no-op with no selection log). `decoys` flags notes retrieved 3+ times but never cited - surfaced for review, never auto-down-ranked (v1.5 Q5). `secrets` flags notes containing an API key, token, password or private key (path, line, kind \u2014 never the value; nothing is rewritten): rotate the secret, then remove it.",
5245
+ "Run lint rules across the vault. Default returns the full LintReport with all findings grouped by rule. Pass `checks` to filter to specific rules (schema, provenance, stale, broken_links, code_symbols, decay_candidates) \u2014 when filtered, byRule contains only the requested rules. Two checks are opt-in only (never in the default report): `code_symbols` flags inline-code file-path references that no longer exist under the project root (no-op outside a code repo); `decay_candidates` cross-references the selection log against current decay to surface frequently-retrieved-but-decayed notes (no-op with no selection log). `decoys` flags notes retrieved 3+ times but never cited - surfaced for review, never auto-down-ranked (v1.5 Q5). `secrets` flags notes containing an API key, token, password or private key (path, line, kind \u2014 never the value; nothing is rewritten): rotate the secret, then remove it. `skills` lints the skill loop's learned skills this repo loads (format, description, evidence, sections, cites, applies_to paths, secrets, name clashes with skills it did not write).",
5247
5246
  {
5248
5247
  pathGlob: external_exports.string().optional(),
5249
- checks: external_exports.array(external_exports.enum(["schema", "provenance", "stale", "broken_links", "code_symbols", "decay_candidates", "alias_conflicts", "decoys", "secrets"])).optional().describe("Filter to specific lint rules. Omit for full report (excludes the opt-in code_symbols / decay_candidates / alias_conflicts / decoys / secrets).")
5248
+ checks: external_exports.array(external_exports.enum(["schema", "provenance", "stale", "broken_links", "code_symbols", "decay_candidates", "alias_conflicts", "decoys", "secrets", "skills"])).optional().describe("Filter to specific lint rules. Omit for full report (excludes the opt-in code_symbols / decay_candidates / alias_conflicts / decoys / secrets / skills).")
5250
5249
  },
5251
5250
  async ({ pathGlob, checks }) => {
5252
5251
  const report = await lintVault(ctx.notesPath, {
@@ -5255,7 +5254,8 @@ function registerLintTools(server, ctx) {
5255
5254
  checkDecayCandidates: !!checks?.includes("decay_candidates"),
5256
5255
  checkAliasConflicts: !!checks?.includes("alias_conflicts"),
5257
5256
  checkDecoys: !!checks?.includes("decoys"),
5258
- checkSecrets: !!checks?.includes("secrets")
5257
+ checkSecrets: !!checks?.includes("secrets"),
5258
+ checkSkills: !!checks?.includes("skills")
5259
5259
  });
5260
5260
  if (!checks || checks.length === 0) {
5261
5261
  return ctx.textResponse(JSON.stringify(report, null, 2));
@@ -5275,7 +5275,12 @@ function registerLintTools(server, ctx) {
5275
5275
  {
5276
5276
  ...report,
5277
5277
  findings: filteredFindings,
5278
- byRule: filteredByRule
5278
+ byRule: filteredByRule,
5279
+ counts: {
5280
+ ...report.counts,
5281
+ errors: filteredFindings.filter((f) => f.severity === "error").length,
5282
+ warnings: filteredFindings.filter((f) => f.severity === "warn").length
5283
+ }
5279
5284
  },
5280
5285
  null,
5281
5286
  2
@@ -5287,19 +5292,6 @@ function registerLintTools(server, ctx) {
5287
5292
 
5288
5293
  // src/mcp/tools/log.ts
5289
5294
  function registerLogTools(server, ctx) {
5290
- server.tool(
5291
- "log_event",
5292
- "Append a structured event to the vault's log.md. Each entry renders as a human line + a machine-readable YAML block for later querying.",
5293
- {
5294
- kind: external_exports.string().describe("Category: ingest, synthesis, decision, incident, etc."),
5295
- summary: external_exports.string().describe("One-line human summary"),
5296
- payload: external_exports.record(external_exports.unknown()).optional().describe("Arbitrary structured data")
5297
- },
5298
- async (args) => {
5299
- const entry = await logEvent(ctx.notesPath, args);
5300
- return ctx.textResponse(JSON.stringify(entry, null, 2));
5301
- }
5302
- );
5303
5295
  server.tool(
5304
5296
  "log_query",
5305
5297
  "Read structured log entries filtered by kind and/or date range. Returns parsed entries from log.md.",
@@ -5315,6 +5307,19 @@ function registerLogTools(server, ctx) {
5315
5307
  }
5316
5308
  );
5317
5309
  if (!ctx.options.readOnly) {
5310
+ server.tool(
5311
+ "log_event",
5312
+ "Append a structured event to the vault's log.md. Each entry renders as a human line + a machine-readable YAML block for later querying.",
5313
+ {
5314
+ kind: external_exports.string().describe("Category: ingest, synthesis, decision, incident, etc."),
5315
+ summary: external_exports.string().describe("One-line human summary"),
5316
+ payload: external_exports.record(external_exports.unknown()).optional().describe("Arbitrary structured data")
5317
+ },
5318
+ async (args) => {
5319
+ const entry = await logEvent(ctx.notesPath, args);
5320
+ return ctx.textResponse(JSON.stringify(entry, null, 2));
5321
+ }
5322
+ );
5318
5323
  server.tool(
5319
5324
  "regenerate_index",
5320
5325
  "Force regeneration of INDEX.md for one directory (or all affected by a list of paths). Idempotent \u2014 skips write if unchanged.",