akm-cli 0.9.30 → 0.9.31

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 (161) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +10 -10
  3. package/ROADMAP.md +112 -0
  4. package/dist/commands/improve/improve-cli.js +33 -12
  5. package/dist/core/file-lock.js +10 -1
  6. package/dist/llm/client.js +33 -3
  7. package/dist/scripts/akm-migrate-node.js +5 -1
  8. package/dist/scripts/akm-migrate.js +5 -1
  9. package/docs/README.md +42 -41
  10. package/docs/agents/README.md +15 -0
  11. package/docs/agents/agent-install.md +14 -0
  12. package/docs/architecture/README.md +67 -0
  13. package/docs/architecture/adapters.md +272 -0
  14. package/docs/architecture/akm-architecture-decision-history.md +2055 -0
  15. package/docs/architecture/akm-core-principles.md +126 -0
  16. package/docs/architecture/architecture.md +579 -0
  17. package/docs/architecture/comparisons/claude-code-vs-akm-workflows-full.md +550 -0
  18. package/docs/architecture/decisions/0001-no-interpolation-attached-structured-context.md +72 -0
  19. package/docs/architecture/decisions/0002-unit-reuse-and-input-hash-scope.md +142 -0
  20. package/docs/architecture/decisions/0003-child-env-allowlist-and-provenance.md +189 -0
  21. package/docs/architecture/decisions/0004-task-input-contract-and-flag-coercion.md +97 -0
  22. package/docs/architecture/decisions/0005-task-result-vocabulary-and-legacy-read-mapping.md +108 -0
  23. package/docs/architecture/decisions/0006-task-source-version-routing.md +124 -0
  24. package/docs/architecture/decisions/0007-workflow-composition-bounds.md +83 -0
  25. package/docs/architecture/decisions/0008-task-binding-normalization.md +88 -0
  26. package/docs/architecture/decisions/0009-child-run-publication-column-parity.md +80 -0
  27. package/docs/architecture/decisions/0010-driver-protocol-cut.md +36 -0
  28. package/docs/architecture/decisions/0011-engine-run-loop-invariants.md +125 -0
  29. package/docs/architecture/decisions/README.md +62 -0
  30. package/docs/architecture/improvement.md +440 -0
  31. package/docs/architecture/internals/classification.md +154 -0
  32. package/docs/architecture/internals/fresh-host-rebuild-runbook.md +40 -0
  33. package/docs/architecture/internals/functional-contract-patterns.md +340 -0
  34. package/docs/architecture/internals/health-advisories.md +110 -0
  35. package/docs/architecture/internals/improve-workflow.md +713 -0
  36. package/docs/architecture/internals/indexing.md +498 -0
  37. package/docs/architecture/internals/registry-network-boundary.md +57 -0
  38. package/docs/architecture/internals/search.md +249 -0
  39. package/docs/architecture/internals/storage-locations.md +943 -0
  40. package/docs/architecture/persisted-data-compat.md +59 -0
  41. package/docs/architecture/reviews/env-secret-access.md +319 -0
  42. package/docs/architecture/runtime-boundary-design.md +153 -0
  43. package/docs/architecture/specs/0.9.0-close-out-plan.md +361 -0
  44. package/docs/architecture/specs/0.9.0-decisions.md +528 -0
  45. package/docs/architecture/specs/0.9.0-docs-code-drift-register.md +745 -0
  46. package/docs/architecture/specs/0.9.0-open-items-register.md +135 -0
  47. package/docs/architecture/specs/0.9.0-public-api-issue-backlog.md +740 -0
  48. package/docs/architecture/specs/0.9.0-release-surface-review.md +636 -0
  49. package/docs/architecture/specs/agent-command-engine-model-design.md +513 -0
  50. package/docs/architecture/specs/akm-0.9.0-bundle-adapter-spec.md +501 -0
  51. package/docs/architecture/specs/akm-0.9.0-ref-grammar-decision.md +291 -0
  52. package/docs/architecture/specs/akm-format-neutral-bundle-workspace-spec.md +2059 -0
  53. package/docs/architecture/specs/di-seams-plan.md +539 -0
  54. package/docs/architecture/specs/driver-protocol-keep-or-cut.md +275 -0
  55. package/docs/architecture/specs/fact-asset-type.md +142 -0
  56. package/docs/architecture/specs/improve-collapse-churn-detector-design.md +634 -0
  57. package/docs/architecture/specs/okf-support.md +148 -0
  58. package/docs/architecture/specs/ref.md +329 -0
  59. package/docs/architecture/specs/reviews/task-workflow-unification/README.md +72 -0
  60. package/docs/architecture/specs/reviews/task-workflow-unification/findings-consolidated.md +152 -0
  61. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-alternatives.md +352 -0
  62. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-bunqueue.md +300 -0
  63. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-openworkflow.md +402 -0
  64. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-1.md +758 -0
  65. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-2.md +645 -0
  66. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-3.md +602 -0
  67. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-adversarial.md +27 -0
  68. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-architecture.md +27 -0
  69. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-coverage.md +74 -0
  70. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-security.md +15 -0
  71. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r2-adversarial.md +132 -0
  72. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r2-verification.md +147 -0
  73. package/docs/architecture/specs/stash-conventions-code-spec.md +275 -0
  74. package/docs/architecture/specs/stash-organization-conventions.md +377 -0
  75. package/docs/architecture/specs/task-workflow-format-unification.md +721 -0
  76. package/docs/architecture/specs/workflow-engine-buy-vs-build.md +231 -0
  77. package/docs/architecture/specs/workflow-format-unification.md +437 -0
  78. package/docs/architecture/testing/manual-testing-checklist.md +3420 -0
  79. package/docs/architecture/testing/okf-v0.2-conformance-runbook.md +924 -0
  80. package/docs/architecture/testing/task-workflow-manual-tests.md +1817 -0
  81. package/docs/architecture/testing/testing-workflow.md +446 -0
  82. package/docs/architecture/workflow-engine.md +274 -0
  83. package/docs/guides/README.md +33 -0
  84. package/docs/guides/author-bundles.md +310 -0
  85. package/docs/guides/author-workflows.md +520 -0
  86. package/docs/guides/bundles.md +321 -0
  87. package/docs/guides/capture-knowledge.md +136 -0
  88. package/docs/guides/claude-code-vs-akm-workflows.md +30 -0
  89. package/docs/guides/concepts.md +93 -0
  90. package/docs/guides/discover-and-load.md +158 -0
  91. package/docs/guides/getting-started.md +240 -0
  92. package/docs/guides/improve-the-library.md +246 -0
  93. package/docs/guides/knowledge-management.md +18 -0
  94. package/docs/guides/recipes/headless-install.md +97 -0
  95. package/docs/guides/recipes/website-source.md +28 -0
  96. package/docs/guides/run-workflows.md +279 -0
  97. package/docs/guides/scheduling.md +123 -0
  98. package/docs/guides/use-with-any-agent.md +129 -0
  99. package/docs/guides/wikis.md +81 -0
  100. package/docs/maintainers/README.md +19 -0
  101. package/docs/maintainers/curate-workmap.md +336 -0
  102. package/docs/maintainers/eval.md +3 -0
  103. package/docs/maintainers/local-development.md +108 -0
  104. package/docs/maintainers/release-checklist.md +103 -0
  105. package/docs/migration/README.md +2 -2
  106. package/docs/migration/release-notes/0.0.13.md +1 -1
  107. package/docs/migration/release-notes/0.1.0.md +1 -1
  108. package/docs/migration/release-notes/0.2.0.md +1 -1
  109. package/docs/migration/release-notes/0.3.0.md +1 -1
  110. package/docs/migration/release-notes/0.5.0.md +1 -1
  111. package/docs/migration/release-notes/0.6.0.md +1 -1
  112. package/docs/migration/release-notes/0.7.0.md +1 -1
  113. package/docs/migration/release-notes/0.7.3.md +2 -2
  114. package/docs/migration/release-notes/0.7.4.md +1 -1
  115. package/docs/migration/release-notes/0.7.5.md +1 -1
  116. package/docs/migration/release-notes/0.8.0.md +1 -1
  117. package/docs/migration/release-notes/0.9.0.md +1 -1
  118. package/docs/migration/release-notes/0.9.14.md +1 -1
  119. package/docs/migration/release-notes/0.9.15.md +1 -1
  120. package/docs/migration/release-notes/0.9.16.md +1 -1
  121. package/docs/migration/release-notes/0.9.17.md +1 -1
  122. package/docs/migration/release-notes/0.9.19.md +1 -1
  123. package/docs/migration/release-notes/0.9.2.md +1 -1
  124. package/docs/migration/release-notes/README.md +27 -31
  125. package/docs/migration/v0.5-to-v0.6.md +759 -0
  126. package/docs/migration/v0.8-to-v0.9.md +1 -1
  127. package/docs/plans/0.9.2-agent-command-workflow-plan.md +423 -0
  128. package/docs/posts/README.md +30 -0
  129. package/docs/posts/akm-command-tour.md +495 -0
  130. package/docs/posts/akm-logo-sized.webp +0 -0
  131. package/docs/posts/belief-aware-memory-12.md +139 -0
  132. package/docs/posts/config-v2-lessons-16.md +191 -0
  133. package/docs/posts/improve-loop-autonomous-10.md +225 -0
  134. package/docs/posts/improve-pipeline-debugging-0803.md +179 -0
  135. package/docs/posts/intro-part-01.md +76 -0
  136. package/docs/posts/intro-part-02.md +221 -0
  137. package/docs/posts/intro-part-03.md +190 -0
  138. package/docs/posts/intro-part-04.md +221 -0
  139. package/docs/posts/llm-mode-reflect-13.md +166 -0
  140. package/docs/posts/openpalm-built-on-akm.md +86 -0
  141. package/docs/posts/progressive-disclosure-06.md +129 -0
  142. package/docs/posts/proposal-safety-net-15.md +112 -0
  143. package/docs/posts/release-0.5.0.md +247 -0
  144. package/docs/posts/release-0.6.0.md +117 -0
  145. package/docs/posts/release-0.7.0.md +159 -0
  146. package/docs/posts/release-0.8.0.md +332 -0
  147. package/docs/posts/scattered-skills-05.md +100 -0
  148. package/docs/posts/task-assets-persistent-workflows-11.md +222 -0
  149. package/docs/posts/team-skills-07.md +198 -0
  150. package/docs/posts/wiki-agent-knowledge-08.md +223 -0
  151. package/docs/posts/workflows-vaults-09.md +321 -0
  152. package/docs/product-surface.md +54 -0
  153. package/docs/reference/README.md +1 -2
  154. package/docs/reference/asset-types.md +168 -0
  155. package/docs/reference/cli.md +5 -6
  156. package/docs/reference/env-and-secrets.md +126 -0
  157. package/docs/reference/memory.md +124 -0
  158. package/docs/reference/refs.md +156 -0
  159. package/docs/reference/registry.md +489 -0
  160. package/docs/reference/website-sources.md +141 -0
  161. package/package.json +12 -15
