@aikdna/kdna-core 0.18.0 → 0.19.0

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 (44) hide show
  1. package/CHANGELOG.md +128 -94
  2. package/README.md +109 -215
  3. package/package.json +7 -2
  4. package/schema/agent-host-capabilities.schema.json +62 -0
  5. package/schema/agent-host-receipt.schema.json +371 -0
  6. package/schema/agent-host-request.schema.json +223 -0
  7. package/schema/{bundle-profile-v1.schema.json → bundle-profile.schema.json} +9 -5
  8. package/schema/checksums.schema.json +8 -8
  9. package/schema/consumption-plan.schema.json +428 -0
  10. package/schema/digest-evidence.schema.json +115 -26
  11. package/schema/{kdna-envelope-external-grant-v1.schema.json → external-grant-envelope.schema.json} +17 -4
  12. package/schema/{kdna-key-grant-v1.schema.json → external-key-grant.schema.json} +39 -7
  13. package/schema/judgment-trace.schema.json +1251 -0
  14. package/schema/load-plan.schema.json +5 -3
  15. package/schema/manifest.schema.json +70 -10
  16. package/schema/{payload-profile-v1.schema.json → payload-profile.schema.json} +30 -6
  17. package/schema/{runtime-capsule-2.schema.json → runtime-capsule.schema.json} +7 -31
  18. package/src/asset-reader.js +8 -2
  19. package/src/{v1 → container}/index.js +385 -198
  20. package/src/container/index.mjs +20 -0
  21. package/src/container-dispatcher.js +6 -6
  22. package/src/crypto-profile.js +37 -107
  23. package/src/external-key-grant.js +41 -15
  24. package/src/index.js +11 -8
  25. package/src/index.mjs +49 -45
  26. package/src/loader-compatibility.js +59 -0
  27. package/src/loader.js +1 -1
  28. package/src/public-api.js +5 -5
  29. package/src/remote-runtime.d.ts +13 -0
  30. package/src/remote-runtime.js +27 -0
  31. package/src/remote-runtime.mjs +3 -0
  32. package/src/runtime-api.js +5 -5
  33. package/src/{capsule-v2.js → runtime-capsule.js} +96 -254
  34. package/src/{execution-contract-v1.js → runtime-contract.js} +184 -152
  35. package/src/types.d.ts +200 -277
  36. package/src/workpack-pure.js +1 -1
  37. package/schema/agent-host-2-receipt.schema.json +0 -206
  38. package/schema/agent-host-2-request.schema.json +0 -135
  39. package/schema/agent-host-capabilities-1.schema.json +0 -40
  40. package/schema/consumption-plan-1.schema.json +0 -280
  41. package/schema/judgment-trace-1.schema.json +0 -748
  42. package/schema/runtime-capsule-1.schema.json +0 -68
  43. package/src/lint-pure.js +0 -433
  44. package/src/v1/index.mjs +0 -21
package/CHANGELOG.md CHANGED
@@ -1,37 +1,70 @@
1
1
  # Changelog
2
2
 
3
- ## v0.18.0 (2026-07-15)
3
+ ## Unreleased
4
4
 
5
5
  ### Added
6
6
 
