akm-cli 0.9.0-rc.1 → 0.9.0-rc.13
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 +1190 -52
- package/README.md +62 -37
- package/SECURITY.md +46 -31
- package/dist/akm +162 -38
- package/dist/akm-migrate +44 -0
- package/dist/assets/backends/schtasks-template.xml +2 -1
- package/dist/assets/hints/cli-hints-full.md +268 -118
- package/dist/assets/hints/cli-hints-short.md +87 -24
- package/dist/assets/{profiles → improve-strategies}/catchup.json +3 -1
- package/dist/assets/{profiles → improve-strategies}/consolidate.json +3 -1
- package/dist/assets/{profiles → improve-strategies}/default.json +6 -7
- package/dist/assets/improve-strategies/frequent.json +15 -0
- package/dist/assets/{profiles → improve-strategies}/graph-refresh.json +4 -2
- package/dist/assets/{profiles → improve-strategies}/memory-focus.json +4 -1
- package/dist/assets/{profiles → improve-strategies}/proactive-maintenance.json +5 -5
- package/dist/assets/{profiles → improve-strategies}/quick.json +4 -2
- package/dist/assets/improve-strategies/reflect-distill.json +30 -0
- package/dist/assets/{profiles → improve-strategies}/thorough.json +1 -1
- package/dist/assets/prompts/consolidate-system.md +5 -5
- package/dist/assets/prompts/extract-session.md +2 -6
- package/dist/assets/prompts/memory-infer-user.md +2 -3
- package/dist/assets/prompts/reflect-llm-framed-contract.md +11 -0
- package/dist/assets/prompts/reflect-llm-schema-contract.md +3 -0
- package/dist/assets/prompts/reflect-output-repair.md +3 -0
- package/dist/assets/stash-skeleton/README.md +38 -10
- package/dist/assets/stash-skeleton/facts/conventions/assets/agent.md +8 -0
- package/dist/assets/stash-skeleton/facts/conventions/assets/command.md +8 -0
- package/dist/assets/stash-skeleton/facts/conventions/assets/fact.md +14 -1
- package/dist/assets/stash-skeleton/facts/conventions/assets/knowledge.md +13 -1
- package/dist/assets/stash-skeleton/facts/conventions/assets/lesson.md +9 -1
- package/dist/assets/stash-skeleton/facts/conventions/assets/memory.md +11 -0
- package/dist/assets/stash-skeleton/facts/conventions/assets/script.md +9 -0
- package/dist/assets/stash-skeleton/facts/conventions/assets/skill.md +9 -0
- package/dist/assets/stash-skeleton/facts/conventions/assets/workflow.md +8 -0
- package/dist/assets/stash-skeleton/facts/conventions/backlinks.md +100 -0
- package/dist/assets/stash-skeleton/facts/conventions/domains.md +64 -0
- package/dist/assets/stash-skeleton/facts/conventions/organization.md +136 -0
- package/dist/assets/tasks/core/extract.yml +3 -2
- package/dist/assets/tasks/core/improve.yml +2 -1
- package/dist/assets/tasks/core/index-refresh.yml +1 -0
- package/dist/assets/tasks/core/sync.yml +1 -0
- package/dist/assets/tasks/core/version-check.yml +2 -1
- package/dist/assets/tasks/improve/akm-graph-refresh-weekly.yml +5 -0
- package/dist/assets/tasks/improve/akm-improve-catchup.yml +8 -0
- package/dist/assets/tasks/improve/akm-improve-consolidate.yml +5 -0
- package/dist/assets/tasks/improve/akm-improve-frequent.yml +5 -0
- package/dist/assets/tasks/improve/akm-improve-nightly.yml +5 -0
- package/dist/assets/templates/html/health.html +5 -4
- package/dist/assets/workflows/workflow-template.md +31 -15
- package/dist/cli/invocation.js +279 -0
- package/dist/cli/parse-args.js +5 -90
- package/dist/cli/retired-commands.js +78 -0
- package/dist/cli/shared.js +158 -48
- package/dist/cli-node.mjs +2 -1
- package/dist/cli.js +747 -293
- package/dist/commands/agent/agent-dispatch.js +19 -18
- package/dist/commands/agent/agent-support.js +0 -24
- package/dist/commands/agent/contribute-cli.js +43 -97
- package/dist/commands/completions.js +80 -23
- package/dist/commands/config-cli.js +44 -281
- package/dist/commands/env/env-binding.js +13 -9
- package/dist/commands/env/env-cli.js +76 -159
- package/dist/commands/env/env.js +12 -163
- package/dist/commands/env/marker-path.js +6 -0
- package/dist/commands/env/secret-cli.js +45 -61
- package/dist/commands/env/secret.js +32 -62
- package/dist/commands/feedback-cli.js +179 -85
- package/dist/commands/health/accept-rate.js +58 -0
- package/dist/commands/health/advisories.js +7 -8
- package/dist/commands/health/checks.js +279 -94
- package/dist/commands/health/html-report.js +197 -578
- package/dist/commands/health/improve-metrics.js +277 -246
- package/dist/commands/health/llm-usage.js +19 -19
- package/dist/commands/health/md-report.js +16 -7
- package/dist/commands/health/metrics.js +67 -32
- package/dist/commands/health/renderers.js +47 -0
- package/dist/commands/health/report-view-model.js +508 -0
- package/dist/commands/health/stash-exposure.js +1 -1
- package/dist/commands/health/surfaces.js +16 -56
- package/dist/commands/health/task-runs.js +3 -67
- package/dist/{migrate-storage-node.mjs → commands/health/types-checks.js} +1 -5
- package/dist/commands/health/types-improve.js +29 -0
- package/dist/{output/text/save.js → commands/health/types-metrics.js} +1 -2
- package/dist/commands/health/types-result.js +7 -0
- package/dist/commands/health/types-runs.js +4 -0
- package/dist/commands/health/types-session-log.js +4 -0
- package/dist/commands/health/types-windows.js +4 -0
- package/dist/commands/health/types.js +26 -21
- package/dist/commands/health/windows.js +2 -3
- package/dist/commands/health.js +296 -167
- package/dist/commands/improve/anti-collapse.js +5 -5
- package/dist/commands/improve/autonomy-gate.js +68 -0
- package/dist/commands/improve/collapse-detector.js +65 -52
- package/dist/commands/improve/consolidate/chunking.js +9 -7
- package/dist/commands/improve/consolidate/eligibility.js +1 -23
- package/dist/commands/improve/consolidate/merge.js +4 -0
- package/dist/commands/improve/consolidate.js +454 -1354
- package/dist/commands/improve/content-hash.js +39 -0
- package/dist/commands/improve/distill/content-repair.js +4 -10
- package/dist/commands/improve/distill/promote-memory.js +89 -64
- package/dist/commands/improve/distill/quality-gate.js +118 -42
- package/dist/commands/improve/distill-guards.js +1 -1
- package/dist/commands/improve/distill-promotion-policy.js +33 -888
- package/dist/commands/improve/distill.js +607 -363
- package/dist/commands/improve/eligibility.js +165 -79
- package/dist/commands/improve/extract-cli.js +35 -126
- package/dist/commands/improve/extract-prompt.js +6 -35
- package/dist/commands/improve/extract.js +640 -391
- package/dist/commands/improve/feedback-valence.js +2 -12
- package/dist/commands/improve/improve-cli.js +134 -135
- package/dist/commands/improve/improve-result-file.js +30 -50
- package/dist/commands/improve/improve-run-types.js +4 -0
- package/dist/commands/improve/improve-strategies.js +135 -0
- package/dist/commands/improve/improve.js +904 -701
- package/dist/commands/improve/locks.js +64 -111
- package/dist/commands/improve/loop-stages.js +1110 -923
- package/dist/commands/improve/memory/derived-ref.js +124 -0
- package/dist/commands/improve/memory/memory-belief.js +79 -7
- package/dist/commands/improve/memory/memory-contradiction-detect.js +49 -52
- package/dist/commands/improve/memory/memory-improve.js +25 -37
- package/dist/commands/improve/outcome-loop.js +25 -88
- package/dist/commands/improve/preparation.js +1034 -813
- package/dist/commands/improve/proactive-maintenance.js +34 -9
- package/dist/commands/improve/proposal-envelope.js +31 -0
- package/dist/commands/improve/reflect.js +983 -794
- package/dist/commands/improve/run-context.js +119 -0
- package/dist/commands/improve/salience.js +24 -127
- package/dist/commands/improve/session-asset.js +7 -3
- package/dist/commands/improve/shared.js +14 -34
- package/dist/commands/improve/source-identity.js +28 -0
- package/dist/commands/improve/triage.js +20 -17
- package/dist/commands/lint/base-linter.js +340 -313
- package/dist/commands/lint/env-key-rules.js +31 -47
- package/dist/commands/lint/index.js +185 -30
- package/dist/commands/{events.js → log.js} +28 -38
- package/dist/commands/migrate-cli.js +54 -0
- package/dist/commands/migration-tool.js +55 -0
- package/dist/commands/observability-cli.js +70 -208
- package/dist/commands/proposal/diff-format.js +50 -0
- package/dist/commands/proposal/drain-policies.js +0 -6
- package/dist/commands/proposal/drain.js +91 -40
- package/dist/commands/proposal/proposal-cli.js +134 -132
- package/dist/commands/proposal/proposal-types.js +56 -0
- package/dist/commands/proposal/proposal.js +83 -65
- package/dist/commands/proposal/propose-cli.js +88 -0
- package/dist/commands/proposal/propose.js +105 -88
- package/dist/commands/proposal/repository.js +1303 -278
- package/dist/commands/proposal/validators/proposal-quality-validators.js +16 -6
- package/dist/commands/proposal/validators/proposal-validators.js +61 -12
- package/dist/commands/proposal/validators/proposals.js +6 -8
- package/dist/commands/read/curate.js +78 -73
- package/dist/commands/read/knowledge.js +510 -13
- package/dist/commands/read/registry-search.js +2 -2
- package/dist/commands/read/remember-cli.js +84 -15
- package/dist/commands/read/search-cli.js +203 -96
- package/dist/commands/read/search.js +126 -94
- package/dist/commands/read/show.js +226 -250
- package/dist/commands/registry-cli.js +34 -60
- package/dist/commands/remember.js +18 -57
- package/dist/commands/sources/add-cli.js +104 -49
- package/dist/commands/sources/bundle-cli.js +166 -0
- package/dist/commands/sources/bundle-config-ops.js +63 -0
- package/dist/commands/sources/info.js +27 -15
- package/dist/commands/sources/init.js +30 -40
- package/dist/commands/sources/installed-stashes.js +469 -172
- package/dist/commands/sources/schema-repair.js +10 -9
- package/dist/commands/sources/self-update.js +182 -121
- package/dist/commands/sources/source-add.js +169 -178
- package/dist/commands/sources/source-clone.js +144 -41
- package/dist/commands/sources/source-manage.js +94 -59
- package/dist/commands/sources/sources-cli.js +64 -205
- package/dist/commands/sources/stash-cli.js +91 -54
- package/dist/commands/sources/stash-skeleton.js +1 -1
- package/dist/commands/tasks/tasks-cli.js +106 -104
- package/dist/commands/tasks/tasks.js +445 -262
- package/dist/commands/workflow-cli.js +75 -228
- package/dist/core/action-contributors.js +1 -1
- package/dist/core/activation-policy.js +49 -0
- package/dist/core/adapter/adapters/agent-skills-adapter.js +181 -0
- package/dist/core/adapter/adapters/akm-adapter.js +528 -0
- package/dist/core/adapter/adapters/akm-lint.js +392 -0
- package/dist/core/adapter/adapters/akm-metadata.js +387 -0
- package/dist/core/adapter/adapters/akm-task-adapter.js +149 -0
- package/dist/core/adapter/adapters/akm-workflow-adapter.js +180 -0
- package/dist/core/adapter/adapters/claude-adapter.js +61 -0
- package/dist/core/adapter/adapters/dotenv-adapter.js +187 -0
- package/dist/core/adapter/adapters/generic-files-adapter.js +119 -0
- package/dist/core/adapter/adapters/index.js +80 -0
- package/dist/core/adapter/adapters/llm-wiki-adapter.js +419 -0
- package/dist/core/adapter/adapters/okf-adapter.js +391 -0
- package/dist/core/adapter/adapters/opencode-adapter.js +68 -0
- package/dist/core/adapter/adapters/shared.js +286 -0
- package/dist/core/adapter/adapters/tool-dir-shared.js +217 -0
- package/dist/core/adapter/adapters/website-snapshot-adapter.js +155 -0
- package/dist/core/adapter/bundle-adapter.js +4 -0
- package/dist/core/adapter/detect-adapter.js +17 -0
- package/dist/core/adapter/recognize-match.js +44 -0
- package/dist/core/adapter/registry.js +56 -0
- package/dist/core/adapter/types.js +4 -0
- package/dist/core/asset/akm-markdown.js +30 -0
- package/dist/core/asset/asset-placement.js +243 -0
- package/dist/core/asset/asset-ref.js +110 -79
- package/dist/core/asset/asset-serialize.js +20 -0
- package/dist/core/asset/frontmatter.js +28 -12
- package/dist/core/asset/markdown.js +40 -51
- package/dist/core/asset/resolve-ref.js +274 -0
- package/dist/core/asset/stash-meta.js +2 -2
- package/dist/core/bundle-id.js +51 -0
- package/dist/core/common.js +281 -86
- package/dist/core/config/config-io.js +42 -128
- package/dist/core/config/config-schema.js +233 -855
- package/dist/core/config/config-sources.js +162 -39
- package/dist/core/config/config-types.js +16 -11
- package/dist/core/config/config-version.js +29 -0
- package/dist/core/config/config-walker.js +126 -37
- package/dist/core/config/config.js +154 -331
- package/dist/core/config/deep-merge.js +41 -0
- package/dist/core/config/engine-semantics.js +28 -0
- package/dist/core/config/experimental.js +21 -0
- package/dist/core/config/schema/embedding.js +38 -0
- package/dist/core/config/schema/engines.js +116 -0
- package/dist/core/config/schema/experimental.js +47 -0
- package/dist/core/config/schema/feedback.js +31 -0
- package/dist/core/config/schema/improve-processes.js +389 -0
- package/dist/core/config/schema/improve.js +94 -0
- package/dist/core/config/schema/index-config.js +176 -0
- package/dist/core/config/schema/output.js +18 -0
- package/dist/core/config/schema/primitives.js +94 -0
- package/dist/core/config/schema/search.js +30 -0
- package/dist/core/config/schema/setup.js +18 -0
- package/dist/core/config/schema/sources-bundles.js +169 -0
- package/dist/core/config/schema/workflow.js +29 -0
- package/dist/core/env-secret-ref.js +155 -20
- package/dist/core/errors.js +17 -15
- package/dist/core/events-types.js +4 -0
- package/dist/core/events.js +46 -128
- package/dist/core/extra-params.js +62 -0
- package/dist/core/file-change.js +17 -0
- package/dist/core/file-lock.js +202 -57
- package/dist/core/fs-txn.js +392 -0
- package/dist/core/git-message.js +59 -0
- package/dist/core/improve-result.js +167 -0
- package/dist/core/lesson-lint.js +1 -17
- package/dist/core/logs-db.js +1 -1
- package/dist/core/maintenance-barrier.js +135 -0
- package/dist/core/migration-operation.js +44 -0
- package/dist/core/mutation-target.js +78 -0
- package/dist/core/paths.js +22 -25
- package/dist/core/platform.js +10 -0
- package/dist/core/recognition-util.js +128 -0
- package/dist/core/redaction.js +392 -0
- package/dist/core/standards/resolve-standards-context.js +36 -65
- package/dist/core/standards/resolve-stash-standards.js +2 -2
- package/dist/core/standards/resolve-type-conventions.js +5 -5
- package/dist/core/state/migrations.js +242 -11
- package/dist/core/state-db.js +98 -10
- package/dist/core/structured.js +1 -1
- package/dist/core/subprocess.js +303 -0
- package/dist/core/text-truncation.js +9 -5
- package/dist/core/time.js +20 -0
- package/dist/core/type-presentation.js +130 -0
- package/dist/core/warn.js +0 -3
- package/dist/core/write-source.js +834 -118
- package/dist/indexer/bundle-identity-guard.js +92 -0
- package/dist/indexer/db/graph-db.js +1 -25
- package/dist/indexer/db/llm-cache.js +1 -1
- package/dist/indexer/ensure-index.js +30 -9
- package/dist/indexer/graph/graph-boost.js +9 -30
- package/dist/indexer/graph/graph-extraction.js +41 -27
- package/dist/indexer/graph/graph-types.js +4 -0
- package/dist/indexer/index-writer-lock.js +93 -49
- package/dist/indexer/index-written-assets.js +100 -53
- package/dist/indexer/indexer.js +746 -329
- package/dist/indexer/init.js +18 -25
- package/dist/indexer/installations.js +142 -0
- package/dist/indexer/passes/dir-staleness.js +18 -10
- package/dist/indexer/passes/memory-inference.js +25 -15
- package/dist/indexer/passes/metadata.js +412 -243
- package/dist/indexer/scan/doc-to-entry.js +160 -0
- package/dist/indexer/scan/drain-dir.js +134 -0
- package/dist/indexer/search/db-search.js +292 -108
- package/dist/indexer/search/fts-query.js +64 -0
- package/dist/indexer/search/ranking-contributors.js +145 -25
- package/dist/indexer/search/ranking-types.js +4 -0
- package/dist/indexer/search/ranking.js +28 -71
- package/dist/indexer/search/search-attribution.js +67 -0
- package/dist/indexer/search/search-fields.js +18 -3
- package/dist/indexer/search/search-hit-enrichers.js +30 -40
- package/dist/indexer/search/search-source.js +157 -111
- package/dist/indexer/search/semantic-status.js +4 -1
- package/dist/indexer/usage/usage-events.js +10 -30
- package/dist/indexer/walk/file-context.js +3 -45
- package/dist/indexer/walk/matchers.js +42 -73
- package/dist/indexer/walk/path-resolver.js +11 -5
- package/dist/indexer/walk/walker.js +42 -14
- package/dist/integrations/agent/builder-shared.js +7 -0
- package/dist/integrations/agent/builders.js +5 -58
- package/dist/integrations/agent/config.js +3 -143
- package/dist/integrations/agent/detect.js +17 -2
- package/dist/integrations/agent/engine-resolution.js +231 -0
- package/dist/integrations/agent/index.js +1 -2
- package/dist/integrations/agent/model-aliases.js +8 -3
- package/dist/integrations/agent/profiles.js +6 -99
- package/dist/integrations/agent/prompts.js +46 -18
- package/dist/integrations/agent/runner-dispatch.js +78 -13
- package/dist/integrations/agent/runner.js +76 -208
- package/dist/integrations/agent/spawn.js +48 -279
- package/dist/integrations/harnesses/aider/agent-builder.js +9 -8
- package/dist/integrations/harnesses/aider/index.js +2 -12
- package/dist/integrations/harnesses/amazonq/agent-builder.js +10 -16
- package/dist/integrations/harnesses/amazonq/index.js +3 -17
- package/dist/integrations/harnesses/claude/agent-builder.js +2 -3
- package/dist/integrations/harnesses/claude/config-import.js +1 -3
- package/dist/integrations/harnesses/claude/index.js +1 -14
- package/dist/integrations/harnesses/claude/session-log.js +27 -75
- package/dist/integrations/harnesses/codex/agent-builder.js +8 -7
- package/dist/integrations/harnesses/codex/index.js +2 -13
- package/dist/integrations/harnesses/copilot/agent-builder.js +9 -9
- package/dist/integrations/harnesses/copilot/index.js +1 -13
- package/dist/integrations/harnesses/gemini/agent-builder.js +8 -9
- package/dist/integrations/harnesses/gemini/index.js +1 -13
- package/dist/integrations/harnesses/ids.js +24 -0
- package/dist/integrations/harnesses/index.js +31 -33
- package/dist/integrations/harnesses/opencode/agent-builder.js +23 -5
- package/dist/integrations/harnesses/opencode/config-import.js +1 -3
- package/dist/integrations/harnesses/opencode/index.js +1 -18
- package/dist/integrations/harnesses/opencode/session-log.js +67 -125
- package/dist/integrations/harnesses/opencode-sdk/harness.js +3 -17
- package/dist/integrations/harnesses/opencode-sdk/sdk-runner.js +274 -191
- package/dist/integrations/harnesses/openhands/agent-builder.js +12 -10
- package/dist/integrations/harnesses/openhands/index.js +2 -12
- package/dist/integrations/harnesses/pi/agent-builder.js +11 -18
- package/dist/integrations/harnesses/pi/index.js +3 -16
- package/dist/integrations/harnesses/shared.js +17 -0
- package/dist/integrations/harnesses/types.js +38 -34
- package/dist/integrations/lockfile.js +211 -24
- package/dist/integrations/session-logs/index.js +24 -40
- package/dist/integrations/session-logs/provider-base.js +113 -0
- package/dist/llm/client.js +182 -110
- package/dist/llm/embedders/deterministic.js +2 -2
- package/dist/llm/embedders/remote.js +21 -9
- package/dist/llm/feature-gate.js +17 -57
- package/dist/llm/graph-extract.js +12 -13
- package/dist/llm/index-passes.js +8 -42
- package/dist/llm/memory-infer.js +144 -1
- package/dist/llm/metadata-enhance.js +45 -30
- package/dist/llm/structured-call.js +16 -8
- package/dist/llm/usage-persist.js +30 -5
- package/dist/llm/usage-telemetry.js +59 -6
- package/dist/output/cli-hints.js +1 -2
- package/dist/output/command-registry.js +27 -0
- package/dist/output/context.js +22 -7
- package/dist/output/format-exempt.js +80 -0
- package/dist/output/generic-render.js +251 -0
- package/dist/output/html-render.js +11 -16
- package/dist/output/render-registry.js +57 -0
- package/dist/output/renderers.js +15 -281
- package/dist/output/shapes/curate.js +10 -1
- package/dist/output/shapes/events.js +12 -7
- package/dist/output/shapes/helpers.js +58 -84
- package/dist/output/shapes/passthrough.js +8 -40
- package/dist/output/shapes/proposal/producer.js +15 -7
- package/dist/output/shapes/registry.js +12 -6
- package/dist/output/shapes.js +0 -9
- package/dist/output/text/{init.js → bundle-create.js} +3 -1
- package/dist/output/text/bundle-show.js +7 -0
- package/dist/output/text/command-format.js +562 -0
- package/dist/output/text/env.js +1 -3
- package/dist/output/text/events.js +8 -7
- package/dist/output/text/helpers.js +15 -1375
- package/dist/output/text/proposal/producer.js +4 -2
- package/dist/output/text/proposal-format.js +202 -0
- package/dist/output/text/registry-commands.js +1 -2
- package/dist/output/text/registry.js +12 -6
- package/dist/output/text/show-directives.js +117 -0
- package/dist/output/text/show-format.js +103 -0
- package/dist/output/text/sync.js +5 -0
- package/dist/output/text/workflow-format.js +332 -0
- package/dist/output/text/workflow.js +1 -2
- package/dist/output/text.js +10 -19
- package/dist/registry/factory.js +4 -6
- package/dist/registry/origin-resolve.js +16 -27
- package/dist/registry/providers/skills-sh.js +3 -3
- package/dist/registry/providers/static-index.js +15 -25
- package/dist/registry/resolve.js +43 -94
- package/dist/registry/semver.js +43 -0
- package/dist/runtime.js +81 -12
- package/dist/scripts/akm-migrate.js +35529 -0
- package/dist/setup/detect.js +5 -7
- package/dist/setup/detected-engines.js +136 -0
- package/dist/setup/engine-config.js +100 -0
- package/dist/setup/registry-stash-loader.js +3 -3
- package/dist/setup/semantic-assets.js +12 -9
- package/dist/setup/setup.js +444 -208
- package/dist/setup/steps/connection-shared.js +120 -0
- package/dist/setup/steps/connection.js +108 -305
- package/dist/setup/steps/platforms.js +13 -12
- package/dist/setup/steps/semantic.js +15 -3
- package/dist/setup/steps/sources.js +21 -15
- package/dist/setup/steps/stashdir.js +6 -4
- package/dist/setup/steps/tasks.js +236 -119
- package/dist/setup/steps.js +3 -2
- package/dist/sources/freshness.js +39 -0
- package/dist/sources/provider-factory.js +11 -17
- package/dist/sources/providers/filesystem.js +2 -3
- package/dist/sources/providers/git-install.js +278 -34
- package/dist/sources/providers/git-provider.js +54 -56
- package/dist/sources/providers/git-stash.js +420 -91
- package/dist/sources/providers/git.js +2 -2
- package/dist/sources/providers/npm.js +16 -19
- package/dist/sources/providers/provider-utils.js +47 -22
- package/dist/sources/providers/sync-from-ref.js +3 -9
- package/dist/sources/providers/website.js +2 -2
- package/dist/sources/resolve.js +11 -10
- package/dist/sources/snapshot-fetchers/types.js +4 -0
- package/dist/sources/{website-ingest.js → snapshot-fetchers/website-ingest.js} +110 -41
- package/dist/storage/database.js +60 -4
- package/dist/storage/engines/sqlite-migrations.js +156 -5
- package/dist/storage/locations.js +1 -2
- package/dist/storage/repositories/canaries-repository.js +1 -1
- package/dist/storage/repositories/events-repository.js +51 -11
- package/dist/storage/repositories/improve-runs-repository.js +6 -32
- package/dist/storage/repositories/index-connection.js +79 -0
- package/dist/storage/repositories/index-db.js +4 -3
- package/dist/storage/repositories/index-entries-repository.js +863 -0
- package/dist/{indexer/db/entry-mapper.js → storage/repositories/index-entry-mapper.js} +19 -2
- package/dist/storage/repositories/index-entry-types.js +4 -0
- package/dist/storage/repositories/index-fts-repository.js +167 -0
- package/dist/storage/repositories/index-llm-cache-repository.js +108 -0
- package/dist/storage/repositories/index-meta-repository.js +49 -0
- package/dist/{indexer/db/schema.js → storage/repositories/index-schema.js} +226 -100
- package/dist/storage/repositories/index-sql.js +12 -0
- package/dist/storage/repositories/index-utility-repository.js +356 -0
- package/dist/storage/repositories/index-vec-repository.js +250 -0
- package/dist/storage/repositories/outcome-repository.js +119 -0
- package/dist/storage/repositories/proposals-repository.js +317 -75
- package/dist/storage/repositories/registry-cache.js +1 -1
- package/dist/storage/repositories/salience-repository.js +172 -0
- package/dist/storage/repositories/task-history-repository.js +110 -3
- package/dist/storage/repositories/workflow-runs-repository.js +68 -35
- package/dist/tasks/backends/cron.js +169 -46
- package/dist/tasks/backends/exec-utils.js +76 -3
- package/dist/tasks/backends/index.js +6 -9
- package/dist/tasks/backends/launchd.js +292 -55
- package/dist/tasks/backends/schtasks.js +557 -70
- package/dist/tasks/backends/types.js +4 -0
- package/dist/tasks/command-executable.js +93 -0
- package/dist/tasks/embedded.js +56 -38
- package/dist/tasks/parser.js +156 -64
- package/dist/tasks/resolve-akm-bin.js +144 -51
- package/dist/tasks/runner.js +377 -209
- package/dist/tasks/schedule.js +108 -19
- package/dist/tasks/scheduler-invocation.js +296 -0
- package/dist/tasks/schema.js +1 -1
- package/dist/tasks/task-id.js +35 -0
- package/dist/tasks/validator.js +30 -16
- package/dist/workflows/authoring/authoring.js +96 -148
- package/dist/workflows/authoring/scope-key.js +1 -1
- package/dist/workflows/cli.js +0 -20
- package/dist/workflows/concurrency-policy.js +15 -0
- package/dist/workflows/exec/brief.js +25 -59
- package/dist/workflows/exec/frozen-judge.js +47 -0
- package/dist/workflows/exec/native-executor.js +157 -94
- package/dist/workflows/exec/report.js +365 -200
- package/dist/workflows/exec/run-workflow.js +46 -40
- package/dist/workflows/exec/scheduler.js +12 -41
- package/dist/workflows/exec/step-work.js +239 -205
- package/dist/workflows/exec/workflow-engine-gate.js +67 -0
- package/dist/workflows/ir/compile.js +141 -283
- package/dist/workflows/ir/freeze.js +233 -0
- package/dist/workflows/ir/plan-hash.js +40 -5
- package/dist/workflows/ir/schema.js +537 -1
- package/dist/workflows/parser.js +878 -306
- package/dist/workflows/program/expressions.js +20 -208
- package/dist/workflows/program/schema.js +7 -10
- package/dist/workflows/renderer.js +99 -121
- package/dist/workflows/resource-limits.js +22 -0
- package/dist/workflows/runtime/checkin.js +1 -1
- package/dist/workflows/runtime/plan-classifier.js +131 -0
- package/dist/workflows/runtime/runs.js +200 -113
- package/dist/workflows/runtime/unit-checkin.js +1 -1
- package/dist/workflows/runtime/unit-phases.js +20 -0
- package/dist/workflows/runtime/workflow-asset-loader.js +235 -97
- package/dist/workflows/schema.js +1 -11
- package/dist/workflows/validate-summary.js +4 -26
- package/dist/workflows/validator.js +52 -30
- package/docs/README.md +42 -78
- package/docs/migration/README.md +8 -0
- package/docs/migration/release-notes/0.6.0.md +1 -1
- package/docs/migration/release-notes/0.7.0.md +9 -8
- package/docs/migration/release-notes/0.9.0.md +158 -14
- package/docs/migration/v0.7-to-v0.8.md +46 -47
- package/docs/migration/v0.8-to-v0.9.md +844 -0
- package/docs/reference/README.md +12 -0
- package/docs/reference/data-and-telemetry.md +333 -0
- package/package.json +21 -17
- package/schemas/akm-asset-envelope.json +93 -0
- package/schemas/akm-config.json +4636 -0
- package/schemas/akm-task.json +87 -0
- package/{dist/schemas → schemas}/akm-workflow.json +127 -82
- package/dist/akm-migrate-storage +0 -38
- package/dist/assets/help/help-accept.md +0 -12
- package/dist/assets/help/help-improve.md +0 -84
- package/dist/assets/help/help-proposals.md +0 -17
- package/dist/assets/help/help-propose.md +0 -17
- package/dist/assets/help/help-reject.md +0 -11
- package/dist/assets/profiles/frequent.json +0 -13
- package/dist/assets/profiles/recombine-only.json +0 -21
- package/dist/assets/profiles/reflect-distill.json +0 -30
- package/dist/assets/profiles/synthesize.json +0 -15
- package/dist/assets/prompts/procedural-system.md +0 -44
- package/dist/assets/prompts/recombine-system.md +0 -40
- package/dist/assets/prompts/staleness-detect-system.md +0 -6
- package/dist/assets/tasks/core/backup.yml +0 -4
- package/dist/assets/tasks/graph-refresh-weekly.yml +0 -10
- package/dist/assets/templates/html/default.html +0 -78
- package/dist/assets/templates/html/vendor/echarts.min.js +0 -45
- package/dist/assets/wiki/index-template.md +0 -12
- package/dist/assets/wiki/ingest-workflow-template.md +0 -83
- package/dist/assets/wiki/log-template.md +0 -8
- package/dist/assets/wiki/schema-template.md +0 -61
- package/dist/cli/config-migrate.js +0 -150
- package/dist/cli/config-validate.js +0 -39
- package/dist/commands/graph/graph-cli.js +0 -124
- package/dist/commands/graph/graph.js +0 -487
- package/dist/commands/improve/calibration.js +0 -161
- package/dist/commands/improve/dedup.js +0 -482
- package/dist/commands/improve/extract-watch.js +0 -140
- package/dist/commands/improve/hot-probation.js +0 -45
- package/dist/commands/improve/improve-auto-accept.js +0 -276
- package/dist/commands/improve/improve-profiles.js +0 -168
- package/dist/commands/improve/procedural.js +0 -398
- package/dist/commands/improve/recombine.js +0 -818
- package/dist/commands/improve/schema-similarity-gate.js +0 -168
- package/dist/commands/lint/agent-linter.js +0 -44
- package/dist/commands/lint/command-linter.js +0 -44
- package/dist/commands/lint/default-linter.js +0 -16
- package/dist/commands/lint/fact-linter.js +0 -39
- package/dist/commands/lint/knowledge-linter.js +0 -16
- package/dist/commands/lint/memory-linter.js +0 -61
- package/dist/commands/lint/registry.js +0 -41
- package/dist/commands/lint/skill-linter.js +0 -45
- package/dist/commands/lint/task-linter.js +0 -50
- package/dist/commands/lint/workflow-linter.js +0 -81
- package/dist/commands/proposal/legacy-import.js +0 -115
- package/dist/commands/sources/history.js +0 -196
- package/dist/commands/tasks/default-tasks.js +0 -186
- package/dist/commands/wiki-cli.js +0 -292
- package/dist/core/asset/asset-registry.js +0 -76
- package/dist/core/asset/asset-spec.js +0 -316
- package/dist/core/config/config-migration.js +0 -602
- package/dist/core/deep-merge.js +0 -38
- package/dist/core/eval/rank-metrics.js +0 -113
- package/dist/core/ripgrep/install.js +0 -163
- package/dist/core/ripgrep/resolve.js +0 -81
- package/dist/indexer/db/db.js +0 -1414
- package/dist/indexer/manifest.js +0 -170
- package/dist/indexer/passes/metadata-contributors.js +0 -31
- package/dist/indexer/usage/unmigrated-vaults-guard.js +0 -94
- package/dist/integrations/harnesses/opencode-sdk/index.js +0 -25
- package/dist/llm/call-ai.js +0 -62
- package/dist/llm/memory-infer-impl.js +0 -138
- package/dist/output/shapes/distill.js +0 -14
- package/dist/output/shapes/history.js +0 -11
- package/dist/output/text/distill.js +0 -6
- package/dist/output/text/enable-disable.js +0 -8
- package/dist/output/text/history.js +0 -6
- package/dist/output/text/wiki.js +0 -16
- package/dist/registry/build-index.js +0 -386
- package/dist/schemas/akm-config.json +0 -14225
- package/dist/scripts/migrate-storage.js +0 -13169
- package/dist/scripts/migrations/import-fs-improve-runs-to-db.js +0 -10169
- package/dist/scripts/migrations/v16-to-v17.js +0 -141
- package/dist/setup/legacy-config.js +0 -106
- package/dist/storage/repositories/consolidation-repository.js +0 -38
- package/dist/storage/repositories/recombine-repository.js +0 -213
- package/dist/wiki/wiki-templates.js +0 -15
- package/dist/wiki/wiki.js +0 -1012
- package/dist/workflows/authoring/workflow-program-template.yaml +0 -31
- package/dist/workflows/db.js +0 -350
- package/dist/workflows/exec/watch.js +0 -116
- package/dist/workflows/program/parser.js +0 -760
- package/dist/workflows/program/project.js +0 -105
- package/docs/data-and-telemetry.md +0 -227
- package/docs/migration/release-notes/0.9.0-beta.60.md +0 -19
- /package/dist/sources/{wiki-fetchers → snapshot-fetchers}/registry.js +0 -0
- /package/dist/sources/{wiki-fetchers → snapshot-fetchers}/youtube.js +0 -0
|
@@ -0,0 +1,844 @@
|
|
|
1
|
+
# Migrating from akm 0.8.x to 0.9.0
|
|
2
|
+
|
|
3
|
+
0.9.0 is the format-neutral **bundle / adapter** refactor. It replaces the flat
|
|
4
|
+
asset-type registry with per-format adapters, adopts one canonical ref grammar,
|
|
5
|
+
consolidates the durable databases and config, and completes several 0.8-era
|
|
6
|
+
deprecations (the CLI aliases and the `vault` asset type). This guide is
|
|
7
|
+
ordered the way you'll need it:
|
|
8
|
+
|
|
9
|
+
> **Heads-up on the 0.9.x series:** 0.9.x is a refactoring and clean-up
|
|
10
|
+
> series — patch releases may include further breaking changes (each with a
|
|
11
|
+
> CHANGELOG migration note) until the remaining technical debt is paid off.
|
|
12
|
+
> The 0.10.x series returns to bug fixes and tuning with the normal
|
|
13
|
+
> breaking-changes-only-in-major/minor discipline. See STABILITY.md.
|
|
14
|
+
|
|
15
|
+
1. [Cross the boundary: `akm migrate status` / `akm migrate apply`](#1-cross-the-boundary-akm-migrate-status--akm-migrate-apply)
|
|
16
|
+
2. [Ref grammar: `type:name` → `[bundle//]conceptId`](#2-ref-grammar-typename--bundleconceptid)
|
|
17
|
+
3. [Removed surfaces](#3-removed-surfaces)
|
|
18
|
+
4. [Behavioral notes](#4-behavioral-notes), including
|
|
19
|
+
[Engine And Task Assets](#engine-and-task-assets) config migration
|
|
20
|
+
5. [Troubleshooting](#5-troubleshooting)
|
|
21
|
+
|
|
22
|
+
The durable-state re-key, database merge, and config migration are handled by
|
|
23
|
+
the journaled, crash-resumable `akm migrate apply` coordinator. It also rewrites
|
|
24
|
+
legacy `workflow:` target refs in valid 0.8 task files after resolving them
|
|
25
|
+
against their containing/configured bundle while preserving each YAML file's
|
|
26
|
+
permission mode; it does not translate profile-based configuration or workflow
|
|
27
|
+
definitions automatically. Create the recovery backup
|
|
28
|
+
before changing a live installation, then migrate other affected assets deliberately.
|
|
29
|
+
|
|
30
|
+
## 1. Cross the boundary: `akm migrate status` / `akm migrate apply`
|
|
31
|
+
|
|
32
|
+
`akm migrate apply` is the one command that performs the 0.8 → 0.9 cutover.
|
|
33
|
+
It:
|
|
34
|
+
|
|
35
|
+
- Converts config from the flat `stashDir` / `sources` / `installed` /
|
|
36
|
+
`wikiName` keys to a `bundles` map keyed by each source's stable id, plus
|
|
37
|
+
`defaultBundle` naming the primary writable bundle. Bundle ids are derived
|
|
38
|
+
from the existing `registryId` / path slug, so no second identity migration
|
|
39
|
+
happens. After the cutover, the retired keys are **hard-rejected** by the
|
|
40
|
+
0.9.0 config schema whenever present — a config still carrying them fails to
|
|
41
|
+
load with an error naming `akm migrate apply`
|
|
42
|
+
(`src/core/config/config-schema.ts`). Registry-installed bundles keep only
|
|
43
|
+
their desired locator (`git`/`npm` + `registryId`) in config; resolved cache
|
|
44
|
+
paths and revisions live exclusively in the lockfile.
|
|
45
|
+
- Folds the former `workflow.db` into `state.db`, taking the database count
|
|
46
|
+
from four to three: `state.db` (durable workspace state), `index.db` (the
|
|
47
|
+
fully regenerable search cache), and a separate `logs.db`.
|
|
48
|
+
- Folds `.stash.json` sidecars into the new layout and applies the AKM adapter's
|
|
49
|
+
D-R6 reserved-filename renames (`index.md` / `log.md` at any AKM stash depth
|
|
50
|
+
are now reserved structural files — see
|
|
51
|
+
[§2](#2-ref-grammar-typename--bundleconceptid)).
|
|
52
|
+
- Imports any pre-0.9 filesystem proposals into `state.db` as part of the same
|
|
53
|
+
apply — this is no longer a separate step.
|
|
54
|
+
- Re-keys every durable ref (usage/feedback events, proposal targets,
|
|
55
|
+
workflow/task targets, salience) to the new `[bundle//]conceptId` spelling.
|
|
56
|
+
Refs embedded in your own asset bodies are rewritten by the content
|
|
57
|
+
migration; unresolvable refs are quarantined, not dropped: the audit summary
|
|
58
|
+
lands in `legacy_state` (surface, ref, row count) and the complete original
|
|
59
|
+
rows are preserved as JSON in `legacy_state_rows` in the migrated
|
|
60
|
+
`state.db`, so nothing the migration cannot re-key is destroyed.
|
|
61
|
+
|
|
62
|
+
### The 0.8 binary cannot do this
|
|
63
|
+
|
|
64
|
+
The 0.8 binary does not contain `akm migrate` or the `upgrade
|
|
65
|
+
--migration-config` contract. Do not attempt to invoke either command with
|
|
66
|
+
0.8, and do not use 0.8 self-update to cross this boundary. Use this
|
|
67
|
+
package-manager/manual boundary procedure instead:
|
|
68
|
+
|
|
69
|
+
1. Stop AKM writers, schedulers, and workflow drivers.
|
|
70
|
+
2. Prepare the complete 0.9 config in a separate file. Do not replace the live
|
|
71
|
+
0.8 config; AKM cannot infer names when old LLM and agent profiles collide.
|
|
72
|
+
3. Take an independent filesystem backup of the live 0.8 `config.json`,
|
|
73
|
+
`state.db`, and `workflow.db` (including any SQLite `-wal`/`-shm` files).
|
|
74
|
+
Store it outside AKM's data directory and verify it before continuing.
|
|
75
|
+
4. Install 0.9 with the package manager, or download, checksum, and stage the
|
|
76
|
+
0.9 standalone binary. A package-manager install replaces the managed 0.8
|
|
77
|
+
package; a standalone operator should retain the old executable. Keep the
|
|
78
|
+
independent data backup in either case.
|
|
79
|
+
5. Invoke the newly installed or staged 0.9 binary, whose migration startup
|
|
80
|
+
bypass can read the old installation without loading its config normally.
|
|
81
|
+
6. After apply succeeds, run `akm task sync --rebind` with that same 0.9 binary
|
|
82
|
+
before restarting schedulers. The explicit rebind replaces 0.8 native
|
|
83
|
+
scheduler definitions with current context-bound invocations.
|
|
84
|
+
|
|
85
|
+
Package-manager installation examples for step 4:
|
|
86
|
+
|
|
87
|
+
Package-manager installs require Node.js >= 22. If Bun >= 1.0 is also on
|
|
88
|
+
`PATH`, the installed launcher prefers Bun after Node.js bootstraps it.
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
npm install -g akm-cli@0.9.0
|
|
92
|
+
# or: pnpm add -g akm-cli@0.9.0
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Commands for steps 5 and 6:
|
|
96
|
+
|
|
97
|
+
```sh
|
|
98
|
+
# Package-manager install: this `akm` is now the 0.9 binary.
|
|
99
|
+
akm migrate status --config ./prepared-0.9.json
|
|
100
|
+
akm migrate apply --config ./prepared-0.9.json --dry-run
|
|
101
|
+
akm migrate apply --config ./prepared-0.9.json
|
|
102
|
+
akm task sync --rebind
|
|
103
|
+
|
|
104
|
+
# Or invoke a checksummed staged standalone binary explicitly.
|
|
105
|
+
./akm-0.9 migrate status --config ./prepared-0.9.json
|
|
106
|
+
./akm-0.9 migrate apply --config ./prepared-0.9.json
|
|
107
|
+
./akm-0.9 task sync --rebind
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Status and dry-run perform the same read-only eligibility checks and report the
|
|
111
|
+
source config plus target config explicitly. Apply validates the target in
|
|
112
|
+
memory, creates a verified recovery run, applies pending `state.db` and
|
|
113
|
+
`workflow.db` migrations one transaction at a time, and atomically installs the
|
|
114
|
+
prepared config last. If any later artifact fails, apply restores config and
|
|
115
|
+
both databases from the verified run before returning. Each artifact is
|
|
116
|
+
classified independently, so a current config with pre-cutover databases can be
|
|
117
|
+
recovered safely.
|
|
118
|
+
|
|
119
|
+
Apply records durable `prepared`, `state-converting`, `state-collapsing`,
|
|
120
|
+
`state-applied`, `workflow-applied`, `cutover-applied`, `config-applied`, `tasks-prepared`, `tasks-applied`,
|
|
121
|
+
`pilot-prepared`, `pilot-applied`, `rollback-prepared`, and `committed` phases. Every phase stores
|
|
122
|
+
streaming size/SHA fingerprints for config, both databases, and SQLite sidecars;
|
|
123
|
+
a pre-cutover resume or rollback first requires the exact live generation.
|
|
124
|
+
State schema migration and the `state-converting` marker commit together; the
|
|
125
|
+
marker binds a canonical logical digest before the journal records the exact
|
|
126
|
+
physical `state-collapsing` generation. A marker-write crash is recoverable only
|
|
127
|
+
when that digest still matches. Once the journal is bound, any later WAL frame
|
|
128
|
+
fails closed; a nonexact generation is accepted only after the raw database
|
|
129
|
+
header proves the WAL-to-DELETE collapse completed and the logical digest still
|
|
130
|
+
matches. After a process
|
|
131
|
+
crash, ordinary config and canonical database access fail closed; `akm migrate
|
|
132
|
+
status` reports the pending phase and `akm migrate apply` resumes idempotently
|
|
133
|
+
from the retained target and verified backup. Apply also refuses before backup
|
|
134
|
+
while managed database handles, maintenance activities, AKM mutation locks, or
|
|
135
|
+
workflow claims are live.
|
|
136
|
+
|
|
137
|
+
A journal at `state-applied` or `workflow-applied` is authenticated by raw
|
|
138
|
+
artifact fingerprints before AKM opens live SQLite files. An exact journal is
|
|
139
|
+
durably rewound through `state-converting`; a nonexact journal fails closed
|
|
140
|
+
without probing WAL state. A journal at `cutover-applied` or any later
|
|
141
|
+
forward-only phase is instead authenticated by the same operation's committed
|
|
142
|
+
cutover ledger row, continuing from its recorded phase without requiring the
|
|
143
|
+
`state-converting` marker; physical WAL differences are retained rather than
|
|
144
|
+
rolled back. A post-cutover journal without that operation-bound marker fails
|
|
145
|
+
closed.
|
|
146
|
+
|
|
147
|
+
Once already running a contract-capable 0.9 release, future self-upgrades may
|
|
148
|
+
pass a prepared target through the coordinated upgrade path:
|
|
149
|
+
|
|
150
|
+
```sh
|
|
151
|
+
akm upgrade --migration-config ./prepared-0.9.json
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
This command is not the 0.8-to-0.9 procedure. The already-installed 0.8 binary
|
|
155
|
+
cannot contain or enforce safeguards added in 0.9, so operators must follow the
|
|
156
|
+
manual boundary above rather than relying on 0.8 self-update. For 0.9+ upgrades,
|
|
157
|
+
the current binary preflights only its current artifact state; it does not parse
|
|
158
|
+
a prepared config for the future release. After installation, only the new
|
|
159
|
+
binary receives `--config` during apply. If the active config is already current,
|
|
160
|
+
no migration-config flag is needed.
|
|
161
|
+
|
|
162
|
+
Recovery runs are stored under
|
|
163
|
+
`$DATA/backups/migrations/<installation-id>/<run-id>/`. They record present and
|
|
164
|
+
absent `config.json`, `state.db`, and `workflow.db` artifacts, ordered migration
|
|
165
|
+
ledgers, sizes, and streaming SHA-256 hashes. SQLite snapshots must also pass
|
|
166
|
+
`PRAGMA quick_check` and ledger-prefix validation before the manifest is
|
|
167
|
+
published. `akm-migrate backup --for 0.9.0` creates an additional unique run when
|
|
168
|
+
an operator wants a manual snapshot. Routine config writes, telemetry, and
|
|
169
|
+
already-current database opens do not depend on any historical run.
|
|
170
|
+
|
|
171
|
+
## 2. Ref grammar: `type:name` → `[bundle//]conceptId`
|
|
172
|
+
|
|
173
|
+
Refs are now subdir-qualified concept ids inside their bundle —
|
|
174
|
+
`skills/code-review`, `memories/vpn-note`, `knowledge/api-guide`, `env/prod`,
|
|
175
|
+
`secrets/deploy-token` — with an optional `bundle//` installation prefix and an
|
|
176
|
+
optional `#fragment`. Durable state stores the fully-qualified
|
|
177
|
+
`bundle//conceptId`; the short bundle-omitted form is accepted input only (CLI,
|
|
178
|
+
API, and inside bundle content), resolved against `defaultBundle` and then
|
|
179
|
+
installation-priority order.
|
|
180
|
+
|
|
181
|
+
Before / after:
|
|
182
|
+
|
|
183
|
+
| 0.8.x | 0.9.0 |
|
|
184
|
+
| --- | --- |
|
|
185
|
+
| `skill:code-review` | `skills/code-review` |
|
|
186
|
+
| `memory:vpn-note` | `memories/vpn-note` |
|
|
187
|
+
| `origin//knowledge:api-guide` | `origin//knowledge/api-guide` |
|
|
188
|
+
| `vault:prod` | `env/prod` (see [§3](#3-removed-surfaces)) |
|
|
189
|
+
|
|
190
|
+
**There is no compatibility parser.** The pre-0.9.0 `[origin//]type:name`
|
|
191
|
+
grammar is removed from every normal code path; it survives only inside the
|
|
192
|
+
migrator (`scripts/akm-migrate/migrate/legacy-ref-grammar.ts`) for reading
|
|
193
|
+
pre-cutover data.
|
|
194
|
+
`akm migrate apply` re-keys every durable ref to the new spelling, and refs
|
|
195
|
+
embedded in your own asset bodies are rewritten by the content migration — but
|
|
196
|
+
any prompt, `AGENTS.md`, or doc that still spells refs in the old `type:name`
|
|
197
|
+
form must be updated by hand. A code-review skill is now `skills/code-review`.
|
|
198
|
+
See `STABILITY.md` for the full contract.
|
|
199
|
+
|
|
200
|
+
`index.md` and `log.md` are also now reserved by the AKM adapter at every stash
|
|
201
|
+
depth — never indexed as items and never valid item-write targets. This matches
|
|
202
|
+
OKF's structural names but is an AKM format rule, not an assertion that the
|
|
203
|
+
stash is an OKF bundle. Existing stash files with those names are excluded from
|
|
204
|
+
the index and renamed by the content migration if they hold a real item.
|
|
205
|
+
|
|
206
|
+
## 3. Removed surfaces
|
|
207
|
+
|
|
208
|
+
### `akm wiki` → a bundle format, not a command family
|
|
209
|
+
|
|
210
|
+
0.9.0 removes the entire `akm wiki` verb family (`create`, `register`, `list`,
|
|
211
|
+
`show`, `remove`, `pages`, `search`, `stash`, `lint`, `ingest`) and the `wiki`
|
|
212
|
+
asset type. The Karpathy-style LLM wiki structure stays first-class, but as a
|
|
213
|
+
**bundle format** owned by the `llm-wiki` adapter instead of a bespoke command
|
|
214
|
+
surface: `schema.md` (the per-wiki rulebook) + `pages/` (agent-authored pages)
|
|
215
|
+
at a bundle's root is enough for the indexer to recognize and lint it like any
|
|
216
|
+
other bundle. `raw/`, `index.md`, and `log.md` stay reserved infrastructure.
|
|
217
|
+
|
|
218
|
+
There is no `akm wiki ...` compatibility shim — an installed non-akm wiki
|
|
219
|
+
directory reclassifies under the `llm-wiki` adapter on your next `akm index`
|
|
220
|
+
(see [adapter dispatch reclassification](#4-behavioral-notes)); wiki pages are
|
|
221
|
+
found through `akm search`/`akm show` like any other asset, and lint runs
|
|
222
|
+
through `akm lint`.
|
|
223
|
+
|
|
224
|
+
### `akm vault` → `env` / `secret`
|
|
225
|
+
|
|
226
|
+
0.9.0 also removes the deprecated `vault` asset type. Its replacement, the `env`
|
|
227
|
+
asset type, shipped in 0.8.0 alongside a deprecation shim and an automatic
|
|
228
|
+
`vaults/` → `env/` migration. This section explains what changed, how to
|
|
229
|
+
migrate, and what 0.9.0 removes.
|
|
230
|
+
|
|
231
|
+
> **TL;DR:** In 0.8.0, run the migration (`akm-migrate storage --yes`) to copy
|
|
232
|
+
> `vaults/` → `env/`, then switch your scripts from `akm vault …` to
|
|
233
|
+
> `akm env …` and from `source "$(akm vault path …)"` to
|
|
234
|
+
> `akm env run <name> -- <command>` (or `-- $SHELL` for an interactive
|
|
235
|
+
> session). Everything keeps working through 0.8.x; the `vault` verb and
|
|
236
|
+
> `vault:` refs are removed in 0.9.0.
|
|
237
|
+
|
|
238
|
+
#### Why `vault` → `env`
|
|
239
|
+
|
|
240
|
+
The old `vault` type managed individual `KEY=value` entries: `vault set`,
|
|
241
|
+
`vault unset`, comment management, and bespoke value quoting. That hand-rolled
|
|
242
|
+
write surface was the riskiest part of the feature. 0.8.0 simplifies the model
|
|
243
|
+
and splits it by **purpose**:
|
|
244
|
+
|
|
245
|
+
- **`env`** — a group of related **configuration** for an app/service (URLs,
|
|
246
|
+
flags, and any credentials it needs) in one `.env` file, sourced or injected
|
|
247
|
+
**wholesale**. Values may or may not be sensitive — all are protected. akm no
|
|
248
|
+
longer edits entries; you edit the file with your own editor and akm loads it.
|
|
249
|
+
- **`secret`** — a single **sensitive value** used on its own for authentication
|
|
250
|
+
(one file = one value: a token, key, or cert), for the cases where
|
|
251
|
+
`vault set <ref> <KEY>` was used to store one credential.
|
|
252
|
+
|
|
253
|
+
Both protect values identically (never written to stdout, the index, or any
|
|
254
|
+
structured output); env additionally surfaces key names for discoverability
|
|
255
|
+
(comment text is never surfaced — comments can contain commented-out
|
|
256
|
+
credentials). Pick `env` for configuration, `secret` for a standalone
|
|
257
|
+
authentication credential.
|
|
258
|
+
|
|
259
|
+
#### What the `vault` split became
|
|
260
|
+
|
|
261
|
+
The mapping (right column is the current 0.9.0 world):
|
|
262
|
+
|
|
263
|
+
| Area | old `vault` world | now (0.9.0) |
|
|
264
|
+
| --- | --- | --- |
|
|
265
|
+
| Asset type | `vault` | `env` (whole group) / `secret` (single value) |
|
|
266
|
+
| Directory | `vaults/` | `env/` and `secrets/` (`vaults/` frozen after migration) |
|
|
267
|
+
| Ref | `vault:prod` | `env/prod` / `secrets/<name>` (the `vault:` prefix is removed) |
|
|
268
|
+
| Shell load | `source "$(akm vault path …)"` | `akm env run prod -- $SHELL` (or `export --out <file>` then source) |
|
|
269
|
+
| Run | `akm vault run vault:prod[/KEY] -- …` | `akm env run prod [--only K] -- …` |
|
|
270
|
+
| Set one value | `akm vault set vault:prod KEY` | `akm secret set <name>` (or edit the `.env`) |
|
|
271
|
+
| Ingest a `.env` | (hand-copy into `vaults/`) | `akm env create prod --from-file ./.env` |
|
|
272
|
+
| Delete | (hand-delete the file) | `akm env remove prod` |
|
|
273
|
+
| Renderer | `vault-env` | `env-file` |
|
|
274
|
+
| Audit event | `vault_access` | `env_access` |
|
|
275
|
+
|
|
276
|
+
The `akm vault` verb still works in 0.8.x: it prints a stderr deprecation
|
|
277
|
+
warning and delegates `list` / `path` / `export` / `run` / `create` to the
|
|
278
|
+
`env` handlers. `vault set` / `vault unset` and the single-key
|
|
279
|
+
`vault run <ref>/KEY` form are **hard-errors** with a signpost — silent changes
|
|
280
|
+
to secret-handling behaviour are unacceptable.
|
|
281
|
+
|
|
282
|
+
#### Running the migration
|
|
283
|
+
|
|
284
|
+
The migration copies `<stash>/vaults/` → `<stash>/env/`. It is **copy, never
|
|
285
|
+
move**: the legacy `vaults/` tree is left intact as a frozen copy and a
|
|
286
|
+
`vaults/.migrated` marker is written so re-runs are no-ops.
|
|
287
|
+
|
|
288
|
+
```sh
|
|
289
|
+
# Preview (no changes written)
|
|
290
|
+
akm-migrate storage --dry-run
|
|
291
|
+
|
|
292
|
+
# Apply
|
|
293
|
+
akm-migrate storage --yes
|
|
294
|
+
|
|
295
|
+
# From a source clone:
|
|
296
|
+
bun scripts/akm-migrate.ts storage --yes
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
What the `vaults/ → env/` step does:
|
|
300
|
+
|
|
301
|
+
1. Skips entirely if there is no `vaults/` directory, if the `.migrated` marker
|
|
302
|
+
already exists, or if `vaults/` contains no `.env` files (e.g. a fresh
|
|
303
|
+
install).
|
|
304
|
+
2. Copies every file under `vaults/` into `env/` as **opaque bytes** (`.env`,
|
|
305
|
+
`.sensitive`, and `.lock` sidecars alike) — contents are never read or
|
|
306
|
+
re-serialised.
|
|
307
|
+
3. **Never overwrites** an `env/` file you already authored (those are skipped
|
|
308
|
+
and preserved).
|
|
309
|
+
4. Tightens permissions on the copied tree: `0600` files, `0700` directories,
|
|
310
|
+
then verifies the mode. (The generic copy helper checks size only, so this
|
|
311
|
+
pass guarantees migrated secret material does not land at the umask default.)
|
|
312
|
+
5. Verifies the post-copy `.env` count is at least the source count, then writes
|
|
313
|
+
the `vaults/.migrated` marker.
|
|
314
|
+
|
|
315
|
+
After migrating, run `akm index` to refresh search so entries surface under
|
|
316
|
+
`env/…` rather than `vault:`.
|
|
317
|
+
|
|
318
|
+
#### Command mapping
|
|
319
|
+
|
|
320
|
+
```sh
|
|
321
|
+
# List
|
|
322
|
+
akm vault list → akm env list # doclint:ignore (left side is the removed 0.8.x `vault` verb — this is the "Before" of the mapping)
|
|
323
|
+
|
|
324
|
+
# Inspect keys (values never shown)
|
|
325
|
+
akm show vault:prod → akm show env/prod
|
|
326
|
+
|
|
327
|
+
# Load values into a shell (use a subshell — safe, nothing on disk)
|
|
328
|
+
source "$(akm vault path vault:prod)" → akm env run prod -- $SHELL
|
|
329
|
+
|
|
330
|
+
# Run a command with the env injected
|
|
331
|
+
akm vault run vault:prod -- ./deploy.sh → akm env run prod -- ./deploy.sh # doclint:ignore (left side is the removed 0.8.x `vault` verb — this is the "Before" of the mapping)
|
|
332
|
+
|
|
333
|
+
# Create / ingest an existing .env
|
|
334
|
+
akm vault create prod → akm env create prod # doclint:ignore (left side is the removed 0.8.x `vault` verb — this is the "Before" of the mapping)
|
|
335
|
+
# or: akm env create prod --from-file ./.env
|
|
336
|
+
|
|
337
|
+
# Edit (akm no longer manages entries)
|
|
338
|
+
akm vault set vault:prod DB_URL → $EDITOR "$(akm env path prod --quiet)" # doclint:ignore (left side is the removed 0.8.x `vault` verb — this is the "Before" of the mapping)
|
|
339
|
+
# or: akm secret set db-url
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
Existing `vault:` refs embedded in your own assets are **not** rewritten (akm
|
|
343
|
+
never mutates your content). They keep resolving through 0.8.x: the resolver
|
|
344
|
+
prefers `env/` and falls back to the frozen `vaults/` copy.
|
|
345
|
+
|
|
346
|
+
#### The safe load paths
|
|
347
|
+
|
|
348
|
+
`env path` prints the **raw** file path. Do **not** `source` it: a hand-edited
|
|
349
|
+
or migrated `.env` containing `X=$(rm -rf ~)` would execute on `source`.
|
|
350
|
+
|
|
351
|
+
- **Processes / agents / interactive** — `akm env run prod -- <cmd>` (or
|
|
352
|
+
`-- $SHELL`). Values go straight into the child process, never through a shell
|
|
353
|
+
and never onto stdout. **This is the only path safe for AI agents** —
|
|
354
|
+
`env export`/`env path` put value-bearing data where a captured context would
|
|
355
|
+
ingest it.
|
|
356
|
+
- **A sourceable file** (a tool that must `source` a script) — `akm env export
|
|
357
|
+
prod --out <file>` writes single-quote-escaped `export KEY='value'` lines
|
|
358
|
+
to a file (mode 0600); the values are re-serialised so sourcing it can never
|
|
359
|
+
execute a substitution. `export` never prints values to stdout, so it requires
|
|
360
|
+
`--out`.
|
|
361
|
+
- **Docker `_FILE` / `--env-file`** — `akm env path prod --quiet` prints the
|
|
362
|
+
raw file path for tools that read it themselves.
|
|
363
|
+
|
|
364
|
+
#### Single values are now secrets
|
|
365
|
+
|
|
366
|
+
If you used `vault set <ref> <KEY>` to store a single credential, store it as a
|
|
367
|
+
[secret](../reference/cli.md#secret) instead:
|
|
368
|
+
|
|
369
|
+
```sh
|
|
370
|
+
printf '%s' "$TOKEN" | akm secret set deploy-token
|
|
371
|
+
akm secret run deploy-token GITHUB_TOKEN -- gh release create v1.0.0
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
`akm env run` injects the **whole** file; the single-key `vault run <ref>/KEY`
|
|
375
|
+
form was removed because silently changing which variables a child process sees
|
|
376
|
+
is a security-relevant behaviour change.
|
|
377
|
+
|
|
378
|
+
#### What 0.9.0 removes
|
|
379
|
+
|
|
380
|
+
- The entire `akm vault` verb and its subcommands.
|
|
381
|
+
- The `vault:` ref alias. Parsing a `vault:` ref now fails immediately with:
|
|
382
|
+
`The \`vault\` asset type was removed in 0.9.0 — use \`env/\` (whole .env
|
|
383
|
+
config) or \`secrets/\` (a single value).`
|
|
384
|
+
- The `vault` asset-spec entry, renderer (`vault-env`), and the `vault_access`
|
|
385
|
+
audit-event alias.
|
|
386
|
+
- The frozen `vaults/` directory is deleted **only** after explicit per-path
|
|
387
|
+
confirmation — the migration never auto-removes it.
|
|
388
|
+
|
|
389
|
+
Switch to `akm env` / `akm secret` and the `akm env run <name> -- <cmd>`
|
|
390
|
+
idiom before upgrading to 0.9.0.
|
|
391
|
+
|
|
392
|
+
##### If you upgraded straight to 0.9.0 without migrating
|
|
393
|
+
|
|
394
|
+
Because 0.9.0 removed the `vault` asset type, the indexer **no longer scans
|
|
395
|
+
`vaults/` at all**. If you jumped from 0.7/0.8 to 0.9.0 and never ran
|
|
396
|
+
`akm-migrate storage`, the `.env` data still sitting in `vaults/` was never
|
|
397
|
+
copied to `env/` and will **not** appear under `env/…` — it is silently
|
|
398
|
+
un-indexed (the files themselves are untouched on disk).
|
|
399
|
+
|
|
400
|
+
The 0.9 runtime does not inspect the retired `vaults/` tree. Use the standalone
|
|
401
|
+
migration tool to detect and copy any remaining files; it owns the
|
|
402
|
+
`vaults/.migrated` marker and remains idempotent and non-destructive:
|
|
403
|
+
|
|
404
|
+
```sh
|
|
405
|
+
akm-migrate storage --yes # copies vaults/ -> env/, leaving vaults/ intact
|
|
406
|
+
akm index # refresh search so entries surface under env/
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
The `vaults/ → env/` migration step still ships in 0.9.0's
|
|
410
|
+
`akm-migrate storage` (it is part of the `0.8 → 0.9` migration) precisely so a
|
|
411
|
+
late migration on a 0.9.0 install still works.
|
|
412
|
+
|
|
413
|
+
#### Verifying the migration
|
|
414
|
+
|
|
415
|
+
```sh
|
|
416
|
+
# env/ now contains your former vault files
|
|
417
|
+
akm env list
|
|
418
|
+
|
|
419
|
+
# The frozen copy + marker are present
|
|
420
|
+
ls -la "$(akm info --format=json | jq -r .bundleDir)/vaults/.migrated"
|
|
421
|
+
|
|
422
|
+
# Values still never leak
|
|
423
|
+
akm show env/prod # key names only
|
|
424
|
+
akm search <a-secret-value> # no hits
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
#### Rolling back the vault copy
|
|
428
|
+
|
|
429
|
+
The migration is non-destructive — `vaults/` is untouched. To roll back, delete
|
|
430
|
+
the generated `env/` directory and remove the `vaults/.migrated` marker, then
|
|
431
|
+
downgrade akm. Because `env/` is a copy, no data is lost either way.
|
|
432
|
+
|
|
433
|
+
### Removed `--auto-accept` on `akm improve`
|
|
434
|
+
|
|
435
|
+
The 0.9.0 confidence gate `--auto-accept` used to configure was deleted:
|
|
436
|
+
proposals now queue for review (`akm proposal` / the drain engine) instead of
|
|
437
|
+
being auto-promoted by threshold. Through 0.9.x, `--auto-accept` is accepted
|
|
438
|
+
only as a compatibility flag: akm warns that it is removed and ignored, and
|
|
439
|
+
discards a space-separated value. Remove it from task definitions and scripts;
|
|
440
|
+
it becomes a hard error in 0.10. See [proposal triage](#4-behavioral-notes) for
|
|
441
|
+
the explicit replacement.
|
|
442
|
+
|
|
443
|
+
### Retired `--wiki` flag
|
|
444
|
+
|
|
445
|
+
`akm import`'s 0.8.x `--wiki <name>` flag (route content into
|
|
446
|
+
`wikis/<name>/raw/` instead of `knowledge/`) is removed along with the rest of
|
|
447
|
+
the `akm wiki` surface. `akm import` always writes into `knowledge/` (use
|
|
448
|
+
`--path` for a subdirectory); use the `llm-wiki` bundle format directly
|
|
449
|
+
(`pages/`, `raw/`) if you still want wiki-shaped content.
|
|
450
|
+
|
|
451
|
+
### Removed `--min-retrieval-count`
|
|
452
|
+
|
|
453
|
+
`akm improve`'s `--min-retrieval-count` flag and the `minRetrievalCount` option
|
|
454
|
+
configured the P0-A high-retrieval fallback lane, which was deleted along with
|
|
455
|
+
several other improve-loop lanes (self-consistency, multi-cycle, exploration
|
|
456
|
+
budget). There is no replacement flag — retrieval-count signal still feeds
|
|
457
|
+
ranking, just not through a dedicated eligibility fallback. Drop the flag from
|
|
458
|
+
any scripted `akm improve` invocations.
|
|
459
|
+
|
|
460
|
+
### `akm mv` → move the file, then `akm index`
|
|
461
|
+
|
|
462
|
+
0.9.0 removes `akm mv` outright — no alias, no stub; `akm mv …` fails with the
|
|
463
|
+
standard unknown-command error. A rename **is** delete plus create in akm's
|
|
464
|
+
identity model (see [`STABILITY.md`](../../STABILITY.md) § Renames), and the
|
|
465
|
+
command's inbound-ref rewrite matched bare conceptIds rather than anchored
|
|
466
|
+
`bundle//conceptId` refs, so it could edit ordinary prose while leaving real
|
|
467
|
+
refs dangling. The supported procedure is three steps you can see the results
|
|
468
|
+
of:
|
|
469
|
+
|
|
470
|
+
```sh
|
|
471
|
+
mv ~/akm/memories/projectA/old-note.md ~/akm/memories/projectA/new-note.md
|
|
472
|
+
akm index # the new path is indexed; the old entry drops out
|
|
473
|
+
akm lint # reports every inbound ref the rename left dangling
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
Fix the refs `akm lint` reports (its `missing-ref` check covers body prose and
|
|
477
|
+
the frontmatter xref channels) and re-run `akm lint` until it is clean.
|
|
478
|
+
Cross-bundle movement is copy/import plus delete — never identity-preserving.
|
|
479
|
+
|
|
480
|
+
**Optional: carry the ranking signal over.** The destination gets a fresh
|
|
481
|
+
identity, so its accumulated signal — feedback, usage events, salience and
|
|
482
|
+
outcome history — stays keyed to the old ref and is eventually collected as
|
|
483
|
+
orphan rows. If the asset has earned history worth keeping, run the re-key
|
|
484
|
+
script from a source clone **before** `akm index`:
|
|
485
|
+
|
|
486
|
+
```sh
|
|
487
|
+
mv ~/akm/memories/projectA/old-note.md ~/akm/memories/projectA/new-note.md
|
|
488
|
+
bun scripts/rekey-asset-ref.ts memories/projectA/old-note memories/projectA/new-note
|
|
489
|
+
akm index && akm lint
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
Add `--dry-run` to see the row counts it would move. It refuses if both files
|
|
493
|
+
exist (that is a copy, not a rename), and it is idempotent — a second run
|
|
494
|
+
reports zero changed rows. See
|
|
495
|
+
[the 0.9.0 troubleshooting guide](v0.9.0-troubleshooting.md) for the symptom
|
|
496
|
+
this fixes after the fact.
|
|
497
|
+
|
|
498
|
+
## 4. Behavioral notes
|
|
499
|
+
|
|
500
|
+
### Adapter dispatch reclassification (installed non-akm bundles)
|
|
501
|
+
|
|
502
|
+
The indexer now dispatches each installed bundle's *detected* adapter (Claude
|
|
503
|
+
tool dirs, LLM wikis, website snapshots, agent-skills packs, …) instead of
|
|
504
|
+
recognizing everything with the akm-stash adapter. Entries in such bundles
|
|
505
|
+
change type and ref spelling to the owning adapter's own scheme the first time
|
|
506
|
+
you reindex after upgrading. **No action needed** — the index is a
|
|
507
|
+
regenerable cache and rebuilds itself — but searches or saved refs into those
|
|
508
|
+
bundles may resolve to the new spellings afterwards. Reindex with `akm index`
|
|
509
|
+
right after the cutover so this settles before you rely on saved refs.
|
|
510
|
+
|
|
511
|
+
### `env`/`secret` writes now honor `--target` / `defaultWriteTarget`
|
|
512
|
+
|
|
513
|
+
Previously, `env create`/`set`/`unset`/`remove` and `secret set`/`remove`
|
|
514
|
+
selected a write destination independently of `--target` and
|
|
515
|
+
`defaultWriteTarget`, ignoring writability and git commit boundaries. 0.9.0
|
|
516
|
+
routes these mutations through the same `resolveWriteTarget` selection every
|
|
517
|
+
other write command uses: explicit `--target` wins, else `defaultWriteTarget`,
|
|
518
|
+
else the working stash — and a non-writable target is refused. A git-backed
|
|
519
|
+
writable target now lands the change in the same batch-at-boundary commit as
|
|
520
|
+
any other write (see [below](#single-batch-at-boundary-git-commit)). Reads
|
|
521
|
+
(`env run`/`show`/`list`/`path`/`export`, `secret run`/`path`/`list`) are
|
|
522
|
+
unaffected — they still search every configured source.
|
|
523
|
+
|
|
524
|
+
### LLM enrichment concurrency defaults
|
|
525
|
+
|
|
526
|
+
Indexing's LLM enrichment pool now defaults its concurrency from the
|
|
527
|
+
configured LLM endpoint instead of always assuming a remote API: a **local**
|
|
528
|
+
endpoint (`localhost`/`127.0.0.1`/`::1`/`*.localhost`) defaults to
|
|
529
|
+
**concurrency 1** (a single loaded model; parallel requests trigger reload
|
|
530
|
+
thrash), and a **remote** endpoint defaults to **concurrency 2** (enough to
|
|
531
|
+
overlap request latency without hammering rate-limited APIs).
|
|
532
|
+
`engines.<name>.concurrency` does not currently affect indexing enrichment;
|
|
533
|
+
it does cap frozen workflow fan-out.
|
|
534
|
+
|
|
535
|
+
### CLI rename table (old → new, removed 0.9.0)
|
|
536
|
+
|
|
537
|
+
Every old spelling printed a stderr deprecation warning in 0.8.x (suppressed
|
|
538
|
+
under `--quiet`) and delegated to the canonical form. 0.9.0 removes the old
|
|
539
|
+
spellings entirely — there is no delegation, and using one is a usage error.
|
|
540
|
+
|
|
541
|
+
| Old spelling (0.8, deprecated) | Canonical (use this) | Notes |
|
|
542
|
+
| --- | --- | --- |
|
|
543
|
+
| `akm proposals` | `akm proposal list` | bare `akm proposal` is now a usage error (exit 2) |
|
|
544
|
+
| `akm show proposal <id>` | `akm proposal show <id>` | |
|
|
545
|
+
| `akm diff <id>` | `akm proposal diff <id>` | |
|
|
546
|
+
| `akm accept <id>` | `akm proposal accept <id>` | |
|
|
547
|
+
| `akm reject <id>` | `akm proposal reject <id>` | |
|
|
548
|
+
| `akm revert <id>` | `akm proposal revert <id>` | |
|
|
549
|
+
| `--detail summary` | `--shape summary` | `--detail` is now verbosity only (`brief\|normal\|full`) |
|
|
550
|
+
| `--detail agent` | `--shape agent` | |
|
|
551
|
+
| `--for-agent` | `--shape agent` | |
|
|
552
|
+
| `--source` (on `accept`/`reject`/`history`) | `--generator` | `search`/`curate`'s `--source` was separately replaced by `--from` in the 0.9.0 surface overhaul (see below); `remember`'s `--source` is a distinct memory-tagging field, not renamed; `graph` was removed in 0.9.0 |
|
|
553
|
+
| `akm save` | `akm sync` | `sync` = commit + optional push; adds `--no-push` |
|
|
554
|
+
| `akm enable <component>` | `akm registry add <url> --name <component>` | `akm config enable/disable` was also removed in 0.9.0 (it only ever toggled the skills.sh registry); use `akm registry add\|remove`, the general mechanism |
|
|
555
|
+
| `akm disable <component>` | `akm registry remove <component>` | |
|
|
556
|
+
| `akm events` | `akm log` | `log` is primary in 0.9.0; `history` is a different (asset-scoped) surface |
|
|
557
|
+
| `akm wiki remove --force` | (removed — see [§3](#3-removed-surfaces)) | the whole `akm wiki` family is gone in 0.9.0 |
|
|
558
|
+
| `akm feedback --note <text>` | `akm feedback --reason <text>` | |
|
|
559
|
+
| `akm workflow next --dry-run` | (removed) | the flag is gone; `next` never supported a dry run |
|
|
560
|
+
|
|
561
|
+
0.9.0 retires the plural `akm tasks` spelling entirely (no alias): `akm task`
|
|
562
|
+
is the sole scheduling group. Its remaining subcommands are `add`, `run`,
|
|
563
|
+
`sync`, `doctor`, and `history`; `list`, `remove`, `init`, `enable`, and
|
|
564
|
+
`disable` are removed. `akm lessons` was removed outright (see
|
|
565
|
+
[§3](#3-removed-surfaces)).
|
|
566
|
+
|
|
567
|
+
### CLI surface overhaul rename table (0.9.0, hard break)
|
|
568
|
+
|
|
569
|
+
A second, larger rename pass landed within 0.9.0 itself: a full CLI-surface
|
|
570
|
+
overhaul with no deprecation window and no aliases. Every old spelling below
|
|
571
|
+
fails immediately with the standard unknown-command/unknown-flag error —
|
|
572
|
+
there was no 0.8.x warn-and-delegate period for these.
|
|
573
|
+
|
|
574
|
+
| Old spelling | New spelling / replacement | Notes |
|
|
575
|
+
| --- | --- | --- |
|
|
576
|
+
| `akm init` | `akm bundle create` | |
|
|
577
|
+
| `akm add` | `akm bundle add` | |
|
|
578
|
+
| `akm list` | `akm bundle list` | |
|
|
579
|
+
| `akm remove` | `akm bundle remove` | |
|
|
580
|
+
| `akm update` | `akm bundle update` | |
|
|
581
|
+
| `akm extract` | `akm proposal extract` | |
|
|
582
|
+
| `akm propose` | `akm proposal new` | |
|
|
583
|
+
| `akm registry search` | `akm search --from registry` | `--assets` folds in too |
|
|
584
|
+
| `akm tasks ...` | `akm task add\|run\|sync\|doctor\|history` | singular group; no plural alias; `list`, `remove`, `init`, `enable`, and `disable` are removed |
|
|
585
|
+
| `akm lessons` / `akm lesson` (command group) | (removed) | the `lesson` asset **type** is unaffected — read/write it via `akm search`/`akm show`/the proposal queue |
|
|
586
|
+
| `akm history` | (removed) | `--accept-rate-by-source` folded into `akm health --report` |
|
|
587
|
+
| `akm log tail` | `akm log --since '@offset:<id>'` | poll from a cooperating process; no daemon |
|
|
588
|
+
| `akm graph ...` (command group) | (removed) | summary counts (entities/relations/extraction coverage) folded into `akm health`; the extraction engine and `akm show`'s related-paths are unaffected |
|
|
589
|
+
| `akm mv` | (removed — see [§3](#akm-mv--move-the-file-then-akm-index)) | plain filesystem move → `akm index` → `akm lint`; optionally `bun scripts/rekey-asset-ref.ts <old> <new>` first to carry feedback/usage signal across the rename |
|
|
590
|
+
| `akm workflow template` | `akm workflow create --print` | prints the template without writing |
|
|
591
|
+
| `akm workflow validate` | `akm lint --type workflows --fail-on-flagged` | plain `lint` exits 0 regardless of findings — keep `--fail-on-flagged` in CI gates to preserve the old non-zero-on-invalid semantics |
|
|
592
|
+
| `akm workflow watch <run-id>` | `akm log --run <run-id> --since '@offset:<id>'` | |
|
|
593
|
+
| `akm extract --watch` / `--debounce-ms` | (removed) | use the shipped `core/extract.yml` cron template instead of a foreground daemon |
|
|
594
|
+
| `akm improve canary` / `--refresh` | `bun scripts/refresh-canary-set.ts [--refresh]` | maintainer tooling, run from a source checkout — helper scripts are not shipped in the npm package or binaries |
|
|
595
|
+
| `akm config show` | `akm config list` | `show` was a self-declared alias |
|
|
596
|
+
| `akm config validate` | (removed) | load-time schema checks already reject an invalid config |
|
|
597
|
+
| `akm index --background` | (removed) | the flag never actually backgrounded the process |
|
|
598
|
+
| `akm setup --detect-only` / `--reset-recommended` | (removed) | environment detection runs inside `akm setup`; `akm info` reports the *configured* capabilities, not a detection scan |
|
|
599
|
+
| `akm env set` / `akm env unset` | (removed) | edit the `.env` file directly, or ingest one with `env create --from-file` |
|
|
600
|
+
| `--source` on `search` / `curate` | `--from` | value rename too: `stash` → `local`, `both` → `all` |
|
|
601
|
+
| `--target` on `remember` / `clone` / `improve` / `task add`/`run`/`sync`/`history` | `--bundle` | `import` and `proposal accept`/`diff`/`revert` **keep** `--target` |
|
|
602
|
+
| `AKM_STASH_DIR` | `AKM_BUNDLE_DIR` | no fallback to the old name |
|
|
603
|
+
| JSON field `stashDir` | `bundleDir` | in command results (`akm info`, `akm bundle create`, `akm config path --all`'s `stash` key → `bundle`); internal DB columns and type names are unaffected |
|
|
604
|
+
| "stash" wording in help text, hints, and docs | "bundle" | user-visible surface only — internal identifiers, DB schema, and historical CHANGELOG/release-notes text are unaffected |
|
|
605
|
+
|
|
606
|
+
**Scheduler ABI respelling.** Installed cron/launchd/schtasks entries invoke
|
|
607
|
+
`akm task run <id> ... --scheduled` (previously a `tasks` spelling on some
|
|
608
|
+
installs). `akm task sync` detects an entry whose argv no longer parses under
|
|
609
|
+
the current spelling — treating it as an orphan of its marker id — and
|
|
610
|
+
reinstalls it from the current file state. Run `akm task sync --rebind` once
|
|
611
|
+
after upgrading to 0.9.0 to explicitly capture the current binary/invocation
|
|
612
|
+
in every installed scheduler entry; see [§1](#1-cross-the-boundary-akm-migrate-status--akm-migrate-apply).
|
|
613
|
+
|
|
614
|
+
### Safety guards added in 0.8 (behavior change for non-interactive callers)
|
|
615
|
+
|
|
616
|
+
Two previously-unguarded destructive paths confirm before acting. **Scripts
|
|
617
|
+
that invoke these non-interactively must add `-y` / `--yes`:**
|
|
618
|
+
|
|
619
|
+
- `akm registry remove <name>` — prompts before removing the registry; pass `-y`
|
|
620
|
+
to skip. Non-interactive use without `-y` aborts.
|
|
621
|
+
- `akm proposal accept --generator <g>` (the **bulk** form) — prompts before
|
|
622
|
+
promoting every matching proposal. Single-id accept is unchanged (revertable).
|
|
623
|
+
|
|
624
|
+
### Proposal triage replaces the `process-proposals` prompt task
|
|
625
|
+
|
|
626
|
+
Move a 0.8 triage process into the selected 0.9 improve strategy. The folded
|
|
627
|
+
pre-pass remains the recommended shape:
|
|
628
|
+
|
|
629
|
+
```jsonc
|
|
630
|
+
{
|
|
631
|
+
"improve": {
|
|
632
|
+
"strategies": {
|
|
633
|
+
"default": {
|
|
634
|
+
"processes": {
|
|
635
|
+
"triage": {
|
|
636
|
+
"enabled": true,
|
|
637
|
+
"applyMode": "queue",
|
|
638
|
+
"policy": "personal-stash"
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
```
|
|
646
|
+
|
|
647
|
+
If a separate schedule is required, replace the old agent prompt task with a
|
|
648
|
+
strict task YAML v2 command:
|
|
649
|
+
|
|
650
|
+
```yaml
|
|
651
|
+
version: 2
|
|
652
|
+
schedule: "20 * * * *"
|
|
653
|
+
command: akm proposal drain --policy personal-stash --yes
|
|
654
|
+
enabled: true
|
|
655
|
+
name: Drain AKM proposal queue
|
|
656
|
+
```
|
|
657
|
+
|
|
658
|
+
Task files live in your stash. Migration rewrites only legacy workflow-target
|
|
659
|
+
ref scalars; it does not convert an arbitrary prompt task into this command. The
|
|
660
|
+
deterministic `akm proposal drain` verb, or the folded strategy pre-pass, is the
|
|
661
|
+
supported 0.9 path.
|
|
662
|
+
|
|
663
|
+
### Single batch-at-boundary git commit
|
|
664
|
+
|
|
665
|
+
0.9.0 unifies the two commit models for git-backed sources onto a single
|
|
666
|
+
**batch-at-boundary** model (issue #507). Previously, writing an asset to a
|
|
667
|
+
writable git `--target` committed (and optionally pushed) **per asset**, gated
|
|
668
|
+
on `options.pushOnCommit`. That staged only the single asset file (leaving
|
|
669
|
+
`.akm/` state dirty) and produced one noisy commit per asset.
|
|
670
|
+
|
|
671
|
+
Now every write/delete to a source is a plain filesystem operation with **no**
|
|
672
|
+
per-asset commit. Git-backed targets are committed **once** at the end of the
|
|
673
|
+
operation (e.g. `akm remember --bundle <git-source>`, proposal accept/revert,
|
|
674
|
+
consolidate) as a single complete commit (`git add -A` staging `.akm/` + assets
|
|
675
|
+
together), pushed under the same `writable + remote` gate as `akm save`/`akm sync`.
|
|
676
|
+
|
|
677
|
+
**Migration:** `options.pushOnCommit` is rejected at config load. Remove it
|
|
678
|
+
from your source config and rely on `writable: true` (plus a configured remote)
|
|
679
|
+
to push. A writable git target with a remote is still pushed; a target without
|
|
680
|
+
a remote (or with push disabled) commits only.
|
|
681
|
+
|
|
682
|
+
## Engine And Task Assets
|
|
683
|
+
|
|
684
|
+
Replace `profiles.llm.<name>` and `profiles.agent.<name>` with one
|
|
685
|
+
`engines.<name>` map. Replace `defaults.llm`, `defaults.agent`, and
|
|
686
|
+
`defaults.improve` with `defaults.llmEngine`, `defaults.engine`, and
|
|
687
|
+
`defaults.improveStrategy`. Replace `profiles.improve.<name>` with
|
|
688
|
+
`improve.strategies.<name>`, process `mode`/`profile` with `engine`, and CLI
|
|
689
|
+
`--profile` with `--strategy` for improve or `--engine` for execution.
|
|
690
|
+
|
|
691
|
+
Do not reuse a colliding LLM and agent profile name without deciding which new
|
|
692
|
+
engine names make the distinction clear. AKM cannot safely infer that choice.
|
|
693
|
+
|
|
694
|
+
Task files use strict YAML v2. During `migrate apply`, valid 0.8 task files are
|
|
695
|
+
rewritten on disk to v2. The standalone migrator canonicalizes workflow refs,
|
|
696
|
+
moves prompt `profile:` to `engine:`, normalizes permissive scalar forms, maps
|
|
697
|
+
bare-current-AKM `improve --profile` to `--strategy`, and removes the retired
|
|
698
|
+
`--auto-accept` argument. The 0.9 runtime does not read v1 task files:
|
|
699
|
+
|
|
700
|
+
```yaml
|
|
701
|
+
version: 2
|
|
702
|
+
schedule: "@daily"
|
|
703
|
+
prompt: Review the previous day's changes.
|
|
704
|
+
engine: reviewer
|
|
705
|
+
model: claude-sonnet-4-6
|
|
706
|
+
timeoutMs: 600000
|
|
707
|
+
enabled: true
|
|
708
|
+
```
|
|
709
|
+
|
|
710
|
+
Prompt tasks may use `engine`, `model`, `timeoutMs`, and `llm`; command tasks
|
|
711
|
+
may use `timeoutMs`; workflow tasks may use `params`. Unknown and wrong-target
|
|
712
|
+
keys are errors in v2. Unsupported versions are reported by current task
|
|
713
|
+
commands. Migration changes only removed AKM spellings; arbitrary shell
|
|
714
|
+
commands are never rewritten.
|
|
715
|
+
|
|
716
|
+
For 0.8 command tasks, syntax migration and self-invocation routing are separate.
|
|
717
|
+
`--profile` is lowered only for a PATH-selected bare `akm`/`akm.exe`, including
|
|
718
|
+
when it follows supported `env` options and assignments. The scanner recognizes
|
|
719
|
+
citty-valid global forms before `improve`, including `--no-quiet`,
|
|
720
|
+
`--no-verbose`, `--quiet=false`, `--verbose=false`, and value options such as
|
|
721
|
+
`--format json`. An explicit `./akm`, `/opt/vendor/akm`, or other executable path
|
|
722
|
+
is operator-owned: it keeps selecting that exact binary and its command argv is
|
|
723
|
+
retained exactly. In particular, AKM does not change syntax sent to a retained
|
|
724
|
+
0.8 binary. Version-2 commands receive no compatibility rewriting.
|
|
725
|
+
|
|
726
|
+
The published 0.8 core `backup.yml` is a special unsafe definition. It was
|
|
727
|
+
enabled and ran `akm db backups`, but that command only listed snapshots; it did
|
|
728
|
+
not create a recurring backup. The standalone migrator disables the exact bare
|
|
729
|
+
`akm db backups` task while preserving its command for operator review. An
|
|
730
|
+
explicit executable path is operator-owned and is not changed. Replace or remove
|
|
731
|
+
the disabled task; use `akm-migrate backup --for 0.9.0` for an explicit migration
|
|
732
|
+
recovery snapshot. Existing 0.8 data-directory backup folders are left
|
|
733
|
+
untouched.
|
|
734
|
+
|
|
735
|
+
Task `enabled` state controls scheduler-originated execution, not explicit
|
|
736
|
+
operator invocation. `akm task run <id>` intentionally runs a disabled task so
|
|
737
|
+
manual catch-up definitions remain useful. Backend-generated invocations carry
|
|
738
|
+
the internal `--scheduled` marker and record a `disabled` result without running
|
|
739
|
+
the target. Do not use the manual command as a scheduler replacement.
|
|
740
|
+
|
|
741
|
+
Canonical task IDs contain only letters, digits, dots, underscores, and dashes,
|
|
742
|
+
start with a letter or digit, are at most 228 characters, omit `.yml`/`.yaml`,
|
|
743
|
+
and cannot use Windows device aliases such as `CON`, `NUL`, `COM1`, or `LPT1`
|
|
744
|
+
(including aliases followed by a dot). The 228-character limit is the final
|
|
745
|
+
portable bound after scheduler and filename overhead. These portability checks
|
|
746
|
+
apply on every platform. For command-line compatibility only, a trailing
|
|
747
|
+
lowercase `.yml` or legacy `.md` is stripped from an ID; a filename discovered
|
|
748
|
+
under `tasks/` must already be canonical and is never renamed. Sync skips a
|
|
749
|
+
non-portable file and disables any matching installed entry rather than guessing
|
|
750
|
+
a replacement ID.
|
|
751
|
+
|
|
752
|
+
Canonical migration preserves 0.8 `state.db` task-history rows and their log
|
|
753
|
+
paths. One historical detail cannot be recovered: published 0.8.14 stored
|
|
754
|
+
command-task history with `target_kind=prompt`. Because the durable row contains
|
|
755
|
+
no command marker, 0.9 preserves and exposes it as legacy prompt history rather
|
|
756
|
+
than inventing a command classification. New runs use the correct target kind.
|
|
757
|
+
|
|
758
|
+
## 5. Troubleshooting
|
|
759
|
+
|
|
760
|
+
### "Cannot convert state.db out of WAL mode for migration"
|
|
761
|
+
|
|
762
|
+
`akm migrate apply` fails with:
|
|
763
|
+
|
|
764
|
+
> Cannot convert state.db out of WAL mode for migration — another akm process
|
|
765
|
+
> is holding it open. Close other akm processes and re-run `akm migrate apply`.
|
|
766
|
+
|
|
767
|
+
This means a live `akm` process (or a zombie connection from a prior crashed
|
|
768
|
+
one) still has `state.db` open in WAL mode, which blocks the checkpoint apply
|
|
769
|
+
needs to fold `workflow.db` in. Close every other `akm` process (schedulers,
|
|
770
|
+
`akm workflow run`, background `improve` runs) and re-run `akm migrate apply`
|
|
771
|
+
— it resumes from the last completed phase rather than starting over.
|
|
772
|
+
|
|
773
|
+
### Resuming after a crash
|
|
774
|
+
|
|
775
|
+
If `akm migrate apply` is interrupted (killed, host crash, power loss), do not
|
|
776
|
+
manually edit or delete anything under `$DATA`. Run `akm migrate status` to
|
|
777
|
+
read the pending phase, then re-run `akm migrate apply` with the same
|
|
778
|
+
`--config` (or none, if the active config is already the target) — it
|
|
779
|
+
authenticates the retained target and verified backup by fingerprint and
|
|
780
|
+
resumes idempotently from the last durable phase (`prepared`, `state-converting`, `state-collapsing`, `state-applied`,
|
|
781
|
+
`workflow-applied`, `cutover-applied`, `config-applied`, `tasks-prepared`,
|
|
782
|
+
`tasks-applied`, `pilot-prepared`, `pilot-applied`, `rollback-prepared`, or `committed`). A
|
|
783
|
+
malformed or fingerprint-mismatched journal fails closed for operator
|
|
784
|
+
diagnosis instead of guessing.
|
|
785
|
+
|
|
786
|
+
### Restoring or downgrading the cutover
|
|
787
|
+
|
|
788
|
+
Stop scheduled AKM jobs and all running `akm improve`, `akm extract`, and
|
|
789
|
+
workflow engine processes first. Restore refuses while a live process lock or
|
|
790
|
+
workflow lease exists. Then, while still running the 0.9 binary, restore the
|
|
791
|
+
complete pre-cutover snapshot:
|
|
792
|
+
|
|
793
|
+
```sh
|
|
794
|
+
akm-migrate restore --for 0.9.0 --run <run-id> --confirm
|
|
795
|
+
```
|
|
796
|
+
|
|
797
|
+
Restore verifies the selected run before changing live files and then creates a
|
|
798
|
+
second verified rescue run of the current installation. It stages every
|
|
799
|
+
replacement beside its destination, writes a durable restore journal,
|
|
800
|
+
quarantines each database together with its WAL/SHM sidecars, and only then
|
|
801
|
+
publishes clean staged files. The journal records a durable committed phase
|
|
802
|
+
before cleanup: an earlier interruption rolls back, while an interruption after
|
|
803
|
+
commit finishes cleanup without mixing generations. While either recovery phase
|
|
804
|
+
is pending, ordinary config and canonical database access fail closed before
|
|
805
|
+
accepting writes or recreating absent files. The selected and rescue runs remain
|
|
806
|
+
under `$DATA`; if verification reports corruption, preserve them and recover
|
|
807
|
+
from an independent backup.
|
|
808
|
+
|
|
809
|
+
Recovery validates the complete restore journal before removing or renaming any
|
|
810
|
+
path: journal format and migration version, phase, exact artifact and SQLite
|
|
811
|
+
sidecar set, operation-bound stage/quarantine names, path uniqueness, source
|
|
812
|
+
backup, and the expected prepared/committed filesystem state. A malformed or
|
|
813
|
+
stale journal remains in place and recovery fails closed for operator diagnosis.
|
|
814
|
+
Committed recovery additionally authenticates each published artifact against
|
|
815
|
+
the selected backup's byte size and streaming SHA-256, then reruns config-state
|
|
816
|
+
validation or SQLite `quick_check` and ledger validation before deleting any
|
|
817
|
+
quarantine or journal.
|
|
818
|
+
|
|
819
|
+
Prepared rollback is itself crash-idempotent. The journal fingerprints the
|
|
820
|
+
original config/database/sidecar generation before quarantine. If recovery dies
|
|
821
|
+
after restoring a quarantine or deleting a stage but before journal deletion,
|
|
822
|
+
the next recovery authenticates the already-restored destination and continues
|
|
823
|
+
cleanup. A same-ledger but byte-different substitution fails closed.
|
|
824
|
+
|
|
825
|
+
Migration config files, manifests, and apply/restore journals are read through
|
|
826
|
+
bounded readers (1 MiB each). Oversized local control files fail closed rather
|
|
827
|
+
than being loaded wholesale. Apply also measures the complete serialized journal
|
|
828
|
+
before its first write; a near-limit config whose expanded target would exceed
|
|
829
|
+
the same cap is rejected before any apply journal or artifact mutation.
|
|
830
|
+
|
|
831
|
+
Only after restore succeeds should you install the older AKM binary. A 0.8
|
|
832
|
+
binary must not run against a 0.9 config or against `state.db` migration 017 /
|
|
833
|
+
`workflow.db` migration 010. If no valid pre-cutover bundle exists, do not
|
|
834
|
+
downgrade in place: preserve the current config and databases, create a separate
|
|
835
|
+
0.8 data/config root, and manually reconstruct the profile-based configuration.
|
|
836
|
+
|
|
837
|
+
### Where backups live
|
|
838
|
+
|
|
839
|
+
Recovery runs are stored under
|
|
840
|
+
`$DATA/backups/migrations/<installation-id>/<run-id>/`. They record present and
|
|
841
|
+
absent `config.json`, `state.db`, and `workflow.db` artifacts, ordered
|
|
842
|
+
migration ledgers, sizes, and streaming SHA-256 hashes. `akm-migrate backup
|
|
843
|
+
--for 0.9.0` creates an additional unique run when an operator wants a manual
|
|
844
|
+
snapshot outside of `apply`'s automatic one.
|