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

feat(ruflo-console): ASCII glitch in the page-title strike-in (ADR-433)

ruv02bd83bfb049
diff --git a/plugins/ruflo-console/hooks/gfx/pictures.ts b/plugins/ruflo-console/hooks/gfx/pictures.ts
index 93c3b8d580..8d07124645 100644
--- a/plugins/ruflo-console/hooks/gfx/pictures.ts
+++ b/plugins/ruflo-console/hooks/gfx/pictures.ts
@@ -284,6 +284,7 @@ const NEON_CORAL = 0xff7a59
*/
/** A page title strikes in over this long when the page is switched to. */
export const TITLE_ENTRY_MS = 1_200
+const GLITCH = '#%&@/\\|<>=+*'
export function titlePicture(name: string, columns: number, t: number, age = Infinity): Grid {
const grid = new Grid(columns, 2)
@@ -331,6 +332,18 @@ export function titlePicture(name: string, columns: number, t: number, age = Inf
if (x > lead + 1) grid.set(x, y, 'â–‘â–’â–“â–ˆ'[hash(x * 7 + y + Math.floor(age / 60)) % 4] as string, mix(0x3a0f2e, NEON_CYAN, 0.35))
else if (x > lead - 1.5) grid.set(x, y, grid.glyph(x, y), 0xffffff)
+ // Behind the edge the letters are settled but still glitching: some flip to an ASCII character for a frame, pink or cyan, less as the entry ends.
+ else if (hash(x * 13 + y * 7 + Math.floor(age / 50)) % 100 < 14 * (1 - age / TITLE_ENTRY_MS)) grid.set(x, y, GLITCH[hash(x + y + Math.floor(age / 50)) % GLITCH.length] as string, hash(x + Math.floor(age / 50)) % 2 === 0 ? 0xff2a6d : 0x05d9e8)
+ }
+
+ // And now and then a whole row slips sideways a cell or two, and snaps back.
+ const slip = hash(y * 5 + Math.floor(age / 80))
+
+ if (slip % 6 === 0 && age < TITLE_ENTRY_MS - 150) {
+ const by = 1 + (slip >>> 3) % 2 * (slip % 2 === 0 ? 1 : -1)
+ const row = grid.cells.slice(y * columns * 3, (y + 1) * columns * 3)
+
+ for (let x = x0; x < Math.min(columns, x0 + width); x++) grid.cells.set(row.slice(Math.max(0, x - by) * 3, Math.max(0, x - by) * 3 + 3), (y * columns + x) * 3)
}
}
}
diff --git a/plugins/ruflo-console/tests/menu-entry.spec.ts b/plugins/ruflo-console/tests/menu-entry.spec.ts
index a561a30037..a3916b34d5 100644
--- a/plugins/ruflo-console/tests/menu-entry.spec.ts
+++ b/plugins/ruflo-console/tests/menu-entry.spec.ts
@@ -125,3 +125,24 @@ describe('a page title when the page is switched to', () => {
expect(cells(300)).toBe(cells(300))
})
})
+
+describe('the title glitch', () => {
+ it('puts ASCII glitch characters in the strike-in, in pink or cyan, and none once it is over', async () => {
+ const { titlePicture, TITLE_ENTRY_MS } = await import('../hooks/gfx/pictures')
+ const ascii = (age: number): number => {
+ const grid = titlePicture('ruflo | Swarm', 80, 0, age)
+ let n = 0
+
+ for (let i = 0; i < grid.cells.length; i += 3) if ('#%&@/\\|<>=+*'.includes(String.fromCodePoint(grid.cells[i] as number))) n++
+
+ return n
+ }
+ let early = 0
+
+ for (let age = 50; age < 700; age += 50) early += ascii(age)
+
+ expect(early).toBeGreaterThan(0)
+ expect(ascii(TITLE_ENTRY_MS)).toBe(ascii(Infinity))
+ expect(ascii(Infinity)).toBe(0)
+ })
+})
diff --git a/v3/docs/adr/ADR-433-console-menu-entry-and-page-title-strike-in.md b/v3/docs/adr/ADR-433-console-menu-entry-and-page-title-strike-in.md
index 0978da33d9..07de69c223 100644
--- a/v3/docs/adr/ADR-433-console-menu-entry-and-page-title-strike-in.md
+++ b/v3/docs/adr/ADR-433-console-menu-entry-and-page-title-strike-in.md
@@ -18,3 +18,7 @@ Extends: ADR 430 (the menu), ADR 432 (the boot uplink).
## 2. Not proven
Seen only as text and element trees, not on a terminal. A press on an entry while it is still scrambling does nothing (it is not a button yet); the hotkeys are handled elsewhere and work.
+
+## 3. Amendment: ASCII glitch in the strike-in
+
+Behind the leading edge, a share of the settled letters (14%, fading to none by the end) flip for a frame to an ASCII character (`#%&@/\|<>=+*`) in pink or cyan, and a title row now and then slips sideways one or two cells and snaps back. Hash-driven, so reproducible; none once the 1.2 s are over (spec: glitch characters appear during the entry and the finished title has none).