akm-cli 0.10.261009-beta → 0.10.261010-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 (50) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/STABILITY.md +15 -4
  3. package/dist/assets/prompts/memory-infer-system.md +1 -1
  4. package/dist/assets/prompts/memory-infer-user.md +3 -2
  5. package/dist/assets/ui/app.js +59 -2
  6. package/dist/assets/ui/asset.js +71 -6
  7. package/dist/assets/ui/bundles.js +80 -3
  8. package/dist/assets/ui/diff-view.js +1 -1
  9. package/dist/assets/ui/editor.js +103 -0
  10. package/dist/assets/ui/index.html +2 -0
  11. package/dist/assets/ui/lib.js +51 -1
  12. package/dist/assets/ui/markdown.js +86 -19
  13. package/dist/assets/ui/search.js +25 -5
  14. package/dist/assets/ui/styles.css +70 -0
  15. package/dist/commands/health/improve-metrics.js +11 -1
  16. package/dist/commands/health/md-report.js +3 -3
  17. package/dist/commands/improve/loop-stages.js +2 -2
  18. package/dist/commands/read/curate.js +1 -1
  19. package/dist/commands/read/knowledge.js +109 -77
  20. package/dist/commands/sources/bundle-cli.js +4 -6
  21. package/dist/commands/sources/installed-stashes.js +10 -19
  22. package/dist/commands/ui/api.js +95 -5
  23. package/dist/commands/ui/document-source.js +51 -0
  24. package/dist/commands/ui/git-read.js +18 -2
  25. package/dist/commands/ui/proposal-actions.js +5 -3
  26. package/dist/commands/ui/server.js +25 -13
  27. package/dist/commands/ui/ui-cli.js +3 -3
  28. package/dist/commands/ui/workspace-actions.js +264 -0
  29. package/dist/commands/workflow-cli.js +3 -1
  30. package/dist/core/asset/akm-markdown.js +19 -3
  31. package/dist/core/asset/markdown.js +14 -6
  32. package/dist/core/config/config.js +6 -4
  33. package/dist/core/non-task-input.js +67 -3
  34. package/dist/core/write-source.js +2 -2
  35. package/dist/indexer/index-writer-lock.js +5 -1
  36. package/dist/indexer/passes/memory-inference.js +28 -6
  37. package/dist/llm/memory-infer.js +23 -14
  38. package/dist/scripts/akm-migrate-node.js +18 -10
  39. package/dist/scripts/akm-migrate.js +18 -10
  40. package/dist/workflows/exec/environment.js +4 -8
  41. package/dist/workflows/parser.js +13 -4
  42. package/docs/architecture/0.10-process-rules.md +5 -3
  43. package/docs/architecture/internals/storage-locations.md +1 -1
  44. package/docs/guides/author-workflows.md +78 -28
  45. package/docs/guides/bundles.md +16 -2
  46. package/docs/reference/cli.md +39 -16
  47. package/docs/reference/env-and-secrets.md +11 -0
  48. package/docs/reference/ui-api.md +84 -8
  49. package/docs/reference/workflow-schema.md +63 -32
  50. package/package.json +1 -1
@@ -175,16 +175,22 @@ families) plus the orchestration keys:
175
175
  A step with neither is **still a unit step** — bare
176
176
  `- id: validate` is the complete minimal declaration. `unit:` is the
