@plasius/asset-contracts 0.4.6 → 0.5.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.
- package/CHANGELOG.md +23 -0
- package/README.md +59 -0
- package/dist/index.cjs +1130 -954
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +38 -1
- package/dist/index.d.ts +38 -1
- package/dist/index.js +1108 -935
- package/dist/index.js.map +1 -1
- package/docs/adrs/adr-0009-model-resource-manifest-qualification.md +74 -0
- package/docs/adrs/index.md +1 -0
- package/docs/tdrs/index.md +1 -0
- package/docs/tdrs/tdr-0004-model-resource-manifest-qualification.md +70 -0
- package/package.json +3 -2
- package/src/index.ts +1 -0
- package/src/model-resource-manifest.ts +198 -0
package/CHANGELOG.md
CHANGED
|
@@ -14,6 +14,28 @@
|
|
|
14
14
|
- **Security**
|
|
15
15
|
- (placeholder)
|
|
16
16
|
|
|
17
|
+
## [0.5.0] - 2026-10-24
|
|
18
|
+
|
|
19
|
+
- **Added**
|
|
20
|
+
- Opt-in canonical model resource manifest qualification with deterministic
|
|
21
|
+
file order, complete inventory/entrypoint checks, exact byte/hash/MIME
|
|
22
|
+
binding, bounded snapshots and cancellation/deadline handling. Existing
|
|
23
|
+
manifest factories remain compatible.
|
|
24
|
+
- (placeholder)
|
|
25
|
+
|
|
26
|
+
- **Changed**
|
|
27
|
+
- Add exact published `@plasius/gpu-model-core@0.7.0` for canonical public
|
|
28
|
+
inventory types; no runtime model parser import or other dependency update.
|
|
29
|
+
- (placeholder)
|
|
30
|
+
|
|
31
|
+
- **Fixed**
|
|
32
|
+
- (placeholder)
|
|
33
|
+
|
|
34
|
+
- **Security**
|
|
35
|
+
- Update development-only fast-uri from 3.1.8 to fixed 3.1.9 after the full
|
|
36
|
+
qualification audit reported URI-normalization advisories; retain major 3.
|
|
37
|
+
- (placeholder)
|
|
38
|
+
|
|
17
39
|
## [0.4.6] - 2026-10-23
|
|
18
40
|
|
|
19
41
|
- **Added**
|
|
@@ -307,3 +329,4 @@
|
|
|
307
329
|
[0.4.4]: https://github.com/Plasius-LTD/asset-contracts/releases/tag/v0.4.4
|
|
308
330
|
[0.4.5]: https://github.com/Plasius-LTD/asset-contracts/releases/tag/v0.4.5
|
|
309
331
|
[0.4.6]: https://github.com/Plasius-LTD/asset-contracts/releases/tag/v0.4.6
|
|
332
|
+
[0.5.0]: https://github.com/Plasius-LTD/asset-contracts/releases/tag/v0.5.0
|
package/README.md
CHANGED
|
@@ -27,6 +27,7 @@ The exported surface covers:
|
|
|
27
27
|
helpers
|
|
28
28
|
- asset job metadata contracts
|
|
29
29
|
- manifest and file descriptor contracts
|
|
30
|
+
- opt-in canonical model package inventory and exact-byte qualification
|
|
30
31
|
- screenshot plan definitions
|
|
31
32
|
- review findings and review report contracts
|
|
32
33
|
- immutable promotion record contracts
|
|
@@ -45,6 +46,64 @@ The exported surface covers:
|
|
|
45
46
|
- generic manifest inference plus byte-verified typed promotion that preserves
|
|
46
47
|
specialized manifest fields
|
|
47
48
|
|
|
49
|
+
## Canonical Model Resource Qualification
|
|
50
|
+
|
|
51
|
+
`qualifyModelResourceManifest` binds an existing `AssetManifest` to a published
|
|
52
|
+
`@plasius/gpu-model-core` `ResourcePackageManifest` and the complete exported
|
|
53
|
+
file bytes. Existing factories retain their staged-construction behavior.
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
import { qualifyModelResourceManifest } from "@plasius/asset-contracts";
|
|
57
|
+
|
|
58
|
+
// Obtain manifest, packageManifest and exportedFiles from your trusted pipeline.
|
|
59
|
+
const qualified = await qualifyModelResourceManifest({
|
|
60
|
+
manifest,
|
|
61
|
+
packageManifest,
|
|
62
|
+
files: exportedFiles, // [{ path, bytes: Uint8Array, contentType }]
|
|
63
|
+
signal: abortController.signal,
|
|
64
|
+
timeoutMs: 10_000,
|
|
65
|
+
});
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Every manifest path, canonical inventory path and payload path must correspond
|
|
69
|
+
exactly, including the entrypoint. The qualifier checks actual byte lengths and
|
|
70
|
+
SHA-256 digests, agreement of canonical MIME declarations, portable relative
|
|
71
|
+
POSIX paths, case-insensitive collisions and file/directory conflicts. Optional
|
|
72
|
+
inventory MIME declarations may be omitted; the descriptor and payload MIME
|
|
73
|
+
declarations are required. It preserves roles, sourceAdapter, source/derived
|
|
74
|
+
paths and specialized model metadata, returning frozen descriptors sorted by
|
|
75
|
+
locale-independent code-unit order. Typed model inputs are also revalidated by
|
|
76
|
+
`createModelAssetManifest`.
|
|
77
|
+
|
|
78
|
+
Pass ordinary `Uint8Array` values backed by `ArrayBuffer`; use
|
|
79
|
+
`new Uint8Array(nodeBuffer)` for Node buffers. Shared buffers, getters in
|
|
80
|
+
metadata, exotic records and sparse arrays are rejected. Metadata and bytes
|
|
81
|
+
are copied before the first hash. `MODEL_RESOURCE_MANIFEST_LIMITS` caps files
|
|
82
|
+
at 16,384, each file at 64 MiB, total bytes at 128 MiB, metadata depth at 16 and
|
|
83
|
+
metadata values at 262,144. Metadata strings are capped at 2,048 characters,
|
|
84
|
+
keys at 128, paths at 1,024 and MIME declarations at 128. The default deadline
|
|
85
|
+
is 10 seconds; callers may choose 1–60,000 ms. Cancellation and deadline checks
|
|
86
|
+
surround each bounded digest; Web Crypto cannot cancel an in-flight digest.
|
|
87
|
+
Failures use value-free `ModelResourceManifestError.code` values.
|
|
88
|
+
|
|
89
|
+
Embedded resources remain inside their owning entrypoint; list only actual
|
|
90
|
+
exported files. This helper checks bytes and declarations, not internal format
|
|
91
|
+
references, MIME sniffing, malware, rendering, storage or promotion authority.
|
|
92
|
+
Keep source provenance in the canonical document and do not substitute derived
|
|
93
|
+
hashes for original source hashes. Detailed role mapping, animation/source
|
|
94
|
+
relationships and promotion closure remain separately tracked work. The result
|
|
95
|
+
is qualification at call time; callers must preserve the exact bytes in their
|
|
96
|
+
own immutable storage boundary.
|
|
97
|
+
|
|
98
|
+
The backend remote evaluator owns `gpu.model.conversion.enabled`. Call this
|
|
99
|
+
helper on the enabled adoption path; disabled and rollback paths retain the
|
|
100
|
+
existing factory path. The package performs no flag lookup or live mutation,
|
|
101
|
+
and adds no UI capability. The model-core dependency is exact published
|
|
102
|
+
`0.7.0` for public type compatibility; its import here is type-only, with no
|
|
103
|
+
runtime parser or renderer loading. Downstream adoption must use a released
|
|
104
|
+
package. See [ADR 0009](./docs/adrs/adr-0009-model-resource-manifest-qualification.md)
|
|
105
|
+
and [TDR 0004](./docs/tdrs/tdr-0004-model-resource-manifest-qualification.md).
|
|
106
|
+
|
|
48
107
|
## Private Artifact Prevention
|
|
49
108
|
|
|
50
109
|
Signed contributor agreements and contributor acceptance records are retained
|