7
- - Add opt-in Runtime Capsule 2 Core primitives, formal Capsule 1/Capsule 2 and
8
- digest-evidence schemas, RFC 8785 JCS delivery hashing, deterministic
9
- v2-to-v1 adaptation, and committed A/C/E/P conformance goldens. Existing
10
- Runtime load entry points continue to emit frozen Capsule 1 values.
11
- - Accept independent expected A/C/E values through `expectedDigests` and block
12
- Capsule 2 emission with digest-specific mismatch codes.
13
- - Preserve the four frozen Capsule 1 inheritance, dependency, and RAG
14
- extension fields through the one-way Capsule 2 compatibility member.
15
- - Define strict opt-in ConsumptionPlan 1.0, Agent Host 2, capability, runtime
16
- receipt, and authoritative JudgmentTrace 1.0 schemas. Add committed
17
- negotiation, plan/P recomputation, five-terminal Trace, exact-budget,
18
- source-directory block, required-null, and cross-document tamper conformance
19
- vectors. Plan 1 formally supports only Capsule 2 plus Host 2 and has no
20
- downgrade or adapter; runtime defaults remain Plan 0.9, Capsule 1, and Host 1.
7
+ - Add the separate `@aikdna/kdna-core/remote-runtime` package subpath for a
8
+ deployer-controlled, single packaged remote asset. It validates and loads one
9
+ immutable byte snapshot into a fixed full JSON Runtime Capsule while the
10
+ package-root consumer loaders continue to return
11
+ `KDNA_AUTH_REMOTE_RUNTIME_REQUIRED`.
12
+
13
+ ## 0.19.0 (2026-07-16)
14
+
15
+ ### Fixed
16
+
17
+ - Enforce `compatibility.min_loader_version` as a strict `x.y.z` loader package
18
+ coordinate across inspect, validate, default verification, LoadPlan, and
19
+ load. Requirements above Core `0.19.0` now fail closed with
20
+ `KDNA_LOADER_VERSION_UNSUPPORTED` before projection; malformed coordinates
21
+ remain schema failures, and arbitrary-size components compare without
22
+ numeric overflow.
23
+
24
+ - Require the manifest encryption profile and compatibility coordinate to
25
+ identify a supported contract, and reject a missing, unknown, or
26
+ envelope-mismatched `profile_version` before decryption.
27
+ - Bind encrypted payloads to a required manifest encryption declaration and
28
+ the sole supported `payload.kdnab` entry instead of accepting a missing or
29
+ unrelated encrypted-entry list.
30
+ - Keep the canonical JudgmentTrace schema's blocked Runtime negotiation codes
31
+ identical to the Runtime implementation, TypeScript declarations, and
32
+ conformance fixtures.
33
+ - Accept only `reasoning.self_check` in judgment payloads and fail closed on
34
+ the deprecated plural field or malformed entries.
35
+ - Preserve each validated self-check string or structured question exactly in
36
+ compact Runtime Capsule projection instead of silently dropping or changing
37
+ its shape.
38
+ - Keep the canonical and packaged payload schemas byte-for-byte identical, and
39
+ regenerate the committed CBOR and authorization conformance fixtures with
40
+ matching checksums and digest evidence.
41
+
42
+ ## 0.18.0 (2026-07-15)
43
+
44
+ ### Added
45
+
46
+ - Introduce experimental Runtime Capsule and Host-contract candidates. These
47
+ candidates and their one-way adapter were superseded by the sole stable,
48
+ responsibility-named contracts; they are not supported aliases.
49
+ - Add digest-evidence schemas, RFC 8785 JCS delivery hashing, independent
50
+ expected A/C/E comparisons, digest-specific mismatch codes, and committed
51
+ A/C/E/P conformance goldens.
52
+ - Add committed negotiation, Plan/P recomputation, terminal Trace,
53
+ exact-budget, source-directory block, required-null, and cross-document
54
+ tamper vectors for ConsumptionPlan, Agent Host, and JudgmentTrace.
21
55
  - Bind Trace elapsed evidence to the correlated Host receipt, make
22
56
  unobserved finite limits propagate to an honest `not_observed` overall
23
57
  comparison, and record Host-side P mismatch as a correlated pre-execution
24
58
  rejection instead of an impossible terminal state.
25
- - Expose the strict opt-in ConsumptionPlan 1, Agent Host 2, budget-evidence,
26
- and JudgmentTrace 1 builders and validators from CJS, ESM, and TypeScript.
27
- The conformance runner now consumes this single packaged implementation.
59
+ - Expose ConsumptionPlan, Agent Host, budget-evidence, and JudgmentTrace
60
+ builders and validators from CJS, ESM, and TypeScript.
28
61
  - Add a dedicated pre-Host budget-blocked Trace builder and validator. They
29
62
  preserve projected A/C/E/P, profile, and exact character evidence without
30
63
  exposing an over-budget Host request; calls within budget fail closed.
31
- - Add a bounded raw execution-contract JSON parser that rejects duplicate
64
+ - Add a bounded runtime-contract JSON parser that rejects duplicate
32
65
  decoded keys, invalid UTF-8 and Unicode, BOMs, hostile-key prototype
33
66
  mutation, non-finite numbers, and trailing or non-RFC JSON input before
34
- Host 2 object validation.
67
+ Agent Host object validation.
35
68
 
36
69
  ### Changed
37
70
 
@@ -61,7 +94,7 @@
61
94
 
62
95
  ### Fixed
63
96
 
64
- - Restrict Core publication to canonical `kdna-core-v*` published-release
97
+ - Restrict Core publication to canonical `core/<package-version>` published-release
65
98
  events, require the exact version tag to identify the workflow commit, and
66
99
  make already-published versions idempotent only when registry `gitHead` and
