akm-cli 0.9.30 → 0.10.261001-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +438 -0
- package/README.md +10 -10
- package/ROADMAP.md +112 -0
- package/STABILITY.md +99 -57
- 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 +15 -29
- package/dist/assets/hints/cli-hints-short.md +2 -2
- package/dist/assets/improve-strategies/default.json +3 -3
- package/dist/assets/prompts/consolidate-pair.md +9 -7
- package/dist/assets/stash-skeleton/README.md +1 -1
- package/dist/assets/tasks/improve/akm-improve-consolidate.yml +1 -1
- 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/feedback-cli.js +75 -49
- 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/chunking.js +3 -10
- package/dist/commands/improve/consolidate/continuity-check.js +4 -4
- package/dist/commands/improve/consolidate/pair-pass.js +29 -10
- package/dist/commands/improve/consolidate.js +10 -65
- 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 +148 -21
- package/dist/commands/improve/eligibility.js +14 -1
- package/dist/commands/improve/extract-cli.js +1 -1
- package/dist/commands/improve/extract-prompt.js +17 -7
- package/dist/commands/improve/extract.js +5 -7
- package/dist/commands/improve/improve-cli.js +125 -118
- package/dist/commands/improve/improve-strategies.js +8 -12
- package/dist/commands/improve/improve.js +134 -52
- package/dist/commands/improve/loop-stages.js +18 -5
- 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 +29 -34
- package/dist/commands/improve/retrieval-queries.js +37 -0
- package/dist/commands/improve/retrieval-scope.js +2 -2
- package/dist/commands/improve/salience.js +2 -9
- package/dist/commands/improve/session-asset.js +4 -1
- package/dist/commands/improve/stage.js +23 -12
- package/dist/commands/lint/index.js +5 -20
- package/dist/commands/observability-cli.js +3 -9
- package/dist/commands/proposal/drain.js +43 -6
- package/dist/commands/proposal/proposal-cli.js +11 -31
- package/dist/commands/proposal/repository.js +20 -14
- package/dist/commands/proposal/validators/proposal-quality-validators.js +0 -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 +6 -14
- 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 +10 -63
- 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 +12 -7
- package/dist/core/improve-result.js +13 -1
- package/dist/core/mutation-target.js +2 -2
- package/dist/core/paths.js +4 -0
- package/dist/core/recognition-util.js +4 -5
- package/dist/core/run-lock.js +1 -1
- package/dist/core/subprocess.js +49 -0
- 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/indexer.js +15 -6
- package/dist/indexer/passes/memory-inference.js +15 -6
- package/dist/indexer/search/db-search.js +49 -36
- package/dist/indexer/search/fts-query.js +0 -19
- package/dist/indexer/search/ranking.js +29 -1
- package/dist/indexer/usage/usage-events.js +21 -16
- 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 +254 -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 +15769 -16731
- package/dist/scripts/akm-migrate.js +16339 -17297
- 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/sources/providers/git-stash.js +94 -13
- package/dist/storage/repositories/index-utility-repository.js +2 -32
- package/dist/storage/repositories/index-vec-repository.js +4 -0
- 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/run-command-task.js +9 -1
- package/dist/tasks/run/run-workflow-task.js +4 -3
- package/dist/tasks/run/task-history.js +0 -2
- package/dist/tasks/run/task-log.js +38 -1
- 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/0.10-process-rules.md +827 -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 +479 -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 +719 -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 +323 -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 +247 -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 +131 -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 +135 -0
- package/docs/migration/README.md +4 -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.10.0.md +201 -0
- 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 +28 -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/migration/v0.9-to-v0.10.md +507 -0
- 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 +163 -192
- package/docs/reference/configuration.md +101 -20
- package/docs/reference/data-and-telemetry.md +2 -2
- 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/prompts/retrieval-relevance-judge.md +0 -6
- 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/improve/retrieval-gate.js +0 -132
- package/dist/commands/tasks/validate.js +0 -176
- package/dist/core/config/legacy-source-shape-shim.js +0 -117
- package/dist/indexer/feedback/utility-policy.js +0 -75
- 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
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# Use AKM With Any Agent
|
|
2
|
+
|
|
3
|
+
AKM works from any shell-capable coding agent — Claude Code, OpenCode, Cursor,
|
|
4
|
+
Windsurf, Aider, and others. No plugins or SDKs are required for the core
|
|
5
|
+
workflow: a three-line system prompt block plus shell access is all an agent
|
|
6
|
+
needs to start using your bundle.
|
|
7
|
+
|
|
8
|
+
## AGENTS.md / CLAUDE.md snippet
|
|
9
|
+
|
|
10
|
+
Add this block to your `AGENTS.md`, `CLAUDE.md`, or system prompt. It tells
|
|
11
|
+
the agent that `akm` is available and how to discover it.
|
|
12
|
+
|
|
13
|
+
```markdown
|
|
14
|
+
## Resources & Capabilities
|
|
15
|
+
|
|
16
|
+
You have access to a searchable library of scripts, skills, commands, agents,
|
|
17
|
+
knowledge, workflows, env files, secrets, lessons, memories, tasks, sessions,
|
|
18
|
+
and facts via the `akm` CLI. Use `akm -h` for details.
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
That is the minimum. The agent can then run `akm curate <task>` at the start
|
|
22
|
+
of any complex task to pull the most relevant assets into context, and
|
|
23
|
+
`akm show <ref>` to load any asset by ref.
|
|
24
|
+
|
|
25
|
+
For a longer, agent-facing instruction block — usage patterns, flag guidance,
|
|
26
|
+
the full ref format — generate one instead of hand-writing it:
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
akm hints --detail brief >> AGENTS.md
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The output is stable across patch releases and designed for agents rather
|
|
33
|
+
than humans: it describes the lookup workflow (`curate` → `show` →
|
|
34
|
+
`feedback`) and explains how refs work. It prints a short guide by default;
|
|
35
|
+
pass `--full` for the complete one.
|
|
36
|
+
|
|
37
|
+
## The retrieval loop: curate, show, feedback
|
|
38
|
+
|
|
39
|
+
Once an agent knows `akm` is available, the working pattern is always the
|
|
40
|
+
same three calls:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
# 1. Curate assets for the current task
|
|
44
|
+
akm curate "deploy to production" --limit 3
|
|
45
|
+
|
|
46
|
+
# 2. Load the best match by ref from the curate output
|
|
47
|
+
akm show workflows/deploy-to-prod
|
|
48
|
+
|
|
49
|
+
# 3. Record outcome
|
|
50
|
+
akm feedback workflows/deploy-to-prod --positive --reason "Completed without issues"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Get refs from search.** Agents should call `akm search --detail agent` or
|
|
54
|
+
`akm curate` to discover refs — not guess them. The `ref` field in search
|
|
55
|
+
results is the stable token to pass to `akm show`. Feedback closes the loop.
|
|
56
|
+
Record `--negative` only when the asset's content is wrong or stale; a note that
|
|
57
|
+
simply did not fit the task is not negative feedback, so record nothing for it.
|
|
58
|
+
`akm feedback <ref> --negative --reason "<what is wrong and what should change>"`
|
|
59
|
+
flags the asset, and the next improve run may repair its description, title or
|
|
60
|
+
`when_to_use` from your reason. Once you have verified the correct fact, attach
|
|
61
|
+
the exact fix with `--replace`, `--with` and `--source`. `--positive` records
|
|
62
|
+
that an asset helped (it raises its ranking) and does not trigger a rewrite. See
|
|
63
|
+
[Improve the Library](improve-the-library.md) for what happens to feedback after
|
|
64
|
+
it's recorded.
|
|
65
|
+
|
|
66
|
+
## Compatibility matrix
|
|
67
|
+
|
|
68
|
+
Not every agent surface integrates with AKM the same way. The table below
|
|
69
|
+
sets expectations by environment.
|
|
70
|
+
|
|
71
|
+
| Environment | Core support | Optional/extended support |
|
|
72
|
+
| --- | --- | --- |
|
|
73
|
+
| Shell-capable coding agent | `curate` / `show` / `feedback` via the CLI | Generated prompt block (`akm hints`) or a platform plugin |
|
|
74
|
+
| Claude/OpenCode project layout | Indexed in place through a `BundleAdapter` — no migration needed | `akm clone` selected assets into a writable bundle for editing |
|
|
75
|
+
| IDE assistant without shell access | Not a direct core integration | Requires a plugin, an `akm task`, or an external bridge that can shell out on the assistant's behalf |
|
|
76
|
+
|
|
77
|
+
A Claude Code `.claude` directory or an OpenCode `.opencode` directory is
|
|
78
|
+
recognized and indexed automatically once added as a source — see
|
|
79
|
+
[Bundle Types](../reference/bundle-types.md) for the full adapter list and
|
|
80
|
+
which formats are read-only versus writable in the current release.
|
|
81
|
+
The native directory remains the source of truth: AKM translates recognized
|
|
82
|
+
assets while reading the bundle and does not synchronize, copy, or write them
|
|
83
|
+
back. The approved target execution rules for these translated agents and
|
|
84
|
+
commands are documented in
|
|
85
|
+
[Agent, Command, Engine, and Model Resolution](../architecture/specs/agent-command-engine-model-design.md).
|
|
86
|
+
|
|
87
|
+
## AKM complements, rather than replaces
|
|
88
|
+
|
|
89
|
+
AKM is not a competitor to assistant-native rules/skills or to MCP — it fills
|
|
90
|
+
a different layer. Assistant-native rules and skills give a specific tool
|
|
91
|
+
built-in, tool-specific activation. MCP exposes live tools and resources over
|
|
92
|
+
a protocol. AKM manages portable, versionable capability assets — and the
|
|
93
|
+
retrieval loop that finds and loads them — across whichever tool you're
|
|
94
|
+
sitting in. In short, AKM complements MCP and assistant-native skills rather
|
|
95
|
+
than replacing either.
|
|
96
|
+
|
|
97
|
+
## Also available
|
|
98
|
+
|
|
99
|
+
- **Tab completion.** `akm completions --install` sets up shell completions
|
|
100
|
+
for subcommands and flags. See [CLI Reference](../reference/cli.md#completions).
|
|
101
|
+
- **Dispatching a bundle agent asset.** `akm agent agents/<name> --engine
|
|
102
|
+
<engine> --prompt "..."` runs a bundle `agents/<name>` persona and model
|
|
103
|
+
defaults through a named engine — including built-in model aliases like
|
|
104
|
+
`sonnet` and `opus` that resolve per platform. The current CLI rejects a
|
|
105
|
+
nonempty tool request at its separate authorization boundary; asset metadata
|
|
106
|
+
is never authorization by itself. See
|
|
107
|
+
[Configuration](../reference/configuration.md#engines) for the alias table
|
|
108
|
+
and [Architecture](../architecture/architecture.md) for how dispatch is
|
|
109
|
+
built into platform-specific CLI argv per backend.
|
|
110
|
+
- **Install refs vs. asset refs.** `npm:@scope/pkg` and `github:owner/repo`
|
|
111
|
+
are install refs, accepted only by `akm bundle add`/`akm clone`, and are a
|
|
112
|
+
different grammar from the `[bundle//]conceptId` refs `show`/`search` use.
|
|
113
|
+
See [Refs](../reference/refs.md) for the full grammar.
|
|
114
|
+
- **Plugin integrations.** For tighter editor and agent integrations,
|
|
115
|
+
platform-specific plugins are available in
|
|
116
|
+
[akm-plugins](https://github.com/itlackey/akm-plugins) (current
|
|
117
|
+
integrations include OpenCode). Plugins add richer UX — in-editor asset
|
|
118
|
+
browsing, automatic context injection — but the core `akm` CLI works
|
|
119
|
+
without them.
|
|
120
|
+
|
|
121
|
+
## OpenCode plugins: one package per OpenCode major
|
|
122
|
+
|
|
123
|
+
OpenCode 1 and OpenCode 2 load different plugin APIs, so akm ships one plugin
|
|
124
|
+
package for each. Install only the one that matches the `opencode` you run; akm
|
|
125
|
+
never installs or replaces the `opencode` binary, and `akm upgrade` never adds
|
|
126
|
+
one plugin to the other major's config.
|
|
127
|
+
|
|
128
|
+
| OpenCode | Plugin package | Config key | Plugin cache |
|
|
129
|
+
| --- | --- | --- | --- |
|
|
130
|
+
| 1 | `akm-opencode` | `"plugin"` | `~/.cache/opencode/packages/akm-opencode@<tag>/` |
|
|
131
|
+
| 2 | `akm-opencode-v2` | `"plugins"` (the key `opencode plugin add` writes) | `~/.cache/opencode/npm/akm-opencode-v2@<tag>/<build>/` |
|
|
132
|
+
|
|
133
|
+
(`$XDG_CACHE_HOME` and `$XDG_CONFIG_HOME` move both.) Both packages declare the
|
|
134
|
+
same `akm-cli` dependency.
|
|
135
|
+
|
|
136
|
+
**OpenCode 1.** Add `akm-opencode` to the global config
|
|
137
|
+
(`~/.config/opencode/opencode.json`):
|
|
138
|
+
|
|
139
|
+
```json
|
|
140
|
+
{ "plugin": ["akm-opencode"] }
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**OpenCode 2.**
|
|
144
|
+
|
|
145
|
+
```sh
|
|
146
|
+
opencode plugin add akm-opencode-v2
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
This installs the package and adds it to `plugins` in the global config.
|
|
150
|
+
|
|
151
|
+
**Updating.** `akm upgrade` refreshes the cached plugin of each major it finds,
|
|
152
|
+
holds the CLI to the `akm-cli` those plugins pin, and leaves a plugin alone
|
|
153
|
+
whose config pins another spec such as `akm-opencode@0.8.0`. Use
|
|
154
|
+
`akm upgrade --next` with `akm-opencode@next` / `akm-opencode-v2@next` in the
|
|
155
|
+
config to follow prereleases. The exact rules are in the
|
|
156
|
+
[`akm upgrade` reference](../reference/cli.md#harness-plugins). `akm health`
|
|
157
|
+
warns when either plugin's bundled `akm-cli` differs from the running CLI.
|
|
158
|
+
|
|
159
|
+
**Which OpenCode akm drives** is detected, not configured: an `opencode` or
|
|
160
|
+
`opencode-sdk` agent engine runs the most recent OpenCode on `PATH` (or its own
|
|
161
|
+
`bin`) and uses the adapters for the major that binary reports; OpenCode 1 logs a
|
|
162
|
+
warning recommending OpenCode 2 (see
|
|
163
|
+
[Configuration](../reference/configuration.md#engines)). It does not change
|
|
164
|
+
which plugin you install, and the plugin choice does not change it.
|
|
165
|
+
|
|
166
|
+
## See also
|
|
167
|
+
|
|
168
|
+
- [Configuration](../reference/configuration.md#engines) — named agent engines and model aliases
|
|
169
|
+
- [Discover and Load](discover-and-load.md) — the full curate → show retrieval path
|
|
170
|
+
- [Knowledge Management](knowledge-management.md) — capturing agent-generated memories
|
|
171
|
+
- [Improve the Library](improve-the-library.md) — feeding back usage signals
|
|
172
|
+
- [CLI Reference](../reference/cli.md) — `completions`, `agent`, and `hints` command documentation
|
|
173
|
+
- [Concepts](concepts.md) — refs, origins, and the asset type system
|
|
174
|
+
- [Bundle Types](../reference/bundle-types.md) — how AKM indexes existing project layouts in place
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# LLM Wikis
|
|
2
|
+
|
|
3
|
+
akm supports [Andrej Karpathy's LLM
|
|
4
|
+
Wiki](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f)
|
|
5
|
+
pattern: a markdown-based knowledge base that an LLM agent maintains
|
|
6
|
+
together with a human, on a filesystem it can read and write directly,
|
|
7
|
+
with no special SDK.
|
|
8
|
+
|
|
9
|
+
**As of 0.9.0 an LLM wiki is a bundle format, not an akm asset type.**
|
|
10
|
+
The `akm wiki` command family was removed with the 0.9.0 bundle-adapter
|
|
11
|
+
architecture; recognition moved into the first-class LLM Wiki adapter.
|
|
12
|
+
|
|
13
|
+
## The design
|
|
14
|
+
|
|
15
|
+
A wiki is a directory. Full stop.
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
<wiki-root>/
|
|
19
|
+
schema.md rulebook the agent reads first
|
|
20
|
+
index.md catalog of pages, regenerable
|
|
21
|
+
log.md append-only activity log
|
|
22
|
+
raw/ immutable ingested sources (never edit)
|
|
23
|
+
pages/<page>.md agent-authored pages
|
|
24
|
+
pages/<topic>/<page>.md optional nesting
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Three layers, from Karpathy's gist:
|
|
28
|
+
|
|
29
|
+
- **Raw sources** (`raw/`) — what you ingest. Articles, papers,
|
|
30
|
+
transcripts, notes. Immutable.
|
|
31
|
+
- **Wiki pages** (`pages/<page>.md`, optionally nested) — what the agent
|
|
32
|
+
writes. Summaries, entity pages, concept pages, FAQs. Cross-referenced
|
|
33
|
+
via `xrefs:` frontmatter; provenance recorded via `sources:`
|
|
34
|
+
frontmatter pointing at the cited raw files.
|
|
35
|
+
- **Schema** (`schema.md`) — the per-wiki configuration: voice, page
|
|
36
|
+
kinds, contradiction policy, any conventions the agent should follow.
|
|
37
|
+
akm never touches it.
|
|
38
|
+
|
|
39
|
+
### Principle — akm surfaces, the agent writes
|
|
40
|
+
|
|
41
|
+
Karpathy's workflow is a conversation between a human, an agent, and a
|
|
42
|
+
filesystem. akm is not that agent. Page writes — create, append, xref,
|
|
43
|
+
log — all use the agent's native `Read` / `Write` / `Edit` tools. akm's
|
|
44
|
+
job is recognition and discovery: it mounts the wiki, indexes the pages,
|
|
45
|
+
and makes them searchable alongside every other asset.
|
|
46
|
+
|
|
47
|
+
No LLM calls are made anywhere in the wiki surface. No network access.
|
|
48
|
+
|
|
49
|
+
## How akm sees a wiki (0.9.0)
|
|
50
|
+
|
|
51
|
+
The LLM Wiki adapter recognizes a wiki **deterministically at install
|
|
52
|
+
time**: a bundle component whose root holds a `schema.md` plus a
|
|
53
|
+
`pages/` directory is mounted as an `llm-wiki` component. From there:
|
|
54
|
+
|
|
55
|
+
- `pages/**.md` are indexed as searchable documents; each page's ref is
|
|
56
|
+
`bundle//conceptId`, where the conceptId is the root-relative path
|
|
57
|
+
minus `.md` (a page at `pages/attention.md` in bundle `research-wiki`
|
|
58
|
+
is `research-wiki//pages/attention`).
|
|
59
|
+
- `raw/**.md` **are** indexed — as first-class, addressable, searchable
|
|
60
|
+
`wiki-source` documents (not `page`-type items; a ref looks like
|
|
61
|
+
`bundle//raw/<slug>`), so citations resolve and raw content is
|
|
62
|
+
discoverable by search too.
|
|
63
|
+
- `schema.md`, `index.md`, and `log.md` are structural and are never
|
|
64
|
+
indexed as a concept.
|
|
65
|
+
- `xrefs:` frontmatter becomes cross-reference edges; `sources:`
|
|
66
|
+
frontmatter becomes citation edges back to raw files.
|
|
67
|
+
|
|
68
|
+
## Working with a wiki
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
akm bundle add github:team/research-wiki # install a wiki bundle (or point at a local dir)
|
|
72
|
+
akm search "attention" # pages rank alongside all other indexed content
|
|
73
|
+
akm show research-wiki//pages/attention # read a page by ref
|
|
74
|
+
akm show research-wiki//pages/attention#history
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
To build a new wiki, create the directory shape above by hand (or have
|
|
78
|
+
your agent do it — `schema.md` plus an empty `pages/` is enough for
|
|
79
|
+
recognition), then add it as a bundle. Ingesting raw sources, writing
|
|
80
|
+
pages, and maintaining `index.md`/`log.md` are the agent's job, guided
|
|
81
|
+
by `schema.md`.
|
|
@@ -30,10 +30,11 @@ akm migrate apply
|
|
|
30
30
|
In order, every run applies (or, under `status`/`--dry-run`, plans):
|
|
31
31
|
|
|
32
32
|
1. **config.json in its current shape** (`configFile`): retired and unknown
|
|
33
|
-
keys dropped,
|
|
34
|
-
|
|
35
|
-
`
|
|
36
|
-
|
|
33
|
+
keys dropped, `configVersion` set. Config loading already does this in
|
|
34
|
+
memory; this persists it under a backup. A config older than 0.9.15 (the
|
|
35
|
+
legacy `stashDir`/`sources[]`/`installed` layout, an `extraParams` key
|
|
36
|
+
that shadows a first-class field) is not converted by 0.10: it blocks
|
|
37
|
+
with a message to run `akm migrate apply` under akm 0.9.x first.
|
|
37
38
|
2. **Pending `state.db` migrations**, historical-destructive ones included
|
|
38
39
|
(`stateMigrations`). This is the only path (besides `akm upgrade`, which
|
|
39
40
|
calls the same code) that is allowed to apply a destructive migration to an
|
|
@@ -98,7 +99,7 @@ same step names):
|
|
|
98
99
|
`status` is one of:
|
|
99
100
|
|
|
100
101
|
- **`current`** — no task-source file needs converting, and no config
|
|
101
|
-
|
|
102
|
+
rewrite is pending. A no-op boot.
|
|
102
103
|
- **`ready`** — task sources have eligible changes and no config-lift
|
|
103
104
|
conflict; a real `apply` will clear them.
|
|
104
105
|
- **`blocked`** — at least one item cannot be applied automatically (a
|
|
@@ -244,7 +245,7 @@ akm-migrate apply
|
|
|
244
245
|
|
|
245
246
|
`akm migrate status`/`apply` (under the `akm` CLI) are a thin wrapper over
|
|
246
247
|
this same executable — same plan, same exit codes. Reach for `akm-migrate`
|
|
247
|
-
directly when you don't want `akm`'s `--format`/`--
|
|
248
|
+
directly when you don't want `akm`'s `--format`/`--detail` output
|
|
248
249
|
handling in the way, e.g. a shell script that just wants the raw JSON line
|
|
249
250
|
on stdout and a plain exit code.
|
|
250
251
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Maintainer Docs
|
|
2
|
+
|
|
3
|
+
This is maintainer/contributor documentation, not user-facing. It covers how
|
|
4
|
+
to work on `akm` itself — running it from source, measuring whether changes
|
|
5
|
+
actually improve it, and the current state of the `curate` implementation.
|
|
6
|
+
|
|
7
|
+
- [Local Development](local-development.md) — the explicit launcher for each
|
|
8
|
+
kind of contributor check (live source, built launcher, packed-package
|
|
9
|
+
acceptance, global checkout install) and the verification commands to run
|
|
10
|
+
before pushing.
|
|
11
|
+
- [Release Checklist](release-checklist.md) — local release validation, exact
|
|
12
|
+
candidate-SHA semantic/Docker/native-scheduler gates, and the evidence links
|
|
13
|
+
required before publication.
|
|
14
|
+
- [akm-eval](https://github.com/itlackey/akm-eval) — the evals and benchmarks
|
|
15
|
+
that measure whether `akm improve` and retrieval changes are actually
|
|
16
|
+
working. The old in-repo toolkit is retired: see [eval.md](eval.md).
|
|
17
|
+
- [Curate Workmap](curate-workmap.md) — the current `akm curate` contract,
|
|
18
|
+
where its implementation diverges from intended behavior, and the
|
|
19
|
+
highest-value next fixes.
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
# Curate Workmap
|
|
2
|
+
|
|
3
|
+
> **Implementation note (added later, verified against `src/commands/read/curate.ts`):**
|
|
4
|
+
> much of the "Preferred direction" / "Next Fix Candidates" work below has
|
|
5
|
+
> already shipped. `curateSearchResults` now selects via `selectCuratedStashHits`
|
|
6
|
+
> (score-first ranking through `annotateCurateHit`/`compareCurateHits`/
|
|
7
|
+
> `passesCurateScoreFloor`, not "take the first hit per type"),
|
|
8
|
+
> `collapseCurateFamilies`/`preferBroadRootRepresentative`/`getCurateFamily`
|
|
9
|
+
> implement the asset-family root/child collapsing this document recommends,
|
|
10
|
+
> `shouldRunCurateFallback` triggers fallback on a weak result set (not only
|
|
11
|
+
> on zero hits, reversing the "Fallback Search Behavior" section below), and
|
|
12
|
+
> `appendCurateSupportRef`/`mergeCurateSupportRefs` attach graph-derived
|
|
13
|
+
> support refs (the "Graph Leverage" recommendation). The `orderCuratedTypes`
|
|
14
|
+
> function this document's "Execution Path" section names no longer exists —
|
|
15
|
+
> regex-based type reordering was replaced by the scoring pipeline above. The
|
|
16
|
+
> "Current Behavior" / "Current Curate Contract" sections below were accurate
|
|
17
|
+
> at the time they were written but are now describing the PRE-fix state in
|
|
18
|
+
> several places; re-verify against the functions above before trusting any
|
|
19
|
+
> specific "current behavior" claim in this document. Not fully re-audited
|
|
20
|
+
> line by line — this note flags the drift rather than rewriting the
|
|
21
|
+
> analysis.
|
|
22
|
+
|
|
23
|
+
## When To Read This
|
|
24
|
+
|
|
25
|
+
Read this before changing `akm curate` ranking, fallback, follow-up generation, or agent-facing output.
|
|
26
|
+
|
|
27
|
+
This page is the shortest path to understanding:
|
|
28
|
+
- how `akm curate` currently works
|
|
29
|
+
- which tests pin that behavior
|
|
30
|
+
- where the current implementation diverges from intended product behavior
|
|
31
|
+
- what fix direction has the strongest support from recent review
|
|
32
|
+
|
|
33
|
+
## Debate Outcome
|
|
34
|
+
|
|
35
|
+
Recent multi-agent review converged on the same conclusion:
|
|
36
|
+
|
|
37
|
+
- `curate` should be relevance-first, not diversity-first
|
|
38
|
+
- search ranking should remain the backbone of the shortlist
|
|
39
|
+
- type diversity should be a soft preference for later slots, not a hard override
|
|
40
|
+
- fallback search should run when the initial result set is weak or noisy, not only when it is empty
|
|
41
|
+
- `followUp` should become more action-aware over time, but ranking/fallback correctness comes first
|
|
42
|
+
|
|
43
|
+
Recommended fix order:
|
|
44
|
+
|
|
45
|
+
1. Make curate selection score-first and diversity-second.
|
|
46
|
+
2. Relax fallback suppression so one weak phrase hit does not block token fallback.
|
|
47
|
+
3. Revisit follow-up generation after ranking quality improves.
|
|
48
|
+
|
|
49
|
+
Additional debate outcome:
|
|
50
|
+
|
|
51
|
+
- simple type-aware reranking is useful only as a thin post-search correction layer
|
|
52
|
+
- root-vs-derived asset families should usually be collapsed to one representative in the top-level shortlist
|
|
53
|
+
- graph data is better suited for attached support refs or navigation hints than for primary reranking in the first iteration
|
|
54
|
+
|
|
55
|
+
## Current Curate Contract
|
|
56
|
+
|
|
57
|
+
- CLI entry lives in `src/commands/read/search-cli.ts`.
|
|
58
|
+
- Public entry point is `akmCurate()` in `src/commands/read/curate.ts`.
|
|
59
|
+
- Default curated limit is `4`.
|
|
60
|
+
- Default search source is `stash`.
|
|
61
|
+
- Curate fetches more search hits than it returns: `limit * 4`, minimum `12`.
|
|
62
|
+
- `--type <type>` bypasses diversification and returns top hits of that type.
|
|
63
|
+
- Default multi-type curate currently keeps one best hit per type, then reorders types using regex heuristics.
|
|
64
|
+
- Registry hits only fill leftover slots and are capped at `2`.
|
|
65
|
+
- Bundle items are enriched via `akmShowUnified()` best-effort.
|
|
66
|
+
- Bundle `followUp` is always `akm show <ref>` today.
|
|
67
|
+
- Curate logs both a summary event and per-item retrieval rows for bundle refs.
|
|
68
|
+
|
|
69
|
+
## Execution Path
|
|
70
|
+
|
|
71
|
+
Read these first:
|
|
72
|
+
|
|
73
|
+
- `src/commands/read/search-cli.ts`
|
|
74
|
+
- `src/commands/read/curate.ts`
|
|
75
|
+
- `src/output/shapes/curate.ts`
|
|
76
|
+
- `src/output/text/helpers.ts`
|
|
77
|
+
- `src/commands/read/search.ts`
|
|
78
|
+
- `src/commands/read/show.ts`
|
|
79
|
+
|
|
80
|
+
Key functions in `src/commands/read/curate.ts` (current names; `orderCuratedTypes()`
|
|
81
|
+
no longer exists — see the implementation note above):
|
|
82
|
+
|
|
83
|
+
- `akmCurate()`
|
|
84
|
+
- `searchForCuration()`
|
|
85
|
+
- `deriveCurateFallbackQueries()`
|
|
86
|
+
- `mergeCurateSearchResponses()`
|
|
87
|
+
- `curateSearchResults()`
|
|
88
|
+
- `selectCuratedStashHits()` / `annotateCurateHit()` / `compareCurateHits()` / `passesCurateScoreFloor()`
|
|
89
|
+
- `collapseCurateFamilies()` / `preferBroadRootRepresentative()` / `getCurateFamily()`
|
|
90
|
+
- `shouldRunCurateFallback()`
|
|
91
|
+
- `appendCurateSupportRef()` / `mergeCurateSupportRefs()`
|
|
92
|
+
- `enrichCuratedStashHit()`
|
|
93
|
+
|
|
94
|
+
## Ranking And Selection Rules
|
|
95
|
+
|
|
96
|
+
Current behavior:
|
|
97
|
+
|
|
98
|
+
- Search returns scored, ordered hits.
|
|
99
|
+
- Curate then discards most of that ordering by taking the first hit per type.
|
|
100
|
+
- Those per-type winners are reordered using query regex boosts such as `deploy`, `review`, `guide`, `agent`, and `memory`.
|
|
101
|
+
- This can promote obviously lower-score items above much stronger hits.
|
|
102
|
+
|
|
103
|
+
Why this is a problem:
|
|
104
|
+
|
|
105
|
+
- search already has strong ranking tests and should remain the primary relevance signal
|
|
106
|
+
- current curate can surface irrelevant filler to satisfy type variety
|
|
107
|
+
- users experience curate as a flagship shortlist, so wrong top results damage trust more than low variety does
|
|
108
|
+
|
|
109
|
+
Preferred direction:
|
|
110
|
+
|
|
111
|
+
- preserve top-ranked overall hits first
|
|
112
|
+
- allow diversity only when alternatives are close in score and plausibly relevant
|
|
113
|
+
- keep explicit `--type` behavior unchanged
|
|
114
|
+
|
|
115
|
+
Small type-aware corrections that are considered in-bounds:
|
|
116
|
+
|
|
117
|
+
- prefer runnable `script` / concrete `command` over similarly scored `memory` for execution-heavy queries
|
|
118
|
+
- prefer `workflow` / `skill` over adjacent explanation docs for multi-step task queries
|
|
119
|
+
- include `agent` mainly for explicit delegation / persona / prompt-building queries
|
|
120
|
+
- keep `memory` for recall/context queries, not as generic filler
|
|
121
|
+
|
|
122
|
+
Corrections that are currently considered too risky:
|
|
123
|
+
|
|
124
|
+
- hard one-per-type quotas
|
|
125
|
+
- large hand-authored type matrices
|
|
126
|
+
- LLM reranking
|
|
127
|
+
- blanket demotion of `memory` or `agent` as types
|
|
128
|
+
|
|
129
|
+
## Asset Families
|
|
130
|
+
|
|
131
|
+
Curate should think in terms of asset families, not just isolated types.
|
|
132
|
+
|
|
133
|
+
Practical examples in this repo:
|
|
134
|
+
|
|
135
|
+
- `skills/docker-homelab`
|
|
136
|
+
- `knowledge/skills/docker-homelab/references/compose`
|
|
137
|
+
|
|
138
|
+
Desired behavior:
|
|
139
|
+
|
|
140
|
+
- broad query like `docker homelab` -> prefer the root asset
|
|
141
|
+
- narrow query like `docker compose reference` -> prefer the child reference page
|
|
142
|
+
- if both are useful, attach the weaker sibling as support instead of spending two top-level slots by default
|
|
143
|
+
|
|
144
|
+
This should start as an explicit structural heuristic, not semantic lineage inference.
|
|
145
|
+
|
|
146
|
+
## Fallback Search Behavior
|
|
147
|
+
|
|
148
|
+
Current behavior:
|
|
149
|
+
|
|
150
|
+
- `searchForCuration()` only runs fallback token searches when the initial query returns zero hits
|
|
151
|
+
- if the initial query returns even one weak or irrelevant hit, fallback does not run
|
|
152
|
+
- fallback token extraction removes filler words, dedupes tokens, drops tokens shorter than 3 chars, and caps the set at 6
|
|
153
|
+
- fallback is also skipped when normalization leaves only one usable token
|
|
154
|
+
|
|
155
|
+
Why this is a problem:
|
|
156
|
+
|
|
157
|
+
- one weak phrase hit can block much better token hits
|
|
158
|
+
- prompt-style queries like `the docker` do not get the obvious one-token fallback
|
|
159
|
+
- meaningful short tokens such as `ai`, `ci`, `cd`, `go`, `js`, or `ts` are lost today
|
|
160
|
+
|
|
161
|
+
Preferred direction:
|
|
162
|
+
|
|
163
|
+
- suppress fallback only when the initial result set is actually strong enough
|
|
164
|
+
- allow one-token fallback when that token is clearly the meaningful residue of a prompt-style query
|
|
165
|
+
- preserve a narrow allowlist of meaningful short tokens
|
|
166
|
+
|
|
167
|
+
## Enrichment And Follow-Up Fields
|
|
168
|
+
|
|
169
|
+
Current behavior:
|
|
170
|
+
|
|
171
|
+
- curate enriches bundle hits by calling `akmShowUnified({ ref })`
|
|
172
|
+
- if show fails, enrichment silently degrades to raw search-hit data
|
|
173
|
+
- bundle follow-up remains `akm show <ref>` even for runnable scripts with a concrete `run`
|
|
174
|
+
- registry follow-up uses the registry action, usually `akm bundle add ...`
|
|
175
|
+
|
|
176
|
+
Product implication:
|
|
177
|
+
|
|
178
|
+
- output is inspect-first, not act-first
|
|
179
|
+
- this is acceptable for now, but becomes more visible once result quality improves
|
|
180
|
+
|
|
181
|
+
For agent consumers, the desired optimization order is:
|
|
182
|
+
|
|
183
|
+
- actionability
|
|
184
|
+
- relevance
|
|
185
|
+
- low duplication / root-asset preference
|
|
186
|
+
- navigability
|
|
187
|
+
- type diversity
|
|
188
|
+
|
|
189
|
+
## Output Shape And Formatting
|
|
190
|
+
|
|
191
|
+
Read:
|
|
192
|
+
|
|
193
|
+
- `src/output/shapes/curate.ts`
|
|
194
|
+
- `src/output/text/helpers.ts`
|
|
195
|
+
|
|
196
|
+
Important details:
|
|
197
|
+
|
|
198
|
+
- `curate` has a dedicated output shaper now
|
|
199
|
+
- `brief` still keeps `followUp` and `reason`
|
|
200
|
+
- `--detail agent` trims fields down for agent use
|
|
201
|
+
- text output prints fixed `Next steps:` guidance that assumes `akm show <ref>` is the next action
|
|
202
|
+
|
|
203
|
+
## Telemetry And Retrieval Signal
|
|
204
|
+
|
|
205
|
+
Read:
|
|
206
|
+
|
|
207
|
+
- `src/commands/read/curate.ts`
|
|
208
|
+
- `tests/integration/get-retrieval-counts.test.ts`
|
|
209
|
+
|
|
210
|
+
Important detail:
|
|
211
|
+
|
|
212
|
+
- curate writes per-item `usage_events` rows for bundle refs so curated items count as retrieval signal
|
|
213
|
+
|
|
214
|
+
This means ranking changes do not just affect UX. They also affect downstream improvement-loop evidence.
|
|
215
|
+
|
|
216
|
+
## Graph Leverage
|
|
217
|
+
|
|
218
|
+
> **Retired (0.9.17-alpha.9):** the LLM entity graph this section recommends
|
|
219
|
+
> leveraging is gone — `graph-extraction`, `graph_meta`/`graph_files`/
|
|
220
|
+
> `graph_file_entities`/`graph_file_relations`, and `akm show`'s `related`
|
|
221
|
+
> block it fed are all deleted. It was already superseded before that: #935
|
|
222
|
+
> (0.9.17-alpha.8) added the first-class asset->asset edge table this section
|
|
223
|
+
> says doesn't exist (`asset_links`, declared links), and curate's support
|
|
224
|
+
> refs (`buildCurateSupportRefs` in `src/commands/read/curate.ts`) come from
|
|
225
|
+
> declared links now, not graph data — the implementation note at the top of
|
|
226
|
+
> this document already flags that rename. Kept below for historical context
|
|
227
|
+
> only; do not implement against it.
|
|
228
|
+
|
|
229
|
+
Existing graph signal:
|
|
230
|
+
|
|
231
|
+
- there is no first-class asset->asset edge table
|
|
232
|
+
- asset relatedness is already derivable via shared-entity overlap
|
|
233
|
+
- `listRelatedPathsForFile()` in `src/indexer/graph/graph-boost.ts` returns related assets with `ref`, `type`, `sharedEntities`, and `relationCount`
|
|
234
|
+
- `akm show` already exposes a lightweight `related` block using that signal
|
|
235
|
+
|
|
236
|
+
Limits:
|
|
237
|
+
|
|
238
|
+
- graph coverage depends on graph extraction having run
|
|
239
|
+
- graph is thin or absent on cold bundles
|
|
240
|
+
- graph quality is uneven and generic entities can over-connect assets
|
|
241
|
+
- graph coverage is strongest for `knowledge` / `memory` and should not be assumed for every asset family
|
|
242
|
+
|
|
243
|
+
Recommended first graph-aware use in curate:
|
|
244
|
+
|
|
245
|
+
- do not use graph as a primary reranker yet
|
|
246
|
+
- use graph to attach 1-2 support refs or navigation hints to a top-level curated result
|
|
247
|
+
- prefer hints like `see also`, `related`, or `inspect next` over full graph payloads
|
|
248
|
+
- keep full graph exploration in `akm show`'s `related` block
|
|
249
|
+
|
|
250
|
+
What not to do yet:
|
|
251
|
+
|
|
252
|
+
- no graph-only reranking
|
|
253
|
+
- no graph-required curate path
|
|
254
|
+
- no full graph dumps in curate output
|
|
255
|
+
- no semantic asset-lineage inference from sparse graph data
|
|
256
|
+
|
|
257
|
+
## Tests That Pin Behavior
|
|
258
|
+
|
|
259
|
+
Start with these:
|
|
260
|
+
|
|
261
|
+
- `tests/integration/curate-command.test.ts`
|
|
262
|
+
- `tests/curate-logic.test.ts`
|
|
263
|
+
- `tests/integration/curate-search-for-curation.test.ts`
|
|
264
|
+
|
|
265
|
+
What they cover:
|
|
266
|
+
|
|
267
|
+
- CLI JSON/text output
|
|
268
|
+
- shape/detail behavior
|
|
269
|
+
- usage logging
|
|
270
|
+
- fallback token derivation
|
|
271
|
+
- merge semantics
|
|
272
|
+
- type ordering
|
|
273
|
+
- diversification logic
|
|
274
|
+
- registry filler cap
|
|
275
|
+
- blank query rejection
|
|
276
|
+
- default limit
|
|
277
|
+
- phrase-hit fallback suppression
|
|
278
|
+
- current quality baselines showing irrelevant filler
|
|
279
|
+
|
|
280
|
+
Search-ranking baselines that curate should respect:
|
|
281
|
+
|
|
282
|
+
- `tests/integration/db-scoring.test.ts` (no `tests/commands/search.test.ts` exists in the current tree; this is the closest surviving search-scoring baseline, not a confirmed direct successor)
|
|
283
|
+
- `tests/integration/ranking-regression.test.ts`
|
|
284
|
+
|
|
285
|
+
## Known Gaps / Mismatches
|
|
286
|
+
|
|
287
|
+
- `docs/guides/discover-and-load.md` currently says curate prefers one strong match per type; that wording is too strong if curate becomes relevance-first.
|
|
288
|
+
- `docs/reference/cli.md` documents `--type`, `--limit`, and `--source`, but does not currently explain the effective `--detail` and `--shape` behavior alongside curate.
|
|
289
|
+
- Some historical AKM refs about curate output shaping are stale because curate now has a dedicated shape implementation.
|
|
290
|
+
|
|
291
|
+
## Safe Edit Checklist
|
|
292
|
+
|
|
293
|
+
Before editing curate:
|
|
294
|
+
|
|
295
|
+
1. Read the three curate-focused test files.
|
|
296
|
+
2. Read `src/commands/read/curate.ts` top to bottom.
|
|
297
|
+
3. Confirm whether you are changing:
|
|
298
|
+
- post-search selection
|
|
299
|
+
- fallback triggering
|
|
300
|
+
- fallback token extraction
|
|
301
|
+
- output contract
|
|
302
|
+
- telemetry side effects
|
|
303
|
+
4. Keep CLI surface and output-shape tests passing unless you intentionally change the public contract.
|
|
304
|
+
5. If you improve ranking quality, convert current characterization tests that encode bad behavior into regression tests for the new intended behavior.
|
|
305
|
+
|
|
306
|
+
## Useful AKM Queries And Refs
|
|
307
|
+
|
|
308
|
+
Queries:
|
|
309
|
+
|
|
310
|
+
```sh
|
|
311
|
+
akm search "curate rerank"
|
|
312
|
+
akm search "curate output shape"
|
|
313
|
+
akm search "search discovery curate"
|
|
314
|
+
akm search "curate telemetry usage_events"
|
|
315
|
+
akm search "curate fallback query"
|
|
316
|
+
akm search "curate quality baseline"
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
Historical context refs:
|
|
320
|
+
|
|
321
|
+
- `memories/curate-weak-for-ui-test-audit.derived`
|
|
322
|
+
- `knowledge/curate-command-flags-inert`
|
|
323
|
+
|
|
324
|
+
Note: `knowledge/curate-command-flags-inert` is historical context only. It describes an older output-shaping limitation that is no longer current now that `src/output/shapes/curate.ts` exists.
|
|
325
|
+
|
|
326
|
+
## Next Fix Candidates
|
|
327
|
+
|
|
328
|
+
Highest-value next changes:
|
|
329
|
+
|
|
330
|
+
1. Replace hard one-per-type selection with score-first shortlist selection plus optional soft diversity.
|
|
331
|
+
2. Replace empty-only fallback triggering with weak-result fallback triggering.
|
|
332
|
+
3. Add simple family-aware root/child collapsing for obvious structural bundles.
|
|
333
|
+
4. Add regression tests asserting that docker-specific curate queries stop surfacing unrelated `commands/release-manager` filler.
|
|
334
|
+
5. Attach lightweight related-asset hints using existing graph data after ranking quality is fixed.
|
|
335
|
+
6. Revisit `followUp` generation after ranking quality is fixed.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# akm-eval — retired from this repository
|
|
2
|
+
|
|
3
|
+
The `scripts/akm-eval/` toolkit has left akm: its code is kept, to read and not to run, in [`retired/akm-scripts-akm-eval/`](https://github.com/itlackey/akm-eval/tree/main/retired/akm-scripts-akm-eval) of [itlackey/akm-eval](https://github.com/itlackey/akm-eval), where [`reports/retired-evals.md`](https://github.com/itlackey/akm-eval/blob/main/reports/retired-evals.md) says what each retired eval asked, found and why it ended. It is also in this repository's history, at commit `f57a7fd44b37` and in the tag `v0.9.27-alpha.1`.
|