# Bind shot identity, file, hash and editorial order in one manifest

Keep shotId, exact filename, SHA-256 and order consistent before assembly. These checks establish file identity and sequence, not visual continuity or the quality of generated footage.

This complete kit uses Node standard-library modules only. No media tool installation is required.

Run from this directory and select a NEW output directory. Existing output directories are refused. On a memory-managed workstation, put its local serialization wrapper before the Node command. No provider credentials or off-device fixture requests are used.

```sh
node run-recipe.mjs --out ./my-run
```

Recorded execution: 8 checks passed, including 6 expected rejections. Node v24.18.0. No FFmpeg subprocess.

Preparation

- Use Node.js with built-in filesystem and crypto modules. The three original one-second shot specifications are opening, hinge and hold; no media provider is contacted.
- Read shot-manifest.json together with the JSON files in shots/. Each file carries its own shotId in addition to the external manifest binding.
- Choose a fresh output directory and require order values 1–3 to match row position. Basenames are local and unique; parent paths and duplicated filenames are not allowed.

## 01. Define identities independently from filenames

The fixture writes three distinct shot JSON files and a manifest with shotId, order, file and sha256. The editorial identity is opening/hinge/hold, while the basenames are shot-01.json through shot-03.json. This distinction lets a renamed file remain a separate reviewed decision.

## 02. Validate order and uniqueness first

Check the exact row count, unique shot IDs, sequential order values and unique safe filenames. A duplicate ID is a failure even when its bytes can be opened; a reordered manifest is not silently sorted into a different editorial sequence.

## 03. Check both file bytes and internal shot identity

Require the file to exist, its SHA-256 to match and its internal shotId to equal the manifest. The suite swaps a filename while keeping the original hash, then rebinds the hash to the wrong shot as a separate case. The second case still fails identity binding.

## 04. Preserve the failed bindings for review

Inspect eight assertions and six expected-rejection records. A missing shot, duplicate ID, wrong order, swapped filename, wrong internal identity and duplicated file each retain a concrete failure reason. Use a separate video review for action and continuity.

Acceptance

- The valid three-row manifest passes without reordering its records.
- opening, hinge and hold are three unique shot identities.
- A duplicate shot ID and a reordered row are separately rejected.
- A filename swap fails the original SHA-256 binding.
- A missing file and a duplicate filename are rejected.
- Even after rebinding the swapped file’s hash, its wrong internal shotId is rejected; all eight checks pass.

Troubleshooting

A readable file is attached to the wrong shot. Correct the file-to-shotId binding and recheck its internal identity. Regenerating a hash alone cannot repair the editorial mismatch.

Two rows use one shot ID. Assign the intended distinct shotId to the incorrect record and its file content, then recompute only that file’s expected hash.

The sequence changes after download. Use the manifest order values as the handoff contract and reject row-position disagreement; do not substitute alphabetical file sorting.

Public receipt copies normalize only local checkout paths and include publicPathNormalization with the original receipt SHA-256; raw originals are retained outside public assets. The actual receipts are under executed/. failure-receipt.json lists expected negative cases, not failed-suite assertions. Original tiny fixtures are generated again into your new output directory; shipped executed inputs and outputs let you inspect the recorded run. Temporary raw buffers and local HTTP servers are cleaned in finally.

checksums.json records every distributed file except itself and the archive, avoiding self-reference. The ZIP includes that same checksum list. Recompute hashes after download; comparison requires trusting the expected list. execution-receipt.json records executed script hashes before and after the run. The complete kit archive is also bound by the publishing catalog asset inventory.

The manifest makes the three shot specifications reviewable as a package. It does not inspect footage, enforce narrative meaning or demonstrate any video model run.

Sources read on 2026-10-14

- Node.js filesystem API: local file inspection: https://nodejs.org/api/fs.html
- Node.js crypto API: SHA-256 hashing: https://nodejs.org/api/crypto.html