67
100
  artifact integrity and SHA-1 shasum match the current release evidence. Only
@@ -85,7 +118,7 @@
85
118
  so package-manager lifecycle behavior cannot introduce network or build-tool
86
119
  dependencies into the offline release gate.
87
120
  - Require a non-null independently trusted Plan digest throughout the strict
88
- Plan 1 / Host 2 chain, snapshot hostile validation contexts without invoking
121
+ ConsumptionPlan / Agent Host chain, snapshot hostile validation contexts without invoking
89
122
  accessors, and keep pre-Host budget enforcement unavailable as a public
90
123
  bypass option.
91
124
  - Require matched Host receipts to correlate sender, Host-recomputed, echoed,
@@ -95,16 +128,13 @@
95
128
  - Check internal C/E declarations and canonical/legacy alias agreement before
96
129
  independent expected values, so external matches cannot hide conflicting
97
130
  asset declarations.
98
- - Validate public Capsule 2 builder and adapter inputs and outputs against the
99
- packaged schemas and cross-field success invariants.
100
- - Preserve only the frozen Capsule 1 access aliases `open`, `protected`, and
101
- `runtime` for exact adapter parity while keeping Capsule 2 access canonical;
102
- fail closed if compatibility metadata pairs an alias with the wrong
103
- canonical access.
104
- - Compute Capsule 1 E directly from Runtime manifest and payload bytes when
105
- checksums are absent, share the same pure E implementation across checksum
106
- build/verify and both Capsule generations, and reject Capsule 1 builder
107
- inputs that disagree with their manifest or digest evidence.
131
+ - Validate Runtime Capsule builder inputs and outputs against packaged schemas
132
+ and cross-field success invariants.
133
+ - Fail closed when access metadata is unknown or internally inconsistent.
134
+ - Compute E directly from Runtime manifest and payload bytes when checksums are
135
+ absent, share the same pure E implementation across checksum build and
136
+ verification, and reject builder inputs that disagree with their manifest
137
+ or digest evidence.
108
138
  - Sort canonical content-tree and signing entry paths by UTF-8 bytes while
109
139
  retaining the existing UTF-16 JSON object-key order. U+E000/U+10000 vectors
110
140
  freeze the distinction.
@@ -118,7 +148,7 @@
118
148
  now fails explicitly rather than pretending current payloads are old source
119
149
  files.
120
150
 
121
- ## v0.17.0 (2026-07-14)
151
+ ## 0.17.0 (2026-07-14)
122
152
 
123
153
  ### Added
124
154
 
@@ -151,7 +181,7 @@
151
181
  - Derive web-package readiness expectations from the declared current Core
152
182
  version rather than a stale hard-coded release number.
153
183
 
154
- ## v0.16.0 (2026-07-13)
184
+ ## 0.16.0 (2026-07-13)
155
185
 
156
186
  ### Added
157
187
 
@@ -178,29 +208,30 @@
178
208
  - Revoked, expired, tampered, digest/version/account/device mismatches fail
179
209
  closed before Runtime Capsule projection.
180
210
 
181
- ## v0.15.12 (2026-07-12)
211
+ ## 0.15.12 (2026-07-12)
182
212
 
183
213
  **Single-format refactor + CBOR wire contract + Runtime Capsule.**
184
214
 
185
215
  ### Breaking changes
186
216
 
187
- - `MIMETYPE_V1`, `MIMETYPE_V2`, `MIMETYPE_LEGACY`, `isV1SourceDir`, `isV2SourceDir`
188
- removed from public API. Use `MIMETYPE`, `isKdnaSourceDir`, `detectContainerFormat`.
217
+ - Remove generation-qualified mimetype constants and source-directory helpers
218
+ from the public API. Use `MIMETYPE`, `isKdnaSourceDir`, and
219
+ `detectContainerFormat`.
189
220
  - `detectContainerFormat` returns only `"kdna"` or `null`.
190
- - `kdna_version: "2.0"` is no longer accepted. Only `"1.0"`.
221
+ - Remove the parallel legacy container discriminator. The current contract is
222
+ now represented solely by `format_version`.
191
223
  - `payload.encoding` accepts only `"cbor"`. JSON payload bytes are rejected;
192
224
  there is no production JSON fallback.
