v3.65.0 — Claude Code mods integration: gaming-resistant learning, compaction carry, plugin trust, gateway budgets
- Learning-loop gaming defences: verified-success turns are tainted when they edit tests, edit a verifier's config, or run a narrowed or weakened check
- Tainted learning-loop records never train unless their classes are listed in learningLoop.allowTaint in .claude-flow/config.json behavior changed · inferred, marked in the notes below
- Opt-in rotating re-verify step (learningLoop.reverify, off by default) that re-runs an allowlisted check in a temporary worktree
- Anomaly gate that holds back lessons whose evidence looks gamed
- Manual, paid learning-loop evaluation harness at scripts/eval-learning-loop.mjs
- Real-binary test tier that runs the claude binary with ruflo-mods against a scripted mock of the Anthropic Messages API, runnable as CI job mods-real-binary and via npm run test:real-binary
- compactSnapshot ruflo-mods option (default on) that saves a screened transcript to rotating slots under .claude-flow/sessions/compactions/ before compaction
- After compaction, a bounded [RUFLO_AFTER_COMPACT] block is added with recent lessons and outcomes, open swarm and claim ids, and the snapshot path
- ruflo doctor --component compact-snapshots warns when snapshots exist but .claude-flow/ is not gitignored
- Plugin secrets read through a shared readSecret helper for cost-tracker, metaharness and x-gateway plugins, checking the masked plugin option before falling back to the environment
- scripts/audit-plugin-secrets.mjs CI gate that fails on secret-named options not marked sensitive and on literal secrets in manifests
- scripts/measure-plugin-footprint.mjs reports plugin footprint, with before and after numbers in v3/docs/validation/
- Cost budget windows stored in .claude-flow/cost/budget.json, written by ruflo cost budget set
- ruflo cost budget export --gateway litellm [--apply] produces LiteLLM budget_limits and per-model budget fallbacks, requiring HTTPS except on loopback and reading the key from an environment variable only
- ruflo cost report breaks spend down by agent and by tool
- ruflo-mods costLedger option (default on)
- --gateway meta-llm refuses to run until meta-llm documents a budget API
- Plugins carry Ed25519 signature.json manifests signed with the existing helpers key
- ruflo plugins verify checks a plugin against its manifest and reports verified, modified, unsigned or bad-signature
- Static scan runs before mods install, init or plugins install, stopping on high findings unless --accept-risk <plugin> is passed behavior changed · inferred, marked in the notes below
- ruflo init stops on risky project auto-approve keys, with --keep-risky-settings and --drop-risky-settings to continue behavior changed · inferred, marked in the notes below
- Under modTrust: refuse-risky, a modified ruflo plugin is refused
- resolvePluginPaths finds ruflo plugins in a local checkout, the marketplace clone or the install cache
- Headless claude -p workers receive --plugin-dir for ruflo-mods automatically
- ruflo plugins paths [--json] prints resolved plugin folders for Agent SDK callers
- ruflo doctor --component headless-plugins checks headless plugin setup
- Operational skills are now user-invoked only (disable-model-invocation: true) behavior changed · inferred, marked in the notes below
- Long skill and command descriptions are trimmed to one sentence, with a ceiling enforced by an audit
4 changes to check, marked in the notes below
From ruflo
Minor release: @claude-flow/cli, claude-flow, ruflo 3.65.0, plus ruflo-mods plugin 0.12.0. This release ships the eight follow-ups to #4581 on how ruflo integrates with Claude Code mods (ADR-503 to ADR-510, #4585).
Added
-
Learning-loop gaming defences (ADR-503, #4590).
- A verified-success turn is tainted when it edited tests (
edited-tests), edited a verifier's config (edited-verifier-config), or ran a narrowed or weakened check (narrowed-verifier). - Tainted records never train unless
.claude-flow/config.jsonlearningLoop.allowTaintlists their classes. behavior changed · inferred - An opt-in rotating re-verify step (
learningLoop.reverify, off by default) re-runs an allowlisted check in a temporary worktree. - An anomaly gate holds back lessons whose evidence looks gamed.
scripts/eval-learning-loop.mjsis a manual, paid evaluation harness.
- A verified-success turn is tainted when it edited tests (
-
Real-binary test tier (ADR-504, #4589). This runs the real
claudebinary with ruflo-mods against a scripted mock of the Anthropic Messages API, with no API key needed. The contracts check that:- every mod loads;
- the learning loop records outcomes;
- lessons reach the model;
- the guard denies risky commands;
- route context is added.
It runs as the CI job
mods-real-binaryand asnpm run test:real-binary. -
compactSnapshot(ruflo-mods option, default on; ADR-505, #4591).- Before compaction, the mod saves a screened transcript to rotating slots under
.claude-flow/sessions/compactions/. - After compaction, it adds one bounded
[RUFLO_AFTER_COMPACT]block with recent lessons and outcomes, open swarm and claim ids, and the snapshot path. ruflo doctor --component compact-snapshotswarns when snapshots exist but.claude-flow/is not gitignored.
- Before compaction, the mod saves a screened transcript to rotating slots under
-
Plugin secrets via
userConfigsensitive: true(ADR-506, #4587).- The cost-tracker, metaharness and x-gateway plugins read their keys through a shared
readSecrethelper. It checks the masked plugin option first and falls back to the environment. - A new
scripts/audit-plugin-secrets.mjsCI gate fails on secret-named options that are not marked sensitive, and on literal secrets in manifests.
- The cost-tracker, metaharness and x-gateway plugins read their keys through a shared
-
Plugin footprint cut (ADR-507, #4588).
- Operational skills are user-invoked only (
disable-model-invocation: true). behavior changed · inferred - Long skill and command descriptions are trimmed to one sentence, with a ceiling enforced by an audit.
scripts/measure-plugin-footprint.mjsreports the result, with before and after numbers inv3/docs/validation/.
- Operational skills are user-invoked only (
-
Cost budgets that can feed a gateway (ADR-508, #4592).
.claude-flow/cost/budget.jsonholds the budget windows.ruflo cost budget setwrites it.ruflo cost budget export --gateway litellm [--apply]produces LiteLLMbudget_limitsand per-model budget fallbacks.--applyrequires HTTPS except on loopback, and reads the key from an environment variable only.ruflo cost reportbreaks spend down by agent and by tool.- New ruflo-mods option
costLedger(default on). --gateway meta-llmrefuses until meta-llm documents a budget API.
-
Plugin trust (ADR-509, #4593).
- Plugins carry Ed25519
signature.jsonmanifests, signed with the existing helpers key. ruflo plugins verifychecks a plugin against its manifest and reports verified, modified, unsigned or bad-signature.- A static scan runs before
mods install,initorplugins install. A high finding stops the install unless you pass--accept-risk <plugin>. behavior changed · inferred ruflo initstops on risky project auto-approve keys (enableAllProjectMcpServers,bypassPermissions, wildcard Bash and others).--keep-risky-settingsand--drop-risky-settingslet you continue. behavior changed · inferred- Under
modTrust: refuse-risky, a modified ruflo plugin is refused.
- Plugins carry Ed25519
-
Headless plugin staging (ADR-510, #4586).
resolvePluginPathsfinds ruflo plugins in a local checkout, the marketplace clone or the install cache.- Headless
claude -pworkers now get--plugin-dirfor ruflo-mods automatically. ruflo plugins paths [--json]prints the resolved folders for Agent SDK{ type: "local", path }callers.ruflo doctor --component headless-pluginschecks this setup.
Not yet
- Per-skill trimming (
skillTrim) was not built: Claude Code exposes no hook that hides a skill from the model's list. - The 30-task learning-loop evaluation from #4581 §7 has still not been run. The loop stays on by default, as the maintainers decided in ADR-502 §6.
Install: npx ruflo@3.65.0 (@claude-flow/cli and claude-flow are 3.65.0 too; latest, alpha and v3alpha all point here). The ruflo-mods plugin (0.12.0) ships through the ruflo plugin marketplace.
Full write-up: https://gist.github.com/ruvnet/6865bcf7870388767fbc51db8f9c9c98 · tracking issue #4594