Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

fix(ruflo-console): hive vote asks for JSON so a refused vote reads as refused

ruv9a26876efc13
diff --git a/plugins/ruflo-console/hooks/hive.ts b/plugins/ruflo-console/hooks/hive.ts
index 5d5faf0a06..dc4115165f 100644
--- a/plugins/ruflo-console/hooks/hive.ts
+++ b/plugins/ruflo-console/hooks/hive.ts
@@ -30,7 +30,8 @@ export function hiveVote(hive: HiveInfo, proposal: Proposal, isFor: boolean): Ac
return {
label: `vote ${isFor ? 'for' : 'against'} ${proposal.type} (${id}) as worker ${voter}`,
- args: ['hive-mind', 'consensus', '--action', 'vote', '--proposal-id', id, '--vote', isFor ? 'yes' : 'no', '--voter-id', voter],
+ // JSON out: the subcommand exits 0 on a refused vote, and only its JSON carries the tool's "error" for the runner.
+ args: ['hive-mind', 'consensus', '--action', 'vote', '--proposal-id', id, '--vote', isFor ? 'yes' : 'no', '--voter-id', voter, '--format', 'json'],
expect: `${voter}'s ballot on the proposal, or the proposal decided`,
verify: snapshot => snapshot.hive?.history.some(entry => entry.id === id) === true || snapshot.hive?.pending.some(entry => entry.id === id && entry.ballots.some(ballot => ballot.voter === voter)) === true,
}
diff --git a/plugins/ruflo-console/hooks/views/hive.ts b/plugins/ruflo-console/hooks/views/hive.ts
index 219ce53ac4..1076db6249 100644
--- a/plugins/ruflo-console/hooks/views/hive.ts
+++ b/plugins/ruflo-console/hooks/views/hive.ts
@@ -80,6 +80,7 @@ function summary(ctx: Ctx, hive: HiveInfo, members: Member[]): RenderElement[] {
const required = requiredVotes(strategy ?? 'raft', nodesOf(hive))
const isRaft = strategy === 'raft'
const counts = (liveness: Liveness) => members.filter(member => member.liveness === liveness).length
+ const keys = hive.memoryKeys.filter(key => key !== 'broadcasts').length
return [
kv(
@@ -92,7 +93,7 @@ function summary(ctx: Ctx, hive: HiveInfo, members: Member[]): RenderElement[] {
kv(ctx, 'fault tolerance', tolerance === null ? `n/a — ${workers === 0 ? 'no workers' : `no bound stated for ${hive.strategy ?? 'this strategy'}`}` : `tolerates ${tolerance.faulty} faulty of ${tolerance.of} (${tolerance.rule})`),
kv(ctx, 'quorum', `${required} of ${nodesOf(hive)} votes to pass (${ruleOf(strategy ?? 'raft')})${workers === 0 ? ' · the CLI counts an empty hive as one node' : ''}`),
kv(ctx, 'workers', workers === 0 ? 'none yet — spawn one below' : `${workers} · ${counts('busy')} busy · ${counts('idle')} idle · ${counts('down') + counts('error')} down · ${members.filter(member => !member.isKnown).length} in no agent store`),
- kv(ctx, 'shared memory', `${hive.memoryKeys.length} key${hive.memoryKeys.length === 1 ? '' : 's'} · ${hive.broadcasts.length} broadcast${hive.broadcasts.length === 1 ? '' : 's'} · updated ${ago(hive.updatedAtMs, ctx.nowMs)}`),
+ kv(ctx, 'shared memory', `${keys} key${keys === 1 ? '' : 's'} · ${hive.broadcasts.length} broadcast${hive.broadcasts.length === 1 ? '' : 's'} · updated ${ago(hive.updatedAtMs, ctx.nowMs)}`),
]
}
diff --git a/plugins/ruflo-console/tests/hive.spec.ts b/plugins/ruflo-console/tests/hive.spec.ts
index ad048b84b7..1103a4c213 100644
--- a/plugins/ruflo-console/tests/hive.spec.ts
+++ b/plugins/ruflo-console/tests/hive.spec.ts
@@ -76,7 +76,7 @@ describe('hive actions', () => {
const proposal = hive.pending[0] as HiveInfo['pending'][number]
expect(nextVoter(hive, proposal)).toBe(WORKERS[1])
- expect(hiveVote(hive, proposal, false)?.args).toEqual(['hive-mind', 'consensus', '--action', 'vote', '--proposal-id', RAFT_ID, '--vote', 'no', '--voter-id', WORKERS[1]])
+ expect(hiveVote(hive, proposal, false)?.args).toEqual(['hive-mind', 'consensus', '--action', 'vote', '--proposal-id', RAFT_ID, '--vote', 'no', '--voter-id', WORKERS[1], '--format', 'json'])
expect(hiveVote({ ...hive, workers: [] }, proposal, true)).toBeNull()
})
diff --git a/plugins/ruflo-console/tests/views.test.ts b/plugins/ruflo-console/tests/views.test.ts
index 7016ef6a10..07e36af81f 100644
--- a/plugins/ruflo-console/tests/views.test.ts
+++ b/plugins/ruflo-console/tests/views.test.ts
@@ -115,7 +115,7 @@ describe('views', () => {
await pane.press({ key: 'confirm' })
expect(votes()).toHaveLength(1)
- expect(votes()[0]?.slice(4)).toEqual(['hive-mind', 'consensus', '--action', 'vote', '--proposal-id', RAFT_ID, '--vote', 'yes', '--voter-id', WORKERS[1]])
+ expect(votes()[0]?.slice(4)).toEqual(['hive-mind', 'consensus', '--action', 'vote', '--proposal-id', RAFT_ID, '--vote', 'yes', '--voter-id', WORKERS[1], '--format', 'json'])
await pane.unmount()
})