@plasius/asset-contracts 0.3.1 → 0.4.1

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