akm-cli 0.9.30 → 0.9.31

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.
Files changed (161) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +10 -10
  3. package/ROADMAP.md +112 -0
  4. package/dist/commands/improve/improve-cli.js +33 -12
  5. package/dist/core/file-lock.js +10 -1
  6. package/dist/llm/client.js +33 -3
  7. package/dist/scripts/akm-migrate-node.js +5 -1
  8. package/dist/scripts/akm-migrate.js +5 -1
  9. package/docs/README.md +42 -41
  10. package/docs/agents/README.md +15 -0
  11. package/docs/agents/agent-install.md +14 -0
  12. package/docs/architecture/README.md +67 -0
  13. package/docs/architecture/adapters.md +272 -0
  14. package/docs/architecture/akm-architecture-decision-history.md +2055 -0
  15. package/docs/architecture/akm-core-principles.md +126 -0
  16. package/docs/architecture/architecture.md +579 -0
  17. package/docs/architecture/comparisons/claude-code-vs-akm-workflows-full.md +550 -0
  18. package/docs/architecture/decisions/0001-no-interpolation-attached-structured-context.md +72 -0
  19. package/docs/architecture/decisions/0002-unit-reuse-and-input-hash-scope.md +142 -0
  20. package/docs/architecture/decisions/0003-child-env-allowlist-and-provenance.md +189 -0
  21. package/docs/architecture/decisions/0004-task-input-contract-and-flag-coercion.md +97 -0
  22. package/docs/architecture/decisions/0005-task-result-vocabulary-and-legacy-read-mapping.md +108 -0
  23. package/docs/architecture/decisions/0006-task-source-version-routing.md +124 -0
  24. package/docs/architecture/decisions/0007-workflow-composition-bounds.md +83 -0
  25. package/docs/architecture/decisions/0008-task-binding-normalization.md +88 -0
  26. package/docs/architecture/decisions/0009-child-run-publication-column-parity.md +80 -0
  27. package/docs/architecture/decisions/0010-driver-protocol-cut.md +36 -0
  28. package/docs/architecture/decisions/0011-engine-run-loop-invariants.md +125 -0
  29. package/docs/architecture/decisions/README.md +62 -0
  30. package/docs/architecture/improvement.md +440 -0
  31. package/docs/architecture/internals/classification.md +154 -0
  32. package/docs/architecture/internals/fresh-host-rebuild-runbook.md +40 -0
  33. package/docs/architecture/internals/functional-contract-patterns.md +340 -0
  34. package/docs/architecture/internals/health-advisories.md +110 -0
  35. package/docs/architecture/internals/improve-workflow.md +713 -0
  36. package/docs/architecture/internals/indexing.md +498 -0
  37. package/docs/architecture/internals/registry-network-boundary.md +57 -0
  38. package/docs/architecture/internals/search.md +249 -0
  39. package/docs/architecture/internals/storage-locations.md +943 -0
  40. package/docs/architecture/persisted-data-compat.md +59 -0
  41. package/docs/architecture/reviews/env-secret-access.md +319 -0
  42. package/docs/architecture/runtime-boundary-design.md +153 -0
  43. package/docs/architecture/specs/0.9.0-close-out-plan.md +361 -0
  44. package/docs/architecture/specs/0.9.0-decisions.md +528 -0
  45. package/docs/architecture/specs/0.9.0-docs-code-drift-register.md +745 -0
  46. package/docs/architecture/specs/0.9.0-open-items-register.md +135 -0
  47. package/docs/architecture/specs/0.9.0-public-api-issue-backlog.md +740 -0
  48. package/docs/architecture/specs/0.9.0-release-surface-review.md +636 -0
  49. package/docs/architecture/specs/agent-command-engine-model-design.md +513 -0
  50. package/docs/architecture/specs/akm-0.9.0-bundle-adapter-spec.md +501 -0
  51. package/docs/architecture/specs/akm-0.9.0-ref-grammar-decision.md +291 -0
  52. package/docs/architecture/specs/akm-format-neutral-bundle-workspace-spec.md +2059 -0
  53. package/docs/architecture/specs/di-seams-plan.md +539 -0
  54. package/docs/architecture/specs/driver-protocol-keep-or-cut.md +275 -0
  55. package/docs/architecture/specs/fact-asset-type.md +142 -0
  56. package/docs/architecture/specs/improve-collapse-churn-detector-design.md +634 -0
  57. package/docs/architecture/specs/okf-support.md +148 -0
  58. package/docs/architecture/specs/ref.md +329 -0
  59. package/docs/architecture/specs/reviews/task-workflow-unification/README.md +72 -0
  60. package/docs/architecture/specs/reviews/task-workflow-unification/findings-consolidated.md +152 -0
  61. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-alternatives.md +352 -0
  62. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-bunqueue.md +300 -0
  63. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-openworkflow.md +402 -0
  64. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-1.md +758 -0
  65. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-2.md +645 -0
  66. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-3.md +602 -0
  67. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-adversarial.md +27 -0
  68. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-architecture.md +27 -0
  69. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-coverage.md +74 -0
  70. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-security.md +15 -0
  71. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r2-adversarial.md +132 -0
  72. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r2-verification.md +147 -0
  73. package/docs/architecture/specs/stash-conventions-code-spec.md +275 -0
  74. package/docs/architecture/specs/stash-organization-conventions.md +377 -0
  75. package/docs/architecture/specs/task-workflow-format-unification.md +721 -0
  76. package/docs/architecture/specs/workflow-engine-buy-vs-build.md +231 -0
  77. package/docs/architecture/specs/workflow-format-unification.md +437 -0
  78. package/docs/architecture/testing/manual-testing-checklist.md +3420 -0
  79. package/docs/architecture/testing/okf-v0.2-conformance-runbook.md +924 -0
  80. package/docs/architecture/testing/task-workflow-manual-tests.md +1817 -0
  81. package/docs/architecture/testing/testing-workflow.md +446 -0
  82. package/docs/architecture/workflow-engine.md +274 -0
  83. package/docs/guides/README.md +33 -0
  84. package/docs/guides/author-bundles.md +310 -0
  85. package/docs/guides/author-workflows.md +520 -0
  86. package/docs/guides/bundles.md +321 -0
  87. package/docs/guides/capture-knowledge.md +136 -0
  88. package/docs/guides/claude-code-vs-akm-workflows.md +30 -0
  89. package/docs/guides/concepts.md +93 -0
  90. package/docs/guides/discover-and-load.md +158 -0
  91. package/docs/guides/getting-started.md +240 -0
  92. package/docs/guides/improve-the-library.md +246 -0
  93. package/docs/guides/knowledge-management.md +18 -0
  94. package/docs/guides/recipes/headless-install.md +97 -0
  95. package/docs/guides/recipes/website-source.md +28 -0
  96. package/docs/guides/run-workflows.md +279 -0
  97. package/docs/guides/scheduling.md +123 -0
  98. package/docs/guides/use-with-any-agent.md +129 -0
  99. package/docs/guides/wikis.md +81 -0
  100. package/docs/maintainers/README.md +19 -0
  101. package/docs/maintainers/curate-workmap.md +336 -0
  102. package/docs/maintainers/eval.md +3 -0
  103. package/docs/maintainers/local-development.md +108 -0
  104. package/docs/maintainers/release-checklist.md +103 -0
  105. package/docs/migration/README.md +2 -2
  106. package/docs/migration/release-notes/0.0.13.md +1 -1
  107. package/docs/migration/release-notes/0.1.0.md +1 -1
  108. package/docs/migration/release-notes/0.2.0.md +1 -1
  109. package/docs/migration/release-notes/0.3.0.md +1 -1
  110. package/docs/migration/release-notes/0.5.0.md +1 -1
  111. package/docs/migration/release-notes/0.6.0.md +1 -1
  112. package/docs/migration/release-notes/0.7.0.md +1 -1
  113. package/docs/migration/release-notes/0.7.3.md +2 -2
  114. package/docs/migration/release-notes/0.7.4.md +1 -1
  115. package/docs/migration/release-notes/0.7.5.md +1 -1
  116. package/docs/migration/release-notes/0.8.0.md +1 -1
  117. package/docs/migration/release-notes/0.9.0.md +1 -1
  118. package/docs/migration/release-notes/0.9.14.md +1 -1
  119. package/docs/migration/release-notes/0.9.15.md +1 -1
  120. package/docs/migration/release-notes/0.9.16.md +1 -1
  121. package/docs/migration/release-notes/0.9.17.md +1 -1
  122. package/docs/migration/release-notes/0.9.19.md +1 -1
  123. package/docs/migration/release-notes/0.9.2.md +1 -1
  124. package/docs/migration/release-notes/README.md +27 -31
  125. package/docs/migration/v0.5-to-v0.6.md +759 -0
  126. package/docs/migration/v0.8-to-v0.9.md +1 -1
  127. package/docs/plans/0.9.2-agent-command-workflow-plan.md +423 -0
  128. package/docs/posts/README.md +30 -0
  129. package/docs/posts/akm-command-tour.md +495 -0
  130. package/docs/posts/akm-logo-sized.webp +0 -0
  131. package/docs/posts/belief-aware-memory-12.md +139 -0
  132. package/docs/posts/config-v2-lessons-16.md +191 -0
  133. package/docs/posts/improve-loop-autonomous-10.md +225 -0
  134. package/docs/posts/improve-pipeline-debugging-0803.md +179 -0
  135. package/docs/posts/intro-part-01.md +76 -0
  136. package/docs/posts/intro-part-02.md +221 -0
  137. package/docs/posts/intro-part-03.md +190 -0
  138. package/docs/posts/intro-part-04.md +221 -0
  139. package/docs/posts/llm-mode-reflect-13.md +166 -0
  140. package/docs/posts/openpalm-built-on-akm.md +86 -0
  141. package/docs/posts/progressive-disclosure-06.md +129 -0
  142. package/docs/posts/proposal-safety-net-15.md +112 -0
  143. package/docs/posts/release-0.5.0.md +247 -0
  144. package/docs/posts/release-0.6.0.md +117 -0
  145. package/docs/posts/release-0.7.0.md +159 -0
  146. package/docs/posts/release-0.8.0.md +332 -0
  147. package/docs/posts/scattered-skills-05.md +100 -0
  148. package/docs/posts/task-assets-persistent-workflows-11.md +222 -0
  149. package/docs/posts/team-skills-07.md +198 -0
  150. package/docs/posts/wiki-agent-knowledge-08.md +223 -0
  151. package/docs/posts/workflows-vaults-09.md +321 -0
  152. package/docs/product-surface.md +54 -0
  153. package/docs/reference/README.md +1 -2
  154. package/docs/reference/asset-types.md +168 -0
  155. package/docs/reference/cli.md +5 -6
  156. package/docs/reference/env-and-secrets.md +126 -0
  157. package/docs/reference/memory.md +124 -0
  158. package/docs/reference/refs.md +156 -0
  159. package/docs/reference/registry.md +489 -0
  160. package/docs/reference/website-sources.md +141 -0
  161. package/package.json +12 -15
