akm-cli 0.10.261013-beta → 0.10.261015-beta

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 (479) hide show
  1. package/CHANGELOG.md +539 -3
  2. package/README.md +14 -0
  3. package/SECURITY.md +12 -11
  4. package/STABILITY.md +45 -49
  5. package/dist/assets/hints/cli-hints-full.md +15 -12
  6. package/dist/assets/opencode/akm-plugin.js +177 -0
  7. package/dist/assets/stash-skeleton/README.md +1 -1
  8. package/dist/assets/tasks/core/improve.yml +1 -1
  9. package/dist/assets/tasks/improve/akm-improve-consolidate.yml +1 -1
  10. package/dist/assets/ui/config.js +27 -10
  11. package/dist/assets/workflows/workflow-template.md +2 -2
  12. package/dist/cli/clack.js +3 -1
  13. package/dist/cli/selection.js +33 -0
  14. package/dist/cli/shared.js +14 -1
  15. package/dist/cli/unknown-flags.js +6 -37
  16. package/dist/cli.js +69 -48
  17. package/dist/commands/agent/agent-dispatch.js +17 -25
  18. package/dist/commands/agent/contribute-cli.js +9 -8
  19. package/dist/commands/command/command-cli.js +4 -8
  20. package/dist/commands/command/command-execution.js +25 -39
  21. package/dist/commands/completions.js +1 -1
  22. package/dist/commands/config-cli.js +14 -5
  23. package/dist/commands/env/child-env.js +12 -14
  24. package/dist/commands/env/env-cli.js +2 -2
  25. package/dist/commands/env/secret-cli.js +2 -2
  26. package/dist/commands/health/checks.js +10 -849
  27. package/dist/commands/health/connections-and-harnesses-check.js +109 -0
  28. package/dist/commands/health/egress.js +3 -3
  29. package/dist/commands/health/html-report.js +9 -10
  30. package/dist/commands/health/plugin-staleness.js +18 -11
  31. package/dist/commands/health/report-view-model.js +16 -12
  32. package/dist/commands/health/semantic-search-check.js +85 -0
  33. package/dist/commands/health/type-directory-check.js +0 -3
  34. package/dist/commands/health.js +30 -42
  35. package/dist/commands/improve/consolidate/pair-pass.js +10 -25
  36. package/dist/commands/improve/consolidate.js +10 -15
  37. package/dist/commands/improve/distill.js +5 -15
  38. package/dist/commands/improve/eligibility.js +1 -1
  39. package/dist/commands/improve/execution.js +37 -40
  40. package/dist/commands/improve/extract-cli.js +6 -11
  41. package/dist/commands/improve/extract-prompt.js +2 -2
  42. package/dist/commands/improve/extract.js +67 -97
  43. package/dist/commands/improve/improve-cli.js +22 -128
  44. package/dist/commands/improve/improve-report.js +1 -1
  45. package/dist/commands/improve/improve-strategies.js +25 -108
  46. package/dist/commands/improve/improve.js +10 -14
  47. package/dist/commands/improve/loop-stages.js +3 -0
  48. package/dist/commands/improve/memory/memory-improve.js +1 -1
  49. package/dist/commands/improve/preparation.js +8 -13
  50. package/dist/commands/improve/reflect.js +203 -332
  51. package/dist/commands/improve/retrieval-scope.js +1 -1
  52. package/dist/commands/improve/session-asset.js +3 -2
  53. package/dist/commands/improve/stage.js +87 -115
  54. package/dist/commands/lint/base-linter.js +3 -3
  55. package/dist/commands/lint/index.js +2 -2
  56. package/dist/commands/models-cli.js +103 -63
  57. package/dist/commands/proposal/drain.js +26 -39
  58. package/dist/commands/proposal/proposal-cli.js +14 -18
  59. package/dist/commands/proposal/propose-cli.js +4 -2
  60. package/dist/commands/proposal/propose.js +37 -64
  61. package/dist/commands/proposal/repository.js +17 -17
  62. package/dist/commands/proposal/validators/proposal-validators.js +2 -2
  63. package/dist/commands/read/curate.js +10 -6
  64. package/dist/commands/read/registry-search.js +2 -48
  65. package/dist/commands/read/search-cli.js +1 -8
  66. package/dist/commands/read/search.js +5 -6
  67. package/dist/commands/read/show.js +2 -4
  68. package/dist/commands/remember.js +25 -40
  69. package/dist/commands/sources/bundle-config-ops.js +2 -2
  70. package/dist/commands/sources/info.js +12 -1
  71. package/dist/commands/sources/init.js +1 -1
  72. package/dist/commands/sources/installed-stashes.js +2 -2
  73. package/dist/commands/sources/migration-help.js +1 -1
  74. package/dist/commands/sources/plugin-upgrade.js +8 -15
  75. package/dist/commands/sources/schema-repair.js +4 -8
  76. package/dist/commands/sources/source-add.js +2 -2
  77. package/dist/commands/sources/source-manage.js +4 -4
  78. package/dist/commands/targets.js +175 -0
  79. package/dist/commands/tasks/explain.js +103 -68
  80. package/dist/commands/tasks/tasks-cli.js +9 -11
  81. package/dist/commands/tasks/tasks.js +37 -41
  82. package/dist/commands/ui/api.js +11 -3
  83. package/dist/commands/ui/redact.js +1 -27
  84. package/dist/commands/ui/workspace-actions.js +1 -1
  85. package/dist/commands/workflow/plan.js +1 -1
  86. package/dist/commands/workflow-cli.js +3 -4
  87. package/dist/core/adapter/adapters/agent-skills-adapter.js +10 -11
  88. package/dist/core/adapter/adapters/akm-adapter.js +33 -38
  89. package/dist/core/adapter/adapters/akm-lint.js +7 -8
  90. package/dist/core/adapter/adapters/akm-task-adapter.js +3 -3
  91. package/dist/core/adapter/adapters/akm-workflow-adapter.js +5 -5
  92. package/dist/core/adapter/adapters/claude-adapter.js +1 -1
  93. package/dist/core/adapter/adapters/dotenv-adapter.js +3 -3
  94. package/dist/core/adapter/adapters/generic-files-adapter.js +5 -5
  95. package/dist/core/adapter/adapters/index.js +3 -4
  96. package/dist/core/adapter/adapters/llm-wiki-adapter.js +12 -14
  97. package/dist/core/adapter/adapters/okf-adapter.js +8 -10
  98. package/dist/core/adapter/adapters/opencode-adapter.js +1 -1
  99. package/dist/core/adapter/adapters/shared.js +3 -3
  100. package/dist/core/adapter/adapters/tool-dir-shared.js +7 -25
  101. package/dist/core/adapter/adapters/website-snapshot-adapter.js +3 -3
  102. package/dist/core/adapter/detect-adapter.js +1 -1
  103. package/dist/core/adapter/execution-source.js +13 -35
  104. package/dist/core/adapter/registry.js +1 -1
  105. package/dist/core/adapter/validate-context.js +2 -4
  106. package/dist/core/asset/asset-placement.js +1 -1
  107. package/dist/core/asset/asset-ref.js +3 -3
  108. package/dist/core/closest-match.js +37 -0
  109. package/dist/core/common.js +33 -5
  110. package/dist/core/config/config-io.js +26 -18
  111. package/dist/core/config/config-schema.js +19 -106
  112. package/dist/core/config/config-sources.js +3 -3
  113. package/dist/core/config/config-types.js +4 -4
  114. package/dist/core/config/config-walker.js +50 -77
  115. package/dist/core/config/config.js +385 -93
  116. package/dist/core/config/convert-engine-references.js +114 -0
  117. package/dist/core/config/convert-engines-shared.js +40 -0
  118. package/dist/core/config/convert-engines.js +300 -0
  119. package/dist/core/config/convert-models-overlay.js +137 -0
  120. package/dist/core/config/credentials.js +304 -0
  121. package/dist/core/config/engine-semantics.js +3 -3
  122. package/dist/core/config/migrate-keys.js +222 -0
  123. package/dist/core/config/model-aliases.js +37 -0
  124. package/dist/core/config/models-file.js +34 -0
  125. package/dist/core/config/retired-engines.js +53 -0
  126. package/dist/core/config/schema/connections.js +41 -0
  127. package/dist/core/config/schema/embedding.js +2 -2
  128. package/dist/core/config/schema/harnesses.js +41 -0
  129. package/dist/core/config/schema/improve-processes.js +9 -28
  130. package/dist/core/config/schema/improve.js +36 -1
  131. package/dist/core/config/schema/index-config.js +18 -20
  132. package/dist/core/config/schema/primitives.js +41 -22
  133. package/dist/core/config/schema/search.js +6 -11
  134. package/dist/core/config/schema/sources-bundles.js +7 -7
  135. package/dist/core/config/schema/workflow.js +2 -6
  136. package/dist/core/config/unusable-entries.js +66 -0
  137. package/dist/core/content-safety.js +3 -6
  138. package/dist/core/endpoint-url.js +47 -0
  139. package/dist/core/errors.js +9 -15
  140. package/dist/core/extra-params.js +3 -3
  141. package/dist/core/improve-result.js +8 -9
  142. package/dist/core/json-schema.js +1 -1
  143. package/dist/core/lesson-lint.js +1 -1
  144. package/dist/core/llm-inference.js +80 -0
  145. package/dist/core/npm-package.js +89 -0
  146. package/dist/core/parse.js +2 -2
  147. package/dist/core/paths.js +32 -4
  148. package/dist/core/recognition-util.js +8 -10
  149. package/dist/core/redaction.js +78 -52
  150. package/dist/core/state/migrations.js +17 -22
  151. package/dist/core/structured.js +2 -68
  152. package/dist/core/subprocess.js +63 -22
  153. package/dist/core/tar.js +116 -0
  154. package/dist/core/type-presentation.js +10 -14
  155. package/dist/execution/input-contract.js +3 -6
  156. package/dist/execution/notices.js +49 -0
  157. package/dist/execution/resolved-request.js +24 -40
  158. package/dist/execution/source.js +21 -45
  159. package/dist/execution/target-ref.js +2 -2
  160. package/dist/indexer/bundle-identity-guard.js +6 -5
  161. package/dist/indexer/ensure-index.js +1 -1
  162. package/dist/indexer/index-writer-lock.js +1 -1
  163. package/dist/indexer/indexer.js +19 -6
  164. package/dist/indexer/installations.js +11 -14
  165. package/dist/indexer/materialize-embeddings.js +20 -16
  166. package/dist/indexer/passes/memory-inference.js +21 -50
  167. package/dist/indexer/passes/metadata.js +5 -5
  168. package/dist/indexer/scan/doc-to-entry.js +1 -1
  169. package/dist/indexer/scan/drain-dir.js +6 -8
  170. package/dist/indexer/search/db-search.js +9 -7
  171. package/dist/indexer/search/search-source.js +40 -22
  172. package/dist/indexer/usage/usage-events.js +2 -3
  173. package/dist/indexer/walk/index-context.js +2 -1
  174. package/dist/indexer/walk/matchers.js +3 -11
  175. package/dist/indexer/walk/walker.js +14 -4
  176. package/dist/integrations/agent/akm-read-tools.js +81 -0
  177. package/dist/integrations/agent/config.js +1 -1
  178. package/dist/integrations/agent/detect.js +32 -36
  179. package/dist/integrations/agent/execution.js +130 -428
  180. package/dist/integrations/agent/index.js +1 -1
  181. package/dist/integrations/agent/profiles.js +24 -28
  182. package/dist/integrations/agent/prompts.js +17 -30
  183. package/dist/integrations/agent/request-lowering.js +67 -101
  184. package/dist/integrations/agent/resolution.js +332 -0
  185. package/dist/integrations/agent/runner-dispatch.js +154 -178
  186. package/dist/integrations/agent/runner.js +20 -72
  187. package/dist/integrations/agent/runtime-port.js +4 -0
  188. package/dist/integrations/agent/runtime.js +10 -0
  189. package/dist/integrations/agent/spawn.js +65 -190
  190. package/dist/integrations/harnesses/aider/index.js +19 -39
  191. package/dist/integrations/harnesses/amazonq/index.js +17 -32
  192. package/dist/integrations/harnesses/claude/index.js +59 -28
  193. package/dist/integrations/harnesses/claude/session-log.js +7 -5
  194. package/dist/integrations/harnesses/codex/index.js +19 -31
  195. package/dist/integrations/harnesses/copilot/index.js +17 -35
  196. package/dist/integrations/harnesses/gemini/index.js +18 -34
  197. package/dist/integrations/harnesses/harness.js +36 -0
  198. package/dist/integrations/harnesses/index.js +20 -51
  199. package/dist/integrations/harnesses/opencode/agent-builder.js +132 -100
  200. package/dist/integrations/harnesses/opencode/index.js +11 -33
  201. package/dist/integrations/harnesses/opencode/roots.js +50 -0
  202. package/dist/integrations/harnesses/opencode/runtime/binary.js +139 -0
  203. package/dist/integrations/harnesses/opencode/runtime/command.js +152 -0
  204. package/dist/integrations/harnesses/opencode/runtime/index.js +181 -0
  205. package/dist/integrations/harnesses/opencode/session-log-v1.js +15 -7
  206. package/dist/integrations/harnesses/opencode/session-log-v2.js +72 -48
  207. package/dist/integrations/harnesses/opencode/session-log.js +58 -137
  208. package/dist/integrations/harnesses/opencode/version.js +34 -53
  209. package/dist/integrations/harnesses/openhands/index.js +13 -37
  210. package/dist/integrations/harnesses/pi/index.js +21 -32
  211. package/dist/integrations/lockfile.js +1 -1
  212. package/dist/integrations/session-logs/index.js +11 -31
  213. package/dist/llm/client.js +93 -111
  214. package/dist/llm/embedder.js +19 -34
  215. package/dist/llm/embedders/connection.js +31 -0
  216. package/dist/llm/embedders/local-model-files.js +56 -0
  217. package/dist/llm/embedders/local.js +111 -115
  218. package/dist/llm/embedders/onnx-runtime.js +121 -0
  219. package/dist/llm/embedders/remote.js +26 -24
  220. package/dist/llm/embedders/types.js +1 -1
  221. package/dist/llm/index-passes.js +33 -39
  222. package/dist/llm/memory-infer.js +67 -77
  223. package/dist/llm/model-list.js +35 -0
  224. package/dist/llm/rerank-client.js +8 -14
  225. package/dist/llm/structured-call.js +45 -99
  226. package/dist/llm/structured.js +60 -0
  227. package/dist/output/renderers.js +2 -7
  228. package/dist/output/shapes/helpers.js +18 -42
  229. package/dist/output/shapes/passthrough.js +1 -0
  230. package/dist/output/shapes.js +1 -7
  231. package/dist/output/text/command-format.js +29 -37
  232. package/dist/output/text/health-format.js +8 -2
  233. package/dist/output/text/helpers.js +1 -1
  234. package/dist/output/text/migrate.js +12 -0
  235. package/dist/output/text/models.js +3 -2
  236. package/dist/output/text/registry-commands.js +1 -2
  237. package/dist/output/text/show-format.js +0 -2
  238. package/dist/output/text/targets-table.js +70 -0
  239. package/dist/output/text/workflow-format.js +7 -8
  240. package/dist/output/text.js +1 -1
  241. package/dist/registry/providers/skills-sh.js +1 -28
  242. package/dist/registry/providers/static-index.js +1 -71
  243. package/dist/runtime.js +6 -2
  244. package/dist/scripts/akm-migrate-node.js +5197 -4193
  245. package/dist/scripts/akm-migrate.js +5197 -4193
  246. package/dist/setup/detect.js +28 -273
  247. package/dist/setup/endpoint.js +36 -0
  248. package/dist/setup/semantic-assets.js +18 -21
  249. package/dist/setup/setup-flags.js +77 -0
  250. package/dist/setup/setup-plan.js +144 -0
  251. package/dist/setup/setup.js +184 -354
  252. package/dist/setup/steps/connection-shared.js +49 -101
  253. package/dist/setup/steps/connection.js +121 -524
  254. package/dist/setup/steps/embeddings.js +168 -0
  255. package/dist/setup/steps/harnesses.js +118 -0
  256. package/dist/setup/steps/platforms.js +2 -81
  257. package/dist/setup/steps.js +10 -0
  258. package/dist/setup/summary.js +67 -0
  259. package/dist/sources/freshness.js +16 -21
  260. package/dist/sources/providers/git-provider.js +2 -9
  261. package/dist/sources/providers/provider-utils.js +1 -5
  262. package/dist/sources/snapshot-fetchers/robots.js +11 -12
  263. package/dist/sources/snapshot-fetchers/website-ingest.js +8 -15
  264. package/dist/storage/database.js +17 -57
  265. package/dist/storage/repositories/improve-ledger-repository.js +1 -1
  266. package/dist/storage/repositories/improve-runs-repository.js +0 -13
  267. package/dist/storage/repositories/index-entries-repository.js +2 -2
  268. package/dist/storage/repositories/workflow-runs-repository.js +8 -15
  269. package/dist/storage/sqlite-read-snapshot.js +33 -29
  270. package/dist/tasks/log-redaction.js +7 -119
  271. package/dist/tasks/prepare/prepare-support.js +5 -5
  272. package/dist/tasks/prepare/prepare.js +5 -5
  273. package/dist/tasks/prepare/script-capture.js +3 -5
  274. package/dist/tasks/run/attempt-lifecycle.js +17 -35
  275. package/dist/tasks/run/load-task.js +8 -13
  276. package/dist/tasks/run/run-command-task.js +15 -10
  277. package/dist/tasks/run/run-native-task.js +8 -13
  278. package/dist/tasks/run/run-task.js +5 -8
  279. package/dist/tasks/run/run-workflow-task.js +12 -19
  280. package/dist/tasks/run/task-history.js +9 -17
  281. package/dist/tasks/run/task-log.js +1 -5
  282. package/dist/tasks/scheduler-invocation.js +13 -18
  283. package/dist/tasks/source/bounded-document.js +31 -76
  284. package/dist/tasks/source/project-v4.js +5 -3
  285. package/dist/tasks/source/task-input-diagnostics.js +3 -4
  286. package/dist/tasks/source/task-source-v4.js +47 -68
  287. package/dist/tasks/source-v3.js +2 -5
  288. package/dist/tasks/task-run-reserved-flags.js +1 -2
  289. package/dist/workflows/authoring/authoring.js +2 -7
  290. package/dist/workflows/concurrency-policy.js +4 -4
  291. package/dist/workflows/exec/child-workflow.js +0 -2
  292. package/dist/workflows/exec/dispatch-redaction.js +14 -83
  293. package/dist/workflows/exec/environment.js +2 -3
  294. package/dist/workflows/exec/exec-unit.js +10 -59
  295. package/dist/workflows/exec/frozen-judge.js +10 -26
  296. package/dist/workflows/exec/native-executor.js +56 -45
  297. package/dist/workflows/exec/run-workflow.js +7 -24
  298. package/dist/workflows/exec/step-work.js +9 -14
  299. package/dist/workflows/exec/unit-dispatch.js +6 -13
  300. package/dist/workflows/freeze/freeze.js +14 -32
  301. package/dist/workflows/freeze/step-values.js +5 -11
  302. package/dist/workflows/freeze/targets/command.js +3 -6
  303. package/dist/workflows/freeze/task-bindings.js +0 -1
  304. package/dist/workflows/parser.js +44 -34
  305. package/dist/workflows/plan.js +3 -1
  306. package/dist/workflows/renderer.js +6 -5
  307. package/dist/workflows/resource-limits.js +2 -2
  308. package/dist/workflows/runtime/run-plan.js +2 -1
  309. package/dist/workflows/runtime/runs.js +14 -9
  310. package/docs/README.md +10 -16
  311. package/docs/architecture/README.md +2 -37
  312. package/docs/architecture/adapters.md +2 -2
  313. package/docs/architecture/akm-core-principles.md +257 -118
  314. package/docs/architecture/architecture.md +282 -98
  315. package/docs/architecture/improvement.md +8 -2
  316. package/docs/architecture/internals/classification.md +1 -3
  317. package/docs/architecture/internals/fresh-host-rebuild-runbook.md +7 -6
  318. package/docs/architecture/internals/health-advisories.md +35 -74
  319. package/docs/architecture/internals/improve-workflow.md +27 -26
  320. package/docs/architecture/internals/indexing.md +3 -3
  321. package/docs/architecture/internals/storage-locations.md +46 -12
  322. package/docs/architecture/persisted-data-compat.md +9 -6
  323. package/docs/architecture/specs/okf-support.md +9 -11
  324. package/docs/architecture/specs/ref.md +7 -9
  325. package/docs/architecture/testing/testing-workflow.md +173 -42
  326. package/docs/architecture/workflow-engine.md +17 -14
  327. package/docs/guides/README.md +0 -1
  328. package/docs/guides/author-bundles.md +1 -3
  329. package/docs/guides/author-workflows.md +61 -73
  330. package/docs/guides/bundles.md +4 -5
  331. package/docs/guides/discover-and-load.md +1 -1
  332. package/docs/guides/getting-started.md +51 -3
  333. package/docs/guides/improve-the-library.md +10 -4
  334. package/docs/guides/recipes/headless-install.md +21 -21
  335. package/docs/guides/run-workflows.md +6 -9
  336. package/docs/guides/scheduling.md +2 -2
  337. package/docs/guides/use-with-any-agent.md +20 -22
  338. package/docs/integration/bundling-akm.md +19 -9
  339. package/docs/maintainers/README.md +0 -3
  340. package/docs/migration/README.md +10 -3
  341. package/docs/migration/release-notes/0.10.0.md +81 -16
  342. package/docs/migration/release-notes/0.6.0.md +1 -1
  343. package/docs/migration/release-notes/0.7.0.md +1 -1
  344. package/docs/migration/release-notes/0.9.0.md +1 -1
  345. package/docs/migration/release-notes/README.md +1 -1
  346. package/docs/migration/v0.9-to-v0.10.md +312 -59
  347. package/docs/migration/v0.9.1-to-v0.9.2.md +6 -5
  348. package/docs/posts/config-v2-lessons-16.md +1 -1
  349. package/docs/posts/llm-mode-reflect-13.md +1 -1
  350. package/docs/posts/release-0.6.0.md +11 -11
  351. package/docs/posts/release-0.8.0.md +4 -4
  352. package/docs/posts/workflows-vaults-09.md +1 -1
  353. package/docs/reference/README.md +1 -1
  354. package/docs/reference/asset-types.md +2 -2
  355. package/docs/reference/cli.md +367 -279
  356. package/docs/reference/configuration.md +591 -557
  357. package/docs/reference/data-and-telemetry.md +8 -5
  358. package/docs/reference/env-and-secrets.md +11 -5
  359. package/docs/reference/refs.md +3 -20
  360. package/docs/reference/registry.md +6 -27
  361. package/docs/reference/supported-formats.md +1 -1
  362. package/docs/reference/tasks.md +11 -8
  363. package/docs/reference/ui-api.md +11 -6
  364. package/docs/reference/workflow-schema.md +106 -134
  365. package/docs/reference/workflows.md +4 -6
  366. package/package.json +9 -14
  367. package/schemas/akm-config.json +1696 -2922
  368. package/schemas/akm-task.json +2 -0
  369. package/schemas/akm-workflow.json +36 -9
  370. package/ROADMAP.md +0 -112
  371. package/dist/assets/models.json +0 -35
  372. package/dist/commands/health/engine-usage.js +0 -45
  373. package/dist/core/config/schema/engines.js +0 -160
  374. package/dist/core/config/schema/execution.js +0 -23
  375. package/dist/core/spawn-env.js +0 -268
  376. package/dist/integrations/agent/builder-shared.js +0 -33
  377. package/dist/integrations/agent/builders.js +0 -43
  378. package/dist/integrations/agent/engine-fallback.js +0 -59
  379. package/dist/integrations/agent/engine-resolution.js +0 -335
  380. package/dist/integrations/agent/model-map.js +0 -475
  381. package/dist/integrations/harnesses/aider/agent-builder.js +0 -107
  382. package/dist/integrations/harnesses/aider/result-extractor.js +0 -53
  383. package/dist/integrations/harnesses/amazonq/agent-builder.js +0 -138
  384. package/dist/integrations/harnesses/amazonq/result-extractor.js +0 -48
  385. package/dist/integrations/harnesses/claude/agent-builder.js +0 -106
  386. package/dist/integrations/harnesses/claude/config-import.js +0 -67
  387. package/dist/integrations/harnesses/claude/result-extractor.js +0 -67
  388. package/dist/integrations/harnesses/codex/agent-builder.js +0 -150
  389. package/dist/integrations/harnesses/codex/result-extractor.js +0 -110
  390. package/dist/integrations/harnesses/copilot/agent-builder.js +0 -117
  391. package/dist/integrations/harnesses/copilot/result-extractor.js +0 -178
  392. package/dist/integrations/harnesses/gemini/agent-builder.js +0 -114
  393. package/dist/integrations/harnesses/gemini/result-extractor.js +0 -149
  394. package/dist/integrations/harnesses/opencode/config-import.js +0 -149
  395. package/dist/integrations/harnesses/opencode/model-config.js +0 -33
  396. package/dist/integrations/harnesses/opencode/model-work-agent.js +0 -115
  397. package/dist/integrations/harnesses/opencode/session-log-types.js +0 -12
  398. package/dist/integrations/harnesses/opencode-sdk/index.js +0 -44
  399. package/dist/integrations/harnesses/opencode-sdk/sdk-runner.js +0 -1052
  400. package/dist/integrations/harnesses/opencode-sdk/v1-adapter.js +0 -199
  401. package/dist/integrations/harnesses/opencode-sdk/v2-adapter.js +0 -254
  402. package/dist/integrations/harnesses/opencode-sdk/wire.js +0 -66
  403. package/dist/integrations/harnesses/openhands/agent-builder.js +0 -120
  404. package/dist/integrations/harnesses/openhands/result-extractor.js +0 -135
  405. package/dist/integrations/harnesses/pi/agent-builder.js +0 -89
  406. package/dist/integrations/harnesses/pi/result-extractor.js +0 -168
  407. package/dist/integrations/harnesses/shared.js +0 -18
  408. package/dist/integrations/harnesses/types.js +0 -55
  409. package/dist/llm/feature-gate.js +0 -115
  410. package/dist/output/shapes/models-list.js +0 -16
  411. package/dist/output/shapes/registry-search.js +0 -10
  412. package/dist/setup/detected-engines.js +0 -136
  413. package/dist/setup/engine-config.js +0 -97
  414. package/dist/setup/harness-config-import.js +0 -47
  415. package/dist/setup/providers.js +0 -14
  416. package/dist/setup/steps/semantic.js +0 -39
  417. package/dist/workflows/exec/lowering-notices.js +0 -23
  418. package/docs/architecture/0.10-process-rules.md +0 -832
  419. package/docs/architecture/akm-architecture-decision-history.md +0 -2055
  420. package/docs/architecture/comparisons/claude-code-vs-akm-workflows-full.md +0 -544
  421. package/docs/architecture/decisions/0001-no-interpolation-attached-structured-context.md +0 -72
  422. package/docs/architecture/decisions/0002-unit-reuse-and-input-hash-scope.md +0 -142
  423. package/docs/architecture/decisions/0003-child-env-allowlist-and-provenance.md +0 -187
  424. package/docs/architecture/decisions/0004-task-input-contract-and-flag-coercion.md +0 -97
  425. package/docs/architecture/decisions/0005-task-result-vocabulary-and-legacy-read-mapping.md +0 -108
  426. package/docs/architecture/decisions/0006-task-source-version-routing.md +0 -124
  427. package/docs/architecture/decisions/0007-workflow-composition-bounds.md +0 -83
  428. package/docs/architecture/decisions/0008-task-binding-normalization.md +0 -88
  429. package/docs/architecture/decisions/0009-child-run-publication-column-parity.md +0 -80
  430. package/docs/architecture/decisions/0010-driver-protocol-cut.md +0 -36
  431. package/docs/architecture/decisions/0011-engine-run-loop-invariants.md +0 -125
  432. package/docs/architecture/decisions/README.md +0 -62
  433. package/docs/architecture/internals/functional-contract-patterns.md +0 -340
  434. package/docs/architecture/internals/registry-network-boundary.md +0 -57
  435. package/docs/architecture/internals/search.md +0 -248
  436. package/docs/architecture/reviews/env-secret-access.md +0 -319
  437. package/docs/architecture/runtime-boundary-design.md +0 -153
  438. package/docs/architecture/specs/0.9.0-close-out-plan.md +0 -361
  439. package/docs/architecture/specs/0.9.0-decisions.md +0 -532
  440. package/docs/architecture/specs/0.9.0-docs-code-drift-register.md +0 -745
  441. package/docs/architecture/specs/0.9.0-open-items-register.md +0 -135
  442. package/docs/architecture/specs/0.9.0-public-api-issue-backlog.md +0 -740
  443. package/docs/architecture/specs/0.9.0-release-surface-review.md +0 -636
  444. package/docs/architecture/specs/agent-command-engine-model-design.md +0 -513
  445. package/docs/architecture/specs/akm-0.9.0-bundle-adapter-spec.md +0 -501
  446. package/docs/architecture/specs/akm-0.9.0-ref-grammar-decision.md +0 -291
  447. package/docs/architecture/specs/akm-format-neutral-bundle-workspace-spec.md +0 -2059
  448. package/docs/architecture/specs/di-seams-plan.md +0 -539
  449. package/docs/architecture/specs/driver-protocol-keep-or-cut.md +0 -275
  450. package/docs/architecture/specs/fact-asset-type.md +0 -142
  451. package/docs/architecture/specs/improve-collapse-churn-detector-design.md +0 -634
  452. package/docs/architecture/specs/reviews/task-workflow-unification/README.md +0 -72
  453. package/docs/architecture/specs/reviews/task-workflow-unification/findings-consolidated.md +0 -152
  454. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-alternatives.md +0 -352
  455. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-bunqueue.md +0 -300
  456. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-openworkflow.md +0 -402
  457. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-1.md +0 -758
  458. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-2.md +0 -645
  459. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-3.md +0 -602
  460. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-adversarial.md +0 -27
  461. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-architecture.md +0 -27
  462. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-coverage.md +0 -74
  463. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-security.md +0 -15
  464. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r2-adversarial.md +0 -132
  465. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r2-verification.md +0 -147
  466. package/docs/architecture/specs/stash-conventions-code-spec.md +0 -275
  467. package/docs/architecture/specs/stash-organization-conventions.md +0 -377
  468. package/docs/architecture/specs/task-workflow-format-unification.md +0 -721
  469. package/docs/architecture/specs/workflow-engine-buy-vs-build.md +0 -231
  470. package/docs/architecture/specs/workflow-format-unification.md +0 -432
  471. package/docs/architecture/testing/manual-testing-checklist.md +0 -3379
  472. package/docs/architecture/testing/okf-v0.2-conformance-runbook.md +0 -924
  473. package/docs/architecture/testing/task-workflow-manual-tests.md +0 -1702
  474. package/docs/guides/claude-code-vs-akm-workflows.md +0 -29
  475. package/docs/guides/knowledge-management.md +0 -18
  476. package/docs/maintainers/curate-workmap.md +0 -335
  477. package/docs/migration/v0.5-to-v0.6.md +0 -759
  478. package/docs/migration/v0.7-to-v0.8.md +0 -1378
  479. package/docs/plans/0.9.2-agent-command-workflow-plan.md +0 -423
