Ground bot intentions in live game knowledge and verify outcomes
Core tests / core (push) Successful in 28s
Core tests / core (push) Successful in 28s
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Read-only checkpoint for the grounded-decision trial. No keys or player whispers."""
|
||||
import collections,json,time,urllib.request
|
||||
from pathlib import Path
|
||||
base='http://127.0.0.1:8787'
|
||||
def get(path):
|
||||
with urllib.request.urlopen(base+path,timeout=20) as r:return json.load(r)
|
||||
s=get('/api/state');insights=get('/api/realm-insights');now=time.time()
|
||||
bots=[b for b in s['bots'] if b.get('status')=='online' and b.get('autonomy',{}).get('managed')]
|
||||
checks=[c for b in bots for c in b.get('autonomy',{}).get('intentChecks',[])]
|
||||
report={'checkedAt':now,'online':len(bots),'teams':dict(collections.Counter(b.get('world',{}).get('team') for b in bots)),
|
||||
'freshObservations':sum(0<=now-b.get('world',{}).get('at',0)<90 for b in bots),
|
||||
'groupedBots':sum(bool(b.get('world',{}).get('groupId')) for b in bots),
|
||||
'questKnowledge':sum(bool(b.get('world',{}).get('questBrief')) for b in bots),
|
||||
'evaluation':insights.get('evaluation'),'recentIntentResults':dict(collections.Counter(c['status'] for c in checks)),
|
||||
'currentActivity':dict(collections.Counter(b['label'] for b in insights.get('activity',[]))),
|
||||
'zaku':[{k:b.get(k) for k in ('name','level','zone','lastDecision')} for b in bots if b['name']=='Zaku'],
|
||||
'limitations':['Rates use fresh sampled bot-hours; collection gaps excluded.','Native death deltas use retained death records; retention can undercount at rollover.','An observed outcome following an intention does not establish causation.','One day is an initial comparison, not proof of long-term reliability.']}
|
||||
print(json.dumps(report,indent=2))
|
||||
@@ -1,6 +1,6 @@
|
||||
"""Read native counters and profiler output; return bounded public measurements."""
|
||||
import json,subprocess,time,math
|
||||
COUNTERS=('quests','abandoned','lootEvents','lootItems','partyKills','rewarded','lootedCopper')
|
||||
COUNTERS=('quests','abandoned','lootEvents','lootItems','partyKills','rewarded','lootedCopper','nativeDeaths')
|
||||
def normalize_performance(raw):
|
||||
def number(v):
|
||||
try:
|
||||
@@ -28,9 +28,13 @@ def collect(sql,state):
|
||||
for line in sql('SELECT guid,COUNT(*) FROM acore_characters.character_queststatus_rewarded WHERE guid IN ('+guids+') GROUP BY guid').splitlines():
|
||||
guid,count=map(int,line.split('\t'));rewarded[guid]=count
|
||||
money={int(g):int(c) for g,c in (line.split('\t') for line in sql('SELECT guid,looted_copper FROM acore_auth.azerothai_currency').splitlines())}
|
||||
deaths={}
|
||||
for line in sql('SELECT guid,account_id,name,COUNT(*) FROM acore_auth.azerothai_death_experience GROUP BY guid,account_id,name').splitlines():
|
||||
g,account,name,count=line.split('\t');g=int(g)
|
||||
if g in allowed and allowed[g]['name']==name and allowed[g]['autonomy'].get('accountId')==int(account):deaths[g]=int(count)
|
||||
result=[]
|
||||
for guid,b in allowed.items():
|
||||
counters=rows.get(guid,dict.fromkeys(COUNTERS,0));counters['rewarded']=rewarded.get(guid,0);counters['lootedCopper']=money.get(guid,0)
|
||||
counters=rows.get(guid,dict.fromkeys(COUNTERS,0));counters['rewarded']=rewarded.get(guid,0);counters['lootedCopper']=money.get(guid,0);counters['nativeDeaths']=deaths.get(guid,0)
|
||||
result.append({'guid':guid,'name':b['name'],**counters})
|
||||
return result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user