akm-cli 0.9.17-alpha.8 → 0.9.17

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 (111) hide show
  1. package/CHANGELOG.md +277 -1694
  2. package/STABILITY.md +9 -8
  3. package/dist/assets/hints/cli-hints-full.md +6 -7
  4. package/dist/assets/improve-strategies/catchup.json +0 -3
  5. package/dist/assets/improve-strategies/consolidate.json +0 -1
  6. package/dist/assets/improve-strategies/default.json +1 -2
  7. package/dist/assets/improve-strategies/proactive-maintenance.json +1 -2
  8. package/dist/assets/improve-strategies/quick.json +1 -2
  9. package/dist/assets/improve-strategies/reflect-distill.json +1 -2
  10. package/dist/assets/improve-strategies/thorough.json +0 -3
  11. package/dist/assets/prompts/consolidate-pair.md +20 -0
  12. package/dist/assets/stash-skeleton/facts/conventions/backlinks.md +17 -19
  13. package/dist/assets/stash-skeleton/facts/conventions/domains.md +2 -2
  14. package/dist/assets/templates/html/health.html +3 -5
  15. package/dist/cli/retired-commands.js +1 -1
  16. package/dist/cli/unknown-flags.js +24 -1
  17. package/dist/cli.js +46 -1
  18. package/dist/commands/health/archive-usage.js +92 -0
  19. package/dist/commands/health/data-dir-usage.js +25 -13
  20. package/dist/commands/health/html-report.js +1 -4
  21. package/dist/commands/health/improve-metrics.js +25 -37
  22. package/dist/commands/health/md-report.js +1 -6
  23. package/dist/commands/health/report-view-model.js +4 -14
  24. package/dist/commands/health/windows.js +0 -1
  25. package/dist/commands/health.js +13 -0
  26. package/dist/commands/improve/consolidate/continuity-check.js +137 -0
  27. package/dist/commands/improve/consolidate/pair-pass.js +791 -0
  28. package/dist/commands/improve/consolidate.js +38 -63
  29. package/dist/commands/improve/extract-prompt.js +1 -2
  30. package/dist/commands/improve/improve-cli.js +1 -1
  31. package/dist/commands/improve/improve-strategies.js +23 -5
  32. package/dist/commands/improve/improve.js +19 -30
  33. package/dist/commands/improve/ledger.js +3 -2
  34. package/dist/commands/improve/loop-stages.js +5 -85
  35. package/dist/commands/improve/memory/memory-belief.js +3 -1
  36. package/dist/commands/improve/memory/memory-improve.js +262 -11
  37. package/dist/commands/improve/planner.js +0 -5
  38. package/dist/commands/improve/preparation.js +20 -135
  39. package/dist/commands/improve/retrieval-scope.js +19 -4
  40. package/dist/commands/improve/salience.js +1 -14
  41. package/dist/commands/improve/stage.js +0 -1
  42. package/dist/commands/lint/base-linter.js +19 -11
  43. package/dist/commands/proposal/drain.js +8 -1
  44. package/dist/commands/proposal/proposal-cli.js +16 -2
  45. package/dist/commands/proposal/proposal-types.js +7 -0
  46. package/dist/commands/proposal/proposal.js +37 -6
  47. package/dist/commands/proposal/repository.js +613 -4
  48. package/dist/commands/proposal/validators/proposals.js +9 -0
  49. package/dist/commands/read/knowledge.js +3 -2
  50. package/dist/commands/read/show.js +0 -14
  51. package/dist/commands/sources/info.js +122 -18
  52. package/dist/commands/sources/stash-cli.js +23 -3
  53. package/dist/core/bundle-rename.js +1 -7
  54. package/dist/core/config/config-schema.js +8 -1
  55. package/dist/core/config/config.js +23 -48
  56. package/dist/core/config/engine-semantics.js +0 -2
  57. package/dist/core/config/schema/improve-processes.js +17 -42
  58. package/dist/core/config/schema/index-config.js +5 -25
  59. package/dist/core/file-change.js +13 -5
  60. package/dist/core/improve-result.js +22 -6
  61. package/dist/core/improve-types.js +0 -1
  62. package/dist/core/loopback.js +7 -12
  63. package/dist/core/parse.js +13 -16
  64. package/dist/core/state/migrations.js +15 -0
  65. package/dist/core/time.js +0 -20
  66. package/dist/indexer/db/llm-cache.js +2 -2
  67. package/dist/indexer/ensure-index.js +2 -2
  68. package/dist/indexer/index-written-assets.js +2 -3
  69. package/dist/indexer/indexer.js +18 -418
  70. package/dist/indexer/passes/metadata.js +0 -19
  71. package/dist/indexer/walk/walker.js +3 -4
  72. package/dist/llm/client.js +8 -10
  73. package/dist/llm/embedders/remote.js +1 -2
  74. package/dist/llm/feature-gate.js +0 -5
  75. package/dist/output/shapes/helpers.js +20 -4
  76. package/dist/output/text/command-format.js +9 -8
  77. package/dist/output/text/proposal-format.js +47 -1
  78. package/dist/output/text/show-format.js +0 -20
  79. package/dist/scripts/akm-migrate-node.js +923 -950
  80. package/dist/scripts/akm-migrate.js +923 -950
  81. package/dist/setup/steps/connection.js +5 -6
  82. package/dist/setup/steps/platforms.js +2 -2
  83. package/dist/sources/providers/git-stash.js +83 -4
  84. package/dist/storage/repositories/improve-ledger-repository.js +48 -7
  85. package/dist/storage/repositories/index-connection.js +5 -2
  86. package/dist/storage/repositories/index-entries-repository.js +4 -7
  87. package/dist/storage/repositories/index-entry-schema.js +4 -2
  88. package/dist/storage/repositories/index-llm-cache-repository.js +7 -26
  89. package/dist/storage/repositories/index-schema.js +55 -104
  90. package/dist/storage/repositories/proposals-repository.js +61 -0
  91. package/dist/storage/repositories/salience-repository.js +1 -19
  92. package/docs/migration/README.md +1 -1
  93. package/docs/migration/release-notes/0.9.17.md +130 -41
  94. package/docs/migration/release-notes/README.md +7 -0
  95. package/docs/reference/cli.md +27 -21
  96. package/docs/reference/configuration.md +21 -12
  97. package/docs/reference/data-and-telemetry.md +0 -1
  98. package/package.json +1 -1
  99. package/schemas/akm-config.json +0 -342
  100. package/dist/assets/improve-strategies/graph-refresh.json +0 -15
  101. package/dist/assets/prompts/contradiction-judge.md +0 -33
  102. package/dist/assets/prompts/graph-extract-system.md +0 -1
  103. package/dist/assets/prompts/graph-extract-user-prompt.md +0 -35
  104. package/dist/assets/prompts/metadata-enhance-system.md +0 -1
  105. package/dist/assets/tasks/improve/akm-graph-refresh-weekly.yml +0 -4
  106. package/dist/indexer/db/graph-db.js +0 -399
  107. package/dist/indexer/graph/graph-extraction.js +0 -809
  108. package/dist/indexer/graph/graph-related.js +0 -131
  109. package/dist/indexer/graph/graph-types.js +0 -4
  110. package/dist/llm/graph-extract.js +0 -892
  111. package/dist/llm/metadata-enhance.js +0 -95
