@plasius/asset-contracts 0.3.1 → 0.4.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 +66 -0
- package/README.md +200 -0
- package/dist/index.cjs +4632 -75
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1243 -1
- package/dist/index.d.ts +1243 -1
- package/dist/index.js +4468 -58
- package/dist/index.js.map +1 -1
- package/docs/adrs/adr-0005-path-only-private-artifact-prevention-gates.md +82 -0
- package/docs/adrs/adr-0006-pvox-model-resolution-contracts.md +168 -0
- package/docs/adrs/adr-0007-hosted-oidc-package-publication.md +41 -0
- package/docs/adrs/index.md +3 -0
- package/docs/tdrs/index.md +1 -0
- package/docs/tdrs/tdr-0003-pvox-validation-and-confirmation-binding.md +208 -0
- package/legal/CLA.md +5 -2
- package/package.json +15 -6
- package/src/index.ts +3 -0
- package/src/pvox-hash-preimage.ts +1074 -0
- package/src/pvox-model-resolution-schema.ts +1041 -0
- package/src/pvox-model-resolution.ts +3244 -0
- package/legal/CLA-REGISTRY.csv +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -14,6 +14,71 @@
|
|
|
14
14
|
- **Security**
|
|
15
15
|
- (placeholder)
|
|
16
16
|
|
|
17
|
+
## [0.4.0] - 2026-08-24
|
|
18
|
+
|
|
19
|
+
- **Added**
|
|
20
|
+
- Added the additive PVOX v2 model-resolution contract family for Task #25:
|
|
21
|
+
source-ingestion and texture-free runtime request profiles, authenticated
|
|
22
|
+
PVOX manifests, voxel technical/capability/physical/fidelity evidence,
|
|
23
|
+
compound-addressed edit journals, native-render confirmation binding,
|
|
24
|
+
diagnostic/confirmable candidate results, pointer-last promotion receipts,
|
|
25
|
+
durable lifecycle states, and strict self-contained JSON Schema descriptors.
|
|
26
|
+
- Added executable, little-endian PVOX hash-preimage encoders with an exact
|
|
27
|
+
normalized root-header layout and real SHA-256 golden vectors.
|
|
28
|
+
- (placeholder)
|
|
29
|
+
|
|
30
|
+
- **Changed**
|
|
31
|
+
- Preserved v1 GLB model-resolution APIs and immutable `ModelAssetRef` values
|
|
32
|
+
while providing deterministic v2-to-v1 state projections for compatibility
|
|
33
|
+
wrappers.
|
|
34
|
+
- Fixed PVOX 1.0 to a major/minor version, whole uncompressed 64-KiB pages,
|
|
35
|
+
scoped metadata/LOD/render/collision page kinds, bounded codec/layout
|
|
36
|
+
constants, and feasible brick/logical-voxel/encoded-sample ceilings.
|
|
37
|
+
- Bound npm publication to the exact prepared `main` commit after successful
|
|
38
|
+
push-triggered CI.
|
|
39
|
+
- (placeholder)
|
|
40
|
+
|
|
41
|
+
- **Fixed**
|
|
42
|
+
- (placeholder)
|
|
43
|
+
|
|
44
|
+
- **Security**
|
|
45
|
+
- Added fail-closed validation for authenticated PVOX resource namespaces,
|
|
46
|
+
fixed format/page/limit invariants, binary/processing/assembly closure
|
|
47
|
+
separation, exact hash-domain bindings, localized physical and governed
|
|
48
|
+
fidelity admission, non-overridable hard gates, and confirmation tokens
|
|
49
|
+
bound to the complete candidate evidence subject.
|
|
50
|
+
- Bound confirmation and pointer-last publication to the complete semantic,
|
|
51
|
+
provenance, rights, binary/processing/assembly/evaluation, capability,
|
|
52
|
+
native-render, and confirmation-binding evidence closures.
|
|
53
|
+
- Required typed physical-inventory/render/evaluation/assembly attestations,
|
|
54
|
+
canonical physical evidence order, base-root-bound edit genesis, complete
|
|
55
|
+
current-state CAS for later edits, and non-empty edit transitions.
|
|
56
|
+
- Made render brick/sample budgets artifact-wide across all retained LODs,
|
|
57
|
+
required an exact closed section registry and non-empty destruction bond
|
|
58
|
+
graph, and bound confirmation chronology to durable snapshot timestamps.
|
|
59
|
+
- Rejected unknown fixed-preimage fields, malformed fixed tuples, byte-view
|
|
60
|
+
type confusion, shared mutable byte storage, and inputs beyond governed
|
|
61
|
+
assembly/hash-work limits; aligned strict JSON Schema lifecycle branches
|
|
62
|
+
with the authoritative runtime factories.
|
|
63
|
+
- Pinned audited transitive `brace-expansion`, `nanoid`, and `postcss`
|
|
64
|
+
versions so the complete development and production dependency trees are
|
|
65
|
+
free of known npm advisories at the configured severity gate.
|
|
66
|
+
- Added fail-closed source and npm-package admission for the administrative contributor registry and pinned the CI/CD runtime to Node.js 24.18.0 LTS.
|
|
67
|
+
- Added zero-dependency, path-only Git-index, working-tree, and final npm-pack
|
|
68
|
+
gates that prevent CSV files, contributor registries, signed CLA artifacts,
|
|
69
|
+
and privacy-marked registries from entering source or release artifacts.
|
|
70
|
+
- Replaced the broad `legal/` package entry with the three exact public CLA
|
|
71
|
+
Markdown documents and an extension-constrained final package allowlist.
|
|
72
|
+
- Removed the legacy npm write-token path and added a fail-closed npm
|
|
73
|
+
11.5.1-or-newer OIDC runtime check.
|
|
74
|
+
- Enabled same-repository pull-request CI while preventing external forks and
|
|
75
|
+
`pull_request_target` from executing repository code on self-hosted runners.
|
|
76
|
+
- Isolated repository release-admission scripts from the write-capable
|
|
77
|
+
release-preparation job, disabled Git hooks in that privileged workspace,
|
|
78
|
+
made the final-package privacy gate unconditional, and added fail-closed
|
|
79
|
+
recovery for partially completed npm/GitHub releases.
|
|
80
|
+
- (placeholder)
|
|
81
|
+
|
|
17
82
|
## [0.3.1] - 2026-07-13
|
|
18
83
|
|
|
19
84
|
- **Added**
|
|
@@ -134,3 +199,4 @@
|
|
|
134
199
|
[0.2.0]: https://github.com/Plasius-LTD/asset-contracts/releases/tag/v0.2.0
|
|
135
200
|
[0.3.0]: https://github.com/Plasius-LTD/asset-contracts/releases/tag/v0.3.0
|
|
136
201
|
[0.3.1]: https://github.com/Plasius-LTD/asset-contracts/releases/tag/v0.3.1
|
|
202
|
+
[0.4.0]: https://github.com/Plasius-LTD/asset-contracts/releases/tag/v0.4.0
|
package/README.md
CHANGED
|
@@ -28,6 +28,8 @@ The exported surface covers:
|
|
|
28
28
|
- immutable promoted `ModelAssetRef` values
|
|
29
29
|
- canonical model processing, LOD, collision, assembly, converter, and fidelity evidence
|
|
30
30
|
- asynchronous resolution records and the disabled Phase 1 generator port
|
|
31
|
+
- additive PVOX request, artifact, voxel capability, physical evidence, native
|
|
32
|
+
render, confirmation-binding, and durable lifecycle contracts
|
|
31
33
|
- typed model, reflected GPU-interface, WGSL shader, rendering-style profile,
|
|
32
34
|
and shader-validation-evidence asset manifests
|
|
33
35
|
- model-facing GPU ABI references, semantics, and optional exact default-style
|
|
@@ -35,6 +37,31 @@ The exported surface covers:
|
|
|
35
37
|
- generic manifest inference plus byte-verified typed promotion that preserves
|
|
36
38
|
specialized manifest fields
|
|
37
39
|
|
|
40
|
+
## Private Artifact Prevention
|
|
41
|
+
|
|
42
|
+
Signed contributor agreements and contributor acceptance records are retained
|
|
43
|
+
only in an approved access-controlled system outside source control. The
|
|
44
|
+
zero-dependency prevention gate inspects path metadata only; it never opens or
|
|
45
|
+
hashes suspected private artifacts.
|
|
46
|
+
|
|
47
|
+
Run the repository and package gates before review or release:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npm run privacy:check
|
|
51
|
+
npm run test:privacy
|
|
52
|
+
npm run build
|
|
53
|
+
npm run pack:check
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`privacy:check` evaluates both working-tree paths and the proposed Git index,
|
|
57
|
+
so ignored files and tracked-but-unstaged deletions cannot bypass it.
|
|
58
|
+
`pack:check` validates the explicit `package.json` publish allowlist and the
|
|
59
|
+
exact `npm pack --dry-run` path manifest. Only the three public CLA Markdown
|
|
60
|
+
documents may be published from `legal/`; `dist/`, `src/`, and `docs/` also
|
|
61
|
+
enforce file-extension allowlists. CI, release preparation, and CD all fail
|
|
62
|
+
closed on these gates. The targeted path rules remain defense in depth and do
|
|
63
|
+
not replace secret scanning, access controls, or incident response.
|
|
64
|
+
|
|
38
65
|
## WebGPU Shader Asset Contracts
|
|
39
66
|
|
|
40
67
|
`@plasius/gpu-shader` owns reflection-derived GPU layouts, ABI hashes, exact
|
|
@@ -245,6 +272,162 @@ an explicit semantic-risk override. Completed staged assets additionally require
|
|
|
245
272
|
a backend-issued promotion receipt binding the proposal, confirmed manifest and
|
|
246
273
|
assembly closure to the exact final `ModelAssetRef`.
|
|
247
274
|
|
|
275
|
+
## PVOX Model Resolution Contracts
|
|
276
|
+
|
|
277
|
+
`MODEL_RESOLUTION_V2_CONTRACT_VERSION` is an additive contract family for the
|
|
278
|
+
partner-to-PVOX pipeline. It does not change the v1 GLB ingestion contracts or
|
|
279
|
+
`ModelAssetRef`. A v2 processing manifest uses the discriminant
|
|
280
|
+
`representation: "pvox"`; its authenticated runtime resource has the fixed
|
|
281
|
+
`.pvox` extension, `application/vnd.plasius.pvox` media type, `PVOX` magic,
|
|
282
|
+
the `{ major: 1, minor: 0 }` static/rigid format, 256-byte header, 128-byte
|
|
283
|
+
directory entries, at most 64 sections, and whole uncompressed 64-KiB pages.
|
|
284
|
+
Pages are typed as metadata, LOD structure, render field, or collision field;
|
|
285
|
+
field pages carry a complete LOD/partition/depth/Morton scope. Root, directory,
|
|
286
|
+
page-set, binary-closure, compilation-input, and runtime-request-profile hashes
|
|
287
|
+
remain distinct.
|
|
288
|
+
|
|
289
|
+
Use `createModelRequestSpecV2` for a PVOX resolution. Source acquisition and
|
|
290
|
+
decode limits live only in `sourceIngestionLimits`. The texture-free runtime
|
|
291
|
+
profile separately declares fidelity, geometry mode, required capabilities,
|
|
292
|
+
and PVOX artifact/page/hierarchy/brick/logical-voxel/encoded-sample/residency
|
|
293
|
+
limits. The default artifact ceilings are 524,288 render bricks, 268,435,456
|
|
294
|
+
logical voxels, and 8,388,608 encoded surface samples; factories also reject
|
|
295
|
+
record counts that cannot fit the declared whole-page artifact. Legacy triangle
|
|
296
|
+
or texture fields cannot be supplied as PVOX runtime constraints. Partition
|
|
297
|
+
extent is fidelity-driven and must fit the LOD0 cell size and hierarchy depth;
|
|
298
|
+
the contract does not assume a 32-metre partition can meet every profile.
|
|
299
|
+
|
|
300
|
+
```ts
|
|
301
|
+
import {
|
|
302
|
+
MODEL_RESOLUTION_V2_CONTRACT_VERSION,
|
|
303
|
+
PVOX_MODEL_REQUEST_POLICY_ID,
|
|
304
|
+
PVOX_PAGE_SIZE_BYTES,
|
|
305
|
+
createModelRequestSpecV2,
|
|
306
|
+
} from "@plasius/asset-contracts";
|
|
307
|
+
|
|
308
|
+
const request = createModelRequestSpecV2({
|
|
309
|
+
contractVersion: MODEL_RESOLUTION_V2_CONTRACT_VERSION,
|
|
310
|
+
policyProfileId: PVOX_MODEL_REQUEST_POLICY_ID,
|
|
311
|
+
requestSemanticProfileHash: requestSemanticProfileSha256,
|
|
312
|
+
query: "weathered oak farmhouse table",
|
|
313
|
+
revision: 0,
|
|
314
|
+
hardConstraints: { collision: "required", partition: "allowed" },
|
|
315
|
+
softPreferences: { category: "furniture", materials: ["oak"] },
|
|
316
|
+
exclusions: [],
|
|
317
|
+
sourceIngestionLimits: {
|
|
318
|
+
maximumDownloadBytes: 100_000_000,
|
|
319
|
+
maximumExpandedBytes: 200_000_000,
|
|
320
|
+
maximumArchiveEntries: 1_000,
|
|
321
|
+
maximumSourceFiles: 2_000,
|
|
322
|
+
maximumDecodedTextureBytes: 100_000_000,
|
|
323
|
+
maximumTextureDimensionPx: 8_192,
|
|
324
|
+
},
|
|
325
|
+
pvoxRuntimeProfile: {
|
|
326
|
+
profileId: "static-world-pvox-v1",
|
|
327
|
+
fidelityProfileId: "props-furniture-v1",
|
|
328
|
+
capabilityProfileId: "world-editable-v1",
|
|
329
|
+
geometryMode: "auto",
|
|
330
|
+
requiredCapabilities: [
|
|
331
|
+
"rendering", "collision", "destruction", "thermal", "moisture",
|
|
332
|
+
"fluid-boundary",
|
|
333
|
+
],
|
|
334
|
+
limits: {
|
|
335
|
+
maximumArtifactBytes: 4 * PVOX_PAGE_SIZE_BYTES,
|
|
336
|
+
maximumPages: 4,
|
|
337
|
+
maximumHierarchyDepth: 8,
|
|
338
|
+
maximumHierarchyNodes: 1_000,
|
|
339
|
+
maximumBricks: 512,
|
|
340
|
+
maximumLogicalVoxels: 262_144,
|
|
341
|
+
maximumEncodedSurfaceSamples: 10_000,
|
|
342
|
+
maximumSurfaceProperties: 4_096,
|
|
343
|
+
maximumPhysicalPaletteRecords: 2,
|
|
344
|
+
maximumPhysicalEvidenceEntries: 38,
|
|
345
|
+
maximumMaterialRegions: 2,
|
|
346
|
+
maximumInteriorLayers: 16,
|
|
347
|
+
maximumMassPropertyRecords: 2,
|
|
348
|
+
maximumBondRecords: 128,
|
|
349
|
+
maximumPartitions: 32,
|
|
350
|
+
maximumLodCount: 4,
|
|
351
|
+
maximumCpuResidentBytes: 100_000_000,
|
|
352
|
+
maximumGpuResidentBytes: 100_000_000,
|
|
353
|
+
},
|
|
354
|
+
},
|
|
355
|
+
});
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
`createPvoxAssetManifestV1`, `createVoxelTechnicalProfile`,
|
|
359
|
+
`createVoxelCapabilityAssessment`, `createPhysicalPropertyEvidence`,
|
|
360
|
+
`createPvoxFidelityEvidence`, `createPvoxEditJournal`, and
|
|
361
|
+
`createModelProcessingManifestV2` reconstruct and deeply freeze allow-listed
|
|
362
|
+
data. The processing factory binds the verified source and canonical-document
|
|
363
|
+
hashes, distinct compilation-input and runtime-request-profile attestations,
|
|
364
|
+
and binary closure to the independently validated PVOX artifact, capability
|
|
365
|
+
evidence, physical evidence, fidelity decision, processing closure, and assembly
|
|
366
|
+
closure. Every leaf and assembly has a distinct domain-separated assembly
|
|
367
|
+
closure attestation; a leaf hashes an empty child list rather than aliasing its
|
|
368
|
+
binary closure. `PVOX_HASH_DOMAINS`, `PVOX_HASH_PREIMAGE_LAYOUTS`, and the
|
|
369
|
+
executable preimage helpers publish the exact PVOX 1.0 section, directory,
|
|
370
|
+
page-set, root, evidence, confirmation, journal, and publication hash inputs.
|
|
371
|
+
Fixed-layout encoders reject unknown own fields, malformed tuple lengths,
|
|
372
|
+
non-`Uint8Array` byte payloads, shared mutable byte storage, and inputs beyond
|
|
373
|
+
the governed artifact, assembly, and preimage ceilings rather than silently
|
|
374
|
+
omitting or coercing them.
|
|
375
|
+
The synchronous factories cross-bind supplied digests and typed attestations.
|
|
376
|
+
At an authenticated trust boundary, the host must recompute each applicable
|
|
377
|
+
digest from the canonical preimage and verify the attestation token against its
|
|
378
|
+
allow-listed issuer; matching object fields alone are not cryptographic proof.
|
|
379
|
+
|
|
380
|
+
Physical evidence is localized by `(regionId, materialId, property)`. Every
|
|
381
|
+
material region must carry the complete high-confidence governed property set
|
|
382
|
+
for each advertised editable capability; inferred evidence requires signed
|
|
383
|
+
review, and critical density, hardness, tensile/compressive/shear strength,
|
|
384
|
+
fracture, interior, ignition, and melting values cannot be zero or defaulted.
|
|
385
|
+
Physical evidence is serialized in authoritative
|
|
386
|
+
region-index then governed-property order, and both the region inventory and
|
|
387
|
+
aggregate evidence carry domain-separated hash attestations. Edit journals
|
|
388
|
+
address each copy-on-write patch by
|
|
389
|
+
field kind, LOD, partition, hierarchy depth, Morton code, expected page index,
|
|
390
|
+
and expected/result page hashes. Genesis is bound to the authenticated base root;
|
|
391
|
+
standalone later revisions require the complete authenticated current placement
|
|
392
|
+
state, while chain validation derives that state after every copy-on-write step.
|
|
393
|
+
Insert, replace, and remove operations reject empty/no-op transitions.
|
|
394
|
+
|
|
395
|
+
`createModelCandidateV2` additionally requires the four native-PVOX review
|
|
396
|
+
views, native-render attestation, allowed rights decision, and one passing
|
|
397
|
+
attestation for every non-overridable gate. Its confirmation token subject binds
|
|
398
|
+
the exact v2 request and semantic assessment, candidate identity, full
|
|
399
|
+
provenance and normalized rights decision, source/PVOX/binary/processing/
|
|
400
|
+
assembly/evaluation hashes, capability evidence, ordered view hashes, fidelity
|
|
401
|
+
and physical evidence, and the complete native-render record. Native-render,
|
|
402
|
+
inventory, binary/processing/assembly/evaluation, confirmation, edit, and
|
|
403
|
+
publication subjects use distinct hash domains. A blocked candidate remains available
|
|
404
|
+
as a diagnostic result with reason codes but receives no confirmation token.
|
|
405
|
+
Only a low semantic score can be overridden; licensing, malware, source-format,
|
|
406
|
+
PVOX, fidelity, physical-property, renderer, and accessibility failures always
|
|
407
|
+
remain blocking. Completed staged candidates require a pointer-last promotion
|
|
408
|
+
receipt binding the proposal, confirmation, processing/assembly closures,
|
|
409
|
+
confirmation-binding hash, credits, catalog row, index snapshot, and final
|
|
410
|
+
immutable `ModelAssetRef`.
|
|
411
|
+
|
|
412
|
+
`VoxelTechnicalProfile.brickCount`, `logicalVoxelCapacity`, and
|
|
413
|
+
`encodedSurfaceSampleCount` are artifact-wide render-field totals across every
|
|
414
|
+
retained LOD, not LOD0-only values. Section counts exactly match the closed
|
|
415
|
+
static, optional bond, and optional collision registry. Advertising destruction
|
|
416
|
+
requires non-empty reviewed mass, bond-graph, and interior-layer records.
|
|
417
|
+
Durable snapshots carrying confirmation must have `updatedAt` at or after the
|
|
418
|
+
confirmation timestamp; their JSON Schemas enforce the same state-dependent
|
|
419
|
+
confirmation, promotion, terminal, and reason-code rules as the factories.
|
|
420
|
+
|
|
421
|
+
The v2 lifecycle preserves every v1 state and adds `downloading`, `importing`,
|
|
422
|
+
`voxelizing`, `evaluating-fidelity`, and `awaiting-material-review`.
|
|
423
|
+
`toLegacyModelResolutionState` supplies a deterministic projection for existing
|
|
424
|
+
wrappers without widening the v1 state union. Closed JSON Schema 2020-12
|
|
425
|
+
descriptors are exported through `MODEL_RESOLUTION_V2_JSON_SCHEMAS` for MCP and
|
|
426
|
+
admin packages. Each of the 14 standalone schemas has a stable versioned `$id`,
|
|
427
|
+
a self-contained closed `$defs` bundle, and strict Ajv 2020 coverage; runtime
|
|
428
|
+
consumers must still call the factories for relational/hash/chronology checks at
|
|
429
|
+
trust boundaries.
|
|
430
|
+
|
|
248
431
|
## Model Processing and References
|
|
249
432
|
|
|
250
433
|
`ModelProcessingManifest` fixes processed output to metres, Y-up, `-Z` forward,
|
|
@@ -303,6 +486,7 @@ separately governed generator implementation is delivered.
|
|
|
303
486
|
## Feature Flag
|
|
304
487
|
|
|
305
488
|
- `asset.pipeline.unified-ai-assets.enabled`
|
|
489
|
+
- `asset.pipeline.pvox-models.enabled`
|
|
306
490
|
|
|
307
491
|
## Related Documents
|
|
308
492
|
|
|
@@ -311,7 +495,9 @@ separately governed generator implementation is delivered.
|
|
|
311
495
|
- plasius-ltd-site `docs/tdrs/tdr-0004-unified-ai-asset-pipeline.md`
|
|
312
496
|
- package `docs/adrs/adr-0002-model-resolution-contracts.md`
|
|
313
497
|
- package `docs/adrs/adr-0003-wgsl-shader-asset-contracts.md`
|
|
498
|
+
- package `docs/adrs/adr-0006-pvox-model-resolution-contracts.md`
|
|
314
499
|
- package `docs/tdrs/tdr-0001-wgsl-shader-asset-envelope-validation.md`
|
|
500
|
+
- package `docs/tdrs/tdr-0003-pvox-validation-and-confirmation-binding.md`
|
|
315
501
|
|
|
316
502
|
## Development
|
|
317
503
|
|
|
@@ -337,3 +523,17 @@ npm run pack:check
|
|
|
337
523
|
## License
|
|
338
524
|
|
|
339
525
|
Apache-2.0
|
|
526
|
+
|
|
527
|
+
<!-- BEGIN PLASIUS RELEASE INTEGRITY -->
|
|
528
|
+
## Release integrity
|
|
529
|
+
|
|
530
|
+
CI keeps the administrative contributor registry outside Git and npm package
|
|
531
|
+
artifacts using exact, case-normalised path checks. CI runs on approved
|
|
532
|
+
self-hosted runners. Release preparation and npm publication use GitHub-hosted
|
|
533
|
+
runners with Node.js 24.18.0 LTS and npm 11.5.1 or newer. CD must not be
|
|
534
|
+
dispatched until the npm trusted-publisher binding is verified. Publication is
|
|
535
|
+
token-free and proceeds only while the prepared commit remains the exact
|
|
536
|
+
`main` head after successful push-triggered CI for that SHA. Repository release
|
|
537
|
+
admission scripts run in a separate credential-free job; the fresh privileged
|
|
538
|
+
release-preparation job disables Git hooks before creating its review PR.
|
|
539
|
+
<!-- END PLASIUS RELEASE INTEGRITY -->
|