# ISIS v2 WebP Output Schema and Metadata Contract

Generated: 2026-03-06T07:59:11.927Z Checklist: `MXD-0009` (ISIS2-01199) Format:
`webp` (image/webp) Phase: Phase 4 | Milestone: M3 Launch (2026-07-27 to
2026-10-30)

## Objective

Define a canonical schema and metadata contract for WebP outputs with strict
chunk-level validation, deterministic integrity metadata, and workflow
provenance suitable for reproducible downstream ingest across Isis preview
packages.

## Canonical Schema

- Schema ID: `isis.v2.output.webp.package`
- Schema Version: `1.0.0`
- Binary signature: `52 49 46 46 .... 57 45 42 50`
- Required top-level fields:
  - `schemaVersion`
  - `format`
  - `width`
  - `height`
  - `encodingMode`
  - `colorSpace`
  - `hasAlpha`
  - `animated`
  - `artifactRole`
  - `chunkInventory`
  - `encoder`
  - `manifest`
- Manifest fields:
  - `filename`
  - `mimeType`
  - `checksumAlgorithm`
  - `checksum`
  - `generatedAt`
  - `provenance`

## Validation Invariants

- RIFF and WEBP chunks are mandatory for every WebP output.
- Lossy WebP outputs require VP8; lossless outputs require VP8L; extended
  outputs require VP8X.
- Alpha-enabled WebP outputs require ALPH or VP8X chunk coverage.
- Animated WebP outputs require ANIM, ANMF, and frameCount.
- loopCount is only valid for animated WebP outputs.
- RegisterOutputRequest dimensions must match webpPackage width and height when
  both are supplied.
- RegisterOutputRequest mimeType must be image/webp and storage.key must end
  with .webp when webpPackage is supplied.
- WebP manifest checksum uses sha256 and must preserve workflow/dependency
  provenance linkage.

## Supported Package Classes

| Package Class | Storage Tier | Required Artifacts                                                            |
| ------------- | ------------ | ----------------------------------------------------------------------------- |
| `preview`     | `HOT`        | `preview/hero-preview.{png,jpg,webp,mp4}`, `preview/thumbnail.{png,jpg,webp}` |

## Applicable Asset Families

| Asset Family                       | Output Classes  | Naming Rules |
| ---------------------------------- | --------------- | ------------ |
| `animatic-shot-set`                | `preview_image` | `FN-001`     |
| `architecture-kitbash-pack`        | `preview_image` | `FN-001`     |
| `audio-sfx-pack`                   |                 |              |
| `character-concept-art`            | `preview_image` | `FN-001`     |
| `character-costume-variant-pack`   | `preview_image` | `FN-001`     |
| `character-expression-sheet`       | `preview_image` | `FN-001`     |
| `character-prop-interaction-sheet` | `preview_image` | `FN-001`     |
| `character-turnaround-sheet`       | `preview_image` | `FN-001`     |
| `cinematic-shot-sequence`          |                 |              |
| `creature-concept-art`             | `preview_image` | `FN-001`     |
| `decal-pack`                       | `preview_image` | `FN-001`     |
| `environment-concept-art`          | `preview_image` | `FN-001`     |
| `environment-matte-painting`       | `preview_image` | `FN-001`     |
| `environment-tileset-pack`         | `preview_image` | `FN-001`     |
| `foliage-pack`                     | `preview_image` | `FN-001`     |
| `hud-element-pack`                 | `preview_image` | `FN-001`     |
| `interior-scene-pack`              | `preview_image` | `FN-001`     |
| `marketing-key-art-pack`           | `preview_image` | `FN-001`     |
| `material-pbr-pack`                | `preview_image` | `FN-001`     |
| `music-cue-pack`                   |                 |              |
| `npc-crowd-variation-pack`         | `preview_image` | `FN-001`     |
| `prop-pack-general`                | `preview_image` | `FN-001`     |
| `sky-atmosphere-pack`              | `preview_image` | `FN-001`     |
| `social-cutdown-pack`              | `preview_image` | `FN-001`     |
| `storyboard-frame-set`             | `preview_image` | `FN-001`     |
| `terrain-heightmap-pack`           | `preview_image` | `FN-001`     |
| `ui-icon-pack`                     | `preview_image` | `FN-001`     |
| `vehicle-exterior-pack`            | `preview_image` | `FN-001`     |
| `vehicle-interior-pack`            | `preview_image` | `FN-001`     |
| `vfx-element-pack`                 | `preview_image` | `FN-001`     |
| `voice-line-pack`                  |                 |              |
| `weapon-pack`                      | `preview_image` | `FN-001`     |

## Verification Commands

- `pnpm --filter @isis/output-registry exec vitest run src/schemas/output.schema.spec.ts`
- `node scripts/isis/validate-v2-webp-output-schema-metadata-contract.mjs`

## Acceptance Criteria

- Output registry accepts first-class WebP package metadata with strict
  validation over chunk inventory, animation flags, alpha handling, and manifest
  checksum fields.
- Canonical WebP contract enumerates the package classes and output classes that
  legitimately emit WebP artifacts under the shared output taxonomy.
- WebP manifest provenance preserves workflow-variant and dependency-manifest
  linkage needed for deterministic downstream ingest.
- Validator and schema tests catch invalid WebP registrations and enforce the
  canonical metadata surface.