177
177
  optional dispatch-override bag (`exec`, `engine`, `model`, `llm`, `timeout`,
178
- `retry`, `on_error`, `env`; see
178
+ `retry`, `on_error`, `output`, `env`; see
179
179
  [Exec (shell) units](#exec-shell-units) and
180
- [Failure policy](#failure-policy)).
180
+ [Failure policy](#failure-policy)). Dispatch settings live under `unit:`
181
+ (`map.unit:` on a map step), not on the step itself; `unit.output` types
182
+ that unit's result, so a solo step puts its schema there.
181
183
  - `inputs` — on a `unit`/`map` step, the prior-step artifacts this step
182
184
  consumes, as bare reference strings (sub-paths legal:
183
185
  `steps.x.output.issues`, not just `steps.x.output`). This is how a step's
184
186
  attached context sees upstream data, and how replay hashing gets its exact
185
187
  input set — a step re-dispatches only when the slice it actually consumes
186
188
  changes.
187
- - `output` — a JSON Schema for the step's promoted artifact.
189
+ - `output` — a JSON Schema for the step's promoted artifact. On a `map` step
190
+ it checks the reducer's result. On any other step that is not a
191
+ child-`workflow` unit and whose `unit:` declares no `output` of its own, it
192
+ is also the unit's `output` schema, so the reply is parsed and checked as
193
+ JSON; `unit.output` is the explicit form.
188
194
  - `gate` — optional validation-loop configuration: `max_loops` bounds
189
195
  evaluator-optimizer retries (see
190
196
  [Gates and verification](#gates-and-verification)). The rubric itself lives
@@ -258,14 +264,15 @@ Fan-out, retries, gates, and a run budget:
258
264
  ```markdown
259
265
  ---
260
266
  type: workflow
261
- description: Review changed files and triage the outcome
267
+ description: Review changed files and give an overall verdict
262
268
  params:
263
269
  changed_files: { type: array, description: Files to review }
264
270
  defaults: { engine: reviewer, model: balanced, timeout: 10m, on_error: fail }
265
271
  budget: { max_units: 40, max_tokens: 200000 }
266
272
  steps:
267
273
  - id: discover
268
- output: { type: object, properties: { files: { type: array } }, required: [files] }
274
+ unit:
275
+ output: { type: object, properties: { files: { type: array } }, required: [files] }
269
276
  - id: review
270
277
  map:
271
278
  over: steps.discover.output.files
@@ -283,12 +290,8 @@ steps:
283
290
  gate: { max_loops: 2 }
284
291
  - id: aggregate
285
292
  inputs: [steps.review.output]
286
- output: { type: object, properties: { verdict: { type: string } }, required: [verdict] }
287
- - id: triage
288
- inputs: [steps.aggregate.output]
289
- - id: ship
290
- - id: rework
291
- - id: manual-triage
293
+ unit:
294
+ output: { type: object, properties: { verdict: { type: string } }, required: [verdict] }
292
295
  ---
293
296
 
294
297
  # Review Changes
@@ -318,25 +321,6 @@ Every changed file has a verdict of `pass` or `fail`.
318
321
  Combine the per-file review verdicts — attached to this unit as input via
319
322
  `inputs: [steps.review.output]` above — into one overall verdict, `pass` or
320
323
  `fail`.
321
-
322
- ## triage
323
-
324
- Read the verdict `aggregate` reported (attached as input) and decide whether
325
- the change should ship, be reworked, or go to manual triage; later steps act on
326
- that decision.
327
-
328
- ## ship
329
-
330
- Ship the change.
331
-
332
- ## rework
333
-
334
- Address the review findings. Confirming the fix is a fresh `akm workflow run`
335
- of this workflow, not a step this run goes back to.
336
-
337
- ## manual-triage
338
-
339
- Summarize the ambiguous verdict for a human to triage.
340
324
  ```
341
325
 
342
326
  ## The reference grammar
@@ -540,7 +524,7 @@ An exec unit names **no engine**. It carries no `engine`, `model`, or `llm` (the
540
524
  parser rejects those alongside `exec:`), it consumes no tokens, and a workflow
541
525
  made only of exec steps freezes and runs on an install with no engine configured
542
526
  at all. Everything else about a unit still applies unchanged: `timeout`, `retry`,
543
- `on_error`, `output`, `env`, `isolation`, `map` fan-out and its concurrency, the
527
+ `on_error`, `output`, `env`, `map` fan-out and its concurrency, the
544
528
  unit journal, budget accounting, and replay/reuse.
545
529
 
546
530
  The step's body prose is still required (it is the step's section, like any
@@ -647,6 +631,11 @@ failure reason.
647
631
  | `AKM_*` context too large for **this platform** to spawn | `exec_context_too_large` | **no** (an authoring/data problem) |
648
632
  | `cwd` resolved outside its base | `exec_cwd_escape` | **no** (tampering, never transient) |
649
633
 
634
+ `non_zero_exit` in `retry.on` re-runs a command that already ran, and a
635
+ command's exit is usually deterministic, so the retry mostly repeats the
636
+ failure and any side effects. For exec steps prefer
637
+ `retry: { max: 1, on: [timeout, spawn_failed] }`.
638
+
650
639
  A non-zero exit is an ordinary unit failure, so it flows through the ordinary
651
640
  policy: with the default `on_error: fail` it fails the step and the run — which
652
641
  is exactly what makes a `test` step a **gate**. With `on_error: continue` the
@@ -710,7 +699,6 @@ context blocks a model unit gets in its prompt:
710
699
  | `AKM_PARAMS` | the run params, canonical JSON |
711
700
  | `AKM_ITEM`, `AKM_ITEM_INDEX` | a `map` unit's item (canonical JSON) and 0-based index |
712
701
  | `AKM_INPUTS` | the step's declared `inputs:` artifacts, keyed by reference string |
713
- | `AKM_TASK_INPUTS` | a task-composed step's resolved `with:` bindings (canonical JSON), present only when the bindings are non-empty |
714
702
 
715
703
  These are applied *after* your `env:` bindings, so a binding can never shadow
716
704
  them.
@@ -832,6 +820,49 @@ a committed *value*, so it cannot carry "whatever this build agent's
832
820
  Values passed through this way are **not** redacted from the command's output
833
821
  the way `env:` binding values are, so never list a credential here.
834
822
 
823
+ #### Binding a secret to a unit
824
+
825
+ A unit's `env:` lists env assets by ref. A value inside an env asset can be a
826
+ `${secret:<name>}` token, which akm replaces with a secret when the unit is
827
+ dispatched. Say the bundle `team` holds `env/discord.env`:
828
+
829
+ ```sh
830
+ DISCORD_BOT_TOKEN=${secret:discord_bot_token}
831
+ ```
832
+
833
+ and the secret beside it, set with
834
+ `akm secret set secrets/discord_bot_token --bundle team`. The unit names the
835
+ env asset:
836
+
837
+ ```yaml
838
+ - id: announce
839
+ inputs: [steps.draft.output]
840
+ unit:
841
+ env: [team//env/discord]
842
+ exec:
843
+ command: ["node", "announce.mjs"]
844
+ ```
845
+
846
+ - `<name>` is read from the **env asset's own bundle's** `secrets/` directory.
847
+ It is a path there, not a ref: `bundle//name` inside the token is **not** a
848
+ bundle qualifier. `${secret:team//token}` reads `secrets/team/token` in the
849
+ env asset's bundle.
850
+ - It is the same token `akm env run` resolves. `akm env export` does not
851
+ resolve it; it writes the token verbatim.
852
+ - Freezing records the env ref, its key names and the secret names, never a
853
+ value. Values and secrets are read at dispatch. A missing secret fails the
854
+ step at dispatch ("frozen environment preflight failed") and nothing is
855
+ injected.
856
+ - Each dispatch that reads the env asset records an `env_access` event with the
857
+ ref, key names and secret names, never values.
858
+ - Every value from an env asset is treated as sensitive, secret or not, and is
859
+ redacted out of stdout, stderr and diagnostics before they are journaled. A
860
+ non-secret value such as a channel id would be redacted from the output too,
861
+ so pass it as a param or in `command:` instead.
862
+ - `env:` needs a child process: it works on exec units and on agent and SDK
863
+ engines. A unit on an `llm` engine that declares `env:` fails
864
+ `env_unsupported`.
865
+
835
866
  #### Durable v4 (`irVersion: 5`) forbids `inherit_env`
836
867
 
837
868
  Every new workflow start freezes the durable plan v4 family's current
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akm-cli",
3
- "version": "0.10.261009-beta",
3
+ "version": "0.10.261010-beta",
4
4
  "type": "module",
5
5
  "description": "akm (Agent Knowledge Manager) — a portable, local-first capability library for AI agents. Discover, load, share, and improve reusable skills, scripts, workflows, and knowledge across any shell-capable coding agent, including Claude Code, OpenCode, and Cursor.",
6
6
  "keywords": [