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,148 @@
1
+ # OKF format support
2
+
3
+ **Status:** DECIDED (0.9.0). OKF is a first-class format supported by AKM
4
+ through the built-in `okf` adapter. First-class means every applicable case in
5
+ the conformance runbook passes end to end; adapter-local recognition alone is
6
+ not sufficient.
7
+
8
+ ## The decision
9
+
10
+ OKF is AKM's least-common-denominator format for Markdown concepts and generic
11
+ read behavior. AKM can install, recognize, index, search, and show conformant
12
+ OKF bundles without converting them to an AKM-native layout. OKF support is
13
+ held to the observable conformance contract in the
14
+ [OKF v0.2 conformance runbook](../testing/okf-v0.2-conformance-runbook.md).
15
+
16
+ That baseline does not make OKF AKM's database schema or force non-Markdown
17
+ formats through Markdown. In particular, OKF is **not**:
18
+
19
+ - an AKM asset type;
20
+ - a serialization imposed on scripts, YAML tasks, environment files, secrets,
21
+ Agent Skills, or other native non-Markdown assets;
22
+ - a replacement for adapter-owned capability, validation, redaction, placement,
23
+ or execution rules.
24
+
25
+ The core provides path identity, open descriptive types, generic Markdown
26
+ content/fragment reads, and a normalized search projection. Adapters add
27
+ behavior to that baseline. They never narrow the core by rejecting an item only
28
+ because its `type` is unfamiliar.
29
+
30
+ ## First-class support contract
31
+
32
+ For a bundle selected as `adapter: okf`, AKM must provide all of the following:
33
+
34
+ 1. Every conformant non-reserved Markdown concept is recognized with its OKF
35
+ path-minus-`.md` concept ID.
36
+ 2. `type`, `title`, `description`, `tags`, and `timestamp` are read according
37
+ to OKF rules. Unknown types and unknown frontmatter fields remain valid.
38
+ 3. `index.md` and `log.md` retain their OKF structural meaning and are not
39
+ indexed as concepts.
40
+ 4. OKF links are retained as relationships. A dangling link does not prevent
41
+ indexing.
42
+ 5. A ref emitted by search for an OKF concept is accepted by show and other
43
+ applicable ref-consuming commands. Adapter-owned concept IDs such as
44
+ `tables/customers` must not be rejected merely because they do not use an
45
+ AKM bundle placement directory.
46
+ 6. Markdown heading fragments are accepted as input-only selectors and never
47
+ become part of durable identity.
48
+ 7. An OKF target without adapter-owned authoring rejects AKM-native write
49
+ commands before touching disk. AKM must never silently place native files in
50
+ an OKF bundle.
51
+
52
+ The shipped `okf` adapter is consumer-only. Its supported behavior is the
53
+ portable content/fragment baseline; it does not infer task, command, script,
54
+ environment, or secret capabilities from an arbitrary OKF `type` value.
55
+
56
+ ## Progressive enhancement
57
+
58
+ AKM Markdown is an OKF-compatible superset. Newly authored AKM Markdown emits a
59
+ non-empty native `type` plus any AKM-specific frontmatter required by its asset
60
+ kind. The `akm` adapter still derives native identity and capability from its
61
+ directory, extension, filename, and content rules; frontmatter `type` does not
62
+ override those rules. Existing legacy Markdown without `type` remains readable
63
+ and is upgraded when AKM creates or semantically rewrites it rather than during
64
+ indexing.
65
+
66
+ The result is progressive enhancement:
67
+
68
+ 1. Any OKF type gets path identity, indexing, search, content show, and heading
69
+ fragments through the `okf` adapter.
70
+ 2. The `akm` adapter recognizes AKM-owned types and adds their specialized
71
+ behavior: command prompts, runnable scripts, workflows, tasks, redacted
72
+ environment/secret views, memories, lessons, and other native capabilities.
73
+ 3. Unknown `type` values remain valid data. They get generic behavior unless
74
+ the selected adapter explicitly adds more.
75
+
76
+ `akm bundle create` records `adapter: akm`. `akm bundle add` records the detected adapter, and an
77
+ explicit configured adapter always wins over probing. Strong native AKM layout
78
+ evidence wins before the broader OKF probe because AKM Markdown is an OKF
79
+ superset. An index-less bundle containing conformant typed Markdown can still be
80
+ recognized as OKF.
81
+
82
+ The normalized `IndexDocument` is the additive cross-format projection. Its
83
+ basic Markdown fields align with OKF, while adapters may project additional
84
+ metadata and capabilities without changing identity.
85
+
86
+ ## v0.2 update (#730)
87
+
88
+ OKF v0.2 (Google Cloud) adds a trust/provenance frontmatter family
89
+ (`generated`/`verified`/`sources`) and a lifecycle family
90
+ (`status`/`stale_after`), standardizes an actor convention
91
+ (`<producer>/<version>` / `human:<id>` / `process:<id>`), and makes one
92
+ breaking-with-fallback change: `timestamp` is superseded by `generated.at`,
93
+ with consumers permitted (and expected) to fall back to the legacy
94
+ `timestamp` field when `generated`/`generated.at` is absent. The decision
95
+ above is unchanged by this update — the `okf` adapter remains **consumer-only**
96
+ and the read/write split stays exactly where §5/§5.1 already drew it:
97
+
98
+ - **Read side (any OKF bundle, third-party or AKM-authored):** the `okf`
99
+ adapter parses the full v0.2 family — `generated.at` (with the `timestamp`
100
+ fallback), `verified` (a list, or v0.2's permitted single-mapping
101
+ shorthand), `sources` (an object list), `status`, `stale_after`, and
102
+ `okf_version` — leniently, exactly like every other optional OKF field
103
+ (missing, malformed, or foreign values never reject a document). These land
104
+ on new, NAMESPACED `IndexDocument` fields (`provenance`, `lifecycleStatus`,
105
+ `staleAfter`, `okfVersion`) rather than overloading the three AKM-native
106
+ fields that already occupy adjacent names: `sources?: string[]` (wiki
107
+ citation strings), `generation?: number` (consolidation merge depth), and
108
+ the existing `quality: "generated"` enum value. See
109
+ `akm-0.9.0-bundle-adapter-spec.md` §0.1 for the full mapping.
110
+ - **Write side (AKM-native assets only, through the proposal path):** since
111
+ AKM Markdown is already an OKF-compatible superset (the progressive-
112
+ enhancement contract above), the new provenance fields are *written* only
113
+ to AKM-native assets, at proposal-promotion time (`promoteProposal`) —
114
+ never through the `okf` adapter, which stays consumer-only. Accepting a
115
+ proposal stamps the v0.2 families using the existing
116
+ `source`/`sourceRun`/`gateDecision`/`review` provenance the proposals system
117
+ already tracks in `state.db`.
118
+
119
+ The on-disk shape is deliberately **hybrid**:
120
+
121
+ - `generated: {by, at}` and `verified: [{by, at}]` are written **bare at the
122
+ top level**, exactly as OKF v0.2 spells them. Neither key has any
123
+ pre-existing AKM consumer, so spelling them the spec's way costs nothing
124
+ and makes the OKF-superset claim above true *for trust metadata* — a
125
+ third-party OKF v0.2 reader pointed at an AKM bundle sees conformant
126
+ provenance rather than one unrecognized `provenance:` key.
127
+ - `sources` alone stays namespaced as `provenance: {sources: [...]}`,
128
+ because a bare top-level `sources:` genuinely collides with the
129
+ pre-existing wiki citation-**string** convention noted above.
130
+
131
+ Every AKM-native markdown type is stamped. `workflow` is the only type whose
132
+ frontmatter is parsed against a closed allowlist, and that allowlist admits
133
+ these keys; a re-validation fallback (promote unstamped, warn) is retained
134
+ only as a backstop should a future type add a closed allowlist.
135
+
136
+ `stale_after`-driven re-verification and trust-tier ranking are explicitly
137
+ out of scope for 0.9.0 (an 0.9.x improve-tuning track).
138
+
139
+ OKF is a month-old, single-vendor **Draft** with no governance body; AKM
140
+ vendors a frozen copy of the spec rules it implements rather than tracking
141
+ upstream live. See the conformance runbook for the pinned upstream reference.
142
+
143
+ ## See also
144
+
145
+ - [`akm-0.9.0-bundle-adapter-spec.md`](./akm-0.9.0-bundle-adapter-spec.md)
146
+ defines the concrete `okf` and `akm` adapter boundaries.
147
+ - [`ref.md`](./ref.md) defines the cross-format ref grammar.
148
+ - [`0.9.0-decisions.md`](./0.9.0-decisions.md) records this positioning as D11.
@@ -0,0 +1,329 @@
1
+ # Ref Format
2
+
3
+ A `ref` is the identifier that `akm search` returns for items and `akm show`
4
+ consumes.
5
+
6
+ Agents should not parse refs or construct them by hand. The intended flow is:
7
+
8
+ ```text
9
+ search -> pick a hit -> pass its ref to show
10
+ ```
11
+
12
+ > **Status.** This document is normative for 0.9.0 and is the target the
13
+ > implementation is being brought to. Sections marked **[0.9.0 change]**
14
+ > describe decisions taken during the 0.9.0 surface review that the code does
15
+ > not yet fully implement; see
16
+ > [`0.9.0-release-surface-review.md`](./0.9.0-release-surface-review.md) and
17
+ > [`0.9.0-decisions.md`](./0.9.0-decisions.md).
18
+
19
+ ## Item Refs
20
+
21
+ Item refs use this wire format:
22
+
23
+ ```text
24
+ [bundle//]conceptId[#fragment]
25
+ ```
26
+
27
+ | Part | Required | Description |
28
+ | --- | --- | --- |
29
+ | `bundle` | no | Workspace bundle slug (e.g. `personal`, `team-catalog`) that owns the item. Separated from the rest of the ref by `//`. When omitted, the ref resolves against the containing bundle (content-internal refs) or, for CLI/API input, against `defaultBundle` and then the remaining bundles in installation-priority order. |
30
+ | `conceptId` | yes | Adapter-defined path within the bundle, `/`-separated and canonicalized by that adapter. Examples: `knowledge/http-caching`, `skills/code-review`, `scripts/db/migrate/run.sh`, `tables/customers`. |
31
+ | `fragment` | no | Selector for a part of the item. For markdown-document items the core interprets it as a **section selector**; for every other item kind it is an adapter-owned selector, opaque to the core. See [Fragments](#fragments). |
32
+
33
+ `type` is **no longer part of a ref**. Identity is a path, not a `type:name`
34
+ pair, and a conceptId is an **opaque path** — akm does not parse meaning out of
35
+ its segments. `skills/deploy` and `workflows/deploy` are distinct concepts that
36
+ never collide because their paths differ, not because their first segment is a
37
+ recognized word.
38
+
39
+ An item's `type` is an **attribute of the resolved item**, supplied by the
40
+ selected adapter, never a predicate parsed out of the ref string. The `okf`
41
+ adapter reads it from OKF frontmatter; the `akm` adapter derives it from its
42
+ native matcher and placement rules. This is why a ref into any bundle —
43
+ `okfbundle//tables/customers`, `wiki//pages/attention` — is just as addressable
44
+ as `personal//memories/vpn-note`. See
45
+ [`okf-support.md`](./okf-support.md).
46
+
47
+ Refs are parsed by `parseBundleRef` in `src/core/asset/asset-ref.ts`. The
48
+ grammar (normative spec §11.1) is:
49
+
50
+ ```text
51
+ ref := [ bundle "//" ] concept-id [ "#" fragment ]
52
+ bundle := any run of non-space chars excluding : . # /
53
+ concept-id := adapter-canonical path within the bundle, / -separated, NFC, case-sensitive
54
+ fragment := section slug (markdown-document items) | adapter-owned selector
55
+ ```
56
+
57
+ The bundle slug excludes `:`, `.`, `#`, `/`, and whitespace so a `bundle//conceptId`
58
+ token is lexically distinct from a URL (whose scheme carries a `:` before `//`) and
59
+ so the first `//` unambiguously bounds the bundle.
60
+
61
+ ### AKM concept ids and adapter layouts
62
+
63
+ The subdirectory prefix is the item's placement directory:
64
+
65
+ | Subdir | Holds | Example conceptId |
66
+ | --- | --- | --- |
67
+ | `scripts/` | Executable scripts | `scripts/deploy.sh` |
68
+ | `skills/` | Skill directories (`SKILL.md`) | `skills/code-review` |
69
+ | `commands/` | Slash-command templates | `commands/release` |
70
+ | `agents/` | Agent definitions | `agents/reviewer` |
71
+ | `knowledge/` | Reference documents | `knowledge/api-guide` |
72
+ | `workflows/` | Workflow documents / programs | `workflows/ship-release` |
73
+ | `memories/` | Recalled context fragments | `memories/deployment-notes` |
74
+ | `lessons/` | Distilled feedback lessons | `lessons/retry-backoff` |
75
+ | `facts/` | Durable bundle-level facts | `facts/team/tool-stack` |
76
+ | `sessions/` | Indexed agent sessions | `sessions/claude/2026-07-24-abc` |
77
+ | `env/` | `.env` configuration groups | `env/prod` |
78
+ | `secrets/` | Single sensitive values | `secrets/deploy-token` |
79
+ | `tasks/` | Scheduled / on-demand tasks | `tasks/nightly-sync` |
80
+
81
+ These are the subdirs the **`akm` adapter** places into and interprets according
82
+ to its own matcher rules. Other bundles use whatever paths their adapters
83
+ declare — an OKF bundle emits `tables/customers`, an LLM wiki emits
84
+ `pages/attention`, and a website snapshot emits its crawled path. Every one of
85
+ those is an equally valid conceptId; the core does not require the leading
86
+ segment to be an AKM placement directory.
87
+
88
+ ### Examples
89
+
90
+ - `scripts/deploy.sh`
91
+ - `skills/code-review`
92
+ - `knowledge/api-guide`
93
+ - `commands/release`
94
+ - `agents/reviewer`
95
+ - `memories/deployment-notes`
96
+ - `env/prod`
97
+ - `personal//knowledge/http-caching`
98
+ - `team-catalog//workflows/release`
99
+ - `knowledge/api-guide#authentication` (section selector)
100
+
101
+ ### Rejected
102
+
103
+ - `viking://skills/deploy` (URI scheme — a `:` before `//` is not a bundle slug)
104
+ - `skills/../../../etc/passwd` (path traversal)
105
+ - `github:owner/repo` (this is an install ref, parsed elsewhere)
106
+ - the pre-0.9.0 `<type>:<name>` grammar (e.g. the old colon-typed spelling) — dead;
107
+ parsed only by the frozen migrator
108
+
109
+ ## Fragments
110
+
111
+ **Scope: `show` only in 0.9.0 (ruled 2026-07-26, Q-06).** `parseRefInput`
112
+ still rejects any `#fragment` outright; `show` is the only command that
113
+ accepts one, by bypassing that shared parser. Every other ref-consuming
114
+ command (graph, tasks, improve, proposals, the utility repo, the indexer
115
+ walk) routes through `parseRefInput` and does not accept fragments yet.
116
+ Wider rollout is post-0.9.0.
117
+
118
+ **[0.9.0 change]** Before 0.9.0 the fragment production existed in the grammar
119
+ and in this document, but every input boundary rejected it
120
+ (`parseRefInput` threw `INVALID_FLAG_VALUE` for any `#fragment`) and nothing
121
+ consumed it. It was stable on paper and unusable in practice. 0.9.0 resolves
122
+ that by giving it one concrete meaning the core implements, and keeping the
123
+ adapter-owned meaning for everything else.
124
+
125
+ **Markdown-document items — section selector (core-implemented).** For an item
126
+ whose adapter presents it as a markdown document, the fragment names a section:
127
+
128
+ ```text
129
+ akm show knowledge/api-guide#authentication
130
+ ```
131
+
132
+ Resolution is: slugify each heading in the document (lowercase, non-alphanumeric
133
+ runs collapsed to `-`, trimmed) and match the fragment against those slugs;
134
+ fall back to a case-insensitive match against raw heading text. The selected
135
+ region runs from that heading to the next heading of the same or higher level.
136
+ A fragment that matches no heading is an error that **lists the available
137
+ fragment slugs** — that error is the discovery mechanism, replacing the removed
138
+ `toc` view mode.
139
+
140
+ **Every other item kind — adapter-owned selector.** Per normative spec §11.3,
141
+ when one item exposes multiple exports the adapter MAY append a stable
142
+ fragment (`team//tools/toolbox#deploy`). The fragment is adapter-owned and
143
+ opaque to the core. The two meanings coexist because the core only interprets
144
+ fragments for items whose adapter declares them markdown documents; for
145
+ everything else it passes the fragment through untouched.
146
+
147
+ **Fragments are input-only.** Durable state — index rows, state keys, proposal
148
+ targets, bindings — never stores a fragment. A stored ref carrying one is
149
+ invalid.
150
+
151
+ ### Superseded: the `akm show` view-mode grammar
152
+
153
+ **[0.9.0 change]** `akm show <ref> toc|section "H"|lines A B|frontmatter|full`
154
+ is removed. It was a second argv parser (`normalizeShowArgv` rewrote
155
+ `process.argv` and injected hidden `--akmView` / `--akmHeading` / `--akmStart` /
156
+ `--akmEnd` flags), and its view keywords were reserved words in ref position.
157
+
158
+ | Old | New |
159
+ | --- | --- |
160
+ | `akm show X section "Auth"` | `akm show X#auth` |
161
+ | `akm show X full` | `akm show X` (no fragment = whole item) |
162
+ | `akm show X toc` | `akm show X#<unmatched>` lists available fragment slugs |
163
+ | `akm show X lines 10 30` | removed — every response carries `path`; slice the file |
164
+ | `akm show X frontmatter` | removed — if a raw-YAML projection proves necessary it returns as a `--shape` value, the designated projection axis |
165
+
166
+ ## Ref-prefix enumeration (browse)
167
+
168
+ **[0.9.0 change]** Browsing a subtree uses a **conceptId prefix**, matching the
169
+ grammar refs are actually emitted in:
170
+
171
+ ```text
172
+ akm search "memories/" # every memory in scope
173
+ akm search "memories/projecta/" # one subtree
174
+ akm search "team-catalog//" # every item in one bundle
175
+ akm search "team-catalog//skills/" # one subtree of one bundle
176
+ ```
177
+
178
+ A trailing `/` is required for a non-empty prefix, giving exact `/`-boundary
179
+ subtree semantics (`projecta/` cannot match a sibling `projectalpha/`). A query
180
+ with interior whitespace is prose, not a prefix — it stays an ordinary keyword
181
+ search.
182
+
183
+ This replaces the pre-0.9.0 `akm search "<type>:"` / `"<type>:<prefix>/"`
184
+ grammar, which had three defects: it resurrected the singular `type:` spelling
185
+ the release removed; it validated against the `akm` adapter's placement types,
186
+ so items from every other adapter could not be enumerated at all; and it
187
+ matched against item *names* while every displayed ref is a conceptId — so
188
+ copying a ref prefix out of search output and pasting it back in silently
189
+ degraded to a keyword search.
190
+
191
+ Because enumeration is now prefix-matching over conceptIds, it covers every
192
+ adapter's items uniformly, and `bundle//` enumeration replaces the removed
193
+ `akm bundle items` command.
194
+
195
+ ## Asset types are free-form
196
+
197
+ `type` is adapter-supplied metadata that presents, ranks, and filters — it
198
+ never executes and never identifies. The OKF adapter reads the open OKF `type`
199
+ field and defaults it according to OKF adapter rules; other adapters derive a
200
+ type from their native formats. `IndexDocument.type` is an open string by
201
+ contract, and adapters emit types outside the `akm` adapter's placement set
202
+ (`website`, `wiki-source`, an LLM-wiki page's `pageKind`, `instruction`, and
203
+ anything an OKF bundle author writes).
204
+
205
+ Consequently `akm search --type <t>` is an **exact string match against an open
206
+ set, deliberately unvalidated**: an unrecognized type returns zero hits rather
207
+ than an error, because "unrecognized" is not a decidable property. Callers that
208
+ want a closed set should filter on conceptId prefix instead (see above).
209
+
210
+ The closed set still applies where a type must select a *write placement* —
211
+ `akm proposal new <type> <name>`, `placeNew` — because those need a directory to write to.
212
+
213
+ ## Reserved structural files
214
+
215
+ For the OKF adapter, `index.md` (directory listing / progressive disclosure)
216
+ and `log.md` (update history) are reserved structural files at every level and
217
+ are never concepts. The `akm` and `llm-wiki` adapters independently reserve
218
+ the same names as part of their own format contracts. Other adapters own their
219
+ reserved-name rules; the cross-format ref grammar does not impose OKF
220
+ structure on them. Item writes must follow the selected adapter's rules.
221
+
222
+ ## Install Refs (distinct grammar)
223
+
224
+ `akm add` and one-shot `akm clone` accept a different ref grammar. Install
225
+ refs locate an upstream kit to fetch; they are **not** item refs and are
226
+ parsed by `parseRegistryRef` in `src/registry/resolve.ts`.
227
+
228
+ ```text
229
+ install-ref := github-ref | git-url | npm-pkg | https-url | skills-sh-slug | local-path
230
+ ```
231
+
232
+ Examples: `github:owner/repo#v1.2.3`, `git+https://gitlab.com/org/kit`,
233
+ `@scope/kit`, `https://docs.example.com`, `skills.sh:code-review`,
234
+ `./path/to/kit`.
235
+
236
+ The two parsers are intentionally distinct — each rejects the other's inputs.
237
+ Item refs never carry URI schemes; install refs are not addressable through
238
+ `akm show`.
239
+
240
+ ## Bundle prefix
241
+
242
+ When a ref includes a bundle prefix, `akm show` narrows lookup to that bundle:
243
+
244
+ ```text
245
+ team-catalog//scripts/deploy.sh
246
+ personal//knowledge/my-notes
247
+ ```
248
+
249
+ When absent, a short ref from CLI/API input resolves to `defaultBundle` if the
250
+ conceptId exists there, otherwise to the first bundle containing it in installation
251
+ priority order (first match wins, deterministically). A short ref inside bundle
252
+ content resolves against its **containing** bundle. To pin lookup to a single
253
+ bundle programmatically, use `resolveRef(input, { only: bundleId })` — there is no
254
+ ref spelling for "primary only".
255
+
256
+ ## Refs in prose
257
+
258
+ Refs embedded in prose MUST use the fully-qualified `bundle//conceptId` form —
259
+ the bundle-slug charset makes such a token lexically anchored — or a native
260
+ link form owned by the adapter (OKF links, wiki links). **Bare short refs in
261
+ prose are not refs**: `memories/foo` in a sentence is ordinary text, and no
262
+ tool may rewrite it.
263
+
264
+ Only lint's missing-ref scan honours this rule today. The other consumer,
265
+ `akm mv`'s inbound-ref rewriting, was defective: it implemented the rule
266
+ exactly inverted (it rewrote bare conceptIds and matched no `bundle//` pattern
267
+ at all), so it rewrote prose that is not a ref while leaving real anchored
268
+ refs dangling. That defect is why `akm mv` shipped **Experimental** earlier in
269
+ the 0.9.0 cycle and was never covered by the stability contract.
270
+
271
+ **Amended 2026-07-30.** `akm mv` was removed outright before the 0.9.0
272
+ release (no alias, no stub — see [`0.9.0-decisions.md` §D3](./0.9.0-decisions.md#d3--renames-are-delete--create-akm-mv-ships-experimental)).
273
+ There is no tool today that rewrites inbound refs on rename; see "Renames and
274
+ moves" below for the current procedure.
275
+
276
+ ## Renames and moves
277
+
278
+ **[0.9.0 change]** A rename or move is **delete plus create**. The destination
279
+ is a new identity: it gets a fresh index row, and learned state (utility,
280
+ salience, outcomes, usage history) does not follow it.
281
+
282
+ ```sh
283
+ mv ~/akm/memories/old-note.md ~/akm/memories/new-note.md
284
+ # update any intentional refs to it
285
+ akm index
286
+ akm lint # confirms nothing dangles
287
+ ```
288
+
289
+ Moving an item **between bundles** is copy/import followed by deletion from the
290
+ source. Both the bundle and the concept identity change; there is no
291
+ identity-preserving cross-bundle move.
292
+
293
+ This supersedes the pre-0.9.0 rule that a rename "MUST use an explicit
294
+ state-rekey transaction". That rule was a product choice made during the bundle
295
+ refactor, not a constraint the architecture imposes. `akm mv`, which implemented
296
+ the superseded rule, shipped briefly as an **Experimental** surface outside
297
+ the stability contract, because its inbound-ref rewriting was inverted (above),
298
+ then was removed outright before the 0.9.0 release. The procedure above —
299
+ plain filesystem move, then `akm index`, then `akm lint` — is the only
300
+ supported path today. If preserving learned state through renames later proves
301
+ materially valuable, a narrow same-bundle `akm rename` can return — resolving
302
+ through the index, using adapter-owned placement, accepting qualified refs,
303
+ rewriting only anchored prose refs, applying one qualified old→new state
304
+ mapping, and rebuilding derived index data rather than preserving row IDs.
305
+
306
+ **Amended 2026-07-30.** Carrying learned state (utility, salience, usage
307
+ history) across a rename is opt-in and out-of-band: run
308
+ `bun scripts/rekey-asset-ref.ts <old-ref> <new-ref>` from a source checkout
309
+ **before** `akm index`, and it re-keys the `entries` row plus
310
+ `asset_salience`/`asset_outcome`/`usage_events` in place rather than letting
311
+ `akm index` mint a fresh row. Automated garbage collection of orphaned rows
312
+ left by renames that skip this script is tracked as issue #733; until it
313
+ lands, the script is the only path. See
314
+ [`v0.9.0-troubleshooting.md`](../../migration/v0.9.0-troubleshooting.md) for
315
+ the full walkthrough.
316
+
317
+ ## Usage Notes
318
+
319
+ Consumers should use structured fields like `conceptId` and `bundle` for display,
320
+ and pass the full `ref` string back to `show` as the lookup token.
321
+
322
+ ## Canonical Form
323
+
324
+ Refs are emitted in canonical form: the bundle slug (when qualified), the
325
+ adapter-canonical conceptId, and an optional `#fragment`. The adapter decides
326
+ whether an on-disk extension is stripped: OKF and AKM Markdown items strip
327
+ `.md`, scripts retain executable extensions, and directory-items such as
328
+ skills resolve on the directory path (`skills/<dir>`, not
329
+ `skills/<dir>/SKILL`).
@@ -0,0 +1,72 @@
1
+ # Review corpus — task/workflow format unification
2
+
3
+ Reference record for
4
+ [`../../task-workflow-format-unification.md`](../../task-workflow-format-unification.md).
5
+ Every revision of that spec from v8 onward was shaped by these reviews; the
6
+ spec's §11 cross-references findings by the ids used here.
7
+
8
+ ## Round 0 — three independent adversarial reviews of spec v7
9
+
10
+ Three reviewers, identical briefs, no shared context — overlap between
11
+ reports is therefore independent confirmation, and unanimous findings
12
+ (3/3) were treated as settled facts.
13
+
14
+ | File | Contents |
15
+ |---|---|
16
+ | [`opus-review-1.md`](./opus-review-1.md) | Reviewer 1 full report |
17
+ | [`opus-review-2.md`](./opus-review-2.md) | Reviewer 2 full report |
18
+ | [`opus-review-3.md`](./opus-review-3.md) | Reviewer 3 full report |
19
+ | [`findings-consolidated.md`](./findings-consolidated.md) | Deduplicated findings (C1–C5, M1–M13, minors) with per-reviewer attribution — the ids the spec's §11 uses |
20
+
21
+ Outcome: v7 → v8 full redesign (IR v4 invocation union, hashVersion 5,
22
+ two output schemas, cascade built-not-exposed, `with:`, env provenance
23
+ split, migration rebuilt).
24
+
25
+ ## Round 1 — four-lens panel on spec v8
26
+
27
+ | File | Lens |
28
+ |---|---|
29
+ | [`panel-r1-coverage.md`](./panel-r1-coverage.md) | Findings-coverage audit: does §11 resolve each round-0 finding, or just name it |
30
+ | [`panel-r1-architecture.md`](./panel-r1-architecture.md) | Module boundaries and seams against the codebase's own idioms |
31
+ | [`panel-r1-adversarial.md`](./panel-r1-adversarial.md) | Fresh defect hunt on what v8 itself introduced |
32
+ | [`panel-r1-security.md`](./panel-r1-security.md) | Script-execution policy, env/redaction contracts, migration mechanics |
33
+
34
+ Outcome: v8 → v9. Headline: the per-bundle script-execution grant was
35
+ withdrawn (contradicted `activation-policy.ts`'s no-new-trust-machinery
36
+ decision) in favor of exact 07 P1-D ceiling inheritance; persona snapshot
37
+ added to the hash preimage; `with:` merge defined; tombstone read-only
38
+ carve-out and interruption-safe conversion ordering.
39
+
40
+ ## Round 2 — verification on spec v9
41
+
42
+ | File | Lens |
43
+ |---|---|
44
+ | [`panel-r2-verification.md`](./panel-r2-verification.md) | Every round-1 critical/major re-checked against v9 and code — verdict: **all fixes hold** |
45
+ | [`panel-r2-adversarial.md`](./panel-r2-adversarial.md) | Cold pass, no prior context — verdict: no design flaws; two evidence corrections (the real placeholder filler; indexer-classifier recognition), both applied |
46
+
47
+ ## Library evaluations — buy-vs-build investigation
48
+
49
+ Three independent investigations into replacing the hand-rolled engine
50
+ with a third-party library, all verified against live artifacts rather
51
+ than training knowledge. Decision record:
52
+ [`../../workflow-engine-buy-vs-build.md`](../../workflow-engine-buy-vs-build.md).
53
+
54
+ | File | Scope |
55
+ |---|---|
56
+ | [`library-eval-bunqueue.md`](./library-eval-bunqueue.md) | bunqueue — full rubric + source read |
57
+ | [`library-eval-openworkflow.md`](./library-eval-openworkflow.md) | OpenWorkflow — full rubric, **executed** (SIGKILL durability probe, reproduced schema collision) |
58
+ | [`library-eval-alternatives.md`](./library-eval-alternatives.md) | Landscape survey — 25+ candidates against the no-server / SQLite / Bun+Windows / license constraints |
59
+
60
+ Outcome: **build**. ~6% of `exec`+`ir` is the generic durable-execution
61
+ concern libraries sell; the best candidate deletes 8–12% while removing
62
+ cancellation, concurrency caps, and transactional atomicity.
63
+
64
+ ## Reading notes
65
+
66
+ - Reports cite `file:line` against the branch state they reviewed
67
+ (`claude/release-0-9-0-polish-d6sycl` @ `71bb686` + this spec's branch);
68
+ lines drift as the base moves.
69
+ - Not every claim in the raw reports survived verification — e.g. round 1's
70
+ "the `tools:` ceiling doesn't exist" was disproven (`show.ts:433-445`).
71
+ Where a report and the spec disagree, the spec's §11 records the
72
+ adjudication and is authoritative.