"""Development audit of 96 outcome-hidden store descriptions; no player reviews."""
import json,hashlib
from design import *
raw=json.loads((R/'audit_blind.json').read_text())
# Explicit setup/build evidence, broader configuration, ambiguity, or no evidence.
# These are single-reader judgments of advertisements, not gameplay verification.
clear={2,8,9,16,17,24,25,26,32,33,34,40,48,49,50,56,57,58,64,66,72,73,74,80,81,82,88,89,90}
broader={3,4,6,18,19,20,28,29,30,38,39,44,53,59,75,78,85,92}
unclear={1,5,10,12,13,35,36,37,41,45,67,76,77,83,84,86,91}
wrong_host={4,5,6,17,23,36,40,41,42,80,81,85,86}
notes={0:'Cosmetic character customization is not a gameplay build.',1:'Choosing a monster body does not necessarily establish a multi-component build.',
6:'Army composition and counter-lineups were missed by the first broad screen.',11:'Modified DOOM engine is a technical reference.',
17:'Cards/tiles are advertised; actual racing is not.',21:'Unreal engine customization is not car tuning evidence.',
27:'Collected gear is described as styling the runner.',30:'Roster, lineup and playbook choices are real configuration without conventional build wording.',
38:'Ship armament selection and defense-force allocation.',39:'Explicit ship-performance customization.',40:'Weapon rhythm is not necessarily a rhythm game.',
42:'Literal wooden deck construction pun.',43:'Dance choreography/cosmetics are not a build setup.',
65:'Configuring blackjack house rules is not constructing a deck.',69:'Power-ups/adjusted time are not enough to establish builds.',
78:'Athlete attributes and lineup choices have stated track-dependent tradeoffs.',87:'Explicitly no skill tree, all moves unlocked.',
93:'Fine-tuning professional skills is not evidence of loadout customization.'}
rows=[]
for i,a in enumerate(raw):
 label='clear_setup' if i in clear else ('broader_configuration' if i in broader else ('unclear' if i in unclear else 'no_confirmed_configuration'))
 rows.append(dict(index=i,appid=a['appid'],name=a['name'],host=a['host'],original_stratum=a['stratum'],judgment=label,host_mismatch=i in wrong_host,note=notes.get(i,'')))
pd.DataFrame(rows).to_csv(R/'audit_labels.csv',index=False)
(R/'audit_manifest.json').write_text(json.dumps(dict(n=96,reader='one assistant',outcomes_hidden=True,
 purpose='Classifier development and error detection, not held-out precision/recall estimation.',
 corrections='Technical-engine references, cosmetic mixing, literal wooden decks and blackjack house rules removed; playstyle-only claims moved to extended; lineup and ship-configuration candidates improved; primary hosts require activity language.',
 packet_hash=hashlib.sha256((R/'audit_blind.json').read_bytes()).hexdigest(),labels_hash=hashlib.sha256((R/'audit_labels.csv').read_bytes()).hexdigest()),indent=2))
print(pd.DataFrame(rows).groupby(['original_stratum','judgment']).size().unstack(fill_value=0).to_string())
