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

merge verify/bench; ADR-468 for the bench optimisations; console 0.34.0

ruv6b17188cadd7
diff --cc plugins/ruflo-console/.claude-plugin/plugin.json
index b59c13a3e1,b59c13a3e1..c64e5d5a6a
--- a/plugins/ruflo-console/.claude-plugin/plugin.json
+++ b/plugins/ruflo-console/.claude-plugin/plugin.json
@@@ -1,7 -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.23",
++ "version": "0.34.0",
"author": {
"name": "ruvnet",
"url": "https://github.com/ruvnet"
diff --cc plugins/ruflo-console/hooks/ap-live.ts
index d98e207303,e5ecbc7c4c..aa980cbf28
--- a/plugins/ruflo-console/hooks/ap-live.ts
+++ b/plugins/ruflo-console/hooks/ap-live.ts
@@@ -16,14 -16,11 +16,14 @@@ import { readBounded, under } from './d
import { checkNoLinks, dirOf, removeFileArgv, replaceFileArgv } from './data/wf-file'
import { cleanText } from './data/wf-clean'
import { trackerOf } from './data/cost-ledger'
-import { evaluate, outcomesOf, promote, propose, reviewTrials, tierOf, tunablesFrom, lastHash } from './data/ap-adapt'
+import { tierOf, tunablesFrom } from './data/ap-adapt'
+import { adaptPass, rotate } from './ap-maint'
+import { checkPin, type Pin } from './data/ap-pin'
+import { loadPin, setPin } from './ap-pin-live'
import { AUTOPILOT_DIR, ENVELOPE_FILE, KILL_FILE, open, type Envelope, type Sealed, type Spend } from './data/ap-envelope'
-import { anatoleFact, classifyTask, effectOf, killSeen, preflightAll, spendArgvs, spendOf, type ToolCheck } from './data/ap-guard'
-import { appendArgv, encodeLine, JOURNAL_FILE, JOURNAL_MAX_BYTES, touchArgv, type JournalEvent } from './data/ap-journal'
-import { digestText, emptyLoop, foldJournal, replayJournal, skipSet, snapshotEvents, tick, type EffectFact, type Facts, type LoopState, type TaskFact } from './data/ap-loop'
+import { anatoleFact, classifyTask, effectOf, killSeen, preflightAll, spendArgvs, spendOf, verifyPermission, type ToolCheck } from './data/ap-guard'
- import { appendArgv, encodeLine, JOURNAL_FILE, JOURNAL_MAX_BYTES, parseJournal, REFUSED_WHY, startedCount, touchArgv, type JournalEvent } from './data/ap-journal'
- import { digestText, emptyLoop, foldJournal, skipSet, tick, type EffectFact, type Facts, type LoopState, type TaskFact } from './data/ap-loop'
++import { appendArgv, encodeLine, JOURNAL_FILE, JOURNAL_MAX_BYTES, REFUSED_WHY, startedCount, touchArgv, type JournalEvent } from './data/ap-journal'
++import { digestText, emptyLoop, foldJournal, replayJournal, skipSet, tick, type EffectFact, type Facts, type LoopState, type TaskFact } from './data/ap-loop'
import type { Preflight } from './data/ap-loop'
import type { NoticeDraft } from './notices'
diff --cc plugins/ruflo-console/hooks/data/ap-loop.ts
index 4c7362e3b1,ab32bc81c0..20ad0153e1
--- a/plugins/ruflo-console/hooks/data/ap-loop.ts
+++ b/plugins/ruflo-console/hooks/data/ap-loop.ts
@@@ -8,8 -10,8 +10,8 @@@
* is considered; budget, Anatole and the failure ladder all sit between "settled" and "act". A step is started at most once per id,
* and a task with a started or done step is never started again.
*/
-import { classAllowed, pathAllowed, sha256, type Envelope, type Spend } from './ap-envelope'
+import { classAllowed, hostAllowed, pathAllowed, sha256, type Envelope, type Spend } from './ap-envelope'
- import type { Anatole, JournalEvent, Receipt } from './ap-journal'
+ import { parseJournal, type Anatole, type JournalEvent, type Receipt } from './ap-journal'
export type Phase = 'idle' | 'running' | 'paused' | 'stopped'
export type StepRec = { id: string; task: string; cls: string; attempt: number; startedAt: number; deadline: number; status: 'started' | 'done' | 'failed'; verified?: boolean; why?: string; tier: string; par?: number; endedAt?: number }
diff --cc plugins/ruflo-console/hooks/version.ts
index aff8018138,aff8018138..79ede445e1
--- a/plugins/ruflo-console/hooks/version.ts
+++ b/plugins/ruflo-console/hooks/version.ts
@@@ -2,4 -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.23'
++export const CONSOLE_VERSION = '0.34.0'
diff --cc plugins/ruflo-console/scripts/smoke.sh
index 92037deba6,92037deba6..6b3348eb8f
--- a/plugins/ruflo-console/scripts/smoke.sh
+++ b/plugins/ruflo-console/scripts/smoke.sh
@@@ -11,9 -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.23"
++step "1. plugin.json declares ruflo-console 0.34.0"
grep -q '"name": "ruflo-console"' "$ROOT/.claude-plugin/plugin.json" \
-- && grep -q '"version": "0.33.23"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version"
++ && grep -q '"version": "0.34.0"' "$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 --cc v3/docs/adr/ADR-468-console-bench-optimizations.md
index 0000000000,7f9b28413f..f8af1dd574
mode 000000,100644..100644
--- a/v3/docs/adr/ADR-468-console-bench-optimizations.md
+++ b/v3/docs/adr/ADR-468-console-bench-optimizations.md
@@@ -1,0 -1,66 +1,66 @@@
-# ADR 467: Workflows page and autopilot: measured costs, the fixes, and the gate that holds them
++# ADR 468: Workflows page and autopilot: measured costs, the fixes, and the gate that holds them
+
+ Status: Accepted
+
+ Date: 2026-10-06
+
+ Builds on: ADR-458 (workflows reader), ADR-459 (drill and search), ADR-464 (page slots), ADR-466 (mission autopilot)
+
+ ## 1. Context
+
+ The Workflows page is drawn on every frame while it is open and the autopilot ticks once a minute for weeks. Neither had been
+ measured under the load a real project and a long run put on them. `scripts/bench-workflows.mjs` and `scripts/bench-autopilot.mjs`
+ now do: every input is generated (no fixtures on disk), the page is drawn through the real page and slots into a recording kit
+ (the engine's own layout is not in it), and each case prints median, p99, bytes allocated and a digest of what it computed, so a
+ BEFORE and an AFTER run can be compared for the same answer and not only the same speed. All digests were identical across the change.
+
+ ## 2. Findings and decisions
+
+ Measured on one host (node 22), BEFORE at 640abdaeb, AFTER on this branch. Frame cases: 6 runs x 60 agents of transcript in memory.
+
+ | Case | Before | After | Cause and fix |
+ |---|---|---|---|
+ | Page frame, 20 runs / 200 on disk | 64 / 61 ms | 0.06 / 0.08 ms | The parse memo held 24 transcripts; the search panel asked for all ~340 on every frame, so each draw parsed them again. The memo is now bounded by the text it holds (24 M characters), and a query too short to search reads nothing. |
+ | Page frame, drill open | 1488 ms | 0.07 ms | Same cause. |
+ | Page frame, a query typed | 1436 ms | 0.12 ms | Same cause; the search memo now compares the transcript text by identity, and `search` parses lazily only as far as its scan cap (new optional `isHeld` counts the rest without a parse). First draw after typing: 1537 ms to 327 ms. |
+ | Tail reads of transcripts over the read cap, per refresh (360 agents) | 360 x 400 KB | 0 | Each refresh re-read every oversized transcript. The listing's size and mtime now stand for "unchanged" and the parsed figures (not the text) are kept. |
+ | `foldJournal`, 100,000 events | 15.5 s (10.8 s earlier run) | 53 ms | A scan of the step and park lists per event (quadratic). Indexes by step id, open park id and park task. 8k events: 65 ms to 2 ms. |
+ | Replay of an 8k-line journal on each tick | 83 ms | 0.000 ms when unchanged (10 ms when changed) | The console replayed the journal every minute; the read cache returns the same text while the file is unchanged, so the last replay is kept (`replayJournal`, one slot, keyed by the text). |
+ | `encodeLine` x 100,000 | 209 ms | 131 ms | A parse of the washed text, to stringify it again, produced the same bytes: one pass. |
+
+ Not changed, with the figure: `parseTranscript` 5 MB 21 ms and `parseActivity` 5 MB 44 ms (linear, read only when the file changes); 50 MB
+ parses once in 0.3 / 0.6 s and is not a product path (a file over 3 MB is tail-read, 400 KB); a refresh with the page open, nothing
+ changed, 5 ms; closed, 0.000 ms; the reader at 200 runs on disk, 1.7 ms; replay `boardAt` at 2000 agents 0.6 ms; a conversation
+ thread fed 1000 messages (it keeps 100) draws in 0.04 ms, adding them costs 30 us each, nearly all `maskSecrets`; `tick` 0.02 ms, 10,000
+ tick+fold a second. The credential mask is the largest single cost left in every parse (23% of a profile) and is left alone: no cheaper
+ prefilter was proved to mask exactly what it masks.
+
+ ## 3. The gate
+
+ Budgets are in the scripts (median ms for one draw or one timer tick; p99 within the larger of 16 ms or three times the budget):
+ page frame 6, drill frame 8, query-active frame 8, conversation frame 3, refresh closed 0.05, refresh open 60, search 120, replay
+ `boardAt` at 2000 agents 12, journal replay 40, `tick` 0.25, fold of 100k events 400. `--check` exits 1 on a miss.
+
+ NODE_OPTIONS=--expose-gc npx -y tsx plugins/ruflo-console/scripts/bench-workflows.mjs --check [--quick] [--only frame,search]
+ NODE_OPTIONS=--expose-gc npx -y tsx plugins/ruflo-console/scripts/bench-autopilot.mjs --check
+
+ `tests/bench-guards.spec.ts` holds the fixes without timing: the new fold agrees with the old scan-per-event fold on seeded random journals, the
+ encoder writes the old bytes, an unchanged journal is not replayed, a live project's transcripts stay parsed, a frame with no query parses
+ nothing, search stops parsing at its cap, and an unchanged oversized transcript is not read twice. Each of its guards was mutation-checked
+ (reverting the fix makes it fail). One test is timing-sensitive: 60,000 events fold in under 1.5 s (measured 40 ms).
+
+ ## 4. Consequences
+
+ - No file format changed: the journal bytes are identical (a test proves it), the tail figures and the parse memo are in memory only.
+ - The tail skip needs the host's `fs.list` to return `mtimeMs` (the reader's own run ordering already does); without it the reads happen as before.
+ - `replayJournal` is one slot: two consoles with different journals in one process would replace each other's answer (correctly, never wrongly).
+ - The parse memo can hold up to 24 M characters of transcript text as parsed records.
+
+ ## 5. Not done
+
+ A transcript that grows is still parsed whole when it changes (a refresh reads only unchanged files for free; a delta parse was not built).
+ Frame costs are of the recording kit, not the engine's layout.
+
+ ## 6. Rollback
+
+ Revert the commit. Nothing else depends on it; the scripts and the spec go with it.