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-mods): correct the agentTrim wording after the live measurement (0.3.6)

ruv8e87229606cc
diff --git a/plugins/ruflo-mods/.claude-plugin/plugin.json b/plugins/ruflo-mods/.claude-plugin/plugin.json
index 89ba5ed5e0..eec91df0dc 100644
--- a/plugins/ruflo-mods/.claude-plugin/plugin.json
+++ b/plugins/ruflo-mods/.claude-plugin/plugin.json
@@ -1,7 +1,7 @@
{
"name": "ruflo-mods",
"description": "ruflo as a Claude Code mod (function hooks, ADR-404): in-process prompt routing, edit learning signals, tighten-only tool checks from ruflo policy, the cost-tracker budget ladder, a mod trust gate for newly installed mods, and the $.ruflo noun other mods compose their status with. Opt-in and removable: the classic hook-handler hooks stay the default and take every event back whenever the mod is not loaded.",
- "version": "0.3.5",
+ "version": "0.3.6",
"author": {
"name": "ruvnet",
"url": "https://github.com/ruvnet"
@@ -57,7 +57,7 @@
"agentTrim": {
"type": "boolean",
"title": "Hide unused agent types",
- "description": "Keep agent types the project does not use out of the model's agent listing and dispatch, to save prompt tokens. Always kept: built-in agents, coder, reviewer, tester, planner, researcher, any type used in the last 30 days, any named in the prompt or in agentTrimKeep. Off by default.",
+ "description": "Keep agent types the project does not use out of the model's agent listing, to save prompt tokens (measured about 4,000 fewer per request with 59 of 69 types hidden). A hidden type the prompt does not name is also refused when spawned. Always kept: built-in agents, coder, reviewer, tester, planner, researcher, any type used in the last 30 days, any in agentTrimKeep. A type named in the prompt can still be spawned, but in a headless session it is not added back to the listing: use agentTrimKeep to keep one reliably. Off by default.",
"required": false,
"default": false
},
diff --git a/plugins/ruflo-mods/hooks/agents/index.ts b/plugins/ruflo-mods/hooks/agents/index.ts
index 3dc718b387..f413e78adc 100644
--- a/plugins/ruflo-mods/hooks/agents/index.ts
+++ b/plugins/ruflo-mods/hooks/agents/index.ts
@@ -12,8 +12,8 @@ const LEDGER = 'agentUse'
* on. A type stays when it is built in, a pinned core role, named in
* `agentTrimKeep`, used in the last 30 days (the `$.store` ledger, fed by
* `agent.spawn`), or named in the current prompt. Tighten-only on what the
- * model sees (not a dispatch block: live, a hidden type still spawns by name; the listing is built before the first prompt in a headless session,
- * so a prompt naming a type does not keep it there). Any failure offers the type (the hook is skipped).
+ * model sees (measured live, 2026-10: a hidden type the prompt does NOT name is refused at dispatch, one the prompt names plainly is accepted; the
+ * listing is built before the first prompt in a headless session, so a prompt naming a type does not put it back in the listing there). Any failure offers the type (the hook is skipped).
*/
export function registerAgents(on: On, state: ModState, options: ModOptions) {
state.agentTrim.enabled = true
diff --git a/plugins/ruflo-mods/scripts/smoke.sh b/plugins/ruflo-mods/scripts/smoke.sh
index 2b63b58a14..ea4226ac1a 100755
--- a/plugins/ruflo-mods/scripts/smoke.sh
+++ b/plugins/ruflo-mods/scripts/smoke.sh
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# Structural + security smoke for ruflo-mods v0.3.5 (ADR-404, ADR-447).
+# Structural + security smoke for ruflo-mods v0.3.6 (ADR-404, ADR-447).
# Static only: CI has no Claude Code, so the hooks module's behaviour is held
# by v3/@claude-flow/cli/__tests__/mods/*.test.ts and, where function hooks are
# on, by `claude plugin test plugins/ruflo-mods`.
@@ -12,9 +12,9 @@ ok() { printf "PASS\n"; PASS=$((PASS+1)); }
bad() { printf "FAIL: %s\n" "$1"; FAIL=$((FAIL+1)); }
HOOKS="$ROOT/hooks"
-step "1. plugin.json declares ruflo-mods 0.3.5"
+step "1. plugin.json declares ruflo-mods 0.3.6"
grep -q '"name": "ruflo-mods"' "$ROOT/.claude-plugin/plugin.json" \
- && grep -q '"version": "0.3.5"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version"
+ && grep -q '"version": "0.3.6"' "$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/v3/docs/adr/ADR-452-mod-system-overnight-hardening.md b/v3/docs/adr/ADR-452-mod-system-overnight-hardening.md
index b6dddbec2a..3d53f593ee 100644
--- a/v3/docs/adr/ADR-452-mod-system-overnight-hardening.md
+++ b/v3/docs/adr/ADR-452-mod-system-overnight-hardening.md
@@ -51,9 +51,9 @@ Still not covered by the corpus: the policy rules of the five policy-only or obs
Same class as 2.1, found by the extended probe: a work limit that returns "nothing found" is a fail-open. The rule it taught, applied in #3734: when a limit is hit, refuse. The agentdb guard already did (#3728).
-### 2.5 `agentTrim` hides from the listing only (#3733, merged)
+### 2.5 `agentTrim` and dispatch (#3733, merged; corrected by the measurement in the trim-measure PR)
-A live headless run of `ruflo-mods` 0.3.1 showed `agentTrim` removes unused agent types from the listing, not from dispatch: a hidden type could still be spawned by name. The text in the option and in the #3729 description said "listing and dispatch", which was wrong; #3733 corrects it (0.3.2, no behaviour change). Also found: a type named in the prompt is not reliably kept in a headless session, because the listing is built before the first prompt; `agentTrimKeep` is the reliable way. Interactive sessions were not tested.
+A live headless run of `ruflo-mods` 0.3.1 appeared to show that `agentTrim` removes unused agent types from the listing only and that a hidden type could still be spawned by name. **That was too broad.** The follow-up measurement (`v3/docs/validation/ruflo-mods-trim-measure-2026-10.md`) found the spawn in the first run had named the type in its prompt, which keeps it at dispatch: with trim on, a hidden type the prompt does not name is refused ("Agent type ... not found"), and one the prompt names plainly is accepted. The measured saving is 4,236 prompt tokens per request with 59 of 69 types hidden. The text in the option and in the #3729 description said "listing and dispatch", which was wrong; #3733 corrects it (0.3.2, no behaviour change). Also found: a type named in the prompt is not reliably kept in a headless session, because the listing is built before the first prompt; `agentTrimKeep` is the reliable way. Interactive sessions were not tested.
### 2.6 Version-collision hazard when merging concurrent PRs
diff --git a/v3/docs/validation/ruflo-mods-live-2026-10.md b/v3/docs/validation/ruflo-mods-live-2026-10.md
index 2269f42aa7..7dda17f0ff 100644
--- a/v3/docs/validation/ruflo-mods-live-2026-10.md
+++ b/v3/docs/validation/ruflo-mods-live-2026-10.md
@@ -44,7 +44,7 @@ The ledger is `$.store`: `~/.claude/plugins/store/ruflo-mods_inline-<hash>.json`
### Two claims the live runs contradict (text corrected in 0.3.2; no behaviour changed)
-1. **A hidden type can still be dispatched.** With `agentTrim` on and `quokka-analyst` hidden, `Call the Agent tool ... subagent_type "quokka-analyst"` replied `ACCEPTED`, ran, and the ledger afterwards held `{"agentUse": {"quokka-analyst": 1791174198156}}`, so it is kept from then on. The option text said "listing and dispatch"; it is the listing only.
+1. **A hidden type can still be dispatched (CORRECTION 2026-10-05: only when the prompt names it; see `ruflo-mods-trim-measure-2026-10.md`, where an unnamed hidden type was refused).** With `agentTrim` on and `quokka-analyst` hidden, `Call the Agent tool ... subagent_type "quokka-analyst"` replied `ACCEPTED`, ran, and the ledger afterwards held `{"agentUse": {"quokka-analyst": 1791174198156}}`, so it is kept from then on. The option text said "listing and dispatch"; it is the listing only.
2. **"Named in the prompt" does not keep a type in a headless session.** `Is quokka-analyst available? ... list` answered `No` and the type stayed hidden (3 hidden); a second experiment (`Say hi`, list, then a prompt naming it plus the list) hid it in both lists. The listing is built before the first prompt and not rebuilt, so `agent.offer` runs before `prompt.submit` can record the prompt. Not tested: an interactive session (it may rebuild the listing). Use `agentTrimKeep` to be sure.
## 3. /ruflo-mods