@@ -4,7 +4,6 @@
4
4
  import { createHash } from "node:crypto";
5
5
  import { prepareCommandInvocation } from "../../../commands/command/command-execution.js";
6
6
  import { canonicalResolvedExecutionRequest, } from "../../../execution/resolved-request.js";
7
- import { fallbackAnnouncement } from "../../../integrations/agent/engine-fallback.js";
8
7
  import { buildExecution } from "../../../integrations/agent/execution.js";
9
8
  import { freezeEnvironment } from "../environment.js";
10
9
  import { durableRequest, executionUnitValues, targetConcurrency, } from "../step-values.js";
@@ -24,8 +23,8 @@ export function commandResult(source, baseUnit, prepared, context, literals = []
24
23
  const runner = lowered.runner;
25
24
  const unit = {
26
25
  ...baseUnit,
27
- engine: request.engine.name,
28
- ...(request.model ? { model: request.model.resolved } : {}),
26
+ engine: request.target.name,
27
+ ...(request.model ? { model: request.model.model } : {}),
29
28
  ...(Object.hasOwn(request.runtime, "timeoutMs") ? { timeoutMs: request.runtime.timeoutMs } : {}),
30
29
  ...(request.inference ? { llm: request.inference } : {}),
31
30
  ...(request.outputSchema ? { output: request.outputSchema } : {}),
@@ -37,17 +36,15 @@ export function commandResult(source, baseUnit, prepared, context, literals = []
37
36
  contentHash: createHash("sha256").update(request.command.content).digest("hex"),
38
37
  request: JSON.parse(canonicalResolvedExecutionRequest(request)),
39
38
  runner,
40
- ...(targetConcurrency(runner, context.config) ? { concurrency: targetConcurrency(runner, context.config) } : {}),
39
+ ...(targetConcurrency(runner) ? { concurrency: targetConcurrency(runner) } : {}),
41
40
  // Not a location. akm 0.10.0 and earlier decode a command-only plan and run it in the invoking directory,
42
41
  // but their dispatch refuses a directory identity it cannot verify, so they stop here instead.
43
42
  cwdIdentity: {},
44
43
  });
45
- const engineAnnouncement = fallbackAnnouncement(prepared.fallbackEngineName, request.engine.name);
46
44
  return {
47
45
  target,
48
46
  environment,
49
47
  unit,
50
48
  instructions: request.command.content,
51
- ...(engineAnnouncement ? { engineAnnouncement } : {}),
52
49
  };
53
50
  }
