Fix progression stalls and add normal class trainer visits
Core tests / core (push) Successful in 29s

This commit is contained in:
Codex
2026-09-24 09:24:57 +12:00
parent d57d793a84
commit 132bf75f9d
24 changed files with 343 additions and 31 deletions
+7 -1
View File
@@ -42,7 +42,7 @@ export function observeInsights(s:State,previous:Cursor|undefined,now:number){
}
return {cursor,events};
}
export function activityReason(b:Bot,now:number){
function activityReasonBase(b:Bot,now:number){
const w=b.world,action=b.lastDecision?.action;
if(b.status!=='online')return {label:b.status,detail:'This resident is not currently online.'};
if(!w||now-w.at>120)return {label:'Telemetry delayed',detail:'Current activity cannot be confirmed from stale observations.'};
@@ -54,6 +54,7 @@ export function activityReason(b:Bot,now:number){
}
if(w.inCombat)return {label:'In combat',detail:'The game reports active combat. Recovery is skipped.'};
if(w.casting)return {label:'Casting',detail:'The game reports a spell cast. Recovery is skipped.'};
if(w.trainingAt&&now-w.trainingAt<90&&w.trainingStatus==='traveling')return {label:'Visiting class trainer',detail:`Walking to ${w.trainingTrainer??'class trainer'} · ${w.trainingPending??0} eligible spells pending. Purchases require the normal trainer interaction and sufficient money.`};
if(w.taxi)return {label:'Traveling by taxi',detail:'The game reports taxi travel. Recovery is skipped.'};
if(w.humanControlled)return {label:'Following player control',detail:'A human master controls this bot. Recovery is skipped.'};
const idle=now-(w.stationarySince??w.at);
@@ -62,6 +63,11 @@ export function activityReason(b:Bot,now:number){
if(idle>=600&&(action==='quest'||action==='explore'))return {label:'Possible stall',detail:w.movementType===7?'Flight controller remains active; native recovery checks whether it is stale.':'No recent movement while intending to travel. The native guard checks progress, safety and cooldown before recovery.'};
return {label:w.groupId?'Grouped / stationary':'Briefly stationary',detail:w.groupId?'May be waiting for companions; waiting is inferred, not confirmed.':'May be choosing a target or pausing between actions. No stall is established.'};
}
export function activityReason(b:Bot,now:number){
const result=activityReasonBase(b,now),w=b.world;
if(w?.trainingAt&&now-w.trainingAt<120)return {...result,detail:result.detail+` Training check at level ${w.trainingLevel}: ${w.trainingStatus}; ${w.trainingPending??0} identified spells pending, ${w.trainingLearned??0} verified trainer purchases.`};
return result;
}
export function summarize(events:Evidence[],start:number,end:number,startedAt:number,samples:number){
const totals:Record<string,number>={levels:0,deaths:0,arrivals:0,conversations:0,bonds:0,parties:0,recruits:0,guild:0,recoveries:0};
for(const e of events)totals[e.kind]=(totals[e.kind]??0)+e.amount;