diff --git a/tests/package_tests.py b/tests/package_tests.py index a1c0b71..20a73e2 100644 --- a/tests/package_tests.py +++ b/tests/package_tests.py @@ -35,6 +35,15 @@ class PackageAllowlistTests(unittest.TestCase): target.parent.mkdir(parents=True, exist_ok=True) target.write_text('synthetic license placeholder') package.validate(root, False) + schema = root / 'docs/formats/obw/schema/1.0/manifest.json' + schema.parent.mkdir(parents=True) + schema.write_text('{"type":"object"}') + package.validate(root, False) + unexpected_json = root / 'docs/world.json' + unexpected_json.write_text('{"synthetic":true}') + with self.assertRaises(RuntimeError): + package.validate(root, False) + unexpected_json.unlink() for name in ['game.fbm', 'BMH.EXE', 'unit_tests', 'secret.txt']: (root / name).write_text('synthetic refusal fixture') with self.assertRaises(RuntimeError): diff --git a/tools/package/make_package.py b/tools/package/make_package.py index 681fe87..60ef0bc 100644 --- a/tools/package/make_package.py +++ b/tools/package/make_package.py @@ -26,6 +26,9 @@ def validate(directory, windows): allowed |= (len(relative.parts) >= 2 and relative.parts[0] == 'docs' and 'licenses' not in relative.parts and file.suffix in {'.md', '.txt', '.csv'} and all(part not in {'analyses', 'agents', 'manuals', 'validation'} for part in relative.parts)) + # Versioned OBW schemas are authored format documentation, not game data. + allowed |= bool(re.fullmatch(r'docs/formats/obw/schema/[1-9][0-9]*\.[0-9]+/[a-z][a-z0-9_-]*\.json', + relative.as_posix())) # App-local UCRT deployment must ship the whole redist set, core forwarders included. allowed |= (windows and len(relative.parts) == 1 and bool(re.fullmatch(r'(?:vcruntime\d+(?:_\d+)?|msvcp\d+(?:_\d+|_atomic_wait|_codecvt_ids)?|'