akm-cli 0.9.30 → 0.10.26101001-alpha
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 +282 -0
- package/README.md +10 -10
- package/ROADMAP.md +112 -0
- package/STABILITY.md +79 -53
- package/dist/api-node.mjs +20 -0
- package/dist/api.d.ts +23 -0
- package/dist/api.js +45 -0
- package/dist/assets/hints/cli-hints-full.md +13 -27
- package/dist/assets/hints/cli-hints-short.md +1 -1
- package/dist/assets/improve-strategies/default.json +3 -3
- package/dist/assets/prompts/consolidate-pair.md +9 -7
- package/dist/cli/shared.js +31 -48
- package/dist/cli/unknown-flags.js +6 -43
- package/dist/cli.js +8 -34
- package/dist/commands/agent/contribute-cli.js +1 -1
- package/dist/commands/completions.js +1 -2
- package/dist/commands/config-cli.js +5 -28
- package/dist/commands/env/env-cli.js +5 -5
- package/dist/commands/env/secret-cli.js +2 -2
- package/dist/commands/health/checks.js +41 -16
- package/dist/commands/health/plugin-staleness.js +52 -22
- package/dist/commands/improve/autonomy-gate.js +5 -3
- package/dist/commands/improve/consolidate/pair-pass.js +7 -1
- package/dist/commands/improve/consolidate.js +6 -35
- package/dist/commands/improve/distill/lesson-update.js +91 -0
- package/dist/commands/improve/distill-guards.js +1 -43
- package/dist/commands/improve/distill.js +140 -20
- package/dist/commands/improve/extract-cli.js +1 -1
- package/dist/commands/improve/improve-cli.js +120 -114
- package/dist/commands/improve/improve-strategies.js +8 -12
- package/dist/commands/improve/loop-stages.js +0 -1
- package/dist/commands/improve/planner.js +0 -1
- package/dist/commands/improve/preparation.js +40 -99
- package/dist/commands/improve/proactive-maintenance.js +2 -2
- package/dist/commands/improve/reflect-noise.js +3 -55
- package/dist/commands/improve/reflect.js +3 -8
- package/dist/commands/improve/retrieval-scope.js +2 -2
- package/dist/commands/improve/salience.js +2 -9
- package/dist/commands/improve/stage.js +14 -9
- package/dist/commands/lint/index.js +5 -20
- package/dist/commands/observability-cli.js +3 -9
- package/dist/commands/proposal/drain.js +39 -6
- package/dist/commands/proposal/proposal-cli.js +10 -30
- package/dist/commands/proposal/repository.js +3 -3
- package/dist/commands/read/knowledge.js +3 -3
- package/dist/commands/read/remember-cli.js +0 -13
- package/dist/commands/read/search-cli.js +29 -97
- package/dist/commands/read/search.js +0 -11
- package/dist/commands/read/show.js +0 -19
- package/dist/commands/sources/plugin-upgrade.js +164 -101
- package/dist/commands/sources/sources-cli.js +1 -15
- package/dist/commands/sources/stash-cli.js +4 -12
- package/dist/commands/tasks/tasks-cli.js +4 -115
- package/dist/commands/workflow/plan.js +11 -33
- package/dist/commands/workflow-cli.js +2 -7
- package/dist/core/adapter/adapter-ids.js +1 -2
- package/dist/core/adapter/adapters/agent-skills-adapter.js +0 -4
- package/dist/core/adapter/adapters/akm-adapter.js +9 -48
- package/dist/core/adapter/adapters/akm-lint.js +10 -26
- package/dist/core/adapter/adapters/akm-metadata.js +2 -72
- package/dist/core/adapter/adapters/akm-task-adapter.js +0 -5
- package/dist/core/adapter/adapters/akm-workflow-adapter.js +9 -28
- package/dist/core/adapter/adapters/dotenv-adapter.js +1 -20
- package/dist/core/adapter/adapters/generic-files-adapter.js +0 -10
- package/dist/core/adapter/adapters/llm-wiki-adapter.js +0 -4
- package/dist/core/adapter/adapters/tool-dir-shared.js +0 -24
- package/dist/core/adapter/adapters/website-snapshot-adapter.js +4 -4
- package/dist/core/adapter/recognize-match.js +3 -4
- package/dist/core/common.js +18 -2
- package/dist/core/config/config-schema.js +12 -15
- package/dist/core/config/config-types.js +6 -15
- package/dist/core/config/config-walker.js +6 -23
- package/dist/core/config/config.js +17 -80
- package/dist/core/config/engine-semantics.js +7 -3
- package/dist/core/config/schema/engines.js +7 -7
- package/dist/core/config/schema/improve-processes.js +8 -61
- package/dist/core/config/schema/improve.js +2 -21
- package/dist/core/config/schema/index-config.js +6 -39
- package/dist/core/env-secret-ref.js +2 -45
- package/dist/core/errors.js +1 -2
- package/dist/core/extra-params.js +2 -86
- package/dist/core/file-lock.js +10 -1
- package/dist/core/improve-result.js +11 -1
- package/dist/core/mutation-target.js +2 -2
- package/dist/core/recognition-util.js +4 -5
- package/dist/core/warn.js +21 -4
- package/dist/core/write-source.js +3 -3
- package/dist/execution/target-ref.js +1 -2
- package/dist/indexer/search/db-search.js +4 -19
- package/dist/indexer/search/fts-query.js +0 -19
- package/dist/integrations/agent/engine-resolution.js +5 -2
- package/dist/integrations/agent/index.js +1 -1
- package/dist/integrations/agent/profiles.js +41 -98
- package/dist/integrations/agent/request-lowering.js +3 -3
- package/dist/integrations/harnesses/aider/index.js +5 -0
- package/dist/integrations/harnesses/amazonq/index.js +1 -0
- package/dist/integrations/harnesses/claude/config-import.js +2 -3
- package/dist/integrations/harnesses/claude/index.js +5 -0
- package/dist/integrations/harnesses/codex/index.js +1 -0
- package/dist/integrations/harnesses/copilot/index.js +1 -0
- package/dist/integrations/harnesses/gemini/index.js +1 -0
- package/dist/integrations/harnesses/index.js +18 -39
- package/dist/integrations/harnesses/opencode/agent-builder.js +60 -35
- package/dist/integrations/harnesses/opencode/config-import.js +121 -52
- package/dist/integrations/harnesses/opencode/index.js +22 -0
- package/dist/integrations/harnesses/opencode/plugin-layout.js +68 -0
- package/dist/integrations/harnesses/opencode/session-log-types.js +12 -0
- package/dist/integrations/harnesses/opencode/session-log-v1.js +72 -0
- package/dist/integrations/harnesses/opencode/session-log-v2.js +140 -0
- package/dist/integrations/harnesses/opencode/session-log.js +104 -115
- package/dist/integrations/harnesses/opencode/version.js +98 -0
- package/dist/integrations/harnesses/opencode-sdk/{harness.js → index.js} +5 -17
- package/dist/integrations/harnesses/opencode-sdk/sdk-runner.js +105 -206
- package/dist/integrations/harnesses/opencode-sdk/v1-adapter.js +199 -0
- package/dist/integrations/harnesses/opencode-sdk/v2-adapter.js +228 -0
- package/dist/integrations/harnesses/opencode-sdk/wire.js +66 -0
- package/dist/integrations/harnesses/openhands/index.js +1 -0
- package/dist/integrations/harnesses/pi/index.js +1 -0
- package/dist/integrations/harnesses/shared.js +2 -0
- package/dist/integrations/harnesses/types.js +2 -0
- package/dist/llm/client.js +74 -14
- package/dist/output/cli-hints.js +1 -1
- package/dist/output/context.js +10 -19
- package/dist/output/format-exempt.js +5 -8
- package/dist/output/shapes/helpers.js +1 -22
- package/dist/output/shapes/passthrough.js +0 -1
- package/dist/output/shapes.js +3 -31
- package/dist/output/stdout.js +5 -1
- package/dist/output/text/command-format.js +6 -1
- package/dist/output/text/workflow-format.js +4 -22
- package/dist/scripts/akm-migrate-node.js +15746 -16706
- package/dist/scripts/akm-migrate.js +16319 -17275
- package/dist/setup/detect.js +10 -4
- package/dist/setup/harness-config-import.js +5 -14
- package/dist/setup/setup.js +1 -1
- package/dist/setup/steps/tasks.js +12 -13
- package/dist/storage/repositories/task-history-repository.js +0 -5
- package/dist/storage/repositories/workflow-runs-repository.js +5 -15
- package/dist/tasks/embedded.js +2 -1
- package/dist/tasks/run/task-history.js +0 -2
- package/dist/tasks/schedule-gates.js +39 -0
- package/dist/tasks/scheduler-binding.js +0 -16
- package/dist/tasks/scheduler-sync.js +3 -97
- package/dist/tasks/source/bounded-document.js +1 -1
- package/dist/tasks/source/task-source-v4.js +2 -12
- package/dist/tasks/task-run-reserved-flags.js +2 -31
- package/dist/workflows/authoring/authoring.js +6 -6
- package/dist/workflows/compile.js +8 -65
- package/dist/workflows/exec/child-workflow.js +22 -3
- package/dist/workflows/exec/native-executor.js +12 -147
- package/dist/workflows/exec/run-workflow.js +31 -103
- package/dist/workflows/exec/step-work.js +9 -178
- package/dist/workflows/exec/unit-dispatch.js +0 -10
- package/dist/workflows/freeze/environment.js +3 -44
- package/dist/workflows/freeze/freeze.js +8 -41
- package/dist/workflows/freeze/targets/child-workflow.js +27 -63
- package/dist/workflows/freeze/targets/command.js +2 -16
- package/dist/workflows/freeze/targets/shell.js +0 -2
- package/dist/workflows/freeze/task-bindings.js +2 -28
- package/dist/workflows/ir/params.js +12 -2
- package/dist/workflows/parser.js +82 -232
- package/dist/workflows/plan.js +1 -1
- package/dist/workflows/renderer.js +10 -19
- package/dist/workflows/runtime/run-plan.js +11 -53
- package/dist/workflows/runtime/runs.js +4 -27
- package/dist/workflows/source-files.js +12 -16
- package/dist/workflows/source-semantics.js +1 -93
- package/docs/README.md +43 -42
- package/docs/agents/README.md +15 -0
- package/docs/agents/agent-install.md +14 -0
- package/docs/architecture/README.md +67 -0
- package/docs/architecture/adapters.md +258 -0
- package/docs/architecture/akm-architecture-decision-history.md +2055 -0
- package/docs/architecture/akm-core-principles.md +126 -0
- package/docs/architecture/architecture.md +578 -0
- package/docs/architecture/comparisons/claude-code-vs-akm-workflows-full.md +550 -0
- package/docs/architecture/decisions/0001-no-interpolation-attached-structured-context.md +72 -0
- package/docs/architecture/decisions/0002-unit-reuse-and-input-hash-scope.md +142 -0
- package/docs/architecture/decisions/0003-child-env-allowlist-and-provenance.md +189 -0
- package/docs/architecture/decisions/0004-task-input-contract-and-flag-coercion.md +97 -0
- package/docs/architecture/decisions/0005-task-result-vocabulary-and-legacy-read-mapping.md +108 -0
- package/docs/architecture/decisions/0006-task-source-version-routing.md +124 -0
- package/docs/architecture/decisions/0007-workflow-composition-bounds.md +83 -0
- package/docs/architecture/decisions/0008-task-binding-normalization.md +88 -0
- package/docs/architecture/decisions/0009-child-run-publication-column-parity.md +80 -0
- package/docs/architecture/decisions/0010-driver-protocol-cut.md +36 -0
- package/docs/architecture/decisions/0011-engine-run-loop-invariants.md +125 -0
- package/docs/architecture/decisions/README.md +62 -0
- package/docs/architecture/improvement.md +471 -0
- package/docs/architecture/internals/classification.md +154 -0
- package/docs/architecture/internals/fresh-host-rebuild-runbook.md +40 -0
- package/docs/architecture/internals/functional-contract-patterns.md +340 -0
- package/docs/architecture/internals/health-advisories.md +110 -0
- package/docs/architecture/internals/improve-workflow.md +720 -0
- package/docs/architecture/internals/indexing.md +498 -0
- package/docs/architecture/internals/registry-network-boundary.md +57 -0
- package/docs/architecture/internals/search.md +248 -0
- package/docs/architecture/internals/storage-locations.md +943 -0
- package/docs/architecture/persisted-data-compat.md +68 -0
- package/docs/architecture/reviews/env-secret-access.md +319 -0
- package/docs/architecture/runtime-boundary-design.md +153 -0
- package/docs/architecture/specs/0.9.0-close-out-plan.md +361 -0
- package/docs/architecture/specs/0.9.0-decisions.md +532 -0
- package/docs/architecture/specs/0.9.0-docs-code-drift-register.md +745 -0
- package/docs/architecture/specs/0.9.0-open-items-register.md +135 -0
- package/docs/architecture/specs/0.9.0-public-api-issue-backlog.md +740 -0
- package/docs/architecture/specs/0.9.0-release-surface-review.md +636 -0
- package/docs/architecture/specs/agent-command-engine-model-design.md +513 -0
- package/docs/architecture/specs/akm-0.9.0-bundle-adapter-spec.md +501 -0
- package/docs/architecture/specs/akm-0.9.0-ref-grammar-decision.md +291 -0
- package/docs/architecture/specs/akm-format-neutral-bundle-workspace-spec.md +2059 -0
- package/docs/architecture/specs/di-seams-plan.md +539 -0
- package/docs/architecture/specs/driver-protocol-keep-or-cut.md +275 -0
- package/docs/architecture/specs/fact-asset-type.md +142 -0
- package/docs/architecture/specs/improve-collapse-churn-detector-design.md +634 -0
- package/docs/architecture/specs/okf-support.md +148 -0
- package/docs/architecture/specs/ref.md +329 -0
- package/docs/architecture/specs/reviews/task-workflow-unification/README.md +72 -0
- package/docs/architecture/specs/reviews/task-workflow-unification/findings-consolidated.md +152 -0
- package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-alternatives.md +352 -0
- package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-bunqueue.md +300 -0
- package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-openworkflow.md +402 -0
- package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-1.md +758 -0
- package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-2.md +645 -0
- package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-3.md +602 -0
- package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-adversarial.md +27 -0
- package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-architecture.md +27 -0
- package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-coverage.md +74 -0
- package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-security.md +15 -0
- package/docs/architecture/specs/reviews/task-workflow-unification/panel-r2-adversarial.md +132 -0
- package/docs/architecture/specs/reviews/task-workflow-unification/panel-r2-verification.md +147 -0
- package/docs/architecture/specs/stash-conventions-code-spec.md +275 -0
- package/docs/architecture/specs/stash-organization-conventions.md +377 -0
- package/docs/architecture/specs/task-workflow-format-unification.md +721 -0
- package/docs/architecture/specs/workflow-engine-buy-vs-build.md +231 -0
- package/docs/architecture/specs/workflow-format-unification.md +432 -0
- package/docs/architecture/testing/manual-testing-checklist.md +3411 -0
- package/docs/architecture/testing/okf-v0.2-conformance-runbook.md +924 -0
- package/docs/architecture/testing/task-workflow-manual-tests.md +1720 -0
- package/docs/architecture/testing/testing-workflow.md +446 -0
- package/docs/architecture/workflow-engine.md +223 -0
- package/docs/guides/README.md +33 -0
- package/docs/guides/author-bundles.md +310 -0
- package/docs/guides/author-workflows.md +490 -0
- package/docs/guides/bundles.md +321 -0
- package/docs/guides/capture-knowledge.md +136 -0
- package/docs/guides/claude-code-vs-akm-workflows.md +29 -0
- package/docs/guides/concepts.md +93 -0
- package/docs/guides/discover-and-load.md +158 -0
- package/docs/guides/getting-started.md +240 -0
- package/docs/guides/improve-the-library.md +246 -0
- package/docs/guides/knowledge-management.md +18 -0
- package/docs/guides/recipes/headless-install.md +97 -0
- package/docs/guides/recipes/website-source.md +28 -0
- package/docs/guides/run-workflows.md +279 -0
- package/docs/guides/scheduling.md +123 -0
- package/docs/guides/use-with-any-agent.md +174 -0
- package/docs/guides/wikis.md +81 -0
- package/docs/integration/bundling-akm.md +7 -6
- package/docs/maintainers/README.md +19 -0
- package/docs/maintainers/curate-workmap.md +335 -0
- package/docs/maintainers/eval.md +3 -0
- package/docs/maintainers/local-development.md +108 -0
- package/docs/maintainers/release-checklist.md +132 -0
- package/docs/migration/README.md +2 -2
- package/docs/migration/release-notes/0.0.13.md +1 -1
- package/docs/migration/release-notes/0.1.0.md +1 -1
- package/docs/migration/release-notes/0.2.0.md +1 -1
- package/docs/migration/release-notes/0.3.0.md +1 -1
- package/docs/migration/release-notes/0.5.0.md +1 -1
- 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.7.3.md +2 -2
- package/docs/migration/release-notes/0.7.4.md +1 -1
- package/docs/migration/release-notes/0.7.5.md +1 -1
- package/docs/migration/release-notes/0.8.0.md +1 -1
- package/docs/migration/release-notes/0.9.0.md +1 -1
- package/docs/migration/release-notes/0.9.14.md +1 -1
- package/docs/migration/release-notes/0.9.15.md +1 -1
- package/docs/migration/release-notes/0.9.16.md +1 -1
- package/docs/migration/release-notes/0.9.17.md +1 -1
- package/docs/migration/release-notes/0.9.19.md +1 -1
- package/docs/migration/release-notes/0.9.2.md +1 -1
- package/docs/migration/release-notes/README.md +27 -31
- package/docs/migration/v0.5-to-v0.6.md +759 -0
- package/docs/migration/v0.8-to-v0.9.md +1 -1
- package/docs/plans/0.9.2-agent-command-workflow-plan.md +423 -0
- package/docs/posts/README.md +30 -0
- package/docs/posts/akm-command-tour.md +495 -0
- package/docs/posts/akm-logo-sized.webp +0 -0
- package/docs/posts/belief-aware-memory-12.md +139 -0
- package/docs/posts/config-v2-lessons-16.md +191 -0
- package/docs/posts/improve-loop-autonomous-10.md +225 -0
- package/docs/posts/improve-pipeline-debugging-0803.md +179 -0
- package/docs/posts/intro-part-01.md +76 -0
- package/docs/posts/intro-part-02.md +221 -0
- package/docs/posts/intro-part-03.md +190 -0
- package/docs/posts/intro-part-04.md +221 -0
- package/docs/posts/llm-mode-reflect-13.md +166 -0
- package/docs/posts/openpalm-built-on-akm.md +86 -0
- package/docs/posts/progressive-disclosure-06.md +129 -0
- package/docs/posts/proposal-safety-net-15.md +112 -0
- package/docs/posts/release-0.5.0.md +247 -0
- package/docs/posts/release-0.6.0.md +117 -0
- package/docs/posts/release-0.7.0.md +159 -0
- package/docs/posts/release-0.8.0.md +332 -0
- package/docs/posts/scattered-skills-05.md +100 -0
- package/docs/posts/task-assets-persistent-workflows-11.md +222 -0
- package/docs/posts/team-skills-07.md +198 -0
- package/docs/posts/wiki-agent-knowledge-08.md +223 -0
- package/docs/posts/workflows-vaults-09.md +321 -0
- package/docs/product-surface.md +54 -0
- package/docs/reference/README.md +2 -2
- package/docs/reference/api.md +65 -0
- package/docs/reference/asset-types.md +166 -0
- package/docs/reference/bundle-types.md +2 -4
- package/docs/reference/cli.md +129 -175
- package/docs/reference/configuration.md +84 -19
- package/docs/reference/data-and-telemetry.md +1 -1
- package/docs/reference/env-and-secrets.md +126 -0
- package/docs/reference/memory.md +124 -0
- package/docs/reference/refs.md +156 -0
- package/docs/reference/registry.md +489 -0
- package/docs/reference/supported-formats.md +3 -4
- package/docs/reference/tasks.md +12 -19
- package/docs/reference/website-sources.md +141 -0
- package/docs/reference/workflow-schema.md +89 -317
- package/docs/reference/workflows.md +20 -48
- package/package.json +23 -16
- package/schemas/akm-config.json +2 -243
- package/schemas/akm-task.json +2 -3
- package/schemas/akm-workflow.json +47 -84
- package/dist/assets/improve-strategies/catchup.json +0 -41
- package/dist/assets/improve-strategies/proactive-maintenance.json +0 -24
- package/dist/assets/improve-strategies/quick.json +0 -17
- package/dist/assets/improve-strategies/reflect-distill.json +0 -29
- package/dist/assets/improve-strategies/thorough.json +0 -49
- package/dist/assets/tasks/improve/akm-improve-catchup.yml +0 -6
- package/dist/assets/tasks/improve/akm-improve-frequent.yml +0 -4
- package/dist/assets/tasks/improve/akm-improve-nightly.yml +0 -4
- package/dist/cli/retired-commands.js +0 -118
- package/dist/commands/tasks/validate.js +0 -176
- package/dist/core/config/legacy-source-shape-shim.js +0 -117
- package/dist/integrations/harnesses/ids.js +0 -28
- package/dist/tasks/source/task-source-v3-frozen.js +0 -424
- package/dist/tasks/source/task-to-v4.js +0 -863
- package/dist/workflows/exec/worktree.js +0 -372
- package/dist/workflows/freeze/child-output-references.js +0 -83
- package/dist/workflows/freeze/identity.js +0 -22
- package/dist/workflows/freeze/targets/script.js +0 -50
- package/dist/workflows/freeze/targets/task.js +0 -124
- package/dist/workflows/github-yaml.js +0 -506
- package/dist/workflows/runtime/run-outputs.js +0 -80
|
@@ -95,6 +95,23 @@ kebab-case, at most 63 characters, and cannot start with `akm-`.
|
|
|
95
95
|
| `llm` | `endpoint`, `model` | OpenAI-compatible chat completions |
|
|
96
96
|
| `agent` | `platform` | A registered dispatch-capable harness |
|
|
97
97
|
|
|
98
|
+
The registered harnesses (generated from the harness registry; do not edit):
|
|
99
|
+
|
|
100
|
+
<!-- harness-table:start (generated by scripts/gen-config-schema.ts) -->
|
|
101
|
+
| `platform` | Harness | Binary | Session logs | Model work | Native `agent` |
|
|
102
|
+
| --- | --- | --- | --- | --- | --- |
|
|
103
|
+
| `opencode` | OpenCode | `opencode` | yes | yes | yes |
|
|
104
|
+
| `claude` | Claude Code | `claude` | yes | yes | yes |
|
|
105
|
+
| `opencode-sdk` | OpenCode SDK | in-process | no | yes | yes |
|
|
106
|
+
| `codex` | OpenAI Codex CLI | `codex` | yes | no | no |
|
|
107
|
+
| `copilot` | GitHub Copilot CLI | `copilot` | no | no | no |
|
|
108
|
+
| `pi` | Pi | `pi` | no | no | no |
|
|
109
|
+
| `gemini` | Gemini CLI | `gemini` | no | no | no |
|
|
110
|
+
| `aider` | Aider | `aider` | no | no | no |
|
|
111
|
+
| `amazonq` | Amazon Q Developer CLI | `q` | no | no | no |
|
|
112
|
+
| `openhands` | OpenHands | `openhands` | no | no | no |
|
|
113
|
+
<!-- harness-table:end -->
|
|
114
|
+
|
|
98
115
|
LLM endpoints must be complete `http://` or `https://` chat-completions URLs
|
|
99
116
|
ending in `/chat/completions`, without userinfo, query, or fragment. API keys
|
|
100
117
|
are symbolic only: `$VAR` or `${VAR}`. AKM resolves them only at dispatch.
|
|
@@ -141,6 +158,16 @@ the LLM engine used as that SDK engine's fallback connection. With no
|
|
|
141
158
|
provider, model and auth from its own configuration. `defaults.llmEngine` is
|
|
142
159
|
not a substitute.
|
|
143
160
|
|
|
161
|
+
An `opencode` or `opencode-sdk` engine has no setting for the OpenCode major: akm
|
|
162
|
+
detects it. With no `bin`, the engine runs the most recent OpenCode on `PATH`
|
|
163
|
+
(`opencode2`, OpenCode 2's own alias, when present, else `opencode`); with a
|
|
164
|
+
`bin`, it runs that binary. akm runs `<bin> --version` once per binary per
|
|
165
|
+
process and uses the OpenCode 2 or OpenCode 1 adapters to match. OpenCode 1 keeps
|
|
166
|
+
working and logs a warning recommending OpenCode 2. A `--version` akm cannot read
|
|
167
|
+
(or a major it does not know) uses the OpenCode 2 adapters and logs a warning
|
|
168
|
+
with the raw output. To run a particular OpenCode, set the engine's `bin`, e.g.
|
|
169
|
+
`{"kind":"agent","platform":"opencode-sdk","bin":"/opt/opencode1/bin/opencode"}`.
|
|
170
|
+
|
|
144
171
|
On an engine without `timeoutMs`, model work (an improve process, a quality or
|
|
145
172
|
triage judge, or an index pass) stops after 600 seconds, whatever the engine's
|
|
146
173
|
kind; other work on an agent engine runs until it finishes. An improve stage's
|
|
@@ -209,7 +236,7 @@ cannot enforce:
|
|
|
209
236
|
| LLM | No tools. |
|
|
210
237
|
| `claude` | Read and Edit inside the working directory, and Bash for `akm search` and `akm show` only. akm runs it with `--restricted`, so your user, project and local settings cannot widen that. |
|
|
211
238
|
| `opencode`, `opencode-sdk` | Read, grep and glob in the working directory and the stash, edit in the working directory only, and `akm_search` and `akm_show`, through an injected `akm-model-work` agent. No bash, because opencode cannot stop a redirect such as `akm show x > file` from writing elsewhere. |
|
|
212
|
-
|
|
|
239
|
+
| Every other `agent` harness | Cannot run model work: akm refuses the request before it starts. |
|
|
213
240
|
|
|
214
241
|
**The one rule.** Every key model work reads its engine from must name an
|
|
215
242
|
LLM engine or a `claude`, `opencode` or `opencode-sdk` agent engine. Those
|
|
@@ -235,7 +262,9 @@ key, the engine and its platform. Other engine keys, `defaults.engine` and
|
|
|
235
262
|
- opencode model work may read the stash and write only its working directory.
|
|
236
263
|
`akm_search` and `akm_show` come from the akm-opencode plugin (0.9.21 or
|
|
237
264
|
later), which akm does not load: put it in your opencode config
|
|
238
|
-
(`"plugin": ["akm-opencode"]`
|
|
265
|
+
(`"plugin": ["akm-opencode"]` for OpenCode 1; for OpenCode 2 install
|
|
266
|
+
`akm-opencode-v2` with `opencode plugin add akm-opencode-v2`, see
|
|
267
|
+
[Use AKM With Any Agent](https://github.com/itlackey/akm/blob/main/docs/guides/use-with-any-agent.md#opencode-plugins-one-package-per-opencode-major)). akm turns off the plugin's curation, learning
|
|
239
268
|
and write gate for these dispatches and keeps its state in akm's state
|
|
240
269
|
directory. The stash is protected from edits only while the temporary
|
|
241
270
|
directory is outside a git repository.
|
|
@@ -442,11 +471,21 @@ can select `engine`, `model`, `timeoutMs`, and LLM request overrides:
|
|
|
442
471
|
|
|
443
472
|
An improve process's engine follows
|
|
444
473
|
[the one rule](#engines-for-unattended-model-work); an explicit invalid or
|
|
445
|
-
incompatible engine never falls back to another engine.
|
|
446
|
-
are
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
474
|
+
incompatible engine never falls back to another engine. The built-in strategies
|
|
475
|
+
are `default` and `consolidate`. `consolidate` is a patch that
|
|
476
|
+
is deep-merged onto `default`, and a user-defined strategy of the same name is
|
|
477
|
+
merged on top of that; so every strategy, built-in or user-defined, inherits
|
|
478
|
+
omitted fields from `default`. `quick`, `reflect-distill`, `thorough`,
|
|
479
|
+
`catchup` were removed in 0.10 (#1130): measured, none beat `default` (`thorough`
|
|
480
|
+
and `catchup` added only a judged triage drain, and `catchup` was identical to
|
|
481
|
+
`consolidate`). `proactive-maintenance` was removed too (#1129): its lane now
|
|
482
|
+
lives in `default`. A `improve.strategies.<name>` block with one of those names is
|
|
483
|
+
now an ordinary user-defined strategy that inherits `default`, so it no longer
|
|
484
|
+
carries the old built-in's settings; `--strategy` or `defaults.improveStrategy`
|
|
485
|
+
naming one with no such block fails with an error that names `default`. To keep
|
|
486
|
+
the old judged drain, set `processes.triage` (`enabled`, `applyMode: "promote"`,
|
|
487
|
+
`judgment: true`) in your own strategy. The built-in strategies other than
|
|
488
|
+
`default` and `consolidate` are Experimental (see [STABILITY.md](../../STABILITY.md)).
|
|
450
489
|
|
|
451
490
|
`processes.triage.judgment` explicitly controls the optional judgment tier.
|
|
452
491
|
Use `true` to enable it, `false` to disable it, or an object with `enabled`,
|
|
@@ -457,6 +496,22 @@ the retired `mode` and `profile` keys continue to report their engine migration
|
|
|
457
496
|
guidance. When enabled, engine selection is judgment → triage → strategy →
|
|
458
497
|
`defaults.llmEngine`, and resolution fails closed if none is available.
|
|
459
498
|
|
|
499
|
+
The `default` strategy runs triage in `promote` mode with judgment off and
|
|
500
|
+
`maxAcceptsPerRun: 25` (#1143), so the proposal backlog drains through the
|
|
501
|
+
deterministic gates without `experimental.improveAutonomy`. Turning judgment on
|
|
502
|
+
in a promote strategy is what that opt-in gates.
|
|
503
|
+
|
|
504
|
+
Judgment is off in every built-in strategy, and the judgment tier may accept
|
|
505
|
+
only a consolidate promotion. Retirements, exact fixes and reflect revisions it
|
|
506
|
+
would accept are left for a person. This is measured, not cautious by habit
|
|
507
|
+
(#1132, #1094): with `experimental.improveAutonomy` and judgment over every
|
|
508
|
+
proposal kind, the nightly eval solved 0.49 (gpt-5.6-terra) and 0.53
|
|
509
|
+
(qwen3.8-27b) of its items while harming 14 and 11, and changed 18 and 21 notes
|
|
510
|
+
outside the planted set; the judge accepted unsafe retirements and applied exact
|
|
511
|
+
fixes unreviewed. Judging promotions alone was reasonable: on qwen3.8-27b it
|
|
512
|
+
had precision 0.87 and recall 0.78 and accepted 4.8% of bad promotions; on
|
|
513
|
+
gpt-5.6-terra it was very cautious (precision 1.0, recall 0.17).
|
|
514
|
+
|
|
460
515
|
```jsonc
|
|
461
516
|
{
|
|
462
517
|
"improve": {
|
|
@@ -557,10 +612,16 @@ off too. Every entry must be a non-empty string, or the config does not load.
|
|
|
557
612
|
```
|
|
558
613
|
|
|
559
614
|
No shipped strategy turns improve-stage session extraction on.
|
|
560
|
-
`proactiveMaintenance` is on
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
615
|
+
`proactiveMaintenance` is on in `default` (and in the strategies that inherit
|
|
616
|
+
from it), and off in `quick`, `consolidate`, `catchup` and
|
|
617
|
+
`reflect-distill`. It plans stable assets that have had no feedback: at most
|
|
618
|
+
`maxPerRun` (default 15) per run, only assets not reflected or distilled for
|
|
619
|
+
`dueDays` (default 30), so each comes up at most once a month, and reflect's
|
|
620
|
+
`limit` (25) still bounds the run. A preset that omits either process
|
|
621
|
+
inherits the `default` value; set `processes.proactiveMaintenance.enabled: false` in the
|
|
622
|
+
selected strategy to turn the lane off. A proposal from this lane is never
|
|
623
|
+
accepted by `proposal drain`: it waits for a person (reason
|
|
624
|
+
`proactive-needs-review`, #1147). User strategy overrides
|
|
564
625
|
are applied last, so an explicit `enabled: true` still opts the selected
|
|
565
626
|
strategy in.
|
|
566
627
|
|
|
@@ -789,8 +850,7 @@ explicit destination flag is given and the command isn't already scoped to a
|
|
|
789
850
|
specific source. It must name a configured bundle; setting it with no
|
|
790
851
|
`bundles` configured, or naming an unconfigured bundle, is rejected at
|
|
791
852
|
`config set` (or config load) time. The full write-target resolution order
|
|
792
|
-
is the command's destination flag (`--bundle`
|
|
793
|
-
`improve`, `--target` on `env`/`secret create`) -> `defaultWriteTarget` ->
|
|
853
|
+
is the command's destination flag (`--bundle`) -> `defaultWriteTarget` ->
|
|
794
854
|
working bundle (`defaultBundle`) -> `ConfigError`.
|
|
795
855
|
|
|
796
856
|
### Memory scope
|
|
@@ -857,7 +917,8 @@ section, an absent key, and an explicit `false` all read identically as off.
|
|
|
857
917
|
```
|
|
858
918
|
|
|
859
919
|
- **`experimental.improveAutonomy`** — gates only the autonomous
|
|
860
|
-
`memoryInference`, `triagePromote
|
|
920
|
+
`memoryInference`, `triagePromote` (a promote with triage judgment on; a
|
|
921
|
+
deterministic-only promote runs without it), and `memoryCleanup` lanes. `akm improve`
|
|
861
922
|
itself always runs; this only gates mutations without a human in the loop.
|
|
862
923
|
Consolidation is not gated: it remains advisory and emits reviewable
|
|
863
924
|
proposals. `sync.push` is deliberately **not** gated by this key.
|
|
@@ -1034,11 +1095,15 @@ network filesystem for the data directory and falls back to `DELETE`.
|
|
|
1034
1095
|
|
|
1035
1096
|
## Retired Configuration
|
|
1036
1097
|
|
|
1037
|
-
`profiles`, `llm`, `agent`, `features`, `stashes
|
|
1038
|
-
`
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1098
|
+
`profiles`, `llm`, `agent`, `features`, and `stashes` are rejected in 0.9.
|
|
1099
|
+
Recreate the configuration using `engines`, `defaults.engine`,
|
|
1100
|
+
`defaults.llmEngine`, and `improve.strategies`; AKM deliberately does not infer
|
|
1101
|
+
or rename ambiguous profile identities. `defaults.llm`, `defaults.agent`,
|
|
1102
|
+
`defaults.improve`, `index.stalenessDetection`, the engine settings that used to
|
|
1103
|
+
sit under `index.<pass>` (`endpoint`, `provider`, `apiKey`, `baseUrl`,
|
|
1104
|
+
`temperature`, `maxTokens`, `capabilities`) and the `feedbackDistillation`
|
|
1105
|
+
process (use `processes.distill.enabled`) load like any other unknown key: named
|
|
1106
|
+
once by the unknown-key warning, ignored, and dropped by `akm migrate apply`.
|
|
1042
1107
|
|
|
1043
1108
|
`embedding.chunkSize` was never read by anything under `src/` (#954), so a
|
|
1044
1109
|
config that still sets it is simply ignored — it still loads, unvalidated
|
|
@@ -189,7 +189,7 @@ the set of types the code actually emits at HEAD (verified against every
|
|
|
189
189
|
| `improve_invoked` | Start of an `akm improve` run | `ref` (scope); `strategy`, `scope`, `dryRun`, `eligibleCount` |
|
|
190
190
|
| `improve_completed` | `akm improve` run finished | run stats |
|
|
191
191
|
| `improve_failed` | `akm improve` run errored | error |
|
|
192
|
-
| `improve_skipped` | `akm improve` left a ref, a lane, or a group of refs out | `reason` (`no_new_signal`, `not_retrieved`, `distill_no_new_signal`, `budget_exhausted`, `budget_exhausted_batch`, `asset_missing_on_disk`, `strategy_filtered_all_passes`, `autonomy_gated`, `engine_unavailable`, `
|
|
192
|
+
| `improve_skipped` | `akm improve` left a ref, a lane, or a group of refs out | `reason` (`no_new_signal`, `not_retrieved`, `distill_no_new_signal`, `budget_exhausted`, `budget_exhausted_batch`, `asset_missing_on_disk`, `strategy_filtered_all_passes`, `autonomy_gated`, `engine_unavailable`, `consolidation_no_memory_updates`, `below_min_new_sessions`, `derived_memory_reflect_skipped`, `memory_distill_requires_feedback`, `distill_flagged_wrong`, `distill_positive_without_reason`, `distill_deprecated_or_superseded`); `count`, `remaining`, `strategy`, `lane` or `configKey` where they apply |
|
|
193
193
|
| `improve_lock_recovered` | Stale improve lock cleared at startup | |
|
|
194
194
|
| `improve_review_needed` | `akm feedback` pushed a high-utility asset's utility below the review threshold — a review-needed escalation is recorded (not a proposal, so it can't accidentally overwrite the asset) | `ref`, `previousUtility`, `nextUtility` |
|
|
195
195
|
| `reflect_invoked` | Start of reflect phase in `akm improve` | `ref`, engine |
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Environment & Secrets
|
|
2
|
+
|
|
3
|
+
Reference for `akm env` and `akm secret` — the two protected-value asset
|
|
4
|
+
types. For task-oriented guidance on capturing knowledge in general, see
|
|
5
|
+
[Capture Knowledge](../guides/capture-knowledge.md); this page states exact
|
|
6
|
+
contract, defaults, and security behavior.
|
|
7
|
+
|
|
8
|
+
## env vs secret
|
|
9
|
+
|
|
10
|
+
`akm env` manages a `.env`-backed group of configuration (a whole `.env` file
|
|
11
|
+
loaded wholesale). `akm secret` manages a single standalone sensitive value —
|
|
12
|
+
one value per file, mirroring Docker's secret model. There is no `akm vault`
|
|
13
|
+
command; use `env` or `secret`.
|
|
14
|
+
|
|
15
|
+
| | `env` | `secret` |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| Purpose | configuration — related settings for an app/service | authentication — one sensitive value |
|
|
18
|
+
| Holds | a `.env` file of many `KEY=value` pairs | one value per file |
|
|
19
|
+
| Discoverable | key *names* (not values) | name only (the whole file is the value) |
|
|
20
|
+
| Injects | many vars at once (`env run`) | one var (`secret run <ref> <VAR>`) |
|
|
21
|
+
|
|
22
|
+
## Core security guarantee
|
|
23
|
+
|
|
24
|
+
Values never appear in akm's structured output. `env list` and `akm show
|
|
25
|
+
env/<name>` surface key names only — comment text is never surfaced either,
|
|
26
|
+
since comments routinely contain commented-out credentials and are treated
|
|
27
|
+
like values. `secret list` surfaces the secret's name only; the file content
|
|
28
|
+
is never shown. Values reach a process only through the safe injection
|
|
29
|
+
paths, `akm env run` and `akm secret run`, which pass values directly into
|
|
30
|
+
the child process — never through akm's own stdout, the index, or `akm
|
|
31
|
+
show`.
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
akm env create prod # create an empty .env group
|
|
35
|
+
akm env create prod --from-file ./.env # or ingest an existing .env
|
|
36
|
+
|
|
37
|
+
# akm does not manage individual keys — edit the whole file with your own editor:
|
|
38
|
+
$EDITOR "$(akm env path env/prod --quiet)"
|
|
39
|
+
|
|
40
|
+
akm env list
|
|
41
|
+
akm show env/prod # key names only
|
|
42
|
+
|
|
43
|
+
# Inject the whole .env into a subprocess (never onto stdout):
|
|
44
|
+
akm env run env/prod -- ./deploy.sh
|
|
45
|
+
akm env run env/prod -- $SHELL # interactive session with the env loaded
|
|
46
|
+
akm env run env/prod --only DATABASE_URL -- ./migrate
|
|
47
|
+
|
|
48
|
+
# Store a single credential as a secret:
|
|
49
|
+
printf '%s' "$TOKEN" | akm secret set secrets/deploy-token
|
|
50
|
+
akm secret run secrets/deploy-token GITHUB_TOKEN -- gh release create v1.0.0
|
|
51
|
+
|
|
52
|
+
# Write into a specific source instead of the working bundle:
|
|
53
|
+
akm secret set secrets/deploy-token --bundle team --from-file ./token
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`env export --out <file>` writes a safe, sourceable `export KEY='value'`
|
|
57
|
+
script (re-serialised single-quoted, so shell substitutions in the source
|
|
58
|
+
`.env` become literal strings) — it requires `--out` and never prints values
|
|
59
|
+
to stdout.
|
|
60
|
+
|
|
61
|
+
## File modes and storage
|
|
62
|
+
|
|
63
|
+
`.env` files are stored at mode 0600 under `env/` in the target bundle;
|
|
64
|
+
standalone secrets are stored at mode 0600 under `secrets/`. A secret write
|
|
65
|
+
is atomic under an exclusive per-secret lock held in akm's data directory;
|
|
66
|
+
maximum secret size is 5 MB.
|
|
67
|
+
Values never cross argv (no `/proc/cmdline` exposure). An `env` file or
|
|
68
|
+
secret can carry a sibling `.sensitive` marker that excludes it from `list`
|
|
69
|
+
output and from the search index entirely; the value remains usable via
|
|
70
|
+
`run`.
|
|
71
|
+
|
|
72
|
+
## Write-target resolution
|
|
73
|
+
|
|
74
|
+
Env/secret **mutations** (`env create`, `env remove`, `secret set`) choose
|
|
75
|
+
their write destination like every other write command: an explicit
|
|
76
|
+
`--bundle <source>` wins, else `defaultWriteTarget`, else the working
|
|
77
|
+
bundle. The chosen source must be writable — a non-writable target fails
|
|
78
|
+
with a `ConfigError` before anything is written — and a git-backed writable
|
|
79
|
+
target commits the mutation at a single operation boundary. Reads (`list`,
|
|
80
|
+
`show`, `path`, `run`, `export`) still span all configured sources.
|
|
81
|
+
|
|
82
|
+
## Subprocess residency
|
|
83
|
+
|
|
84
|
+
`akm env run` and `akm secret run` inject values directly into the child
|
|
85
|
+
process — never through a shell — but the child controls its own
|
|
86
|
+
stdout/stderr, so a command that prints its own environment will still leak
|
|
87
|
+
values into your terminal or agent transcript. Injected values live in the
|
|
88
|
+
child process environment for its entire lifetime and are visible to every
|
|
89
|
+
subprocess the child spawns.
|
|
90
|
+
|
|
91
|
+
- Prefer `akm secret run secrets/<name> <VAR> -- <command>` over `akm env
|
|
92
|
+
run` when a command only needs one value.
|
|
93
|
+
- Avoid `env run` / `secret run` for long-lived daemon or server processes;
|
|
94
|
+
for those, point the process at the secret file directly
|
|
95
|
+
(`<bundle>/secrets/<name>`) so the value never sits in a process
|
|
96
|
+
environment variable at all.
|
|
97
|
+
- Avoid running commands that print the environment (`env`, `printenv`,
|
|
98
|
+
shell tracing, verbose diagnostics) in agent contexts unless you
|
|
99
|
+
explicitly intend to expose the child environment.
|
|
100
|
+
- Before spawning, injected key names are scanned for known
|
|
101
|
+
process-hijacking variables (`LD_PRELOAD`, `PATH`, `GIT_CONFIG_*`, ...): a
|
|
102
|
+
first-party bundle warns and proceeds, a third-party-sourced bundle is
|
|
103
|
+
refused.
|
|
104
|
+
|
|
105
|
+
## Stability
|
|
106
|
+
|
|
107
|
+
`env list`, `env path`, `env export`, `env run`, `secret list`, and `secret
|
|
108
|
+
run` — the read-and-inject surface — are Stable. `env create`, `env remove`,
|
|
109
|
+
and `secret set` — the write verbs — are Experimental. Check
|
|
110
|
+
[STABILITY.md](../../STABILITY.md) for the current tier of any command
|
|
111
|
+
before depending on its exact output shape.
|
|
112
|
+
|
|
113
|
+
## What this page does not cover
|
|
114
|
+
|
|
115
|
+
This page documents akm's own guarantees for these two asset types, not the
|
|
116
|
+
broader threat model (what a compromised bundle or malicious script could
|
|
117
|
+
still do, what filesystem-level exposure remains, how this compares to a
|
|
118
|
+
dedicated secrets manager). See [SECURITY.md](../../SECURITY.md) for that
|
|
119
|
+
fuller picture, including plaintext-at-rest scope and rotation guidance.
|
|
120
|
+
|
|
121
|
+
## See also
|
|
122
|
+
|
|
123
|
+
- [Capture Knowledge](../guides/capture-knowledge.md) — `remember`, `import`,
|
|
124
|
+
and when to reach for each
|
|
125
|
+
- [CLI Reference](cli.md) — full flag documentation for `env` and `secret`
|
|
126
|
+
- [SECURITY.md](../../SECURITY.md) — full threat model
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Memory
|
|
2
|
+
|
|
3
|
+
Reference for the `memory` asset type: capture, belief states, and derived
|
|
4
|
+
memories.
|
|
5
|
+
|
|
6
|
+
## Contract
|
|
7
|
+
|
|
8
|
+
Memories are context fragments — observations, decisions, snippets —
|
|
9
|
+
captured as markdown files. Capture one directly in your working bundle with
|
|
10
|
+
`akm remember "..."`, or point akm at any directory of memory files written
|
|
11
|
+
by another tool:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
# File-based memory store from another tool
|
|
15
|
+
akm bundle add ~/my-agent/memories
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Memory assets appear in search results with the `memory` type, giving agents
|
|
19
|
+
access to recalled context from previous sessions.
|
|
20
|
+
|
|
21
|
+
## Schema
|
|
22
|
+
|
|
23
|
+
Memories captured with `akm remember` can carry optional YAML frontmatter
|
|
24
|
+
that the indexer records:
|
|
25
|
+
|
|
26
|
+
| Field | Purpose |
|
|
27
|
+
| --- | --- |
|
|
28
|
+
| `tags` | Free-form categorization |
|
|
29
|
+
| `source` | Where the memory came from (also used as the derived-memory parent backref — see below) |
|
|
30
|
+
| `observed_at` | When the observation happened |
|
|
31
|
+
| `expires` | When the memory should stop being considered current |
|
|
32
|
+
| `subjective` | Marks the memory as opinion/preference rather than fact |
|
|
33
|
+
| `description` | Short human-readable summary |
|
|
34
|
+
| `captureMode` | `hot` (written via `akm remember`) or `background` (inferred by `akm improve`) |
|
|
35
|
+
| `beliefState` | See belief states below |
|
|
36
|
+
| `supersededBy` | Points at the memory that replaced this one |
|
|
37
|
+
|
|
38
|
+
Supply frontmatter fields explicitly with `--tag`/`--expires`/`--source`,
|
|
39
|
+
derive them from the body heuristically with `--auto`, or have the
|
|
40
|
+
configured LLM propose them with `--enrich`. See
|
|
41
|
+
[`akm remember`](cli.md#remember) for the full flag list.
|
|
42
|
+
|
|
43
|
+
### Belief states
|
|
44
|
+
|
|
45
|
+
Memories carry a `beliefState` field that records how current they are.
|
|
46
|
+
Search ranking does not read it; the `--belief` filter below does. The
|
|
47
|
+
supported values, from strongest to weakest authority:
|
|
48
|
+
|
|
49
|
+
| State | When it's set | `--belief` |
|
|
50
|
+
| --- | --- | --- |
|
|
51
|
+
| `asserted` | Written directly by `akm remember` (user-explicit) | current |
|
|
52
|
+
| `active` | Default for memories with no explicit state | current |
|
|
53
|
+
| `deprecated` | Marked as no-longer-current but not yet superseded; frozen (never auto-refreshed) | historical |
|
|
54
|
+
| `superseded` | Replaced by another memory via the `supersededBy` field | historical |
|
|
55
|
+
| `contradicted` | Marked as contradicted by other evidence | historical |
|
|
56
|
+
| `archived` | Soft-deleted; retained for audit | historical |
|
|
57
|
+
|
|
58
|
+
`akm search` filters via `--belief current|historical|all`:
|
|
59
|
+
|
|
60
|
+
- `current` → `active` + `asserted`
|
|
61
|
+
- `historical` → `deprecated` + `superseded` + `contradicted` + `archived`
|
|
62
|
+
- `all` (default — no filter) → every belief state, including `archived` and
|
|
63
|
+
`contradicted` memories, is eligible to surface.
|
|
64
|
+
|
|
65
|
+
### Derived memories as retrieval shortcuts
|
|
66
|
+
|
|
67
|
+
When `akm improve` infers a derived memory from a parent (e.g. distilling a
|
|
68
|
+
verbose memory into a focused summary), the derived memory is written with a
|
|
69
|
+
`source:` frontmatter backref naming the parent, and the indexer records the
|
|
70
|
+
parent/child link in the `derived_from` column. This provenance backref is a
|
|
71
|
+
sanctioned internal channel that carries a bare parent name, not a public
|
|
72
|
+
[ref](refs.md) — agents never construct it.
|
|
73
|
+
|
|
74
|
+
Search hits for the parent memory are then enriched in-place: the parent's
|
|
75
|
+
description and tags are swapped with the derived child's surface text, and
|
|
76
|
+
an `expandTo: memories/<derived>` field on the hit points at the richer
|
|
77
|
+
derived ref. The parent ref itself is preserved on the hit, so existing
|
|
78
|
+
automation keeps working — agents that want the deeper summary follow
|
|
79
|
+
`expandTo`.
|
|
80
|
+
|
|
81
|
+
## Defaults
|
|
82
|
+
|
|
83
|
+
- Hot-path memories (those written via `akm remember`) receive
|
|
84
|
+
`captureMode: hot` and `beliefState: asserted` in their frontmatter
|
|
85
|
+
automatically.
|
|
86
|
+
- Background-derived memories (those inferred from other assets by `akm
|
|
87
|
+
improve`) receive `captureMode: background`.
|
|
88
|
+
- A memory with no explicit `beliefState` defaults to `active`.
|
|
89
|
+
- `akm search --belief` defaults to `all` — no filter is applied unless you
|
|
90
|
+
pass `current` or `historical` explicitly.
|
|
91
|
+
|
|
92
|
+
## Security / persistence implications
|
|
93
|
+
|
|
94
|
+
- Memories are plain markdown files inside a bundle directory; there is no
|
|
95
|
+
separate memory store. `akm improve` and `akm lint` only operate on
|
|
96
|
+
writable sources — a read-only registry-cached memory source is excluded
|
|
97
|
+
from cleanup and derivation passes even if it's indexed.
|
|
98
|
+
- The derived-memory `source:` backref and the index's `derived_from` column
|
|
99
|
+
are an internal provenance channel, not a ref an agent should read,
|
|
100
|
+
construct, or rely on programmatically. Use the `expandTo` field on a
|
|
101
|
+
search hit instead.
|
|
102
|
+
- Belief-state frontmatter is rewritten in place by `akm improve`'s memory
|
|
103
|
+
cleanup lane when autonomy is enabled (`experimental.improveAutonomy`);
|
|
104
|
+
with autonomy off, cleanup is analyzed but not applied. See
|
|
105
|
+
`STABILITY.md`'s "`akm improve` autonomy" section.
|
|
106
|
+
|
|
107
|
+
## Stability
|
|
108
|
+
|
|
109
|
+
Per `STABILITY.md`, **memory belief-state transitions are Experimental**:
|
|
110
|
+
`captureMode`, `beliefState`, contradiction edges, and the consolidate
|
|
111
|
+
journal are observable but the algorithm that writes them is tuning across
|
|
112
|
+
patch releases. Do not script against the exact transition logic — the
|
|
113
|
+
frontmatter fields and their meanings above are the stable-enough surface to
|
|
114
|
+
read, but when and how akm assigns them is still settling. The `lesson`
|
|
115
|
+
asset type, which shares the same distillation pipeline, is also
|
|
116
|
+
Experimental for the same reason.
|
|
117
|
+
|
|
118
|
+
## See also
|
|
119
|
+
|
|
120
|
+
- [Concepts](../guides/concepts.md) — how a memory fits the capability model
|
|
121
|
+
- [Refs](refs.md) — the public ref grammar (distinct from the internal derived-memory backref)
|
|
122
|
+
- [Asset Types](asset-types.md) — where `memory` sits in the full type taxonomy
|
|
123
|
+
- [`akm remember`](cli.md#remember) — the capture command and its flags
|
|
124
|
+
- `STABILITY.md` — the full stability tier index, including `akm improve` autonomy
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# Refs
|
|
2
|
+
|
|
3
|
+
Reference for the ref grammar `akm search` emits and `akm show` consumes,
|
|
4
|
+
rename semantics, and namespacing conventions.
|
|
5
|
+
|
|
6
|
+
## Contract
|
|
7
|
+
|
|
8
|
+
A **ref** is a compact handle identifying one capability. Agents should
|
|
9
|
+
treat refs as opaque tokens — get them from search or curate, pass them to
|
|
10
|
+
show. The structured `conceptId` and `bundle` fields in search results
|
|
11
|
+
provide the same information in parseable form; never parse a ref string by
|
|
12
|
+
hand.
|
|
13
|
+
|
|
14
|
+
## Grammar
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
[bundle//]conceptId[#fragment]
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
| Part | Required | Description |
|
|
21
|
+
| --- | --- | --- |
|
|
22
|
+
| `bundle` | no | Narrows lookup to one installed bundle, separated from the rest of the ref by `//`. Omit it and the ref resolves against the workspace `defaultBundle`, then the remaining bundles in installation-priority order. |
|
|
23
|
+
| `conceptId` | yes | Subdir-qualified within its bundle: the placement subdirectory followed by the item's canonical name (extension stripped for markdown-like types; scripts and secrets keep their natural filename). `type` is not part of a ref — the subdirectory carries that signal. |
|
|
24
|
+
| `fragment` | no | A selector for part of the item. Input-only — never stored. |
|
|
25
|
+
|
|
26
|
+
Examples: `scripts/deploy.sh`, `agents/reviewer`, `knowledge/api-guide`,
|
|
27
|
+
`workflows/ship-release`, `team-catalog//scripts/deploy.sh`,
|
|
28
|
+
`personal//knowledge/guide`, `knowledge/api-guide#authentication`.
|
|
29
|
+
|
|
30
|
+
Source locators like `github:owner/repo` and `npm:@scope/pkg` are **install
|
|
31
|
+
refs**, a distinct grammar accepted only by `akm bundle add` and `akm
|
|
32
|
+
clone`. They are not asset refs and are never addressable through `akm
|
|
33
|
+
show`.
|
|
34
|
+
|
|
35
|
+
This reference page is deliberately non-normative prose over the same
|
|
36
|
+
grammar; [`docs/architecture/specs/ref.md`](https://github.com/itlackey/akm/blob/main/docs/architecture/specs/ref.md)
|
|
37
|
+
is the normative spec, including the `parseBundleRef` grammar, fragment
|
|
38
|
+
resolution rules, and reserved-name handling.
|
|
39
|
+
|
|
40
|
+
## Namespacing
|
|
41
|
+
|
|
42
|
+
AKM supports **physical-subdirectory namespacing** — no extra flags
|
|
43
|
+
required. Drop assets under nested directories beneath the type folder and
|
|
44
|
+
the path becomes part of the ref's name:
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
memories/projectA/auth-tip.md → memories/projectA/auth-tip
|
|
48
|
+
memories/teamA/clientX/notes.md → memories/teamA/clientX/notes
|
|
49
|
+
skills/projectB/lint-fix.md → skills/projectB/lint-fix
|
|
50
|
+
knowledge/clientX/api-guide.md → knowledge/clientX/api-guide
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
This works for **any** asset type. The subpath segments become part of the
|
|
54
|
+
conceptId, so `akm search "projectA" --type memory` narrows results to that
|
|
55
|
+
subtree, and `akm show memories/projectA/auth-tip` resolves the full ref.
|
|
56
|
+
|
|
57
|
+
There is also a **ref-prefix query syntax** — a query that is a conceptId
|
|
58
|
+
prefix ending in `/` enumerates that subtree instead of keyword-matching:
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
akm search "memories/" # every memory
|
|
62
|
+
akm search "memories/projectA/" # exactly that subtree
|
|
63
|
+
akm search "team-catalog//" # every item in one bundle
|
|
64
|
+
akm search "team-catalog//skills/" # one subtree of one bundle
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Enumeration is `/`-boundary exact — a sibling `projectAlpha/` scope does not
|
|
68
|
+
leak — and hits are a deterministic listing with the fixed browse score `1`,
|
|
69
|
+
not a relevance ranking. Because it matches conceptIds, it works for items
|
|
70
|
+
from every adapter, and you can copy a ref prefix straight out of search
|
|
71
|
+
output and paste it back as a query. A complete ref
|
|
72
|
+
(`memories/projectA/auth-tip`, no trailing `/`) stays an ordinary keyword
|
|
73
|
+
search — resolving a single ref is `akm show`'s job.
|
|
74
|
+
|
|
75
|
+
**Recommendation:** use physical subdirectories now to organize multi-project
|
|
76
|
+
or multi-team bundles. They sort cleanly on disk and require no
|
|
77
|
+
configuration.
|
|
78
|
+
|
|
79
|
+
**Which subdirectory?** Choose the partition axis by asset **type**:
|
|
80
|
+
scope-born types (`memory`, `lesson`, `task`, `env`, `secret`) take the
|
|
81
|
+
current **project/client** slug; reuse-born types (`knowledge`, `skill`,
|
|
82
|
+
`fact`, `script`) take a stable **domain**; global types (`command`, `agent`,
|
|
83
|
+
`workflow`) stay at the type root or a tool slug. The full rules — depth
|
|
84
|
+
limits, no-volatile-facets, off-axis facets as tags, and how to cross-link
|
|
85
|
+
for retrieval — ship as the `facts/conventions/organization`,
|
|
86
|
+
`facts/conventions/backlinks`, and `facts/conventions/domains` convention
|
|
87
|
+
facts in the bundle skeleton, and are surfaced to agents automatically at
|
|
88
|
+
authoring time.
|
|
89
|
+
|
|
90
|
+
### Planned
|
|
91
|
+
|
|
92
|
+
Not part of the current stability contract; see
|
|
93
|
+
[ROADMAP.md](../../ROADMAP.md) for what's committed:
|
|
94
|
+
|
|
95
|
+
- A `--namespace <ns>` flag to provide a thin name-prefix normalizer on
|
|
96
|
+
`search`, `remember`, `improve`, and `feedback` so the same prefix doesn't
|
|
97
|
+
have to be typed every time.
|
|
98
|
+
- A `::` delimiter (for example `projectA::memories/auth-tip`) to provide
|
|
99
|
+
strict isolation so refs from different namespaces never collide in
|
|
100
|
+
ranking or recall.
|
|
101
|
+
|
|
102
|
+
Until those land, physical subdirectories remain the recommended pattern.
|
|
103
|
+
|
|
104
|
+
## Renames and moves
|
|
105
|
+
|
|
106
|
+
**Treat a ref as permanent.** A rename is **delete plus create**: the new
|
|
107
|
+
path is a new identity, so the destination starts with fresh learned state
|
|
108
|
+
(utility, salience, usage history) and any inbound refs to the old path
|
|
109
|
+
dangle. When you must rename:
|
|
110
|
+
|
|
111
|
+
```sh
|
|
112
|
+
mv ~/akm/memories/old-note.md ~/akm/memories/new-note.md
|
|
113
|
+
# update any intentional refs (they are fully qualified: bundle//memories/old-note)
|
|
114
|
+
akm index
|
|
115
|
+
akm lint # confirms nothing dangles
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Moving an item between bundles is copy/import followed by deletion from the
|
|
119
|
+
source — both the bundle and the concept identity change. `akm mv`, which
|
|
120
|
+
promised identity-preserving renames, was removed in 0.9.0: its inbound-ref
|
|
121
|
+
rewriting targeted bare conceptIds rather than the anchored
|
|
122
|
+
`bundle//conceptId` prose form, so it could rewrite non-refs while leaving
|
|
123
|
+
real refs dangling. The procedure above is the only supported path today.
|
|
124
|
+
|
|
125
|
+
To carry an asset's earned signal (feedback, usage, salience/outcome
|
|
126
|
+
history) across a rename, the maintainer script `scripts/rekey-asset-ref.ts`
|
|
127
|
+
re-keys those rows onto the new ref before `akm index` runs; it is Internal
|
|
128
|
+
tooling, not a supported command surface. See
|
|
129
|
+
[the decision record](https://github.com/itlackey/akm/blob/main/docs/architecture/specs/0.9.0-decisions.md#d3--renames-are-delete--create-akm-mv-ships-experimental).
|
|
130
|
+
|
|
131
|
+
## Refs in prose
|
|
132
|
+
|
|
133
|
+
Refs embedded in prose must use the fully-qualified `bundle//conceptId` form
|
|
134
|
+
— the bundle-slug charset makes such a token lexically anchored — or a
|
|
135
|
+
native link form owned by the adapter (OKF links, wiki links). A bare
|
|
136
|
+
conceptId in prose is ordinary text, not a ref, and no akm tool rewrites it.
|
|
137
|
+
|
|
138
|
+
## Stability
|
|
139
|
+
|
|
140
|
+
Per `STABILITY.md`, this is **Stable** surface: the
|
|
141
|
+
`[bundle//]conceptId[#fragment]` grammar (durable state always stores the
|
|
142
|
+
fully-qualified `bundle//conceptId`; the short form is accepted input only),
|
|
143
|
+
conceptId-prefix enumeration, and the rename-is-delete-plus-create procedure
|
|
144
|
+
are all named explicitly in the Stable tier, and the ref grammar is called
|
|
145
|
+
out as frozen at 1.0 alongside the supported source model, search behavior,
|
|
146
|
+
and write-target rules. The `--namespace` flag and `::` delimiter above are
|
|
147
|
+
On the horizon, not yet part of the contract. See `STABILITY.md` for the
|
|
148
|
+
full command- and surface-level tier index.
|
|
149
|
+
|
|
150
|
+
## See also
|
|
151
|
+
|
|
152
|
+
- [Concepts](../guides/concepts.md) — where refs fit in the retrieval loop
|
|
153
|
+
- [Asset Types](asset-types.md) — how a conceptId's subdirectory maps to an asset type
|
|
154
|
+
- [Memory](memory.md) — parent/derived-memory provenance backrefs
|
|
155
|
+
- [`docs/architecture/specs/ref.md`](https://github.com/itlackey/akm/blob/main/docs/architecture/specs/ref.md) — the normative ref grammar spec
|
|
156
|
+
- [ROADMAP.md](../../ROADMAP.md) — planned ref-syntax additions
|