π 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(ruflo-console): icon row fits beside header art; boot scan names; palette sorts unrunnable last; smoke contract names the update GET; controller under 500 lines
ruvcc912873cd8a
diff --git a/plugins/ruflo-console/hooks/controller.ts b/plugins/ruflo-console/hooks/controller.tsindex 7cd644025f..9b9b3c3cc8 100644--- a/plugins/ruflo-console/hooks/controller.ts+++ b/plugins/ruflo-console/hooks/controller.ts@@ -20,6 +20,7 @@ import { loadAllowed } from './remember'import { loadAiPrefs } from './settings'import { openLoaders } from './view-open'import { listSkills } from './skills'+import { readDrillLogs } from './drill-logs'import { entryAge } from './menu-entry'import { BOOT_MIN_MS, CLI_PREFIXES, isBooting, NAV_KEY, NAV_STYLES, PANE_ID, push, rowsOf, storeKeyOf, type State } from './state'import type { Actions } from './views/common'@@ -252,11 +253,10 @@ export function createController(state: State, host: Host): Controller {state.timers.delete(name)}- /** One frame of every picture of the view in front, each blitted only at the size it was mounted. */- // Whether the last frame drew the boot screen: when it ends the whole pane redraws once, and an unfocused pane's- // loop stops again (the boot screen animates whether or not the pane holds the keys).+ // Whether the last frame drew the boot screen: when it ends the whole pane redraws once, and an unfocused pane's loop stops again.let wasBooting = false+ /** One frame of every picture of the view in front, each blitted only at the size it was mounted. */function frame(): void {const started = Date.now()const booting = isBooting(state, started)@@ -287,15 +287,10 @@ export function createController(state: State, host: Host): Controller {/** Runs the frame loop while the pane is shown and holds the keys (or plays the boot screen), at `fps`; stops it otherwise. */function animate(): void {- // Something in progress moves its spinner, pictured or not: a lab action in flight (on any page), or, on the Missions page, a- // mission, a task or a guidance run that is live.+ // Something in progress moves its spinner, pictured or not: a lab action in flight, or a live mission, task or guidance run on the Missions page.const moving = state.lab.running !== null || (state.view === 'missions' && hasLiveWork(state.snapshot?.missions?.missions ?? [], mcOf(state).guidance?.status === 'running'))- if (!(state.options.fps > 0 && isVisible() && (state.pane.isFocused || isBooting(state, Date.now())) && (state.mounted.size > 0 || moving))) {- cancel('frames')-- return- }+ if (!(state.options.fps > 0 && isVisible() && (state.pane.isFocused || isBooting(state, Date.now())) && (state.mounted.size > 0 || moving))) return cancel('frames')every('frames', Math.round(1000 / state.options.fps), frame)}@@ -459,15 +454,7 @@ export function createController(state: State, host: Host): Controller {const spec = agent === undefined ? null : agentLogs(agent)- if (spec !== null) {- void host- .run([...CLI_PREFIXES[state.options.cli], ...spec.args], 30_000)- .then(result => {- if (state.drill.agentId === agentId) state.drill = { agentId, logs: result.stdout.split('\n').map(line => plain(line, 160)).filter(Boolean).slice(-12), logsAtMs: Date.now() }- })- .catch(() => undefined)- .finally(() => host.invalidate())- }+ if (spec !== null) readDrillLogs(state, host, agentId, spec.args)}const runner = createRunner(state, host, {diff --git a/plugins/ruflo-console/hooks/drill-logs.ts b/plugins/ruflo-console/hooks/drill-logs.tsnew file mode 100644index 0000000000..35eb3119bf--- /dev/null+++ b/plugins/ruflo-console/hooks/drill-logs.ts@@ -0,0 +1,14 @@+import { plain } from './data/parse'+import type { Host } from './host'+import { CLI_PREFIXES, type State } from './state'++/** Reads an agent's last log lines for the drill-down (through the ruflo CLI, 30 s at most) and redraws when they arrive; a stale answer for another agent is dropped. */+export function readDrillLogs(state: State, host: Host, agentId: string, args: readonly string[]): void {+ void host+ .run([...CLI_PREFIXES[state.options.cli], ...args], 30_000)+ .then(result => {+ if (state.drill.agentId === agentId) state.drill = { agentId, logs: result.stdout.split('\n').map(line => plain(line, 160)).filter(Boolean).slice(-12), logsAtMs: Date.now() }+ })+ .catch(() => undefined)+ .finally(() => host.invalidate())+}diff --git a/plugins/ruflo-console/hooks/gfx/boot-cyber.ts b/plugins/ruflo-console/hooks/gfx/boot-cyber.tsindex d347f332e4..188fc95df0 100644--- a/plugins/ruflo-console/hooks/gfx/boot-cyber.ts+++ b/plugins/ruflo-console/hooks/gfx/boot-cyber.ts@@ -25,6 +25,11 @@ const EDGE_MS = 350export const EGG_FROM_MS = 2400export const EGG_TO_MS = 3800+/** The scan grid's names, shortened where the full one would not fit its cell (the checks are still keyed by the full name). */+export const SCAN_NAMES: Readonly<Record<string, string>> = { MetaHarness: 'Harness', 'Self-Evolution': 'Evolution', 'Plugins & Mods': 'Plugins', 'Plugin Catalog': 'Catalog', 'Cost & Budget': 'Cost', Performance: 'Perf', 'AI Terminal': 'Terminal' }+/** How many characters of a name its cell holds. */+export const SCAN_NAME_CELLS = 10+const CONST_ROWS = 7const CELL = 18/** Rows the full layout needs under the sign's own rows: title, constellation, signal row, a scan grid, READY. */@@ -190,7 +195,7 @@ export function drawCyber(grid: Grid, facts: BootFacts, modules: readonly { nameconst bad = isOn && failed.includes(entry)grid.text(x, row, bad ? '[FAIL]' : isOn ? '[ OK ]' : '[ .. ]', bad ? PINK : isOn ? GREEN : CYAN)- grid.text(x + 7, row, entry.name.slice(0, CELL - 8), bad ? PINK : isOn ? WHITE : CYAN)+ grid.text(x + 7, row, (SCAN_NAMES[entry.name] ?? entry.name).slice(0, SCAN_NAME_CELLS), bad ? PINK : isOn ? WHITE : CYAN)})y += scanRowsdiff --git a/plugins/ruflo-console/hooks/help-topics-more.ts b/plugins/ruflo-console/hooks/help-topics-more.tsindex 19ee9adfeb..1bc9813206 100644--- a/plugins/ruflo-console/hooks/help-topics-more.ts+++ b/plugins/ruflo-console/hooks/help-topics-more.ts@@ -29,7 +29,7 @@ export const MORE_TOPICS: readonly HelpTopic[] = [{ text: 'Inspect which models were used and what they cost.', go: { run: 'cost-model-stats' } },{ text: 'The main menu and the band above the prompt show the running total.' },],- tips: ['Reads and local work cost nothing. The tag on each button says what it may cost: $0, cpu, net, $.', 'More agents are not automatically cheaper: parallel work saves waiting but can use more tokens. Judge cost per accepted result.', 'A good start: one coordinator, a few really independent tasks, a fixed budget and a finish line.'],+ tips: ['Reads and local work cost nothing. The tag on each button says what it may cost: $0, cpu, net, $$.', 'More agents are not automatically cheaper: parallel work saves waiting but can use more tokens. Judge cost per accepted result.', 'A good start: one coordinator, a few really independent tasks, a fixed budget and a finish line.'],related: ['settings', 'terminal'],keywords: ['spend', 'money', 'budget', 'price', 'tokens', 'limit', 'expensive'],},diff --git a/plugins/ruflo-console/hooks/icon-layout.ts b/plugins/ruflo-console/hooks/icon-layout.tsnew file mode 100644index 0000000000..5eacd68596--- /dev/null+++ b/plugins/ruflo-console/hooks/icon-layout.ts@@ -0,0 +1,46 @@+/**+ * Where the icon row fits, pure: the row sits at the right of the pane's first line, beside the page's header art (the title art on a page,+ * the logo banner on the menu), and must never run under it. The row spells a word beside each glyph only when the pane is wide and the art+ * leaves room for the whole row; otherwise it is a glyph and a cell each. Tested in tests/pane-icons.spec.ts.+ */+export const ICON_WORDS_FROM = 110++/**+ * The icons, in order: id, glyph, word. Each glyph is one cell wide and none is an emoji or has an emoji form: a glyph that is also an emoji (β, βΉ) can be+ * drawn two cells wide when a terminal switches to its emoji font for it, as it can when the glyph is bold (how the page you are on is drawn), and the row+ * then jumps when that page is selected. A plain ? draws visibly larger than the small symbols beside it, so help is Κ (a small question-mark shape).+ * Settings is β, a gear with no emoji form; refresh is β³, a little larger than β», and last, beside the close mark.+ */+export const ICONS = [+ { id: 'menu', glyph: 'β', word: 'menu' },+ { id: 'palette', glyph: 'β', word: 'palette' },+ { id: 'help', glyph: 'Κ', word: 'help' },+ { id: 'settings', glyph: 'β', word: 'settings' },+ { id: 'refresh', glyph: 'β³', word: 'refresh' },+] as const++/** Cells after the last icon, so the row does not touch the host's β at the edge. */+export const ICON_MARGIN = 2++/** The row's width in cells: glyph and a cell each, or glyph, word and a cell each; then the margin. */+export const iconCells = (withWords: boolean): number => ICONS.reduce((sum, icon) => sum + (withWords ? icon.glyph.length + 1 + icon.word.length + 1 : icon.glyph.length + 1), 0) + ICON_MARGIN++/** Whether each icon spells its word, given the pane's width and how many cells the header art uses of the first line. */+export const iconsSpellWords = (columns: number, headerCells: number): boolean => columns >= ICON_WORDS_FROM && headerCells + iconCells(true) <= columns++/** How many columns of a cell grid hold anything: the right edge of what is drawn. `glyphs` is the grid's first cell of each three (glyph, fg, bg). */+export function usedColumns(cells: Uint32Array, columns: number, rows: number): number {+ let used = 0++ for (let y = 0; y < rows; y++) {+ for (let x = columns - 1; x >= used; x--) {+ if ((cells[(y * columns + x) * 3] as number) !== 0x20) {+ used = x + 1++ break+ }+ }+ }++ return used+}diff --git a/plugins/ruflo-console/hooks/palette.ts b/plugins/ruflo-console/hooks/palette.tsindex bd80dba1a3..33149d2cf0 100644--- a/plugins/ruflo-console/hooks/palette.ts+++ b/plugins/ruflo-console/hooks/palette.ts@@ -211,9 +211,13 @@ export function filterPalette(entries: readonly PaletteEntry[], query: string, creturn score === null ? [] : [{ entry, score }]})- .sort((a, b) => b.score - a.score)+ // What can run comes first, so the best match, which Enter runs, is something that runs; each half keeps its own order.+ .sort((a, b) => Number(isUnavailable(a.entry)) - Number(isUnavailable(b.entry)) || b.score - a.score).map(match => match.entry)}+/** An entry that cannot run now (its spec is null: a mod that is not seated, a missing selection). */+export const isUnavailable = (entry: PaletteEntry): boolean => entry.run.kind === 'spec' && entry.run.spec === null+/** The argument a text entry takes from the query: everything after its keyword. */export const textOfQuery = (query: string, keyword: string): string => query.trim().slice(keyword.length).trim()diff --git a/plugins/ruflo-console/hooks/views/frames.ts b/plugins/ruflo-console/hooks/views/frames.tsindex 602d2d816a..5c6c78d386 100644--- a/plugins/ruflo-console/hooks/views/frames.ts+++ b/plugins/ruflo-console/hooks/views/frames.ts@@ -21,6 +21,7 @@ import { activityPicture, bannerPicture, bootPicture, titlePicture, curvePictureimport type { Grid } from '../gfx/raster'import { PROBES, severityOf } from '../data/cli'import { EXPECTED_IN_MARKET, RUFLO_MARKET } from '../data/snapshot'+import { iconCells, usedColumns } from '../icon-layout'import { entryAge } from '../menu-entry'import { BOOT_MIN_MS, isBooting, isCompactPane, VIEWS, type State } from '../state'import { CARD_COLUMNS, hasCards } from './card'@@ -122,6 +123,17 @@ export function lanesOf(state: State, nowMs: number): Lane[] {/** When the score on screen was first drawn: the radar grows from there. Module-held, reset by a new value. */const scoreShown = new WeakMap<object, number>()+/**+ * A header picture sized to what it uses, and never wider than the pane leaves beside the icon row: the Raster draws its whole grid, so a grid padded+ * to 120 cells would sit under the icons. Built at the widest allowed size, then again at the width it really used.+ */+function fitHeader(paneColumns: number, build: (columns: number) => Grid, max: number): Grid {+ const wide = build(Math.max(8, Math.min(max, paneColumns - iconCells(false) - 1)))+ const used = usedColumns(wide.cells, wide.columns, wide.rows)++ return used > 0 && used < wide.columns ? build(used) : wide+}+export function picturesOf(state: State, columns: number, nowMs: number, t: number): Map<string, Grid> {const pictures = new Map<string, Grid>()// A page in cards (views/card.ts) is narrower by the border and padding: its pictures are drawn to that width, by the render and by the frame loop alike.@@ -142,7 +154,7 @@ export function picturesOf(state: State, columns: number, nowMs: number, t: numbif (state.view === 'menu') {const project = state.cwd.split('/').filter(Boolean).at(-1) ?? ''- pictures.set('header', state.options.look === 'bbs' ? bannerPicture(project, Math.min(width, 72), t, headerAge) : headerPicture(`β ruflo v${CONSOLE_VERSION}${getBuild() === '' ? '' : ` Β· ${getBuild()}`} Β· ${project}`, Math.min(width, 64), t))+ pictures.set('header', state.options.look === 'bbs' ? fitHeader(columns, size => bannerPicture(project, size, t, headerAge), 72) : headerPicture(`β ruflo v${CONSOLE_VERSION}${getBuild() === '' ? '' : ` Β· ${getBuild()}`} Β· ${project}`, Math.min(width, 64), t))// The palette strip above the menu's groups moves while the frame loop runs; with fps 0 it is the still strip (the light is off it).if (state.options.look === 'bbs') pictures.set('palette', palettePicture(Math.max(8, width - 2), state.options.fps > 0 ? t : 0, PALETTE.map(rgb)))}@@ -153,7 +165,7 @@ export function picturesOf(state: State, columns: number, nowMs: number, t: numb// The menu is the RUFLO board itself; every other page reads `RUFLO | PAGE`, the logo's style left of the page's name.const name = state.view === 'menu' && !state.isHelp && !state.palette.isOpen ? 'ruflo bbs' : `ruflo | ${page}`- pictures.set('title', titlePicture(name, Math.min(width, 120), t, headerAge))+ pictures.set('title', fitHeader(columns, size => titlePicture(name, size, t, headerAge), 120))}switch (state.view) {diff --git a/plugins/ruflo-console/hooks/views/palette.ts b/plugins/ruflo-console/hooks/views/palette.tsindex 22e4291703..8c5c99a9cd 100644--- a/plugins/ruflo-console/hooks/views/palette.ts+++ b/plugins/ruflo-console/hooks/views/palette.ts@@ -1,6 +1,6 @@import type { RenderElement } from 'claude-code'-import { filterPalette, paletteEntries, type PaletteEntry } from '../palette'+import { filterPalette, isUnavailable, paletteEntries, type PaletteEntry } from '../palette'import { button, clip, col, row, rule, tagChip, text, THEME, type Ctx } from './common'export const PALETTE_ROWS = 12@@ -19,7 +19,7 @@ export function entryTag(entry: PaletteEntry): { text: string; color: string } {case 'text':return { text: 'text ', color: THEME.warn }case 'spec':- return run.spec === null ? { text: ' n/a ', color: THEME.bad } : run.spec.isReadOnly === true ? { text: ' $0 ', color: THEME.ok } : { text: 'ask ', color: THEME.warn }+ return isUnavailable(entry) || run.spec === null ? { text: ' n/a ', color: THEME.bad } : run.spec.isReadOnly === true ? { text: ' $0 ', color: THEME.ok } : { text: 'ask ', color: THEME.warn }}}diff --git a/plugins/ruflo-console/hooks/views/pane.ts b/plugins/ruflo-console/hooks/views/pane.tsindex 0e46a69dce..3862beac6d 100644--- a/plugins/ruflo-console/hooks/views/pane.ts+++ b/plugins/ruflo-console/hooks/views/pane.ts@@ -37,6 +37,7 @@ import { labResult } from './mh-lab'import { neuralResult, neuralView } from './neural'import { missionControlView } from './mission-control'import { overviewView } from './overview'+import { ICON_MARGIN, ICONS, iconsSpellWords } from '../icon-layout'import { helpView } from './help'import { paletteView } from './palette'import { perfResult, perfView } from './perf'@@ -291,43 +292,37 @@ const RESULT_OF: Partial<Record<ViewId, (ctx: Ctx) => RenderElement[]>> = {learning: neuralResult,}-/** How many cells of space follow the last icon, so the row does not touch the host's β at the edge. */-const ICON_MARGIN = 2-/**- * The icons' glyphs: one cell each, and none an emoji or with an emoji form. A glyph that is also an emoji (β, βΉ) can be drawn two cells wide when a terminal- * switches to its emoji font for it, as it can when the glyph is bold, which is how the page you are on is drawn: the row then jumps when that page is- * selected. A plain ? is also visibly larger than the small symbols beside it. So: β the main menu, β the palette, Κ help (a small question-mark shape: a plain ? is too large, β was not obvious), β settings (a gear with no emoji form),- * β³ refresh last (it draws a little larger than β», as asked). A bare glyph is not always obvious (help most of all), so from WORDS_FROM columns each icon also says its word.+ * The icons on one line, at the right of the first row, beside the host's β: the main menu, the palette, help, settings and refresh (hooks/icon-layout.ts+ * says which glyphs and why). Each says its word as well when the pane is wide and the header art beside it leaves room for the whole row; otherwise it+ * is a glyph and a cell. The one for the page you are on is lit: coloured text of exactly the width of a button (a plain Button draws exactly its label).*/-const ICON_GLYPHS = { menu: 'β', palette: 'β', refresh: 'β³', help: 'Κ', settings: 'β' } as const--/** The pane width from which each icon spells its word beside its glyph. */-export const ICON_WORDS_FROM = 110--/** The icons on one line, at the right of the first row, beside the host's β: the main menu, the palette, refresh, help and settings. The one for the page you are on is lit: coloured text, the same width as a button. */export function iconRow(ctx: Ctx): RenderElement {const { state } = ctx- const withWords = ctx.columns >= ICON_WORDS_FROM- // A plain Button draws exactly its label, so the page you are on is coloured text of exactly the same width: nothing moves when it changes.- const icon = (key: string, glyph: string, word: string, isCurrent: boolean, press: () => void): RenderElement => {- const label = withWords ? `${glyph} ${word} ` : `${glyph} `-- return isCurrent- ? ctx.kit.Box({ key, children: [ctx.kit.Text({ bold: true, color: THEME.head, children: label })] })- : ctx.kit.Button({ key, label, plain: true, dimColor: true, onPress: press })+ const header = ctx.pictures.get(state.view === 'menu' ? 'header' : 'title')+ const withWords = iconsSpellWords(ctx.columns, header?.columns ?? 0)+ const press: Record<(typeof ICONS)[number]['id'], { isCurrent: boolean; run: () => void }> = {+ menu: { isCurrent: state.view === 'menu' && !state.isHelp && !state.palette.isOpen, run: () => ctx.act.view('menu') },+ palette: { isCurrent: state.palette.isOpen, run: () => ctx.act.palette('all') },+ help: { isCurrent: state.isHelp, run: ctx.act.help },+ settings: { isCurrent: state.view === 'settings' && !state.isHelp && !state.palette.isOpen, run: () => ctx.act.view('settings') },+ // Refresh re-reads everything and replays the intro, as the footer's Refresh and the r key do; it is an action, never the page you are on.+ refresh: { isCurrent: false, run: ctx.act.restart },}return ctx.kit.Box({flexDirection: 'row',key: 'pane-icons',children: [- icon('pane-icon-menu', ICON_GLYPHS.menu, 'menu', state.view === 'menu' && !state.isHelp && !state.palette.isOpen, () => ctx.act.view('menu')),- icon('pane-icon-palette', ICON_GLYPHS.palette, 'palette', state.palette.isOpen, () => ctx.act.palette('all')),- icon('pane-icon-help', ICON_GLYPHS.help, 'help', state.isHelp, ctx.act.help),- icon('pane-icon-settings', ICON_GLYPHS.settings, 'settings', state.view === 'settings' && !state.isHelp && !state.palette.isOpen, () => ctx.act.view('settings')),- // Last, beside the close mark: refresh re-reads everything and replays the intro, as the footer's Refresh and the r key do; it is an action, never the page you are on.- icon('pane-icon-refresh', ICON_GLYPHS.refresh, 'refresh', false, ctx.act.restart),+ ...ICONS.map(icon => {+ const key = `pane-icon-${icon.id}`+ const label = withWords ? `${icon.glyph} ${icon.word} ` : `${icon.glyph} `+ const entry = press[icon.id]++ return entry.isCurrent+ ? ctx.kit.Box({ key, children: [ctx.kit.Text({ bold: true, color: THEME.head, children: label })] })+ : ctx.kit.Button({ key, label, plain: true, dimColor: true, onPress: entry.run })+ }),ctx.kit.Text({ children: ' '.repeat(ICON_MARGIN) }),],})diff --git a/plugins/ruflo-console/scripts/smoke.sh b/plugins/ruflo-console/scripts/smoke.shindex ff5cc3b75c..a69218601e 100755--- a/plugins/ruflo-console/scripts/smoke.sh+++ b/plugins/ruflo-console/scripts/smoke.sh@@ -27,11 +27,15 @@ step "4. no import reaches outside the plugin folder"deep=$(grep -rnE "from ['\"](\.\./){3,}" "$HOOKS" || true)[[ -z "$deep" ]] && ok || bad "$deep"-step "5. no network call from the module (\$.http) and \$ is touched in register.ts only"-http=$(grep -rnE '\$\.http\.' "$HOOKS" || true)+step "5. the module's one network call is the update check's GET (\$.http in register.ts fetchText, used by update-flow.ts alone), and \$ is touched in register.ts only"# Code lines only: comments may name the calls they explain.+http=$(grep -rnE '\$\.http\.' "$HOOKS" | grep -vE '^[^:]+:[0-9]+:\s*(\*|//|/\*)' || true)+# Exactly one is allowed (ADR-429): it goes through the engine, so an administrator's policy can refuse it, and nothing but update-flow.ts calls fetchText.+extra=$(printf '%s\n' "$http" | grep . | grep -vE '/register\.ts:[0-9]+: *const response = await \$\.http\.fetch\(url\)$' || true)+count=$(printf '%s\n' "$http" | grep -c . || true)+users=$(grep -rlE '\bfetchText\b' "$HOOKS" | grep -vE '/(host|register|update-flow)\.ts$' || true)outside=$(grep -rnE '\$\.(fs|process|ui|clock|store|env|ruflo|tool|session|settings|command)\.' "$HOOKS" | grep -vE '^[^:]+:[0-9]+:\s*(\*|//|/\*)' | grep -v '/register.ts:' || true)-[[ -z "$http" && -z "$outside" ]] && ok || bad "http: $http outside: $outside"+[[ -z "$extra" && "$count" == "1" && -z "$users" && -z "$outside" ]] && ok || bad "http: $http fetchText used by: $users outside: $outside"step "6. never runs plugins list or verify (network); roster, registry, claims and sync are the network probes, all behind the federationNetwork option"cmds=$(grep -nE "args: \['(plugins|verify)'" "$HOOKS/data/cli.ts" || true)diff --git a/plugins/ruflo-console/tests/boot-cyber.spec.ts b/plugins/ruflo-console/tests/boot-cyber.spec.tsindex c05b0ea228..659453f9e7 100644--- a/plugins/ruflo-console/tests/boot-cyber.spec.ts+++ b/plugins/ruflo-console/tests/boot-cyber.spec.ts@@ -8,7 +8,7 @@ import { describe, expect, it } from 'vitest'import { bootFacts } from '../hooks/boot-facts'import { bootPicture, BOOT_MODULES, BOOT_ROWS } from '../hooks/gfx/boot'import { NEON_ROWS } from '../hooks/gfx/neon'-import { eggText, scramble, EGG_FROM_MS } from '../hooks/gfx/boot-cyber'+import { eggText, scramble, EGG_FROM_MS, SCAN_NAMES, SCAN_NAME_CELLS } from '../hooks/gfx/boot-cyber'import { newState, type State } from '../hooks/state'const textOf = (grid: ReturnType<typeof bootPicture>): string => {@@ -209,3 +209,13 @@ describe('the border round the boot animation', () => {expect(lit(400 + 450)).toBeLessThan(lit(4_000))})})++describe('the boot scan grid\'s names', () => {+ it('all fit their cell whole: none is clipped mid-word', () => {+ for (const entry of BOOT_MODULES) {+ const shown = SCAN_NAMES[entry.name] ?? entry.name++ expect(shown.length, entry.name).toBeLessThanOrEqual(SCAN_NAME_CELLS)+ }+ })+})diff --git a/plugins/ruflo-console/tests/help-docs.spec.ts b/plugins/ruflo-console/tests/help-docs.spec.tsindex 3715c23226..21464161fa 100644--- a/plugins/ruflo-console/tests/help-docs.spec.ts+++ b/plugins/ruflo-console/tests/help-docs.spec.ts@@ -252,3 +252,12 @@ describe('the Help page', () => {expect(wrap('a bb ccc dddd', 6)).toEqual(['a bb', 'ccc', 'dddd'])})})++describe('the guides\' text', () => {+ it('keeps the cost tags as written: $0, cpu, net, $$ (a string replace once collapsed $$ to $)', () => {+ const all = TOPICS.flatMap(topic => [topic.summary, ...topic.steps.map(step => step.text), ...(topic.tips ?? [])]).join('\n')++ expect(all).toContain('$0, cpu, net, $$.')+ expect(all).toContain('$$ may spend')+ })+})diff --git a/plugins/ruflo-console/tests/palette-view.spec.ts b/plugins/ruflo-console/tests/palette-view.spec.tsindex 9113ec11e4..c17bd30e2f 100644--- a/plugins/ruflo-console/tests/palette-view.spec.ts+++ b/plugins/ruflo-console/tests/palette-view.spec.ts@@ -6,7 +6,7 @@*/import { describe, expect, it } from 'vitest'-import { filterPalette, paletteEntries } from '../hooks/palette'+import { filterPalette, isUnavailable, paletteEntries } from '../hooks/palette'import { newState, type State } from '../hooks/state'import type { Ctx } from '../hooks/views/common'import { entryTag, paletteView, PALETTE_ROWS } from '../hooks/views/palette'@@ -107,3 +107,22 @@ describe('the palette page', () => {expect(flat(tree).some(node => String(node.props.key).startsWith('pal-kw-'))).toBe(false)})})++describe('what cannot run sorts last', () => {+ it('puts the entries that cannot run now after those that can, so the best match is one Enter runs', () => {+ const state = newState({})+ const all = paletteEntries(state, Date.now())++ for (const query of ['', 'budget', 'set', 'a']) {+ const matches = filterPalette(all, query, 'all')+ const firstNa = matches.findIndex(isUnavailable)+ const lastRunnable = matches.map(isUnavailable).lastIndexOf(false)++ if (firstNa >= 0) expect(lastRunnable, `query "${query}"`).toBeLessThan(firstNa)+ expect(isUnavailable(matches[0] as never), `query "${query}": the best match`).toBe(false)+ }++ // And there are entries that cannot run in this state, so the rule is exercised.+ expect(all.some(isUnavailable)).toBe(true)+ })+})diff --git a/plugins/ruflo-console/tests/pane-icons.spec.ts b/plugins/ruflo-console/tests/pane-icons.spec.tsindex 4ddde69fc8..12baf79cae 100644--- a/plugins/ruflo-console/tests/pane-icons.spec.ts+++ b/plugins/ruflo-console/tests/pane-icons.spec.ts@@ -153,3 +153,72 @@ describe('the icon row', () => {expect(key(draw('swarm', 36, 0), 'pane-icons')).toBeUndefined()})})++describe('the icon row never runs under the header art', () => {+ it('spells words only when the pane is wide and the art leaves room for the whole row', async () => {+ const { iconCells, iconsSpellWords, ICON_WORDS_FROM } = await import('../hooks/icon-layout')++ expect(iconCells(true)).toBe(47)+ expect(iconCells(false)).toBe(12)+ expect(iconsSpellWords(ICON_WORDS_FROM - 1, 0)).toBe(false)+ expect(iconsSpellWords(ICON_WORDS_FROM, 0)).toBe(true)+ expect(iconsSpellWords(126, 126 - 47)).toBe(true)+ expect(iconsSpellWords(126, 126 - 46)).toBe(false)+ })++ it('draws every page\'s header art narrower than the pane by at least the glyph row, at every width from 40 to 220', async () => {+ const { picturesOf } = await import('../hooks/views/frames')+ const { iconCells } = await import('../hooks/icon-layout')+ const { VIEWS } = await import('../hooks/state')+ const problems: string[] = []++ for (const view of VIEWS) {+ for (let columns = 40; columns <= 220; columns += 7) {+ const state = newState({})++ state.options.look = 'bbs'+ state.options.boot = false+ state.view = view.id+ state.pane.columns = columns+ state.snapshot = null++ const pictures = picturesOf(state, columns, Date.now(), 0)+ const art = pictures.get(view.id === 'menu' ? 'header' : 'title')++ if (art !== undefined && art.columns + iconCells(false) > columns) problems.push(`${view.id} at ${columns}: art ${art.columns} + icons ${iconCells(false)} > ${columns}`)+ }+ }++ expect(problems).toEqual([])+ })++ it('with the real header art: words on the menu banner at 126 columns, glyphs only under a wide page title, and the art plus the row always fit', async () => {+ const { picturesOf } = await import('../hooks/views/frames')+ const { iconCells } = await import('../hooks/icon-layout')+ const render = (view: ViewId, columns: number): { tree: El; art: number } => {+ const state = newState({})++ state.options.look = 'bbs'+ state.options.boot = false+ state.view = view+ state.pane.placement = 'dock'+ state.pane.columns = columns+ state.snapshot = null+ setLook('bbs')++ const pictures = picturesOf(state, columns, Date.now(), 0)+ const tree = paneView({ kit, state, nowMs: Date.now(), columns, pictures, act: recorder('') as never, cards: false } as unknown as Ctx) as unknown as El++ return { tree, art: pictures.get(view === 'menu' ? 'header' : 'title')?.columns ?? 0 }+ }+ const word = (tree: El): string => String(key(tree, 'pane-icon-help')?.props.label ?? flat(key(tree, 'pane-icon-help'))[1]?.props.children)+ const menu = render('menu', 126)+ const page = render('market', 126)++ expect(word(menu.tree)).toBe('Κ help ')+ expect(word(page.tree)).toBe('Κ ')+ // Whichever form is chosen, the art and the row fit in the pane.+ expect(menu.art + iconCells(true)).toBeLessThanOrEqual(126)+ expect(page.art + iconCells(false)).toBeLessThanOrEqual(126)+ })+})diff --git a/v3/docs/adr/ADR-430-console-menu-design.md b/v3/docs/adr/ADR-430-console-menu-design.mdindex 2b8a2675e0..dcf8b5617a 100644--- a/v3/docs/adr/ADR-430-console-menu-design.md+++ b/v3/docs/adr/ADR-430-console-menu-design.md@@ -25,3 +25,9 @@ On the main menu the nav card shows only the groups until one is picked, and a pThe β in a pane's top right is Claude Code's own close mark: a mod cannot add to it (`$.ui.open` takes an id, title, focus, rows and columns; the `Pane` component's props are read-only). So the console draws a row of five small icons on the first line of its own body, at the right beside the β, with two cells of space after the last so it does not touch the close mark, next to the page's header art and purpose line: **β** the main menu, **β** the palette, **Κ** help (the guide for the page; a small question-mark shape, since a plain `?` draws too large and β was not obvious), **β** settings, and **β³** refresh last, beside the β (the footer's Refresh: re-reads everything and replays the intro; a slightly larger glyph than β»). From 110 columns each icon also spells its word (`β menu`, `Κ help` β¦), since a bare glyph is not obvious, help least of all; narrower, a glyph and a cell.None of the glyphs is an emoji or has an emoji form (`?` drew visibly larger than the small symbols; `β` and `βΉ` are also emoji, which a terminal can draw two cells wide, notably in the bold lit state, making the row jump). The icon for the page you are on (the menu, the palette or help while open, settings) is lit: bold coloured text of exactly the width of a button (a plain Button draws exactly its label and ignores the primary style), so nothing moves when the page changes; refresh is an action and is never lit. The row is left out of a pane under 40 columns. Specs: the one-line row with its trailing space beside the header rows in four layouts; the words from 110 columns and none below; every icon does its one thing; the lit icon is the width of the button at 140 and 90 columns; no emoji glyph; refresh last; removing the wrapper or a glyph rule fails them.++## Amendment (2026 10 03, recorded from a live pane): found by watching the walkthrough++Recording the walkthrough from the real pane found what the specs could not: the page title art (a Raster drawn padded to 120 cells) ran under the icon row on wide titles, pushing out `β³ refresh` and hiding `β palette`; the boot's scan grid clipped names mid-word (`Self-Evolu`, `Plugins &`); the palette opened with four red `n/a` entries and a `βΆ` best match Enter could not run; and the Cost guide's tip had lost a `$` (`$$` collapsed to `$` by a string replace). Fixes: the header pictures are built to the width they use and never wider than the pane leaves beside the icons (`hooks/icon-layout.ts`), and the icon row spells its words only when the pane is wide and the art leaves room for the whole row; the scan grid shows short names (Harness, Evolution, Plugins, Catalog, Cost, Perf, Terminal); entries that cannot run sort after those that can, so the `βΆ` is something Enter runs; the tip is restored and a spec guards it.++The console's smoke contract (step 5) now names its one network exception: the update check's single GET (`$.http.fetch` in `register.ts`, used by `update-flow.ts` alone, ADR-429), and fails on any other. `controller.ts` is back under 500 lines (the drill-down log read moved to `drill-logs.ts`).