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): the whole boot uplink in narrow and short panes (0.26.1)

ruvdada5edd0564
diff --git a/plugins/ruflo-console/.claude-plugin/plugin.json b/plugins/ruflo-console/.claude-plugin/plugin.json
index ec2cae6bf5..51c1849d29 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.26.0",
+ "version": "0.26.1",
"author": {
"name": "ruvnet",
"url": "https://github.com/ruvnet"
diff --git a/plugins/ruflo-console/hooks/gfx/boot-cyber.ts b/plugins/ruflo-console/hooks/gfx/boot-cyber.ts
index 188fc95df0..becebfccd0 100644
--- a/plugins/ruflo-console/hooks/gfx/boot-cyber.ts
+++ b/plugins/ruflo-console/hooks/gfx/boot-cyber.ts
@@ -30,10 +30,15 @@ export const SCAN_NAMES: Readonly<Record<string, string>> = { MetaHarness: 'Harn
/** How many characters of a name its cell holds. */
export const SCAN_NAME_CELLS = 10
+/** The constellation's height: seven rows when the pane has room, five (the same nine stars, closer together) when it is shorter. */
const CONST_ROWS = 7
+const COMPACT_ROWS = 5
const CELL = 18
-/** Rows the full layout needs under the sign's own rows: title, constellation, signal row, a scan grid, READY. */
-const MIN_COLUMNS = 64
+/** The narrowest pane the uplink is drawn in: below it the plain boot log. Its text fits the width it is given (see `fit`). */
+const MIN_COLUMNS = 48
+
+/** The first of `variants` that fits `columns`, else the last cut to fit: the long form when there is room, never a sentence cut mid-word. */
+const fit = (columns: number, variants: readonly string[]): string => variants.find(text => text.length <= columns) ?? (variants.at(-1) as string).slice(0, columns)
/** A deterministic hash, 0 to 0xffffffff. */
export const hash = (n: number): number => {
@@ -58,19 +63,19 @@ export function scramble(text: string, age: number, from: number, span: number):
}
/** The ghost signal's text at `age`: three bytes of binary that decode, byte by byte, into rUv. */
-export function eggText(age: number): string {
+export function eggText(age: number, withTail = true): string {
const bytes = [...'rUv'].map(ch => ch.charCodeAt(0).toString(2).padStart(8, '0'))
const shown = Math.min(1, Math.max(0, (age - EGG_FROM_MS) / 1100))
const bits = bytes.join(' ')
const lit = Math.floor(shown * bits.length)
const done = shown >= 1
- return `${bits.slice(0, lit)}${bits.slice(lit).replace(/[01]/g, (_m, at: number) => (hash(at + Math.floor(age / 70)) % 2 === 0 ? '0' : '1'))}${done ? ' = rUv · the stars were always there' : ''}`
+ return `${bits.slice(0, lit)}${bits.slice(lit).replace(/[01]/g, (_m, at: number) => (hash(at + Math.floor(age / 70)) % 2 === 0 ? '0' : '1'))}${done ? (withTail ? ' = rUv · the stars were always there' : ' = rUv') : ''}`
}
-const cellOf = (star: Star, left: number, width: number, top: number): { x: number; y: number } => ({
+const cellOf = (star: Star, left: number, width: number, top: number, rows: number): { x: number; y: number } => ({
x: left + Math.round(star.x * Math.max(0, width - star.label.length - 3)),
- y: top + Math.round(star.y * (CONST_ROWS - 1)),
+ y: top + Math.round(star.y * (rows - 1)),
})
/** The cells of a straight line between two points, ends excluded. */
@@ -83,10 +88,10 @@ function line(a: { x: number; y: number }, b: { x: number; y: number }): { x: nu
return out
}
-function constellation(grid: Grid, facts: BootFacts, age: number, top: number, waveFrom: number): void {
+function constellation(grid: Grid, facts: BootFacts, age: number, top: number, waveFrom: number, rows: number): void {
const width = Math.min(grid.columns, 74)
const left = Math.floor((grid.columns - width) / 2)
- const place = new Map(facts.stars.map(star => [star.id, cellOf(star, left, width, top)]))
+ const place = new Map(facts.stars.map(star => [star.id, cellOf(star, left, width, top, rows)]))
const visible = (star: Star): boolean => age >= CYBER_FROM_MS + star.appearAt
const byId = new Map(facts.stars.map(star => [star.id, star]))
@@ -134,7 +139,7 @@ function constellation(grid: Grid, facts: BootFacts, age: number, top: number, w
/** The signal row: the project's real numbers two at a time, or the easter egg while it is on. */
function signal(grid: Grid, facts: BootFacts, age: number, y: number): void {
if (age >= EGG_FROM_MS && age <= EGG_TO_MS) {
- grid.text(0, y, `░ ${eggText(age)}`.slice(0, grid.columns), PINK)
+ grid.text(0, y, `░ ${eggText(age, grid.columns >= 72)}`.slice(0, grid.columns), PINK)
return
}
@@ -159,7 +164,9 @@ export function drawCyber(grid: Grid, facts: BootFacts, modules: readonly { name
const columns = grid.columns
const per = Math.max(1, Math.floor(columns / CELL))
const scanRows = Math.ceil(modules.length / per)
- const withMap = room >= 1 + CONST_ROWS + 1 + scanRows + 1
+ // The full constellation if the pane has the rows, else the compact one, else none: the title, the signal row, the scan and READY always.
+ const constRows = room >= 1 + CONST_ROWS + 1 + scanRows + 1 ? CONST_ROWS : room >= 1 + COMPACT_ROWS + 1 + scanRows + 1 ? COMPACT_ROWS : 0
+ const withMap = constRows > 0
const needed = 1 + 1 + scanRows + 1
if (columns < MIN_COLUMNS || room < needed) return false
@@ -168,14 +175,15 @@ export function drawCyber(grid: Grid, facts: BootFacts, modules: readonly { name
// Title strip: scrambles into place, with a brief pink glitch now and then.
const glitch = age > 3000 && Math.floor(age / 40) % 53 === 0
- const title = `▌ ${facts.title} ▐ ${facts.credit} · ruflo v${facts.version}${facts.build !== '' ? ` · ${facts.build}` : ''}`
+ const build = facts.build !== '' ? ` · ${facts.build}` : ''
+ const title = fit(columns, [`▌ ${facts.title} ▐ ${facts.credit} · ruflo v${facts.version}${build}`, `▌ ${facts.title} ▐ ${facts.credit} · v${facts.version}`, `▌ RUV.NET // RUVECTOR ▐ ${facts.credit} · v${facts.version}`, `▌ RUV.NET ▐ ${facts.credit} · v${facts.version}`])
grid.text(0, y, scramble(title, age, CYBER_FROM_MS - 200, 900).slice(0, columns), glitch ? PINK : CYAN)
y += 1
if (withMap) {
- constellation(grid, facts, age, y, CYBER_FROM_MS + modules.length * SCAN_MS + SCAN_MS)
- y += CONST_ROWS
+ constellation(grid, facts, age, y, CYBER_FROM_MS + modules.length * SCAN_MS + SCAN_MS, constRows)
+ y += constRows
}
signal(grid, facts, age, y)
@@ -206,9 +214,14 @@ export function drawCyber(grid: Grid, facts: BootFacts, modules: readonly { name
if (age >= scanEnd) {
const verified = modules.length - failed.length
const aligned = dark === 0 && failed.length === 0
- const text = aligned ? `ALL STARS ALIGNED · ${verified} areas verified · press a key or click` : `READY · ${verified} of ${modules.length} areas verified${failed.length > 0 ? ` · ${failed.length} failed` : ''}${dark > 0 ? ` · ${dark} star${dark === 1 ? '' : 's'} dark` : ''} · press a key or click`
-
- grid.text(0, y, `${aligned ? '[ OK ]' : failed.length > 0 ? '[FAIL]' : '[WARN]'} ${text}`.slice(0, columns), aligned ? GREEN : failed.length > 0 ? PINK : AMBER)
+ const tags = `${failed.length > 0 ? ` · ${failed.length} failed` : ''}${dark > 0 ? ` · ${dark} star${dark === 1 ? '' : 's'} dark` : ''}`
+ const mark = aligned ? '[ OK ]' : failed.length > 0 ? '[FAIL]' : '[WARN]'
+ // The long sentence when it fits, else shorter ones, never cut mid-word.
+ const text = aligned
+ ? fit(columns - 7, [`ALL STARS ALIGNED · ${verified} areas verified · press a key or click`, `ALL STARS ALIGNED · ${verified} verified · press a key`, 'ALL STARS ALIGNED'])
+ : fit(columns - 7, [`READY · ${verified} of ${modules.length} areas verified${tags} · press a key or click`, `READY · ${verified}/${modules.length} verified${tags} · press a key`, `READY · ${verified}/${modules.length}${tags}`])
+
+ grid.text(0, y, `${mark} ${text}`.slice(0, columns), aligned ? GREEN : failed.length > 0 ? PINK : AMBER)
}
return true
diff --git a/plugins/ruflo-console/hooks/version.ts b/plugins/ruflo-console/hooks/version.ts
index 486292f558..cc4e205d8c 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.26.0'
+export const CONSOLE_VERSION = '0.26.1'
diff --git a/plugins/ruflo-console/scripts/smoke.sh b/plugins/ruflo-console/scripts/smoke.sh
index a69218601e..881a054d44 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.26.0"
+step "1. plugin.json declares ruflo-console 0.26.1"
grep -q '"name": "ruflo-console"' "$ROOT/.claude-plugin/plugin.json" \
- && grep -q '"version": "0.26.0"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version"
+ && grep -q '"version": "0.26.1"' "$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/boot-cyber.spec.ts b/plugins/ruflo-console/tests/boot-cyber.spec.ts
index 659453f9e7..bba2866a2a 100644
--- a/plugins/ruflo-console/tests/boot-cyber.spec.ts
+++ b/plugins/ruflo-console/tests/boot-cyber.spec.ts
@@ -97,7 +97,7 @@ describe('the cyberpunk log', () => {
it('falls back to the plain log in a narrow or short pane', () => {
const facts = bootFacts(withPlugins([]), '1', '')
- expect(textOf(bootPicture('p', 50, 6000, 10, 10, rowsFor, allOk, facts))).toContain('[ OK ] READY 26 of 26 areas verified')
+ expect(textOf(bootPicture('p', 44, 6000, 10, 10, rowsFor, allOk, facts))).toContain('[ OK ] READY 26 of 26 areas verified')
expect(textOf(bootPicture('p', 90, 6000, 10, 10, BOOT_ROWS + 6, allOk, facts))).not.toContain('RUV.NET')
})
})
@@ -219,3 +219,44 @@ describe('the boot scan grid\'s names', () => {
}
})
})
+
+describe('the uplink in a narrow or short pane', () => {
+ const lines = (columns: number, rows: number, age = 6000, facts = bootFacts(withPlugins(['ruflo-ruvector']), '0.26.0', 'abc123')): string[] => textOf(bootPicture('p', columns, age, 10, 10, rows, allOk, facts)).split('\n')
+
+ it.each([48, 60, 72])('draws the whole uplink at %i columns: title, constellation, scan, READY, none cut mid-word', columns => {
+ const text = lines(columns, BOOT_ROWS + 30).join('\n')
+
+ expect(text).toContain('RUV.NET')
+ expect(text).toMatch(/rUv/)
+ expect(text).toMatch(/[★☆]/)
+ expect(text).toContain('[ OK ]')
+ expect(text).toMatch(/READY/)
+ expect(text).not.toMatch(/areas verifi\b|areas veri\b/)
+ for (const line of lines(columns, BOOT_ROWS + 30)) expect(line.length, line).toBeLessThanOrEqual(columns)
+ })
+
+ it('draws a compact constellation (five rows) when the pane is shorter, and none when it is shorter still', () => {
+ const scanRows = Math.ceil(BOOT_MODULES.length / 4)
+ const compact = lines(72, BOOT_ROWS + 1 + 1 + 5 + 1 + scanRows + 1).join('\n')
+ const none = lines(72, BOOT_ROWS + 1 + 1 + 1 + scanRows + 1).join('\n')
+
+ expect(compact).toMatch(/[★☆]/)
+ expect(compact).toMatch(/READY/)
+ expect(none).not.toMatch(/[★☆]/)
+ expect(none).toMatch(/READY/)
+ })
+
+ it('says ALL STARS ALIGNED whole at 60 columns when everything is lit, and keeps the easter egg short enough to fit', () => {
+ const lit = withPlugins(['ruflo-ruvector', 'ruflo-rvf', 'ruflo-ruvllm', 'rulake-stack', 'ruqu-mcp', 'rvdna-mcp', 'ruflo-agentdb'])
+
+ lit.snapshot = { ...(lit.snapshot as object), isRufloProject: true, sona: { patterns: 3 } } as never
+
+ expect(lines(60, BOOT_ROWS + 20, 6000, bootFacts(lit, '0.26.0', 'abc123')).join('\n')).toContain('ALL STARS ALIGNED')
+ expect(eggText(EGG_FROM_MS + 1400, false)).toContain('= rUv')
+ expect(eggText(EGG_FROM_MS + 1400, false)).not.toContain('the stars')
+ })
+
+ it('still falls back to the plain log under 48 columns', () => {
+ expect(lines(44, BOOT_ROWS + 20).join('\n')).not.toContain('RUV.NET')
+ })
+})
diff --git a/v3/docs/adr/ADR-432-console-cyberpunk-boot-uplink-and-restart.md b/v3/docs/adr/ADR-432-console-cyberpunk-boot-uplink-and-restart.md
index bf07dd56e4..174ac9fec5 100644
--- a/v3/docs/adr/ADR-432-console-cyberpunk-boot-uplink-and-restart.md
+++ b/v3/docs/adr/ADR-432-console-cyberpunk-boot-uplink-and-restart.md
@@ -38,3 +38,7 @@ The first two boot rows (`ATDT ruflo.local RING… RING…` and `CONNECT 11520
## 6. Amendment: a border round the whole animation area
The boot's neon sign sits inside a double-line border (`╔═╗ ║ ╚═╝`) that encloses the whole animation area, the brick wall included: it runs along the edge of the picture, with a row above the sign and a row below it (the sign moves down one row; the boot's fixed rows are two more than before). It is dim until the sign switches on, then a run of light goes round it clockwise from the top left: a white leading cell, ten cells of blue behind it, then pink. Once the run has gone all the way round, the whole border is one pink and stays so. Specs: the four corners at the picture's edges at 90, 60 and 44 columns; dim before the sign; white, blue and pink mid-strike; exactly one colour (pink) when complete and later; removing the call or the single-colour rule fails them.
+
+## 7. Amendment: the whole uplink in a narrow or short pane (0.26.1)
+
+The uplink needed 64 columns and 33 rows, so a narrow cockpit (the README's phone-sized walkthrough) fell back to the old plain log: no title strip, constellation, scan grid, easter egg or READY line. It is now drawn from 48 columns. The constellation has a compact five-row form (the same nine stars) when the pane lacks the rows for seven, and is left out only when it is shorter still (the title, signal row, scan grid and READY are always there). Every line of text picks the longest of several forms that fits the width (the title strip, the easter egg, the READY sentence), so nothing is cut mid-word. Specs: the whole uplink at 48, 60 and 72 columns with no line wider than the pane; the compact constellation in a shorter pane and none in a shorter one still; ALL STARS ALIGNED whole at 60 columns; the plain log under 48.