akm-cli 0.9.0-beta.57 → 0.9.0-beta.59

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 (56) hide show
  1. package/dist/assets/prompts/extract-session.md +5 -1
  2. package/dist/cli/config-migrate.js +7 -1
  3. package/dist/commands/config-cli.js +8 -11
  4. package/dist/commands/health/stash-exposure.js +46 -0
  5. package/dist/commands/health/windows.js +6 -7
  6. package/dist/commands/health.js +31 -10
  7. package/dist/commands/improve/collapse-detector.js +2 -1
  8. package/dist/commands/improve/consolidate/eligibility.js +0 -17
  9. package/dist/commands/improve/consolidate.js +209 -167
  10. package/dist/commands/improve/distill/promote-memory.js +4 -3
  11. package/dist/commands/improve/distill/quality-gate.js +7 -4
  12. package/dist/commands/improve/distill-promotion-policy.js +826 -167
  13. package/dist/commands/improve/distill.js +26 -12
  14. package/dist/commands/improve/extract-prompt.js +16 -2
  15. package/dist/commands/improve/extract.js +16 -8
  16. package/dist/commands/improve/improve-auto-accept.js +22 -1
  17. package/dist/commands/improve/loop-stages.js +7 -2
  18. package/dist/commands/improve/memory/memory-belief.js +14 -15
  19. package/dist/commands/improve/memory/memory-contradiction-detect.js +60 -32
  20. package/dist/commands/improve/memory/memory-improve.js +27 -27
  21. package/dist/commands/improve/preparation.js +6 -5
  22. package/dist/commands/improve/procedural.js +1 -0
  23. package/dist/commands/improve/recombine.js +3 -11
  24. package/dist/commands/improve/reflect-noise.js +1 -1
  25. package/dist/commands/improve/reflect.js +4 -3
  26. package/dist/commands/improve/shared.js +9 -6
  27. package/dist/commands/proposal/drain-policies.js +4 -2
  28. package/dist/commands/read/remember-cli.js +1 -1
  29. package/dist/commands/read/show.js +15 -0
  30. package/dist/commands/remember.js +11 -12
  31. package/dist/commands/sources/init.js +5 -1
  32. package/dist/commands/sources/stash-skeleton.js +34 -0
  33. package/dist/commands/tasks/default-tasks.js +3 -2
  34. package/dist/core/asset/frontmatter.js +22 -0
  35. package/dist/core/common.js +1 -15
  36. package/dist/core/config/config-io.js +10 -1
  37. package/dist/core/config/config-migration.js +2 -15
  38. package/dist/core/config/config-schema.js +15 -3
  39. package/dist/core/config/config.js +22 -14
  40. package/dist/core/paths.js +4 -4
  41. package/dist/core/time.js +53 -0
  42. package/dist/indexer/db/db.js +51 -46
  43. package/dist/indexer/graph/graph-extraction.js +1 -13
  44. package/dist/indexer/indexer.js +77 -65
  45. package/dist/indexer/search/db-search.js +41 -6
  46. package/dist/indexer/search/ranking-contributors.js +14 -8
  47. package/dist/indexer/search/search-source.js +15 -3
  48. package/dist/llm/feature-gate.js +4 -8
  49. package/dist/output/renderers.js +4 -0
  50. package/dist/scripts/migrate-storage.js +83 -59
  51. package/dist/scripts/migrations/import-fs-improve-runs-to-db.js +6 -0
  52. package/dist/storage/repositories/registry-cache.js +2 -1
  53. package/dist/storage/repositories/registry-index-cache-repository.js +46 -0
  54. package/dist/workflows/runtime/runs.js +6 -1
  55. package/package.json +1 -1
  56. package/dist/assets/tasks/core/update-stashes.yml +0 -4
@@ -107,14 +107,17 @@ export function buildJudgePrompt(lessonContent, sourceContent, similarLessons) {
107
107
  * `profiles.improve.default.processes.distill.qualityGate.enabled` (and the
108
108
  * corresponding `.reflect.qualityGate.enabled` for proposals).
109
109
  *
110
- * Fail-open: returns `pass: true` on timeout, parse failure, or missing LLM.
110
+ * Fail-CLOSED (07 P0-2): returns `pass: false` (score -1) on timeout, parse
111
+ * failure, or missing LLM. Minted content that cannot be judged is rejected,
112
+ * not passed through — an unverifiable judge must never wave content into the
113
+ * stash. The rejection is `quality_rejected`, not `review_needed`.
111
114
  */
112
115
  export async function runLessonQualityJudge(config, lessonContent, sourceContent, chat,
113
116
  /** D-4 / #390: top-3 similar existing lessons for dedup check. */
114
117
  similarLessons) {
115
118
  const llmConfig = getDefaultLlmConfig(config);
116
119
  if (!llmConfig) {
117
- return { pass: true, score: -1, reason: "no LLM configured — passing through" };
120
+ return { pass: false, score: -1, reason: "no LLM configured — cannot judge, failing closed" };
118
121
  }
119
122
  const judgeLlmConfig = llmConfig.judgeModel ? { ...llmConfig, model: llmConfig.judgeModel } : llmConfig;
120
123
  const JUDGE_TIMEOUT_MS = 8_000;
@@ -128,7 +131,7 @@ similarLessons) {
128
131
  ]);
129
132
  const parsed = parseEmbeddedJsonResponse(raw);
130
133
  if (!parsed || typeof parsed.score !== "number") {
131
- return { pass: true, score: -1, reason: "judge parse failed — passing through" };
134
+ return { pass: false, score: -1, reason: "judge parse failed — cannot judge, failing closed" };
132
135
  }
133
136
  // D-5 / #388: Three-band system (MT-Bench arXiv:2306.05685 — ~±0.5 judge variance).
134
137
  // >= 3.5: auto-queue as pending (pass: true)
@@ -146,7 +149,7 @@ similarLessons) {
146
149
  return { pass: false, score, reason };
147
150
  }
148
151
  catch {
149
- return { pass: true, score: -1, reason: "judge failedpassing through" };
152
+ return { pass: false, score: -1, reason: "judge timeout/errorcannot judge, failing closed" };
150
153
  }
151
154
  }
152
155
  // ── Quality-rejection helper ─────────────────────────────────────────────────