@@ -334,15 +334,6 @@
334
334
  }
335
335
  },
336
336
  "additionalProperties": true
337
- },
338
- "metadataEnhance": {
339
- "type": "object",
340
- "properties": {
341
- "enabled": {
342
- "type": "boolean"
343
- }
344
- },
345
- "additionalProperties": true
346
337
  }
347
338
  },
348
339
  "additionalProperties": {
@@ -401,18 +392,6 @@
401
392
  }
402
393
  },
403
394
  "additionalProperties": true
404
- },
405
- "graphExtractionBatchSize": {
406
- "type": "integer",
407
- "exclusiveMinimum": 0
408
- },
409
- "graphExtractionIncludeTypes": {
410
- "type": "array",
411
- "items": {
412
- "type": "string",
413
- "minLength": 1
414
- },
415
- "minItems": 1
416
395
  }
417
396
  },
418
397
  "additionalProperties": true
@@ -975,13 +954,6 @@
975
954
  "minimum": 1,
976
955
  "maximum": 50
977
956
  },
978
- "incrementalSince": {
979
- "type": "string"
980
- },
981
- "neighborsPerChanged": {
982
- "type": "integer",
983
- "minimum": 1
984
- },
985
957
  "p90ChunkSecondsDefault": {
986
958
  "type": "number",
987
959
  "exclusiveMinimum": 0
@@ -1080,89 +1052,6 @@
1080
1052
  },
