akm-cli 0.10.261012-beta → 0.10.261014-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.
- package/CHANGELOG.md +710 -3
- package/README.md +15 -0
- package/SECURITY.md +11 -10
- package/STABILITY.md +47 -51
- package/dist/assets/hints/cli-hints-full.md +21 -19
- package/dist/assets/hints/cli-hints-short.md +3 -4
- package/dist/assets/opencode/akm-plugin.js +177 -0
- package/dist/assets/stash-skeleton/README.md +1 -1
- package/dist/assets/tasks/core/improve.yml +1 -1
- package/dist/assets/tasks/improve/akm-improve-consolidate.yml +1 -1
- package/dist/assets/ui/config.js +27 -10
- package/dist/assets/workflows/workflow-template.md +2 -2
- package/dist/cli/clack.js +3 -1
- package/dist/cli/selection.js +33 -0
- package/dist/cli/shared.js +14 -1
- package/dist/cli/unknown-flags.js +6 -37
- package/dist/cli.js +69 -48
- package/dist/commands/agent/agent-dispatch.js +17 -25
- package/dist/commands/agent/contribute-cli.js +9 -8
- package/dist/commands/command/command-cli.js +4 -8
- package/dist/commands/command/command-execution.js +25 -39
- package/dist/commands/command/execution-source-loader.js +10 -14
- package/dist/commands/completions.js +1 -1
- package/dist/commands/config-cli.js +14 -5
- package/dist/commands/env/child-env.js +12 -14
- package/dist/commands/env/env-binding.js +47 -58
- package/dist/commands/env/env-cli.js +22 -24
- package/dist/commands/env/env.js +10 -58
- package/dist/commands/env/secret-cli.js +11 -29
- package/dist/commands/env/secret.js +3 -10
- package/dist/commands/health/checks.js +10 -849
- package/dist/commands/health/connections-and-harnesses-check.js +109 -0
- package/dist/commands/health/egress.js +3 -3
- package/dist/commands/health/html-report.js +9 -10
- package/dist/commands/health/plugin-staleness.js +18 -11
- package/dist/commands/health/report-view-model.js +16 -12
- package/dist/commands/health/scheduler-binary.js +1 -1
- package/dist/commands/health/semantic-search-check.js +85 -0
- package/dist/commands/health/type-directory-check.js +0 -3
- package/dist/commands/health.js +30 -42
- package/dist/commands/improve/consolidate/pair-pass.js +10 -25
- package/dist/commands/improve/consolidate.js +10 -15
- package/dist/commands/improve/distill.js +5 -17
- package/dist/commands/improve/eligibility.js +1 -3
- package/dist/commands/improve/execution.js +37 -40
- package/dist/commands/improve/extract-cli.js +6 -11
- package/dist/commands/improve/extract-prompt.js +2 -2
- package/dist/commands/improve/extract.js +67 -97
- package/dist/commands/improve/improve-cli.js +22 -128
- package/dist/commands/improve/improve-report.js +1 -1
- package/dist/commands/improve/improve-strategies.js +25 -108
- package/dist/commands/improve/improve.js +10 -14
- package/dist/commands/improve/loop-stages.js +3 -0
- package/dist/commands/improve/memory/memory-improve.js +1 -1
- package/dist/commands/improve/preparation.js +8 -13
- package/dist/commands/improve/reflect.js +203 -332
- package/dist/commands/improve/retrieval-scope.js +1 -1
- package/dist/commands/improve/session-asset.js +3 -2
- package/dist/commands/improve/stage.js +87 -115
- package/dist/commands/lint/base-linter.js +3 -3
- package/dist/commands/lint/env-key-rules.js +7 -6
- package/dist/commands/lint/index.js +3 -3
- package/dist/commands/models-cli.js +103 -63
- package/dist/commands/proposal/drain.js +26 -39
- package/dist/commands/proposal/proposal-cli.js +14 -18
- package/dist/commands/proposal/propose-cli.js +4 -2
- package/dist/commands/proposal/propose.js +37 -64
- package/dist/commands/proposal/repository.js +17 -17
- package/dist/commands/proposal/validators/proposal-validators.js +3 -6
- package/dist/commands/read/curate.js +10 -6
- package/dist/commands/read/registry-search.js +2 -48
- package/dist/commands/read/search-cli.js +1 -8
- package/dist/commands/read/search.js +5 -6
- package/dist/commands/read/show.js +6 -29
- package/dist/commands/remember.js +25 -40
- package/dist/commands/sources/add-cli.js +8 -63
- package/dist/commands/sources/bundle-cli.js +8 -9
- package/dist/commands/sources/bundle-config-ops.js +2 -2
- package/dist/commands/sources/info.js +12 -1
- package/dist/commands/sources/init.js +1 -1
- package/dist/commands/sources/installed-stashes.js +119 -63
- package/dist/commands/sources/migration-help.js +1 -1
- package/dist/commands/sources/plugin-upgrade.js +8 -15
- package/dist/commands/sources/schema-repair.js +4 -10
- package/dist/commands/sources/source-add.js +2 -2
- package/dist/commands/sources/source-clone.js +31 -7
- package/dist/commands/sources/source-manage.js +4 -4
- package/dist/commands/targets.js +175 -0
- package/dist/commands/tasks/explain.js +104 -69
- package/dist/commands/tasks/tasks-cli.js +9 -11
- package/dist/commands/tasks/tasks.js +75 -97
- package/dist/commands/ui/api.js +11 -3
- package/dist/commands/ui/redact.js +5 -31
- package/dist/commands/ui/workspace-actions.js +1 -1
- package/dist/commands/workflow/plan.js +48 -9
- package/dist/commands/workflow-cli.js +40 -45
- package/dist/core/adapter/adapters/agent-skills-adapter.js +10 -11
- package/dist/core/adapter/adapters/akm-adapter.js +36 -41
- package/dist/core/adapter/adapters/akm-lint.js +10 -12
- package/dist/core/adapter/adapters/akm-metadata.js +2 -2
- package/dist/core/adapter/adapters/akm-task-adapter.js +8 -9
- package/dist/core/adapter/adapters/akm-workflow-adapter.js +5 -5
- package/dist/core/adapter/adapters/claude-adapter.js +1 -1
- package/dist/core/adapter/adapters/dotenv-adapter.js +7 -6
- package/dist/core/adapter/adapters/generic-files-adapter.js +5 -5
- package/dist/core/adapter/adapters/index.js +3 -4
- package/dist/core/adapter/adapters/llm-wiki-adapter.js +12 -14
- package/dist/core/adapter/adapters/okf-adapter.js +8 -10
- package/dist/core/adapter/adapters/opencode-adapter.js +1 -1
- package/dist/core/adapter/adapters/shared.js +3 -3
- package/dist/core/adapter/adapters/tool-dir-shared.js +7 -25
- package/dist/core/adapter/adapters/website-snapshot-adapter.js +3 -3
- package/dist/core/adapter/detect-adapter.js +1 -1
- package/dist/core/adapter/execution-source.js +13 -35
- package/dist/core/adapter/registry.js +1 -1
- package/dist/core/adapter/validate-context.js +2 -4
- package/dist/core/asset/asset-placement.js +1 -1
- package/dist/core/asset/asset-ref.js +3 -3
- package/dist/core/asset/resolve-ref.js +5 -0
- package/dist/core/bundle-rename.js +12 -4
- package/dist/core/closest-match.js +37 -0
- package/dist/core/common.js +37 -57
- package/dist/core/config/config-io.js +26 -18
- package/dist/core/config/config-schema.js +19 -106
- package/dist/core/config/config-sources.js +3 -3
- package/dist/core/config/config-types.js +4 -4
- package/dist/core/config/config-walker.js +50 -77
- package/dist/core/config/config.js +438 -109
- package/dist/core/config/convert-engine-references.js +114 -0
- package/dist/core/config/convert-engines-shared.js +40 -0
- package/dist/core/config/convert-engines.js +300 -0
- package/dist/core/config/convert-models-overlay.js +137 -0
- package/dist/core/config/credentials.js +304 -0
- package/dist/core/config/engine-semantics.js +3 -3
- package/dist/core/config/migrate-keys.js +222 -0
- package/dist/core/config/model-aliases.js +37 -0
- package/dist/core/config/models-file.js +34 -0
- package/dist/core/config/retired-engines.js +53 -0
- package/dist/core/config/schema/connections.js +41 -0
- package/dist/core/config/schema/embedding.js +2 -2
- package/dist/core/config/schema/harnesses.js +41 -0
- package/dist/core/config/schema/improve-processes.js +9 -28
- package/dist/core/config/schema/improve.js +36 -1
- package/dist/core/config/schema/index-config.js +18 -20
- package/dist/core/config/schema/primitives.js +42 -17
- package/dist/core/config/schema/search.js +6 -11
- package/dist/core/config/schema/sources-bundles.js +9 -9
- package/dist/core/config/schema/workflow.js +2 -6
- package/dist/core/config/unusable-entries.js +66 -0
- package/dist/core/content-safety.js +3 -6
- package/dist/core/endpoint-url.js +47 -0
- package/dist/core/env-secret-ref.js +84 -73
- package/dist/core/errors.js +10 -16
- package/dist/core/extra-params.js +3 -3
- package/dist/core/improve-result.js +8 -9
- package/dist/core/json-schema.js +1 -1
- package/dist/core/lesson-lint.js +1 -1
- package/dist/core/llm-inference.js +80 -0
- package/dist/core/parse.js +2 -2
- package/dist/core/paths.js +33 -10
- package/dist/core/recognition-util.js +8 -10
- package/dist/core/redaction.js +94 -55
- package/dist/core/ref-token.js +82 -0
- package/dist/core/secret-value.js +14 -0
- package/dist/core/state/migrations.js +17 -22
- package/dist/core/structured.js +2 -68
- package/dist/core/subprocess.js +63 -22
- package/dist/core/type-presentation.js +10 -14
- package/dist/core/write-source.js +20 -4
- package/dist/execution/input-contract.js +3 -6
- package/dist/execution/notices.js +49 -0
- package/dist/execution/resolved-request.js +24 -40
- package/dist/execution/source.js +21 -45
- package/dist/execution/target-ref.js +2 -2
- package/dist/indexer/bundle-identity-guard.js +6 -5
- package/dist/indexer/ensure-index.js +1 -1
- package/dist/indexer/index-writer-lock.js +1 -1
- package/dist/indexer/indexer.js +46 -42
- package/dist/indexer/installations.js +12 -22
- package/dist/indexer/lookup/adapter-concept-owner.js +40 -14
- package/dist/indexer/materialize-embeddings.js +20 -16
- package/dist/indexer/passes/memory-inference.js +21 -50
- package/dist/indexer/passes/metadata.js +5 -5
- package/dist/indexer/scan/doc-to-entry.js +1 -1
- package/dist/indexer/scan/drain-dir.js +9 -11
- package/dist/indexer/search/db-search.js +9 -7
- package/dist/indexer/search/search-source.js +42 -22
- package/dist/indexer/usage/usage-events.js +2 -3
- package/dist/indexer/walk/index-context.js +2 -1
- package/dist/indexer/walk/matchers.js +3 -11
- package/dist/indexer/walk/path-resolver.js +13 -68
- package/dist/indexer/walk/walker.js +32 -26
- package/dist/integrations/agent/akm-read-tools.js +81 -0
- package/dist/integrations/agent/config.js +1 -1
- package/dist/integrations/agent/detect.js +32 -36
- package/dist/integrations/agent/execution.js +130 -428
- package/dist/integrations/agent/index.js +1 -1
- package/dist/integrations/agent/profiles.js +24 -28
- package/dist/integrations/agent/prompts.js +17 -30
- package/dist/integrations/agent/request-lowering.js +67 -101
- package/dist/integrations/agent/resolution.js +332 -0
- package/dist/integrations/agent/runner-dispatch.js +156 -181
- package/dist/integrations/agent/runner.js +20 -70
- package/dist/integrations/agent/runtime-port.js +4 -0
- package/dist/integrations/agent/runtime.js +10 -0
- package/dist/integrations/agent/spawn.js +65 -190
- package/dist/integrations/harnesses/aider/index.js +19 -39
- package/dist/integrations/harnesses/amazonq/index.js +17 -32
- package/dist/integrations/harnesses/claude/index.js +59 -28
- package/dist/integrations/harnesses/claude/session-log.js +7 -5
- package/dist/integrations/harnesses/codex/index.js +19 -31
- package/dist/integrations/harnesses/copilot/index.js +17 -35
- package/dist/integrations/harnesses/gemini/index.js +18 -34
- package/dist/integrations/harnesses/harness.js +36 -0
- package/dist/integrations/harnesses/index.js +20 -51
- package/dist/integrations/harnesses/opencode/agent-builder.js +132 -100
- package/dist/integrations/harnesses/opencode/index.js +11 -33
- package/dist/integrations/harnesses/opencode/roots.js +50 -0
- package/dist/integrations/harnesses/opencode/runtime/binary.js +206 -0
- package/dist/integrations/harnesses/opencode/runtime/command.js +152 -0
- package/dist/integrations/harnesses/opencode/runtime/index.js +177 -0
- package/dist/integrations/harnesses/opencode/runtime/tar.js +107 -0
- package/dist/integrations/harnesses/opencode/session-log-v1.js +15 -7
- package/dist/integrations/harnesses/opencode/session-log-v2.js +72 -48
- package/dist/integrations/harnesses/opencode/session-log.js +58 -137
- package/dist/integrations/harnesses/opencode/version.js +34 -53
- package/dist/integrations/harnesses/openhands/index.js +13 -37
- package/dist/integrations/harnesses/pi/index.js +21 -32
- package/dist/integrations/lockfile.js +1 -1
- package/dist/integrations/session-logs/index.js +11 -31
- package/dist/llm/client.js +93 -111
- package/dist/llm/embedder.js +19 -34
- package/dist/llm/embedders/connection.js +31 -0
- package/dist/llm/embedders/local-model-files.js +56 -0
- package/dist/llm/embedders/local.js +146 -115
- package/dist/llm/embedders/remote.js +26 -23
- package/dist/llm/embedders/types.js +1 -1
- package/dist/llm/index-passes.js +33 -39
- package/dist/llm/memory-infer.js +67 -77
- package/dist/llm/model-list.js +35 -0
- package/dist/llm/rerank-client.js +8 -14
- package/dist/llm/structured-call.js +45 -99
- package/dist/llm/structured.js +60 -0
- package/dist/output/renderers.js +2 -8
- package/dist/output/shapes/helpers.js +18 -44
- package/dist/output/shapes/passthrough.js +1 -0
- package/dist/output/shapes.js +1 -7
- package/dist/output/text/command-format.js +41 -39
- package/dist/output/text/health-format.js +8 -2
- package/dist/output/text/helpers.js +1 -1
- package/dist/output/text/migrate.js +12 -0
- package/dist/output/text/models.js +3 -2
- package/dist/output/text/registry-commands.js +1 -2
- package/dist/output/text/show-directives.js +16 -28
- package/dist/output/text/show-format.js +0 -2
- package/dist/output/text/targets-table.js +70 -0
- package/dist/output/text/workflow-format.js +44 -15
- package/dist/output/text.js +1 -1
- package/dist/registry/providers/skills-sh.js +1 -28
- package/dist/registry/providers/static-index.js +1 -71
- package/dist/runtime.js +6 -2
- package/dist/scripts/akm-migrate-node.js +47095 -44905
- package/dist/scripts/akm-migrate.js +46946 -44755
- package/dist/setup/detect.js +28 -273
- package/dist/setup/endpoint.js +36 -0
- package/dist/setup/semantic-assets.js +13 -19
- package/dist/setup/setup-flags.js +77 -0
- package/dist/setup/setup-plan.js +144 -0
- package/dist/setup/setup.js +134 -358
- package/dist/setup/steps/connection-shared.js +49 -101
- package/dist/setup/steps/connection.js +121 -524
- package/dist/setup/steps/embeddings.js +151 -0
- package/dist/setup/steps/harnesses.js +118 -0
- package/dist/setup/steps/platforms.js +2 -81
- package/dist/setup/steps/tasks.js +1 -2
- package/dist/setup/steps.js +10 -0
- package/dist/setup/summary.js +67 -0
- package/dist/sources/freshness.js +16 -21
- package/dist/sources/providers/git-provider.js +2 -9
- package/dist/sources/providers/provider-utils.js +13 -5
- package/dist/sources/resolve.js +12 -16
- package/dist/sources/snapshot-fetchers/robots.js +11 -12
- package/dist/sources/snapshot-fetchers/secret-seam.js +2 -4
- package/dist/sources/snapshot-fetchers/website-ingest.js +8 -15
- package/dist/sources/snapshot-fetchers/x.js +1 -1
- package/dist/standalone/onnxruntime-library.js +52 -0
- package/dist/storage/repositories/improve-ledger-repository.js +1 -1
- package/dist/storage/repositories/improve-runs-repository.js +0 -13
- package/dist/storage/repositories/index-entries-repository.js +2 -2
- package/dist/storage/repositories/proposals-repository.js +2 -2
- package/dist/storage/repositories/task-history-repository.js +2 -2
- package/dist/storage/repositories/workflow-runs-repository.js +44 -129
- package/dist/storage/sqlite-read-snapshot.js +33 -29
- package/dist/tasks/embedded.js +1 -1
- package/dist/tasks/log-redaction.js +7 -119
- package/dist/tasks/prepare/prepare-support.js +8 -7
- package/dist/tasks/prepare/prepare.js +8 -9
- package/dist/tasks/prepare/script-capture.js +9 -25
- package/dist/tasks/run/attempt-lifecycle.js +17 -35
- package/dist/tasks/run/load-task.js +54 -27
- package/dist/tasks/run/run-command-task.js +15 -10
- package/dist/tasks/run/run-native-task.js +8 -21
- package/dist/tasks/run/run-task.js +5 -8
- package/dist/tasks/run/run-workflow-task.js +14 -21
- package/dist/tasks/run/task-history.js +9 -17
- package/dist/tasks/run/task-log.js +1 -5
- package/dist/tasks/scheduler-invocation.js +13 -18
- package/dist/tasks/scheduler-sync.js +0 -1
- package/dist/tasks/source/bounded-document.js +31 -117
- package/dist/tasks/source/parse-task-source.js +0 -1
- package/dist/tasks/source/project-v4.js +5 -3
- package/dist/tasks/source/task-input-diagnostics.js +3 -4
- package/dist/tasks/source/task-source-v4.js +48 -72
- package/dist/tasks/source-v3.js +2 -5
- package/dist/tasks/task-run-reserved-flags.js +1 -2
- package/dist/workflows/authoring/authoring.js +2 -7
- package/dist/workflows/compile.js +1 -15
- package/dist/workflows/concurrency-policy.js +4 -4
- package/dist/workflows/exec/child-workflow.js +1 -4
- package/dist/workflows/exec/dispatch-redaction.js +35 -86
- package/dist/workflows/exec/environment.js +13 -77
- package/dist/workflows/exec/exec-unit.js +14 -55
- package/dist/workflows/exec/frozen-judge.js +26 -28
- package/dist/workflows/exec/native-executor.js +126 -71
- package/dist/workflows/exec/run-workflow.js +38 -42
- package/dist/workflows/exec/step-work.js +13 -17
- package/dist/workflows/exec/unit-dispatch.js +7 -21
- package/dist/workflows/freeze/environment.js +14 -119
- package/dist/workflows/freeze/freeze.js +14 -33
- package/dist/workflows/freeze/step-values.js +6 -13
- package/dist/workflows/freeze/targets/child-workflow.js +3 -5
- package/dist/workflows/freeze/targets/command.js +9 -15
- package/dist/workflows/freeze/targets/shell.js +0 -3
- package/dist/workflows/freeze/task-bindings.js +0 -1
- package/dist/workflows/parser.js +50 -59
- package/dist/workflows/plan.js +8 -2
- package/dist/workflows/renderer.js +83 -9
- package/dist/workflows/resource-limits.js +2 -2
- package/dist/workflows/runtime/run-plan.js +38 -23
- package/dist/workflows/runtime/runs.js +55 -93
- package/dist/workflows/runtime/workflow-asset-loader.js +55 -86
- package/dist/workflows/source-files.js +7 -19
- package/docs/README.md +10 -16
- package/docs/architecture/README.md +2 -37
- package/docs/architecture/adapters.md +2 -2
- package/docs/architecture/akm-core-principles.md +256 -118
- package/docs/architecture/architecture.md +283 -99
- package/docs/architecture/improvement.md +8 -2
- package/docs/architecture/internals/classification.md +1 -3
- package/docs/architecture/internals/fresh-host-rebuild-runbook.md +7 -6
- package/docs/architecture/internals/health-advisories.md +35 -74
- package/docs/architecture/internals/improve-workflow.md +27 -26
- package/docs/architecture/internals/indexing.md +3 -3
- package/docs/architecture/internals/storage-locations.md +48 -15
- package/docs/architecture/persisted-data-compat.md +10 -6
- package/docs/architecture/specs/okf-support.md +9 -11
- package/docs/architecture/specs/ref.md +7 -9
- package/docs/architecture/testing/testing-workflow.md +172 -52
- package/docs/architecture/workflow-engine.md +51 -34
- package/docs/guides/README.md +0 -1
- package/docs/guides/author-bundles.md +15 -20
- package/docs/guides/author-workflows.md +93 -71
- package/docs/guides/bundles.md +20 -16
- package/docs/guides/discover-and-load.md +1 -1
- package/docs/guides/getting-started.md +49 -3
- package/docs/guides/improve-the-library.md +10 -4
- package/docs/guides/recipes/headless-install.md +11 -16
- package/docs/guides/run-workflows.md +29 -20
- package/docs/guides/scheduling.md +2 -2
- package/docs/guides/use-with-any-agent.md +20 -22
- package/docs/integration/bundling-akm.md +19 -9
- package/docs/maintainers/README.md +2 -6
- package/docs/maintainers/release-checklist.md +73 -126
- package/docs/migration/README.md +10 -3
- package/docs/migration/release-notes/0.10.0.md +81 -16
- package/docs/migration/release-notes/0.6.0.md +1 -1
- package/docs/migration/release-notes/0.7.0.md +1 -1
- package/docs/migration/release-notes/0.9.0.md +1 -1
- package/docs/migration/release-notes/README.md +1 -1
- package/docs/migration/v0.9-to-v0.10.md +300 -60
- package/docs/migration/v0.9.1-to-v0.9.2.md +6 -5
- package/docs/posts/config-v2-lessons-16.md +1 -1
- package/docs/posts/llm-mode-reflect-13.md +1 -1
- package/docs/posts/release-0.6.0.md +11 -11
- package/docs/posts/release-0.8.0.md +4 -4
- package/docs/posts/workflows-vaults-09.md +1 -1
- package/docs/reference/README.md +1 -1
- package/docs/reference/asset-types.md +2 -2
- package/docs/reference/cli.md +477 -388
- package/docs/reference/configuration.md +569 -550
- package/docs/reference/data-and-telemetry.md +9 -6
- package/docs/reference/env-and-secrets.md +72 -15
- package/docs/reference/refs.md +3 -20
- package/docs/reference/registry.md +12 -38
- package/docs/reference/supported-formats.md +1 -1
- package/docs/reference/tasks.md +22 -11
- package/docs/reference/ui-api.md +14 -9
- package/docs/reference/workflow-schema.md +199 -154
- package/docs/reference/workflows.md +4 -6
- package/package.json +9 -11
- package/schemas/akm-config.json +1696 -2922
- package/schemas/akm-task.json +4 -4
- package/schemas/akm-workflow.json +36 -9
- package/ROADMAP.md +0 -112
- package/dist/assets/models.json +0 -35
- package/dist/commands/health/engine-usage.js +0 -45
- package/dist/commands/sources/dangerous-env-audit.js +0 -134
- package/dist/core/activation-policy.js +0 -67
- package/dist/core/config/schema/engines.js +0 -160
- package/dist/core/config/schema/execution.js +0 -23
- package/dist/core/spawn-env.js +0 -268
- package/dist/execution/directory-identity.js +0 -78
- package/dist/integrations/agent/builder-shared.js +0 -33
- package/dist/integrations/agent/builders.js +0 -43
- package/dist/integrations/agent/engine-fallback.js +0 -59
- package/dist/integrations/agent/engine-resolution.js +0 -333
- package/dist/integrations/agent/model-map.js +0 -475
- package/dist/integrations/harnesses/aider/agent-builder.js +0 -107
- package/dist/integrations/harnesses/aider/result-extractor.js +0 -53
- package/dist/integrations/harnesses/amazonq/agent-builder.js +0 -138
- package/dist/integrations/harnesses/amazonq/result-extractor.js +0 -48
- package/dist/integrations/harnesses/claude/agent-builder.js +0 -106
- package/dist/integrations/harnesses/claude/config-import.js +0 -67
- package/dist/integrations/harnesses/claude/result-extractor.js +0 -67
- package/dist/integrations/harnesses/codex/agent-builder.js +0 -150
- package/dist/integrations/harnesses/codex/result-extractor.js +0 -110
- package/dist/integrations/harnesses/copilot/agent-builder.js +0 -117
- package/dist/integrations/harnesses/copilot/result-extractor.js +0 -178
- package/dist/integrations/harnesses/gemini/agent-builder.js +0 -114
- package/dist/integrations/harnesses/gemini/result-extractor.js +0 -149
- package/dist/integrations/harnesses/opencode/config-import.js +0 -149
- package/dist/integrations/harnesses/opencode/model-config.js +0 -33
- package/dist/integrations/harnesses/opencode/model-work-agent.js +0 -115
- package/dist/integrations/harnesses/opencode/session-log-types.js +0 -12
- package/dist/integrations/harnesses/opencode-sdk/index.js +0 -44
- package/dist/integrations/harnesses/opencode-sdk/sdk-runner.js +0 -1052
- package/dist/integrations/harnesses/opencode-sdk/v1-adapter.js +0 -199
- package/dist/integrations/harnesses/opencode-sdk/v2-adapter.js +0 -254
- package/dist/integrations/harnesses/opencode-sdk/wire.js +0 -66
- package/dist/integrations/harnesses/openhands/agent-builder.js +0 -120
- package/dist/integrations/harnesses/openhands/result-extractor.js +0 -135
- package/dist/integrations/harnesses/pi/agent-builder.js +0 -89
- package/dist/integrations/harnesses/pi/result-extractor.js +0 -168
- package/dist/integrations/harnesses/shared.js +0 -18
- package/dist/integrations/harnesses/types.js +0 -55
- package/dist/llm/feature-gate.js +0 -115
- package/dist/output/shapes/models-list.js +0 -16
- package/dist/output/shapes/registry-search.js +0 -10
- package/dist/setup/detected-engines.js +0 -136
- package/dist/setup/engine-config.js +0 -97
- package/dist/setup/harness-config-import.js +0 -47
- package/dist/setup/providers.js +0 -14
- package/dist/setup/steps/semantic.js +0 -39
- package/dist/workflows/authoring/scope-key.js +0 -79
- package/dist/workflows/exec/lowering-notices.js +0 -23
- package/dist/workflows/source-semantics.js +0 -110
- package/docs/architecture/0.10-process-rules.md +0 -832
- package/docs/architecture/akm-architecture-decision-history.md +0 -2055
- package/docs/architecture/comparisons/claude-code-vs-akm-workflows-full.md +0 -550
- package/docs/architecture/decisions/0001-no-interpolation-attached-structured-context.md +0 -72
- package/docs/architecture/decisions/0002-unit-reuse-and-input-hash-scope.md +0 -142
- package/docs/architecture/decisions/0003-child-env-allowlist-and-provenance.md +0 -189
- package/docs/architecture/decisions/0004-task-input-contract-and-flag-coercion.md +0 -97
- package/docs/architecture/decisions/0005-task-result-vocabulary-and-legacy-read-mapping.md +0 -108
- package/docs/architecture/decisions/0006-task-source-version-routing.md +0 -124
- package/docs/architecture/decisions/0007-workflow-composition-bounds.md +0 -83
- package/docs/architecture/decisions/0008-task-binding-normalization.md +0 -88
- package/docs/architecture/decisions/0009-child-run-publication-column-parity.md +0 -80
- package/docs/architecture/decisions/0010-driver-protocol-cut.md +0 -36
- package/docs/architecture/decisions/0011-engine-run-loop-invariants.md +0 -125
- package/docs/architecture/decisions/README.md +0 -62
- package/docs/architecture/internals/functional-contract-patterns.md +0 -340
- package/docs/architecture/internals/registry-network-boundary.md +0 -57
- package/docs/architecture/internals/search.md +0 -248
- package/docs/architecture/reviews/env-secret-access.md +0 -319
- package/docs/architecture/runtime-boundary-design.md +0 -153
- package/docs/architecture/specs/0.9.0-close-out-plan.md +0 -361
- package/docs/architecture/specs/0.9.0-decisions.md +0 -532
- package/docs/architecture/specs/0.9.0-docs-code-drift-register.md +0 -745
- package/docs/architecture/specs/0.9.0-open-items-register.md +0 -135
- package/docs/architecture/specs/0.9.0-public-api-issue-backlog.md +0 -740
- package/docs/architecture/specs/0.9.0-release-surface-review.md +0 -636
- package/docs/architecture/specs/agent-command-engine-model-design.md +0 -513
- package/docs/architecture/specs/akm-0.9.0-bundle-adapter-spec.md +0 -501
- package/docs/architecture/specs/akm-0.9.0-ref-grammar-decision.md +0 -291
- package/docs/architecture/specs/akm-format-neutral-bundle-workspace-spec.md +0 -2059
- package/docs/architecture/specs/di-seams-plan.md +0 -539
- package/docs/architecture/specs/driver-protocol-keep-or-cut.md +0 -275
- package/docs/architecture/specs/fact-asset-type.md +0 -142
- package/docs/architecture/specs/improve-collapse-churn-detector-design.md +0 -634
- package/docs/architecture/specs/reviews/task-workflow-unification/README.md +0 -72
- package/docs/architecture/specs/reviews/task-workflow-unification/findings-consolidated.md +0 -152
- package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-alternatives.md +0 -352
- package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-bunqueue.md +0 -300
- package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-openworkflow.md +0 -402
- package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-1.md +0 -758
- package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-2.md +0 -645
- package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-3.md +0 -602
- package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-adversarial.md +0 -27
- package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-architecture.md +0 -27
- package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-coverage.md +0 -74
- package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-security.md +0 -15
- package/docs/architecture/specs/reviews/task-workflow-unification/panel-r2-adversarial.md +0 -132
- package/docs/architecture/specs/reviews/task-workflow-unification/panel-r2-verification.md +0 -147
- package/docs/architecture/specs/stash-conventions-code-spec.md +0 -275
- package/docs/architecture/specs/stash-organization-conventions.md +0 -377
- package/docs/architecture/specs/task-workflow-format-unification.md +0 -721
- package/docs/architecture/specs/workflow-engine-buy-vs-build.md +0 -231
- package/docs/architecture/specs/workflow-format-unification.md +0 -432
- package/docs/architecture/testing/manual-testing-checklist.md +0 -3411
- package/docs/architecture/testing/okf-v0.2-conformance-runbook.md +0 -924
- package/docs/architecture/testing/task-workflow-manual-tests.md +0 -1720
- package/docs/guides/claude-code-vs-akm-workflows.md +0 -29
- package/docs/guides/knowledge-management.md +0 -18
- package/docs/maintainers/curate-workmap.md +0 -335
- package/docs/migration/v0.5-to-v0.6.md +0 -759
- package/docs/migration/v0.7-to-v0.8.md +0 -1378
- package/docs/plans/0.9.2-agent-command-workflow-plan.md +0 -423
|
@@ -51,9 +51,9 @@ steps:
|
|
|
51
51
|
The step needs a `## investigate` body section like any other step (it is
|
|
52
52
|
documentation for a human; the child's own steps carry the instructions).
|
|
53
53
|
|
|
54
|
-
- `workflow` names the child. A workflow unit
|
|
55
|
-
carries its own environment, so `exec`, `
|
|
56
|
-
beside `workflow` are lint errors. `workflow` is not allowed inside
|
|
54
|
+
- `workflow` names the child. A workflow unit runs no model of its own and the
|
|
55
|
+
child carries its own environment, so `exec`, `connection`, `harness`, `model`,
|
|
56
|
+
`llm` and `env` beside `workflow` are lint errors. `workflow` is not allowed inside
|
|
57
57
|
`map.unit`.
|
|
58
58
|
- `with:` binds the child's declared `params:` (a workflow has no `inputs:`).
|
|
59
59
|
Each value is a literal (validated against the param's declared type at
|
|
@@ -159,12 +159,14 @@ families) plus the orchestration keys:
|
|
|
159
159
|
- `params` — name → `{ type, description, default }` (JSON-Schema-typed, unlike a bare
|
|
160
160
|
description string). A param the run does not supply takes its `default:`; an explicit
|
|
161
161
|
value wins. Params are never required.
|
|
162
|
-
- `defaults` — run-level dispatch defaults (`
|
|
163
|
-
`timeout`, `on_error`), overridable per unit.
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
step
|
|
167
|
-
|
|
162
|
+
- `defaults` — run-level dispatch defaults (`connection`, `harness`, `model`,
|
|
163
|
+
`llm`, `timeout`, `on_error`), overridable per unit. A step with neither runs
|
|
164
|
+
on the default harness, else akm's own runtime over the default connection.
|
|
165
|
+
`llm:` tuning (`temperature`, `max_tokens`, `enable_thinking`,
|
|
166
|
+
`reasoning_effort`) reaches every step, and a document-level `llm:` reaches
|
|
167
|
+
EVERY step. A connection and akm's own runtime send it; a harness reports it as
|
|
168
|
+
an `untranslated-field` notice on that step (see
|
|
169
|
+
[Settings a call asks for](configuration.md#settings-a-call-asks-for)).
|
|
168
170
|
There is no per-step opt-out (`llm: {}` is a no-op and `llm: null` is a parse
|
|
169
171
|
error), so in a mixed document put `llm:` on the `unit:` of each step it is
|
|
170
172
|
meant for instead of in `defaults:`.
|
|
@@ -174,8 +176,8 @@ families) plus the orchestration keys:
|
|
|
174
176
|
(`[A-Za-z_][A-Za-z0-9_-]*` — no dots) and **at most one** of `unit` or `map`.
|
|
175
177
|
A step with neither is **still a unit step** — bare
|
|
176
178
|
`- id: validate` is the complete minimal declaration. `unit:` is the
|
|
177
|
-
optional dispatch-override bag (`exec`, `
|
|
178
|
-
`retry`, `on_error`, `output`, `env`; see
|
|
179
|
+
optional dispatch-override bag (`exec`, `connection`, `harness`, `model`,
|
|
180
|
+
`llm`, `timeout`, `retry`, `on_error`, `output`, `env`; see
|
|
179
181
|
[Exec (shell) units](#exec-shell-units) and
|
|
180
182
|
[Failure policy](#failure-policy)). Dispatch settings live under `unit:`
|
|
181
183
|
(`map.unit:` on a map step), not on the step itself; `unit.output` types
|
|
@@ -267,7 +269,7 @@ type: workflow
|
|
|
267
269
|
description: Review changed files and give an overall verdict
|
|
268
270
|
params:
|
|
269
271
|
changed_files: { type: array, description: Files to review }
|
|
270
|
-
defaults: {
|
|
272
|
+
defaults: { harness: claude, model: balanced, timeout: 10m, on_error: fail }
|
|
271
273
|
budget: { max_units: 40, max_tokens: 200000 }
|
|
272
274
|
steps:
|
|
273
275
|
- id: discover
|
|
@@ -278,8 +280,8 @@ steps:
|
|
|
278
280
|
over: steps.discover.output.files
|
|
279
281
|
concurrency: 8
|
|
280
282
|
unit:
|
|
281
|
-
|
|
282
|
-
model:
|
|
283
|
+
harness: claude
|
|
284
|
+
model: reasoning
|
|
283
285
|
timeout: 5m
|
|
284
286
|
retry: { max: 1, on: [timeout, llm_rate_limit] }
|
|
285
287
|
on_error: continue
|
|
@@ -491,20 +493,20 @@ fail later at `akm workflow run`:
|
|
|
491
493
|
| `map.concurrency` | 1 – 64 |
|
|
492
494
|
| `retry.max` | 0 – 100 |
|
|
493
495
|
| `timeout` | ≤ 2147483647 ms (~24.8 days), or `none` |
|
|
494
|
-
| `
|
|
496
|
+
| `connection` and `harness` names | `^[a-z][a-z0-9]*(-[a-z0-9]+)*$`, ≤ 63 chars |
|
|
495
497
|
|
|
496
498
|
`timeout` is resolved **once, at freeze time**, and the frozen value is what
|
|
497
|
-
dispatch applies — there is no separate
|
|
499
|
+
dispatch applies — there is no separate ceiling on top of it. The
|
|
498
500
|
first of these that is set wins: the unit's `timeout`, then the document's
|
|
499
|
-
`defaults.timeout`, then `
|
|
500
|
-
default — **
|
|
501
|
-
|
|
501
|
+
`defaults.timeout`, then the selected connection's or harness's `timeoutMs`,
|
|
502
|
+
then the default — **none for agent work, whether it runs on a harness or on
|
|
503
|
+
akm's runtime over a connection, and 10m for model work**. Writing `timeout: none` is an explicit opt
|
|
502
504
|
out and leaves the unit genuinely unbounded; nothing later re-imposes a cap.
|
|
503
505
|
|
|
504
506
|
## Exec (shell) units
|
|
505
507
|
|
|
506
508
|
A step whose `unit:` block declares `exec:` runs a **shell command** instead of
|
|
507
|
-
dispatching
|
|
509
|
+
dispatching a model. Deterministic work — running the test suite, building,
|
|
508
510
|
linting, copying a file, invoking a script — is a command, not a prompt, and
|
|
509
511
|
paying for an LLM or agent dispatch to get it done buys nondeterminism, latency,
|
|
510
512
|
and tokens in exchange for nothing.
|
|
@@ -515,15 +517,15 @@ steps:
|
|
|
515
517
|
unit:
|
|
516
518
|
exec:
|
|
517
519
|
command: ["bun", "run", "test:unit"]
|
|
518
|
-
cwd: packages/core # optional,
|
|
520
|
+
cwd: packages/core # optional: relative to the workflow's bundle root, or absolute
|
|
519
521
|
timeout: "10m"
|
|
520
522
|
retry: { max: 1, on: [timeout] }
|
|
521
523
|
```
|
|
522
524
|
|
|
523
|
-
An exec unit names **no
|
|
524
|
-
parser rejects those alongside `exec:`), it
|
|
525
|
-
made only of exec steps freezes and runs on an
|
|
526
|
-
at all. Everything else about a unit still applies unchanged: `timeout`, `retry`,
|
|
525
|
+
An exec unit names **no connection or harness**. It carries no `connection`,
|
|
526
|
+
`harness`, `model`, or `llm` (the parser rejects those alongside `exec:`), it
|
|
527
|
+
consumes no tokens, and a workflow made only of exec steps freezes and runs on an
|
|
528
|
+
install with no connection or harness configured at all. Everything else about a unit still applies unchanged: `timeout`, `retry`,
|
|
527
529
|
`on_error`, `output`, `env`, `map` fan-out and its concurrency, the
|
|
528
530
|
unit journal, budget accounting, and replay/reuse.
|
|
529
531
|
|
|
@@ -554,11 +556,66 @@ Bounds: 1–64 argv entries, each a non-empty string of at most 4096 bytes.
|
|
|
554
556
|
|
|
555
557
|
### `cwd`
|
|
556
558
|
|
|
557
|
-
Optional
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
559
|
+
Optional: a non-empty string, **relative or absolute**, and free to carry
|
|
560
|
+
`${ref}` tokens (see [`${ref}` in argv and `cwd`](#ref-in-argv-and-cwd)). It is
|
|
561
|
+
the only static check; there is no containment.
|
|
562
|
+
|
|
563
|
+
An exec unit's working directory is the **root of the bundle that owns the
|
|
564
|
+
workflow**. akm finds that bundle again for each step, by the run's workflow
|
|
565
|
+
ref, so a `bundle update` that moves the bundle to a new revision directory
|
|
566
|
+
between two steps of a running workflow is harmless: the next step runs from
|
|
567
|
+
the new directory. `cwd` is joined onto that root **once**: `cwd: sub` runs in
|
|
568
|
+
`<bundle>/sub`, and an absolute `cwd` replaces the root. Agent and SDK units
|
|
569
|
+
get the same directory as their workspace, and so does a step's gate judge. If the workflow's bundle no longer
|
|
570
|
+
resolves, the step fails with a message naming the ref; a step with a gate is
|
|
571
|
+
blocked by its judge first, for `akm workflow resume`, because the judge is built
|
|
572
|
+
before anything is dispatched. akm never falls back to its own working
|
|
573
|
+
directory.
|
|
574
|
+
|
|
575
|
+
### The exec contract
|
|
576
|
+
|
|
577
|
+
What a command can rely on, in one place. The sections below give each point in
|
|
578
|
+
full.
|
|
579
|
+
|
|
580
|
+
| | |
|
|
581
|
+
| --- | --- |
|
|
582
|
+
| **Working directory** | The owner root of the run's workflow, found at each step's dispatch. `cwd` joins it once and may be absolute. |
|
|
583
|
+
| **Argv** | Spawned directly, never shell-interpreted. A `${ref}` token in an entry is replaced at dispatch. |
|
|
584
|
+
| **Environment** | [akm's own](#the-childs-environment), with the directories this akm resolved set over it, then the unit's `env:` bindings, then the engine's `AKM_*` [context](#context-reaching-the-command). |
|
|
585
|
+
| **`${ref}` tokens** | In argv, `cwd` and env-asset values. `${secrets/name}` becomes the secret's value, any other asset ref the asset's absolute path. A ref no bundle owns fails the unit before it spawns. Prompts are not substituted. |
|
|
586
|
+
| **Redaction** | Only values akm knows are secret are scrubbed from stdout, stderr, diagnostics and the journal: values substituted from `secrets/` refs, secret-shaped run params, connection keys, and the values of credential-named variables the command inherited from akm's environment (names such as `*_API_KEY`, `*_TOKEN`, `*_SECRET` and `*_PASSWORD`, eight characters or more). Configuration, such as a URL bound through an env asset or an ordinary inherited variable, is not. |
|
|
587
|
+
|
|
588
|
+
#### What is frozen, and what is found at dispatch
|
|
589
|
+
|
|
590
|
+
The frozen plan records the identities the engine itself dereferences: the
|
|
591
|
+
workflow ref, each unit's `env:` refs qualified with their bundle
|
|
592
|
+
(`team//env/prod`), and child workflow refs, plus the argv, `cwd` and
|
|
593
|
+
`pass_env` names as authored. It records no directory or file location. The
|
|
594
|
+
bundle root, the env files, the secrets and the paths behind `${ref}` tokens are
|
|
595
|
+
all looked up when the unit dispatches, through the same ref lookup `akm show`
|
|
596
|
+
uses. Plans frozen by earlier releases (`irVersion` 5 and 6) also carry a frozen
|
|
597
|
+
`cwdIdentity` and the env asset's owner paths; they decode, those fields are
|
|
598
|
+
ignored, and such a run dispatches by ref like any other.
|
|
599
|
+
|
|
600
|
+
#### `${ref}` in argv and `cwd`
|
|
601
|
+
|
|
602
|
+
An argv entry or `cwd` can name an asset in any bundle with the same
|
|
603
|
+
`${[bundle//]conceptId}` token env assets use:
|
|
604
|
+
|
|
605
|
+
```yaml
|
|
606
|
+
- id: status
|
|
607
|
+
unit:
|
|
608
|
+
env: [team//env/discord]
|
|
609
|
+
exec:
|
|
610
|
+
command: ["bun", "${homelab//scripts/lab-status/fetch-status.ts}"]
|
|
611
|
+
```
|
|
612
|
+
|
|
613
|
+
A `secrets/` ref gives the secret's value, trimmed of surrounding whitespace,
|
|
614
|
+
and joins the redaction set; any other asset ref gives the asset's absolute
|
|
615
|
+
path. Putting a secret in argv is the author's choice (it shows up in the
|
|
616
|
+
process list); prefer an `env:` binding. A `${...}` body that is not an akm ref
|
|
617
|
+
(`${HOME}`) is left as text. A ref no bundle owns fails the unit, naming it,
|
|
618
|
+
before anything is spawned.
|
|
562
619
|
|
|
563
620
|
### The output rule
|
|
564
621
|
|
|
@@ -623,13 +680,12 @@ failure reason.
|
|
|
623
680
|
| non-zero exit | `non_zero_exit` | yes |
|
|
624
681
|
| exceeded `timeout` | `timeout` | yes |
|
|
625
682
|
| run cancelled (`Ctrl-C`, `--timeout`, budget) | `aborted` | yes |
|
|
626
|
-
| binary missing / working directory
|
|
683
|
+
| binary missing / working directory missing | `spawn_failed` | yes |
|
|
627
684
|
| **stdout** capture never completed | `exec_capture_incomplete` | **no** (the command already ran) |
|
|
628
685
|
| **stderr** capture never completed | — (unit succeeds; a warning says the stderr tail may be missing) | — |
|
|
629
686
|
| stdout past the retention limit, **and** the unit declares `output:` | `exec_output_limit` | **no** (deterministic) |
|
|
630
687
|
| stdout past the retention limit, no `output:` schema | — (unit succeeds; artifact marked truncated) | — |
|
|
631
688
|
| `AKM_*` context too large for **this platform** to spawn | `exec_context_too_large` | **no** (an authoring/data problem) |
|
|
632
|
-
| `cwd` resolved outside its base | `exec_cwd_escape` | **no** (tampering, never transient) |
|
|
633
689
|
|
|
634
690
|
`non_zero_exit` in `retry.on` re-runs a command that already ran, and a
|
|
635
691
|
command's exit is usually deterministic, so the retry mostly repeats the
|
|
@@ -642,8 +698,10 @@ is exactly what makes a `test` step a **gate**. With `on_error: continue` the
|
|
|
642
698
|
failure is recorded in the step's evidence and the completion gate decides.
|
|
643
699
|
|
|
644
700
|
On timeout or cancellation the child's whole **process group** gets a
|
|
645
|
-
SIGTERM→SIGKILL ladder
|
|
646
|
-
|
|
701
|
+
SIGINT→SIGTERM→SIGKILL ladder (each signal after a grace period of 5 seconds, for
|
|
702
|
+
a command still running), so a command that spawned its own children does not
|
|
703
|
+
leave them orphaned. Windows has no process group; there the first signal ends
|
|
704
|
+
the command itself.
|
|
647
705
|
|
|
648
706
|
### Output limits
|
|
649
707
|
|
|
@@ -689,9 +747,10 @@ want the whole thing, have it write to a file and print the **path**:
|
|
|
689
747
|
|
|
690
748
|
### Context reaching the command
|
|
691
749
|
|
|
692
|
-
A frozen argv
|
|
693
|
-
|
|
694
|
-
|
|
750
|
+
A frozen argv never carries run data (this format has no substitution language
|
|
751
|
+
for params or step output; the only substitution is a [`${ref}` token](#ref-in-argv-and-cwd)
|
|
752
|
+
naming an asset), so data reaches an exec unit as **environment**, the argv
|
|
753
|
+
analogue of the context blocks a model unit gets in its prompt:
|
|
695
754
|
|
|
696
755
|
| Variable | Value |
|
|
697
756
|
| --- | --- |
|
|
@@ -724,7 +783,7 @@ Where those numbers come from:
|
|
|
724
783
|
- **macOS** has no per-string cap; its binding constraint is `ARG_MAX`
|
|
725
784
|
(262 144 bytes) over `argv` + `environ` *combined*. The 128 KiB total keeps
|
|
726
785
|
akm's own contribution to half of that, leaving the rest for the argv, the
|
|
727
|
-
environment
|
|
786
|
+
rest of the environment and your `env:` bindings.
|
|
728
787
|
- **Windows** caps a single user-defined environment variable at 32 767
|
|
729
788
|
characters (`SetEnvironmentVariable`), and the environment block has limits of
|
|
730
789
|
the same order.
|
|
@@ -768,42 +827,32 @@ command would have to handle both shapes, and the spill file would have to be
|
|
|
768
827
|
placed and cleaned up. A stable contract plus
|
|
769
828
|
an explicit error is the smaller, more predictable surface.
|
|
770
829
|
|
|
771
|
-
### The child's environment
|
|
830
|
+
### The child's environment
|
|
772
831
|
|
|
773
|
-
An exec unit's command
|
|
774
|
-
|
|
832
|
+
An exec unit's command inherits the environment akm runs in, as a command typed in
|
|
833
|
+
your shell would, and nothing is filtered out of it: `PATH`, `HOME`, locale and
|
|
834
|
+
toolchain variables, and any credential or proxy setting of the process that ran
|
|
835
|
+
`akm workflow run` reach the command. It is built in three layers, in this order:
|
|
775
836
|
|
|
776
|
-
1.
|
|
777
|
-
(plus any names the unit adds with `pass_env:`);
|
|
837
|
+
1. akm's own environment, with the directories this akm resolved set over it;
|
|
778
838
|
2. the unit's resolved **`env:` bindings**;
|
|
779
839
|
3. the engine-authored **`AKM_*` context** — last, so a binding can never
|
|
780
840
|
shadow it.
|
|
781
841
|
|
|
782
|
-
The
|
|
783
|
-
|
|
842
|
+
The directories are `AKM_CONFIG_DIR`, `AKM_DATA_DIR`, `AKM_CACHE_DIR` and
|
|
843
|
+
`AKM_STATE_DIR`, set to the ones the akm that started the command resolved (from
|
|
844
|
+
`AKM_*_DIR`, `XDG_*_HOME` or the platform default), and `AKM_BUNDLE_DIR` when that
|
|
845
|
+
akm had one. A step that runs `akm` therefore uses the same bundle, config, data,
|
|
846
|
+
cache and state. Binding one of them in `env:` overrides it. When a scheduled
|
|
847
|
+
task runs the workflow, `AKM_EVENT_SOURCE` is set (when the environment has
|
|
848
|
+
none), so a command that calls `akm` records machine traffic, not user demand; a
|
|
849
|
+
direct `akm workflow run` leaves it as it found it.
|
|
784
850
|
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
| Locale | `LANG`, `LC_ALL`, `LC_CTYPE` | without a locale, non-ASCII stdout — *which is this unit's artifact* — gets mangled |
|
|
791
|
-
| Terminal / clock | `TERM`, `TZ` | some CLIs abort with no `TERM`; `TZ` keeps printed timestamps stable |
|
|
792
|
-
| Scratch space | `TMPDIR`, `TEMP`, `TMP` | POSIX and Windows temp roots |
|
|
793
|
-
| Windows essentials | `SystemRoot`, `SystemDrive`, `WINDIR`, `COMSPEC`, `PATHEXT` | Windows **process creation itself** fails with an empty environment; `PATHEXT` is what makes `bun.exe`/`bun.cmd` resolvable at all |
|
|
794
|
-
| Windows home/config | `USERPROFILE`, `HOMEDRIVE`, `HOMEPATH`, `APPDATA`, `LOCALAPPDATA`, `ProgramData`, `ProgramFiles` | the Windows analogues of `HOME` and the machine-wide install roots toolchain shims resolve against |
|
|
795
|
-
| akm provenance | `AKM_EVENT_SOURCE` | a command that calls `akm` records machine traffic, not user demand |
|
|
796
|
-
|
|
797
|
-
`PATH` is additionally supplemented with well-known user binary directories
|
|
798
|
-
when akm is running in a scheduler context (cron/launchd/Task Scheduler) that
|
|
799
|
-
stripped it — the same treatment an agent-harness child gets.
|
|
800
|
-
|
|
801
|
-
Deliberately **not** on the list: credentials of any kind, cloud/CI variables,
|
|
802
|
-
and the proxy family (`HTTP_PROXY` and friends — proxy URLs routinely embed
|
|
803
|
-
credentials). Reach a required value with an exact named `env:` binding, or
|
|
804
|
-
name a non-secret per-machine variable with `pass_env:`.
|
|
805
|
-
|
|
806
|
-
#### `pass_env:` — widen the allowlist by name
|
|
851
|
+
Reach a fixed value or a secret with an exact named `env:` binding; what is
|
|
852
|
+
redacted from what the command prints is in the Redaction row of [the exec
|
|
853
|
+
contract](#the-exec-contract).
|
|
854
|
+
|
|
855
|
+
#### `pass_env:` — frozen, and it selects nothing
|
|
807
856
|
|
|
808
857
|
```yaml
|
|
809
858
|
unit:
|
|
@@ -812,22 +861,20 @@ name a non-secret per-machine variable with `pass_env:`.
|
|
|
812
861
|
pass_env: [CARGO_HOME, SCCACHE_DIR]
|
|
813
862
|
```
|
|
814
863
|
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
Values passed through this way are **not** redacted from the command's output
|
|
821
|
-
the way `env:` binding values are, so never list a credential here.
|
|
864
|
+
`pass_env:` was the list of variable names an earlier release copied into a child
|
|
865
|
+
that started empty. A workflow that has it keeps loading, and the names are kept
|
|
866
|
+
in the frozen plan and in the unit's input hash, but they select nothing now: the
|
|
867
|
+
command already has the environment. Names only, matching
|
|
868
|
+
`^[A-Za-z_][A-Za-z0-9_]*$`.
|
|
822
869
|
|
|
823
870
|
#### Binding a secret to a unit
|
|
824
871
|
|
|
825
872
|
A unit's `env:` lists env assets by ref. A value inside an env asset can be a
|
|
826
|
-
`${
|
|
873
|
+
`${ref}` token, which akm replaces with the secret's value when the unit is
|
|
827
874
|
dispatched. Say the bundle `team` holds `env/discord.env`:
|
|
828
875
|
|
|
829
876
|
```sh
|
|
830
|
-
DISCORD_BOT_TOKEN=${
|
|
877
|
+
DISCORD_BOT_TOKEN=${team//secrets/discord_bot_token}
|
|
831
878
|
```
|
|
832
879
|
|
|
833
880
|
and the secret beside it, set with
|
|
@@ -843,33 +890,42 @@ env asset:
|
|
|
843
890
|
command: ["node", "announce.mjs"]
|
|
844
891
|
```
|
|
845
892
|
|
|
846
|
-
-
|
|
847
|
-
|
|
848
|
-
bundle
|
|
849
|
-
|
|
893
|
+
- The token body is an akm ref, `[bundle//]conceptId`, resolved with the one
|
|
894
|
+
ref walk: `${team//secrets/discord_bot_token}` reads that secret from the
|
|
895
|
+
`team` bundle whichever bundle holds the env asset, and an unqualified
|
|
896
|
+
`${secrets/discord_bot_token}` resolves by the default bundle then
|
|
897
|
+
installation priority. A `secrets/...` ref gives the secret's value, trimmed
|
|
898
|
+
of surrounding whitespace; any other asset ref (`${scripts/x.sh}`) gives the
|
|
899
|
+
asset's absolute path. A `${...}` body that is not an akm ref (`${HOME}`) is
|
|
900
|
+
left as text.
|
|
850
901
|
- It is the same token `akm env run` resolves. `akm env export` does not
|
|
851
902
|
resolve it; it writes the token verbatim.
|
|
852
|
-
- Freezing records the env ref,
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
903
|
+
- Freezing records the env ref, never a value. At each dispatch the unit's env
|
|
904
|
+
assets are read live with `resolveEnvBinding`, the same function `akm env run`
|
|
905
|
+
uses, so an edit to the env file, or to a secret, after the run started is
|
|
906
|
+
picked up by the next dispatch; there is no key-set check against the frozen
|
|
907
|
+
plan. A ref no bundle owns fails the step at dispatch ("frozen environment
|
|
908
|
+
preflight failed") and nothing is injected.
|
|
856
909
|
- Each dispatch that reads the env asset records an `env_access` event with the
|
|
857
|
-
ref
|
|
858
|
-
-
|
|
859
|
-
redacted out of stdout, stderr and
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
910
|
+
ref and key names, never values.
|
|
911
|
+
- Redaction covers secrets, not configuration. A value substituted from a
|
|
912
|
+
`secrets/` ref is treated as sensitive and redacted out of stdout, stderr and
|
|
913
|
+
diagnostics before they are journaled. The rest of an env asset, such as a URL
|
|
914
|
+
or a channel id, reaches the journal and the next step unredacted. A
|
|
915
|
+
credential typed straight into an env file is not redacted, so keep
|
|
916
|
+
credentials in `secrets/` and bind them with a `${secrets/name}` token.
|
|
917
|
+
- `env:` needs a child process: it works on exec units and on every unit that
|
|
918
|
+
runs an agent, whether on a harness or on akm's own runtime. A model call that
|
|
919
|
+
runs no agent cannot take a per-unit environment and fails `env_unsupported`.
|
|
920
|
+
|
|
921
|
+
#### Durable v4 (`irVersion: 8`) forbids `inherit_env`
|
|
867
922
|
|
|
868
923
|
Every new workflow start freezes the durable plan v4 family's current
|
|
869
|
-
executable format
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
924
|
+
executable format (`irVersion: 8`; a plan frozen earlier decodes when it holds no
|
|
925
|
+
model step). It rejects
|
|
926
|
+
`inherit_env: true`, which is not needed: the command inherits akm's
|
|
927
|
+
environment. Exact named `env:` bindings are dispatch-significant and form part
|
|
928
|
+
of the unit's input hash.
|
|
873
929
|
|
|
874
930
|
The historical `inherit_env` spelling is unsupported.
|
|
875
931
|
|
|
@@ -877,8 +933,8 @@ The historical `inherit_env` spelling is unsupported.
|
|
|
877
933
|
|
|
878
934
|
`akm show <workflow> --format json` summarizes each step under
|
|
879
935
|
`steps[].orchestration`. For an exec step that summary carries an `exec` object
|
|
880
|
-
and **no `engine`/`model`** — an exec unit
|
|
881
|
-
workflow's `defaults
|
|
936
|
+
and **no `engine`/`model`** — an exec unit runs on no connection or harness, so
|
|
937
|
+
reporting the workflow's `defaults` there would describe a dispatch that never
|
|
882
938
|
happens. Field presence is the discriminator, the same way `fanOut` marks a
|
|
883
939
|
`map` step:
|
|
884
940
|
|
|
@@ -906,8 +962,8 @@ happens. Field presence is the discriminator, the same way `fanOut` marks a
|
|
|
906
962
|
step's output. Every byte is already visible in the workflow file (and stored
|
|
907
963
|
verbatim in `plan_json`) — which is also why you never inline a secret there.
|
|
908
964
|
- `cwd` and `passEnv` appear only when the unit declares them. `passEnv` is a
|
|
909
|
-
list of variable **names
|
|
910
|
-
carry `inheritEnv`.
|
|
965
|
+
list of variable **names** that select nothing; no value is ever projected. New
|
|
966
|
+
v4 plans never carry `inheritEnv`.
|
|
911
967
|
- `timeoutMs` is still reported, because an exec unit really does inherit
|
|
912
968
|
`defaults.timeout` — that number is true for it.
|
|
913
969
|
|
|
@@ -920,29 +976,21 @@ Exec units sit inside the existing workflow trust model — see
|
|
|
920
976
|
[Security: workflow sources are executed code](https://github.com/itlackey/akm/blob/main/docs/guides/run-workflows.md#security-workflow-sources-are-executed-code).
|
|
921
977
|
They do not widen it, and they do not narrow it:
|
|
922
978
|
|
|
923
|
-
- **The child's environment
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
exports tokens for unrelated services, and a third-party step that merely
|
|
930
|
-
prints its environment, or a tool that ships one in a crash report, should
|
|
931
|
-
not get them for free), it makes the environment surface **explicit and
|
|
932
|
-
reviewable** (this list plus lines in the frontmatter diff, rather than
|
|
933
|
-
"whatever the invoking shell happened to export"), and it **matches the
|
|
934
|
-
convention akm already applies to spawned children** — agent-harness children
|
|
935
|
-
have always been built from `envPassthrough` this way, and exec units now use
|
|
936
|
-
the same mechanism rather than a second one. Operators who need a harder
|
|
937
|
-
boundary still scope the *akm process* (dedicated account, ephemeral working
|
|
979
|
+
- **The child inherits akm's environment.** The command runs with your
|
|
980
|
+
environment, as if you had typed it in your shell, so a credential the shell or
|
|
981
|
+
CI job exported reaches it, and a value it inherited is not redacted from what
|
|
982
|
+
it prints. That is the same trust a workflow source already has: a command that
|
|
983
|
+
runs at all can read the same credentials off disk. Operators who need a
|
|
984
|
+
boundary scope the *akm process* (dedicated account, ephemeral working
|
|
938
985
|
directory, external network/filesystem policy); that is the boundary that
|
|
939
986
|
actually holds.
|
|
940
987
|
- **Secrets come from `env:` bindings by name.** The frozen plan carries only
|
|
941
988
|
the ref names, the replay hash carries only the ref names, and the resolved
|
|
942
989
|
values are collected and scrubbed out of stdout, stderr, and the failure
|
|
943
990
|
diagnostic by the same redaction contract every other dispatch uses — before
|
|
944
|
-
anything is journaled. Never inline a secret into `command:`; argv is
|
|
945
|
-
|
|
991
|
+
anything is journaled. Never inline a secret value into `command:`; argv is
|
|
992
|
+
stored as authored in `plan_json`. A `${secrets/name}` token in argv is
|
|
993
|
+
stored as the token and replaced only when the unit dispatches.
|
|
946
994
|
- **Read a workflow before you run it.** `exec:` makes what a workflow will run
|
|
947
995
|
explicit and auditable in one place, which is a real improvement over
|
|
948
996
|
instructing a model to "run the tests" — but a bundle you do not trust is
|
|
@@ -989,18 +1037,16 @@ Raising one never raises the others:
|
|
|
989
1037
|
| --- | --- | --- |
|
|
990
1038
|
| `map.concurrency` | the step | `workflow.defaultMapConcurrency`, else **4** |
|
|
991
1039
|
| `execution.maxConcurrency` | `workflow.maxConcurrency` config | CPU-derived `min(16, max(1, cores − 2))` |
|
|
992
|
-
| the selected
|
|
1040
|
+
| the selected connection's concurrency | `connections.<name>.concurrency` | **1** for a loopback endpoint, **4** for a remote one |
|
|
993
1041
|
| the host CPU safety cap | nothing — reapplied at dispatch | `min(16, max(1, cores − 2))` |
|
|
994
1042
|
|
|
995
|
-
The
|
|
1043
|
+
The connection limit is per **endpoint kind** on purpose. A local model server (LM
|
|
996
1044
|
Studio, Ollama) has one loaded model, and concurrent inference makes it reload
|
|
997
1045
|
and return HTTP 500 — a hard failure, so loopback endpoints stay at 1 and a
|
|
998
1046
|
`map` against a local model is still effectively serial unless you raise
|
|
999
|
-
`
|
|
1047
|
+
`connections.<name>.concurrency` yourself. Remote providers fail softly (a
|
|
1000
1048
|
retryable 429), and four concurrent completions is well inside any hosted
|
|
1001
|
-
provider's entry tier.
|
|
1002
|
-
except an `opencode-sdk` engine that sets `llmEngine`, which inherits that
|
|
1003
|
-
fallback engine's limit.
|
|
1049
|
+
provider's entry tier. A harness carries no concurrency limit of its own.
|
|
1004
1050
|
|
|
1005
1051
|
#### What counts as a loopback endpoint
|
|
1006
1052
|
|
|
@@ -1022,15 +1068,15 @@ exactly as single-model as one on `127.0.0.1`.
|
|
|
1022
1068
|
re-serializes the dotted form to the hex one before the check ever sees it. A
|
|
1023
1069
|
mapped public address such as `[::ffff:8.8.8.8]` still reads as remote. The
|
|
1024
1070
|
deprecated IPv4-compatible form `[::127.0.0.1]` is not recognized; if you use
|
|
1025
|
-
it, set `
|
|
1071
|
+
it, set `connections.<name>.concurrency: 1`.
|
|
1026
1072
|
|
|
1027
1073
|
The check is **purely syntactic — it never resolves a name.** A frozen plan has
|
|
1028
1074
|
to come out the same on your laptop, on CI, and on a machine with no network at
|
|
1029
1075
|
all, and a DNS lookup would make the frozen width depend on what a resolver
|
|
1030
1076
|
happened to answer. So a *name* that resolves to loopback (a hosts-file alias,
|
|
1031
1077
|
`host.docker.internal`, an internal DNS record) is treated as **remote**; point
|
|
1032
|
-
the
|
|
1033
|
-
explicitly. In the other direction the classification is deliberately
|
|
1078
|
+
the connection's endpoint at the address itself, or set
|
|
1079
|
+
`connections.<name>.concurrency: 1` explicitly. In the other direction the classification is deliberately
|
|
1034
1080
|
conservative: an endpoint akm cannot parse at all is treated as loopback, since
|
|
1035
1081
|
freezing 4 for a config it does not understand is the failure worth avoiding.
|
|
1036
1082
|
|
|
@@ -1104,17 +1150,17 @@ verdict that cannot change. So a step whose unit is `exec:` still has its
|
|
|
1104
1150
|
artifact judged and can still be failed by the verdict; a rejection simply lands
|
|
1105
1151
|
on the first evaluation, carrying the same missing criteria and feedback the
|
|
1106
1152
|
one-shot case does. `gate.max_loops` on such a step is capped at 1 rather than
|
|
1107
|
-
rejected, and
|
|
1153
|
+
rejected, and a model step's declared `max_loops` is untouched. This is the
|
|
1108
1154
|
same reasoning that makes an exec unit's `output:` schema miss fail without a
|
|
1109
1155
|
corrective re-dispatch.
|
|
1110
1156
|
|
|
1111
1157
|
**Fail-closed verification.** With no non-empty `### gate` rubric, no
|
|
1112
|
-
verification runs. When a rubric is present, the workflow requires
|
|
1113
|
-
|
|
1114
|
-
|
|
1158
|
+
verification runs. When a rubric is present, the workflow requires a
|
|
1159
|
+
connection or a harness to judge it before the plan can be frozen: the judge
|
|
1160
|
+
runs where model work runs (the default connection, else the default harness; see
|
|
1161
|
+
[Where each process runs](configuration.md#where-each-process-runs)) — see
|
|
1115
1162
|
[Author's Guide: Troubleshooting](https://github.com/itlackey/akm/blob/main/docs/guides/author-workflows.md#troubleshooting)
|
|
1116
|
-
if
|
|
1117
|
-
the run.
|
|
1163
|
+
if neither is configured yet. That verifier invocation is frozen into the run.
|
|
1118
1164
|
|
|
1119
1165
|
Only a well-formed `complete: true` verdict advances a criteria-bearing step.
|
|
1120
1166
|
A missing verifier, dispatch failure, or malformed result rejects the gate
|
|
@@ -1131,33 +1177,32 @@ across resumes**, not just the current invocation. Hitting a ceiling aborts
|
|
|
1131
1177
|
the step's still-pending dispatches and fails the step with a
|
|
1132
1178
|
`budget exceeded (<which> ceiling)` summary — budget exhaustion is a hard
|
|
1133
1179
|
stop that ignores `on_error: continue`. Because the plan is frozen, raising a
|
|
1134
|
-
budget means starting a new run.
|
|
1180
|
+
budget means starting a new run. Only units that run on akm's own runtime
|
|
1181
|
+
report token usage; a unit on a harness or a direct model call reports none
|
|
1182
|
+
and adds nothing to `max_tokens`.
|
|
1135
1183
|
|
|
1136
1184
|
## Model references
|
|
1137
1185
|
|
|
1138
1186
|
Reference semantic aliases in `model:` fields instead of exact model ids so a
|
|
1139
|
-
workflow stays
|
|
1140
|
-
|
|
1187
|
+
workflow stays portable across machines. The standard aliases are `fast`,
|
|
1188
|
+
`balanced` and `reasoning`; each connection and harness says which of its models
|
|
1189
|
+
answers them (`connections.<name>.models`, `harnesses.<name>.models`; Claude Code
|
|
1190
|
+
ships a map of its own):
|
|
1141
1191
|
|
|
1142
|
-
```
|
|
1143
|
-
{
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
"reasoning": { "claude": "claude-opus-4-7", "opencode": "opencode/claude-opus-4-7" }
|
|
1149
|
-
}
|
|
1150
|
-
}
|
|
1192
|
+
```yaml
|
|
1193
|
+
defaults: { model: balanced }
|
|
1194
|
+
steps:
|
|
1195
|
+
- id: review
|
|
1196
|
+
unit:
|
|
1197
|
+
model: reasoning
|
|
1151
1198
|
```
|
|
1152
1199
|
|
|
1153
|
-
Resolution
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
configured for the selected engine, with no workflow-authored change. See the [Author's Guide](https://github.com/itlackey/akm/blob/main/docs/guides/author-workflows.md#choosing-engines-and-models)
|
|
1160
|
-
for guidance on which tier to pick per step.
|
|
1200
|
+
Resolution looks the alias up on the connection or harness the step runs on. A
|
|
1201
|
+
string that is not an alias is an exact model name and is used as written. An
|
|
1202
|
+
alias the connection does not map answers with that connection's first model; a
|
|
1203
|
+
harness with no model for it passes none and uses its own default. See
|
|
1204
|
+
[Aliases](configuration.md#aliases) for the full rules and the author's guide
|
|
1205
|
+
for [which tier to pick per step](https://github.com/itlackey/akm/blob/main/docs/guides/author-workflows.md#choosing-where-a-step-runs-and-which-model).
|
|
1161
1206
|
|
|
1162
1207
|
## See also
|
|
1163
1208
|
|
|
@@ -11,9 +11,7 @@ interruption without replaying completed units.
|
|
|
11
11
|
|
|
12
12
|
Workflows are one of the execution surfaces AKM directly orchestrates: AKM
|
|
13
13
|
retrieves every supported capability type, but a workflow's declared steps —
|
|
14
|
-
not arbitrary indexed content — are what actually gets dispatched.
|
|
15
|
-
[Architecture: Core Principles](https://github.com/itlackey/akm/blob/main/docs/architecture/akm-core-principles.md) for
|
|
16
|
-
that boundary.
|
|
14
|
+
not arbitrary indexed content — are what actually gets dispatched.
|
|
17
15
|
|
|
18
16
|
This page is a short map. The full contract now lives across four pages,
|
|
19
17
|
split by what you're doing:
|
|
@@ -24,8 +22,8 @@ split by what you're doing:
|
|
|
24
22
|
someone else's bundle.
|
|
25
23
|
- **[Author's Guide: Writing Workflows](https://github.com/itlackey/akm/blob/main/docs/guides/author-workflows.md)** —
|
|
26
24
|
writing and testing a workflow definition: choosing a source format, the Markdown structure, a
|
|
27
|
-
minimal complete example, common authoring mistakes, choosing
|
|
28
|
-
|
|
25
|
+
minimal complete example, common authoring mistakes, choosing where a step
|
|
26
|
+
runs and which model, and troubleshooting a missing harness or connection.
|
|
29
27
|
- **[Workflow Schema](../reference/workflow-schema.md)** — the exhaustive,
|
|
30
28
|
authoritative reference: every frontmatter key, the bare-reference grammar,
|
|
31
29
|
failure policy, gates, and budget ceilings, with exact syntax.
|
|
@@ -41,7 +39,7 @@ For task- or schedule-driven workflow runs — an `akm task` bound to
|
|
|
41
39
|
|
|
42
40
|
Markdown `.md` is the one workflow source format; it preserves AKM's full prose,
|
|
43
41
|
gates, maps, typed artifacts, and exec vocabulary. New starts resolve source
|
|
44
|
-
owners and executable targets, then freeze durable plan `irVersion`
|
|
42
|
+
owners and executable targets, then freeze durable plan `irVersion` 8. A
|
|
45
43
|
stored plan is read back as it is: one frozen at another `irVersion` that
|
|
46
44
|
still decodes runs, and one this akm cannot decode is abandoned by
|
|
47
45
|
`akm workflow run` with a message naming how to start a new run. See
|