193
- - Version-qualified public APIs (`V1_REQUIRED_DIR_ENTRIES`, `readV1Layout`,
194
- `buildChecksumsV1`, `loadV1`, and the `./v1` export) are removed. Use the
195
- unversioned APIs below.
196
- - `kdna load --as=json` now returns Runtime Capsule format
197
- (`type: "kdna.context.capsule"`) instead of raw `{status, content}`.
225
+ - Version-qualified public APIs and the generation-qualified subpath export
226
+ are removed. Use the stable APIs below.
227
+ - `kdna load --as=json` returns a Runtime Capsule instead of raw
228
+ `{status, content}`.
198
229
 
199
230
  ### Added
200
231
 
201
232
  - `REQUIRED_DIR_ENTRIES`, `readLayout`, `buildChecksums`, `load`, and
202
233
  `loadAsset` are the sole public container/loading APIs.
203
- - `buildCapsule(loadResult, v1, profile, opts)` — wraps load output as
234
+ - `buildCapsule(loadResult, pre-cutover, profile, opts)` — wraps load output as
204
235
  `kdna.context.capsule` per `specs/runtime-capsule.md`.
205
236
  - `parsePayloadEntry` — strict CBOR decoding for `payload.kdnab`.
206
237
 
@@ -208,27 +239,27 @@
208
239
 
209
240
  - Producer/consumer encoding alignment: `dev-pack.js`, `studio.js` write CBOR;
210
241
  validation and loading decode CBOR, including encrypted envelopes.
211
- - `loadV1Unsafe` extends/deps processing occurs before Capsule wrapping (Story 12 fix).
242
+ - `loadAssetUnsafe` extends/deps processing occurs before Capsule wrapping (Story 12 fix).
212
243
  - All test fixtures converted to CBOR; golden files regenerated.
213
244
 
214
- ## v0.15.11 (2026-07-03)
245
+ ## 0.15.11 (2026-07-03)
215
246
 
216
- **Fix**: repair Core v1 container dispatcher module resolution in the
247
+ **Fix**: repair Core container dispatcher module resolution in the
217
248
  published package layout.
218
249
 
219
250
  - Corrects internal `src/container-dispatcher.js` imports so the dispatcher can
220
- load sibling `asset-reader` and `v1` modules after npm packaging.
221
- - Loads v1 JSON schemas through package-relative static imports before falling
251
+ load sibling `asset-reader` and container modules after npm packaging.
252
+ - Load Runtime schemas through package-relative static imports before falling
222
253
  back to disk discovery, so bundled server environments do not look for
223
254
  KDNA schemas in the host application directory.
224
- - Adds regression coverage for loading a v1 source asset through the dispatcher
255
+ - Add regression coverage for loading a source asset through the dispatcher
225
256
  from the package `src/` layout and for validating from a non-repository cwd.
226
257
  - Fix webpack bundler warning: use `eval('require')` for ajv meta-schema import
227
258
  so webpack does not try to statically resolve the JSON file at build time.
228
259
 
229
260
  No public API changes.
230
261
 
231
- ## v0.15.10 (2026-06-30)
262
+ ## 0.15.10 (2026-06-30)
232
263
 
233
264
  **API**: export `parseSemver`, `compareSemver`, `satisfies` from public module.
234
265
 
@@ -243,9 +274,9 @@ a parallel copy.
243
274
 
244
275
  No breaking changes. Purely additive.
245
276
 
246
- ## v0.15.9 (2026-06-28)
277
+ ## 0.15.9 (2026-06-28)
247
278
 
