akm-cli 0.9.16 → 0.9.17-alpha.2

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 (50) hide show
  1. package/CHANGELOG.md +504 -0
  2. package/dist/assets/prompts/consolidate-system.md +4 -11
  3. package/dist/assets/prompts/graph-extract-user-prompt.md +5 -5
  4. package/dist/commands/health/accept-rate.js +6 -0
  5. package/dist/commands/health/checks.js +54 -0
  6. package/dist/commands/health/improve-metrics.js +1 -5
  7. package/dist/commands/health/report-view-model.js +0 -1
  8. package/dist/commands/health.js +10 -0
  9. package/dist/commands/improve/consolidate/chunking.js +19 -35
  10. package/dist/commands/improve/consolidate/merge.js +6 -9
  11. package/dist/commands/improve/consolidate.js +104 -91
  12. package/dist/commands/improve/distill/promote-memory.js +40 -2
  13. package/dist/commands/improve/distill/quality-gate.js +186 -23
  14. package/dist/commands/improve/distill.js +42 -8
  15. package/dist/commands/improve/eligibility.js +13 -3
  16. package/dist/commands/improve/improve-cli.js +32 -9
  17. package/dist/commands/improve/improve-strategies.js +23 -1
  18. package/dist/commands/improve/improve.js +121 -84
  19. package/dist/commands/improve/loop-stages.js +241 -108
  20. package/dist/commands/improve/preparation.js +50 -17
  21. package/dist/commands/improve/reflect.js +16 -5
  22. package/dist/commands/improve/shared.js +0 -10
  23. package/dist/commands/proposal/drain.js +79 -10
  24. package/dist/commands/proposal/proposal-types.js +21 -0
  25. package/dist/commands/proposal/repository.js +108 -29
  26. package/dist/commands/tasks/tasks.js +19 -2
  27. package/dist/core/asset/frontmatter.js +106 -1
  28. package/dist/core/config/config.js +5 -2
  29. package/dist/core/config/retired-experimental-keys-shim.js +62 -0
  30. package/dist/core/config/schema/improve-processes.js +29 -2
  31. package/dist/core/improve-result.js +9 -0
  32. package/dist/core/paths.js +7 -0
  33. package/dist/core/write-source.js +10 -2
  34. package/dist/indexer/ensure-index.js +52 -7
  35. package/dist/indexer/graph/graph-extraction.js +82 -8
  36. package/dist/indexer/passes/memory-inference.js +16 -1
  37. package/dist/llm/client.js +16 -2
  38. package/dist/llm/graph-extract.js +162 -18
  39. package/dist/scripts/akm-migrate-node.js +97 -36
  40. package/dist/scripts/akm-migrate.js +97 -36
  41. package/dist/storage/repositories/index-entries-repository.js +43 -0
  42. package/dist/storage/repositories/proposals-repository.js +4 -1
  43. package/dist/storage/state-db-integrity.js +123 -0
  44. package/dist/workflows/program/schema.js +1 -0
  45. package/docs/reference/cli.md +17 -7
  46. package/docs/reference/data-and-telemetry.md +1 -0
  47. package/package.json +1 -1
  48. package/schemas/akm-config.json +44 -0
  49. package/schemas/akm-workflow.json +1 -0
  50. package/dist/commands/improve/eval-cases.js +0 -52
@@ -154,6 +154,7 @@
154
154
  "content_policy_reject",
155
155
  "unsupported_type",
156
156
  "no_change",
157
+ "quality_rejected",
157
158
  "aborted"
158
159
  ]
159
160
  },
@@ -1,52 +0,0 @@
1
- // This Source Code Form is subject to the terms of the Mozilla Public
2
- // License, v. 2.0. If a copy of the MPL was not distributed with this
3
- // file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
- import fs from "node:fs";
5
- import path from "node:path";
6
- import { writeFileAtomic } from "../../core/common.js";
7
- import { getEvalCasesDir } from "../../core/paths.js";
8
- import { recordWrittenPath } from "../../core/write-provenance.js";
9
- export function writeEvalCase(stashDir, evalCase) {
10
- const evalDir = getEvalCasesDir(stashDir);
11
- fs.mkdirSync(evalDir, { recursive: true });
12
- const fileName = `${evalCase.slug}.md`;
13
- const filePath = path.join(evalDir, fileName);
14
- const content = `---
15
- ref: ${evalCase.ref}
16
- failureReason: ${evalCase.failureReason}
17
- assetType: ${evalCase.assetType}
18
- rejectedAt: ${evalCase.rejectedAt}
19
- source: ${evalCase.source}
20
- ---
21
-
22
- # Eval Case: ${evalCase.ref}
23
-
24
- **Failure reason:** ${evalCase.failureReason}
25
- **Source:** ${evalCase.source}
26
- **Asset type:** ${evalCase.assetType}
27
-
28
- This case was automatically captured when a distillation or proposal was rejected.
29
- Use it as a regression test: future improve runs on this ref should not produce
30
- output that would be rejected for the same reason.
31
- `;
32
- writeFileAtomic(filePath, content);
33
- // itlackey/akm#890: journal it even though it now lands under `$STATE`,
34
- // outside the stash's git repo — `result.writtenPaths` still reports it
35
- // (as an absolute path; see describeRunWrittenPaths in improve.ts), and
36
- // the auto-sync commit's own containment check already excludes anything
37
- // outside the stash from what gets staged, so recording it here cannot
38
- // cause it to be committed.
39
- recordWrittenPath(filePath);
40
- return filePath;
41
- }
42
- export function countEvalCases(stashDir) {
43
- const evalDir = getEvalCasesDir(stashDir);
44
- if (!fs.existsSync(evalDir))
45
- return 0;
46
- try {
47
- return fs.readdirSync(evalDir).filter((f) => f.endsWith(".md")).length;
48
- }
49
- catch {
50
- return 0;
51
- }
52
- }