# Asset Pack Checker 1.0.0

Check a ZIP before importing it into a game or handing it to a build agent. Download `pack-check.py` and run it locally with Python 3.8 or newer. It reads the ZIP in place and requires no packages, network, accounts or access to your project.

## Try it

Download [Pixel Current](https://www.bitblurs.com/library/pixel-current), put the script beside the ZIP and run:

```sh
python pack-check.py pixel-current-0.2.0.zip --json
```

A successful report gives the number of verified files and exits with code 0. A failed check exits with code 1 and describes the first problem. An agent should run its import step only after exit 0. To verify the identity of the complete published ZIP as well, pass its SHA-256 from a trusted release listing:

```sh
python pack-check.py pixel-current-0.2.0.zip --sha256 5c8bbb521e8aafb88b62e81cdaf4fcca47a5e9614147daee5f902ec30308d763
```

The same tool reads the `download-manifest.json` in the [Iso Forest 0.3.0 River Terrace download](https://www.bitblurs.com/library/iso-forest). The ZIP digest for that release is `4bb1c49c984c37b2f481561410264aedcb3c9bc495e5135ac18253e91c07c1cb`. Without a trusted ZIP digest, a pass means the files agree with the manifest supplied in that archive. It does not establish authorship or evaluate the contents of a script.

## Use your own pack

Put an `integrity.json` at the root, alongside the files it describes. A single enclosing folder around the entire pack also works. List every regular file except the manifest. Use forward-slash paths relative to the manifest and hash the exact bytes that will go into the ZIP. For a minimal example, create an empty `notes.txt` and use this manifest:

```json
{"schema":"bitblur.file-integrity.v1","files":[{"name":"notes.txt","bytes":0,"sha256":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}]}
```

ZIP the two files, run the checker, then change the text file and rebuild the ZIP without updating the manifest. The second check should fail. The alternate `bitblur.download/1` format uses `download-manifest.json` and the field `path` in place of `name`.

Version 1 accepts stored and Deflate ZIPs with up to 20,000 entries and 1 GiB of uncompressed content. It rejects encrypted entries, symbolic links, repeated paths, listed files with different bytes, and unlisted files. File hashes are streamed. The MIT licence is included in the script.
