checkpoint: File edit:

🚀 Generated with [Claude Code](https://claude.com/claude-code)
📊 V3 Development Progress Checkpoint

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
This commit is contained in:
rUvandClaude Sonnet 4 committed 2026-01-05 00:30:54 +00:00
1 parent 3f36886b06
commit 12fe4da63a
1 file changed
+8 -3
@@ -463,13 +463,18 @@ export class TopologyManager extends EventEmitter implements ITopologyManager {
}
private async rebalanceHierarchical(): Promise<void> {
const queen = this.state.nodes.find(n => n.role === 'queen');
// O(1) queen lookup
let queen = this.queenNode;
if (!queen) {
// Elect a queen if missing
if (this.state.nodes.length > 0) {
this.state.nodes[0].role = 'queen';
const newQueen = this.state.nodes[0]!;
newQueen.role = 'queen';
this.addToRoleIndex(newQueen);
queen = newQueen;
} else {
return;
}
return;
}
// Ensure all workers are connected to queen