akm-cli 0.9.17-alpha.2 → 0.9.17-alpha.4
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 +756 -0
- package/dist/akm +94 -196
- package/dist/cli/shared.js +6 -2
- package/dist/cli.js +22 -9
- package/dist/commands/agent/agent-dispatch.js +1 -1
- package/dist/commands/command/command-execution.js +24 -62
- package/dist/commands/feedback-cli.js +0 -1
- package/dist/commands/health/accept-rate.js +2 -2
- package/dist/commands/health/checks.js +30 -75
- package/dist/commands/health/config-skew.js +38 -0
- package/dist/commands/health/egress.js +54 -0
- package/dist/commands/health/html-report.js +0 -38
- package/dist/commands/health/improve-metrics.js +123 -562
- package/dist/commands/health/plugin-staleness.js +53 -3
- package/dist/commands/health/renderers.js +12 -4
- package/dist/commands/health/report-view-model.js +11 -106
- package/dist/commands/health/types-improve.js +4 -19
- package/dist/commands/health/windows.js +64 -73
- package/dist/commands/health.js +122 -143
- package/dist/commands/improve/consolidate/chunking.js +25 -100
- package/dist/commands/improve/consolidate/sanitize.js +54 -149
- package/dist/commands/improve/consolidate.js +538 -1075
- package/dist/commands/improve/content-hash.js +16 -24
- package/dist/commands/improve/distill/content-repair.js +18 -100
- package/dist/commands/improve/distill-guards.js +20 -81
- package/dist/commands/improve/distill-promotion-policy.js +23 -243
- package/dist/commands/improve/distill.js +608 -1075
- package/dist/commands/improve/eligibility.js +126 -400
- package/dist/commands/improve/execution.js +3 -5
- package/dist/commands/improve/extract.js +487 -1046
- package/dist/commands/improve/feedback-valence.js +0 -25
- package/dist/commands/improve/improve-cli.js +29 -166
- package/dist/commands/improve/improve-result-file.js +10 -66
- package/dist/commands/improve/improve-strategies.js +12 -7
- package/dist/commands/improve/improve-usage-report.js +18 -64
- package/dist/commands/improve/improve.js +443 -1063
- package/dist/commands/improve/ledger.js +114 -0
- package/dist/commands/improve/locks.js +2 -8
- package/dist/commands/improve/loop-stages.js +459 -1172
- package/dist/commands/improve/memory/derived-ref.js +12 -77
- package/dist/commands/improve/memory/memory-belief.js +14 -118
- package/dist/commands/improve/memory/memory-improve.js +4 -3
- package/dist/commands/improve/outcome-loop.js +28 -156
- package/dist/commands/improve/planner.js +5 -10
- package/dist/commands/improve/preparation.js +851 -2339
- package/dist/commands/improve/proactive-maintenance.js +34 -101
- package/dist/commands/improve/reflect-noise.js +104 -280
- package/dist/commands/improve/reflect.js +621 -1367
- package/dist/commands/improve/salience.js +46 -232
- package/dist/commands/improve/session-asset.js +19 -100
- package/dist/commands/improve/stage.js +323 -0
- package/dist/commands/proposal/drain.js +251 -644
- package/dist/commands/proposal/proposal-cli.js +3 -18
- package/dist/commands/proposal/proposal-types.js +20 -41
- package/dist/commands/proposal/proposal.js +1 -2
- package/dist/commands/proposal/propose.js +134 -160
- package/dist/commands/proposal/repository.js +502 -1487
- package/dist/commands/proposal/validators/proposal-quality-validators.js +71 -174
- package/dist/commands/proposal/validators/proposal-validators.js +1 -1
- package/dist/commands/proposal/validators/proposals.js +13 -89
- package/dist/commands/read/curate.js +63 -413
- package/dist/commands/read/search-cli.js +16 -33
- package/dist/commands/read/search.js +17 -23
- package/dist/commands/read/show.js +2 -13
- package/dist/commands/sources/bundle-cli.js +25 -2
- package/dist/commands/sources/bundle-config-ops.js +7 -0
- package/dist/commands/sources/dangerous-env-audit.js +1 -2
- package/dist/commands/sources/info.js +2 -11
- package/dist/commands/sources/installed-stashes.js +197 -746
- package/dist/commands/sources/schema-repair.js +98 -129
- package/dist/commands/sources/source-add.js +62 -12
- package/dist/commands/sources/stash-cli.js +1 -1
- package/dist/commands/tasks/explain.js +10 -13
- package/dist/commands/tasks/tasks-cli.js +9 -8
- package/dist/commands/tasks/tasks.js +326 -930
- package/dist/commands/tasks/validate.js +42 -21
- package/dist/commands/workflow/plan.js +22 -29
- package/dist/commands/workflow-cli.js +4 -4
- package/dist/core/adapter/adapters/akm-adapter.js +0 -1
- package/dist/core/adapter/adapters/akm-lint.js +2 -3
- package/dist/core/adapter/adapters/akm-metadata.js +11 -12
- package/dist/core/adapter/adapters/akm-workflow-adapter.js +1 -1
- package/dist/core/adapter/execution-source.js +17 -29
- package/dist/core/asset/resolve-ref.js +1 -1
- package/dist/core/bundle-id.js +42 -5
- package/dist/core/bundle-rename.js +291 -0
- package/dist/core/config/config-io.js +1 -2
- package/dist/core/config/config-schema.js +1 -33
- package/dist/core/config/config-walker.js +1 -1
- package/dist/core/config/config.js +163 -68
- package/dist/core/config/legacy-source-shape-shim.js +38 -9
- package/dist/core/config/schema/embedding.js +20 -5
- package/dist/core/config/schema/engines.js +5 -0
- package/dist/core/config/schema/execution.js +1 -1
- package/dist/core/config/schema/experimental.js +1 -1
- package/dist/core/config/schema/improve-processes.js +21 -95
- package/dist/core/config/schema/improve.js +4 -42
- package/dist/core/config/schema/scheduler.js +12 -12
- package/dist/core/config/schema/search.js +6 -22
- package/dist/core/env-secret-ref.js +0 -1
- package/dist/core/errors.js +8 -9
- package/dist/core/file-lock.js +76 -173
- package/dist/core/logs-db.js +2 -2
- package/dist/core/paths.js +0 -27
- package/dist/core/redaction.js +109 -2
- package/dist/core/run-lock.js +2 -5
- package/dist/core/spawn-env.js +1 -1
- package/dist/core/state/migrations.js +108 -61
- package/dist/core/state-db-scope.js +2 -4
- package/dist/core/state-db.js +126 -692
- package/dist/core/type-presentation.js +1 -9
- package/dist/core/write-source.js +293 -1012
- package/dist/execution/input-contract.js +1 -1
- package/dist/execution/resolved-request.js +135 -689
- package/dist/execution/source.js +63 -257
- package/dist/execution/target-ref.js +1 -1
- package/dist/indexer/bundle-identity-guard.js +2 -2
- package/dist/indexer/db/graph-db.js +106 -46
- package/dist/indexer/ensure-index.js +44 -85
- package/dist/indexer/graph/graph-extraction.js +340 -562
- package/dist/indexer/graph/graph-related.js +130 -0
- package/dist/indexer/index-rebuild-lock.js +3 -11
- package/dist/indexer/index-writer-lock.js +8 -17
- package/dist/indexer/index-written-assets.js +139 -151
- package/dist/indexer/indexer.js +524 -846
- package/dist/indexer/materialize-embeddings.js +60 -397
- package/dist/indexer/passes/memory-inference.js +81 -90
- package/dist/indexer/passes/metadata.js +132 -200
- package/dist/indexer/read-preflight.js +0 -7
- package/dist/indexer/scan/doc-to-entry.js +1 -3
- package/dist/indexer/scan/drain-dir.js +1 -1
- package/dist/indexer/search/db-search.js +181 -590
- package/dist/indexer/search/fts-query.js +30 -41
- package/dist/indexer/search/ranking.js +28 -154
- package/dist/indexer/search/search-attribution.js +12 -32
- package/dist/indexer/search/search-fields.js +11 -15
- package/dist/indexer/search/search-hit-enrichers.js +54 -85
- package/dist/indexer/search/search-source.js +1 -4
- package/dist/indexer/usage/usage-events.js +2 -7
- package/dist/integrations/agent/engine-fallback.js +23 -40
- package/dist/integrations/agent/engine-resolution.js +93 -183
- package/dist/integrations/agent/execution.js +507 -0
- package/dist/integrations/agent/model-map.js +28 -156
- package/dist/integrations/agent/request-lowering.js +66 -141
- package/dist/integrations/agent/runner-dispatch.js +143 -321
- package/dist/integrations/agent/runner.js +54 -14
- package/dist/integrations/lockfile.js +53 -101
- package/dist/llm/embedders/deterministic.js +2 -3
- package/dist/llm/embedders/profile.js +71 -0
- package/dist/llm/embedders/remote.js +10 -15
- package/dist/llm/graph-extract.js +3 -12
- package/dist/llm/index-passes.js +3 -5
- package/dist/llm/memory-infer.js +1 -2
- package/dist/llm/metadata-enhance.js +1 -2
- package/dist/llm/structured-call.js +5 -24
- package/dist/output/generic-render.js +23 -11
- package/dist/output/html-render.js +13 -10
- package/dist/output/render-registry.js +3 -32
- package/dist/output/shapes/helpers.js +2 -34
- package/dist/output/shapes/passthrough.js +1 -9
- package/dist/{indexer/search/ranking-types.js → output/text/bundle-rename.js} +4 -1
- package/dist/output/text/command-format.js +60 -23
- package/dist/output/text/helpers.js +1 -1
- package/dist/output/text/migrate.js +5 -14
- package/dist/output/text/proposal-format.js +1 -2
- package/dist/output/text/workflow-format.js +0 -32
- package/dist/output/text.js +2 -0
- package/dist/registry/factory.js +4 -19
- package/dist/registry/network.js +66 -220
- package/dist/registry/providers/index.js +0 -2
- package/dist/registry/providers/skills-sh.js +3 -14
- package/dist/registry/providers/static-index.js +24 -26
- package/dist/registry/resolve.js +55 -131
- package/dist/scripts/akm-migrate-node.js +43937 -93313
- package/dist/scripts/akm-migrate.js +43697 -93071
- package/dist/setup/registry-stash-loader.js +4 -13
- package/dist/setup/semantic-assets.js +3 -44
- package/dist/setup/setup.js +1 -1
- package/dist/setup/steps/tasks.js +25 -15
- package/dist/sources/provider-factory.js +17 -18
- package/dist/sources/providers/filesystem.js +2 -3
- package/dist/sources/providers/git-install.js +7 -1
- package/dist/sources/providers/git-provider.js +0 -3
- package/dist/sources/providers/git-stash.js +0 -17
- package/dist/sources/providers/npm.js +2 -4
- package/dist/sources/providers/provider-utils.js +5 -10
- package/dist/sources/providers/website.js +0 -2
- package/dist/sources/snapshot-fetchers/website-ingest.js +1 -1
- package/dist/sources/website-url.js +2 -2
- package/dist/storage/database.js +9 -35
- package/dist/storage/repositories/improve-ledger-repository.js +168 -0
- package/dist/storage/repositories/index-connection.js +34 -70
- package/dist/storage/repositories/index-entries-repository.js +69 -111
- package/dist/storage/repositories/index-entry-mapper.js +1 -2
- package/dist/storage/repositories/index-entry-schema.js +83 -269
- package/dist/storage/repositories/index-fts-repository.js +86 -256
- package/dist/storage/repositories/index-llm-cache-repository.js +17 -0
- package/dist/storage/repositories/index-meta-repository.js +6 -4
- package/dist/storage/repositories/index-schema.js +192 -220
- package/dist/storage/repositories/index-utility-repository.js +8 -29
- package/dist/storage/repositories/index-vec-repository.js +133 -414
- package/dist/storage/repositories/outcome-repository.js +2 -1
- package/dist/storage/repositories/proposals-repository.js +35 -0
- package/dist/storage/repositories/registry-index-cache-repository.js +100 -0
- package/dist/storage/repositories/task-history-repository.js +26 -4
- package/dist/storage/repositories/workflow-runs-repository.js +53 -244
- package/dist/storage/sqlite-migrations.js +136 -0
- package/dist/storage/sqlite-pragmas.js +11 -9
- package/dist/storage/sqlite-transaction.js +170 -0
- package/dist/storage/state-db-integrity.js +34 -27
- package/dist/tasks/activation-config.js +134 -62
- package/dist/tasks/backends/cron.js +129 -277
- package/dist/tasks/backends/exec-utils.js +2 -5
- package/dist/tasks/backends/launchd.js +125 -745
- package/dist/tasks/backends/schtasks.js +101 -620
- package/dist/tasks/prepare/prepare-support.js +5 -15
- package/dist/tasks/prepare/prepare.js +0 -2
- package/dist/tasks/resolve-akm-bin.js +20 -79
- package/dist/tasks/run/attempt-lifecycle.js +0 -1
- package/dist/tasks/scheduler-binding.js +18 -238
- package/dist/tasks/scheduler-invocation.js +52 -52
- package/dist/tasks/scheduler-lock.js +53 -0
- package/dist/tasks/scheduler-sync.js +363 -679
- package/dist/tasks/source/parse-task-source.js +160 -10
- package/dist/tasks/source/task-source-v3-frozen.js +3 -4
- package/dist/tasks/source/task-to-v4.js +2 -2
- package/dist/workflows/authoring/authoring.js +3 -12
- package/dist/workflows/compile.js +211 -0
- package/dist/workflows/concurrency-policy.js +13 -74
- package/dist/workflows/exec/child-invocation.js +3 -17
- package/dist/workflows/exec/child-workflow.js +32 -141
- package/dist/workflows/exec/dispatch-redaction.js +13 -53
- package/dist/workflows/exec/environment.js +98 -0
- package/dist/workflows/exec/exec-unit.js +33 -140
- package/dist/workflows/exec/frozen-judge.js +7 -59
- package/dist/workflows/exec/native-executor.js +82 -341
- package/dist/workflows/exec/param-secrets.js +29 -47
- package/dist/workflows/exec/run-workflow.js +154 -387
- package/dist/workflows/exec/scheduler.js +9 -36
- package/dist/workflows/exec/step-work.js +127 -430
- package/dist/workflows/exec/unit-dispatch.js +11 -63
- package/dist/workflows/exec/unit-writer.js +8 -52
- package/dist/workflows/exec/worktree.js +39 -273
- package/dist/workflows/freeze/child-output-references.js +4 -15
- package/dist/workflows/freeze/environment.js +99 -92
- package/dist/workflows/freeze/freeze.js +172 -0
- package/dist/workflows/freeze/step-values.js +19 -21
- package/dist/workflows/freeze/targets/child-workflow.js +23 -92
- package/dist/workflows/freeze/targets/command.js +10 -33
- package/dist/workflows/freeze/targets/script.js +5 -12
- package/dist/workflows/freeze/targets/shell.js +3 -6
- package/dist/workflows/freeze/targets/task.js +25 -80
- package/dist/workflows/freeze/task-bindings.js +20 -67
- package/dist/workflows/{source-ir/github-yaml.js → github-yaml.js} +88 -206
- package/dist/workflows/ir/params.js +6 -51
- package/dist/workflows/ir/plan-hash.js +2 -34
- package/dist/workflows/parser.js +140 -43
- package/dist/{commands/improve/consolidate/types.js → workflows/plan.js} +2 -1
- package/dist/workflows/renderer.js +36 -69
- package/dist/workflows/resource-limits.js +12 -120
- package/dist/workflows/runtime/agent-identity.js +8 -40
- package/dist/workflows/runtime/run-outputs.js +3 -6
- package/dist/workflows/runtime/run-plan.js +316 -0
- package/dist/workflows/runtime/runs.js +48 -200
- package/dist/workflows/runtime/workflow-asset-loader.js +24 -57
- package/dist/workflows/{source-ir/semantics.js → source-semantics.js} +16 -20
- package/dist/workflows/validate-summary.js +2 -7
- package/docs/integration/bundling-akm.md +49 -42
- package/docs/migration/README.md +1 -0
- package/docs/migration/release-notes/0.9.17.md +41 -0
- package/docs/migration/v0.9.1-to-v0.9.2.md +19 -7
- package/docs/reference/cli.md +182 -125
- package/docs/reference/configuration.md +49 -56
- package/docs/reference/data-and-telemetry.md +19 -20
- package/docs/reference/tasks.md +86 -38
- package/docs/reference/workflow-schema.md +14 -18
- package/docs/reference/workflows.md +6 -9
- package/package.json +1 -1
- package/schemas/akm-config.json +87 -406
- package/dist/commands/health/advisories.js +0 -150
- package/dist/commands/health/metrics.js +0 -329
- package/dist/commands/health/surfaces.js +0 -102
- package/dist/commands/improve/anti-collapse.js +0 -83
- package/dist/commands/improve/collapse-detector.js +0 -432
- package/dist/commands/improve/consolidate/eligibility.js +0 -48
- package/dist/commands/improve/consolidate/merge.js +0 -146
- package/dist/commands/improve/distill/promote-memory.js +0 -329
- package/dist/commands/improve/distill/quality-gate.js +0 -500
- package/dist/commands/improve/memory/memory-contradiction-detect.js +0 -291
- package/dist/commands/improve/proposal-envelope.js +0 -31
- package/dist/commands/improve/run-context.js +0 -123
- package/dist/commands/improve/shared.js +0 -21
- package/dist/commands/improve/source-identity.js +0 -28
- package/dist/commands/improve/triage.js +0 -96
- package/dist/commands/proposal/drain-policies.js +0 -151
- package/dist/commands/sources/update-transaction.js +0 -220
- package/dist/core/action-contributors.js +0 -28
- package/dist/core/config/config-version-shim.js +0 -101
- package/dist/core/config/retired-experimental-keys-shim.js +0 -62
- package/dist/core/fs-txn.js +0 -405
- package/dist/core/lexical-score.js +0 -25
- package/dist/core/maintenance-barrier.js +0 -167
- package/dist/execution/executable-identity.js +0 -105
- package/dist/execution/guarded-source.js +0 -427
- package/dist/indexer/graph/graph-boost.js +0 -427
- package/dist/indexer/graph/graph-dedup.js +0 -95
- package/dist/indexer/search/name-match.js +0 -35
- package/dist/indexer/search/ranking-contributors.js +0 -515
- package/dist/indexer/walk/project-context.js +0 -192
- package/dist/integrations/agent/execution-cascade.js +0 -566
- package/dist/integrations/agent/execution-definitions.js +0 -202
- package/dist/integrations/agent/execution-lowering.js +0 -841
- package/dist/integrations/agent/execution-preparation.js +0 -98
- package/dist/integrations/agent/inline-execution.js +0 -74
- package/dist/registry/create-provider-registry.js +0 -29
- package/dist/registry/pinned-request-helper.js +0 -247
- package/dist/registry/pinned-transport.js +0 -717
- package/dist/sources/providers/index.js +0 -14
- package/dist/storage/engines/sqlite-migrations.js +0 -271
- package/dist/storage/repositories/canaries-repository.js +0 -107
- package/dist/storage/repositories/embedding-salvage-repository.js +0 -184
- package/dist/storage/repositories/registry-cache.js +0 -113
- package/dist/tasks/scheduler-sync-preview.js +0 -52
- package/dist/workflows/freeze/resolve-steps.js +0 -86
- package/dist/workflows/freeze/source-freeze.js +0 -64
- package/dist/workflows/ir/compile.js +0 -321
- package/dist/workflows/ir/environment-v4.js +0 -330
- package/dist/workflows/ir/freeze-v4.js +0 -153
- package/dist/workflows/ir/schema-v4.js +0 -745
- package/dist/workflows/ir/schema.js +0 -354
- package/dist/workflows/program/schema.js +0 -78
- package/dist/workflows/runtime/checkin.js +0 -57
- package/dist/workflows/runtime/plan-classifier.js +0 -196
- package/dist/workflows/runtime/unit-checkin.js +0 -45
- package/dist/workflows/runtime/unit-phases.js +0 -20
- package/dist/workflows/schema.js +0 -4
- package/dist/workflows/source-ir/compile.js +0 -200
- package/dist/workflows/source-ir/program.js +0 -50
- package/dist/workflows/source-ir/result.js +0 -26
- package/dist/workflows/source-ir/schema.js +0 -786
- package/dist/workflows/source-ir/triggers.js +0 -79
- package/dist/workflows/source-ir/uses.js +0 -40
- package/dist/workflows/validator.js +0 -60
package/docs/reference/cli.md
CHANGED
|
@@ -219,11 +219,11 @@ Build or refresh the search index.
|
|
|
219
219
|
|
|
220
220
|
```sh
|
|
221
221
|
akm index # Incremental (only changed directories)
|
|
222
|
-
akm index --full #
|
|
222
|
+
akm index --full # Re-drain every directory (keeps unchanged embeddings — see below)
|
|
223
223
|
akm index --verbose # Print phase progress to stderr
|
|
224
224
|
akm index --clean # Normal index + remove stale entries from the DB
|
|
225
225
|
akm index --clean --dry-run # Report stale entries without deleting
|
|
226
|
-
akm index --reembed #
|
|
226
|
+
akm index --reembed # Discard stored vectors and re-embed every entry
|
|
227
227
|
akm index --skip-if-locked # for scheduled/opportunistic runs: skip (exit 0) if a run is already in progress
|
|
228
228
|
```
|
|
229
229
|
|
|
@@ -254,25 +254,22 @@ Use `--clean` to resolve the edge case where a deleted file in an unchanged
|
|
|
254
254
|
directory lingers in the index across incremental runs. With `--dry-run`, reports
|
|
255
255
|
which entries would be removed without modifying the database.
|
|
256
256
|
|
|
257
|
-
**`--full`
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
apart from a genuine model change, and keeps the stored vectors when they
|
|
274
|
-
are still compatible; `--reembed` skips that check and forces a rebuild
|
|
275
|
-
regardless of what it would have decided.
|
|
257
|
+
**`--full` does not re-embed unchanged content:** a full run re-drains and
|
|
258
|
+
re-persists every directory, but entry ids are kept, so a vector stays
|
|
259
|
+
attached to its entry and only entries whose search text changed go back to
|
|
260
|
+
the embedding provider. An incremental run re-persists only the files that
|
|
261
|
+
changed.
|
|
262
|
+
|
|
263
|
+
**Embedding model changes:** every stored vector records the embedding model
|
|
264
|
+
it was generated under (`embedding.model` plus dimension for a remote
|
|
265
|
+
endpoint, the local model name otherwise). When the configured model
|
|
266
|
+
changes, the next `akm index` re-embeds entry by entry, committing each
|
|
267
|
+
batch; nothing is purged first, an interrupted run resumes where it
|
|
268
|
+
stopped, and search serves only vectors from the configured model in the
|
|
269
|
+
meantime.
|
|
270
|
+
|
|
271
|
+
**`--reembed` flag:** Discards every stored vector and re-embeds all entries
|
|
272
|
+
under the configured model.
|
|
276
273
|
|
|
277
274
|
**`--skip-if-locked` flag:** Every explicit `akm index` run acquires an
|
|
278
275
|
opt-in, PID-liveness-only rebuild lock and releases it on exit — this is
|
|
@@ -334,11 +331,10 @@ Returns a JSON object with:
|
|
|
334
331
|
| `semanticSearch` | Semantic search status: `mode`, `status`, and optional `reason`/`message` |
|
|
335
332
|
| `registries` | Configured registries |
|
|
336
333
|
| `sourceProviders` | Configured sources (filesystem, git, website, npm) |
|
|
337
|
-
| `indexStats` | Index stats: `entryCount`, `byType` (per-asset-type breakdown), `lastBuiltAt`, `hasEmbeddings
|
|
334
|
+
| `indexStats` | Index stats: `entryCount`, `byType` (per-asset-type breakdown), `lastBuiltAt`, `hasEmbeddings` |
|
|
338
335
|
|
|
339
336
|
`semanticSearch.status` values:
|
|
340
|
-
- `"ready-
|
|
341
|
-
- `"ready-js"` — pure JS fallback active (correct but slower at scale)
|
|
337
|
+
- `"ready-js"` — every entry has a vector; semantic search is active (the name is historical: `"ready-vec"`, the sqlite-vec variant, is gone)
|
|
342
338
|
- `"pending"` — not yet initialized (run `akm index` to set up)
|
|
343
339
|
- `"blocked"` — setup failed (see `reason` and `message` fields)
|
|
344
340
|
- `"disabled"` — semantic search is turned off in config
|
|
@@ -379,7 +375,7 @@ default agent engine, and summarizes recent `improve_*` events. Unless
|
|
|
379
375
|
to the `default-llm-engine` and every `configured-engines` LLM connection (and
|
|
380
376
|
an SDK engine's LLM fallback), one probe per distinct endpoint, checks the
|
|
381
377
|
installed akm-cli version against the latest GitHub release (`cli-version`),
|
|
382
|
-
|
|
378
|
+
runs the scheduler's recorded akm binary with `--version` to check it
|
|
383
379
|
against the running CLI (`scheduler-binary`).
|
|
384
380
|
|
|
385
381
|
Primary result fields:
|
|
@@ -387,9 +383,9 @@ Primary result fields:
|
|
|
387
383
|
| Field | Description |
|
|
388
384
|
| --- | --- |
|
|
389
385
|
| `status` | Overall health verdict: `pass`, `warn`, or `fail` |
|
|
390
|
-
| `hardChecks` | Deterministic checks such as `state-db-schema`, `state-db-round-trip`, `state-db-integrity`, `state-db-migrations`, `
|
|
386
|
+
| `hardChecks` | Deterministic checks such as `state-db-schema`, `state-db-round-trip`, `state-db-integrity`, `state-db-migrations`, `active-runs`, `default-engine`, `model-map-files`, `default-llm-engine`, `configured-engines`, and `active-improve-strategy` |
|
|
391
387
|
| `advisories` | Non-fatal warnings including `semantic-search-runtime`, `session-extraction` (akmExtract pipeline health), `cli-version` (installed vs latest release), `thinking-control` (an `enableThinking: false` engine whose recorded usage still shows reasoning tokens), and `engine-last-used` (an engine bound to an enabled improve process with no recorded use in 30 days) |
|
|
392
|
-
| `metrics` | Aggregate task/runtime metrics: `taskFailRate`, `agentFailureRate`, `stuckActiveRuns
|
|
388
|
+
| `metrics` | Aggregate task/runtime metrics: `taskFailRate`, `agentFailureRate`, `stuckActiveRuns` |
|
|
393
389
|
| `improve` | Recent improve-loop counts derived from `improve_invoked`, `improve_skipped`, and `improve_completed` events |
|
|
394
390
|
|
|
395
391
|
The `improve` section includes counts for planned refs, reflect/distill actions,
|
|
@@ -397,13 +393,13 @@ memory-prune actions, memory-inference writes, graph-extraction refreshes,
|
|
|
397
393
|
session-extraction outcomes (`sessionsScanned`, `sessionsExtracted`, `proposalsCreated`),
|
|
398
394
|
dead-URL detections, and skip reasons observed in the selected time window.
|
|
399
395
|
|
|
400
|
-
`state-db-migrations` reports
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
`status` instead of grepping akm's error text
|
|
396
|
+
`state-db-migrations` reports what `akm health`'s own open of `state.db`
|
|
397
|
+
applied. Every open applies pending migrations (copying the file to
|
|
398
|
+
`state.db.pre-<id>.bak` first when one drops schema), so the check passes and
|
|
399
|
+
names the applied IDs (`evidence.applied`) and the copy (`evidence.backupPath`).
|
|
400
|
+
It `fail`s only when a pending migration could not be applied — naming it and
|
|
401
|
+
pointing at `akm migrate apply` — rather than the command crashing. Read this
|
|
402
|
+
check's `status` instead of grepping akm's error text.
|
|
407
403
|
|
|
408
404
|
`default-llm-engine` and `configured-engines` probe reachability (not just
|
|
409
405
|
configuration) for a `kind: "llm"` engine — an unreachable endpoint is a hard
|
|
@@ -439,10 +435,8 @@ for an infrastructure reason (`llm_unavailable`, `read_failed`, `exception`,
|
|
|
439
435
|
The indexed entity graph (entities/relations extracted from bundle assets) has
|
|
440
436
|
no dedicated inspection command; its summary counts surface as an info-level
|
|
441
437
|
metric in `akm health`. Graph data is automatically re-extracted on the first
|
|
442
|
-
`akm improve` cycle after a `DB_VERSION` upgrade
|
|
443
|
-
|
|
444
|
-
`search.graphBoost.confidenceMode` and `search.graphBoost.confidenceWeight` in
|
|
445
|
-
[`docs/reference/configuration.md#search-tuning`](configuration.md#search-tuning).
|
|
438
|
+
`akm improve` cycle after a `DB_VERSION` upgrade. The graph backs `akm show`'s
|
|
439
|
+
`related` list and curate's support refs; it does not affect search ranking.
|
|
446
440
|
|
|
447
441
|
### search
|
|
448
442
|
|
|
@@ -499,6 +493,18 @@ query. The last case also adds one sanitized, endpoint-naming entry to
|
|
|
499
493
|
preserved by `--shape agent` so machine consumers can lower their confidence
|
|
500
494
|
instead of treating keyword fallback as healthy semantic ranking.
|
|
501
495
|
|
|
496
|
+
Ranking fuses two candidate lists by reciprocal rank (k = 60, equal weights):
|
|
497
|
+
BM25 over whole documents matching any non-stopword query word, and the
|
|
498
|
+
document vectors nearest to the query embedding, 100 candidates each. A hit's
|
|
499
|
+
`score` is its fused score, and equal scores are ordered by ref. The query is
|
|
500
|
+
embedded with the model's query template (see `embedding.queryTemplate` in
|
|
501
|
+
[`configuration.md`](configuration.md)); when the embedding takes longer than
|
|
502
|
+
`embedding.queryTimeoutMs` (default 3000) or fails, the search is served by
|
|
503
|
+
keyword ranking alone with `fts-fallback` and a warning. Filters (`--type`,
|
|
504
|
+
`--from`, `--filter`, `--belief`, the default session exclusion, proposed
|
|
505
|
+
quality) and one-hit-per-file deduplication narrow the fused list without
|
|
506
|
+
reordering it.
|
|
507
|
+
|
|
502
508
|
| Flag | Values | Default | Description |
|
|
503
509
|
| --- | --- | --- | --- |
|
|
504
510
|
| `--type` | `skill`, `command`, `agent`, `knowledge`, `instruction`, `workflow`, `script`, `memory`, `env`, `secret`, `lesson`, `task`, `session`, `fact`, `any` | `any` | Filter by asset type. Free-form and unvalidated — an unknown type returns no hits. Also accepts any adapter-defined type (e.g. `website`) — see [Bundle Types](bundle-types.md) for the open types each adapter emits. |
|
|
@@ -508,8 +514,7 @@ instead of treating keyword fallback as healthy semantic ranking.
|
|
|
508
514
|
| `--filter` | `<key>=<value>` | _(none)_ | Scope filter — repeatable. Valid keys: `user`, `agent`, `run`, `channel`. Example: `--filter user=alice --filter channel=ops`. Narrows the result set; ranking is unchanged. |
|
|
509
515
|
| `--include-proposed` | flag | `false` | Include entries with `quality: "proposed"` in the result set. Default search excludes them; `generated` and `curated` quality entries are always included. Unknown quality values warn once and remain searchable. |
|
|
510
516
|
| `--belief` | `all`, `current`, `historical` | `all` | Memory belief filter. `current` keeps active memory beliefs; `historical` keeps contradicted/superseded/archived ones. |
|
|
511
|
-
| `--no-
|
|
512
|
-
| `--track-usage`, `--no-track-usage` | flag | `true` | Record or suppress local usage-event and ranking updates for this successful read |
|
|
517
|
+
| `--track-usage`, `--no-track-usage` | flag | `true` | Record or suppress local usage events for this successful read |
|
|
513
518
|
| `--include-sessions` | flag | `false` | Include session assets, which are excluded from default results via `config.search.defaultExcludeTypes` |
|
|
514
519
|
| `--format` | `json`, `jsonl`, `yaml`, `text`, `md`, `html` | `json` | Output format |
|
|
515
520
|
| `--detail` | `brief`, `normal`, `full` | `brief` | Output verbosity level |
|
|
@@ -529,21 +534,12 @@ availability:
|
|
|
529
534
|
- **`ref`** -- The asset handle to pass to `akm show` (for example
|
|
530
535
|
`team//scripts/deploy.sh`); present at `brief`, `full`, and `agent` for local
|
|
531
536
|
hits
|
|
532
|
-
- **fragment provenance** -- when `ref` selects an indexed Markdown fragment,
|
|
533
|
-
`selectedRef` and `parentRef` distinguish the ranked evidence from its parent;
|
|
534
|
-
one-based `fragmentOrdinal`, `fragmentCount`, source-line bounds, neighbor
|
|
535
|
-
refs, and separate fragment/parent size estimates are available without
|
|
536
|
-
changing ranking. `estimatedTokens` describes the fragment for a
|
|
537
|
-
fragment-qualified hit; `parentEstimatedTokens` describes the whole asset.
|
|
538
537
|
- **`name`** -- The asset's filename or identifier; present at all levels
|
|
539
538
|
- **`origin`** -- The source bundle (e.g. `npm:@scope/pkg`), present only for
|
|
540
539
|
managed source assets; surfaced at `full` only
|
|
541
540
|
- **`id`** -- Registry-level identifier (registry hits only)
|
|
542
|
-
- **`
|
|
543
|
-
|
|
544
|
-
`relaxed` (OR/prefix-OR recovery). Omitted for hits with no FTS component
|
|
545
|
-
(e.g. a pure-semantic hybrid match) and for registry hits; surfaced at
|
|
546
|
-
`normal`, `full`, and `--shape agent`
|
|
541
|
+
- **`whyMatched`** -- The hit's rank in each candidate list that returned
|
|
542
|
+
it (`lexical rank 3`, `vector rank 12`); surfaced at `full`
|
|
547
543
|
|
|
548
544
|
The default brief shape is intentionally small. The exact field set per
|
|
549
545
|
detail level (and per `--shape`) is authoritative in
|
|
@@ -553,9 +549,9 @@ assembled into the shape registry by the `src/output/shapes.ts` barrel:
|
|
|
553
549
|
| Level | Local bundle hits | Registry hits |
|
|
554
550
|
| --- | --- | --- |
|
|
555
551
|
| `brief` (default) | `type`, `name`, `ref`, `action`, `estimatedTokens` | `name`, `installRef`, `score` |
|
|
556
|
-
| `normal` | `type`, `name`, `description`, `action`, `score`, `estimatedTokens`, optional `warnings`/`quality`/`keys
|
|
557
|
-
| `full` | full hit object (includes `ref`, `origin`, `tags`, `whyMatched`, optional `warnings`, optional `quality`,
|
|
558
|
-
| `--shape agent` | `name`, `ref`, `type`, `path`, `editable`, conditional `editHint`, `description`, `action`, `score`, optional `estimatedTokens`/`keys
|
|
552
|
+
| `normal` | `type`, `name`, `description`, `action`, `score`, `estimatedTokens`, optional `warnings`/`quality`/`keys` | `name`, `description`, `action`, `installRef`, `score`, optional `warnings` |
|
|
553
|
+
| `full` | full hit object (includes `ref`, `origin`, `tags`, `whyMatched`, optional `warnings`, optional `quality`, timings, bundle metadata) | full hit object |
|
|
554
|
+
| `--shape agent` | `name`, `ref`, `type`, `path`, `editable`, conditional `editHint`, `description`, `action`, `score`, optional `estimatedTokens`/`keys` | no local access fields |
|
|
559
555
|
|
|
560
556
|
`--shape summary` is **not valid on `search`** — see
|
|
561
557
|
[`--shape summary`](#--shape-summary) above; it is a usage error (exit 2)
|
|
@@ -594,18 +590,18 @@ akm curate "learn the release workflow" --from all --format text
|
|
|
594
590
|
| `--type` | `skill`, `command`, `agent`, `knowledge`, `instruction`, `workflow`, `script`, `memory`, `env`, `secret`, `lesson`, `task`, `session`, `fact`, `any` | `any` | Filter curated results by asset type |
|
|
595
591
|
| `--limit` | number | `4` | Maximum curated results |
|
|
596
592
|
| `--from` | `local`, `registry`, `all` | `local` | Where to search before curating |
|
|
597
|
-
| `--track-usage`, `--no-track-usage` | flag | `true` | Record or suppress local usage
|
|
598
|
-
|
|
599
|
-
`akm curate`
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
593
|
+
| `--track-usage`, `--no-track-usage` | flag | `true` | Record or suppress local usage events for this successful read |
|
|
594
|
+
|
|
595
|
+
`akm curate` takes the top `--limit` hits of one search, in search order, and
|
|
596
|
+
enriches each with a preview, run details and up to two graph-related support
|
|
597
|
+
refs. With `search.curateRerank.enabled`, a cross-encoder first reorders the
|
|
598
|
+
top 30 fused candidates (`search.curateRerank.topN`) by name, description and
|
|
599
|
+
the start of each asset's indexed content. Curate includes direct follow-up
|
|
600
|
+
commands such as `akm show <ref>` or `akm bundle add <ref>` so you can
|
|
601
|
+
immediately inspect or install what it found.
|
|
605
602
|
`--detail` and `--shape agent` both work on curate output; `--shape summary`
|
|
606
603
|
does not.
|
|
607
|
-
Curate preserves the underlying `searchMode` and
|
|
608
|
-
warnings across its full-query and token-fallback searches.
|
|
604
|
+
Curate preserves the underlying search's `searchMode` and warnings.
|
|
609
605
|
Agent-shaped local items include `ref`, `path`, and `editable`, plus `editHint`
|
|
610
606
|
only for read-only items. Their `followUp` remains `akm show <ref>` rather than
|
|
611
607
|
being replaced by clone guidance.
|
|
@@ -615,8 +611,7 @@ individual scripts, skills, or docs.
|
|
|
615
611
|
every prompt: it only ever reads the index as it currently stands (the same
|
|
616
612
|
non-blocking `ensureIndex()` path `search` uses) and never waits on or
|
|
617
613
|
contends with a full `akm index` rebuild in progress.
|
|
618
|
-
Use `--no-track-usage` when this inspection must not
|
|
619
|
-
ranking signals.
|
|
614
|
+
Use `--no-track-usage` when this inspection must not record usage events.
|
|
620
615
|
|
|
621
616
|
### show
|
|
622
617
|
|
|
@@ -624,8 +619,8 @@ Display an asset by ref. On a markdown document `#fragment` selects one
|
|
|
624
619
|
section by heading slug (falling back to case-insensitive heading text); an
|
|
625
620
|
unmatched fragment lists the available slugs.
|
|
626
621
|
|
|
627
|
-
Successful reads record local usage
|
|
628
|
-
`--no-track-usage` to suppress
|
|
622
|
+
Successful reads record local usage events by default; pass
|
|
623
|
+
`--no-track-usage` to suppress them.
|
|
629
624
|
|
|
630
625
|
```sh
|
|
631
626
|
akm show scripts/deploy.sh
|
|
@@ -655,7 +650,7 @@ akm show memories/retro --filter user=alice --filter agent=claude
|
|
|
655
650
|
| `--max-chars` | positive integer | `3200` for `lead` | Hard contextual content budget in characters; requires `--context lead` and is mutually exclusive with `--max-tokens`. |
|
|
656
651
|
| `--max-tokens` | positive integer | _(none)_ | Approximate contextual budget using four characters per token; requires `--context lead` and is mutually exclusive with `--max-chars`. |
|
|
657
652
|
| `--filter` | `<key>=<value>` | _(none)_ | Repeatable scope filter (`user`, `agent`, `run`, `channel`). |
|
|
658
|
-
| `--track-usage`, `--no-track-usage` | flag | `true` | Record or suppress local usage
|
|
653
|
+
| `--track-usage`, `--no-track-usage` | flag | `true` | Record or suppress local usage events for this successful read. |
|
|
659
654
|
|
|
660
655
|
`meta` is not an asset type — `[<origin>//]meta[:<name>]` direct-reads a
|
|
661
656
|
human-authored orientation doc from a bundle's optional `.meta/` directory
|
|
@@ -816,7 +811,7 @@ The old `--params <json>` bag is removed.
|
|
|
816
811
|
| `--max-retries <n>` | When a step fails, reopen the same run and retry the failed step up to this many additional times. Range: 0 through 100; default 0. Gate rejection and interruption are not retried. |
|
|
817
812
|
| `--timeout <duration>` | Abort the whole invocation after `N`, `Nms`, `Ns`, or `Nm`; bare `N` is milliseconds. The active step remains resumable. |
|
|
818
813
|
| `--new` | Start a fresh run even when one is already active for this ref, instead of resuming it. The existing active run is left untouched — it is never abandoned automatically. A workflow ref only: passing a run id with `--new` is a usage error (exit 2). Parameter flags are allowed together with `--new`, since it is starting a new run. |
|
|
819
|
-
| `--skip-if-locked` | If another akm process already
|
|
814
|
+
| `--skip-if-locked` | If another akm process is already driving this run (it holds the run's lock file: `RUN_LEASE_HELD`), or `state.db` is busy with another writer (`STATE_DB_CONTENDED`), skip gracefully (exit 0) instead of failing (exit 75, `TransientError`). The envelope reports `{ skipped: { reason: "lock-held" \| "state-db-contended", message } }`. Every other failure (a bad flag, an unresolvable target) still fails loudly regardless of this flag. Use for high-frequency scheduled runs so they don't pile up failures while a longer-running invocation is in progress — same family as `improve --skip-if-locked`. |
|
|
820
815
|
|
|
821
816
|
**Resuming an active run is announced, not silent.** Passing a ref that
|
|
822
817
|
already has an active run in the current scope resumes that run rather than
|
|
@@ -941,8 +936,8 @@ Two output modes:
|
|
|
941
936
|
- **`--format json`**: the full envelope — `ok`, `ref`, `title`,
|
|
942
937
|
`sourceFormat`, `sourcePath`, `irVersion`, `planHash`, `published` (always
|
|
943
938
|
`false`, so a consumer can never mistake this for a run envelope),
|
|
944
|
-
`execution`, `budget?`, `params?`, `outputs?`, `steps[]`, `
|
|
945
|
-
`
|
|
939
|
+
`execution`, `budget?`, `params?`, `outputs?`, `steps[]`, `notices[]`,
|
|
940
|
+
`warnings[]`. Each step entry carries an `expansion` field
|
|
946
941
|
naming how its target was reached: `{via: "direct"}`, `{via: "task",
|
|
947
942
|
taskRef}`, or — for a step composing a child workflow —
|
|
948
943
|
`{via: "child", childRef, childPlanHash, childOutputs, steps[]}` with the
|
|
@@ -1038,7 +1033,7 @@ akm bundle add https://docs.example.com --max-pages 100 --max-depth 5
|
|
|
1038
1033
|
|
|
1039
1034
|
| Flag | Description |
|
|
1040
1035
|
| --- | --- |
|
|
1041
|
-
| `--name` |
|
|
1036
|
+
| `--name` | The bundle key. A contract, not a hint: it must be a legal bundle slug (no `:` `.` `#` `/` or whitespace) and not already taken by a different bundle, or the add fails before any write. Re-adding an already-installed source under a different `--name` than it already carries also fails — use `akm bundle rename <old> <new>` instead. Omit it and akm derives a name (falling back to a `-<hash>` suffix on a collision). |
|
|
1042
1037
|
| `--provider` | Explicit provider for declarative source configuration; normally inferred from the input |
|
|
1043
1038
|
| `--writable` | Mark a git source as writable so `akm sync` also pushes (default: false) |
|
|
1044
1039
|
| `--options` | Provider options as JSON (e.g. `'{"ref":"main"}'`) |
|
|
@@ -1209,6 +1204,42 @@ in `processed`/`plainSynced`; rejected entries report `status: "blocked"` and a
|
|
|
1209
1204
|
security code; provider or transaction errors report `status: "failed"`. The
|
|
1210
1205
|
command continues with later bundles without half-publishing a blocked one.
|
|
1211
1206
|
|
|
1207
|
+
### bundle rename
|
|
1208
|
+
|
|
1209
|
+
Rename a configured bundle's key everywhere akm itself persists it — the one
|
|
1210
|
+
command allowed to change it (renaming by hand-editing `config.json`'s
|
|
1211
|
+
`bundles` key strands every durable ref the tool minted under the old id; see
|
|
1212
|
+
`akm health` / the startup warning that names this).
|
|
1213
|
+
|
|
1214
|
+
```sh
|
|
1215
|
+
akm bundle rename old-name new-name
|
|
1216
|
+
akm bundle rename old-name new-name --dry-run # Show the plan; write nothing
|
|
1217
|
+
```
|
|
1218
|
+
|
|
1219
|
+
| Flag | Description |
|
|
1220
|
+
| --- | --- |
|
|
1221
|
+
| `--dry-run` | Report what would change (index/state row counts, scheduler refs, content files that still mention the old name) without writing anything |
|
|
1222
|
+
|
|
1223
|
+
`<new>` must be a legal, unused bundle slug (the same `--name` contract `akm
|
|
1224
|
+
bundle add` enforces) or the rename fails before any write. Rewritten: the
|
|
1225
|
+
config `bundles` key; `defaultBundle`/`defaultWriteTarget` when they name the
|
|
1226
|
+
old id; every `scheduler.enabled[].ref` with the old `<old>//` prefix; the
|
|
1227
|
+
lockfile entry id; every indexed entry's `bundle_id`/ref; and this tool's own
|
|
1228
|
+
state rows that name the old bundle (`proposals.ref`, a pending proposal's
|
|
1229
|
+
write target, and workflow `task_history.target_ref`). Reported, never
|
|
1230
|
+
rewritten: refs inside the bundle's own CONTENT (cross-references, `uses:` in
|
|
1231
|
+
a task, `supersededBy`) — the result's `contentRefs` lists the indexed files
|
|
1232
|
+
that still spell the old `<old>//` prefix so you can fix them by hand. A real
|
|
1233
|
+
run also re-syncs native scheduler bindings under the new name (`taskSync` in
|
|
1234
|
+
the result reports the outcome, never thrown, since config/index/state are
|
|
1235
|
+
already renamed by then). `taskSync.ok` is `false` both when the sync call
|
|
1236
|
+
itself fails and when it comes back reporting one or more
|
|
1237
|
+
`taskSync.result.failures` — a binding that failed to prepare has already
|
|
1238
|
+
lost its old native row and stays unscheduled until you re-run
|
|
1239
|
+
`akm task sync`; `--dry-run` lists the installed native rows that still name
|
|
1240
|
+
the old bundle (`nativeSchedulerRows`) so you can see what that sync will
|
|
1241
|
+
replace.
|
|
1242
|
+
|
|
1212
1243
|
### upgrade
|
|
1213
1244
|
|
|
1214
1245
|
Upgrade `akm` itself to the latest release. Standalone binaries are downloaded,
|
|
@@ -1432,7 +1463,7 @@ akm remember "Deployment needs VPN access" --bundle team-bundle
|
|
|
1432
1463
|
| `--expires <dur>` | Expiry shorthand (`30d`, `12h`, `6m`). Resolved to an ISO date |
|
|
1433
1464
|
| `--source <s>` | Free-form source reference — URL, asset ref, file path, or any string |
|
|
1434
1465
|
| `--xref <ref>` | Cross-reference ref recorded in the memory's `xrefs:` frontmatter list. Repeatable: `--xref knowledge/auth-flow --xref memories/vpn-note`. Each ref must resolve in the write target or a configured source (read-only sources count); an unresolvable ref fails with exit 2 before anything is written. More than 5 refs warns (soft cap) but still writes. Does not trigger the tags-required check. |
|
|
1435
|
-
| `--supersedes <ref>` | Ref of an existing asset this memory corrects. Repeatable. Writes the correction with the old ref folded into its `xrefs:` (correction provenance) AND demotes the old asset — `beliefState: superseded` + `supersededBy: [<new ref>]`, a metadata-only frontmatter edit that preserves every other key and the body — then reindexes it so
|
|
1466
|
+
| `--supersedes <ref>` | Ref of an existing asset this memory corrects. Repeatable. Writes the correction with the old ref folded into its `xrefs:` (correction provenance) AND demotes the old asset — `beliefState: superseded` + `supersededBy: [<new ref>]`, a metadata-only frontmatter edit that preserves every other key and the body — then reindexes it so `--belief current` hides the stale version immediately. An unresolvable ref fails with exit 2 before anything is written or demoted; so does a ref naming the asset being written itself (a correction cannot supersede itself, e.g. `--force` overwriting the same name). A ref that resolves only outside the write target and the working bundle still writes the correction but skips the demotion: stderr warns and the JSON output reports `superseded: [{ref, applied: false, reason}]` — the reason names the `--bundle` remedy when the old asset lives in a configured writable source. An old asset whose existing frontmatter is not parseable YAML is skipped the same way (`applied: false`) instead of being rewritten lossily. Re-running the same correction is idempotent. On a git write target the correction and the demoted old asset land in the same single boundary commit. |
|
|
1436
1467
|
| `--auto` | Apply heuristic tagging from the body (opt-in, zero-latency, pure TS) |
|
|
1437
1468
|
| `--enrich` | Call the configured LLM for tag/description proposals (opt-in, 10s timeout, fails soft) |
|
|
1438
1469
|
| `--user <id>` | Scope this memory to a user id. Persisted as the canonical `scope_user` frontmatter key. |
|
|
@@ -1565,9 +1596,9 @@ akm feedback skills/code-review --negative --reason "flaky" --tag slice:train --
|
|
|
1565
1596
|
Specify exactly one of `--positive` or `--negative`. The ref must already be
|
|
1566
1597
|
present in the current local index.
|
|
1567
1598
|
|
|
1568
|
-
The `--applied-to` flag
|
|
1569
|
-
|
|
1570
|
-
|
|
1599
|
+
The `--applied-to` flag records the lesson-strength signal: each credit is
|
|
1600
|
+
kept in the lesson's `lessonStrength[]` frontmatter. Search ranking does not
|
|
1601
|
+
use it.
|
|
1571
1602
|
|
|
1572
1603
|
### log
|
|
1573
1604
|
|
|
@@ -1671,27 +1702,25 @@ wrapper over the standalone `akm-migrate` executable (installed alongside
|
|
|
1671
1702
|
akm has ever written so the CLI proper reads only current schemas. The steps,
|
|
1672
1703
|
in order:
|
|
1673
1704
|
|
|
1674
|
-
1.
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
(`configSchedulerSourceIds`);
|
|
1682
|
-
4. pending `state.db` migrations, historical-destructive ones included, with
|
|
1705
|
+
1. config.json rewritten in its current shape (`configFile`): retired and
|
|
1706
|
+
unknown keys dropped, legacy `extraParams` lifted onto first-class engine
|
|
1707
|
+
fields, the legacy `stashDir`/`sources[]`/`installed` layout converted to
|
|
1708
|
+
`bundles`/`defaultBundle`, `configVersion` bumped — the same pipeline
|
|
1709
|
+
every load already runs in memory, so this only persists it, under a
|
|
1710
|
+
backup;
|
|
1711
|
+
2. pending `state.db` migrations, historical-destructive ones included, with
|
|
1683
1712
|
a verified sibling safety copy (`stateMigrations`) — the only path besides
|
|
1684
1713
|
`akm upgrade` that admits released migration 018, which an ordinary
|
|
1685
1714
|
command refuses;
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
`$
|
|
1715
|
+
3. task files at version 2 or 3, and version 4 files still carrying the
|
|
1716
|
+
retired `schedule[].enabled` key, rewritten as task source v4
|
|
1717
|
+
(`taskFiles`) under one backup directory per run, each emitted document
|
|
1718
|
+
re-parsed by the runtime v4 parser first; a file the planner cannot
|
|
1719
|
+
convert unambiguously is reported `blocked` and left alone;
|
|
1720
|
+
4. superseded residue removed (`deadResidue`): pre-0.9.0 `.akm` leftovers in
|
|
1721
|
+
the stash, and the transaction-journal, maintenance-barrier, lock-mutex and
|
|
1722
|
+
version-stamp files older releases kept under `$DATA`, `$STATE` and
|
|
1723
|
+
`$CONFIG`.
|
|
1695
1724
|
|
|
1696
1725
|
```sh
|
|
1697
1726
|
akm migrate status
|
|
@@ -1710,6 +1739,16 @@ blocked-reason table and worked examples, and
|
|
|
1710
1739
|
[Bundling akm](../integration/bundling-akm.md) for the plan JSON shape and
|
|
1711
1740
|
how to drive this from a container/image boot step.
|
|
1712
1741
|
|
|
1742
|
+
Each step above runs under its own catch: a step's own anomaly is always
|
|
1743
|
+
recorded in the plan's `failedSteps: [{step, error}]` instead of ending the
|
|
1744
|
+
whole run — the remaining steps still run in order. Under `apply`, a failed
|
|
1745
|
+
step's section falls back to its read-only preview; if that fails too, the
|
|
1746
|
+
fallback adds its own `failedSteps` entry, and the section is absent from the
|
|
1747
|
+
plan. Any `failedSteps` entry
|
|
1748
|
+
forces `status: "blocked"` and adds a matching line to `blockers`, so
|
|
1749
|
+
`akm migrate status|apply` reports the plan and exits 1 (not the internal-error
|
|
1750
|
+
70) the same way it does for any other blocked plan.
|
|
1751
|
+
|
|
1713
1752
|
### config
|
|
1714
1753
|
|
|
1715
1754
|
Read and write configuration. Bare `akm config` (no subcommand) is a usage
|
|
@@ -2383,10 +2422,14 @@ akm improve report --since 7d # ...aggregated over every real run start
|
|
|
2383
2422
|
`akm improve` is the public entrypoint for whole-bundle, type-scoped, and
|
|
2384
2423
|
ref-scoped improvement. It owns the memory-cleanup and lesson-distillation
|
|
2385
2424
|
flow. A qualified scope such as `team//skills/code-review` selects that bundle;
|
|
2386
|
-
a different explicit `--bundle` is a usage error.
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2425
|
+
a different explicit `--bundle` is a usage error.
|
|
2426
|
+
|
|
2427
|
+
Every stage records what it did with each asset in the improve ledger
|
|
2428
|
+
(`improve_ledger` in `state.db`) and reads it before any model call: an asset
|
|
2429
|
+
whose proposal was rejected waits 14 days (reflect), 30 days (distill) or 7
|
|
2430
|
+
days (other stages) before it is tried again; an expired proposal waits one
|
|
2431
|
+
day; an asset a stage looked at and left unchanged is revisited after 7 days,
|
|
2432
|
+
or as soon as new feedback (or, for consolidation, an edit) arrives.
|
|
2390
2433
|
|
|
2391
2434
|
Built-in `default` and `frequent` leave the improve-stage extract process off,
|
|
2392
2435
|
and `default` plus `reflect-distill` leave proactive maintenance off. Use the
|
|
@@ -2490,7 +2533,7 @@ default probe-on behavior) to check whether a named engine actually answers.
|
|
|
2490
2533
|
builds the exact prompt reflect would send for one asset — the same source
|
|
2491
2534
|
resolution, runner selection, feedback/schema-hint/related-lesson/rejected-
|
|
2492
2535
|
proposal gathering `akm improve`'s live reflect step uses — and prints it
|
|
2493
|
-
without
|
|
2536
|
+
without reading a credential, so it never calls an engine. Add
|
|
2494
2537
|
`--format text` (the default JSON/yaml envelope escapes the prompt into one
|
|
2495
2538
|
line, which defeats a by-eye read) to confirm by eye that recent feedback is
|
|
2496
2539
|
framed as an unverified report to investigate (never a fact to insert
|
|
@@ -2498,9 +2541,7 @@ verbatim) and that the response contract tells the model never to emit the
|
|
|
2498
2541
|
truncation marker or any content from outside the shown asset.
|
|
2499
2542
|
|
|
2500
2543
|
When reinforced facts need promotion, `knowledge` is the higher-authority
|
|
2501
|
-
destination than `memory`.
|
|
2502
|
-
`knowledge` over `memory` hits, including inferred `.derived` memories, when
|
|
2503
|
-
the evidence is otherwise comparable.
|
|
2544
|
+
destination than `memory`.
|
|
2504
2545
|
|
|
2505
2546
|
#### improve report
|
|
2506
2547
|
|
|
@@ -2786,27 +2827,27 @@ requires `--reason`.
|
|
|
2786
2827
|
|
|
2787
2828
|
#### proposal drain
|
|
2788
2829
|
|
|
2789
|
-
Drain the standing pending-proposal backlog
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2830
|
+
Drain the standing pending-proposal backlog instead of adjudicating proposals
|
|
2831
|
+
one at a time. One rule decides each proposal: a proposal whose quality judge
|
|
2832
|
+
passed on its current content is accepted (unless its target changed since it
|
|
2833
|
+
was minted — that one is auto-rejected as `stale-target`); an empty diff is
|
|
2834
|
+
rejected; everything else goes to the judgment tier when one is enabled, and
|
|
2835
|
+
is otherwise left for review. Default mode stages decisions (queue mode); pass
|
|
2836
|
+
`--promote` to actually accept.
|
|
2793
2837
|
|
|
2794
2838
|
```sh
|
|
2795
2839
|
akm proposal drain --dry-run # Preview without writing
|
|
2796
|
-
akm proposal drain --
|
|
2797
|
-
akm proposal drain --
|
|
2798
|
-
akm proposal drain --max-diff-lines 50 --older-than 7 --promote -y
|
|
2840
|
+
akm proposal drain --promote -y
|
|
2841
|
+
akm proposal drain --max-accepts 10 --older-than 7 --promote -y
|
|
2799
2842
|
akm proposal drain --strategy default --promote -y # Read the triage block from an improve strategy
|
|
2800
2843
|
```
|
|
2801
2844
|
|
|
2802
2845
|
| Flag | Description |
|
|
2803
2846
|
| --- | --- |
|
|
2804
|
-
| `--
|
|
2805
|
-
| `--
|
|
2806
|
-
| `--promote` | Promote (accept) matching proposals. Default is queue mode — stage only, no writes to assets. |
|
|
2847
|
+
| `--strategy` | Read the triage block (apply mode, ceilings, judgment) from this improve strategy instead |
|
|
2848
|
+
| `--promote` | Promote (accept) judge-passed proposals. Default is queue mode — stage only, no writes to assets. |
|
|
2807
2849
|
| `--dry-run` | List what would be accepted/rejected/deferred, without writing |
|
|
2808
2850
|
| `--max-accepts` | Hard per-run accept ceiling; accepts beyond this are reported as `skippedByCap` |
|
|
2809
|
-
| `--max-diff-lines` | Defer (never promote) accepts whose proposed content exceeds this many lines |
|
|
2810
2851
|
| `--older-than` | Only consider proposals created more than this many days ago |
|
|
2811
2852
|
| `--judgment` | Explicitly enable the judgment tier for this standalone drain, including when the selected strategy says `judgment.enabled: false`; execution overrides still come from that strategy. Without this flag, strategy judgment config does not enable standalone drain judgment. A missing runner remains a no-op with a logged `triage_deferred` summary. |
|
|
2812
2853
|
| `-y`, `--yes` | Skip the confirmation prompt (required in non-interactive mode for promotion) |
|
|
@@ -2855,10 +2896,10 @@ akm task prune --yes # Remove every currently-computed or
|
|
|
2855
2896
|
akm task prune --id ghost,stale --yes # Remove only the named orphan ids
|
|
2856
2897
|
```
|
|
2857
2898
|
|
|
2858
|
-
`task add` also accepts `--disabled` (
|
|
2859
|
-
scheduler), `--force` (overwrite an existing task with
|
|
2860
|
-
`--rebind` (
|
|
2861
|
-
|
|
2899
|
+
`task add` also accepts `--disabled` (write the task but leave its ref out of
|
|
2900
|
+
this host's scheduler activation), `--force` (overwrite an existing task with
|
|
2901
|
+
the same id), and `--rebind` (also point the bundle's installed scheduler rows
|
|
2902
|
+
at this akm invocation, as `akm task sync --rebind` does).
|
|
2862
2903
|
|
|
2863
2904
|
`akm task list [<query>] [--limit <n>] [--from local|registry|all]` is a
|
|
2864
2905
|
pure alias for `akm search --type task` with the query, `--limit`, and
|
|
@@ -2902,17 +2943,33 @@ time. Each run is recorded as a row in the durable `task_history` table
|
|
|
2902
2943
|
no `task_invoked`/`task_completed` event type on the `akm log` stream.
|
|
2903
2944
|
|
|
2904
2945
|
Task source cannot enable itself. `akm task enable <fully-qualified-ref>` adds
|
|
2905
|
-
|
|
2906
|
-
`scheduler.enabled` config and
|
|
2907
|
-
syncs that bundle; `akm task disable` removes it and unschedules the task.
|
|
2946
|
+
the ref to this host's `scheduler.enabled` list and syncs that bundle; `akm task disable` removes it and unschedules the task.
|
|
2908
2947
|
Manual `akm task run` remains available. To remove a task, delete its file
|
|
2909
2948
|
(`<bundle>/tasks/<id>.yml`) and run `akm task sync` — sync uninstalls the
|
|
2910
2949
|
orphaned scheduler entry.
|
|
2911
2950
|
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2951
|
+
A config with no `scheduler.enabled` list at all (written before 0.9.17)
|
|
2952
|
+
means "keep what is installed": `akm task sync` takes the akm-written rows
|
|
2953
|
+
already in the scheduler as this host's choice and writes the list; an
|
|
2954
|
+
explicit list is never second-guessed. `akm task sync --dry-run` prints the
|
|
2955
|
+
planned adds/updates/removes (removals carry their owning bundle) without
|
|
2956
|
+
touching the scheduler — zero writes. Exits non-zero when removals are pending, so it can
|
|
2957
|
+
gate a CI/health check on "sync would change something."
|
|
2958
|
+
|
|
2959
|
+
`sync`'s (and `sync --dry-run`'s) result always carries `failures: [{path,
|
|
2960
|
+
ref?, reason}]` — one entry per item sync could not reconcile: a task/workflow
|
|
2961
|
+
source that failed to parse or prepare (its installed row is left as it is),
|
|
2962
|
+
two sources claiming the same scheduler id, a desired binding whose id is
|
|
2963
|
+
already scheduled from a different bundle or installation, a row whose
|
|
2964
|
+
install or removal failed, or — for an unscoped, multi-bundle sync — a whole
|
|
2965
|
+
bundle whose sources could not be read. Every one of these is a per-item
|
|
2966
|
+
failure: the item is left exactly as it was and reported here, while every
|
|
2967
|
+
OTHER item and bundle in the same sync still reconciles; with `--bundle`,
|
|
2968
|
+
that one bundle IS the whole sync, so a bundle that cannot be read raises
|
|
2969
|
+
instead of being reported here. `failures` is empty on a fully clean sync; a
|
|
2970
|
+
non-empty `failures` still exits non-zero, same as a pending removal. A
|
|
2971
|
+
crontab whose akm markers are malformed is refused unmodified, and another
|
|
2972
|
+
akm process holding the scheduler lock makes sync exit 75 (retry shortly).
|
|
2916
2973
|
|
|
2917
2974
|
`akm task prune` reclaims installed scheduler entries that `sync` can never
|
|
2918
2975
|
clean up on its own: entries whose own `--scheduler-context` descriptor no
|