from pathlib import Path
root=Path(__file__).resolve().parents[1]
needed=['vendor/autoload.php','artisan','database.sql','.env','.htaccess','public/index.php','composer.lock','README.txt','app/Models/AccountAttachment.php','database/migrations/2026_09_20_000002_create_account_attachments_table.php','tests/Feature/PccmsSystemTest.php']
missing=[name for name in needed if not (root/name).is_file()]
code=[p.read_text(errors='ignore') for base in ['app','resources','routes','config'] for p in (root/base).rglob('*') if p.is_file()]
controller=(root/'app/Http/Controllers/StudentAccountController.php').read_text()
ai=(root/'app/Http/Controllers/AiAssistantController.php').read_text()
users=(root/'app/Http/Controllers/UserController.php').read_text()
sql=(root/'database.sql').read_text()
checks={'prohibited_brand_not_displayed':not any('First City University College' in text for text in code),'framework_13_31':'"version": "v13.31.0"' in (root/'composer.lock').read_text(),'roles':all(role in sql for role in ['superadmin','admin','programme_coordinator']),'multi_attachment':all(x in controller+sql for x in ['attachments.*','storeAttachments','account_attachments']),'private_storage':"store(\"credit-control/{$account->id}\", 'local')" in controller,'password_input':"Hash::make($data['password'])" in users,'ai_graceful':"with('ai_error'" in ai and 'ConnectionException' in ai,'directory_listing_disabled':'Options -Indexes' in (root/'.htaccess').read_text()}
assert not missing and all(checks.values()),f'missing={missing}, checks={checks}'
print('PASS:',checks)