1081
1053
  "additionalProperties": true
1082
1054
  },
1083
- "graphExtraction": {
1084
- "type": "object",
1085
- "properties": {
1086
- "engine": {
1087
- "type": "string",
1088
- "maxLength": 63,
1089
- "pattern": "^(?!akm-)[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
1090
- },
1091
- "model": {
1092
- "type": "string",
1093
- "minLength": 1
1094
- },
1095
- "llm": {
1096
- "type": "object",
1097
- "properties": {
1098
- "temperature": {
1099
- "type": "number"
1100
- },
1101
- "maxTokens": {
1102
- "type": "integer",
1103
- "exclusiveMinimum": 0
1104
- },
1105
- "supportsJsonSchema": {
1106
- "type": "boolean"
1107
- },
1108
- "extraParams": {
1109
- "type": "object",
1110
- "additionalProperties": {}
1111
- },
1112
- "contextLength": {
1113
- "type": "integer",
1114
- "exclusiveMinimum": 0
1115
- },
1116
- "enableThinking": {
1117
- "type": "boolean"
1118
- },
1119
- "reasoningEffort": {
1120
- "type": "string",
1121
- "minLength": 1
1122
- }
1123
- },
1124
- "additionalProperties": true
1125
- },
1126
- "enabled": {
1127
- "type": "boolean"
1128
- },
1129
- "timeoutMs": {
1130
- "anyOf": [
1131
- {
1132
- "type": "integer",
1133
- "exclusiveMinimum": 0
1134
- },
1135
- {
1136
- "type": "null"
1137
- }
1138
- ]
1139
- },
1140
- "topN": {
1141
- "type": "integer",
1142
- "exclusiveMinimum": 0
1143
- },
1144
- "includeTypes": {
1145
- "type": "array",
1146
- "items": {
1147
- "type": "string",
1148
- "minLength": 1
1149
- },
1150
- "minItems": 1
1151
- },
1152
- "batchSize": {
1153
- "type": "integer",
1154
- "exclusiveMinimum": 0
1155
- },
1156
- "fullScan": {
1157
- "type": "boolean"
1158
- },
1159
- "maxChunksPerAsset": {
1160
- "type": "integer",
1161
- "exclusiveMinimum": 0
1162
- }
1163
- },
1164
- "additionalProperties": true
1165
- },
1166
1055
  "extract": {
1167
1056
  "type": "object",
1168
1057
  "properties": {
@@ -1995,15 +1884,6 @@
1995
1884
  }
1996
1885
  },
1997
1886
  "additionalProperties": true
1998
- },
1999
- "metadataEnhance": {
2000
- "type": "object",
2001
- "properties": {
2002
- "enabled": {
2003
- "type": "boolean"
2004
- }
2005
- },
2006
- "additionalProperties": true
2007
1887
  }
2008
1888
  },
2009
1889
  "additionalProperties": {
@@ -2062,18 +1942,6 @@
2062
1942
  }
2063
1943
  },
2064
1944
  "additionalProperties": true
2065
- },
2066
- "graphExtractionBatchSize": {
2067
- "type": "integer",
2068
- "exclusiveMinimum": 0
2069
- },
2070
- "graphExtractionIncludeTypes": {
2071
- "type": "array",
2072
- "items": {
2073
- "type": "string",
2074
- "minLength": 1
2075
- },
2076
- "minItems": 1
2077
1945
  }
2078
1946
  },
2079
1947
  "additionalProperties": true
@@ -2636,13 +2504,6 @@
2636
2504
  "minimum": 1,
2637
2505
  "maximum": 50
