@aikdna/kdna-core 0.15.3 → 0.15.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.15.4 (2026-06-28)
4
+
5
+ Audit follow-ups (2026-06-28 round-trip verification). This release
6
+ keeps the canonicalisation paths in sync across producers (studio-cli
7
+ `manifestForSigning`, kdna-cli `publish.js#manifestForSigning`,
8
+ kdna-studio-core `buildPayload`, kdna-core's own verifier) so a
9
+ signature generated by one tool is accepted by every other.
10
+
11
+ - **manifestForSignature now recursively strips `authoring.content_digest`.**
12
+ Prior version only stripped the top-level content_digest. The digest
13
+ builder (`manifestForDigest`) has always stripped the nested field
14
+ too, so a manifest that contained an `authoring` block with a
15
+ `content_digest` would hash differently for signing vs. digest and
16
+ report a false-positive verification failure.
17
+ - **asset-reader canonicalisation is now the single source of truth**
18
+ for the list of fields the signing payload excludes. Documented
19
+ in `docs/CANONICALIZATION.md`.
20
+
3
21
  ## v0.15.3 (2026-06-27)
4
22
  - Fix (PC-2, real): `renderPromptItem` now actually ships the
5
23
  boundary card branch. The previous v0.15.2 release (ee20c5e)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aikdna/kdna-core",
3
- "version": "0.15.3",
3
+ "version": "0.15.4",
4
4
  "description": "KDNA Core library for validating, planning, and loading local .kdna judgment assets.",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -204,6 +204,14 @@ function buildContentDigest(asset) {
204
204
  }
205
205
 
206
206
  function manifestForSignature(manifest, { stripDigestFields = true } = {}) {
207
+ // Mirrors manifestForDigest above. The two must agree on every field
208
+ // they strip, or the signing and digest paths will hash different
209
+ // representations of the same manifest and verifiers will report a
210
+ // mismatch on otherwise-valid assets.
211
+ //
212
+ // Bug: prior version omitted the `authoring.content_digest` strip
213
+ // that manifestForDigest performs, so the signing payload included
214
+ // a digest field that the digest payload did not.
207
215
  const copy = { ...(manifest || {}) };
208
216
  delete copy.signature;
209
217
  delete copy._source;
@@ -211,6 +219,11 @@ function manifestForSignature(manifest, { stripDigestFields = true } = {}) {
211
219
  delete copy.asset_digest;
212
220
  delete copy.container_sha256;
213
221
  delete copy.content_digest;
222
+ if (copy.authoring && typeof copy.authoring === 'object') {
223
+ const auth = { ...copy.authoring };
224
+ delete auth.content_digest;
225
+ copy.authoring = auth;
226
+ }
214
227
  }
215
228
  return copy;
216
229
  }