@@ -0,0 +1,67 @@
1
+ # Architecture Index
2
+
3
+ How akm is built: system overview, normative specs, decision history, and
4
+ subsystem internals.
5
+
6
+ - [Architecture](architecture.md) -- How akm's bundles, cache, index, and registries fit together
7
+ - [Core Principles](akm-core-principles.md) -- Design principles and constraints
8
+ - [Adapters](adapters.md) -- The `BundleAdapter` contract: what a bundle's files *are*, how they're indexed, linted, and written
9
+ - [Architecture: The Workflow Engine](workflow-engine.md) -- How a workflow compiles to a frozen plan, persists run/unit state, dispatches work, and resumes without replaying completed steps
10
+ - [Architecture: The Improvement Loop](improvement.md) -- Purpose and boundary of the improvement loop
11
+ - [Runtime Boundary Design](runtime-boundary-design.md) -- Isolating `bun:sqlite`/`Bun.*` from the core
12
+ - [Architecture Decision History](akm-architecture-decision-history.md) -- ADR-style record of the major architecture rulings
13
+
14
+ ## Specs (`specs/`)
15
+
16
+ Normative specifications and binding conventions.
17
+
18
+ - [OKF format support](specs/okf-support.md) -- OKF is a first-class format supported through the built-in `okf` adapter
19
+ - [0.9.0 surface decisions](specs/0.9.0-decisions.md) -- The decision record (D1-D12) behind the 0.9.0 breaking changes
20
+ - [Bundle & Adapter Spec (0.9.0)](specs/akm-0.9.0-bundle-adapter-spec.md) -- Normative spec for bundles, adapters, and bundle recognition
21
+ - [Ref Grammar Decision (0.9.0)](specs/akm-0.9.0-ref-grammar-decision.md) -- The `[bundle//]conceptId` ref grammar
22
+ - [Ref Format](specs/ref.md) -- Wire format for asset references
23
+ - [Format-Neutral Bundle Workspace Spec](specs/akm-format-neutral-bundle-workspace-spec.md) -- The format-neutral workspace model
24
+ - [Agent, Command, Engine, and Model Resolution](specs/agent-command-engine-model-design.md) -- Approved target semantics for native agent/command bundles, configuration cascading, model maps, and dispatch
25
+ - [0.9.2 Agent/Command/Task/Workflow Implementation Plan](../plans/0.9.2-agent-command-workflow-plan.md) -- Sequenced work packages, [GitHub milestone tracker](https://github.com/itlackey/akm/issues/801), migration rules, support boundaries, and release evidence for the coherent execution MVP
26
+ - [Fact Asset Type](specs/fact-asset-type.md) -- The `fact` asset type
27
+ - [Bundle Conventions Code Spec](specs/stash-conventions-code-spec.md) -- Code-level bundle conventions
28
+ - [Bundle Organization Conventions](specs/stash-organization-conventions.md) -- How a bundle is laid out
29
+ - [DI Seams Plan](specs/di-seams-plan.md) -- Dependency-injection seams used by the test suite
30
+ - [Improve Collapse/Churn Detector](specs/improve-collapse-churn-detector-design.md) -- Longitudinal collapse/churn detection design (§6.3 is the operator runbook referenced by `akm health`)
31
+
32
+ Historical review registers (0.9.0 release-review audit trail, kept for provenance, not normative going forward):
33
+
34
+ - [0.9.0 Docs–Code Drift Register](specs/0.9.0-docs-code-drift-register.md) -- Ruled record of places documentation and code disagreed, and open-intent questions (Q-01..Q-19)
35
+ - [0.9.0 Public API Issue Backlog](specs/0.9.0-public-api-issue-backlog.md) -- Implementation-only findings from the CLI surface review
36
+ - [0.9.0 Release Surface Review](specs/0.9.0-release-surface-review.md) -- Reconciled action list from the end-to-end user-facing surface sweep
37
+
38
+ ## Internals (`internals/`)
39
+
40
+ Current-truth subsystem references.
41
+
42
+ - [Storage Locations](internals/storage-locations.md) -- Authoritative inventory of every on-disk read/write path
43
+ - [Search](internals/search.md) -- Hybrid search architecture and scoring
44
+ - [Indexing](internals/indexing.md) -- How the search index is built
45
+ - [Classification](internals/classification.md) -- Matcher and renderer behavior
46
+ - [Improve Workflow](internals/improve-workflow.md) -- `akm improve` command surface and pipeline reference
47
+ - [Health Advisories](internals/health-advisories.md) -- `akm health` advisory-to-action map for operators
48
+ - [Registry Network Boundary](internals/registry-network-boundary.md) -- Outbound registry request inventory, destination policy, redirects, and DNS guarantees
49
+ - [Functional Contract Patterns](internals/functional-contract-patterns.md) -- Quick reference for contributor pipelines and small process contracts
50
+ - [Fresh-Host Rebuild Runbook](internals/fresh-host-rebuild-runbook.md) -- Rebuild an akm install on a new machine
51
+ - [Persisted-Data Compatibility Contract](persisted-data-compat.md) -- What a reader owes data an earlier release wrote, per persisted format
52
+
53
+ ## Reviews (`reviews/`)
54
+
55
+ Point-in-time architecture reviews of a specific subsystem question.
56
+
57
+ - [Runtime secret resolution for in-process source fetchers](reviews/env-secret-access.md) -- Why secret reads are injected as a `SecretResolver` capability instead of imported inside the fetcher subgraph
58
+
59
+ ## Comparisons (`comparisons/`)
60
+
61
+ - [Workflow architecture: Claude Code workflows vs. akm workflows](comparisons/claude-code-vs-akm-workflows-full.md) -- Full technical comparison of the Claude Code `Workflow` tool and akm workflows; see [the short vendor-neutral guide](../guides/claude-code-vs-akm-workflows.md) for the decision-level version
62
+
63
+ ## Testing (`testing/`)
64
+
65
+ - [Testing Workflow](testing/testing-workflow.md) -- End-to-end, Docker, deployment, and upgrade validation, plus the coverage gap guide
66
+ - [Manual Testing Checklist](testing/manual-testing-checklist.md) -- Pre-release manual QA checklist
67
+ - [OKF v0.2 Conformance Re-Evaluation Runbook](testing/okf-v0.2-conformance-runbook.md) -- Acceptance procedure to re-run after changing adapters, indexing, refs, writes, or lint behavior
@@ -0,0 +1,272 @@
1
+ # Adapters
2
+
3
+ A **`BundleAdapter`** (`src/core/adapter/bundle-adapter.ts`) is the code that
4
+ decides what a bundle's files *are*, how they're indexed, how `akm lint`
5
+ validates them, and where a new item would be placed. 0.9.0 ships 11
6
+ built-in adapters — one per format in
7
+ [Supported Formats](../reference/supported-formats.md). This page is the
8
+ write-path and internals reference; that page is the compatibility table.
9
+
10
+ For read-only native tool bundles, recognition is runtime translation, not
11
+ conversion: the adapter projects native files into AKM's index/runtime shapes
12
+ while the source file remains authoritative. AKM does not synchronize native
13
+ formats, maintain translated canonical copies, or write agent/command assets
14
+ back through the Claude/OpenCode adapters. See
15
+ [Agent, Command, Engine, and Model Resolution](specs/agent-command-engine-model-design.md).
16
+
17
+ > **Stability note.** The adapter set, bundle-recognition rules, and the
18
+ > `bundles` config shape are still evolving — see [STABILITY.md](../../STABILITY.md).
19
+
20
+ ---
21
+
22
+ ## Probe order
23
+
24
+ Each bundle root is owned by exactly **one** adapter, decided once at
25
+ install/index time:
26
+
27
+ 1. If the bundle's config entry sets `components.<id>.adapter` explicitly,
28
+ that adapter wins — no detection runs.
29
+ 2. Otherwise, every built-in adapter's `looksLikeRoot(root)` probe runs in a
30
+ **fixed order**, most-specific markers first. The first probe that
31
+ returns `true` claims the root.
32
+ 3. If no probe fires, the bundle falls back to the `akm` adapter.
33
+
34
+ The order is pinned by `BUILTIN_ADAPTERS` (`src/core/adapter/adapters/index.ts`)
35
+ and enforced by the conformance suite's ordered-owner matrix — it, not any
36
+ prose spec listing, is authoritative:
37
+
38
+ ```text
39
+ website-snapshot -- root manifest.json {url, fetchedAt}
40
+ agent-skills -- a <name>/SKILL.md package at the bundle root
41
+ claude -- root CLAUDE.md + commands/|agents/|skills/
42
+ opencode -- opencode.json(c), or root AGENTS.md + a tool dir
43
+ dotenv -- every top-level dir is env/ and/or secrets/
44
+ akm-workflow -- a top-level .md with explicit type: workflow
45
+ akm-task -- a top-level valid task source v4 .yml (schedule optional)
46
+ llm-wiki -- root schema.md + pages/
47
+ akm -- .stash marker, or 2+ native subdirs, or fallback
48
+ okf -- root index.md, or any .md with frontmatter type
49
+ generic-files -- never auto-selected; explicit config only
50
+ ```
51
+
52
+ The rationale for the ordering:
53
+
54
+ - The three loosest probes — `llm-wiki`, `akm`, and `okf` — stay **last**.
55
+ Native AKM evidence wins before OKF because AKM Markdown is an OKF
56
+ superset; the `akm` probe is strict enough not to claim an OKF bundle
57
+ merely because it contains one familiar directory name.
58
+ - `akm.looksLikeRoot` fires on any root carrying a bundle-subdir-named
59
+ directory — which includes a `.claude`/`.opencode` tool dir (`commands/`,
60
+ `agents/`, `skills/`) and a dotenv bundle (`env/`, `secrets/`). So
61
+ `claude`/`opencode`/`dotenv` come **ahead of** `akm`; their tighter markers
62
+ claim those roots first, and `akm` still wins its own workspace root
63
+ (which those tighter probes reject).
64
+ - `website-snapshot`, `agent-skills`, `akm-workflow`, and `akm-task` carry
65
+ disjoint, specific markers that fire on none of the other roots, so they
66
+ sit at the front for clarity.
67
+ - `generic-files` is explicit-config-only — its `looksLikeRoot` never fires —
68
+ so it's last and can never shadow anything.
69
+
70
+ ---
71
+
72
+ ## `BundleAdapter` interface contract
73
+
74
+ Transcribed from `src/core/adapter/bundle-adapter.ts`:
75
+
76
+ ```ts
77
+ interface BundleAdapter {
78
+ readonly id: string;
79
+ readonly version: string; // feeds incrementality + fingerprints
80
+ readonly extensions: readonly string[]; // longest-match stripping + collision priority
81
+
82
+ // REQUIRED — single-file recognition primitive.
83
+ recognize(c: BundleComponent, file: FileContext): IndexDocument | null;
84
+
85
+ // OPTIONAL — full-component scan for non-per-file layouts (website
86
+ // snapshots, llm-wiki multi-file semantics). Absent -> the core walk
87
+ // (git-aware, symlink-safe, skip-dirs) drives recognize() per file.
88
+ index?(inst: BundleInstallation, c: BundleComponent): AsyncIterable<IndexDocument>;
89
+
90
+ // OPTIONAL — item-scoped incrementality. Default: identity (one file = one item).
91
+ affectedItems?(c: BundleComponent, changedPaths: string[]): string[];
92
+
93
+ // REQUIRED — native validation (change-transaction pre-commit + lint --fix).
94
+ // Adapters MUST NOT write and MUST NOT read the live filesystem: ctx serves
95
+ // a run snapshot with pending changes overlaid, plus a read-only
96
+ // resolveRef for link/xref existence.
97
+ validate(c: BundleComponent, changes: FileChange[], ctx: ValidateContext): Promise<Diagnostic[]>;
98
+
99
+ // OPTIONAL — the CLOSED-FORM set of existing-file placements/read aliases
100
+ // that could own `conceptId`, used for first-owner arbitration without
101
+ // reading authored bytes or walking the bundle.
102
+ readCandidates?(c: BundleComponent, conceptId: string): Array<{ path: string; conceptId: string }>;
103
+
104
+ // OPTIONAL — placement / discovery.
105
+ placeNew?(c: BundleComponent, conceptId: string): string; // where a new item would live
106
+ directoryList?(c: BundleComponent): string[]; // owned dirs; feeds git exact-path staging
107
+ looksLikeRoot?(root: string): boolean; // install-time probe
108
+ }
109
+ ```
110
+
111
+ `recognize` and `validate` are required on every adapter; `index`,
112
+ `affectedItems`, `readCandidates`, `placeNew`, `directoryList`, and
113
+ `looksLikeRoot` are optional capability methods. An adapter overriding `index()` must keep
114
+ `recognize()` coherent with it (conformance: `index()` == fold of
115
+ `recognize()` over the core walk) or declare component-level
116
+ incrementality.
117
+
118
+ `readCandidates` is intentionally distinct from both `extensions` and
119
+ `placeNew`: extensions are non-exhaustive walk hints, while placement is a
120
+ write-normalization policy. Read candidates preserve canonical directory
121
+ manifests (for example `skills/<name>/SKILL.md`) so lookup, index-backed show, and workflow runtime share one
122
+ physical-owner decision. Each candidate carries its canonical concept identity,
123
+ so a byte-denying ownership probe never has to infer identity from the query.
124
+ Path-derived recognition (`toCanonicalName`/`toAssetPath`, `src/core/asset/asset-placement.ts`)
125
+ is a deterministic function of a file's path, so its inverse — every physical
126
+ spelling that could own one conceptId — is computable in CLOSED FORM (#857):
127
+ the canonical placement under the type's own bundle subdir, the loose
128
+ off-canonical placement (an authored path elsewhere in the bundle, keyed off
129
+ its full path relative to the bundle root instead of the type subdir — this
130
+ is what `readCandidates` returns for it), and any type-specific duality (for
131
+ example `env`'s `.env`/`<name>.env` spellings for the "default" alias).
132
+ `readCandidates` enumerates the complete closed-form set directly from the
133
+ conceptId; no bundle walk is needed, so no scan bound applies. The shared
134
+ authority (`src/indexer/lookup/adapter-concept-owner.ts`) still probes every
135
+ candidate with a byte-denying `FileContext` before trusting it, so an
136
+ adapter returning a candidate the file does not actually own is harmless —
137
+ it is simply filtered out.
138
+
139
+ The core walk — the live indexer's per-dir walk, drained by
140
+ `drainDirDocuments` — is one implementation carrying the security policy
141
+ (symlink-safety, skip-dirs, git-awareness); adapters never reimplement it.
142
+
143
+ Cross-component ref existence is a **core** base check, not an adapter
144
+ concern.
145
+
146
+ ---
147
+
148
+ ## `placeNew()` wiring status
149
+
150
+ The interface declares `placeNew()` as an optional capability method, and 9
151
+ of the 11 built-in adapters already implement it — all but `okf` and
152
+ `website-snapshot` (`claude` and `opencode` inherit theirs from the shared
153
+ tool-dir factory). **Nothing in the write path calls it yet**: AKM-native
154
+ writes still resolve through AKM's own flat type→directory placement table
155
+ (`src/core/asset/asset-placement.ts`'s `PLACEMENT_SPECS`), not through the
156
+ owning adapter's `placeNew()`.
157
+
158
+ Placement for every existing bundle is already correct today — this is a
159
+ deliberately sequenced routing change, not unfinished behavior. It's
160
+ scoped out of 0.9.0 by
161
+ [D12](../architecture/specs/0.9.0-decisions.md#d12--bundleadapterplacenew-stays-unwired-until-010)
162
+ and deferred to 0.10; nothing user-visible changes in 0.10 for this alone.
163
+ See [STABILITY.md](../../STABILITY.md) ("On the horizon") for the
164
+ up-to-date status if this changes.
165
+
166
+ ---
167
+
168
+ ## Write allowlists
169
+
170
+ `placeNew()` wiring is a separate question from **which bundles AKM-native
171
+ write commands are allowed to touch at all** — that's decided today by a
172
+ small allowlist check, `assertAkmAssetWrite` (`src/core/write-source.ts`),
173
+ run before any write command touches the filesystem. It compares the target
174
+ bundle's detected (or configured) adapter id against an allowlist and throws
175
+ a `UsageError` on a miss.
176
+
177
+ The default allowlist is `["akm"]`. Two command families widen it explicitly:
178
+
179
+ | Command | Allowlist adds |
180
+ | --- | --- |
181
+ | `akm env create` / `env remove` / `secret set` | `dotenv` |
182
+ | `akm workflow create` | `akm-workflow` |
183
+
184
+ Every other adapter — including every adapter that already implements
185
+ `placeNew()` (`agent-skills`, `claude`, `opencode`, `akm-task`,
186
+ `generic-files`) — is rejected by every AKM-native write command in 0.9.0.
187
+ `akm task add` in particular uses the *default* allowlist (`akm` only), so a
188
+ standalone `akm-task` bundle is read-only through AKM-native write commands
189
+ even though `akm-task`'s own `placeNew()` is implemented.
190
+
191
+ Reading, searching, and `akm lint` are unaffected by this allowlist — only
192
+ creating, editing, or deleting through AKM's own commands is restricted.
193
+ "Read-only" in [Supported Formats](../reference/supported-formats.md) means
194
+ this write-command restriction, not a filesystem permission.
195
+
196
+ This allowlist boundary is also where AKM's [execution
197
+ boundary](../guides/concepts.md) principle shows up on the write side: AKM
198
+ retrieves and validates every supported format, but it only lets its own
199
+ write commands mutate a narrow, explicitly-declared set of targets — it
200
+ does not widen write access to a format just because that format's adapter
201
+ happens to expose a `placeNew()` implementation.
202
+
203
+ ---
204
+
205
+ ## Task adapter
206
+
207
+ The native and standalone `akm-task` paths delegate to the authoritative task
208
+ source parser, `parseTaskSource`, which accepts only `version: 4` (task
209
+ source v4). A task source v4 document declares exactly one executable
210
+ selector (`uses` or `run`), but its scheduling is OPTIONAL — a document with
211
+ no `schedule:` is valid and runnable manually. A `version: 3` or `version: 2`
212
+ document is no longer read by `src` at all: it fails closed with
213
+ `TASK_SCHEMA_VERSION_UNSUPPORTED`, naming `akm migrate` as the path forward.
214
+ See [Tasks](../reference/tasks.md) for the public source contract and the
215
+ migration path.
216
+
217
+ ---
218
+
219
+ ## Implementation caveats
220
+
221
+ A few adapter-specific behaviors are easy to assume differently from how
222
+ they actually work:
223
+
224
+ - **`agent-skills` recognition/validation are decoupled.** The per-change
225
+ half of `validate()` only inspects changes that resolve to an actual
226
+ `SKILL.md`, so an invalid skill is still indexed as `skill` (with its raw,
227
+ invalid name projected) and its field violations surface only for files
228
+ that exist. `missing-skill-md` is the exception and runs as a separate
229
+ directory pass over `ValidateContext.list`: a **top-level** directory that
230
+ holds files but no `SKILL.md` anywhere within three levels is flagged. A
231
+ package's own resource dirs (`pdf-processing/reference/`) are part of the
232
+ item, not candidate packages, and are never considered.
233
+ - **`claude`/`opencode` share one codec** (`tool-dir-shared.ts`) and differ
234
+ only in instruction filename and adapter/component ids. Both accept only
235
+ the canonical plural tool directories.
236
+ - **`dotenv` redaction is a hard, adapter-level contract.** No frontmatter
237
+ `type:` override can bypass it: `env` entries surface only key names,
238
+ `secret` entries surface only the file name, never content. A `.env`
239
+ file placed under `secrets/` is a secret (name-only), not an env group —
240
+ the directory gate wins over the `.env` suffix.
241
+ - **Task adapters share one task source parser.** A standalone `akm-task`
242
+ bundle and task files owned by the native `akm` adapter both route through
243
+ `parseTaskSource`, which accepts only `version: 4` (task source v4) — a
244
+ `version: 3` or `version: 2` document fails closed with
245
+ `TASK_SCHEMA_VERSION_UNSUPPORTED` and is never indexed, validated, or run.
246
+ Task source v4 requires exactly one `uses` or `run` executable selector,
247
+ but its `schedule:` is OPTIONAL. It recognizes `akm/command`, `commands/`,
248
+ `workflows/`, and `scripts/` targets, refuses the github-action `uses:`
249
+ variant entirely (removed in v4 — no equivalent spelling), and refuses
250
+ agent/task refs and unsupported actions. `.yaml` is a collection hint only:
251
+ recognition still gates on `.yml`, so the near miss is diagnosed but never
252
+ indexed or scheduled. See the [Tasks reference](../reference/tasks.md).
253
+ - **`llm-wiki`, `akm`, and `okf` all reserve `index.md`/`log.md`** as
254
+ structural files — never indexed as concepts, never valid write targets —
255
+ at any depth.
256
+ - **`okf`'s lenient wording is not a lenient gate.** `missing-type` and
257
+ broken-link findings are labelled `info:`/`warning:` in the diagnostic
258
+ text, but diagnostics carry no severity field: `akm lint` funnels every
259
+ finding into one `flagged` list, and `--fail-on-flagged` fails on any
260
+ non-empty list.
261
+ - **`generic-files` is the only adapter with no auto-detection at all.**
262
+ `looksLikeRoot` always returns `false`; a bundle only gets this adapter
263
+ through an explicit `components.<id>.adapter: "generic-files"` override.
264
+
265
+ ---
266
+
267
+ ## See also
268
+
269
+ - [Supported Formats](../reference/supported-formats.md) — the compatibility table this page's internals back
270
+ - [Asset Types](../reference/asset-types.md) — the `akm` adapter's 14 native asset types
271
+ - [Concepts](../guides/concepts.md) — the retrieval loop and execution boundary these adapters serve
272
+ - [Architecture](architecture.md) — sources, refs, the search pipeline, and the write-source chokepoint