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