Ground bot intentions in live game knowledge and verify outcomes
Core tests / core (push) Successful in 28s

This commit is contained in:
Codex
2026-09-25 13:28:03 +08:00
parent 20ccd0fced
commit 502cb1e4fd
17 changed files with 251 additions and 24 deletions
+12
View File
@@ -34,3 +34,15 @@ test('trainer activity reports pending work and verified learning separately',()
const a=activityReason(b,now);assert.equal(a.label,'Visiting class trainer');assert.match(a.detail,/3 identified spells pending, 2 verified trainer purchases/);
b.world.inCombat=true;assert.equal(activityReason(b,now).label,'In combat');
});
test('exposure excludes stale snapshots and gaps; outcome evidence counts once',()=>{
const s=state();const first=observeInsights(s,undefined,now);
for(const b of s.bots)b.world.at=now+60;
s.bots[0].autonomy.intentChecks=[{id:'q',action:'quest',status:'observed',checkedAt:now+30,detail:'XP gained'}];
const next=observeInsights(s,first.cursor,now+60);
assert.equal(next.events.filter(e=>e.kind==='onlineSeconds').reduce((n,e)=>n+e.amount,0),120);
assert.equal(next.events.filter(e=>e.kind==='intentObserved').length,1);
assert.equal(observeInsights(s,next.cursor,now+90).events.length,0);
for(const b of s.bots)b.world.at=now+600;
assert.equal(observeInsights(s,next.cursor,now+600).events.filter(e=>e.kind==='onlineSeconds').length,0);
});