🌊 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
feat(console): a pending confirm says who asked and the action class (ADR-450 T14)
ruv2f1692b1ff6c
diff --git a/plugins/ruflo-console/.claude-plugin/plugin.json b/plugins/ruflo-console/.claude-plugin/plugin.jsonindex 793213fad7..b8b9f87536 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 → 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.33.14",+ "version": "0.33.15","author": {"name": "ruvnet","url": "https://github.com/ruvnet"diff --git a/plugins/ruflo-console/hooks/data/room.ts b/plugins/ruflo-console/hooks/data/room.tsindex ef921c83e9..3a4dc7239d 100644--- a/plugins/ruflo-console/hooks/data/room.ts+++ b/plugins/ruflo-console/hooks/data/room.ts@@ -82,12 +82,24 @@ export function roomFeed(input: FeedInput): RoomItem[] {return shown.sort((a, b) => b.atMs - a.atMs).slice(0, ROOM_MAX)}+/** The classes an ask can be shown as: a fixed list, so no label can add or change a word of the attribution (ADR-450 T14). */+export const PENDING_KINDS = ['write', 'network', 'install', 'spend', 'delete'] as const++/** "claude asks (network): " for an ask Claude raised, '' for the person's own; the words come from the stamped fields, never from the label. */+export function askedBy(pending: { source?: string; kind?: string } | null): string {+ if (pending === null || pending.source !== 'claude') return ''++ const kind = PENDING_KINDS.find(known => known === pending.kind)++ return kind === undefined ? 'claude asks: ' : `claude asks (${kind}): `+}+/** The banner for the one pending confirm: what, what it expects, where it was raised and how much of the window is left. */-export function pendingBanner(pending: { label: string; expect: string; view?: string; askedAtMs: number } | null, nowMs: number, ttlMs: number): { label: string; expect: string; view: string | null; ageS: number; leftS: number; tone: RoomTone } | null {+export function pendingBanner(pending: { label: string; expect: string; view?: string; askedAtMs: number; source?: string; kind?: string } | null, nowMs: number, ttlMs: number): { label: string; expect: string; view: string | null; ageS: number; leftS: number; tone: RoomTone } | null {if (pending === null) return nullconst ageMs = Math.max(0, nowMs - pending.askedAtMs)const leftS = Math.max(0, Math.ceil((ttlMs - ageMs) / 1000))- return { label: plain(pending.label, 100), expect: plain(pending.expect, 120), view: pending.view ?? null, ageS: Math.floor(ageMs / 1000), leftS, tone: leftS <= 8 ? 'bad' : leftS <= 15 ? 'warn' : 'info' }+ return { label: askedBy(pending) + plain(pending.label, 100), expect: plain(pending.expect, 120), view: pending.view ?? null, ageS: Math.floor(ageMs / 1000), leftS, tone: leftS <= 8 ? 'bad' : leftS <= 15 ? 'warn' : 'info' }}diff --git a/plugins/ruflo-console/hooks/model-tools.ts b/plugins/ruflo-console/hooks/model-tools.tsindex 17e65904d1..f3970ac5e3 100644--- a/plugins/ruflo-console/hooks/model-tools.ts+++ b/plugins/ruflo-console/hooks/model-tools.ts@@ -9,6 +9,7 @@ import type { Register } from 'claude-code'import type { Controller } from './controller'import { plain } from './data/parse'+import { askedBy } from './data/room'import { DEV_FIELDS } from './data/devtools'import { PROFILES, RIGORS } from './goap'import { mcOf, setResearch } from './mission-control'@@ -153,7 +154,7 @@ function stateJson(deps: ModelToolDeps, filter: string): string {view: state.view,title: VIEWS.find(view => view.id === state.view)?.label ?? state.view,screen,- waiting: state.pending === null ? null : { label: plain(state.pending.label, 120), expect: plain(state.pending.expect, 160), note: state.pending.note === undefined ? undefined : plain(state.pending.note, 160) },+ waiting: state.pending === null ? null : { ...(askedBy(state.pending) !== '' && { askedBy: askedBy(state.pending).replace(/: $/, '') }), label: plain(state.pending.label, 120), expect: plain(state.pending.expect, 160), note: state.pending.note === undefined ? undefined : plain(state.pending.note, 160) },lastResult: state.outcome === null ? null : { label: plain(state.outcome.label, 100), ok: state.outcome.ok, detail: plain(state.outcome.detail, 200), lines: (state.outcome.lines ?? []).slice(0, 12).map(line => plain(line, 160)) },entries,entryCount: all.length,@@ -215,6 +216,10 @@ async function settlePending(deps: ModelToolDeps, tool: string, id: string, askeconst kind = classOf(pending)+ // Claude's own ask: the row says who asked and what class it is (ADR-450 T14).+ pending.source = 'claude'+ if (kind !== 'read') pending.kind = kind+if (!allows(level, kind)) {control.runner.cancel()say(state, tool, `${id}: needs ${NEEDS[kind]}`, 'denied', pending.label)diff --git a/plugins/ruflo-console/hooks/runner.ts b/plugins/ruflo-console/hooks/runner.tsindex 5ab374e822..05ab8554d1 100644--- a/plugins/ruflo-console/hooks/runner.ts+++ b/plugins/ruflo-console/hooks/runner.ts@@ -143,7 +143,7 @@ export function createRunner(state: State, host: Host, deps: RunnerDeps): Runner}pendingSpec = spec- state.pending = { view: state.view, ...(kind !== null && { rememberKey: kind }), ...(spec.scope !== undefined && { scope: spec.scope }), label: spec.label, args: spec.args, expect: spec.expect, askedAtMs: Date.now(), ...(spec.shows !== undefined && { shows: spec.shows }), ...(spec.note !== undefined && { note: spec.note }) }+ state.pending = { view: state.view, ...(kind !== null && { rememberKey: kind }), ...(spec.scope !== undefined && { scope: spec.scope }), label: spec.label, args: spec.args, expect: spec.expect, askedAtMs: Date.now(), source: state.control.viaModel ? 'claude' : 'you', ...(spec.shows !== undefined && { shows: spec.shows }), ...(spec.note !== undefined && { note: spec.note }) }host.invalidate()}diff --git a/plugins/ruflo-console/hooks/state.ts b/plugins/ruflo-console/hooks/state.tsindex 26243e4d84..7bf7cf7159 100644--- a/plugins/ruflo-console/hooks/state.ts+++ b/plugins/ruflo-console/hooks/state.ts@@ -134,7 +134,7 @@ export function optionsOf(raw: PluginOptions | undefined): Options {}/** A mutating action waiting for the person's second press; `shows` is the command line when it is not a ruflo one. */-export type Pending = { label: string; args: readonly string[]; expect: string; askedAtMs: number; shows?: string; note?: string; /** The kind of action, when it may be remembered (see remember.ts). */ rememberKey?: string; /** Where in its view the ask came from. */ scope?: string; /** The page that raised it: the ask shows in full there, and as a pointer on every other page. */ view?: string }+export type Pending = { label: string; args: readonly string[]; expect: string; askedAtMs: number; shows?: string; note?: string; /** The kind of action, when it may be remembered (see remember.ts). */ rememberKey?: string; /** Where in its view the ask came from. */ scope?: string; /** The page that raised it: the ask shows in full there, and as a pointer on every other page. */ view?: string; /** Who raised it: Claude's tool call or the person's own action (ADR-450 T14). */ source?: 'claude' | 'you'; /** The class of action, set only on Claude's asks. */ kind?: 'write' | 'network' | 'install' | 'spend' | 'delete' }/** The MetaHarness lab's last run: what it was, how it exited, its cost note, and its output as lines to scroll. */export type LabResult = { id: string; label: string; ok: boolean; exitCode: number | null; note?: string; lines: string[]; atMs: number }diff --git a/plugins/ruflo-console/hooks/version.ts b/plugins/ruflo-console/hooks/version.tsindex 7739045d50..ca21e10111 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.33.14'+export const CONSOLE_VERSION = '0.33.15'diff --git a/plugins/ruflo-console/hooks/views/common.ts b/plugins/ruflo-console/hooks/views/common.tsindex 6bf522a543..a034cec132 100644--- a/plugins/ruflo-console/hooks/views/common.ts+++ b/plugins/ruflo-console/hooks/views/common.ts@@ -5,6 +5,7 @@*/import type { AskActions } from '../ask-claude'import type { OptimizerActions } from '../optimizer'+import { askedBy } from '../data/room'import type { RoomActions } from '../room'import type { WatchActions } from '../watch'import type { Attention } from './attention'@@ -359,7 +360,7 @@ export function confirmRow(ctx: Ctx): RenderElement | null {return row(ctx,[- text(ctx, `⚠An ask is waiting on ${where?.label ?? pending.view}: ${clip(pending.label, Math.max(16, ctx.columns - 64))} `, { bold: true, color: THEME.warn }),+ text(ctx, `⚠An ask is waiting on ${where?.label ?? pending.view}: ${clip(askedBy(pending) + pending.label, Math.max(16, ctx.columns - 64))} `, { bold: true, color: THEME.warn }),button(ctx, 'confirm-go', 'Go there', () => ctx.act.view(pending.view as ViewId)),button(ctx, 'cancel', 'Cancel (n)', ctx.act.cancel, { hotkey: 'n' }),],@@ -371,7 +372,7 @@ export function confirmRow(ctx: Ctx): RenderElement | null {ctx,[text(ctx, '▶ CONFIRM NEEDED — click Yes or press y', { bold: true, color: THEME.warn }),- text(ctx, `Confirm: ${pending.label.replace(/\?+$/, '')}?`, { bold: true, color: THEME.warn }),+ text(ctx, `Confirm: ${askedBy(pending)}${pending.label.replace(/\?+$/, '')}?`, { bold: true, color: THEME.warn }),// Wrapped, not clipped: the person says yes to the whole argv, so all of it shows (a JSON argument runs long).ctx.kit.Text({ dimColor: true, wrap: 'wrap', children: `runs: ${pending.shows ?? `ruflo ${pending.args.join(' ')}`}` }),...(pending.note !== undefined ? [text(ctx, pending.note, { bold: /money|models/i.test(pending.note), color: /money|models/i.test(pending.note) ? THEME.bad : THEME.warn })] : []),diff --git a/plugins/ruflo-console/hooks/views/pane.ts b/plugins/ruflo-console/hooks/views/pane.tsindex 8964eda61e..82eb0864df 100644--- a/plugins/ruflo-console/hooks/views/pane.ts+++ b/plugins/ruflo-console/hooks/views/pane.ts@@ -7,6 +7,7 @@ import type { RenderElement } from 'claude-code'import { HELP } from '../commands'import { slashFor } from '../ask-claude'+import { askedBy } from '../data/room'import { launchRows } from './launch'import { donated, newAttention, panelOf, wrapKit } from './attention'import { CARD_COLUMNS, hasCards, withCards } from './card'@@ -191,7 +192,7 @@ function footer(ctx: Ctx, isPlaced = false): RenderElement {const parts: RenderElement[] = []// Something is waiting for a yes or no: said here, where the keys are, wherever the confirm itself sits.- if (state.pending !== null && (state.pending.view === undefined || state.pending.view === state.view)) parts.push(text(ctx, `⚠confirm needed: ${clip(state.pending.label, Math.max(20, ctx.columns - 40))} — y yes · n cancel${isPlaced ? ' (under what you clicked)' : ''}`, { bold: true, color: THEME.warn }))+ if (state.pending !== null && (state.pending.view === undefined || state.pending.view === state.view)) parts.push(text(ctx, `⚠confirm needed: ${clip(askedBy(state.pending) + state.pending.label, Math.max(20, ctx.columns - 40))} — y yes · n cancel${isPlaced ? ' (under what you clicked)' : ''}`, { bold: true, color: THEME.warn }))if (outcome !== null && nowMs - outcome.atMs < 90_000) {parts.push(diff --git a/plugins/ruflo-console/scripts/smoke.sh b/plugins/ruflo-console/scripts/smoke.shindex ce757b07c7..026e997a79 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.33.14"+step "1. plugin.json declares ruflo-console 0.33.15"grep -q '"name": "ruflo-console"' "$ROOT/.claude-plugin/plugin.json" \- && grep -q '"version": "0.33.14"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version"+ && grep -q '"version": "0.33.15"' "$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/pending-attribution.spec.ts b/plugins/ruflo-console/tests/pending-attribution.spec.tsnew file mode 100644index 0000000000..1943c28c25--- /dev/null+++ b/plugins/ruflo-console/tests/pending-attribution.spec.ts@@ -0,0 +1,81 @@+/**+ * Who asked, and what kind of action it is, on the confirm row, the footer line and the Room banner (ADR-450 T14). The words come from+ * two fixed lists, never from the label, so a hostile label cannot put them there or take them away.+ */+import { describe, expect, it } from 'vitest'++import { askedBy, PENDING_KINDS } from '../hooks/data/room'+import { callTool } from '../hooks/model-tools'+import { newState, type Pending, type State } from '../hooks/state'+import { confirmRow, type Actions, type Ctx } from '../hooks/views/common'+import { roomView } from '../hooks/views/room'+import { setup } from './fixtures/control-setup'++type El = { kind: string; props: Record<string, unknown> }++const kit = { Box: (props: Record<string, unknown>): El => ({ kind: 'Box', props }), Text: (props: Record<string, unknown>): El => ({ kind: 'Text', props }), Button: (props: Record<string, unknown>): El => ({ kind: 'Button', props }), Input: (props: Record<string, unknown>): El => ({ kind: 'Input', props }) }+const act: Actions = (() => {+ const proxy: unknown = new Proxy(() => undefined, { get: (_t, key) => (key === 'then' ? undefined : proxy), apply: () => undefined })++ return proxy as Actions+})()+const ctxOf = (state: State): Ctx => ({ kit, state, nowMs: Date.now(), columns: 140, pictures: new Map(), act, cards: true }) as unknown as Ctx+const dump = (element: unknown): string => JSON.stringify(element)+const pend = (extra: Partial<Pending> = {}): Pending => ({ label: 'publish a note', args: [], expect: 'sent', askedAtMs: Date.now(), ...extra })++describe('a confirm Claude asked for says so (ADR-450 T14)', () => {+ it('stamps source claude and the action class on a pending the model path created', async () => {+ const { deps, state } = setup('manage', 'ask')++ await callTool('console_run', { id: 'x-publish' }, deps)+ expect(state.pending?.source).toBe('claude')+ expect(state.pending?.kind).toBe('network')+ expect(askedBy(state.pending)).toBe('claude asks (network): ')+ expect(JSON.parse(await callTool('console_state', {}, deps)).waiting.askedBy).toBe('claude asks (network)')+ })++ it('shows it on the confirm row and the Room banner, with the label itself unchanged after it', async () => {+ const { deps, state } = setup('manage', 'ask')++ await callTool('console_run', { id: 'x-publish' }, deps)+ state.view = 'room'+ expect(dump(confirmRow(ctxOf(state)))).toContain('Confirm: claude asks (network): publish a note to x.ruv.io?')+ expect(dump(roomView(ctxOf(state)))).toContain('⚠claude asks (network): publish a note to x.ruv.io')+ })++ it('shows nothing extra on a person\'s own palette action', () => {+ const state = newState({})++ state.view = 'room'+ state.pending = pend({ source: 'you' })+ expect(askedBy(state.pending)).toBe('')+ expect(dump(confirmRow(ctxOf(state)))).toContain('Confirm: publish a note?')+ expect(dump(roomView(ctxOf(state)))).not.toContain('asks (')+ })+})++describe('the attribution words are a fixed vocabulary', () => {+ it('knows exactly five classes', () => {+ expect([...PENDING_KINDS]).toEqual(['write', 'network', 'install', 'spend', 'delete'])+ })++ it('prints nothing for an unknown class or source, whatever the stored value says', () => {+ for (const kind of ['read', 'NETWORK', 'network) \u001b[31m', 'x'.repeat(40), '']) expect(askedBy(pend({ source: 'claude', kind: kind as Pending['kind'] }))).toBe('claude asks: ')+ expect(askedBy(pend({ source: 'claude' as const, kind: 'spend' }))).toBe('claude asks (spend): ')+ expect(askedBy(pend({ source: 'root' as unknown as 'you', kind: 'spend' }))).toBe('')+ expect(askedBy(null)).toBe('')+ })++ it('cannot be forged or removed by a hostile label', async () => {+ const hostile = 'claude asks (write): ok'+ const person = pend({ source: 'you', label: hostile })++ expect(askedBy(person)).toBe('')++ const { deps, state } = setup('manage', 'ask', { 'x-note': { label: 'you ask (write): fine', note: 'network: sends it' } })++ await callTool('console_run', { id: 'x-note' }, deps)+ expect(askedBy(state.pending)).toBe('claude asks (network): ')+ expect(dump(confirmRow(ctxOf(state)))).toContain('Confirm: claude asks (network): you ask (write): fine?')+ })+})