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(console): manually entered text is never silently truncated (ADR-481)

ruv817dcfe0e3cc
diff --git a/plugins/ruflo-console/.claude-plugin/plugin.json b/plugins/ruflo-console/.claude-plugin/plugin.json
index 15bd5a1cdd..e6ad4bd345 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.39.0",
+ "version": "0.39.1",
"author": {
"name": "ruvnet",
"url": "https://github.com/ruvnet"
diff --git a/plugins/ruflo-console/CHANGELOG.md b/plugins/ruflo-console/CHANGELOG.md
index 5265c32143..af0e117ecb 100644
--- a/plugins/ruflo-console/CHANGELOG.md
+++ b/plugins/ruflo-console/CHANGELOG.md
@@ -2,6 +2,12 @@
Newest first. One `## <version> — <date>` heading per version, then `feat:`, `fix:`, `breaking:` and `chore:` bullets (ADR-478). Built from git history; older versions: `git log -- plugins/ruflo-console`.
+## 0.39.1 — 2026-10-07
+- fix: text you type is never silently shortened (ADR-481): the mission goal (was cut at 500 characters), the question, the aside, the guide, the research question, a loop task, help and ask questions, room messages, palette text, start fields, workflow guidance and messages, templates, security and memory fields, the Gates setting and the recall prompt now keep every character; the goal, the loop prompt and the mission context carry it whole
+- fix: the one-line field no longer hides what you typed: under any field whose text passes one line, a bordered mirror shows every line (wrapped, growing to 12 lines, then the last lines with a count) with a line count; type a backslash and n for a new line, and Enter sends all of it
+- fix: a goal, objective, question or note is drawn in full (wrapped), with an explicit "+N more lines" marker past 40 lines, instead of one clipped line; the Mission Control header shows the objective in full
+- fix: over a real limit the action is refused before anything is sent, with the exact limit and the characters over (the field's own 10,000, an argument's 8,000, a ruflo mission objective's 2,000, a loop task's 4,000) and the text stays in the field; AIDefence now screens all of a long text, not its first 2,000 characters
+
## 0.39.0 — 2026-10-07
- feat: ADRs page under TOOLS: find, propose, accept, reject, deprecate and supersede your own project's Architecture Decision Records, with the exact file and diff in the confirm (ADR-480)
- feat: the page finds your project's ADR folder (docs/adr, docs/adrs, doc/adr, adr, docs/architecture/decisions, docs/decisions ...) or the one in Settings, follows the style of your existing ADRs (MADR, Nygard / adr-tools, ruflo style) and offers to initialise a project that has none
diff --git a/plugins/ruflo-console/hooks/adr-actions.ts b/plugins/ruflo-console/hooks/adr-actions.ts
index 12b836aa30..4b25f863fb 100644
--- a/plugins/ruflo-console/hooks/adr-actions.ts
+++ b/plugins/ruflo-console/hooks/adr-actions.ts
@@ -2,6 +2,7 @@
* What the ADRs page and its palette entries call (ADR-480): filter, select, initialise, propose, change a status, attach, check scope.
* Each write is a spec for the runner's confirm row; this file only wires them.
*/
+import { checkLimit } from './full-text'
import type { ActionSpec } from './actions'
import { adrOf, docByNumber, docOf, initSpec, loadAdrs, proposeSpec, say, statusSpec, type AdrFilter } from './adr'
import { draftSpec, scopeCheck, setAttached } from './adr-mission'
@@ -29,6 +30,9 @@ export type AdrWired = { host: Host; actions: AdrActions }
const wired = new WeakMap<State, AdrWired>()
export const adrWired = (state: State): AdrWired | undefined => wired.get(state)
+/** The longest ADR title: the heading and file name of the record (titleText in data/adr-write.ts). */
+export const ADR_TITLE_MAX = 120
+
const today = (): string => new Date().toISOString().slice(0, 10)
export function adrActions(state: State, host: Host, runner: Runner): AdrActions {
@@ -51,7 +55,14 @@ export function adrActions(state: State, host: Host, runner: Runner): AdrActions
host.invalidate()
},
init: () => ask(initSpec(state, host, today()), adr.dir === null ? 'cannot initialise' : 'this project already has an ADR folder'),
- propose: title => ask(proposeSpec(state, host, title, today()), adr.dir === null ? reason : 'type a title for the record'),
+ propose: title => {
+ // The title is the record's heading and its file name: one line of at most ADR_TITLE_MAX characters. Longer is refused with the count, never cut (ADR-481).
+ const fit = checkLimit(title.replace(/\s+/g, ' ').trim(), ADR_TITLE_MAX, 'the title', 'it is the record’s heading and file name; put the rest in the record itself')
+
+ if (!fit.ok) return say(state, host, 'propose ADR', false, [fit.message])
+
+ ask(proposeSpec(state, host, title, today()), adr.dir === null ? reason : 'type a title for the record')
+ },
status: (file, to) => {
const doc = docOf(state, file)
diff --git a/plugins/ruflo-console/hooks/data/adr-write.ts b/plugins/ruflo-console/hooks/data/adr-write.ts
index af49486703..ee65af1275 100644
--- a/plugins/ruflo-console/hooks/data/adr-write.ts
+++ b/plugins/ruflo-console/hooks/data/adr-write.ts
@@ -263,7 +263,7 @@ export function draftFromMission(mission: { objective: string; tasks: readonly {
title: titleText(mission.objective).slice(0, 100),
status: 'proposed',
scope: [...scope],
- context: `A mission set out to: ${plain(mission.objective, 300)}`,
+ context: `A mission set out to: ${plain(mission.objective, 2_000)}`,
decision: `Draft, written from the mission's record and to be rewritten by a person: the mission did the following.\n\n${done.join('\n')}\n\nWhat was decided, and why, is not in the record: say it here.`,
}
}
diff --git a/plugins/ruflo-console/hooks/version.ts b/plugins/ruflo-console/hooks/version.ts
index e6871ead11..a79a5de5d5 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.39.0'
+export const CONSOLE_VERSION = '0.39.1'
diff --git a/plugins/ruflo-console/scripts/smoke.sh b/plugins/ruflo-console/scripts/smoke.sh
index 87a066b377..667d4b4fa3 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.39.0"
+step "1. plugin.json declares ruflo-console 0.39.1"
grep -q '"name": "ruflo-console"' "$ROOT/.claude-plugin/plugin.json" \
- && grep -q '"version": "0.39.0"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version"
+ && grep -q '"version": "0.39.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/scripts/ci-test-excluded.txt b/scripts/ci-test-excluded.txt
index 4e0464d030..8527576317 100644
--- a/scripts/ci-test-excluded.txt
+++ b/scripts/ci-test-excluded.txt
@@ -80,6 +80,7 @@ tests/check-guard-tool-names.test.mjs
tests/check-status-forwarding.test.mjs
plugins/ruflo-console/tests/result-display.test.ts
plugins/ruflo-console/tests/toasts.test.ts
+plugins/ruflo-console/tests/full-text.test.ts
plugins/ruflo-console/tests/whatsnew.test.ts
plugins/ruflo-console/tests/adrs.test.ts
plugins/ruflo-protector/tests/corpus.test.ts
diff --git a/v3/docs/adr/ADR-481-text-inputs-never-silently-truncate.md b/v3/docs/adr/ADR-481-text-inputs-never-silently-truncate.md
new file mode 100644
index 0000000000..adfb969e8b
--- /dev/null
+++ b/v3/docs/adr/ADR-481-text-inputs-never-silently-truncate.md
@@ -0,0 +1,123 @@
+# ADR 481: Text inputs never silently truncate (ruflo-console)
+
+Status: Accepted
+
+Date: 2026-10-07
+
+Related: ADR-480 (ADRs page, numbered 480 by the concurrent change), ADR-443 (mission context), ADR-466 (mission autopilot)
+
+## 1. Context
+
+Report: "the mission input field seems to cut off text", then "still not fixed, anything beyond the first line is hidden". Two defects
+sat together:
+
+1. **The host `Input` is one line.** Its props are `key, label, placeholder, value, submitLabel, autoFocus, onInput, onSubmit`
+ (`@internal A one-line text field`, Claude Code 2.1.x): no multiline, rows, wrap, height or maxLength; Enter is always a submit and
+ there is no key event for a new line. A longer text scrolls out of sight. Measured here (tests/full-text.test.ts): an `Input` whose
+ `value` is longer than 10,000 characters makes the engine refuse the **whole pane** ("Input value longer than 10000 characters; the
+ engine drew its own"), so 10,000 is the most any field can hold and no larger value may ever be drawn.
+2. **The code cut what the field held.** `plain(x, N)`, `.slice(0, N)`, `clip()` and `MAX_*` constants shortened typed text in storage,
+ in the prompts and arguments sent on, and in the view where the text was the primary content (the goal was cut at 500 characters
+ before it was even planned; a loop task at 400; a guide at 500; ruHelp and ask questions at 300; room messages at 160; ...).
+
+## 2. Decision
+
+**Rule: a person's manually entered text is never silently shortened.** Where a real limit exists it is checked BEFORE anything is sent,
+refused with the exact limit and the number of characters over (`checkLimit`, hooks/full-text.ts), and the text stays in the field
+(`keepText`, hooks/field-keep.ts). Where text must be shortened for a one-line label, only the label is shortened (with an ellipsis) and
+the full text is kept in the record. Secret masking and control-character stripping are not truncation and stay.
+
+### 2.1 The field: a live mirror
+
+The host cannot grow the field, so the plugin does: `withClearing` (views/clearing.ts) wraps every `Input`. When its text passes one
+line (or holds a line break), a bordered **mirror** under it shows the whole text wrapped to the pane width, growing line by line to 12
+lines; past that it shows the **last** lines (where the cursor is) led by "… (N earlier lines above; all of it is kept and sent)",
+plus "N lines · M characters · Enter sends all of it". It redraws on every keystroke once the text is long (fields that own their value,
+like the research question, redraw too). Short text changes nothing: the field is returned untouched. Because Enter always submits,
+**a typed backslash and `n` is a line break** (`withBreaks`); a real line break from a paste is kept. This applies to every input the
+console draws, so the main-menu goal, the Mission Control goal, the guide, the aside, the room message, the research question, the
+loop task, settings text fields, start fields and the palette all behave alike.
+
+### 2.2 The view: full text, or an explicit marker
+
+`fullRows` (views/full-rows.ts) draws a person's text in full, wrapped, indented under its lead ("goal: "), with the `✎ edit` button after
+it; past 40 lines it ends in "… (+K more lines, press ✎ edit to view/edit)", K being the exact hidden count (`showFull`). Used for the
+goal, the active mission's objective, the last guide, the loop task and the line it will send, the room draft, the recall prompt and the
+result line. The goal no longer sits in the field's placeholder.
+
+### 2.3 The bounds (the largest safe value, with the evidence)
+
+| Name | Value | Where it comes from |
+|---|---|---|
+| `INPUT_VALUE_MAX` / `LONG_TEXT_MAX` | 10,000 | The host `Input` refuses a longer value (measured). Prompt-bound text (goal, guide, aside, questions, loop task via its own bound) goes to Claude through `$.prompt.submit/fill` and `$.command` or on `claude -p` stdin: no argv, and the plugin API documents no length bound. |
+| `ARGV_TEXT_MAX` | 8,000 | One argv element or one JSON argument of `ruflo ... -p <json>`. Linux allows 128 KiB per element (`MAX_ARG_STRLEN`), Windows 32,767 characters for the whole command line; 8,000 (a JSON escape can double it) is safe on both. ruflo's own `validateText` allows 10,000 for a task description. |
+| `MISSION_OBJECTIVE_MAX` | 2,000 | `mission_create`'s input schema: `objective: { maxLength: 2000 }` (v3/@claude-flow/cli/src/mcp-tools/mission-tools.ts:43). Creating a mission from a longer goal is refused with the count; planning, guidance, the skills and the loop use the whole goal. |
+| `MAX_TASK` (loop) | 4,000 | A loop task is sent again on every tick, billed each time. |
+| ADR title | 120 | The record's heading and file name. |
+| Plugin option value | 4,000 | One JSON value on stdin to `claude plugin configure`. |
+| Event query | 20,000 | In-memory filter; terms (12) and regex (48 characters, 2 quantifiers) keep their own visible guards. |
+
+Plain `plain()` collapses line breaks; where the destination takes lines (guide, goal) the console now uses `keepLines`, and where it is
+one line (the arguments of a slash command, a title) the lines join with spaces and the page says so.
+
+### 2.4 Also fixed
+
+- AIDefence screened only the first 2,000 characters of a goal or question; `screenText` now screens all of it in overlapping pieces
+ (`chunksOf`) that each fit one argument.
+- The recall explainer digested a masked, 300-character copy of the prompt, so the lookup of a recorded recall failed for long prompts.
+- The AI terminal's "ask again" row re-sent a 400-character copy of the question.
+- The workflow-convo relay cut the person's own instruction (the quoted answer, another party's text, is shortened with a marker).
+- The mission loop prompt and the mission context carried 200 characters of the objective; they carry it whole (the context budget grew
+ by the objective's 2,000).
+
+## 3. Audit: every text input, its limit, and what it was
+
+Class: (a) display-only cut, (b) silent data cut, (c) legitimate hard limit. "Now" is the state after this change.
+
+| Input (key) | Was | Now |
+|---|---|---|
+| Mission goal (`mc-goal`, `menu-goal`, `/ruflo plan`) | b: stored `plain(,500)`; a: `clip(,60)` placeholder and `clip(,columns-24)` line | stored whole (to 10,000), drawn whole with marker; create refused over 2,000 (c, named); over 10,000 refused with the count |
+| Launch args (`/goal-plan` etc.), `shows` | b: `plain(,500)`; a: confirm `plain(,100/200)` | whole goal; confirm shows the whole command |
+| Guide (`mc-guide`), aside (`mc-aside`) | b: 500, newlines dropped | whole to 10,000, guide keeps its line breaks, refusal with count, text kept |
+| Research question | b: 500 live in the field and again on start | whole to 10,000, mirror shown |
+| Loop task / stop | b: 400 on entry, line 600 refused generically | task to 4,000, refusal names the count; stop is a grammar (c) |
+| Mission loop prompt, mission context, `/loop` line in guidance, re-read mission objective | b: 200 / 1000 | whole objective (to 2,000) |
+| Palette query and every text command (task, mission, route, store, search, propose, broadcast, x.ruv.io, memory, vector, security) | b: query `plain(,200)`, then 160-500 per command | query uncut; commands take 8,000 per argument, mission start 2,000; over: refused with the count |
+| Start fields (task, mission) | b: 200, 300; verify compared the cut text | 8,000, 2,000; refusal names the count |
+| ruHelp question, Ask Claude question | b: 300 (three places) | whole to 10,000, refusal with count |
+| AI terminal question | b: 8,000 cut; "ask again" row re-sent 400 | whole to 10,000, ruflo mode 8,000; the row keeps the whole question |
+| Room message / find | b: draft 500, broadcast 160; find 80 | draft whole and shown, find uncut |
+| Hive propose / broadcast | b: 300, 160 | 8,000 |
+| Workflow guidance and message | b: 300 (memory note 500) | 8,000 |
+| Workflow conversation composer, relay | b: 1,500 in the field and the body; relay 1,700 | 8,000; relay never cuts the person's instruction |
+| Workflow template text parameters | b: 160 live | 8,000, the launch refuses over it with the count |
+| Workflow search | c-ish: 80 | 20,000 |
+| Autopilot envelope lists | c: validators that refuse visibly (paths 300, verify parts 300, 24 parts) | unchanged: security validators |
+| Automation task / workflow / history / session, neural lab fields | c: refused over 300 (session name 64) | 8,000 (session name 256, ruflo's limit) |
+| Settings: Mission gates | b: `slice(0,800)` on entry and on load | uncut; `parseGates` refuses a long line or a fifth gate with the reason (c) |
+| Settings: plugin option values | b/c: 200 with a generic refusal | 4,000, refusal names the count; ruflo config values stay a curated charset (c) |
+| Settings search, plugin catalog filter, events query, room find | b: 80, 80, 200, 80 | uncut (events 20,000) |
+| Cost budget draft | b: `slice(0,40)` | uncut; a number outside 0.01-10,000 is refused (c) |
+| Security scan text | b/c: 2,000 and any control character refused | 8,000; line breaks allowed |
+| Vector lab fields | b/c: 200, title 120, content 2,000, doubled spaces refused; SQL prompt 500 | 8,000, title 500, doubled spaces folded; rvlite prompt 10,000 |
+| Memory lab fields | c: 300 and 2,000 | 8,000 |
+| x.ruv.io publish | b: `plain(,500)`; JSON 2,000 | 8,000 |
+| Skills search / create | c: query 64; name 64 | query 512; the name stays 64 (a folder name, c) |
+| Recall explainer prompt | b: 300 and masked, so its digest never matched | whole (display masks a credential-shaped word) |
+| Claude's `console_set` / `console_run` text | b: 500 | 10,000 |
+| ADRs: filter / propose title | c: title cut at 120 silently; objective in the draft cut at 300 | title over 120 refused with the count; draft carries the objective to 2,000 |
+| Page navigation find, menu prompt, wf-export path, `ap-add-*` | no cut / validators that refuse visibly (c) | unchanged |
+
+Labels that stay shortened (a): list rows and buttons (`clip`, `labelOf`), the confirm label ("send Claude: ..."), the menu strip's
+objective beside its progress bar (the Mission Control page shows the objective in full), the task title in a ruflo task (generated from
+the plan, not typed).
+
+## 4. Consequences
+
+- The helpers are the only place a limit is written: hooks/full-text.ts (`checkLimit`, `showFull`, `showTail`, `wrapFull`, `chunksOf`,
+ `keepLines`, `labelOf`, the bounds) and views/full-rows.ts. tests/full-text.spec.ts mutation-checks them; tests/full-text.test.ts
+ drives the real console (1,500-character and 9,500-character goals at three widths and both looks, a 5-line draft, the 12-line cap,
+ a goal over the field's 10,000, a 2,500-character goal that plans but cannot create a mission, a 1,500-character goal created whole).
+- A text over 10,000 characters cannot be put back in its field (the engine would refuse the pane), so such a refusal clears the field.
+- Not verified: the host's own limits on a submitted prompt or slash command (the plugin types document none); the x.ruv.io relay's
+ message limit (the console's 8,000 is its own bound).