Retry native party invitations and remove verified dead memberships
Core tests / core (push) Successful in 1m0s

This commit is contained in:
Codex
2026-09-22 23:18:27 -04:00
parent a533c7b28a
commit ad9f1801e4
6 changed files with 192 additions and 7 deletions
+3 -3
View File
@@ -2,7 +2,7 @@ const {test}=require('node:test');
const assert=require('node:assert/strict');
const {partyDecision,bondEvidence,community,compileCommunityAction,observePresence,applyCooperation}=require('../.test-build/community.js');
const now=()=>Date.now()/1000;
function bot(id){return {id,name:id,status:'online',level:5,autonomy:{managed:true,characterGuid:id==='A'?1:2},personality:{sociability:60,activities:['quest']},relationships:[],memories:[],world:{at:now(),team:1,nearby:id==='A'?['B']:['A'],inCombat:false,groupNames:[],groupId:'',guildId:3,guildName:'Guild',guildRank:0,mapId:0,x:1,y:1}};}
function bot(id){return {id,name:id,status:'online',level:5,autonomy:{managed:true,characterGuid:id==='A'?1:2,accountId:id==='A'?11:12},personality:{sociability:60,activities:['quest']},relationships:[],memories:[],world:{at:now(),team:1,nearby:id==='A'?['B']:['A'],inCombat:false,groupNames:[],groupId:'',guildId:3,guildName:'Guild',guildRank:0,mapId:0,x:1,y:1}};}
test('party acceptance respects faction, level, hostility, combat, and observation freshness',()=>{
const a=bot('A'),b=bot('B');assert.equal(partyDecision(a,b).accepted,true);
b.world.team=0;assert.equal(partyDecision(a,b).accepted,false);b.world.team=1;
@@ -22,7 +22,7 @@ test('relationship evidence is reciprocal, replay safe, bounded, and excludes de
});
test('native commands protect human parties, cap party size, verify identities and enforce guild authority',()=>{
const a=bot('A'),b=bot('B');
const p=compileCommunityAction('party',a,b);assert.match(p,/Human party is protected/);assert.match(p,/GetMembersCount\(\)>=5/);assert.match(p,/GroupCreate/);assert.match(p,/GetGUIDLow\(\)~=2/);
const p=compileCommunityAction('party',a,b);assert.match(p,/AzerothAIQueueParty/);assert.match(p,/guid=2,account=12/);assert.match(p,/__command_id/);
const g=compileCommunityAction('recruit',a,b);assert.match(g,/GetGuildRank\(\)~=0/);assert.match(g,/Already belongs to a guild/);
assert.match(compileCommunityAction('leave',a),/Party changed/);
});
@@ -34,7 +34,7 @@ test('fresh movement snapshots update guild registry and stale snapshots cannot
});
test('offline party members are protected when their identity cannot be checked live',()=>{
assert.match(compileCommunityAction('party',bot('A'),bot('B')),/Party has offline members/);
assert.match(compileCommunityAction('party',bot('A'),bot('B')),/AzerothAIQueueParty/);
assert.match(compileCommunityAction('leave',bot('A')),/Party has offline members/);
});
test('recent danger encourages shy companions without overriding hostility or human control',()=>{