@@ -0,0 +1,513 @@
1
+ # Agent, Command, Engine, and Model Resolution
2
+
3
+ > **Historical implementation design.** The 0.9.2 implementation is complete;
4
+ > current public contracts live in [Tasks](../../reference/tasks.md) and
5
+ > [Workflow Schema](../../reference/workflow-schema.md). The staged checkpoints
6
+ > below are retained as design history and are not current status.
7
+
8
+ **Status:** Approved target design
9
+
10
+ **Decision date:** 2026-08-18
11
+
12
+ **Implementation baseline:** The 0.9.2 line implements WP2 model maps, the WP3
13
+ common cascade/authorization boundary, the WP4 command surface, and WP5
14
+ runtime engine lowering convergence. Task v3 remains WP6, and the final
15
+ source-to-frozen durable workflow IR/resume representation remains WP7; see
16
+ the [0.9.2 implementation plan](../../plans/0.9.2-agent-command-workflow-plan.md).
17
+
18
+ This specification defines how agent personas, command templates, execution
19
+ engines, model mappings, tasks, and workflows interact. It is authoritative
20
+ for those semantics and for the 0.9.2 task/workflow format direction.
21
+
22
+ ## 1. Goals
23
+
24
+ The design has four goals:
25
+
26
+ 1. Native Claude Code, OpenCode, and similar agent assets remain useful in
27
+ place, without migration or synchronization.
28
+ 2. AKM gives the same agent, command, engine, and model settings the same
29
+ precedence regardless of whether execution starts at the CLI, a scheduled
30
+ task, or a workflow.
31
+ 3. Portable behavior stays deliberately small. Native-only behavior is not
32
+ guessed or partially emulated.
33
+ 4. Runtime policy remains separate from asset configuration. An asset can
34
+ select requested tools or a model, but it cannot override operator
35
+ authorization or budget policy.
36
+
37
+ ## 2. The concepts
38
+
39
+ ### 2.1 Agent: who performs the work
40
+
41
+ An agent asset is a **persona**, not executable work. It may contribute:
42
+
43
+ - a persona/system prompt;
44
+ - a requested tool policy;
45
+ - a model preference;
46
+ - an optional default engine; and
47
+ - other ordinary execution defaults recognized by its format and adapter.
48
+
49
+ An agent is selected with an `agent` selector. An agent ref MUST NOT be used
50
+ as an executable `uses` target. A direct invocation such as:
51
+
52
+ ```sh
53
+ akm agent agents/reviewer --prompt "Review this change"
54
+ ```
55
+
56
+ is shorthand for selecting `agents/reviewer` as the persona and using the
57
+ provided prompt as the work.
58
+
59
+ Agent files extend the native agent-file concepts of their source formats.
60
+ They do not select a special AKM-only runtime merely because AKM indexed them.
61
+
62
+ ### 2.2 Command: reusable agent work
63
+
64
+ A command asset is a reusable **agent prompt template**, compatible with the
65
+ custom/slash-command concept in native agent tools. It is not an operating
66
+ system command.
67
+
68
+ A command may contribute defaults such as an agent selector, engine, model,
69
+ tools, and timeout. Those values participate in the normal cascade and can be
70
+ overridden by a nearer caller.
71
+
72
+ AKM owns command resolution. It loads the command through its bundle adapter,
73
+ applies the portable argument contract, resolves the agent/engine/model
74
+ cascade, and dispatches the resulting work. AKM MUST NOT send an unresolved
75
+ slash-command invocation to a native harness and rely on that harness to
76
+ reinterpret it.
77
+
78
+ `akm command run` is the target canonical CLI. `akm agent --command` may remain
79
+ as a compatibility alias, but both MUST call the same resolver and produce the
80
+ same behavior.
81
+
82
+ ### 2.3 Engine: how the work runs
83
+
84
+ An engine is a named execution backend. It may be an agent harness or a direct
85
+ LLM connection. Agent and command assets may provide an optional default
86
+ engine, but neither is required to do so.
87
+
88
+ The same agent and command assets may run through agent or LLM engines. AKM
89
+ does not maintain a central, exhaustive capability registry and does not
90
+ reject an engine merely because its kind is assumed not to support a field.
91
+ See [Optimistic lowering](#7-optimistic-lowering).
92
+
93
+ ### 2.4 Model mapping: portable intent to provider configuration
94
+
95
+ `model` accepts either:
96
+
97
+ - a known alias; or
98
+ - an exact provider-native identifier.
99
+
100
+ Alias identity is registry-based, not heuristic. If a value matches a known
101
+ alias, the selected engine's mapping MUST resolve it. A known alias without a
102
+ mapping is an actionable lint/resolution error. A value that is not a known
103
+ alias is an exact identifier and passes through unchanged.
104
+
105
+ ### 2.5 Task: when work runs
106
+
107
+ A task is a scheduling wrapper around existing work. It adds scheduling and
108
+ invocation overrides but does not define another agent, command, or model
109
+ resolution system.
110
+
111
+ A task may describe or reference:
112
+
113
+ - a command;
114
+ - a workflow;
115
+ - a script or explicit shell operation; or
116
+ - inline command content with an optional agent selector.
117
+
118
+ There is no separate prompt executable type. Prompt text is command content:
119
+ stored content is a command asset, while inline content is an anonymous
120
+ command invocation using the same resolver and execution path.
121
+
122
+ ### 2.6 Workflow: durable composition
123
+
124
+ A workflow composes work into a frozen, journaled run. A workflow step may
125
+ reuse a task's work definition; scheduling-only task fields such as `schedule`
126
+ and `enabled` do not join the step. Step values are nearer and therefore
127
+ override the referenced task.
128
+
129
+ Workflow authoring is multi-format. AKM Markdown workflows remain first-class
130
+ with no planned deprecation. GitHub-shaped YAML is an additional format, and
131
+ future known formats may be added through adapters. Every adapter compiles to
132
+ one versioned internal execution IR before the run is frozen; source files are
133
+ never rewritten into another authoring format.
134
+
135
+ Nested workflows are outside the initial design. A separately journaled child
136
+ workflow may be added after v1 if real usage demonstrates the need.
137
+
138
+ ### 2.7 Script or shell work: deterministic process execution
139
+
140
+ Scripts and explicit shell/process declarations are the deterministic
141
+ execution surface. They MUST remain distinct from command assets. Calling a
142
+ prompt template a command does not authorize it to run as an OS command.
143
+
144
+ The 0.9.2 task/workflow `run` field follows GitHub step semantics: it is a
145
+ string executed through the selected shell, with compatible `shell` and
146
+ `working-directory` controls where the host supports them.
147
+
148
+ ## 3. Native bundles and runtime translation
149
+
150
+ Native tool directories such as `.claude` and `.opencode` are registered as
151
+ ordinary AKM bundles. The owning `BundleAdapter` reads their native files and
152
+ translates recognized assets into AKM's runtime representation.
153
+
154
+ The following rules are explicit:
155
+
156
+ - The native file is authoritative.
157
+ - AKM does not create a canonical copy.
158
+ - AKM does not synchronize native directories with one another.
159
+ - AKM does not write native agent or command assets.
160
+ - Runtime translation is not a migration or a projection stored on disk.
161
+ - Identically named assets in different bundles remain distinct and can be
162
+ addressed with bundle-qualified refs.
163
+
164
+ Fields shared with a native format remain in that format's normal location.
165
+ Optional AKM-only extensions SHOULD be namespaced under `akm` to reduce the
166
+ chance of colliding with future native fields:
167
+
168
+ ```yaml
169
+ ---
170
+ description: Review a change
171
+ model: balanced
172
+ akm:
173
+ engine: reviewer
174
+ timeout: 20m
175
+ ---
176
+ ```
177
+
178
+ This namespace does not imply that AKM writes the file. It only gives a native
179
+ bundle author a collision-resistant place to opt into AKM-specific runtime
180
+ defaults.
181
+
182
+ ## 4. One configuration cascade
183
+
184
+ Ordinary execution values use one far-to-near cascade:
185
+
186
+ ```text
187
+ installation defaults
188
+ -> selected engine
189
+ -> selected agent
190
+ -> selected command
191
+ -> task/workflow defaults
192
+ -> current task, step, or CLI invocation
193
+ ```
194
+
195
+ The nearest explicit value wins. This rule includes engine, model, tools,
196
+ timeout, and other ordinary execution settings. Examples:
197
+
198
+ - a command's model overrides its selected agent's model preference;
199
+ - a task or workflow step overrides the command;
200
+ - a direct CLI model flag overrides every asset default; and
201
+ - omitting a field preserves the value from the next-farthest layer.
202
+
203
+ Selection and authorization are separate. In particular:
204
+
205
+ ```text
206
+ selected tools = nearest explicit tools value
207
+ effective tools = selected tools authorized by machine/user runtime policy
208
+ ```
209
+
210
+ Agent and command tool declarations do not intersect with each other. The
211
+ nearer declaration replaces the farther declaration like any other setting.
212
+ If the selected tools exceed operator authorization, AKM MUST fail explicitly;
213
+ it MUST NOT silently grant or silently reduce them.
214
+
215
+ Installed third-party bundle metadata participates in the same cascade as
216
+ locally authored metadata. Provenance does not create a second precedence
217
+ system. Authorization and budget policy remain the enforcement boundaries.
218
+
219
+ ## 5. Engine selection and fallback
220
+
221
+ The ordinary cascade selects the engine. In practical nearest-first terms:
222
+
223
+ ```text
224
+ CLI/step/task override
225
+ -> command default
226
+ -> agent default
227
+ -> configured installation default
228
+ -> documented fallback
229
+ ```
230
+
231
+ When no layer selects an engine, AKM uses the fixed `opencode-sdk` fallback if
232
+ it is available. The fallback MUST be announced, never silent. A configured
233
+ `defaults.engine` is the normal way to select an installation default and
234
+ preempts the fallback. If the fallback is unavailable, AKM fails with setup
235
+ guidance.
236
+
237
+ The fallback is deliberately not separately configurable: such a setting
238
+ would duplicate `defaults.engine`.
239
+
240
+ ## 6. Model maps and structured aliases
241
+
242
+ AKM ships a small starter map of provider-neutral intent aliases. The initial
243
+ vocabulary SHOULD stay small; `fast`, `balanced`, and `reasoning` are the
244
+ approved starting shape. These are conveniences, not permanent universal
245
+ model classifications.
246
+
247
+ The authoritative mechanism is data-driven and operator-owned. The long-term
248
+ mapping precedence is:
249
+
250
+ ```text
251
+ AKM starter defaults
252
+ -> explicitly adopted mapping pack
253
+ -> user or organization configuration
254
+ -> engine-specific overrides
255
+ ```
256
+
257
+ Bundles may select aliases. They MUST NOT redefine what an alias means on the
258
+ host. A bundle may distribute a suggested map, but it becomes active only when
259
+ the operator explicitly adopts it.
260
+
261
+ AKM 0.9.2 does not implement reusable mapping packs. It ships an immutable
262
+ default `models.json` with the installation and reads an optional,
263
+ user-editable `models.json` from the AKM configuration directory. The user
264
+ file overlays the installed default by alias and by field, so users need only
265
+ state differences. The default MUST NOT live in the cache: cache deletion or
266
+ eviction cannot be allowed to change model resolution. AKM provides an
267
+ explicit command that can copy the installed defaults into the user config
268
+ directory for full customization.
269
+
270
+ An alias mapping may be either:
271
+
272
+ 1. a simple exact model identifier; or
273
+ 2. a structured inference profile containing a model and related defaults.
274
+
275
+ A structured alias expands as defaults at the same cascade layer that selected
276
+ it. Explicit sibling fields and nearer layers win:
277
+
278
+ ```text
279
+ farther layers
280
+ -> selected alias profile
281
+ -> explicit fields beside the alias
282
+ -> nearer layers
283
+ ```
284
+
285
+ For example, if `reasoning` supplies `effort: high`, then an explicit
286
+ `effort: medium` beside `model: reasoning` wins.
287
+
288
+ ## 7. Optimistic lowering
289
+
290
+ AKM does not maintain a static matrix of every feature every model, endpoint,
291
+ and harness supports. Such a matrix would become stale and reject engines that
292
+ gain features independently.
293
+
294
+ Instead:
295
+
296
+ 1. Resolve the common cascade.
297
+ 2. Let the selected engine adapter translate the fields it understands.
298
+ 3. Emit structured notices for fields the adapter does not translate.
299
+ 4. Dispatch optimistically.
300
+ 5. Treat an actual provider or harness rejection as a runtime failure.
301
+
302
+ An untranslated setting is not a pre-dispatch capability failure. An operator
303
+ authorization violation is still a hard failure because it is policy, not a
304
+ capability guess.
305
+
306
+ When an engine has no native system-prompt channel, AKM MUST preserve the
307
+ persona by deterministically composing a clearly delimited persona block into
308
+ the user prompt. It SHOULD emit a lowering notice when it uses this fallback.
309
+
310
+ The 0.9.2 implementation makes that adapter choice structural. Every registered
311
+ harness contributes a concrete resolved-request lowerer through the harness
312
+ registry, and direct LLM is the remaining registered lowerer. The registry is
313
+ an inventory of implementations, not a table predicting model/provider
314
+ capabilities. Lowerers receive the exact model and inference selected by the
315
+ common cascade; they do not reinterpret aliases. They return stable translated
316
+ and untranslated field paths plus structured notices whose fixed messages and
317
+ metadata contain no prompt, environment value, credential value, or provider
318
+ error body.
319
+
320
+ LLM and SDK-fallback credentials stay as symbolic descriptors in engine
321
+ transport and frozen runner material; secret values never enter the resolved
322
+ request. Only final runner dispatch reads their current environment values. An
323
+ already-frozen runner uses the config-free lowering entry point, which does not
324
+ consult live config, aliases, environment variables, or credentials before
325
+ dispatch.
326
+
327
+ ## 8. Native agent selectors
328
+
329
+ A qualified `agents/...` ref is portable and resolves through AKM. A bare
330
+ agent name in a native command is a native harness selector.
331
+
332
+ For the initial implementation:
333
+
334
+ - a bare selector works with its matching native harness;
335
+ - an operator-defined selector mapping may translate it;
336
+ - the selected engine adapter may translate or consume it; and
337
+ - AKM fails with an actionable portability error if no deterministic
338
+ translation exists.
339
+
340
+ The core MUST NOT use fuzzy name or content matching to guess an equivalent
341
+ persona.
342
+
343
+ ## 9. Command arguments
344
+
345
+ The initial portable command-template contract is deliberately limited to a
346
+ single, one-pass `$ARGUMENTS` substitution. The invocation supplies the exact
347
+ argument string.
348
+
349
+ AKM MUST NOT initially claim portable support for positional `$N` placeholders
350
+ or named placeholders. Native tools disagree about positional indexing and
351
+ tokenization, and AKM has not established a portable named-argument source
352
+ syntax.
353
+
354
+ Native-only template constructs may remain in native source files and continue
355
+ to work when users invoke those files through their native tool. When AKM owns
356
+ execution, an unsupported native construct MUST produce an actionable
357
+ portability error before dispatch. AKM MUST NOT partially expand a command and
358
+ send the remainder to the model.
359
+
360
+ Template substitution is intentionally non-programmable: no expressions,
361
+ loops, conditionals, or recursive expansion.
362
+
363
+ ## 10. Resolution time and sessions
364
+
365
+ Direct command invocations and scheduled tasks resolve the current assets and
366
+ configuration when they execute.
367
+
368
+ Workflows use the same semantic resolver, then freeze its output when a run is
369
+ created. The frozen plan must include every dispatch-significant resolved
370
+ input needed for deterministic resume and replay, including the selected
371
+ agent/persona, command content after argument substitution, exact engine/model
372
+ settings, and relevant source identities or hashes.
373
+
374
+ AKM command execution starts a fresh, one-shot session by default. Reusing or
375
+ resuming a native session requires an explicit invocation option.
376
+
377
+ ## 11. Task and workflow source formats
378
+
379
+ ### 11.1 Task v3
380
+
381
+ Task v3 is an intentional breaking replacement for the 0.9.1 task schema. AKM
382
+ does not keep the v2 parser as a compatibility execution path. Instead,
383
+ `akm migrate` provides an explicit, previewable, fail-closed conversion. It
384
+ backs up files before writing, converts only deterministic cases, and stops
385
+ for manual review when an argv array or another v2 construct cannot be
386
+ translated portably into the v3 shell-string contract.
387
+
388
+ The executable part of a v3 task is GitHub-step-shaped:
389
+
390
+ - exactly one of `uses` or `run` selects the work;
391
+ - compatible fields such as `name`, `with`, `env`, `shell`, and
392
+ `working-directory` keep their GitHub spelling and location; and
393
+ - scheduling and other AKM-only controls use the `akm` namespace when the
394
+ source is a step-shaped task.
395
+
396
+ `uses` accepts both existing AKM refs and GitHub action refs. Their grammars
397
+ are deterministic: AKM does not introduce an `akm:` URI alias or guess whether
398
+ an unresolved string was intended as inline content. AKM command refs,
399
+ workflow refs, script refs, and future GitHub action refs remain distinct
400
+ resolved target kinds. An agent ref is never executable through `uses`.
401
+
402
+ Inline command content uses a built-in command action rather than a separate
403
+ prompt target. Its contract requires exactly one of `with.ref` or
404
+ `with.content`; `with.arguments` supplies the exact string substituted for the
405
+ portable `$ARGUMENTS` placeholder. Stored and inline forms compile to the same
406
+ command IR.
407
+
408
+ AKM accepts scheduling information through adapters in three source shapes:
409
+
410
+ 1. a step-shaped task with `akm.schedule`;
411
+ 2. a step-shaped task with a GitHub-style `on` block; or
412
+ 3. a complete GitHub-style `on` plus `jobs` document.
413
+
414
+ The third shape is exposed as one workflow asset, not as both a task and a
415
+ workflow. Its locally representable triggers create internal scheduler
416
+ bindings that use the existing OS-native scheduler backends. `schedule` maps
417
+ to scheduled execution and `workflow_dispatch` maps to manual execution.
418
+ Repository and service events such as `push`, `pull_request`, and `issues`
419
+ produce an explicit unsupported-trigger result in local execution; AKM does
420
+ not silently ignore them or install polling daemons.
421
+
422
+ ### 11.2 Workflow formats and internal IR
423
+
424
+ AKM Markdown and GitHub-shaped YAML are peer authoring formats. Adapters
425
+ compile both into a shared, internal, versioned IR. The IR deliberately reuses
426
+ known GitHub concepts such as `jobs`, `needs`, `steps`, `uses`, `run`, `with`,
427
+ and `env` where they fit. It is not the literal GitHub workflow schema and is
428
+ not a fourth public authoring format.
429
+
430
+ The IR also carries the information AKM needs for deterministic execution:
431
+ resolved command and persona snapshots, engine/model/tool settings, source
432
+ identity and hashes, adapter-owned supported extensions, lowering notices,
433
+ and journal/freeze metadata. Format adapters may preserve supported native
434
+ constructs explicitly. An unsupported construct produces an actionable
435
+ portability error or a structured lowering notice; it never creates a
436
+ format-specific executor alongside the shared scheduler.
437
+
438
+ GitHub interoperability is consumption-first. GitHub workflow and action files
439
+ remain authoritative and AKM will consume them through adapters; AKM does not
440
+ generate or synchronize GitHub files. Full GitHub workflow/action execution is
441
+ 0.9.3 work. A separate, deliberate future bridge is a public GitHub Action
442
+ package that invokes AKM from a GitHub workflow. That package uses typed
443
+ subpath actions such as `/command`, `/workflow`, and `/task`, backed by one
444
+ runtime. There is no `/prompt` action because prompt content is a command.
445
+
446
+ ## 12. 0.9.2 support boundary
447
+
448
+ 0.9.2 delivers the coherent MVP across direct CLI invocation, scheduled tasks,
449
+ and workflow freeze/resume. All currently registered execution profiles must
450
+ consume the same resolved request and lowering contract.
451
+
452
+ The native agent/command authoring formats in scope are the formats AKM already
453
+ recognizes: AKM native, Claude, and OpenCode. 0.9.2 does not add native file
454
+ adapters for Codex, Gemini, Aider, Copilot, Pi, Amazon Q, or OpenHands, but their
455
+ existing execution profiles must still accept unified resolved work. New
456
+ native authoring formats, full GitHub action/workflow ingestion, and the public
457
+ GitHub Action package begin in 0.9.3 or later.
458
+
459
+ ## 13. Implementation status
460
+
461
+ This document describes both the approved design and the staged 0.9.2
462
+ implementation boundary. The current line implements:
463
+
464
+ - the installed/operator `models.json` layers and exact alias/profile
465
+ expansion in the common far-to-near cascade;
466
+ - selection-versus-authorization handling for tools before engine lowering;
467
+ - canonical `akm command run`, adapter-rendered command/persona loading,
468
+ strict one-pass `$ARGUMENTS`, and the delegating non-interactive
469
+ `akm agent` compatibility surface;
470
+ - an engine-owned optimistic lowerer for all ten registered harnesses plus
471
+ direct LLM, with exact selected models, translated/untranslated field
472
+ inventories, deterministic persona/conversation composition, and
473
+ secret-free structured notices;
474
+ - runtime adapters for the existing task-v2 prompt arm, improve/proposal model
475
+ work, current frozen workflow units and judges, index passes, and shared
476
+ structured LLM calls; and
477
+ - symbolic LLM and SDK-fallback credentials until dispatch, including a
478
+ config-free path that lowers already-frozen runner material without
479
+ re-reading live config or aliases.
480
+
481
+ WP5 is therefore implemented as **runtime lowering convergence**. It does not
482
+ claim the still-separate WP6 task-v3 source schema/migrator, nor WP7's final
483
+ source-to-frozen durable workflow IR and resume-persistence convergence. The
484
+ current workflow adapter lowers its already-frozen engine invocation at run
485
+ time; that is not proof that the source plan froze a complete
486
+ `ResolvedExecutionRequestV1`. Workflow lowering notices are currently live
487
+ result/diagnostic metadata and are intentionally excluded from durable
488
+ result/evidence journal data; this specification does not assign future notice
489
+ persistence to WP7.
490
+
491
+ GitHub-step-shaped task sources, GitHub-shaped workflow compilation, durable
492
+ common-request freeze/resume, and their migrations remain WP6/WP7 work. Full
493
+ GitHub Actions semantics, remote action acquisition, and the public GitHub
494
+ Action package remain unsupported and out of scope.
495
+
496
+ Implementation work MUST preserve current public behavior deliberately or
497
+ document a migration. It MUST NOT describe a remaining WP6/WP7 gap as approved
498
+ semantics merely because an older task or workflow runtime already exists.
499
+
500
+ ## 14. Deferred decisions
501
+
502
+ The following remain deliberately outside 0.9.2:
503
+
504
+ - portable positional or named command arguments;
505
+ - nested or child workflows;
506
+ - reusable model mapping packs beyond the installed/user `models.json` layers;
507
+ - full GitHub workflow/action execution and the public GitHub Action package;
508
+ - additional native agent/command authoring formats; and
509
+ - the CLI syntax for explicit session reuse.
510
+
511
+ These require separate decisions or implementation evidence. They are not
512
+ license to add synchronization, native-asset write-back, a central capability
513
+ registry, or a second command-execution mode.