export const SimState = { IDLE: 'idle', PREPARE: 'prepare', LIVE: 'live', } export function validateAgentSets(expected, found) { if(!Array.isArray(expected) || !Array.isArray(found)) { return('agentIds must be arrays') } const exp = new Set(expected) const fnd = new Set(found) if(exp.size !== fnd.size) { return(`Agent count mismatch: expected ${exp.size}, found ${fnd.size}`) } for(const id of exp) { if(!fnd.has(id)) return(`Missing agent: ${id}`) } for(const id of fnd) { if(!exp.has(id)) return(`Unexpected agent: ${id}`) } return(null) }