| import json, pathlib, sys, tomllib, subprocess |
| root = pathlib.Path(__file__).resolve().parents[1] |
| checks=[] |
| def ok(name, passed, detail=''): |
| checks.append((name, passed, detail)) |
| for p in ['config/model-catalog.json','config/models.json','manifest/product.json']: |
| try: json.loads((root/p).read_text(encoding='utf-8')); ok(f'json {p}', True) |
| except Exception as e: ok(f'json {p}', False, str(e)) |
| for p in ['config/jackailocal.windows.toml','config/jackailocal.linux.toml','config/jackailocal.macos.toml','config/jackailocal.appliance.toml']: |
| try: tomllib.loads((root/p).read_text(encoding='utf-8')); ok(f'toml {p}', True) |
| except Exception as e: ok(f'toml {p}', False, str(e)) |
| for p in ['webui/index.html','webui/app-v15.js','webui/styles.css','src/main.rs']: |
| ok(f'exists {p}', (root/p).exists()) |
| legacy = list(root.rglob('*PortableMind*')) |
| ok('product rename JackAILocal', len(legacy)==0, f'legacy names: {[str(x.relative_to(root)) for x in legacy[:5]]}') |
| placeholders = [str(p.relative_to(root)) for p in root.rglob('*PUT_*')] |
| ok('no placeholder payload files', len(placeholders)==0, f'placeholders: {placeholders[:5]}') |
| product_text = '\n'.join( |
| p.read_text(encoding='utf-8', errors='replace') |
| for p in [root/'README.md', root/'saas/gradio/README.md', root/'manifest/product.json'] |
| if p.exists() |
| ).lower() |
| for forbidden in ['mock server', 'fake usb', 'usb simulator', 'demomode']: |
| ok(f'no product claim: {forbidden}', forbidden not in product_text) |
| for name, passed, detail in checks: |
| print(('PASS' if passed else 'FAIL'), name, detail) |
| if any(not p for _,p,_ in checks): sys.exit(1) |
|
|