# Reproducible V3 source-and-evidence verifier bundle

This tool creates a deterministic, self-contained review package for an exact
reviewed source commit and its exact evidence commit. It is deliberately not a
plain `git archive`: Git archives represent submodules as gitlinks and omit
vendored dependency source.

The generated `vaultfire-verifier-bundle/v2` package:

1. snapshots `v3-src` at the specified **source commit** and recursively vendors
   every pinned submodule needed to inspect it, including `SafeERC20.sol`;
2. contains `git-bundles/source.bundle` for the exact source commit and
   `git-bundles/evidence.bundle` for the exact evidence commit;
3. records both commit/tree IDs and rejects a package unless the evidence commit
   has the source commit as its **sole direct parent**;
4. includes a standard-library-only offline verifier, deterministic archive
   metadata, a complete SHA-256 manifest, and secret-material rejection.

The source bundle proves the reviewed source independently. The evidence bundle
is incremental over that exact source bundle: together the two files are
self-contained, while avoiding a duplicate copy of source history. The offline
verifier loads the source bundle before validating and fetching the evidence
bundle, then reproduces the direct parent edge.

## Create the correction package

Run from any Git worktree that contains both commits and initialized recursive
submodules:

```sh
python3 release-tools/verifier-bundle/create_verifier_bundle.py \
  --repo /path/to/vaultfire-v3-mainnet-release-20260822 \
  --source-commit 57f9fe81d7bd7eb9953822daba79797be7e1c2ee \
  --evidence-commit f0815778912bb832411d26bdc009c5b9ee10375a \
  --output /secure/release-artifacts/vaultfire-v3-source-evidence-bundle.tar.gz
```

The command is intentionally explicit: it refuses any pair that is not a
single-parent, direct evidence-to-source relation. It produces no Git commits,
network actions, deployments, signatures, broadcasts, or payments.

## Verify offline

```sh
python3 release-tools/verifier-bundle/verify_verifier_bundle.py \
  /secure/release-artifacts/vaultfire-v3-source-evidence-bundle.tar.gz
```

Verification checks archive safety, exact SHA-256 coverage, both top-level Git
bundles (`git bundle verify`, clone, and `git fsck --no-dangling`), source and
evidence commit/tree IDs, the evidence direct-parent relation, every recursive
submodule pin, the vendored source tree, and required files.

Forge checks are deliberately offline and optional only in the sense that their
absence is reported as `INCOMPLETE`, not `PASS`. Use `--allow-incomplete` only
when accepting structural verification without local Forge checks; use
`--require-all-tools` when the compiler checks must also run.

## Determinism and safety

The creator fixes tar ownership, permissions metadata, ordering, archive mtimes,
and gzip mtime. Identical inputs and tool version produce byte-identical output.
It rejects `.env`, key-like files, private-key paths, and private-key/API-key
literals before packaging. The unit suite also confirms that a changed vendored
file, a missing dependency file, or a falsified evidence-parent assertion is
rejected.
