Files
praxisandClaude Fable 5.2 7f2139d8d0 Offline test fixtures
883 files, from working commit b1a079a.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-19 01:32:48 +02:00

58 lines
4.2 KiB
Python

#!/usr/bin/env python3
"""Actual public minimap glyphs against yellow foliage; no running UI input."""
import io,os,subprocess,sys
from pathlib import Path
from PIL import Image,ImageOps
root=Path(__file__).resolve().parents[1];sys.path.insert(0,str(root/'ops'))
from client_ui import tight_world_label,raw_world_label,is_world_screen,native_world_label
from client_session import classify
for name in ('northshire-foliage-zone.png','gm-island-zone.png','orgrimmar-valley-of-honor-zone.png','twilight-base-camp-zone.png'):
crop=Image.open(root/'docs/evidence/automation'/name)
p=Image.new('RGB',(1920,1080))
if name=='northshire-foliage-zone.png':
assert crop.size==(113,16);p.paste(crop,(1717,4));label=tight_world_label(p);assert label.size==(904,128)
else:
# Actual GM Island is recognized by capture_text's existing first
# grayscale minimap pass; nearest-neighbour tight OCR reads its G as o.
assert crop.size==(229,35);p.paste(crop,(1690,0))
label=ImageOps.autocontrast(p.crop((1690,0,1919,35)).convert('L')).resize((916,140))
b=io.BytesIO();label.save(b,format='PNG');r=subprocess.run(['tesseract','stdin','stdout','--psm','7'],input=b.getvalue(),capture_output=True,env=dict(os.environ,OMP_THREAD_LIMIT='1'),check=True)
assert is_world_screen(r.stdout.decode()),'Actual world glyphs still fail readiness; do not relax state guards'
crop=Image.open(root/'docs/evidence/automation/booty-bay-bank-post-login-zone.png')
assert crop.size==(95,22)
p=Image.new('RGB',(1920,1080));p.paste(crop,(1710,0))
b=io.BytesIO();raw_world_label(p).save(b,format='PNG')
r=subprocess.run(['tesseract','stdin','stdout','--psm','7'],input=b.getvalue(),capture_output=True,env=dict(os.environ,OMP_THREAD_LIMIT='1'),check=True)
assert is_world_screen(r.stdout.decode()),'Actual bank gold mask needs exact single-line OCR'
assert tight_world_label(Image.new('RGB',(800,600))) is None
assert classify('Email or phone Password Remember account Log in Northshire Valley')=='login'
assert classify('Disconnected Northshire Valley')=='disconnected'
assert classify('Valley of Honor')=='world'
assert classify('Email or phone Password Remember account Log in Valley of Honor')=='login'
assert classify('Disconnected Valley of Honor')=='disconnected'
assert classify('Valley of Honor Enter World Create Character')=='characters'
assert classify('GM Island')=='world'
assert classify('Email or phone Password Remember account Log in GM Island')=='login'
assert classify('Disconnected GM Island')=='disconnected'
assert classify('GM Island Enter World Create Character')=='characters'
assert classify('GM Island Enter World')=='loading-or-unknown'
assert classify('Twilight Base Camp')=='world'
assert classify('Account Name Password Remember account Log in Twilight Base Camp')=='login'
assert classify('Disconnected Twilight Base Camp')=='disconnected'
assert classify('Twilight Base Camp Enter World Create Character')=='characters'
assert classify('Silithus')=='world'
assert classify('Account Name Password Remember account Log in Silithus')=='login'
assert classify('Disconnected Silithus')=='disconnected'
assert classify('Silithus Enter World Create Character')=='characters'
print('Actual Northshire/GM Island minimap glyphs recognized; credential/disconnect/roster precedence and size guard preserved.')
crop=Image.open(root/'docs/evidence/automation/twilight-native-gold-zone.png')
p=Image.new('RGB',(2560,1440));p.paste(crop,(2245,0));b=io.BytesIO();native_world_label(p).save(b,format='PNG')
r=subprocess.run(['tesseract','stdin','stdout','--psm','7'],input=b.getvalue(),capture_output=True,env=dict(os.environ,OMP_THREAD_LIMIT='1'),check=True)
assert is_world_screen(r.stdout.decode()),'Original1440p gold glyphs must remain exact before reference scaling'
assert native_world_label(Image.new('RGB',(800,600))) is None
crop=Image.open(root/'docs/evidence/automation/silithus-native-gold-zone.png')
p=Image.new('RGB',(2560,1440));p.paste(crop,(2245,0));b=io.BytesIO();native_world_label(p).save(b,format='PNG')
r=subprocess.run(['tesseract','stdin','stdout','--psm','7'],input=b.getvalue(),capture_output=True,env=dict(os.environ,OMP_THREAD_LIMIT='1'),check=True)
assert is_world_screen(r.stdout.decode()),'Observed Silithus label must not strand a healthy native ghost session'