@@ -6,7 +6,6 @@
6
6
  * {@link freezeTaskInputBindings} classifies an authored `with:` against a
7
7
  * child workflow's `params:` contract. A reference's resolved value is
8
8
  * validated before each attempt (`exec/step-work.ts`).
9
- * See docs/architecture/decisions/0008-task-binding-normalization.md.
10
9
  */
11
10
  import { isRecord } from "../../core/common.js";
12
11
  import { UsageError } from "../../core/errors.js";
@@ -38,7 +38,9 @@ import { parseMarkdownToc } from "../core/asset/markdown.js";
38
38
  import { isRecord } from "../core/common.js";
39
39
  import { formatExtraParamsIssue, validateExtraParams } from "../core/extra-params.js";
40
40
  import { checkJsonSchemaDefinition, JSON_SCHEMA_SUBSET_SUPPORTED_KEYWORDS } from "../core/json-schema.js";
41
+ import { warnOnce } from "../core/warn.js";
41
42
  import { INPUT_NAME_PATTERN } from "../execution/input-contract.js";
43
+ import { warnRetiredEngineKey } from "../execution/source.js";
42
44
  import { classifyTargetRef } from "../execution/target-ref.js";
43
45
  import { WORKFLOW_PLAN_VERSION, } from "./plan.js";
