π 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
TypeScript agentic-aiagentic-frameworkagentic-workflowagentsai-agentsai-assistantai-skillsautonomous-agentsclaudecodexdsh-pluginharnessmcp-servermulti-agentmulti-agent-systemsnpmskillsswarmswarm-intelligencetypescript
fix(console): let Claude ack Project Anatole alerts via console_run (0.49.7) (#4545)
rUv7d679ab425cf
diff --git a/plugins/ruflo-console/.claude-plugin/plugin.json b/plugins/ruflo-console/.claude-plugin/plugin.jsonindex f02d0610c6..ed7f9a797c 100644--- a/plugins/ruflo-console/.claude-plugin/plugin.json+++ b/plugins/ruflo-console/.claude-plugin/plugin.json@@ -1,7 +1,7 @@{"name": "ruflo-console","description": "ruflo's cockpit inside Claude Code and the one /ruflo command for every ruflo mod (function hooks, early access). Views: overview with health alerts, swarm topology graph, claims flow with TTL rings, federation map, plugin health matrix, learning curve and pipeline, MetaHarness radar and audit trend, memory, cost gauge, agent timeline, approvals queue, event stream, a main menu, an x.ruv.io federation board, an AI terminal (codex, claude or both in remembered sessions, streamed), Skills (npx skills), a Hive-Mind view, a MetaHarness lab, agent drill-down; a command palette for confirm-gated actions through the ruflo CLI; a band above the prompt. Reads ruflo's files and the CLI's local JSON; anything not measured reads n/a. The one network call it makes by itself is a daily read of the published plugin.json at github.com/ruvnet/ruflo to offer an update (Settings \u2192 Updates: ask, auto, or off); it installs only through Claude Code's own claude plugin update, and never a new major version without asking.",- "version": "0.49.6",+ "version": "0.49.7","author": {"name": "ruvnet","url": "https://github.com/ruvnet"diff --git a/plugins/ruflo-console/CHANGELOG.md b/plugins/ruflo-console/CHANGELOG.mdindex 8cc6e6803a..58b9c14b79 100644--- a/plugins/ruflo-console/CHANGELOG.md+++ b/plugins/ruflo-console/CHANGELOG.md@@ -2,6 +2,9 @@Newest first. One `## <version> β <date>` heading per version, then `feat:`, `fix:`, `breaking:` and `chore:` bullets (ADR-478). Built from git history; older versions: `git log -- plugins/ruflo-console`.+## 0.49.7 β 2026-10-27+- fix: Claude can clear Project Anatole alerts through the console again. `console_run anatole-ack-<id>` (and every other Anatole change or read Claude ran) failed with "command.run: called from a tool.call hook, it would wait on the turn this hook is holding", so nothing was acked and the Security page kept every alert open. The console sent `/protector` and waited for its answer inside Claude's tool call, and the host refuses a slash command while that call holds the turn (a clock tick and `immediate` do not get around it). The console now sends `/protector` without waiting and retries for about a minute while the host still reports the turn as held. Claude's reply says "Queued", not "Done", and the mod applies the ack when the turn ends. The outcome and the Result panel update when the mod answers. Acks still go through the console's confirm and Claude-control level, and the alert file is never edited directly (#4545).+## 0.49.6 β 2026-10-27- fix: Mission Control offers to create a mission for a new goal once the active mission is over. The active mission stayed active for ever, so after a mission finished (every task done in the ruflo task store) or was cancelled, a goal typed after it was planned but the NEXT STEP box showed "Create the mission and its tasks" as done, with the old mission's id and no create button, and nothing turned the new plan into a mission. Now the create step is the next step, with its β create button (AIDefence still blocks an unsafe goal), and the run step waits for the mission it will make. Pressing it asks first, as always, then makes the new mission the active one and keeps the old one in the picker and the saved ledger. Nothing is created unasked. A mission that is still going keeps its re-plan in place, a finished mission's own goal is not offered a second time, and a cancelled mission's goal can be created again. The menu's goal box says "create it as another mission" instead of "planned in place of this one" for a mission that is over.diff --git a/plugins/ruflo-console/hooks/anatole.ts b/plugins/ruflo-console/hooks/anatole.tsindex c13cf36a79..c3c0d3bd8f 100644--- a/plugins/ruflo-console/hooks/anatole.ts+++ b/plugins/ruflo-console/hooks/anatole.ts@@ -57,7 +57,36 @@ const NOT_WIRED = 'open the console first'type Make = { label: string; verb: string; note: string; expect: string; declared?: 'write' | 'delete' | 'install'; read?: boolean }-/** A spec that sends `/protector <verb>`. A read runs at once and its answer fills the Result panel; a change asks first and says its effect. */+/** The host's refusal of a slash command started while a hook the turn waits on still runs (Claude's console_run, `/ruflo run`). */+const HELD = /would wait on the turn this hook is holding/++/** How long to wait before each new try after a HELD refusal: about a minute in all, then the refusal stands. */+export const HELD_RETRY_MS: readonly number[] = [250, 500, 1000, 2000, 4000, 8000, 15000, 30000]++/**+ * Sends `/protector <verb>`, trying again while the host refuses it as HELD. The caller must not await this inside a hook: the hook that+ * holds the turn is the reason for the refusal, so it has to return first.+ */+export function sendProtector(host: Pick<Host, 'runSlash' | 'after'>, verb: string): Promise<{ text?: string } | void> {+ return new Promise((resolve, reject) => {+ const attempt = (tries: number): void => {+ host.runSlash('protector', verb).then(resolve, (error: unknown) => {+ const wait = HELD_RETRY_MS[tries]++ if (wait !== undefined && HELD.test(error instanceof Error ? error.message : String(error))) host.after(wait, () => attempt(tries + 1))+ else reject(error)+ })+ }++ attempt(0)+ })+}++/**+ * A spec that sends `/protector <verb>`. A read's answer fills the Result panel; a change asks first and says its effect. The run returns once+ * the command is sent and never waits for the mod's answer: Claude's console_run runs it inside a tool.call hook, and the host refuses a slash+ * command while that hook holds the turn. Until the answer arrives the outcome says it is queued.+ */function slashSpec(state: State, make: Make): ActionSpec | null {const host = wired.get(state)@@ -76,24 +105,28 @@ function slashSpec(state: State, make: Make): ActionSpec | null {run: async () => {if (id !== null) state.lab.running = { id, label: make.label, startedAtMs: Date.now() }+ state.outcome = { label: make.label, ok: true, queued: true, verified: 'n/a', detail: `sent /protector ${make.verb}; the mod runs it when the current turn ends${id === null ? ', and the page reads the result from its files' : ', and its answer fills the Result panel'}`, atMs: Date.now() }host.invalidate()- try {- const answer = await host.runSlash('protector', make.verb)- const text = typeof answer === 'object' && answer !== null && typeof answer.text === 'string' ? answer.text : ''- const lines = text === '' ? ['the mod returned no text: its answer is in the conversation; this page reads the files it wrote'] : textLines(text)-- if (id !== null) state.lab.result = { id, label: make.label, ok: true, exitCode: null, note: UNAUTH, lines, atMs: Date.now() }- else state.outcome = { label: make.label, ok: true, verified: 'n/a', detail: `sent /protector ${make.verb}; the page reads the result from the mod's files`, atMs: Date.now() }- } catch (error) {- const why = plain(error instanceof Error ? error.message : String(error), 160) || 'refused'-- if (id !== null) state.lab.result = { id, label: make.label, ok: false, exitCode: null, lines: [`/protector ${make.verb} did not run: ${why}`, 'is the ruflo-protector plugin loaded? /reload-plugins'], atMs: Date.now() }- else state.outcome = { label: make.label, ok: false, verified: 'n/a', detail: `/protector ${make.verb} did not run: ${why}`, atMs: Date.now() }- } finally {- state.lab.running = null- host.invalidate()- }+ void sendProtector(host, make.verb)+ .then(answer => {+ const text = typeof answer === 'object' && answer !== null && typeof answer.text === 'string' ? answer.text : ''+ const lines = text === '' ? ['the mod returned no text: its answer is in the conversation; this page reads the files it wrote'] : textLines(text)++ if (id !== null) state.lab.result = { id, label: make.label, ok: true, exitCode: null, note: UNAUTH, lines, atMs: Date.now() }++ state.outcome = { label: make.label, ok: true, verified: 'n/a', detail: id === null ? `ran /protector ${make.verb}; the page reads the result from the mod's files` : `ran /protector ${make.verb}; its answer is in the Result panel`, atMs: Date.now() }+ }, (error: unknown) => {+ const why = plain(error instanceof Error ? error.message : String(error), 160) || 'refused'++ if (id !== null) state.lab.result = { id, label: make.label, ok: false, exitCode: null, lines: [`/protector ${make.verb} did not run: ${why}`, 'is the ruflo-protector plugin loaded? /reload-plugins'], atMs: Date.now() }++ state.outcome = { label: make.label, ok: false, verified: 'n/a', detail: `/protector ${make.verb} did not run: ${why}`, atMs: Date.now() }+ })+ .finally(() => {+ if (id === null || state.lab.running?.id === id) state.lab.running = null+ host.invalidate()+ })},}}diff --git a/plugins/ruflo-console/hooks/dispatch.ts b/plugins/ruflo-console/hooks/dispatch.tsindex 023452570f..294a4f2fd6 100644--- a/plugins/ruflo-console/hooks/dispatch.ts+++ b/plugins/ruflo-console/hooks/dispatch.ts@@ -163,7 +163,7 @@ export async function dispatch(control: Controller, state: State, args: string,// A typed yes names no card: the runner refuses it while the card is too new or just replaced one (press the card's own Yes then).await control.runner.confirmUnbound(intent.card)- return { text: xruvAnswer(state, null, confirmedAtMs) ?? labAnswer(state, null, confirmedAtMs) ?? (state.outcome === null ? 'Ran.' : `${state.outcome.ok ? 'β' : 'β'} ${state.outcome.label}: ${state.outcome.detail}${state.outcome.verified === 'yes' ? ' (on disk)' : state.outcome.verified === 'no' ? ' (not on disk yet)' : ''}`) }+ return { text: xruvAnswer(state, null, confirmedAtMs) ?? labAnswer(state, null, confirmedAtMs) ?? (state.outcome === null ? 'Ran.' : `${state.outcome.queued === true ? 'β¦' : state.outcome.ok ? 'β' : 'β'} ${state.outcome.label}: ${state.outcome.detail}${state.outcome.verified === 'yes' ? ' (on disk)' : state.outcome.verified === 'no' ? ' (not on disk yet)' : ''}`) }case 'agent': {const who = intent.who.toLowerCase()const agent = state.snapshot?.agents.find(entry => entry.id.toLowerCase() === who || entry.name?.toLowerCase() === who) ?? state.snapshot?.agents.find(entry => entry.id.toLowerCase().endsWith(who))diff --git a/plugins/ruflo-console/hooks/model-tools.ts b/plugins/ruflo-console/hooks/model-tools.tsindex 4c691649ee..db3a9071aa 100644--- a/plugins/ruflo-console/hooks/model-tools.ts+++ b/plugins/ruflo-console/hooks/model-tools.ts@@ -324,7 +324,7 @@ async function settlePending(deps: ModelToolDeps, tool: string, id: string, askereturn { status: 'waiting', text: `Started: "${modelLine(pending.label, 100)}". It is still running after ${FINISH_MS / 1000} s; call console_state later to see the result.` }}- return { status: 'done', text: `${done === null ? 'Ran' : done.ok ? 'Done' : 'Failed'}: ${modelLine(pending.label, 100)}.${done === null ? '' : ` ${modelLine(done.detail, 200)}`}` }+ return { status: 'done', text: `${done === null ? 'Ran' : done.queued === true ? 'Queued' : done.ok ? 'Done' : 'Failed'}: ${modelLine(pending.label, 100)}.${done === null ? '' : ` ${modelLine(done.detail, 200)}`}` }}/**@@ -457,7 +457,7 @@ async function answer(name: string, input: Record<string, unknown>, deps: ModelT// A ruRE row's answer is the lab result's lines (not the outcome's): all of them, as the page keeps them (ADR-496).const body = rureOf(state, askedAt)?.lines ?? (done?.lines ?? []).slice(0, 12).map(line => modelLine(line, 160))- return done === null ? `Ran ${id}.` : `${done.ok ? 'Done' : 'Failed'}: ${modelLine(done.label, 100)}. ${modelLine(done.detail, 200)}${body.length > 0 ? `\n${body.join('\n')}` : ''}`+ return done === null ? `Ran ${id}.` : `${done.queued === true ? 'Queued' : done.ok ? 'Done' : 'Failed'}: ${modelLine(done.label, 100)}. ${modelLine(done.detail, 200)}${body.length > 0 ? `\n${body.join('\n')}` : ''}`} catch (error) {say(state, name, name, 'error', error instanceof Error ? error.message : 'failed')diff --git a/plugins/ruflo-console/hooks/state.ts b/plugins/ruflo-console/hooks/state.tsindex 239c650d72..13e7bc7d87 100644--- a/plugins/ruflo-console/hooks/state.ts+++ b/plugins/ruflo-console/hooks/state.ts@@ -189,7 +189,7 @@ export type TermSessions = { codex?: string; claude?: string }export const termStoreKeyOf = (cwd: string): string => `ruflo-console/term:${workspaceKeyOf(cwd)}`/** What an action did: what ran, how it exited, whether the disk shows the change, and anything it printed to show. */-export type Outcome = { label: string; ok: boolean; verified: 'yes' | 'no' | 'n/a'; detail: string; atMs: number; lines?: string[]; /** A confirm card that nobody answered within PENDING_TTL_MS and was cleared unrun (the Room shows it briefly). */ expired?: boolean }+export type Outcome = { label: string; ok: boolean; verified: 'yes' | 'no' | 'n/a'; detail: string; atMs: number; lines?: string[]; /** Sent but not answered yet (a slash command waits for the turn to end): Claude's tools say Queued, not Done. */ queued?: boolean; /** A confirm card that nobody answered within PENDING_TTL_MS and was cleared unrun (the Room shows it briefly). */ expired?: boolean }/** One module seen registering since the console loaded, as the engine's scan named it. */export type ModSeen = { name: string; provenance: string; isLoaded: boolean; reason?: string; atMs: number }diff --git a/plugins/ruflo-console/hooks/version.ts b/plugins/ruflo-console/hooks/version.tsindex 842d115b69..a30982a150 100644--- a/plugins/ruflo-console/hooks/version.ts+++ b/plugins/ruflo-console/hooks/version.ts@@ -2,4 +2,4 @@* The console's version, shown on the header so a person can tell which build is running. Kept equal to the plugin's manifest* (`.claude-plugin/plugin.json`); tests/version.spec.ts fails if the two drift.*/-export const CONSOLE_VERSION = '0.49.6'+export const CONSOLE_VERSION = '0.49.7'diff --git a/plugins/ruflo-console/scripts/smoke.sh b/plugins/ruflo-console/scripts/smoke.shindex fc4e612cfb..0b0c7322c5 100755--- a/plugins/ruflo-console/scripts/smoke.sh+++ b/plugins/ruflo-console/scripts/smoke.sh@@ -11,9 +11,9 @@ step() { printf "β %s ... " "$1"; }ok() { printf "PASS\n"; PASS=$((PASS+1)); }bad() { printf "FAIL: %s\n" "$1"; FAIL=$((FAIL+1)); }-step "1. plugin.json declares ruflo-console 0.49.6"+step "1. plugin.json declares ruflo-console 0.49.7"grep -q '"name": "ruflo-console"' "$ROOT/.claude-plugin/plugin.json" \- && grep -q '"version": "0.49.6"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version"+ && grep -q '"version": "0.49.7"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version"step "2. hooks.json names exactly one module and no classic hook commands"grep -q '"modules": \["./register.ts"\]' "$HOOKS/hooks.json" && ! grep -q '"command"' "$HOOKS/hooks.json" \diff --git a/plugins/ruflo-console/tests/anatole.spec.ts b/plugins/ruflo-console/tests/anatole.spec.tsindex 37592af31b..9a38aa4c0e 100644--- a/plugins/ruflo-console/tests/anatole.spec.ts+++ b/plugins/ruflo-console/tests/anatole.spec.ts@@ -8,7 +8,7 @@ import { describe, expect, it } from 'vitest'import { ALERTS_TAIL, parseAlertLine, parseAlerts, parseAnatoleRules, parseAnatoleStatus, readAnatole } from '../hooks/data/anatole'import { readSnapshot } from '../hooks/data/snapshot'import type { ReaderFs } from '../hooks/data/files'-import { ANATOLE_RULES, anatolePalette, INSTALL_LINE, slashOf, wireAnatole } from '../hooks/anatole'+import { ANATOLE_RULES, anatolePalette, HELD_RETRY_MS, INSTALL_LINE, sendProtector, slashOf, wireAnatole } from '../hooks/anatole'import { classOf } from '../hooks/model-tools'import { newState } from '../hooks/state'import { ruleRows } from '../hooks/views/anatole'@@ -168,7 +168,9 @@ describe('the section', () => {describe('the actions', () => {const sent: string[] = []- const host = { invalidate: () => undefined, runSlash: async (command: string, args: string) => { sent.push(`${command} ${args}`); return { text: 'one\ntwo' } } }+ const host = { invalidate: () => undefined, after: (ms: number, fn: () => void) => setTimeout(fn, 0), runSlash: async (command: string, args: string) => { sent.push(`${command} ${args}`); return { text: 'one\ntwo' } } }+ // The run returns once the command is sent; the answer lands a tick later.+ const settle = () => new Promise(resolve => setTimeout(resolve, 5))const state = newState({})wireAnatole(state, host as never)@@ -203,18 +205,58 @@ describe('the actions', () => {it('puts run and replay answers in the Result panel, and a failure there too', async () => {await specOf('anatole-run')?.run?.()+ await settle()expect(state.lab.result).toMatchObject({ id: 'anatole-run', ok: true, lines: ['one', 'two'] })const broken = newState({})- wireAnatole(broken, { invalidate: () => undefined, runSlash: async () => Promise.reject(new Error('no such command')) } as never)+ wireAnatole(broken, { invalidate: () => undefined, after: host.after, runSlash: async () => Promise.reject(new Error('no such command')) } as never)const entry = anatolePalette(broken).find(candidate => candidate.id === 'anatole-replay')await (entry?.run.kind === 'spec' ? entry.run.spec?.run?.() : undefined)+ await settle()expect(broken.lab.result).toMatchObject({ id: 'anatole-replay', ok: false })})+ it('never waits for the mod inside the run, so Claude\'s console_run (a tool.call hook) is not holding the turn when the command starts', async () => {+ const held = newState({})+ let answer: (value: { text: string }) => void = () => undefined++ wireAnatole(held, { invalidate: () => undefined, after: host.after, runSlash: () => new Promise(resolve => { answer = resolve }) } as never)++ const entry = anatolePalette(held).find(candidate => candidate.id === 'anatole-ack')++ // The mod has not answered, yet the run is over: the outcome says queued, never done.+ await (entry?.run.kind === 'text' ? entry.run.make('a1')?.run?.() : undefined)+ expect(held.outcome).toMatchObject({ ok: true, queued: true })+ expect(held.outcome?.detail).toContain('when the current turn ends')++ answer({ text: 'a1 marked as a false positive' })+ await settle()+ expect(held.outcome).toMatchObject({ ok: true, detail: expect.stringContaining('ran /protector ack a1') })+ expect(held.outcome?.queued).toBeUndefined()+ })++ it('tries again while the host refuses the command as held by a hook, and gives up on any other refusal', async () => {+ const HELD = new Error('command.run: called from a tool.call hook, it would wait on the turn this hook is holding; run it from a later event (turn.complete)')+ const waits: number[] = []+ const after = (ms: number, fn: () => void) => { waits.push(ms); setTimeout(fn, 0) }+ let tries = 0++ await expect(sendProtector({ after, runSlash: async () => { tries += 1; if (tries < 3) throw HELD; return { text: 'ok' } } } as never, 'ack a1')).resolves.toEqual({ text: 'ok' })+ expect(tries).toBe(3)+ expect(waits).toEqual(HELD_RETRY_MS.slice(0, 2))++ tries = 0+ await expect(sendProtector({ after, runSlash: async () => { tries += 1; throw new Error('no such command') } } as never, 'ack a1')).rejects.toThrow('no such command')+ expect(tries).toBe(1)++ tries = 0+ await expect(sendProtector({ after, runSlash: async () => { tries += 1; throw HELD } } as never, 'ack a1')).rejects.toThrow('holding')+ expect(tries).toBe(HELD_RETRY_MS.length + 1)+ })+it('classes them for Claude: reads at read, edits at write, enforce asks as install, reset is delete', () => {const cls = (id: string, text = '') => {const spec = specOf(id, text)