2638
2506
  },
2639
- "incrementalSince": {
2640
- "type": "string"
2641
- },
2642
- "neighborsPerChanged": {
2643
- "type": "integer",
2644
- "minimum": 1
2645
- },
2646
2507
  "p90ChunkSecondsDefault": {
2647
2508
  "type": "number",
2648
2509
  "exclusiveMinimum": 0
@@ -2741,89 +2602,6 @@
2741
2602
  },
2742
2603
  "additionalProperties": true
2743
2604
  },
2744
- "graphExtraction": {
2745
- "type": "object",
2746
- "properties": {
2747
- "engine": {
2748
- "type": "string",
2749
- "maxLength": 63,
2750
- "pattern": "^(?!akm-)[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
2751
- },
2752
- "model": {
2753
- "type": "string",
2754
- "minLength": 1
2755
- },
2756
- "llm": {
2757
- "type": "object",
2758
- "properties": {
2759
- "temperature": {
2760
- "type": "number"
2761
- },
2762
- "maxTokens": {
2763
- "type": "integer",
2764
- "exclusiveMinimum": 0
2765
- },
2766
- "supportsJsonSchema": {
2767
- "type": "boolean"
2768
- },
2769
- "extraParams": {
2770
- "type": "object",
2771
- "additionalProperties": {}
2772
- },
2773
- "contextLength": {
2774
- "type": "integer",
2775
- "exclusiveMinimum": 0
2776
- },
2777
- "enableThinking": {
2778
- "type": "boolean"
2779
- },
2780
- "reasoningEffort": {
2781
- "type": "string",
2782
- "minLength": 1
2783
- }
2784
- },
2785
- "additionalProperties": true
2786
- },
2787
- "enabled": {
2788
- "type": "boolean"
2789
- },
2790
- "timeoutMs": {
2791
- "anyOf": [
2792
- {
2793
- "type": "integer",
2794
- "exclusiveMinimum": 0
2795
- },
2796
- {
2797
- "type": "null"
2798
- }
2799
- ]
2800
- },
2801
- "topN": {
2802
- "type": "integer",
2803
- "exclusiveMinimum": 0
2804
- },
2805
- "includeTypes": {
2806
- "type": "array",
2807
- "items": {
2808
- "type": "string",
2809
- "minLength": 1
2810
- },
2811
- "minItems": 1
2812
- },
2813
- "batchSize": {
2814
- "type": "integer",
2815
- "exclusiveMinimum": 0
2816
- },
2817
- "fullScan": {
2818
- "type": "boolean"
2819
- },
2820
- "maxChunksPerAsset": {
2821
- "type": "integer",
2822
- "exclusiveMinimum": 0
2823
- }
2824
- },
2825
- "additionalProperties": true
2826
- },
2827
2605
  "extract": {
2828
2606
  "type": "object",
2829
2607
  "properties": {
@@ -3585,13 +3363,6 @@
3585
3363
  "minimum": 1,
3586
3364
  "maximum": 50
3587
3365
  },
3588
- "incrementalSince": {
3589
- "type": "string"
3590
- },
3591
- "neighborsPerChanged": {
3592
- "type": "integer",
3593
- "minimum": 1
3594
- },
3595
3366
  "p90ChunkSecondsDefault": {
3596
3367
  "type": "number",
3597
3368
  "exclusiveMinimum": 0
@@ -3614,29 +3385,6 @@
3614
3385
  "type": "integer",
3615
3386
  "minimum": 0
3616
3387
  },
3617
- "topN": {
3618
- "type": "integer",
3619
- "exclusiveMinimum": 0
3620
- },
3621
- "includeTypes": {
3622
- "type": "array",
3623
- "items": {
3624
- "type": "string",
3625
- "minLength": 1
3626
- },
3627
- "minItems": 1
3628
- },
3629
- "batchSize": {
3630
- "type": "integer",
3631
- "exclusiveMinimum": 0
3632
- },
3633
- "fullScan": {
3634
- "type": "boolean"
3635
- },
3636
- "maxChunksPerAsset": {
3637
- "type": "integer",
3638
- "exclusiveMinimum": 0
3639
- },
3640
3388
  "defaultSince": {
3641
3389
  "type": "string",
3642
3390
  "minLength": 1
@@ -4105,13 +3853,6 @@
4105
3853
  "minimum": 1,
4106
3854
  "maximum": 50
4107
3855
  },
4108
- "incrementalSince": {
4109
- "type": "string"
4110
- },
4111
- "neighborsPerChanged": {
4112
- "type": "integer",
4113
- "minimum": 1
4114
- },
4115
3856
  "p90ChunkSecondsDefault": {
4116
3857
  "type": "number",
4117
3858
  "exclusiveMinimum": 0
@@ -4210,89 +3951,6 @@
4210
3951
  },
4211
3952
  "additionalProperties": true
4212
3953
  },