248
- Story 12 — Asset inheritance (`extends` field, RFC #148 v2.x Phase 3).
279
+ Story 12 — Asset inheritance (`extends` field, RFC #148 later pre-cutover.x Phase 3).
249
280
 
250
281
  - **`extends` field in `manifest.schema.json`**: assets may declare
251
282
  `extends: "@scope/name@^1.0.0"` (string) or `extends: { name, version }`
@@ -255,9 +286,9 @@ Story 12 — Asset inheritance (`extends` field, RFC #148 v2.x Phase 3).
255
286
  and the manifest declares `extends`, `planLoad` resolves the base asset and
256
287
  records `extends_chain` in the plan output. Non-blocking — missing base
257
288
  emits a WARNING issue, not a blocking error.
258
- - **`loadAuthorized` passes `extends_chain`** from the plan to `loadV1Unsafe`
289
+ - **`loadAuthorized` passes `extends_chain`** from the plan to `loadAssetUnsafe`
259
290
  so the inheritance merge is applied at load time.
260
- - **`loadV1Unsafe` inheritance merge**: when `extendsChain` is non-empty, the
291
+ - **`loadAssetUnsafe` inheritance merge**: when `extendsChain` is non-empty, the
261
292
  base asset's content is loaded and merged with the child's content. Merge
262
293
  rules: child axioms override parent axioms with the same `id`; parent axioms
263
294
  not in child are inherited; same for boundaries (by `scope` text);
@@ -266,9 +297,9 @@ Story 12 — Asset inheritance (`extends` field, RFC #148 v2.x Phase 3).
266
297
  to load output when inheritance is applied.
267
298
  - Blocks Story 13 (trust levels) per Section 6 sequencing.
268
299
 
269
- ## v0.15.8 (2026-06-28)
300
+ ## 0.15.8 (2026-06-28)
270
301
 
271
- Story 11 — RAG namespace isolation (RFC #148 v2.x Phase 3).
302
+ Story 11 — RAG namespace isolation (RFC #148 later pre-cutover.x Phase 3).
272
303
 
273
304
  - **`rag_namespace`** field added to each entry in `resolved_dependencies`.
274
305
  Format: `name@version` (or bare `name` when version is absent). Provides a
@@ -284,7 +315,7 @@ Story 11 — RAG namespace isolation (RFC #148 v2.x Phase 3).
284
315
  - No breaking changes to existing single-asset load output or to
285
316
  `resolved_dependencies` shape (fields are additive only).
286
317
 
287
- ## v0.15.7 (2026-06-28)
318
+ ## 0.15.7 (2026-06-28)
288
319
 
289
320
  Story 6 — dependencies runtime. Supports semver-matching local/registry dependency resolution and topological sort-based loading order.
290
321
 
@@ -292,25 +323,28 @@ Story 6 — dependencies runtime. Supports semver-matching local/registry depend
292
323
  - **Topological Sorting Resolver**: Added a robust, pure post-order DFS topological sorter with circular cycle, missing dependency, and version range mismatch checks.
293
324
  - **Topological Prompt Composition**: Enabled recursive, multi-domain prompt composition and flat topological JSON return inside `loadAuthorized`.
294
325
 
295
- ## v0.15.6 (2026-06-28)
326
+ ## 0.15.6 (2026-06-28)
296
327
 
297
- Story 5 — Bundle payload type. Bumps KDNA manifest format schema to v2, introduces bundle-profile-v1 payload profile, and starts KDNA v1 format deprecation window.
328
+ Story 5 — Bundle payload type. This historical release introduced the bundle
329
+ payload profile while the project was still using removed generation-labelled
330
+ container vocabulary.
298
331
 
299
332
  - **Bundle asset_type support:** added `"bundle"` to `asset_type` enum and `VALID_ASSET_TYPE` check.
300
- - **V2 Schema support:** bumped manifest schema version to v2.0, supporting `kdna_version` as `"2.0"`.
301
- - **Bundle profile support:** added `bundle-profile-v1` payload profile and validator.
333
+ - **Schema support:** added the then-current bundle manifest shape. The sole
334
+ current Runtime schema has since replaced it.
335
+ - **Bundle profile support:** added `kdna.payload.bundle` payload profile and validator.
302
336
 
303
- ## v0.15.5 (2026-06-28)
337
+ ## 0.15.5 (2026-06-28)
304
338
 
305
339
  Phase 12 audit follow-up. Closes 3 issues filed against this
306
340
  repo (#145, #146, #147).
307
341
 
308
342
  - **#145** The `compilePatterns` output for `misunderstanding`
309
- cards was already preserved (the v1 round-trip fix in 0.15.4
343
+ cards was already preserved (the container round-trip fix in 0.15.4
310
344
  carried `failure_risk` / `applies_when` / `does_not_apply_when`).
311
345
  The audit confirmed the fix is in place. No code change required;
312
346
  this entry documents the verification.
313
- - **#146** `cardsFromV1Payload` (in the studio-cli consumer) now
347
+ - **#146** The Studio CLI payload-card projection now
314
348
  infers a `type` for `payload.patterns` entries that omit it,
315
349
  by inspecting the field set. Misunderstandings (which have
316
350
  `wrong` + `correct`), terms (have `term` + `definition`),
@@ -328,7 +362,7 @@ repo (#145, #146, #147).
328
362
  warn producers/verifiers that any new exclusion MUST be added
329
363
  to both paths in the same change.
330
364
 
331
- ## v0.15.4 (2026-06-28)
365
+ ## 0.15.4 (2026-06-28)
332
366
 
333
367
  Audit follow-ups (2026-06-28 round-trip verification). This release
334
368
  keeps the canonicalisation paths in sync across producers (studio-cli
@@ -346,18 +380,18 @@ signature generated by one tool is accepted by every other.
346
380
  for the list of fields the signing payload excludes. Documented
347
381
  in `docs/CANONICALIZATION.md`.
348
382
 
349
- ## v0.15.3 (2026-06-27)
383
+ ## 0.15.3 (2026-06-27)
350
384
 
351
385
  - Fix (PC-2, real): `renderPromptItem` now actually ships the
352
- boundary card branch. The previous v0.15.2 release (ee20c5e)
386
+ boundary card branch. The previous 0.15.2 release (ee20c5e)
353
387
  bumped package.json and added a CHANGELOG entry but did NOT
354
- include the source change to `src/v1/index.js`. This release
388
+ include the source change to `src/container/index.js`. This release
355
389
  re-bundles the fix that landed in 46047fb (PC-1/PC-4 cleanup).
356
390
  Verified end-to-end: `kdna-studio card add boundary` with
357
391
  non-empty `scope` + `out_of_scope` → `kdna load` now prints
358
392
  `in scope: X; out of scope: Y` instead of the UUID `id`.
359
393
 
360
- ## v0.15.2 (2026-06-27)
394
+ ## 0.15.2 (2026-06-27)
361
395
 
362
396
  - Fix (PC-2): `renderPromptItem` now renders boundary cards as
363
397
  `in scope: X; out of scope: Y; exceptions: ...` instead of
@@ -369,27 +403,27 @@ signature generated by one tool is accepted by every other.
369
403
  matches returns `(unrendered card: <type>)` instead of the
370
404
  UUID `id`, so any unrecognized card shape is visible.
371
405
 
372
- ## v0.15.1 (2026-06-27)
406
+ ## 0.15.1 (2026-06-27)
373
407
 
374
408
  - Fix: package.json `files` array now includes `CHANGELOG.md`. The
375
- v0.15.0 tarball was published without the changelog, leaving
409
+ 0.15.0 tarball was published without the changelog, leaving
376
410
  consumers with no way to read release notes from `npm install`.
377
411
  Adding it now is a no-op for code but resolves the docs gap.
378
412
 
379
- ## v0.15.0 (2026-06-27)
413
+ ## 0.15.0 (2026-06-27)
380
414
 
381
- - B2: scrypt password profile `kdna-password-protected-v1-scrypt` (ADR-007)
415
+ - B2: scrypt password profile `kdna.encryption.password.scrypt` (ADR-007)
382
416
  - encryptProtectedEntryScrypt / decryptProtectedEntryScrypt (zero new deps, Node crypto.scryptSync)
383
417
  - AES-256-GCM + AES-256-KW envelope encryption, same CEK model as RFC-0008
384
418
  - scrypt N=32768 r=8 p=1, 32B KEK, 16B random salt
385
419
  - planLoad inferEntitlementProfile detects scrypt profile
386
420
  - decrypt dispatch routes Argon2id vs scrypt by envelope profile field
387
- - recovery slot deferred to v0.2; v0.1: single password slot
421
+ - recovery slot deferred to 0.2; 0.1: single password slot
388
422
  - B5: conformance:canonical npm script (threshold #8)
389
423
 
390
- ## v0.14.0 (2026-06-25)
424
+ ## 0.14.0 (2026-06-25)
391
425
 
392
- - B1: unified container dispatcher (readAsset — v1/v2/ dir → CanonicalAssetModel)
426
+ - B1: unified container dispatcher (readAsset — pre-cutover/later pre-cutover/ dir → CanonicalAssetModel)
393
427
  - B4: loadAuthorized decryption orchestration (opts.password, opts.decryptEntry)
394
428
  - B4: encrypted payload detection in runValidate (backward compatible)
395
429
  - B8: cross-language golden vectors (test-vectors/golden-vectors.js — 8/8)
@@ -398,14 +432,14 @@ signature generated by one tool is accepted by every other.
398
432
  - Wave 3a: CQ-T2/T3 symmetric compact rendering, scenario null consistency
399
433
  - Add: engines.node >=18.0.0
400
434
 
401
- ## v0.13.3 (2026-06-22)
435
+ ## 0.13.3 (2026-06-22)
402
436
 
403
437
  - Fix: index profile includes max_tokens_hint
404
438
  - Fix: compact profile falls back to full_statement for TBD placeholders
405
439
 
406
440
  Packages: `@aikdna/kdna-core`
407
441
 
408
- ## v0.13.2 (2026-06-21)
442
+ ## 0.13.2 (2026-06-21)
409
443
 
410
444
  ### Fixed
411
445
 
@@ -421,7 +455,7 @@ Packages: `@aikdna/kdna-core`
421
455
 
422
456
  ---
423
457
 
424
- ## v0.13.1 (2026-06-21)
458
+ ## 0.13.1 (2026-06-21)
425
459
 
426
460
  ### Fixed
427
461
 
@@ -430,13 +464,13 @@ Packages: `@aikdna/kdna-core`
430
464
 
431
465
  ### Changed
432
466
 
433
- - Public API provenance and profile split clarified: `loadKDNA` / `loadKDNASync` are the stable entry points for runtime consumers. Lower-level `readV1Layout`, `runValidate`, and `planLoad` are exported for advanced tooling but carry no backward-compatibility guarantee.
467
+ - Public API provenance and profile split clarified: `loadKDNA` / `loadKDNASync` are the stable entry points for runtime consumers. Lower-level `generation-qualified layout reader`, `runValidate`, and `planLoad` are exported for advanced tooling but carry no backward-compatibility guarantee.
434
468
  - Access enum values normalized everywhere: `public`, `licensed`, `remote`. Legacy aliases (`open` → `public`, `protected` → `licensed`, `runtime` → `remote`) are mapped transparently with an info-level issue in the LoadPlan.
435
469
  - `verifyAsset` / `verifyAssetSync`, `verifyDigest` / `verifyDigestSync`, and `verifySignature` / `verifySignatureSync` are now documented as the stable verification API surface.
436
470
 
437
471
  ---
438
472
 
439
- ## v0.13.0 (2026-06-19)
473
+ ## 0.13.0 (2026-06-19)
440
474
 
441
475
  ### Added
442
476
 
@@ -453,15 +487,15 @@ Packages: `@aikdna/kdna-core`
453
487
  - `input_fingerprint` capturing the source digest, has-password signal, and entitlement status for cache keying
454
488
  - `source.kind` and `source.path` indicating whether the input was a source directory or `.kdna` container
455
489
  - **`loadAuthorized(inputPath, opts)`** — a higher-level loader that calls `planLoad` first and blocks load when `can_load_now` is false. Throws `KDNA_LOAD_NOT_AUTHORIZED` with the first issue's code. This is the recommended entry point for agent runtimes.
456
- - **`loadV1(inputPath, opts)`** — renders judgment content into agent-ready prompt text. Supports profiles (`index`, `compact`, `scenario`, `full`) and output formats (`json`, `prompt`). The `prompt` format produces a flat text block suitable for agent context windows with proper axiom applicability rendering.
457
- - **KDNA Core v1 inspect module.** `inspect(inputPath)` returns a content-neutral manifest summary including `asset_id`, `asset_uid`, `kdna_version`, `payload_encrypted`, `profile`, `load_contract_default_profile`, and signature count. Output is always JSON. Banned terms (`trusted`, `recommended`, `high_quality`, `officially_approved`) are enforced by an automatic assertion.
458
- - **KDNA Core v1 validate module.** `validate(inputPath)` runs four independent gates:
490
+ - **`loadAsset(inputPath, opts)`** — renders judgment content into agent-ready prompt text. Supports profiles (`index`, `compact`, `scenario`, `full`) and output formats (`json`, `prompt`). The `prompt` format produces a flat text block suitable for agent context windows with proper axiom applicability rendering.
491
+ - **KDNA Core inspect module.** `inspect(inputPath)` returns a content-neutral manifest summary including `asset_id`, `asset_uid`, `kdna_version`, `payload_encrypted`, `profile`, `load_contract_default_profile`, and signature count. Output is always JSON. Banned terms (`trusted`, `recommended`, `high_quality`, `officially_approved`) are enforced by an automatic assertion.
492
+ - **KDNA Core validate module.** `validate(inputPath)` runs four independent gates:
459
493
  1. **Format gate:** required entries present (`mimetype`, `kdna.json`, `payload.kdnab`), mimetype content correct, lineage is an object not an array
460
494
  2. **Schema gate:** `kdna.json` against `manifest.schema.json` via AJV 2020-12
461
- 3. **Payload gate:** `payload.kdnab` against `payload-profile-v1.schema.json`
495
+ 3. **Payload gate:** `payload.kdnab` against `payload-profile.schema.json`
462
496
  4. **Checksums gate:** when `checksums.json` is present, computed digests are compared against declared values for `kdna.json`, `payload.kdnab`, and the combined asset digest
463
- - **KDNA Core v1 pack module.** `pack(sourceDir, outputPath)` produces a deterministic `.kdna` container: fixed DOS epoch timestamps, alphabetical entry order, mimetype first (STORED, method 0). Same source → byte-identical output.
464
- - **KDNA Core v1 unpack module.** `unpack(inputPath, outputDir)` extracts a `.kdna` container to a directory with path-traversal protection.
497
+ - **KDNA Core pack module.** `pack(sourceDir, outputPath)` produces a canonical-order `.kdna` container: fixed DOS epoch timestamps, alphabetical entry order, mimetype first (STORED, method 0). Package bytes are reproducible with one pinned packer toolchain and compressor; DEFLATE output may differ across compressors or zlib versions.
498
+ - **KDNA Core unpack module.** `unpack(inputPath, outputDir)` extracts a `.kdna` container to a directory with path-traversal protection.
465
499
  - **Container security hardening.** ZIP reader enforces:
466
500
  - Maximum container size (25 MiB), max entries (128), max entry size (5 MiB), max total uncompressed (12 MiB)
467
501
  - Max compression ratio (100:1) to prevent zip bombs
@@ -471,17 +505,17 @@ Packages: `@aikdna/kdna-core`
471
505
  - Symlink and device/special file rejection
472
506
  - **Digest matching verification.** When `checksums.json` includes `manifest_digest`, `payload_digest`, or `asset_digest`, the validate module computes actual SHA-256 hashes and compares them. Mismatch produces a `KDNA_INTEGRITY_DIGEST_FAILED` issue.
473
507
  - **Load contract validation.** When the manifest includes a `load_contract` block, it is validated against `load-contract.schema.json`. A missing load contract is not an error — it simply means no specialization.
474
- - **Dual CJS/ESM exports.** `src/index.js` (CommonJS) and `src/index.mjs` (ES module) with matching `exports` map. The v1 module is also available at `@aikdna/kdna-core/v1`.
508
+ - **Dual CJS/ESM exports.** `src/index.js` (CommonJS) and `src/index.mjs` (ES module) with matching `exports` map. The pre-cutover module is also available at `@aikdna/kdna-core/pre-cutover`.
475
509
  - **TypeScript declarations.** `src/types.d.ts` exports type definitions for the stable public API surface.
476
510
 
477
511
  ### Changed
478
512
 
479
- - **V1 is the only active format path.** The v2 reader (`readDataMapSync`, `readDataMap`) remains in the codebase for migration compatibility but is no longer the default path. All new integrations should use the v1 API: `inspect`, `validate`, `planLoad`, `loadAuthorized`.
480
- - `validate` and `planLoad` reject v2 containers (`application/vnd.aikdna.kdna+zip`) with a format error.
513
+ - **Pre-cutover is the only active format path.** The later pre-cutover reader (`readDataMapSync`, `readDataMap`) remains in the codebase for migration compatibility but is no longer the default path. All new integrations should use the pre-cutover API: `inspect`, `validate`, `planLoad`, `loadAuthorized`.
514
+ - `validate` and `planLoad` reject later pre-cutover containers (`application/vnd.aikdna.kdna+zip`) with a format error.
481
515
  - Access model normalized to the three-tier `public` | `licensed` | `remote` enum. The LoadPlan maps legacy values transparently with an info-level issue.
482
- - Container format detection (`detectContainerFormat`) reads only the first central-directory entry to determine v1 vs v2, preventing malicious later entries from causing format confusion.
516
+ - Container format detection (`detectContainerFormat`) reads only the first central-directory entry to determine pre-cutover vs later pre-cutover, preventing malicious later entries from causing format confusion.
483
517
 
484
518
  ### Removed
485
519
 
486
- - Legacy v1 compatibility shims removed. v2 is the only legacy format and is handled through the existing `asset-reader.js` module.
487
- - `readDataMapSync` / `readDataMap` deprecated for new use. Use `planLoad` + `loadV1` for runtime loading or `validate` + `inspect` for diagnostics.
520
+ - Legacy pre-cutover compatibility shims removed. later pre-cutover is the only legacy format and is handled through the existing `asset-reader.js` module.
521
+ - `readDataMapSync` / `readDataMap` deprecated for new use. Use `planLoad` + `loadAsset` for runtime loading or `validate` + `inspect` for diagnostics.