# Supplementary Material / Replication Package

This package contains the frozen code, preserved inputs, processed outputs,
audit artifacts, and verification material for **More Models, Less Certainty:
The Evidence Budget of Distributional Analytics**.

It is designed for two distinct tasks:

1. editorial audit of the preserved frozen package, and
2. computational reruns that reproduce the reported numerical findings.

The package supports computational traceability. The protocol was locally
frozen before the primary runs, but it was not externally preregistered.

## Directory map

- `code/frozen/`: exact frozen Study 1 and Study 2 scripts.
- `code/run_study2_portable.py`: package-local Study 2 launcher.
- `code/audit_temporal_integrity.py`: executable audit of time ordering, prefix
  invariance, and sampled recomputation.
- `code/verify_numeric_results.py`: numeric reproduction checker for rerun
  outputs.
- `data/raw/`: 11 preserved adjusted-price snapshots used in Study 2.
- `data/asset_inventory.csv`: file coverage, block counts, and SHA-256 hashes.
- `data/redistribution_permissions.md`: current redistribution-permission note
  for the preserved market-data snapshots.
- `protocol/`: frozen confirmatory protocol and protocol hash.
- `results/`: frozen study outputs, tables, figures, and audit results.
- `results/paper_results_crosswalk.csv`: crosswalk from manuscript figures and
  tables to package result files.
- `manifests/file_manifest.csv`: file-level size and SHA-256 digest.
- `manifests/SHA256SUMS.txt`: standard checksum file.
- `manifests/verification_guide.md`: difference between hash and numeric
  verification.
- `DATA_AND_CODE_AVAILABILITY.md`: submission-ready data/code availability
  statement.

## Environment

Two dependency files are included:

- `requirements.txt`: broad compatibility ranges for routine reruns.
- `requirements-lock.txt`: exact versions for the replay environment used to
  verify this package.

The original frozen manifests report Python 3.9.6 on Apple silicon. The exact
replay lock file in this package was also verified on Python 3.9.6.

## Testing

The package now uses `pytest`-compatible tests.

From the package root:

```bash
pip install -r requirements-lock.txt
pytest
```

If you prefer direct execution, the same test file can also be run as:

```bash
python code/frozen/test_studies.py
```

## Recommended reproduction order

1. Install the exact replay environment:
   `pip install -r requirements-lock.txt`
2. Run the test suite:
   `pytest`
3. Run the temporal-integrity audit:
   `python code/audit_temporal_integrity.py`
4. Reproduce Study 1:
   `python code/frozen/run_study1.py --output results/reproduced_study1`
5. Reproduce Study 2 with package-local data:
   `python code/run_study2_portable.py --data-dir data/raw --output results/reproduced_study2`
6. Run numeric verification on the regenerated outputs:
   `python code/verify_numeric_results.py --study1-dir results/reproduced_study1 --study2-dir results/reproduced_study2`
7. Run archival hash verification if you need to confirm package identity:
   `shasum -a 256 -c manifests/SHA256SUMS.txt`

## Hash verification versus numeric verification

These checks answer different questions:

- `Hash verification` is for preserved files that should remain byte-identical.
  Use it for archived scripts, preserved raw snapshots, frozen tables/figures,
  and deposited result files.
- `Numeric verification` is for rerun outputs. Regenerated CSV or JSON files can
  differ in bytes because of float formatting or library behavior while still
  reproducing the same reported quantities.

See `manifests/verification_guide.md` for details.

## Manuscript exhibit crosswalk

Use `results/paper_results_crosswalk.csv` to map each manuscript figure or
table to:

- the primary package file,
- the supporting result files,
- the generating script, and
- the recommended verification mode.

This file is intended to make editorial spot checks faster.

## Data-redistribution status

The 11 preserved raw snapshots support confidential editorial audit. Current
Yahoo Finance and `yfinance` legal notices do **not** clearly authorize
unrestricted public redistribution of those raw files.

The current safest posture is:

- include `data/raw/` in confidential review submissions;
- exclude `data/raw/` from any unrestricted public repository unless written
  permission or another redistributable licensed source is obtained;
- retain `data/asset_inventory.csv`, source hashes, code, processed outputs, and
  reconstruction instructions in any public-facing release.

See `data/redistribution_permissions.md` and
`DATA_AND_CODE_AVAILABILITY.md`.

## Audit status

The included temporal-integrity audit reports an overall `PASS` result with
22 of 22 checks passed and no frozen-code modification detected. See
`results/temporal_integrity_audit/summary.json` and
`results/temporal_integrity_audit/temporal_integrity_audit.md`.