4213
- "graphExtraction": {
4214
- "type": "object",
4215
- "properties": {
4216
- "engine": {
4217
- "type": "string",
4218
- "maxLength": 63,
4219
- "pattern": "^(?!akm-)[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
4220
- },
4221
- "model": {
4222
- "type": "string",
4223
- "minLength": 1
4224
- },
4225
- "llm": {
4226
- "type": "object",
4227
- "properties": {
4228
- "temperature": {
4229
- "type": "number"
4230
- },
4231
- "maxTokens": {
4232
- "type": "integer",
4233
- "exclusiveMinimum": 0
4234
- },
4235
- "supportsJsonSchema": {
4236
- "type": "boolean"
4237
- },
4238
- "extraParams": {
4239
- "type": "object",
4240
- "additionalProperties": {}
4241
- },
4242
- "contextLength": {
4243
- "type": "integer",
4244
- "exclusiveMinimum": 0
4245
- },
4246
- "enableThinking": {
4247
- "type": "boolean"
4248
- },
4249
- "reasoningEffort": {
4250
- "type": "string",
4251
- "minLength": 1
4252
- }
4253
- },
4254
- "additionalProperties": true
4255
- },
4256
- "enabled": {
4257
- "type": "boolean"
4258
- },
4259
- "timeoutMs": {
4260
- "anyOf": [
4261
- {
4262
- "type": "integer",
4263
- "exclusiveMinimum": 0
4264
- },
4265
- {
4266
- "type": "null"
4267
- }
4268
- ]
4269
- },
4270
- "topN": {
4271
- "type": "integer",
4272
- "exclusiveMinimum": 0
4273
- },
4274
- "includeTypes": {
4275
- "type": "array",
4276
- "items": {
4277
- "type": "string",
4278
- "minLength": 1
4279
- },
4280
- "minItems": 1
4281
- },
4282
- "batchSize": {
4283
- "type": "integer",
4284
- "exclusiveMinimum": 0
4285
- },
4286
- "fullScan": {
4287
- "type": "boolean"
4288
- },
4289
- "maxChunksPerAsset": {
4290
- "type": "integer",
4291
- "exclusiveMinimum": 0
4292
- }
4293
- },
4294
- "additionalProperties": true
4295
- },
4296
3954
  "extract": {
4297
3955
  "type": "object",
4298
3956
  "properties": {
@@ -1,15 +0,0 @@
1
- {
2
- "description": "Full-corpus graph extraction pass — rebuilds graph relationships across all stash files. Disables all other sub-processes. Use via `akm improve --strategy graph-refresh` or the embedded `graph-refresh-weekly` task.",
3
- "processes": {
4
- "reflect": { "enabled": false },
5
- "distill": { "enabled": false },
6
- "consolidate": { "enabled": false },
7
- "memoryInference": { "enabled": false },
8
- "graphExtraction": { "enabled": true, "fullScan": true },
9
- "extract": { "enabled": false },
10
- "triage": { "enabled": false },
11
- "validation": { "enabled": false },
12
- "proactiveMaintenance": { "enabled": false }
13
- },
14
- "sync": { "enabled": true, "push": true }
15
- }
@@ -1,33 +0,0 @@
1
- You are evaluating two derived memory entries to determine if they contain
2
- directly contradictory factual claims about the same subject.
3
-
4
- Memory A:
5
- Ref: {{A_REF}}
6
- Description: {{A_DESCRIPTION}}
7
- Content:
8
- ```
9
- {{A_BODY}}
10
- ```
11
-
12
- Memory B:
13
- Ref: {{B_REF}}
14
- Description: {{B_DESCRIPTION}}
15
- Content:
16
- ```
17
- {{B_BODY}}
18
- ```
19
-
20
- Answer ONLY with valid JSON — no prose, no code fences:
21
- {"contradicts": true|false, "confidence": 0.0, "reason": "<cite the exact opposing sentence from each memory, or explain why not contradicted>"}
22
-
23
- A contradiction means the memories make LOGICALLY EXCLUSIVE claims: a practitioner
24
- cannot follow BOTH simultaneously. The test: cite the exact sentence from Memory A
25
- and the exact sentence from Memory B that are in direct conflict. If you cannot cite
26
- specific opposing sentences, return false.
27
-
28
- Sharing a topic, tool, domain, or workflow stage is NOT a contradiction. Only direct
29
- factual opposites qualify: opposing recommended commands, opposing boolean flags,
30
- opposing version numbers, or mutually exclusive instructions.
31
-
32
- Set confidence ≥ 0.92 only when evidence is unambiguous. Use lower values when
33
- uncertain — the caller will skip edges below 0.92.
@@ -1 +0,0 @@
1
- You extract a knowledge graph from developer notes. Return ONLY valid JSON — no prose, no markdown fences, no preamble.
@@ -1,35 +0,0 @@
1
- Extract entities and relations from the asset body below.
2
-
3
- Rules:
4
- - Output ONLY a JSON object: {"entities": ["Entity One", ...], "relations": [["A", "uses", "B"], ...]}.
5
- - Entities are short, canonical noun phrases (project names, services, tools, people, technical concepts). Do NOT emit file or directory paths (anything containing "/" or "\") — they are dropped downstream.
6
- - Each relation is a 3-element array: [from, type, to]. Relations connect two entities that both appear in the entities array.
7
- - "type" is a short verb phrase (e.g. "uses", "depends on", "owns", "documents"). Use "" when unsure.
8
- - Drop pleasantries, meta-commentary, and timestamps.
9
- - Limit to at most {{MAX_ENTITIES}} entities and {{MAX_RELATIONS}} relations per asset.
10
- - Return {"entities": [], "relations": []} if the body has no extractable graph content.
11
- - DO NOT return markdown code blocks, ONLY valid JSON objects.
12
-
13
- Examples:
14
-
15
- Input:
16
- ## Deployment Notes
17
- The auth-service uses PostgreSQL for user sessions. It depends on the redis-cache
18
- for rate limiting. The terraform-provisioner deploys everything to the prod cluster.
19
- Owner: @alice.
20
-
21
- Output:
22
- {"entities":["auth-service","PostgreSQL","redis-cache","terraform-provisioner","prod cluster","@alice"],"relations":[["auth-service","uses","PostgreSQL"],["auth-service","depends on","redis-cache"],["terraform-provisioner","deploys","prod cluster"],["terraform-provisioner","deploys","auth-service"],["@alice","owns","auth-service"]]}
23
-
24
- Input:
25
- ## Meeting: API Redesign
26
- Discussed moving from REST to GraphQL. The frontend team will use Apollo Client.
27
- Backend needs to implement resolvers. Timeline: Q2.
28
-
29
- Output:
30
- {"entities":["REST","GraphQL","Apollo Client","frontend team","backend","resolvers","Q2"],"relations":[["frontend team","uses","Apollo Client"],["backend","implements","resolvers"],["frontend team","migrates to","GraphQL"]]}
31
-
32
- ===============
33
-
34
- Request:
35
-
@@ -1 +0,0 @@
1
- You are a metadata generator for a developer asset registry. Given a script/skill/command/agent entry, generate improved metadata. Respond with ONLY valid JSON, no markdown fencing.
@@ -1,4 +0,0 @@
1
- version: 4
2
- run: akm improve --strategy graph-refresh --skip-if-locked --require-engines
3
- description: Full-corpus graph rebuild (weekly Sunday 3:10am)
4
- schedule: "10 3 * * 0"