44
46
  import { parseReference } from "./program/expressions.js";
@@ -88,13 +90,15 @@ const ENVELOPE_KEYS = [
88
90
  ];
89
91
  const WORKFLOW_KEYS = ["params", "defaults", "budget", "steps"];
90
92
  const TOP_LEVEL_KEYS = [...ENVELOPE_KEYS, ...WORKFLOW_KEYS];
91
- const DEFAULTS_KEYS = ["engine", "model", "timeout", "on_error", "llm"];
93
+ const DEFAULTS_KEYS = ["connection", "harness", "engine", "model", "timeout", "on_error", "llm"];
92
94
  const BUDGET_KEYS = ["max_tokens", "max_units"];
93
95
  const STEP_KEYS = ["id", "unit", "map", "inputs", "output", "gate"];
94
96
  const UNIT_KEYS = [
95
97
  "exec",
96
98
  "workflow",
97
99
  "with",
100
+ "connection",
101
+ "harness",
98
102
  "engine",
99
103
  "model",
100
104
  "llm",
@@ -105,8 +109,8 @@ const UNIT_KEYS = [
105
109
  "env",
106
110
  ];
107
111
  const EXEC_KEYS = ["command", "cwd", "pass_env"];
108
- /** Unit keys that name an ENGINE dispatch and therefore cannot appear beside `exec:`. */
109
- const UNIT_ENGINE_KEYS = ["engine", "model", "llm"];
112
+ /** Unit keys that name a model or agent dispatch and therefore cannot appear beside `exec:`. `engine` is the retired spelling of `connection` / `harness`. */
113
+ const UNIT_ENGINE_KEYS = ["connection", "harness", "engine", "model", "llm"];
110
114
  const MAP_KEYS = ["over", "concurrency", "reducer", "unit"];
111
115
  const RETRY_KEYS = ["max", "on"];
112
116
  const GATE_KEYS = ["max_loops"];
@@ -523,10 +527,14 @@ function parseDefaults(ctx, raw) {
523
527
  }
524
528
  checkUnknownKeys(ctx, raw, path, DEFAULTS_KEYS, `"defaults"`);
525
529
  const defaults = {};
526
- if (raw.engine !== undefined) {
527
- const engine = parseEngineName(ctx, raw.engine, [...path, "engine"], `"defaults.engine"`);
528
- if (engine !== undefined)
529
- defaults.engine = engine;
530
+ for (const key of ["connection", "harness", "engine"]) {
531
+ if (raw[key] === undefined)
532
+ continue;
533
+ const name = parseEngineName(ctx, raw[key], [...path, key], `"defaults.${key}"`);
534
+ if (name !== undefined)
535
+ defaults[key] = name;
536
+ if (key === "engine")
537
+ warnRetiredEngineKey();
530
538
  }
531
539
  if (raw.model !== undefined) {
532
540
  if (typeof raw.model === "string" && raw.model.trim() !== "")
@@ -654,7 +662,7 @@ function parseUnit(ctx, raw, path, stepLabel, allowWorkflow = true) {
654
662
  const exec = parseExec(ctx, raw.exec, [...path, "exec"], stepLabel);
655
663
  if (exec !== undefined)
656
664
  unit.exec = exec;
657
- // An exec unit dispatches no engine call, so every engine-selection key is
665
+ // An exec unit dispatches no model call, so every connection or harness selection key is
658
666
  // a contradiction rather than a harmless extra. Reported per key so the
659
667
  // author sees exactly which line to delete.
660
668
  for (const key of UNIT_ENGINE_KEYS) {
@@ -671,7 +679,7 @@ function parseUnit(ctx, raw, path, stepLabel, allowWorkflow = true) {
671
679
  if (raw.exec !== undefined) {
672
680
  ctx.err([...path, "workflow"], `${stepLabel} "unit" declares both "exec" and "workflow" — a unit runs one or the other.`);
673
681
  }
674
- // A workflow unit starts a child run: it reaches no engine and the child carries its own environment.
682
+ // A workflow unit starts a child run: it reaches no model and the child carries its own environment.
675
683
  for (const key of [...UNIT_ENGINE_KEYS, "env"]) {
676
684
  if (raw[key] === undefined)
677
685
  continue;
@@ -690,10 +698,14 @@ function parseUnit(ctx, raw, path, stepLabel, allowWorkflow = true) {
690
698
  unit.with = raw.with;
691
699
  }
692
700
  }
693
- if (raw.engine !== undefined) {
694
- const engine = parseEngineName(ctx, raw.engine, [...path, "engine"], `${stepLabel} "engine"`);
695
- if (engine !== undefined)
696
- unit.engine = engine;
701
+ for (const key of ["connection", "harness", "engine"]) {
702
+ if (raw[key] === undefined)
703
+ continue;
704
+ const name = parseEngineName(ctx, raw[key], [...path, key], `${stepLabel} "${key}"`);
705
+ if (name !== undefined)
706
+ unit[key] = name;
707
+ if (key === "engine")
708
+ warnRetiredEngineKey();
697
709
  }
698
710
  if (raw.model !== undefined) {
699
711
  if (typeof raw.model === "string" && raw.model.trim() !== "")
@@ -779,16 +791,18 @@ function parseExec(ctx, raw, path, stepLabel) {
779
791
  return exec;
780
792
  }
781
793
  /**
782
- * `pass_env:` — extra parent-process env var NAMES the child may see on top of
783
- * the default allowlist. NAMES ONLY: a value would be a plaintext secret in the
784
- * frozen plan, which is exactly what `env:` bindings exist to avoid.
794
+ * `pass_env:` — env var NAMES, recorded in the frozen plan. They select nothing:
795
+ * an exec child inherits akm's environment, so a workflow written before that
796
+ * still parses. NAMES ONLY: a value would be a plaintext secret in the frozen
797
+ * plan, which is exactly what `env:` bindings exist to avoid.
785
798
  */
786
799
  function parseExecPassEnv(ctx, raw, path, stepLabel) {
787
800
  if (raw === undefined)
788
801
  return undefined;
789
802
  if (!Array.isArray(raw) || raw.length === 0) {
790
- ctx.err(path, `${stepLabel} "exec.pass_env" must be a non-empty list of environment variable NAMES to copy through from ` +
791
- `akm's own environment, e.g. pass_env: [CARGO_HOME]. Values never appear here — use "env:" bindings for those.`);
803
+ ctx.err(path, `${stepLabel} "exec.pass_env" must be a non-empty list of environment variable NAMES, e.g. ` +
804
+ `pass_env: [CARGO_HOME]. It has no effect: the command inherits akm's environment. Values never appear ` +
805
+ `here — use "env:" bindings for those.`);
792
806
  return undefined;
793
807
  }
794
808
  const names = [];
@@ -924,19 +938,19 @@ function parseGate(ctx, raw, path, stepLabel) {
924
938
  // Field helpers
925
939
  // ---------------------------------------------------------------------------
926
940
  /**
927
- * Engine names must already satisfy the frozen-plan grammar
941
+ * Connection and harness names must already satisfy the frozen-plan grammar
928
942
  * (`WORKFLOW_ENGINE_NAME_PATTERN`, max 63 chars) at parse time — the decoder
929
943
  * enforces the same bound on persisted plans, and a name that only fails there
930
944
  * surfaces as an unlocated "Invalid frozen workflow plan" at `workflow run`.
931
945
  */
932
946
  function parseEngineName(ctx, raw, path, label) {
933
947
  if (typeof raw !== "string" || raw.trim() === "") {
934
- ctx.err(path, `${label} must be a non-empty engine name.`);
948
+ ctx.err(path, `${label} must be a non-empty name.`);
935
949
  return undefined;
936
950
  }
937
951
  const name = raw.trim();
938
952
  if (!WORKFLOW_ENGINE_NAME_PATTERN.test(name) || name.length > WORKFLOW_MAX_ENGINE_NAME_LENGTH) {
939
- ctx.err(path, `${label} has an invalid engine name ${JSON.stringify(name)}. Engine names are lowercase words of letters ` +
953
+ ctx.err(path, `${label} has an invalid name ${JSON.stringify(name)}. Names are lowercase words of letters ` +
940
954
  `and digits separated by single dashes, starting with a letter (e.g. "code-review-llm"), at most ` +
941
955
  `${WORKFLOW_MAX_ENGINE_NAME_LENGTH} characters.`);
942
956
  return undefined;
@@ -1025,7 +1039,12 @@ function parseEnumField(ctx, raw, path, label, allowed) {
1025
1039
  ctx.err(path, `${label} must be one of: ${allowed.join(" | ")} (got ${JSON.stringify(raw)}).`);
1026
1040
  return undefined;
1027
1041
  }
1028
- /** Parse only invocation tuning. Connection identity belongs to a named engine. */
1042
+ /** Keys a unit's `llm:` once took and akm no longer reads: warned about once, then ignored. */
1043
+ const RETIRED_LLM_KEYS = {
1044
+ supports_json_schema: "akm retries without a schema when the endpoint rejects one",
1045
+ context_length: "the context window is a connection's setting (contextLength)",
1046
+ };
1047
+ /** Parse only invocation tuning. Where it is sent belongs to a named connection. */
1029
1048
  function parseLlmOverrides(ctx, raw, path, label) {
1030
1049
  if (raw === undefined)
1031
1050
  return undefined;
@@ -1057,11 +1076,9 @@ function parseLlmOverrides(ctx, raw, path, label) {
1057
1076
  else
1058
1077
  ctx.err([...path, "max_tokens"], `${label}.max_tokens must be a positive integer.`);
1059
1078
  }
1060
- if (raw.supports_json_schema !== undefined) {
1061
- if (typeof raw.supports_json_schema === "boolean")
1062
- result.supportsJsonSchema = raw.supports_json_schema;
1063
- else
1064
- ctx.err([...path, "supports_json_schema"], `${label}.supports_json_schema must be a boolean.`);
1079
+ for (const [key, why] of Object.entries(RETIRED_LLM_KEYS)) {
1080
+ if (raw[key] !== undefined)
1081
+ warnOnce(`workflow-llm-${key}`, `A workflow's llm.${key} is ignored: ${why}.`);
1065
1082
  }
1066
1083
  if (raw.extra_params !== undefined) {
1067
1084
  if (!isRecord(raw.extra_params)) {
@@ -1080,13 +1097,6 @@ function parseLlmOverrides(ctx, raw, path, label) {
1080
1097
  }
1081
1098
  }
1082
1099
  }
1083
- if (raw.context_length !== undefined) {
1084
- if (typeof raw.context_length === "number" && Number.isInteger(raw.context_length) && raw.context_length > 0) {
1085
- result.contextLength = raw.context_length;
1086
- }
1087
- else
1088
- ctx.err([...path, "context_length"], `${label}.context_length must be a positive integer.`);
1089
- }
1090
1100
  if (raw.enable_thinking !== undefined) {
1091
1101
  if (typeof raw.enable_thinking === "boolean")
1092
1102
  result.enableThinking = raw.enable_thinking;
@@ -5,5 +5,7 @@
5
5
  * Stored plans record this; 0.9.15 and 0.9.16 wrote 5 and early 0.10 wrote 6,
6
6
  * which still decode (the 0.9.15 floor, #1091). 7 stopped freezing locations:
7
7
  * the plan names the refs the engine dereferences, never a directory or file.
8
+ * 8 freezes a connection or harness where 7 froze an engine: a plan of 7 or
9
+ * earlier that holds a command target cannot be decoded, and its run starts afresh.
8
10
  */
9
- export const WORKFLOW_PLAN_VERSION = 7;
11
+ export const WORKFLOW_PLAN_VERSION = 8;
@@ -45,16 +45,16 @@ function projectParameters(plan) {
45
45
  }
46
46
  /**
47
47
  * Compact, show-facing orchestration summary for one step. Field mapping:
48
- * `engine`/`model`/`timeoutMs` merge the run-level `defaults` exactly like the
48
+ * `engine` (the connection or harness a unit names), `model` and `timeoutMs` merge the run-level `defaults` exactly like the
49
49
  * compiler does (per-unit override wins), `fanOut.over` carries the raw
50
50
  * reference string.
51
51
  * Returns undefined when the step declares nothing worth summarizing.
52
52
  *
53
53
  * ## exec units
54
54
  *
55
- * An `exec` unit runs a shell command and names NO engine — the parser rejects
56
- * `engine`/`model`/`llm` alongside `exec:`. Merging `defaults.engine` into its
57
- * summary would make `show` state something untrue about what will run, so the
55
+ * An `exec` unit runs a shell command and names no connection or harness — the parser rejects
56
+ * `connection`/`harness`/`model`/`llm` alongside `exec:`. Merging the run's default
57
+ * into its summary would make `show` state something untrue about what will run, so the
58
58
  * two fields are suppressed and the argv is projected instead, under `exec`
59
59
  * (field presence carries the dispatch kind, exactly like `fanOut`
60
60
  * carries the step kind).
@@ -80,7 +80,8 @@ export function summarizeStepOrchestration(step, defaults) {
80
80
  const exec = spec ? spec.exec : frozen?.exec;
81
81
  const env = unit?.env ?? frozen?.env;
82
82
  const workflow = spec ? spec.workflow : frozen?.workflow;
83
- const engine = exec ? undefined : (unit?.engine ?? defaults?.engine);
83
+ const named = (settings) => settings?.connection ?? settings?.harness ?? settings?.engine;
84
+ const engine = exec ? undefined : (named(unit) ?? named(defaults));
84
85
  const model = exec ? undefined : (unit?.model ?? defaults?.model);
85
86
  const timeoutMs = unit?.timeoutMs !== undefined ? unit.timeoutMs : defaults?.timeoutMs;
86
87
  const summary = {
@@ -35,7 +35,7 @@ export const WORKFLOW_EXEC_OUTPUT_TRUNCATED_MARKER = "__akm_exec_output_truncate
35
35
  // Per-var: Win32 `SetEnvironmentVariable` caps one variable at 32 767 UTF-16
36
36
  // code units; measuring UTF-8 bytes is conservative in the right direction.
37
37
  // Total: akm's own share of the `CreateProcess` `lpEnvironment` block, which it
38
- // shares with the allowlist, the unit's `env:` bindings and the argv.
38
+ // shares with the rest of the environment, the unit's `env:` bindings and the argv.
39
39
  const EXEC_CONTEXT_LIMITS_WIN32 = {
40
40
  perVarBytes: 32_767,
41
41
  totalBytes: 64_000,
@@ -45,7 +45,7 @@ const EXEC_CONTEXT_LIMITS_WIN32 = {
45
45
  // margin for the name, `=`, NUL and the kernel's own accounting — the guard must
46
46
  // never reject a spawn the platform would have accepted.
47
47
  // Total: half of macOS's 256 KiB `ARG_MAX` (the tightest supported total), so
48
- // the other half remains for the argv, the allowlist and the `env:` bindings.
48
+ // the other half remains for the argv, the rest of the environment and the `env:` bindings.
49
49
  const EXEC_CONTEXT_LIMITS_POSIX = {
50
50
  perVarBytes: 96 * 1024,
51
51
  totalBytes: 128 * 1024,
@@ -15,7 +15,8 @@
15
15
  * would make an interrupted run publish a second child after an upgrade.
16
16
  * Dispatch finds the bundle and the env asset by ref and never reads them. It
17
17
  * rejects only a plan it cannot run: no steps, a unit with no frozen target, a
18
- * request that does not decode. `plan_hash` is an informational column. A plan
18
+ * request that does not decode — which is every command target an earlier
19
+ * irVersion froze, since each names an engine. `plan_hash` is an informational column. A plan
19
20
  * that cannot be decoded comes back from {@link readRunPlan} as a `problem`
20
21
  * sentence and the caller decides the remedy (the engine abandons such a run
21
22
  * instead of throwing) — except for a plan a NEWER akm froze (`plan_ir_version`
@@ -25,9 +25,19 @@ import { canonicalizeWorkflowRefInput, loadWorkflowAsset } from "./workflow-asse
25
25
  * The `Record<WorkflowRuntimeKind, …>` is exhaustiveness-checked, so a new runtime
26
26
  * kind cannot be added to the union without being accepted here too.
27
27
  */
28
- const IR_RUNTIME_KINDS = { llm: true, agent: true, sdk: true, exec: true };
28
+ const IR_RUNTIME_KINDS = { connection: true, harness: true, exec: true };
29
+ /** What a run of an earlier release journaled for the runner kinds that were renamed. */
30
+ const EARLIER_RUNTIME_KINDS = {
31
+ llm: "connection",
32
+ agent: "harness",
33
+ sdk: "harness",
34
+ };
29
35
  function runtimeKindOf(runner) {
30
- return runner !== null && Object.hasOwn(IR_RUNTIME_KINDS, runner) ? runner : null;
36
+ if (runner === null)
37
+ return null;
38
+ if (Object.hasOwn(IR_RUNTIME_KINDS, runner))
39
+ return runner;
40
+ return EARLIER_RUNTIME_KINDS[runner] ?? null;
31
41
  }
32
42
  function toUnitDiagnostic(row) {
33
43
  let diagnostic = null;
@@ -145,11 +155,6 @@ export async function startWorkflowRun(ref, params = {}, options) {
145
155
  const secretWarnings = detectSecretShapedParams(effectiveParams);
146
156
  if (secretWarnings.length > 0)
147
157
  result.warnings = [...(result.warnings ?? []), ...secretWarnings];
148
- // The implicit engine fallback is announced ONCE, here at run creation —
149
- // the frozen plan records the engine actually used, so a resume never
150
- // re-announces a decision it did not make.
151
- if (frozen.engineAnnouncement)
152
- result.warnings = [...(result.warnings ?? []), frozen.engineAnnouncement];
153
158
  return result;
154
159
  });
155
160
  }
@@ -368,7 +373,7 @@ export async function completeWorkflowStep(input) {
368
373
  : input.summaryJudge;
369
374
  if (criteria.length > 0 && !judge) {
370
375
  throw new ConfigError(`Workflow run ${input.runId} has completion criteria for step "${input.stepId}" but its frozen plan has no judge. ` +
371
- "Set workflow.judgeEngine, abandon this run, and create a new one with `akm workflow run <ref>`.", "INVALID_CONFIG_FILE");
376
+ "Run `akm setup` to add a connection or harness, abandon this run, and create a new one with `akm workflow run <ref>`.", "INVALID_CONFIG_FILE");
372
377
  }
373
378
  const verdict = await validateStepSummary({ stepTitle: preflight.stepPlan.title, completionCriteria: criteria, summary }, judge ?? undefined, input.signal);
374
379
  if (!verdict.complete) {
@@ -602,7 +607,7 @@ function toChildRunNode(repo, rootRunId, row) {
602
607
  ? {
603
608
  resume: {
604
609
  command: `akm workflow resume ${row.id}`,
605
- // biome-ignore lint/suspicious/noThenProperty: mirrors spec §4.5's real WorkflowChildRunNode.resume.then field name
610
+ // biome-ignore lint/suspicious/noThenProperty: mirrors the real WorkflowChildRunNode.resume.then field name
606
611
  then: `akm workflow resume ${rootRunId} && akm workflow run ${rootRunId}`,
607
612
  },
608
613
  }
package/docs/README.md CHANGED
@@ -17,6 +17,7 @@ Full per-directory indexes: [Guides](guides/README.md),
17
17
  - [Getting Started](guides/getting-started.md) -- Install akm, connect a source, and pull a curated shortlist in five to seven minutes
18
18
  - [Concepts](guides/concepts.md) -- Capabilities, bundles, adapters, asset types, and refs -- the mental model in one page
19
19
  - [Agent Install Guide](agents/agent-install.md) -- Step-by-step automated (non-interactive) install for agents
20
+ - [Upgrade from 0.9 to 0.10](migration/v0.9-to-v0.10.md) -- The current upgrade path: the order to follow, every removed CLI spelling, config key and workflow feature with its replacement, and what a scheduled `akm improve` now does
20
21
  - `akm hints` (complete guide by default; `akm hints --detail brief` for the short one) -- The CLI reference agents load to use akm; always the embedded corpus at `src/assets/hints/cli-hints-{full,short}.md`
21
22
 
22
23
  ## Use
@@ -32,7 +33,6 @@ the task needs, and capture what you learn along the way.
32
33
  - [Environment & Secrets](reference/env-and-secrets.md) -- `akm env` and `akm secret`: exact operations, file modes, and the security guarantee
33
34
  - [Run Workflows](guides/run-workflows.md) -- Start or continue a run, check on it, resume it, or abandon it
34
35
  - [Scheduling](guides/scheduling.md) -- Run akm tasks through the OS scheduler (cron / launchd / schtasks) safely
35
- - [Migrate to 0.9.2](migration/v0.9.1-to-v0.9.2.md) -- Convert task-v2 sources safely and understand workflow resume compatibility
36
36
  - [Improve the Library](guides/improve-the-library.md) -- Feedback, history, and proposals -- how evidence turns into reviewable changes
37
37
  - Recipes: [Turn a Website into a Searchable Bundle](guides/recipes/website-source.md), [Headless Install](guides/recipes/headless-install.md)
38
38
 
@@ -42,23 +42,21 @@ Package complete capabilities and turn knowledge into repeatable work.
42
42
 
43
43
  - [Bundle Author's Guide](guides/author-bundles.md) -- Build a bundle, make it discoverable, and share it so others can install it with `akm bundle add`
44
44
  - [Author's Guide: Writing Workflows](guides/author-workflows.md) -- Write and test a workflow definition, from a minimal example to gates and outputs
45
- - [Claude Code workflows vs. akm workflows](guides/claude-code-vs-akm-workflows.md) -- Short decision guide for choosing between a session-native workflow and an akm workflow ([full technical comparison](architecture/comparisons/claude-code-vs-akm-workflows-full.md))
46
45
  - [Bundling akm](integration/bundling-akm.md) -- Ship akm inside your own product: the pin/migrate/health boot contract, plan JSON shapes, and exit codes for bundlers
47
46
 
48
47
  ### Maintainers
49
48
 
50
49
  Working on akm itself, not just using it.
51
50
 
52
- - [Maintainer Docs](maintainers/README.md) -- Start here: local development, measuring improvement, and the curate contract
51
+ - [Maintainer Docs](maintainers/README.md) -- Start here: local development, the release checklist, and measuring improvement
53
52
  - [Local Development](maintainers/local-development.md) -- Dogfooding akm while editing its own source
54
- - [Curate Workmap](maintainers/curate-workmap.md) -- The current `akm curate` contract and the highest-value next fixes
55
53
 
56
54
  ## Look up details
57
55
 
58
56
  - [CLI](reference/cli.md) -- All `akm` commands and flags
59
- - [Configuration](reference/configuration.md) -- Engines, strategies, bundles, and settings
57
+ - [Configuration](reference/configuration.md) -- Connections, harnesses, strategies, bundles, and settings
60
58
  - [Supported Formats](reference/supported-formats.md) -- Every bundle format akm recognizes, its detection marker, and current read/write support
61
- - [Tasks](reference/tasks.md) -- Task-v3 files, targets, triggers, and fail-closed migration
59
+ - [Tasks](reference/tasks.md) -- Task source v4 files, targets, triggers, and the explicit `akm migrate apply` conversion of v2 and v3 files
62
60
  - [Asset Types](reference/asset-types.md) -- The capability taxonomy, directory conventions, and per-type examples
63
61
  - [Refs](reference/refs.md) -- The ref grammar `akm search` emits and `akm show` consumes
64
62
  - [Memory](reference/memory.md) -- The `memory` asset type: capture, belief states, and derived memories
@@ -68,17 +66,14 @@ Working on akm itself, not just using it.
68
66
  - [Website Sources](reference/website-sources.md) -- The pluggable fetcher API for URL-based knowledge reads
69
67
  - [Data & Telemetry](reference/data-and-telemetry.md) -- Exactly what akm reads and writes on your machine (no remote telemetry)
70
68
  - [Architecture Overview](architecture/architecture.md) -- How akm's bundles, cache, index, and registries fit together
71
- - [Core Principles](architecture/akm-core-principles.md) -- Design principles and constraints
69
+ - [Core Principles](architecture/akm-core-principles.md) -- How the code, tests and docs in this repo are built: the engineering rules and what enforces each
72
70
  - [Adapters](architecture/adapters.md) -- How akm picks an adapter, indexes, validates, and writes into a bundle
73
71
  - [The Workflow Engine](architecture/workflow-engine.md) -- How a frozen plan is stored, dispatched, and resumed without replaying completed units
74
72
  - [The Improvement Loop](architecture/improvement.md) -- How a feedback signal becomes a ranking change, and how evidence becomes a proposal
75
- - [Runtime Boundary Design](architecture/runtime-boundary-design.md) -- Isolating `bun:sqlite`/`Bun.*` from the core
76
- - [Architecture Decision History](architecture/akm-architecture-decision-history.md) -- ADR-style record of the major architecture rulings
77
- - [Specs](architecture/README.md#specs-specs) -- Normative specifications (bundle/adapter model, ref grammar, bundle conventions)
78
- - [Internals](architecture/README.md#internals-internals) -- Current-truth subsystem references (storage, search, indexing, improve, health)
79
- - [Testing](architecture/README.md#testing-testing) -- Testing workflow and pre-release checklist
80
- - [Migration](migration/README.md) -- Upgrade guides and per-release migration notes
81
- - [Roadmap](https://github.com/itlackey/akm/blob/main/ROADMAP.md) -- High-level focus for the releases from here through 1.0
73
+ - [Specs](architecture/README.md#specs-specs) -- Normative specifications (ref grammar, OKF support)
74
+ - [Internals](architecture/README.md#internals-internals) -- Current-truth subsystem references (storage, indexing, classification, improve, health)
75
+ - [Testing](architecture/README.md#testing-testing) -- Testing workflow
76
+ - [Migration](migration/README.md) -- The current 0.9 to 0.10 upgrade guide, then the historical guides and per-release notes of earlier releases
82
77
 
83
78
  ## Execution boundary
84
79
 
@@ -86,8 +81,7 @@ AKM retrieves every supported capability type. It directly orchestrates
86
81
  defined execution surfaces such as workflows, agent dispatch, tasks, and
87
82
  guarded subprocess injection. It does not blindly execute arbitrary indexed
88
83
  content merely because that content appears in search results. See
89
- [Core Principles](architecture/akm-core-principles.md) for the full boundary,
90
- and [The Improvement Loop](architecture/improvement.md) for how that boundary
84
+ [The Improvement Loop](architecture/improvement.md) for how that boundary
91
85
  applies to akm's own self-generated changes.
92
86
 
93
87
  ## Posts
@@ -1,67 +1,32 @@
1
1
  # Architecture Index
2
2
 
3
- How akm is built: system overview, normative specs, decision history, and
4
- subsystem internals.
3
+ How akm is built: system overview, normative specs, and subsystem internals.
5
4
 
6
5
  - [Architecture](architecture.md) -- How akm's bundles, cache, index, and registries fit together
7
- - [Core Principles](akm-core-principles.md) -- Design principles and constraints
6
+ - [Core Principles](akm-core-principles.md) -- How the code, tests and docs in this repo are built: the engineering rules and what enforces each
8
7
  - [Adapters](adapters.md) -- The `BundleAdapter` contract: what a bundle's files *are*, how they're indexed, linted, and written
9
8
  - [Architecture: The Workflow Engine](workflow-engine.md) -- How a workflow compiles to a frozen plan, persists run/unit state, dispatches work, and resumes without replaying completed steps
10
9
  - [Architecture: The Improvement Loop](improvement.md) -- Purpose and boundary of the improvement loop
11
- - [Runtime Boundary Design](runtime-boundary-design.md) -- Isolating `bun:sqlite`/`Bun.*` from the core
12
- - [Architecture Decision History](akm-architecture-decision-history.md) -- ADR-style record of the major architecture rulings
13
10
 
14
11
  ## Specs (`specs/`)
15
12
 
16
13
  Normative specifications and binding conventions.
17
14
 
18
15
  - [OKF format support](specs/okf-support.md) -- OKF is a first-class format supported through the built-in `okf` adapter
19
- - [0.9.0 surface decisions](specs/0.9.0-decisions.md) -- The decision record (D1-D12) behind the 0.9.0 breaking changes
20
- - [Bundle & Adapter Spec (0.9.0)](specs/akm-0.9.0-bundle-adapter-spec.md) -- Normative spec for bundles, adapters, and bundle recognition
21
- - [Ref Grammar Decision (0.9.0)](specs/akm-0.9.0-ref-grammar-decision.md) -- The `[bundle//]conceptId` ref grammar
22
16
  - [Ref Format](specs/ref.md) -- Wire format for asset references
23
- - [Format-Neutral Bundle Workspace Spec](specs/akm-format-neutral-bundle-workspace-spec.md) -- The format-neutral workspace model
24
- - [Agent, Command, Engine, and Model Resolution](specs/agent-command-engine-model-design.md) -- Approved target semantics for native agent/command bundles, configuration cascading, model maps, and dispatch
25
- - [0.9.2 Agent/Command/Task/Workflow Implementation Plan](../plans/0.9.2-agent-command-workflow-plan.md) -- Sequenced work packages, [GitHub milestone tracker](https://github.com/itlackey/akm/issues/801), migration rules, support boundaries, and release evidence for the coherent execution MVP
26
- - [Fact Asset Type](specs/fact-asset-type.md) -- The `fact` asset type
27
- - [Bundle Conventions Code Spec](specs/stash-conventions-code-spec.md) -- Code-level bundle conventions
28
- - [Bundle Organization Conventions](specs/stash-organization-conventions.md) -- How a bundle is laid out
29
- - [DI Seams Plan](specs/di-seams-plan.md) -- Dependency-injection seams used by the test suite
30
- - [Improve Collapse/Churn Detector](specs/improve-collapse-churn-detector-design.md) -- Longitudinal collapse/churn detection design (§6.3 is the operator runbook referenced by `akm health`)
31
-
32
- Historical review registers (0.9.0 release-review audit trail, kept for provenance, not normative going forward):
33
-
34
- - [0.9.0 Docs–Code Drift Register](specs/0.9.0-docs-code-drift-register.md) -- Ruled record of places documentation and code disagreed, and open-intent questions (Q-01..Q-19)
35
- - [0.9.0 Public API Issue Backlog](specs/0.9.0-public-api-issue-backlog.md) -- Implementation-only findings from the CLI surface review
36
- - [0.9.0 Release Surface Review](specs/0.9.0-release-surface-review.md) -- Reconciled action list from the end-to-end user-facing surface sweep
37
17
 
38
18
  ## Internals (`internals/`)
39
19
 
40
20
  Current-truth subsystem references.
41
21
 
42
22
  - [Storage Locations](internals/storage-locations.md) -- Authoritative inventory of every on-disk read/write path
43
- - [Search](internals/search.md) -- Hybrid search architecture and scoring
44
23
  - [Indexing](internals/indexing.md) -- How the search index is built
45
24
  - [Classification](internals/classification.md) -- Matcher and renderer behavior
46
25
  - [Improve Workflow](internals/improve-workflow.md) -- `akm improve` command surface and pipeline reference
47
26
  - [Health Advisories](internals/health-advisories.md) -- `akm health` advisory-to-action map for operators
48
- - [Registry Network Boundary](internals/registry-network-boundary.md) -- Outbound registry request inventory, destination policy, redirects, and DNS guarantees
49
- - [Functional Contract Patterns](internals/functional-contract-patterns.md) -- Quick reference for contributor pipelines and small process contracts
50
27
  - [Fresh-Host Rebuild Runbook](internals/fresh-host-rebuild-runbook.md) -- Rebuild an akm install on a new machine
51
28
  - [Persisted-Data Compatibility Contract](persisted-data-compat.md) -- What a reader owes data an earlier release wrote, per persisted format
52
29
 
53
- ## Reviews (`reviews/`)
54
-
55
- Point-in-time architecture reviews of a specific subsystem question.
56
-
57
- - [Runtime secret resolution for in-process source fetchers](reviews/env-secret-access.md) -- Why secret reads are injected as a `SecretResolver` capability instead of imported inside the fetcher subgraph
58
-
59
- ## Comparisons (`comparisons/`)
60
-
61
- - [Workflow architecture: Claude Code workflows vs. akm workflows](comparisons/claude-code-vs-akm-workflows-full.md) -- Full technical comparison of the Claude Code `Workflow` tool and akm workflows; see [the short vendor-neutral guide](../guides/claude-code-vs-akm-workflows.md) for the decision-level version
62
-
63
30
  ## Testing (`testing/`)
64
31
 
65
32
  - [Testing Workflow](testing/testing-workflow.md) -- End-to-end, Docker, deployment, and upgrade validation, plus the coverage gap guide
66
- - [Manual Testing Checklist](testing/manual-testing-checklist.md) -- Pre-release manual QA checklist
67
- - [OKF v0.2 Conformance Re-Evaluation Runbook](testing/okf-v0.2-conformance-runbook.md) -- Acceptance procedure to re-run after changing adapters, indexing, refs, writes, or lint behavior
@@ -11,8 +11,8 @@ For read-only native tool bundles, recognition is runtime translation, not
11
11
  conversion: the adapter projects native files into AKM's index/runtime shapes
12
12
  while the source file remains authoritative. AKM does not synchronize native
13
13
  formats, maintain translated canonical copies, or write agent/command assets
14
- back through the Claude/OpenCode adapters. See
15
- [Agent, Command, Engine, and Model Resolution](specs/agent-command-engine-model-design.md).
14
+ back through the Claude/OpenCode adapters. Execution of agent and command
15
+ assets is described in [Architecture: Connections and Harnesses](architecture.md#connections-and-harnesses).
16
16
 
17
17
  > **Stability note.** The adapter set, bundle-recognition rules, and the
18
18
  > `bundles` config shape are still evolving — see [STABILITY.md](../../STABILITY.md).