"""Read-only public checks. No login, submissions, mail, AI calls or data changes."""
import urllib.request,urllib.error,json,ssl
BASE='https://ipc.ai360.com.my'
results=[]
for label,path in [('Home','/'),('Staff login','/wp-login.php')]:
 try:
  request=urllib.request.Request(BASE+path,headers={'User-Agent':'IPC-Public-Smoke-Check/1.1'})
  with urllib.request.urlopen(request,context=ssl.create_default_context(),timeout=20) as response:
   text=response.read(2000000).decode('utf-8',errors='replace')
   correct_origin=response.url.startswith(BASE+'/')
   results.append({'check':label,'status':'PASS' if response.status==200 and correct_origin and 'Pusat Tuisyen Inovasi Pintar Cemerlang' in text else 'NEEDS REVIEW','http_status':response.status,'https_origin_matches':correct_origin})
 except Exception as error:
  results.append({'check':label,'status':'NOT VERIFIED','detail':str(error)})
print(json.dumps({'target':BASE,'results':results,'scope':'Read-only public responses and TLS. Does not verify authenticated workflows, email, AI or devices.'},indent=2))
