🌊 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(ruflo-console): cyberpunk data-driven boot uplink; Refresh replays the intro (ADR-432)
ruv7c1150f32cd1
diff --git a/plugins/ruflo-console/hooks/bindings.ts b/plugins/ruflo-console/hooks/bindings.tsindex e0ed1eb7e4..70e21ddd5e 100644--- a/plugins/ruflo-console/hooks/bindings.ts+++ b/plugins/ruflo-console/hooks/bindings.ts@@ -34,6 +34,7 @@ import { openTasks, selection } from './views/select'export type Steps = {freshRead: () => Promise<void>+ animate: () => voidprobe: (force?: boolean) => Promise<void>setView: (view: State['view']) => voiddrill: (agentId: string) => void@@ -41,7 +42,7 @@ export type Steps = {}export function actionsOf(state: State, host: Host, runner: Runner, steps: Steps): Actions {- const { freshRead, probe, setView, drill, close } = steps+ const { freshRead, probe, setView, drill, close, animate } = steps/*** After a command typed in the terminal field (/ruflo, /new, /up…) the rows above the field change, and the engine@@ -119,6 +120,13 @@ export function actionsOf(state: State, host: Host, runner: Runner, steps: Stepsif (state.view === 'skills') actions.skills.list()if (state.view === 'evolve') actions.evolve.reread()},+ restart: () => {+ // The intro plays again from now (BBS look and the boot option on); the pane redraws at once, and the read starts over beneath it.+ state.pane.bootAtMs = Date.now()+ host.invalidate()+ animate()+ actions.refresh()+ },help: () => {state.isHelp = !state.isHelphost.invalidate()@@ -202,7 +210,7 @@ export function actionsOf(state: State, host: Host, runner: Runner, steps: Stepsif (word === '') returnif (word === '?' || word === 'h' || word === 'help') actions.help()else if (word === 'p') actions.palette('all')- else if (word === 'r') actions.refresh()+ else if (word === 'r') actions.restart()else if (word === 'o' || word === 'bye' || word === 'logoff') actions.close()else if (view !== null) setView(view)else runner.ask(null, `no area "${plain(word, 24)}": type a key from the menu, or ? for help`)diff --git a/plugins/ruflo-console/hooks/boot-facts.ts b/plugins/ruflo-console/hooks/boot-facts.tsnew file mode 100644index 0000000000..1b4a2fbec9--- /dev/null+++ b/plugins/ruflo-console/hooks/boot-facts.ts@@ -0,0 +1,131 @@+/**+ * What the boot screen shows of this machine, pure: the ruvector constellation (nine stars, each lit only if something real says it is+ * there) and the numbers under it. Every fact comes from what the console has already read (the CLI's version probe, the memory and+ * intelligence probes, the installed-plugin list, the neural and swarm files); nothing is spawned for the boot, and nothing is invented:+ * a star with no evidence stays dark and says so. The drawing is gfx/boot-cyber.ts. Tested in tests/boot-cyber.spec.ts.+ */+import type { ProbeResult } from './data/cli'+import type { State } from './state'++export type Star = {+ id: string+ label: string+ /** Where it sits on the map, 0 to 1 across and down. */+ x: number+ y: number+ alive: boolean+ /** What lit it, in words (a version, a count), or why it is dark. */+ detail: string+ /** Milliseconds into the log before this star may light, so they come on one after another. */+ appearAt: number+}++export type BootFacts = {+ title: string+ /** The person who made it, the version and the git build, for the title row. */+ credit: string+ version: string+ build: string+ stars: Star[]+ links: readonly (readonly [string, string])[]+ /** Real numbers to cycle through: only the ones there is data for. */+ stats: { label: string; value: string }[]+}++/** The constellation's lines: the hub, then what hangs off ruvector. */+export const LINKS: readonly (readonly [string, string])[] = [+ ['ruflo', 'ruvector'],+ ['ruflo', 'agentdb'],+ ['ruflo', 'sona'],+ ['agentdb', 'ruvector'],+ ['ruvector', 'rvf'],+ ['ruvector', 'ruvllm'],+ ['ruvector', 'rulake'],+ ['rulake', 'ruqu'],+ ['rulake', 'rvdna'],+]++/** The map: where each star sits and when it may light. The ids are the packages' own names. */+const MAP: readonly { id: string; label: string; x: number; y: number; appearAt: number }[] = [+ { id: 'ruflo', label: 'ruflo', x: 0.5, y: 1, appearAt: 0 },+ { id: 'agentdb', label: 'agentdb', x: 0.1, y: 1, appearAt: 250 },+ { id: 'sona', label: 'sona', x: 0.88, y: 1, appearAt: 500 },+ { id: 'ruvector', label: 'ruvector', x: 0.5, y: 0.6, appearAt: 750 },+ { id: 'rvf', label: 'rvf', x: 0.84, y: 0.62, appearAt: 1000 },+ { id: 'ruvllm', label: 'ruvllm', x: 0.8, y: 0.3, appearAt: 1250 },+ { id: 'rulake', label: 'rulake', x: 0.38, y: 0.3, appearAt: 1500 },+ { id: 'ruqu', label: 'ruqu', x: 0.08, y: 0, appearAt: 1750 },+ { id: 'rvdna', label: 'rvdna', x: 0.86, y: 0, appearAt: 2000 },+]++/** A probe's last good value, or null when it has none or its latest word is an error: the same test the pages use before they call a source live. */+const liveOf = <T>(result: ProbeResult | undefined): T | null => {+ if (result === undefined || result.value === null) return null+ if (result.error !== null && (result.errorAtMs ?? 0) >= (result.okAtMs ?? 0)) return null++ return result.value as T+}++type Evidence = { alive: boolean; detail: string }++export function bootFacts(state: State, version: string, build: string): BootFacts {+ const snap = state.snapshot+ const installed = snap?.plugins.installed ?? []+ const named = (name: string) => installed.find(entry => entry.name === name)+ const matching = (part: string) => installed.filter(entry => entry.name.includes(part))+ const cli = liveOf<string>(state.probes.get('version'))+ const memory = liveOf<unknown>(state.probes.get('memory'))+ const engine = liveOf<unknown>(state.probes.get('intelligence'))+ const plugin = (name: string): Evidence => {+ const found = named(name)++ return found === undefined ? { alive: false, detail: `${name} is not installed` } : { alive: true, detail: `plugin ${found.version}` }+ }+ const family = (part: string): Evidence => {+ const found = matching(part)++ return found.length === 0 ? { alive: false, detail: `no ${part} plugin installed` } : { alive: true, detail: `${found.length} plugin${found.length === 1 ? '' : 's'}` }+ }++ const evidence: Record<string, Evidence> = {+ ruflo: cli !== null ? { alive: true, detail: `cli ${cli}` } : snap?.isRufloProject === true ? { alive: true, detail: 'a ruflo project' } : { alive: false, detail: 'the CLI has not answered' },+ agentdb: memory !== null ? { alive: true, detail: 'memory answers' } : named('ruflo-agentdb') !== undefined ? plugin('ruflo-agentdb') : { alive: false, detail: 'no memory database found' },+ sona:+ snap?.sona != null+ ? { alive: true, detail: `${snap.sona.patterns} patterns` }+ : snap?.neural != null+ ? { alive: true, detail: 'neural stats on disk' }+ : engine !== null+ ? { alive: true, detail: 'the engine answers' }+ : { alive: false, detail: 'nothing learned here yet' },+ ruvector: plugin('ruflo-ruvector'),+ rvf: plugin('ruflo-rvf'),+ ruvllm: plugin('ruflo-ruvllm'),+ rulake: family('rulake'),+ ruqu: family('ruqu'),+ rvdna: family('rvdna'),+ }++ const stats: { label: string; value: string }[] = []+ const add = (label: string, value: number | string | null | undefined): void => {+ if (value !== null && value !== undefined && value !== 0 && value !== '') stats.push({ label, value: String(value) })+ }++ add('agents', snap?.agents.length)+ add('claims', snap?.claims.length)+ add('tasks', snap?.tasks.length)+ add('patterns', snap?.neural?.patterns ?? snap?.sona?.patterns)+ add('trajectories', snap?.neural?.trajectories)+ add('plugins', installed.length)+ add('missions', snap?.missions?.missions.length)++ return {+ title: 'RUV.NET // RUVECTOR CONSTELLATION',+ credit: 'rUv',+ version,+ build,+ stars: MAP.map(star => ({ ...star, alive: (evidence[star.id] as Evidence).alive, detail: (evidence[star.id] as Evidence).detail })),+ links: LINKS,+ stats,+ }+}diff --git a/plugins/ruflo-console/hooks/controller.ts b/plugins/ruflo-console/hooks/controller.tsindex 2e397107e2..835c84a5ad 100644--- a/plugins/ruflo-console/hooks/controller.ts+++ b/plugins/ruflo-console/hooks/controller.ts@@ -470,7 +470,7 @@ export function createController(state: State, host: Host): Controller {drill,command: name => (name === 'refresh' ? actions.refresh() : name === 'help' ? actions.help() : actions.close()),})- const actions: Actions = actionsOf(state, host, runner, { freshRead, probe, setView, drill, close })+ const actions: Actions = actionsOf(state, host, runner, { freshRead, probe, setView, drill, close, animate })function markFrame(requestId: string, isWorking: boolean): void {markRequest = requestIddiff --git a/plugins/ruflo-console/hooks/gfx/boot-cyber.ts b/plugins/ruflo-console/hooks/gfx/boot-cyber.tsnew file mode 100644index 0000000000..7be04fb635--- /dev/null+++ b/plugins/ruflo-console/hooks/gfx/boot-cyber.ts@@ -0,0 +1,200 @@+/**+ * The boot log under the RuFlo sign, drawn as a cyberpunk uplink from real data (ADR-432): a title strip that scrambles into place,+ * the ruvector constellation (a star is lit only if boot-facts found evidence for it, and data pulses run only along lines whose two+ * ends are both lit), a signal row of the project's real numbers, a scan grid of every console area with the self-check's verdict, and a+ * READY line that says "ALL STARS ALIGNED" only when every star is lit and every area verified. Everything is a function of the age in+ * ms and a hash of it, never of a random number, so a frame is reproducible. One easter egg sits in the middle of the boot.+ */+import type { BootCheck } from '../boot-checks'+import type { BootFacts, Star } from '../boot-facts'+import { Grid } from './raster'++const GREEN = 0x39ff14+const CYAN = 0x05d9e8+const PINK = 0xff2a6d+const AMBER = 0xffb000+const DIM = 0x6b7280+const WHITE = 0xe6e6e6++/** The log starts here (the sign has struck and the handshake is typed), and one area is scanned every SCAN_MS. */+export const CYBER_FROM_MS = 1500+const SCAN_MS = 100+/** The easter egg's window: a ghost signal in the signal row. */+export const EGG_FROM_MS = 2400+export const EGG_TO_MS = 3800++const CONST_ROWS = 7+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++/** A deterministic hash, 0 to 0xffffffff. */+export const hash = (n: number): number => {+ let x = Math.imul(n | 0, 0x9e3779b1) >>> 0++ x ^= x >>> 15+ x = Math.imul(x, 0x85ebca6b) >>> 0+ x ^= x >>> 13++ return x >>> 0+}++const NOISE = '01#%$&▒░<>/\\'++/** `text` resolved from the left over `span` ms from `from`: characters not yet resolved are noise, so it scrambles into place. */+export function scramble(text: string, age: number, from: number, span: number): string {+ if (age < from) return ''++ const settled = Math.floor(((age - from) / span) * text.length)++ return [...text].map((ch, i) => (i < settled || ch === ' ' ? ch : (NOISE[hash(i * 31 + Math.floor(age / 55)) % NOISE.length] as string))).join('')+}++/** The ghost signal's text at `age`: three bytes of binary that decode, byte by byte, into rUv. */+export function eggText(age: number): 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' : ''}`+}++const cellOf = (star: Star, left: number, width: number, top: 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)),+})++/** The cells of a straight line between two points, ends excluded. */+function line(a: { x: number; y: number }, b: { x: number; y: number }): { x: number; y: number }[] {+ const steps = Math.max(Math.abs(b.x - a.x), Math.abs(b.y - a.y))+ const out: { x: number; y: number }[] = []++ for (let i = 1; i < steps; i++) out.push({ x: Math.round(a.x + ((b.x - a.x) * i) / steps), y: Math.round(a.y + ((b.y - a.y) * i) / steps) })++ return out+}++function constellation(grid: Grid, facts: BootFacts, age: number, top: 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 visible = (star: Star): boolean => age >= CYBER_FROM_MS + star.appearAt+ const byId = new Map(facts.stars.map(star => [star.id, star]))++ facts.links.forEach(([from, to], index) => {+ const a = byId.get(from)+ const b = byId.get(to)+ const pa = place.get(from)+ const pb = place.get(to)++ if (a === undefined || b === undefined || pa === undefined || pb === undefined || !visible(a) || !visible(b)) return++ const cells = line(pa, pb)+ const live = a.alive && b.alive+ // A pulse travels a lit line from one end to the other; a line with a dark end stays a faint dotted trace and carries nothing.+ const pulse = live && cells.length > 0 ? Math.floor(((age / 1100 + index * 0.37) % 1) * cells.length) : -1++ cells.forEach((cell, i) => {+ if (live) grid.set(cell.x, cell.y, i === pulse ? '●' : '·', i === pulse ? WHITE : CYAN)+ else if ((i + index) % 2 === 0) grid.set(cell.x, cell.y, '·', DIM)+ })+ })++ for (const star of facts.stars) {+ const at = place.get(star.id)++ if (at === undefined || !visible(star)) continue++ const flicker = hash(star.appearAt + Math.floor(age / 260)) % 5 === 0+ const glyph = star.alive ? (flicker ? '✦' : '★') : '☆'+ const color = star.alive ? (star.id === 'ruflo' ? AMBER : GREEN) : DIM++ grid.set(at.x, at.y, glyph, color)+ grid.text(at.x + 2, at.y, star.label, star.alive ? WHITE : DIM)+ }+}++/** 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)++ return+ }++ if (facts.stats.length === 0) {+ grid.text(0, y, '▸ no live swarm data yet: a quiet project is a clean slate', DIM)++ return+ }++ const first = Math.floor(age / 700) % facts.stats.length+ const picks = [facts.stats[first], facts.stats[(first + 1) % facts.stats.length]].filter((entry, i, all) => entry !== undefined && all.indexOf(entry) === i)++ grid.text(0, y, `▸ ${picks.map(entry => `${entry?.label} ${entry?.value}`).join(' · ')}`.slice(0, grid.columns), CYAN)+}++/**+ * Draws the cyberpunk log into `grid` below row `top`, in `room` rows. Returns false, drawing nothing, when the grid is too narrow+ * or too short for it, so the caller keeps the plain boot log.+ */+export function drawCyber(grid: Grid, facts: BootFacts, modules: readonly { name: string }[], checks: readonly BootCheck[] | undefined, age: number, top: number, room: number): boolean {+ 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+ const needed = 1 + 1 + scanRows + 1++ if (columns < MIN_COLUMNS || room < needed) return false++ let y = top++ // 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}` : ''}`++ 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)+ y += CONST_ROWS+ }++ signal(grid, facts, age, y)+ y += 1++ // The scan grid: [ .. ] while an area is being read, then its verdict from the self-check.+ const failed = modules.filter(entry => checks?.find(result => result.area === entry.name)?.ok === false)++ modules.forEach((entry, i) => {+ const startedAt = CYBER_FROM_MS + i * SCAN_MS++ if (age < startedAt) return++ const x = (i % per) * CELL+ const row = y + Math.floor(i / per)+ const isOn = age >= startedAt + SCAN_MS+ const 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 : WHITE)+ })+ y += scanRows++ // READY: the claim is only as big as the evidence.+ const scanEnd = CYBER_FROM_MS + modules.length * SCAN_MS + SCAN_MS+ const dark = facts.stars.filter(star => !star.alive).length++ 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)+ }++ return true+}diff --git a/plugins/ruflo-console/hooks/gfx/boot.ts b/plugins/ruflo-console/hooks/gfx/boot.tsindex 4767ae673e..97bdf1be24 100644--- a/plugins/ruflo-console/hooks/gfx/boot.ts+++ b/plugins/ruflo-console/hooks/gfx/boot.ts@@ -7,6 +7,8 @@* [FAIL] with the first problem if not, so what the screen claims is what was verified.*/import type { BootCheck } from '../boot-checks'+import type { BootFacts } from '../boot-facts'+import { drawCyber } from './boot-cyber'import { neonPicture, NEON_ROWS } from './neon'import { Grid } from './raster'@@ -59,7 +61,7 @@ const NAME_WIDTH = 15* `total`), so it moves before any read returns and reads 100% before the boot ends at BOOT_MIN_MS. `rows` is the* pane's body height when it is known: the boot log fills what is left under the sign (0: the sign alone).*/-export function bootPicture(project: string, columns: number, age: number, done: number, total: number, rows = 0, checks?: readonly BootCheck[]): Grid {+export function bootPicture(project: string, columns: number, age: number, done: number, total: number, rows = 0, checks?: readonly BootCheck[], facts?: BootFacts): Grid {const height = Math.max(BOOT_ROWS, rows)const grid = new Grid(columns, height)const type = (y: number, from: number, text: string, color: number, msPerChar = 22) => {@@ -89,7 +91,10 @@ export function bootPicture(project: string, columns: number, age: number, done:const started = age < LOG_FROM_MS ? 0 : Math.min(entries.length, Math.floor((age - LOG_FROM_MS) / LOG_MS_PER) + 1)const logProgress = started / entries.length- if (room > 0 && started > 0) {+ // With the machine's facts and room for it, the log is the cyberpunk uplink (boot-cyber.ts); otherwise the plain list below.+ const isCyber = facts !== undefined && age >= LOG_FROM_MS - 200 && drawCyber(grid, facts, BOOT_MODULES, checks, age, BOOT_ROWS + 1, room)++ if (!isCyber && room > 0 && started > 0) {const first = Math.max(0, started - room)for (let i = first; i < started; i++) {diff --git a/plugins/ruflo-console/hooks/views/common.ts b/plugins/ruflo-console/hooks/views/common.tsindex 43782fdb59..1164192009 100644--- a/plugins/ruflo-console/hooks/views/common.ts+++ b/plugins/ruflo-console/hooks/views/common.ts@@ -35,6 +35,8 @@ export type Kit = Pick<Elements['terminal'], 'Box' | 'Text' | 'Button'> & { Rastexport type Actions = {view: (id: ViewId) => voidrefresh: () => void+ /** Refresh and replay the intro boot screen: the footer button and the r key. */+ restart: () => voidhelp: () => voidclose: () => voidback: () => voiddiff --git a/plugins/ruflo-console/hooks/views/frames.ts b/plugins/ruflo-console/hooks/views/frames.tsindex 838a244a24..bce3a77667 100644--- a/plugins/ruflo-console/hooks/views/frames.ts+++ b/plugins/ruflo-console/hooks/views/frames.ts@@ -7,6 +7,7 @@ import type { AuditTrend, HarnessScore, Intelligence } from '../data/cli'import { recentByAgent } from '../data/events'import { agentLabels } from '../data/parse'import { getBootChecks } from '../boot-checks'+import { bootFacts } from '../boot-facts'import { getBuild } from '../build'import { PALETTE, rgb } from '../menu-colors'import { CONSOLE_VERSION } from '../version'@@ -128,7 +129,7 @@ export function picturesOf(state: State, columns: number, nowMs: number, t: numb// The BBS boot screen owns the pane for its first seconds; nothing else is drawn under it.if (isBooting(state, nowMs)) {- pictures.set('boot', bootPicture(state.cwd.split('/').filter(Boolean).at(-1) ?? '', Math.min(width, 90), nowMs - state.pane.bootAtMs, state.probes.size, PROBES.length, state.pane.rows, getBootChecks()))+ pictures.set('boot', bootPicture(state.cwd.split('/').filter(Boolean).at(-1) ?? '', Math.min(width, 90), nowMs - state.pane.bootAtMs, state.probes.size, PROBES.length, state.pane.rows, getBootChecks(), bootFacts(state, CONSOLE_VERSION, getBuild())))return pictures}diff --git a/plugins/ruflo-console/hooks/views/pane.ts b/plugins/ruflo-console/hooks/views/pane.tsindex eac11137cf..9d2e715143 100644--- a/plugins/ruflo-console/hooks/views/pane.ts+++ b/plugins/ruflo-console/hooks/views/pane.ts@@ -214,7 +214,7 @@ function footer(ctx: Ctx, isPlaced = false): RenderElement {{ id: 'close', full: 'Close', short: '×', priority: 4 },]const fit = fitFooter(items, ctx.columns - 2)- const press: Record<string, () => void> = { palette: () => ctx.act.palette('all'), actions: () => ctx.act.palette('selection'), 'ask-claude': () => ctx.act.ask.ask(), 'ask-slash': () => ctx.act.ask.slash(), refresh: ctx.act.refresh, help: ctx.act.help, close: ctx.act.close }+ const press: Record<string, () => void> = { palette: () => ctx.act.palette('all'), actions: () => ctx.act.palette('selection'), 'ask-claude': () => ctx.act.ask.ask(), 'ask-slash': () => ctx.act.ask.slash(), refresh: ctx.act.restart, help: ctx.act.help, close: ctx.act.close }const hotkey: Record<string, string> = { palette: 'p', actions: 'x', refresh: 'r', help: 'h' }const full = new Map(items.map(item => [item.id, item.full]))const statusRoom = Math.max(10, ctx.columns - fit.used - 3)diff --git a/plugins/ruflo-console/tests/boot-cyber.spec.ts b/plugins/ruflo-console/tests/boot-cyber.spec.tsnew file mode 100644index 0000000000..b37d9abc49--- /dev/null+++ b/plugins/ruflo-console/tests/boot-cyber.spec.ts@@ -0,0 +1,125 @@+/**+ * The cyberpunk boot log (ADR-432): a star is lit only on evidence, pulses run only on lit lines, READY claims no more than was+ * verified, the scramble and easter egg are deterministic, and a small pane falls back to the plain log. Run with+ * npx vitest run plugins/ruflo-console/tests/boot-cyber.spec.ts+ */+import { describe, expect, it } from 'vitest'++import { bootFacts } from '../hooks/boot-facts'+import { bootPicture, BOOT_MODULES, BOOT_ROWS } from '../hooks/gfx/boot'+import { eggText, scramble, EGG_FROM_MS } from '../hooks/gfx/boot-cyber'+import { newState, type State } from '../hooks/state'++const textOf = (grid: ReturnType<typeof bootPicture>): string => {+ const lines: string[] = []++ for (let y = 0; y < grid.rows; y++) {+ let s = ''++ for (let x = 0; x < grid.columns; x++) s += String.fromCodePoint(grid.glyph(x, y))+ lines.push(s.trimEnd())+ }++ return lines.join('\n')+}+const withPlugins = (names: string[]): State => {+ const state = newState({})++ state.snapshot = { plugins: { installed: names.map(name => ({ id: `${name}@ruflo`, name, marketplace: 'ruflo', version: '1.0.0', scope: 'user' })) }, agents: [{}, {}], claims: [], tasks: [], neural: null, sona: null, missions: null, isRufloProject: false } as never++ return state+}+const allOk = BOOT_MODULES.map(entry => ({ area: entry.name, ok: true, problems: [] as string[] }))+const rowsFor = BOOT_ROWS + 20++describe('boot facts', () => {+ it('lights a star only on evidence, and says why a dark one is dark', () => {+ const facts = bootFacts(withPlugins(['ruflo-ruvector', 'rulake-stack']), '0.26.0', 'abc123')+ const star = (id: string) => facts.stars.find(entry => entry.id === id)++ expect(star('ruvector')).toMatchObject({ alive: true })+ expect(star('rulake')).toMatchObject({ alive: true, detail: '1 plugin' })+ expect(star('rvf')).toMatchObject({ alive: false, detail: 'ruflo-rvf is not installed' })+ expect(star('ruflo')?.alive).toBe(false)+ })++ it('lists only the numbers there is data for', () => {+ const facts = bootFacts(withPlugins(['a']), '1', '')++ expect(facts.stats.map(entry => entry.label)).toEqual(['agents', 'plugins'])+ })+})++describe('the cyberpunk log', () => {+ it('draws the title, the constellation, the scan grid and a READY that matches the evidence', () => {+ const facts = bootFacts(withPlugins(['ruflo-ruvector']), '0.26.0', 'abc123')+ const text = textOf(bootPicture('p', 90, 6000, 10, 10, rowsFor, allOk, facts))++ expect(text).toContain('RUV.NET // RUVECTOR CONSTELLATION')+ expect(text).toContain('rUv · ruflo v0.26.0 · abc123')+ expect(text).toContain('ruvector')+ expect(text).toMatch(/\[WARN\] READY · 26 of 26 areas verified · \d+ stars? dark/)+ expect(text).not.toContain('ALL STARS ALIGNED')+ })++ it('says ALL STARS ALIGNED only when every star is lit and every area verified, and reports a failed area', () => {+ 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++ const aligned = textOf(bootPicture('p', 90, 6000, 10, 10, rowsFor, allOk, bootFacts(lit, '1', '')))++ expect(aligned).toContain('ALL STARS ALIGNED')++ const failing = allOk.map((entry, i) => (i === 3 ? { ...entry, ok: false, problems: ['x'] } : entry))+ const failed = textOf(bootPicture('p', 90, 6000, 10, 10, rowsFor, failing, bootFacts(lit, '1', '')))++ expect(failed).not.toContain('ALL STARS ALIGNED')+ expect(failed).toMatch(/\[FAIL\] READY · 25 of 26 areas verified · 1 failed/)+ })++ it('shows the easter egg only in its window, and it decodes to rUv', () => {+ const facts = bootFacts(withPlugins([]), '1', '')++ expect(textOf(bootPicture('p', 90, EGG_FROM_MS + 1400, 10, 10, rowsFor, allOk, facts))).toContain('01110010 01010101 01110110 = rUv')+ expect(textOf(bootPicture('p', 90, 5000, 10, 10, rowsFor, allOk, facts))).not.toContain('01110010')+ expect(eggText(EGG_FROM_MS + 1400)).toBe(eggText(EGG_FROM_MS + 1400))+ })++ it('is deterministic and scrambles into place', () => {+ expect(scramble('ruflo', 1000, 1000, 500)).toHaveLength(5)+ expect(scramble('ruflo', 1600, 1000, 500)).toBe('ruflo')+ expect(scramble('ruflo', 900, 1000, 500)).toBe('')+ expect(textOf(bootPicture('p', 90, 3000, 10, 10, rowsFor, allOk, bootFacts(withPlugins([]), '1', '')))).toBe(textOf(bootPicture('p', 90, 3000, 10, 10, rowsFor, allOk, bootFacts(withPlugins([]), '1', ''))))+ })++ 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', 90, 6000, 10, 10, BOOT_ROWS + 6, allOk, facts))).not.toContain('RUV.NET')+ })+})++describe('restart (the footer Refresh and r)', () => {+ it('replays the intro: a pane that finished booting boots again from the new start, in the BBS look only', async () => {+ const { isBooting, BOOT_MIN_MS } = await import('../hooks/state')+ const state = newState({})++ state.options.look = 'bbs'+ state.options.boot = true+ state.snapshot = {} as never+ state.pane.bootAtMs = 1_000++ expect(isBooting(state, 1_000 + BOOT_MIN_MS + 1)).toBe(false)++ state.pane.bootAtMs = 100_000++ expect(isBooting(state, 100_500)).toBe(true)+ expect(isBooting(state, 100_000 + BOOT_MIN_MS + 1)).toBe(false)++ state.options.look = 'plain'++ expect(isBooting(state, 100_500)).toBe(false)+ })+})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.mdnew file mode 100644index 0000000000..18ddf56559--- /dev/null+++ b/v3/docs/adr/ADR-432-console-cyberpunk-boot-uplink-and-restart.md@@ -0,0 +1,28 @@+# ADR 432: A data-driven cyberpunk boot log, and Refresh that replays it++Status: Accepted (ships in ruflo-console 0.26.0)++Date: 2026 10 03++Decision owner: Ruflo maintainers++Scope: `plugins/ruflo-console`: `hooks/boot-facts.ts` (new), `hooks/gfx/boot-cyber.ts` (new), `hooks/gfx/boot.ts`, `hooks/views/frames.ts`, `hooks/bindings.ts` (`restart`), `hooks/views/pane.ts`, `tests/boot-cyber.spec.ts` (new).++Extends: ADR 426 (the self-check the log reports), ADR 430 (the menu's look).++## 1. Decision++- **The log under the sign is an uplink drawn from real data.** A title strip scrambles into place (`RUV.NET // RUVECTOR CONSTELLATION`, rUv, the console version and git build); the ruvector constellation (ruflo, agentdb, sona, ruvector, rvf, ruvllm, rulake, ruqu, rvdna) is drawn as stars and lines; a signal row cycles the project's real numbers (agents, claims, tasks, patterns, plugins, missions); a scan grid lists the 26 console areas with the self-check's verdict; READY closes it.+- **Nothing is invented.** A star is lit only if `boot-facts` found evidence (the CLI version probe, the memory and intelligence probes, the installed-plugin list, the neural and SONA files); a dark star says why. A data pulse runs only along a line whose two ends are both lit. READY says `ALL STARS ALIGNED` only when every star is lit and every area verified; otherwise it counts failed areas and dark stars.+- **Reproducible.** Motion is a function of the age and a hash, never `Math.random`.+- **An easter egg** sits mid-boot (2.4 to 3.8 s): a ghost signal of the binary for `rUv` that decodes byte by byte.+- **Fallback.** Under 64 columns, or without room for the title, scan grid and READY, the plain log is drawn as before.+- **Refresh restarts the intro.** The footer Refresh button and the `r` key now reset the boot clock (so the intro plays again, in the BBS look with the boot option on) and then do the full re-read. The Cost page's own "Refresh cost" button and `/ruflo refresh` stay plain re-reads.++## 2. What this does not prove++Seen only through `Grid` text in specs, not on a terminal. The constellation's evidence is by plugin name (`ruflo-ruvector`, `ruflo-rvf`, `ruflo-ruvllm`, `rulake*`, `ruqu*`, `rvdna*`), so a package installed another way reads as dark.++## 3. Tests++`tests/boot-cyber.spec.ts` (8): evidence lights stars, READY matches the evidence, the egg's window, determinism and scramble, the narrow fallback, and the boot replaying from a reset clock.