"""Exact package inventory; verifies code and own targets, not just an exit flag."""
from pathlib import Path
import hashlib,json
manifest=json.loads(Path('package-manifest.json').read_text())
for row in manifest['files']:
    if Path(row['name']).name!=row['name']:raise ValueError('Unexpected package path')
    body=Path(row['name']).read_bytes()
    if len(body)!=row['bytes'] or hashlib.sha256(body).hexdigest()!=row['sha256']:raise ValueError('Package member changed: '+row['name'])
print('PASS',len(manifest['files']),'exact package members')
