1321 Commits
Author SHA1 Message Date
randRuFlo 9b46f57c58 feat(metaharness): @metaharness/darwin as a regular dependency, used in-process (ADR-526); release 3.74.0
- darwin moves to dependencies (ADR-526 amends ADR-150 rule 2 for darwin
  only); the smoke gate, doctor check and clean-install test accept it.
- src/metaharness/darwin-lib.ts: cached import; metaharness_bench verify and
  every metaharness_gepa op run in-process with the scripts' exact payloads
  and exit codes, falling back to the scripts when darwin does not import.
- ruflo-metaharness 0.5.0: bench.mjs verify imports darwin directly (bare
  import, no tool-time install) and falls back to the installed darwin CLI.
- Parity test vs the plugin scripts; benchmark script + measured runs.
- Version 3.74.0.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-08 22:01:25 -05:00
rUvandr 657a4ff81c feat(funnel): count plugin-only users via the ruflo-core MCP launch (#4872)
* feat(funnel): count plugin-only users via the ruflo-core MCP launch

Plugin-only users never run init, so no SessionStart hook refreshes the
funnel cache and they are invisible in the usage numbers. The ruflo-core
launcher now sets RUFLO_LAUNCH_SURFACE=plugin; mcp start (stdio) makes the
existing 6h-cached /v1/messages fetch off the start path, gated on
resolveFunnelEnabled(), and the User-Agent gains ' surface/plugin' from a
closed allowlist. Nothing is written to stdout. LIA updated.

Co-Authored-By: RuFlo <ruv@ruv.net>

* fix(ruflo-core): keep RUFLO_MCP_SPAWN inside the env-precedence audit window

The four-line insertion pushed the existing RUFLO_MCP_SPAWN read past the
audit's 20-line function-signature heuristic. Collapse it to one line and
move the explanation to the header comment.

Co-Authored-By: RuFlo <ruv@ruv.net>

---------

Co-authored-by: r <r@x>
2026-11-06 15:00:01 -06:00
rUvandr adef54c386 chore(ruflo-console): Vector Lab pin follows ruflo-ruvector to ruvector 0.3.13 (0.49.13) (#4856)
Readers checked against 0.3.13 output (hooks stats, hooks route, rvf
examples, identity show): same shapes as 0.3.12. Console smoke 21/21;
claude plugin test 255/260, the same 5 mission-control / compact-nav /
goal-length failures as on main (noted in #4842), none in the vector page.

Co-authored-by: r <r@x>
2026-11-06 07:28:20 -06:00
rUvandr b9f32453f3 feat(plugins): agentdb 3.4, ruvllm 4.1 runtime, sublinear-core, injection guard in plugins + marketplace pins (#4843)
* feat(plugins): ecosystem releases in agentdb, ruvllm, aidefence, intelligence, graph-intelligence + marketplace pins

ruflo-ruvllm 0.4.0: new ruvllm-runtime skill telling apart ruvllm-wasm (MCP
tools), @ruvector/ruvllm ^4.1.0 (restored SonaCoordinator/LoraAdapter/
TrainingPipeline runtime) and @ruvector/ruvllm-gpu-loop 1.1.x; warns off the
wrong-repo 4.0.x. ruflo-agentdb 0.4.12: agentdb 3.4 capabilities (pathfinder
dynamic-mincut, AGENTDB_INJECTION_GUARD, where RaBitQ lives for ruflo), and
the agentdb-specialist ruvector pin line from #4842. ruflo-aidefence 0.3.4:
agentdb guard + agentic-flow prompt_injection_scan. ruflo-intelligence 0.4.6:
learning-wasm / ruvllm 4.1 backends, links lora-learning and fast-code-edits.
ruflo-graph-intelligence 0.3.0-alpha.1: declared solver dep
sublinear-time-solver -> @ruvnet/sublinear-core (never imported; lockfile
1,015 -> 77 packages; tsc + vitest 104/104), new sublinear-core skill,
supply-chain allowlist updated.

Marketplace: external agentdb -> plugin-v3.4.0 (agentdb@3.4.0); external
agentic-flow -> aa5b11e (plugin 3.3.0, agentic-flow@3.3.0, ecosystem tools).

ruflo-ruvector is left to #4842; additions on top follow after it merges.
The six CLI ecosystem skills are linked, not duplicated; no v3/ changes.

Co-Authored-By: claude-flow <ruv@ruv.net>

* fix(plugins): keep the two new skill descriptions under 300 chars (ADR-507)

Co-Authored-By: claude-flow <ruv@ruv.net>

---------

Co-authored-by: r <r@x>
2026-11-06 07:28:16 -06:00
rUvandr 459dea5a55 feat(ruflo-ruvector): pin ruvector 0.3.13 — DiskANN CLI/MCP, RaBitQ hook recall; drop MCP tools the server never had (0.4.1) (#4855)
Follows #4842. Smoke 14/14 against 0.3.13; DiskANN build + search round
trip run with the diskann extra. 0.3.13 registers 118 MCP tools (adds
diskann_build, diskann_search) and moves to @ruvector/attention ^2.2.3
(GHSA-p62c-q7fc-qmg9) and @ruvector/sona ^0.1.11. The agent listed
sona_*, attention_* and gnn_* MCP tools that ruvector never registered;
they are CLI-only. Documents ruvector add extras and
RUVECTOR_RABITQ_THRESHOLD. Removes the benchmark limitation, which no
longer reproduces.

Co-authored-by: r <r@x>
2026-11-06 07:17:36 -06:00
randRuFlo 357c06dfa0 test(plugins): smoke contracts expect ruflo-agentdb 0.4.12 and ruflo-browser 0.3.8
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-05 22:42:49 -05:00
randRuFlo 13432299e5 fix(plugins): keep history in comments, hint on an uncached pin, scope the verified claim
- browser-session-tools / neural-tools: comments keep the versions they
  describe (#2015 was found on 0.2.25; ONNX bundled since 0.2.27). The
  embedder label no longer hardcodes a version the ^0.3.11 range may not
  resolve to.
- Console vector page: npx --offline with only an older pin cached printed a
  bare ENOTCACHED. The result now starts with the command that fixes it.
  Spec added.
- ruflo-ruvector README: the "since 0.3.3" table says which rows were run.
  The two MCP gates were exercised over stdio (refused without the variable,
  allowed with it); 0.3.10/0.3.11 come from release notes. /vector-setup says
  to re-register the server after upgrading.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-05 22:29:05 -05:00
randRuFlo 8ecb115eef chore(ruflo-agentdb): 0.4.12 for the ruvector pin note
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-05 22:21:11 -05:00
randRuFlo 4ed8aa3926 feat(plugins): move ruflo-ruvector, ruflo-browser and the console vector page to ruvector 0.3.12
The CLI has depended on ruvector ^0.3.11 since #4838. The plugins still pinned
older releases: 0.3.3 in ruflo-ruvector and the console vector page, and
0.2.27/0.2.25 in ruflo-browser and the CLI's browser-session npx fallback.
0.3.3 predates the 0.3.4 MCP security hardening.

- Every pinned command was run against 0.3.12: the ruflo-ruvector smoke
  (14/14), the console vector page's read commands, and the browser-session
  rvf + trajectory argv.
- Fix the ruflo-browser agent and browser-record recipes. They passed
  --session-id/--task/--args/--verdict to `hooks trajectory-*`, which no
  ruvector release accepts. They now use the argv the browser_session_* MCP
  tools already use.
- ruflo-ruvector README: a "What changed since 0.3.3" table (MCP env gates,
  per-project store, CRUD, `ruvector add`, rvf lock fix, graph-mincut fix),
  a re-verified limitations table, and the correct ADR link and tool count.
  /vector-setup documents RUVECTOR_MCP_ALLOW_INIT and RUVECTOR_MCP_ROOTS.
- Versions: ruflo-ruvector 0.4.0, ruflo-browser 0.3.8, ruflo-console 0.49.12.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-05 22:20:36 -05:00
rUvandr 29b327ee5f feat(cli,codex): ecosystem integrations + skills; darwin ^0.13.0, ruvllm ^4.1.0; release 3.72.1 (#4838)
* feat(cli,codex): wire ecosystem packages into real code paths + ecosystem skills

Every integration here has a reachable path (optional dep or lazy import,
graceful fallback) and a test that drives the real package.

- @ruvector/learning-wasm 0.1.29 (new optional dep): it was imported by
  ruvector-training.ts, neural.ts and ruvector/index.ts but never declared,
  so MicroLoRA always ran on the JS fallback. Now initializeTraining()
  reports backend 'wasm'; `neural benchmark` measures ~2 us/adaptation at
  256-dim. The benchmark's attention section (broken against
  @ruvector/attention 2.x) no longer aborts the MicroLoRA numbers.
- ruvector ^0.2.27 -> ^0.3.11. ruvector 0.3 ships @ruvector/mincut-wasm and
  its DynamicMinCut wrapper. New ruvector/mincut-bridge.ts folds duplicate and
  reversed edges (the solver rejects them) and backs:
  - agentdb_graph-pathfinder `dynamic-mincut`, previously a k-hop stub: exact
    min cut of the seed's depth-hop neighbourhood, returns the seed's side
    plus cut metadata (cutValue, cutEdges, backend). JS Stoer-Wagner
    fallback for neighbourhoods <= 300 nodes.
  - graph-analyzer loadRuVector(), which probed a nonexistent
    ruvector.hooks_graph_mincut and @ruvector/wasm GraphAnalyzer. Measured
    187 ms vs 6 s (JS) at 1,000 nodes, same cut value.
  spectral-sparsify / connected-component-churn stay k-hop approximations
  and now say so in the response (`implementation`).
- @ruvector/rabitq-wasm 0.1.0 -> 0.1.2: ruvector 0.3.11 declares an optional
  peer >=0.1.1, and npm raises ERESOLVE against an exact 0.1.0 pin. Same API.
- agent-booster ^0.2.2 (new optional dep) backs a new hooks_fast-apply MCP
  tool: merges a code snippet into a file or string (~ms, no LLM), with
  project-root and symlink containment, dryRun and minConfidence. ADR-143
  is respected: it is an applier for caller-supplied snippets, not a Tier-1
  intent engine. The appliance bridge's tier-1 hint, labelled
  'agent-booster' while being two regexes, is now labelled 'codemod' and
  points at hooks_codemod. Path-containment helpers move from hooks-tools.ts
  to realpath-containment.ts so both tools share them.
- ast-analyzer / diff-classifier / coverage-router imported @ruvector/ast,
  @ruvector/diff, @ruvector/coverage, which were never published (npm 404).
  ruvector 0.3's ASTParser needs native tree-sitter and is async-only;
  parseDiff / parseIstanbulCoverage are plain JS equivalent to the local
  parsers. The phantom imports are removed rather than swapped for a no-op hop.
- Skills: six new Claude Code skills (vector-quantization, graph-mincut,
  sublinear-solver, injection-defense, fast-code-edits, lora-learning) in a
  new SKILLS_MAP.ecosystem group, installed by default `ruflo init`
  (`init skills --ecosystem`), and the Codex equivalents bundled in
  @claude-flow/codex .agents/skills (built-in, installed by --full).
  @claude-flow/codex 3.0.5 -> 3.0.6.
- no-cli-optdep-bloat-2561 guard: CLI_MAX 13 -> 17 and learning-wasm off the
  FORBIDDEN list, with cold-install measurements (learning-wasm 0.38 s / 1
  pkg / 104K; agent-booster 0.98 s / 67 pkgs / 5.8M).

Evaluated and not wired: sublinear-time-solver as a PPR accelerator (its
computePageRank took 1.2 s at 500 nodes and 68 s at 2,000, vs ms for the
built-in power iteration; 184 deps / 123 MB), strange-loops (pulls the same
tree), @ruvector/kge, @ruvector/cnn, @ruvector/rvlite, @ruvector/graph-wasm,
@ruvector/emergent-time, agentic-jujutsu, @ruvector/pi-brain (no existing
caller doing the job badly); @ruvector/diskann (see the memory PR).

Co-Authored-By: claude-flow <ruv@ruv.net>

* fix(deps): bound @ruvector/ruvllm away from the broken 4.0.x; ruvector override to ^0.3.11

@ruvector/ruvllm 4.0.0/4.0.1 were published from the wrong repository: an
ESM-only GPU-loop harness with no main entry and none of SonaCoordinator,
ContrastiveTrainer, TrainingPipeline or LoraAdapter. The open `>=2.6.0`
ranges in the root and ruflo overrides and the v3 pnpm.overrides let it
resolve, and every createRequire('@ruvector/ruvllm') caller (intelligence.ts,
sona-optimizer.ts, native-training.ts) then fell back to JS silently.

- root/ruflo overrides, v3 pnpm.overrides, providers peer:
  `>=2.6.0 <4.0.0 || ^4.1.0` (2.6-3.x all export the four classes; 4.1.0 is
  the restored runtime). Narrow to ^4.1.0 once it is on the registry.
- root/ruflo overrides: ruvector ^0.2.41 -> ^0.3.11. agentdb 3.3.0 itself
  depends on ruvector ^0.3.5 and the CLI now on ^0.3.11, so the old override
  forced both below their own ranges inside this repo's tree.
- ruflo overrides: agentdb `>=3.3.0` -> `^3.3.0`, agentic-flow `>=2.0.14` ->
  `^2.0.14 || ^3.0.0` (no open-ended ecosystem ranges).
- providers/src/__tests__/ruvllm-runtime-contract.test.ts loads the installed
  package through createRequire, asserts the four classes, constructs a
  SonaCoordinator the way the CLI does, and checks the resolved version is in
  range. Against 4.0.1, require() itself fails (no CJS entry).

Co-Authored-By: claude-flow <ruv@ruv.net>

* test: run ecosystem and ruvllm contract tests where the packages are installed

ci.yml's repo-root npm layout does not install the CLI's optional
dependencies, so those blocks skip there; the pnpm workspace that Test V3
Packages uses installs every one of them, so they run. The probe walks
node_modules only up to the repository root. A @ruvector/ruvllm that is
installed but does not load through require() still fails, and says which
copy and why.

Co-Authored-By: claude-flow <ruv@ruv.net>

* fix(umbrella): claude-flow carries the CLI's new optional deps; rabitq-wasm 0.1.2

The claude-flow umbrella ships the CLI dist with its own dependency list.
With @ruvector/rabitq-wasm pinned at 0.1.0, npm could not hoist ruvector 0.3
(optional peer rabitq-wasm >=0.1.1) and nested it under agentdb/agentic-flow,
so the umbrella's copy of the CLI could not import('ruvector') and the mincut
path was dead there. rabitq-wasm -> 0.1.2 (same API) puts ruvector back at
the top level; ruvector ^0.3.11, @ruvector/learning-wasm 0.1.29 and
agent-booster ^0.2.2 join the umbrella's optionalDependencies so the WASM
MicroLoRA, min-cut and fast-apply paths are reachable from npx claude-flow too.

Co-Authored-By: claude-flow <ruv@ruv.net>

* fix(security): @metaharness/darwin ^0.13.0 (GHSA-mjwg-5fm3-fx2p), metaharness ^0.4.20

@metaharness/darwin 0.13.0 fixes a high-severity sandbox bypass
(GHSA-mjwg-5fm3-fx2p); the CLI's `~0.12.0` could never resolve it.

- cli optionalDependencies @metaharness/darwin ~0.12.0 -> ^0.13.0; peer
  metaharness ^0.4.1 -> ^0.4.20
- distill-oracle MH_DARWIN_PIN 0.12.0 -> 0.13.0 (npx tier-1 oracle calls)
- ruflo-metaharness helper pins: _darwin.mjs ~0.12.0 -> ~0.13.0,
  _harness.mjs ~0.4.1 -> ~0.4.20 (tilde, as check-metaharness-pins requires);
  plugin 0.4.0 -> 0.4.1

Checked against 0.13.0 before bumping (0.x minor): same exports
(., ./contrastive, ./gepa), same metaharness-darwin verbs ruflo surfaces
(evolve, evolve-numeric, bench create|verify, security bench), and the gepa
library calls (loadCand6Genome, validateGenome, buildSystemFromGenome)
return identical results to 0.12.0. Tier-2 evolution now runs in an isolated
child process upstream; ruflo already drives darwin as a subprocess. Note:
0.13.0 adds one runtime dependency (@babel/parser), where 0.12 had none.
check-metaharness-pins, metaharness-clean-install-test and the CLI's
metaharness/distill/darwin tests (80) pass.

Co-Authored-By: claude-flow <ruv@ruv.net>

* fix(deps): @ruvector/ruvllm ^4.1.0 now that the restored runtime is published

4.1.0 is the dual CJS/ESM runtime again. Root and ruflo overrides, v3
pnpm.overrides and the providers peer move from `>=2.6.0 <4.0.0 || ^4.1.0`
to `^4.1.0`; both lockfiles now resolve 4.1.0. The contract test requires
>=4.1 <5 and passed against 4.1.0 (SonaCoordinator, ContrastiveTrainer,
TrainingPipeline, LoraAdapter, DEFAULT_SONA_CONFIG; SonaCoordinator
constructs), as did the CLI's neural-status/trajectory/learning tests.

Co-Authored-By: claude-flow <ruv@ruv.net>

* release: 3.72.1

@claude-flow/cli, claude-flow and ruflo 3.72.1 (ruflo pins cli 3.72.1),
carrying the ecosystem integrations, @claude-flow/memory 3.2.3, codex 3.0.6,
@ruvector/ruvllm ^4.1.0 and @metaharness/darwin ^0.13.0.

Co-Authored-By: claude-flow <ruv@ruv.net>

* fix(metaharness): tilde-pin darwin ~0.13.0; smoke expects plugin 0.4.1

ruflo-metaharness smoke step 17z73 enforces tilde pins for @metaharness/*
(ADR-150 review: tilde stays on one minor). ~0.13.0 admits the same versions
as ^0.13.0 on a 0.x line and still resolves the GHSA-mjwg-5fm3-fx2p fix.
Smoke step 1 hard-codes the plugin version; it moves to 0.4.1 with the bump
that plugin-version-bump requires. smoke.sh: 128/128 locally.

Co-Authored-By: claude-flow <ruv@ruv.net>

---------

Co-authored-by: r <r@x>
2026-11-05 20:50:18 -06:00
randRuFlo 7c0ad84e5e fix(cost-tracker): warm an npx CLI once before parallel subchecks; a failed CLI read is an error (#4711)
cost-health started four subchecks at once, each running
npx -y @claude-flow/cli@latest. With a cold npm cache the four first
installs raced in one ~/.npm/_npx directory and left a broken install. Its
memory reads then exited 1, and budget/_sessions read that as no data, so
the budget check reported "no budget set" and Case 2 of the integration
test failed about half the time.

- health.mjs resolves the CLI once, serially, when it comes from npx
  (HEALTH_SKIP_WARMUP=1 skips it).
- A non-zero memory list is reported as an error with the CLI's stderr
  (exit 2) by budget, burn, anomaly and projection.
- New test-cli-failure-4711.mjs, in smoke step 48 and the CI workflow; the
  integration test runs with RUFLO_DAEMON_AUTOSTART=0.
- ruflo-cost-tracker 0.31.2.

Closes #4711

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-05 17:52:20 -05:00
randRuFlo 704330e488 fix(cli): reuse an identical corrupt-store backup; bump workflows 0.7.2 and plugin-creator 0.4.5
Polling a corrupt store made a new .corrupt-<ts> copy on every read (#4779
review). A backup with identical bytes is now reused.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-05 09:53:38 -05:00
r 4ea572a9d3 Merge PR #4797 2026-11-05 09:52:45 -05:00
r 1bac85340b Merge PR #4796 2026-11-05 09:52:45 -05:00
chaitanya-y20 13af5f1208 chore(plugins): give every plugin manifest a repository field
44 of the 48 `plugins/*/.claude-plugin/plugin.json` manifests had no
`repository`, while the four that do already point at the repo URL their
`homepage` names. The field is what the directory listing and
`npm view` read, and its absence is invisible until something reads it.

Add it to the 44 that lack it, then make `scripts/audit-plugin-manifest.mjs`
enforce it so the next plugin cannot ship without one:

- check 6 in the script header, the violation in `auditManifest`, and the
  clean-run summary line. A manifest may carry the repository as a string or
  as an object's `url`; anything else is reported as missing, and a value that
  is not an http(s) URL is reported separately.
- the required-field lists in `create-plugin` and `validate-plugin` skills, so
  a scaffolded plugin passes the gate it is told to satisfy.

Verified with the repo's own gates:

- `node scripts/audit-plugin-manifest.mjs` scans 48 manifests, clean.
- removing the field from one manifest reports `repository field: missing or
  empty` and exits 1; setting it to `ruvnet/ruflo` reports `repository is a URL`
  and exits 1; restoring it exits 0.
- `node scripts/check-plugin-manifests.mjs` is unchanged by this diff (its two
  nested-manifest findings belong to `ruflo-ai-team/directory` and
  `ruflo-x-gateway/directory`, which this change does not touch).
- `node scripts/audit-plugin-secrets.mjs` clean, 48 manifests.

No plugin version is bumped: the installed artifact's behaviour does not change
and no user-visible surface reads the field from an installed copy, so there is
nothing for a version bump to deliver. The `Plugin version bump` workflow will
flag the 44 manifests it sees as shipped files, and this PR needs the
`skip-plugin-version-check` label rather than 44 unrelated version bumps that
would collide with each plugin's own release cadence.

Closes #4774
2026-11-05 09:25:38 +05:30
Doomguy d50f5b6fa1 docs: document GAIA critic and decomposition diagnostics 2026-11-05 06:50:04 +03:00
Doomguy 7b2e1b3ce0 docs: add the ruRE plugin guide 2026-11-05 06:18:42 +03:00
rUv 8b132881ae Merge pull request #4791 from ruvnet/fix/untrusted-project-context
fix(hooks): ignore repo-committed learning data; label surfaced notes as project data
2026-11-04 21:10:17 -06:00
randRuFlo f91135144b fix(hooks): ignore repo-committed learning data; label surfaced notes as project data
.claude-flow/data stores committed to a cloned repository are no longer read
as this machine's learned patterns or synced into the user's Claude Code
memory, and are never rewritten. Surfaced entries are flattened to one line
(control, bidi and zero-width characters removed) and the block ends with a
line saying they are project notes, not instructions. Same change in the
generated fallback helper and the ruflo-mods routeContext block (0.16.2).
Helper manifest re-signed.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-04 21:53:45 -05:00
randRuFlo 825ce061d5 fix(x-gateway): key per-IP limits on the trusted forwarding address
Rate limits and the Seraphina/GitHub allowances keyed on the leftmost
X-Forwarded-For entry. They now use the same trusted-chain derivation as
registration (shared client-ip module). Gateway 0.9.2, plugin 0.10.3.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-04 21:41:09 -05:00
Michael ValderramaandMichael Valderrama 5c44615e78 fix(cost-tracker): count each Claude Code response once in track and session (#4688)
* fix(cost-tracker): count each Claude Code response once in track and session

Claude Code writes one assistant line per content block and repeats the response's usage on each, so summing lines counts a response once per block. Key responses by message.id + requestId, as _ledger.mjs already does, and price each once.

* chore(cost-tracker): bump to 0.31.1; use a counter in the test fixture

The double-count fix changes shipped scripts, so the plugin version rises for installed copies to pick it up. The fixture's uuid no longer uses Math.random, which CodeQL flagged.

---------

Co-authored-by: Michael Valderrama <17348490+ibucketbranch@users.noreply.github.com>
2026-11-04 17:49:00 -06:00
rUv d2e33508f4 Merge pull request #4704 from ruvnet/integrate/sweep-2026-11-04b
integrate: 4 contributor fixes + #4693 + #4691 (2026-11-04 sweep)
2026-11-04 17:32:41 -06:00
rUvandr 00432b4eb1 fix(plugins): agentdb_context-synthesize guidance in agentdb, observability and rag-memory (#4691 follow-up) (#4705)
agentdb 0.4.11, observability 0.3.6, rag-memory 0.3.8: the tool summarizes
validated task episodes; ordinary memories and trace spans get no-eligible-
episodes, which the old 'combine memories' guidance made look like missing data.

Co-authored-by: r <r@x>
2026-11-04 17:31:57 -06:00
randRuFlo e95c77d469 fix: refuse a trajectoryIds selection in hooks_intelligence_learn (#4693); route research synthesis away from the episode controller (#4691)
- hooks_intelligence_learn advertised trajectoryIds but never read it, so a
  scoped request ran global learning. The learning path cannot select, so an
  explicit selection is now refused before anything is imported or mutated.
- agentdb_context-synthesize summarizes validated task episodes; its description,
  the research-synthesize skill (ruflo-goals 0.4.6) and the researcher agent
  (ruflo-core 0.2.14) no longer send research documents to it.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-04 17:46:14 -05:00
rUvandr 27dd1f1ac8 feat(ruflo-mods): agentModels — a model per agent type for spawns that chose none (0.16.1) (#4703)
agent.spawn routing for Claude Code 2.1.300+: 'Explore=haiku,general-purpose=sonnet'
sets the model of a spawn whose call chose none, covering built-in and other
plugins' types (definitions a person cannot edit) and workflow agents. A chosen
model, forks and teammates are kept; malformed pairs are dropped; a failing hook
passes the spawn through. Off by default; /ruflo-mods reports it.

Co-authored-by: r <r@x>
2026-11-04 16:07:51 -06:00
rUvandr 45bf52cd86 feat(mods): adopt Claude Code 2.1.290-2.1.318 mod API changes (mods 0.16.0, console 0.49.11, swarm 0.3.8) (#4702)
- ruflo-mods guard (tool.check): read-only fast path on e.isReadOnly (2.1.304)
  that skips the policy-projection stat while a full check found none in the
  last 2 s (web tools excluded so the research ask still fires); a chain deny
  returns without file reads; decider "person" on every ask ruflo raises;
  agentId names the subagent on ruflo's reason; the chain's ceiling survives a
  tightening; .catch documented for 2.1.301 semantics, still fails closed.
- ruflo-console: console_state and console_run registered with
  isDeferred: false (2.1.293); console_open/console_set stay deferred.
- console + swarm: Text bold -> weight (2.1.299 deprecation), codemodded;
  bold: true -> weight: "semibold" (what the host already maps bold to).
  Engines before 2.1.299 refuse a tree with an unknown Text prop, so the kit
  maps weight back to bold there (text-weight.ts, via $.session.version()).
- tests for 2.1.318's kit: $.tool.call now raises tool.check first
  (guidance test); stub answers are validated (swarm prompt.fill stub);
  stale expectations fixed (probe session.compact, learning-loop handshake).
- console kit tests: timeoutMs 30_000 (the 5 s default timed out 19-58
  end-to-end tests under load, on 2.1.289 and 2.1.318 alike), and the mock
  clock advanced past runner.ts's VERIFY_RETRY_MS in actions/settings tests.

Co-authored-by: r <r@x>
2026-11-04 15:49:08 -06:00
rUvandr 937a9a44c2 fix(ruflo-console): the band fits a narrow pane (0.49.10) (#4701)
Rows are measured in terminal columns (emoji are two), a part that does not
fit is left out whole with a dim +N count instead of being cut mid-word, the
longest parts are shortened first so a wide band keeps the rest in full, and
the open button sizes to its label ('open' below 64 columns; the mark alone
below 40).

Co-authored-by: r <r@x>
2026-11-04 15:15:40 -06:00
rUvandr 1c0d63c79a feat(ruflo-agent): leaf agents skip CLAUDE.md and run at low effort (0.4.2) (#4700)
nested-leaf and nested-queen-leaf get effort: low and omitClaudeMd: true.
Measured on Claude Code 2.1.318 in this repo: ~64k fewer input tokens per
leaf spawn; a one-leaf run cost $0.081 instead of $0.153. README gains the
2.1.292 one-command 'claude plugin install --marketplace' form.

Co-authored-by: r <r@x>
2026-11-04 14:33:12 -06:00
Mario JauvinandRuFlo dbeaa39611 fix(ruflo-console): mission over with cancelled tasks, and no cancelled-mission context in Claude's prompt (0.49.9) (#4689)
* fix(ruflo-console): treat a mission with only done and cancelled tasks as over (0.49.9)

Co-Authored-By: RuFlo <ruv@ruv.net>

* fix(ruflo-console): leave the mission context out of Claude's prompt for a cancelled mission (0.49.9)

The active mission stays active until another is created, so after a cancel every new goal's guidance reached Claude with 'The mission is cancelled. Do not start new work.' before the create step could make the new mission. contextSection already returned null for a finished mission; it now does the same for a cancelled one.

---------

Co-authored-by: RuFlo <ruv@ruv.net>
2026-11-04 09:31:07 -06:00
rUv 5f3dacc54b feat(mods): automatic context delegation (ruflo-mods 0.15.0, ADR-522) + release 3.71.0 (#4652)
* feat(mods): automatic context delegation (ruflo-mods 0.15.0, ADR-522) + release 3.71.0

New contextDelegation option (off | observe | enforce, default off). A
main-loop whole-file Read of a 14-120 KB file for an analysis prompt is
answered by a no-tools haiku $.model.complete on the session's own
credentials. Every quote is checked against the file and the model sees
only the cited passages (the file's own lines) plus how to read the rest.
The real Read always runs first, so a later Edit works (spike: answering
the Read without next(e) breaks Edit); any failure shows the whole file.

Live A/B (real binary, haiku main, 6 repo files 17-83 KB): 6/6 correct
both ways, 6/6 delegated, total cost -22.5% incl. worker, main input
-21.5%, wall +6.5%. First run delegated 0/6: haiku drops indentation in
quotes; the verifier now trims per-line whitespace and relocates up to 3
lines, showing the file's own lines.

Tests: 8 plugin tests, 3 real-binary e2e (extract + Edit, forged quote,
off), CLI parity test vs DEFAULT_CONTEXT_LIMITS and core verdicts. Smoke
step 4 now allows exactly one gated $.model.complete.

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01MfPHVHXWyvDvDtYMTsA6MP

* ci: keep the claude-code test-kit plugin test out of the vitest ratchet

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01MfPHVHXWyvDvDtYMTsA6MP
2026-11-01 15:14:10 -05:00
Mario JauvinandRuFlo 36a1575eaf fix(ruflo-core): say why a stale local CLI build failed and fall back to npx (0.2.13) (#4607)
mcp-launch picked v3/@claude-flow/cli inside a ruflo checkout because bin/cli.js and dist/src/index.js existed, then died on a bare ERR_MODULE_NOT_FOUND when dist/ predated src/. Claude Code hides stderr behind 'Skipping connection', so the cause was invisible.

Catch the missing-module import failure, print the rebuild command and the run-outside-the-repo option, and fall back to npx @latest. RUFLO_MCP_CLI_OVERRIDE, RUFLO_MCP_SKIP_NPX=1 and other error types still exit 1.

Co-authored-by: RuFlo <ruv@ruv.net>
2026-11-01 10:26:15 -05:00
rUvandr 66df9b95e1 feat(marketplace): agentdb and agentic-flow external plugins (ADR-518) (#4629)
* feat(marketplace): list agentdb and agentic-flow as external plugins (ADR-518)

Adds both upstream Claude Code plugins to the ruflo marketplace as
git-subdir entries pinned to their plugin-v3.1.0 merge commits
(agentdb 401fcb68, agentic-flow 2c86073b). Each runs its own MCP server
pinned to the 3.1.0 package plus a mod guard command.

A real-binary e2e checks out the pinned commit and asserts the mod
answers its own command with zero model requests, with a negative
control the loader refuses. README rows and ADR-518 added.

Co-Authored-By: RuFlo <ruv@ruv.net>

* chore(marketplace): keep \u escapes so the diff only adds the two entries

Co-Authored-By: RuFlo <ruv@ruv.net>

* fix(console): give agentdb and agentic-flow a home section (plugin coverage)

Co-Authored-By: RuFlo <ruv@ruv.net>

* test: run the external-plugin e2e only in the real-binary tier

Co-Authored-By: RuFlo <ruv@ruv.net>

* chore(console): 0.49.8 — plugin map covers agentdb and agentic-flow

Co-Authored-By: RuFlo <ruv@ruv.net>

---------

Co-authored-by: r <r@x>
2026-10-31 20:45:43 -04:00
rUvandr bd77bced5f fix(security): bearer parsing, verification-code bias, protocol stripping; release 3.66.2 (#4624)
* fix(security): linear bearer parsing, unbiased verification codes, nested-protocol stripping

- @claude-flow/mcp: HTTP and WebSocket transports parse Authorization: Bearer
  with a prefix compare instead of /^Bearer\s+(.+)$/i, which backtracked
  quadratically on long whitespace runs (CodeQL js/polynomial-redos).
- ruflo-chatgpt-federation: same parser fix in authContext.
- @claude-flow/security: generateVerificationCode draws digits with
  randomInt(10); byte % 10 favoured 0-5 (js/biased-cryptographic-random).
- @claude-flow/security: sanitizeString strips javascript:/vbscript:/data:
  until stable, so javajavascript:script: no longer reassembles javascript:
  (js/incomplete-url-scheme-check).
- cli terminal_create: session ids from crypto randomBytes, not Math.random.

Co-Authored-By: RuFlo <ruv@ruv.net>

* chore(release): 3.66.2 — mcp 3.1.5, security 3.0.6

Co-Authored-By: RuFlo <ruv@ruv.net>

* chore(ruflo-chatgpt-federation): 0.2.5 for the bearer parser fix

Co-Authored-By: RuFlo <ruv@ruv.net>

* test(ruflo-chatgpt-federation): smoke expects 0.2.5

Co-Authored-By: RuFlo <ruv@ruv.net>

---------

Co-authored-by: r <r@x>
2026-10-31 14:11:42 -04:00
rUvandr 189aceca1d feat(learning): the verified-outcome learning loop on classic hooks, for every ruflo project (ADR-512) (#4604)
* feat(learning): run the verified-outcome learning loop on classic hooks for every ruflo project (ADR-512)

Until now only the opt-in ruflo-mods plugin recorded verified turns and showed lessons. Classic hooks
(every `ruflo init` project) now do the same. They replay the session transcript (`transcript_path`)
through the mod's own record and lesson code, bundled into .claude/helpers/learning-loop.cjs:

- route: records the turns that finished, then prints the lessons that fit the new prompt
- session-end: records the rest (PreCompact leaves the open turn open). This runs before the
  session-id dedup, which otherwise dropped SessionEnd after a PreCompact. It also starts a
  detached `ruflo hooks verified-ingest --quiet`
- one implementation: plugins/ruflo-mods/scripts/build-learning-loop-helper.mjs bundles
  hooks/loop/transcript.ts; the bundle is committed, checked in mod-guidance CI, and is a signed
  critical helper that helper-refresh installs (manifest re-signed)
- never twice: with its loop on, the mod adds `learning-loop` to RUFLO_MODS_OWNS
- opt-out: .claude-flow/config.json learningLoop.enabled=false, or RUFLO_LEARNING_LOOP=0

Tests: mods-learning-loop-classic (replay matches the mod's records, offsets, the hook-handler run
as a process, end to end classic record -> real ingest -> lesson in route output) and real-binary
contract 6 (pinned claude, mock model, no plugin). ruflo-mods 0.14.0.

Co-Authored-By: RuFlo <ruv@ruv.net>

* docs(adr): ADR-512 cites PR #4604

Co-Authored-By: RuFlo <ruv@ruv.net>

* ci: sign and exclude the classic-loop helper and real-binary test where the other helpers are (ADR-512)

smoke-helper-signing-security copies the critical helpers into its fixture; it now copies
learning-loop.cjs too. The ratchet's default run skips real-binary files, which need the
claude binary (mods-real-binary runs them).

Co-Authored-By: RuFlo <ruv@ruv.net>

* test(mods): give the built-CLI tests the time their children get

vitest's 5s default timed out mods-cli-bin on a loaded CI runner and reported only
STACK_TRACE_ERROR (the timeout error carries the stack of the it() call). Each test runs the
built CLI several times with a 120s child timeout.

Co-Authored-By: RuFlo <ruv@ruv.net>

---------

Co-authored-by: r <r@x>
2026-10-30 16:59:46 -04:00
rUvandr 243bc57f0b feat(learning): lessons say where the fix goes; reworded tasks learn together (ADR-511) (#4603)
* feat(learning): lessons say where the fix goes; reworded tasks learn together (ADR-511)

The §7 evaluation (#4581) showed three limits on what the verified-outcome
loop can learn:

- a lesson named an agent, nothing the model can act on;
- tasks naming different files merged into one lesson;
- the same task worded differently never learned (15 reworded verified
  successes left 15 patterns at one success each, zero lessons).

Changes:
- mods: a verified turn records its screened edited source files; a lesson
  names the three its passing fixes edited most and leads with them; pick()
  weighs rare keywords (IDF) and drops matches far below the best.
  ruflo-mods 0.13.0.
- cli: files are counted per pattern (successes only) into learned-lessons.json;
  SONA takes them as pattern anchors (never keywords), so reworded tasks that
  fixed the same file reinforce one pattern; tasks naming disjoint paths never
  merge. Lesson building moves to verified-lessons.ts.
- eval: the harness gains --ablate, --test-index, --concurrency, --lessons,
  --save-lessons, --eval-sample, --calibrate and --max-turns;
  scripts/eval-learning-loop-corpus.mjs writes a validated 15+30-task corpus.

Proved offline (tests): 15 reworded prompts form 5 lessons, up from 0; the
first run's prompts form 5 lessons, up from 1; the right lesson ranks first
for 30 of 30 eval prompts, with 1.07 lessons shown per prompt.

Paid pilots (haiku, about $6.80) are directional and did not reach the gate:
- 8-turn cap: off 2/10, on 4/10, lessons without files 1/10;
- uncapped: 6/6 vs 6/6, cost within 1%.
ADR-511 §5 has the details.

Co-Authored-By: RuFlo <ruv@ruv.net>

* docs(adr): ADR-511 cites PR #4603

Co-Authored-By: RuFlo <ruv@ruv.net>

---------

Co-authored-by: r <r@x>
2026-10-30 12:12:42 -04:00
rUvandr e9248a170e feat(security): plugin signing, scan before install, refuse risky project auto-approve keys (ADR-509) (#4593)
* feat(plugins): ADR-509 plugin trust — signing, scan before install, refuse project auto-approve keys

- scripts/sign-plugins.mjs signs every marketplace plugin (signature.json:
  sorted path+sha256 list, version, Ed25519 over canonical JSON) with the
  existing helpers key (same key resolution as sign-helpers.mjs; never
  printed). Nothing is signed with the real key here; release step in ADR.
- `ruflo plugins verify [name]` and `ruflo mods doctor` check the clone and
  install cache: verified / modified / unsigned / bad-signature, and write
  ~/.claude-flow/mods/plugin-verify.json per config dir.
- ruflo-mods plugin.register gate: under modTrust refuse-risky, a
  <name>@ruflo module whose clone is modified or bad-signature is refused
  (allow-list does not exempt it). Live-validated on Claude Code 2.1.289.
- Static scan of .mcp.json, hooks/hooks.json and hook modules before
  `claude plugin install` (mods install / init mods path) and before a
  local `plugins install`; a high finding blocks that plugin unless
  --accept-risk <plugin>, which is recorded in .claude-flow/mods/install.json.
- settings-risk-scanner covers enableAllProjectMcpServers,
  enabledMcpjsonServers, bypassPermissions, blanket Bash/* allows and
  non-ruflo hooks; `ruflo init` / `init hooks` / `init upgrade --settings`
  stop before writing anything (--keep-risky-settings / --drop-risky-settings);
  `ruflo doctor` warns on them in settings.json and settings.local.json.

Co-Authored-By: RuFlo <ruv@ruv.net>

* docs(adr): ADR-509 status names PR #4593

Co-Authored-By: RuFlo <ruv@ruv.net>

* fix(init): ADR-509 classify ruflo hooks by exact command; gate project-shipped helpers

isRufloHelperCommand no longer reuses pinToUserHelpers as a classifier: it
matches the closed set of commands ruflo generates or has generated (each
helper, subcommand, scope, platform, plus the legacy forms) by string
equality. node -e with extra code, -r/--require, --import, NODE_OPTIONS=
and a helper path in a comment are now findings. A project
.claude/helpers/<critical helper> that is neither ruflo's shipped copy nor
in a ruflo-signed manifest stops init too; --drop-risky-settings replaces it.

Co-Authored-By: RuFlo <ruv@ruv.net>

* fix(mods): ADR-509 a scan-blocked plugin is never left enabled

applyMods scans an existing marketplace clone before enabling anything and
does not enable what it blocks; a plugin the post-refresh scan blocks has
its enabledPlugins key removed and is dropped from the install record. The
--no-plugin-install, test/CI and no-claude paths are covered by the
pre-enable scan, and say when there is no clone to scan yet.

Co-Authored-By: RuFlo <ruv@ruv.net>

* fix(plugins): ADR-509 scan the modules hooks.json loads and their imports

The pre-install scan now resolves hooks.json `modules` against hooks.json
and follows every relative import/export-from/import()/require they reach,
with none of the walk's name, directory or size skips. A loaded file that is
missing, unreadable, over the size limit, outside the plugin, or loads a
computed module name is a high finding instead of being skipped.

Co-Authored-By: RuFlo <ruv@ruv.net>

* fix(mods): ADR-509 signature gate works on Windows and checks the loaded copy

The status file key is normalized the same way on both sides (forward
slashes, no trailing slash, Windows drive paths lower-cased), and the mod
finds the home the CLI used (USERPROFILE on Windows, else HOME).
plugins/.gitattributes turns off line-ending conversion so a Windows clone
hashes as signed. Every writer now records the install-cache copies too:
per plugin the worst of all copies, and each copy by its directory; the mod
looks up the plugin.register root first, so a tampered install cache next
to a clean clone is refused.

Co-Authored-By: RuFlo <ruv@ruv.net>

* fix(mods): ADR-509 match status path keys normalized; fix-pass notes

The mod compares the status file's per-copy path keys normalized, so a key
another writer spelled differently still matches the plugin.register root.
ADR-509 gains the review fix-pass implementation notes and live validation.

Co-Authored-By: RuFlo <ruv@ruv.net>

* fix(mods): ADR-509 report each blocked plugin once per run

Co-Authored-By: RuFlo <ruv@ruv.net>

* fix(cli): no env values in sign-plugins errors; RSA-2048 in the rejection test (CodeQL, ADR-509)

Co-Authored-By: RuFlo <ruv@ruv.net>

* chore(ruflo-mods): 0.12.0 for ADR-509

Co-Authored-By: RuFlo <ruv@ruv.net>

* test(mods): make mods-cli-bin failures readable (no more opaque STACK_TRACE_ERROR)

execFileSync's error holds Buffers and a process handle that vitest cannot
serialize, so a CI failure only said STACK_TRACE_ERROR. Rethrow a plain
Error with exit status, signal and the child's stdout/stderr tail.

Co-Authored-By: RuFlo <ruv@ruv.net>

---------

Co-authored-by: r <r@x>
2026-10-29 22:32:06 -04:00
rUvandr 5d2be9374a feat(cost): budget file, LiteLLM gateway export, per-agent/tool attribution (ADR-508) (#4592)
* feat(cost): ADR-508 budget file, LiteLLM budget export, per-agent/tool attribution

- .claude-flow/cost/budget.json (v1): `ruflo cost budget set --daily/--weekly/--monthly`
  writes it; the ruflo-mods ladder uses its smallest window when costBudgetUsd is 0.
  Hostile files (negative usd, unknown periods, oversized arrays) are no budget.
  Validator in both the mod and the CLI with a parity test.
- `ruflo cost budget export --gateway litellm` prints budget_limits (and, with
  --model, model_max_budget + budget_fallbacks) as YAML or the /key/generate body;
  --apply posts it to https or loopback only, key from --key-env, redirects refused.
  --gateway meta-llm fails with a pointer to ADR-508 (no documented budget API).
- ruflo-mods costLedger option (default on, ruflo projects only): session.measure
  deltas charged to subagent type and preceding tool, one line per session in
  .claude-flow/cost/attribution.jsonl, read by `ruflo cost report`; a gateway
  budget refusal is toasted once and counted.
- Live-validated on Claude Code 2.1.289 (fake LiteLLM on loopback + one haiku run).

Co-Authored-By: RuFlo <ruv@ruv.net>

* docs(adr): ADR-508 status names PR #4592

Co-Authored-By: RuFlo <ruv@ruv.net>

* docs(ruflo-mods): ADR-508 costLedger transcript read, open budget-file and default-on notes

Co-Authored-By: RuFlo <ruv@ruv.net>

* fix(cost): ADR-508 review — --apply host escape via // path, per-call attribution split

- keyGenerateUrl: a base path starting with // (or /\) resolved as a
  protocol-relative URL and sent the LiteLLM master key to another host
  (http://localhost//evil.example/ -> http://evil.example/key/generate).
  Refuse such paths, set the path on a copy of the parsed URL, and require
  the result to keep the given scheme and host.
- Attribution: session.measure fires once per main-thread turn, and a
  foreground subagent runs inside the main Agent call, so last-tool
  charging put subagent spend on main/Agent. Split each measured delta
  evenly across the tool calls completed since the last measurement.
- Tests in host event order and for the path escape; both fail on the
  previous code. ADR, README, cost report header state the estimate rule.

Co-Authored-By: RuFlo <ruv@ruv.net>

* docs(adr): ADR-508 live run of the per-call attribution split

Co-Authored-By: RuFlo <ruv@ruv.net>

* chore(plugins): ruflo-mods 0.11.0, cost-tracker 0.31.0 for ADR-508

Co-Authored-By: RuFlo <ruv@ruv.net>

---------

Co-authored-by: r <r@x>
2026-10-29 20:33:25 -04:00
rUvandr 828a8d78d9 feat(plugins): cut per-turn footprint — user-invoked operational skills, description ceiling, footprint report (ADR-507) (#4588)
* feat(plugins): ADR-507 cut the per-turn plugin footprint

- scripts/measure-plugin-footprint.mjs: per-plugin skills/commands/agents,
  listing characters and estimated tokens, from the tree or a git ref;
  before/after reports in v3/docs/validation/.
- 27 operational skills get disable-model-invocation: true (cost-tracker
  sub-reports reached by /ruflo-cost, metaharness bench/learn/evolve/mint/
  oia-audit, GAIA submission + comparison, init-project, ruflo-status,
  vector-setup, federation-init, agntcy-status). Each is listed in a
  "User-invoked skills" table in its plugin README; the choosing rule is in
  plugins/README.md.
- 20 skill descriptions over 300 characters cut to one sentence plus
  "Use when".
- audit-skill-frontmatter: 300-char ceiling on skill and command
  descriptions (measured unfolded) and a README check for every
  user-invoked skill.
- skillTrim (§2.4) not built: the engine has no skill-listing hook.

Listing with every plugin enabled: 47,743 -> 39,402 chars
(about 11,936 -> 9,851 tokens per turn).

Co-Authored-By: RuFlo <ruv@ruv.net>

* docs(adr): ADR-507 status names PR #4588

Co-Authored-By: RuFlo <ruv@ruv.net>

* docs(plugins): ADR-507 cost-analyst points users at /ruflo-cost for user-invoked reports

The engine's refusal for a disable-model-invocation skill says not to
replicate its workflow by other means, so the agent names the subcommand
instead of running the report script. After-report now cites the pushed
commit.

Co-Authored-By: RuFlo <ruv@ruv.net>

* fix(scripts): ADR-507 audit runs through symlinked paths; test the gate's wiring

The import guard compared argv[1] with import.meta.url, which Node realpaths
for the entry module. Run through a symlinked path, main() was skipped and the
audit exited 0 having checked nothing. Both scripts now compare realpaths.

audit-skill-frontmatter takes --plugins-dir so tests can run the real CLI on
a fixture: a 304-char folded description, an unlisted user-invoked skill and
a 311-char literal command description must exit 1 with those findings, and
adding the README row must clear only the user-invoked one. The repo-wide test
now also asserts skillsScanned > 100. Disabling any of the three checks, or
restoring either old guard, fails a test.

Co-Authored-By: RuFlo <ruv@ruv.net>

* chore(plugins): version bumps for ADR-507 footprint changes

Co-Authored-By: RuFlo <ruv@ruv.net>

---------

Co-authored-by: r <r@x>
2026-10-29 19:50:34 -04:00
rUvandr 49fe0b362b feat(mods): compactSnapshot — pre-compaction snapshot + post-compaction reload (ADR-505) (#4591)
* feat(mods): compactSnapshot — pre-compaction transcript snapshot + one-shot reload block (ADR-505)

New ruflo-mods option compactSnapshot (default on). On a main-loop manual/auto/plugin
session.compact it writes the transcript about to be summarized to
.claude-flow/sessions/compactions/snapshot-<n>.jsonl (role, text <= 2000 chars, tool
names/ids only; each line screened; 400 messages / 2 MiB; ten rotating slots), beside
the compaction so it is never blocked, delayed or rewritten. The next non-slash prompt
after a compaction that stood gets one [RUFLO_AFTER_COMPACT] context block (<= 2000
chars) from lessons shown this session, the last 5 loop outcomes, open swarm/claim ids
and the snapshot path. ruflo doctor warns when snapshots exist and git would commit them.

Co-Authored-By: RuFlo <ruv@ruv.net>

* test(mods): isolate the ADR-505 doctor test from global git excludes; note precompute inference

Co-Authored-By: RuFlo <ruv@ruv.net>

* docs(adr): ADR-505 status names PR #4591

Co-Authored-By: RuFlo <ruv@ruv.net>

* fix(mods): compactSnapshot screens raw message text before JSON encoding (ADR-505)

JSON escaping put a backslash before quotes and encoded newlines, so the
key-assignment rule missed "api_key": "..." / password="..." and the
line-start role-tag rule missed a \nsystem: line; those were written to the
snapshot in plaintext. messageLine now screens the raw cut text and the tool
names, plus the encoded line as before. Negative-control test added.

Co-Authored-By: RuFlo <ruv@ruv.net>

* chore(ruflo-mods): 0.10.0 for ADR-505

---------

Co-authored-by: r <r@x>
2026-10-29 19:41:08 -04:00
rUvandr 658f0e33bf feat(plugins): sensitive userConfig secrets + readSecret + secrets audit (ADR-506) (#4587)
* feat(plugins): sensitive userConfig secrets, readSecret helper, plugin secrets audit (ADR-506)

- ruflo-cost-tracker, ruflo-metaharness: `openrouterApiKey`; ruflo-x-gateway:
  `adminToken`. Each is type string, sensitive, optional, no default.
- readSecret(name, envFallbacks): CLAUDE_PLUGIN_OPTION_<NAME> first, then the
  variables the plugin always read. Copied per plugin (x-gateway in src/, the
  only folder its Docker image ships); a test keeps the copies identical.
- Consumers: openrouter.mjs key/generation, x-gateway checkAdmin (call time,
  fail closed), redblue child env (OPENROUTER_API_KEY, never argv).
- scripts/audit-plugin-secrets.mjs: credential-named option without
  sensitive: true, or a literal secret (the mods' COMMON_SECRETS, parsed from
  screen.ts) in plugin.json/hooks.json, fails. Wired into plugin-package-audit.

Co-Authored-By: RuFlo <ruv@ruv.net>

* docs(adr): ADR-506 status points at PR #4587

Co-Authored-By: RuFlo <ruv@ruv.net>

* fix(plugins): deliver the ADR-506 secret option, harden the plugin secrets audit

Review fixes for #4587:

- Delivery: Claude Code gives a plugin option only to the plugin's own hooks
  and MCP servers, never to the Bash tool that runs openrouter.mjs and the
  redblue skill path. ruflo-cost-tracker and ruflo-metaharness now carry a
  SessionStart hook (scripts/_secret-env.cjs) that writes the sensitive
  openrouterApiKey option to CLAUDE_ENV_FILE as OPENROUTER_API_KEY, only when
  that variable is unset. Live-verified with Claude Code 2.1.289 (probe plugin
  and the real cost-tracker): a Bash tool command resolved the key.
- ruflo-x-gateway adminToken removed: the gateway is a deployed server that no
  Claude Code process of the plugin runs, so the option could never arrive.
- Audit: a secret used as a JSON key is shown as <redacted-key> and never
  printed; .mcp.json and .lsp.json are scanned; OpenRouter key shape added;
  credential-named env/headers entries holding a 16+ char literal fail;
  ${user_config.*} in command/headersHelper/args fails.
- ADR-506 updated with the delivery trade-off and what the bridge does not
  reach (the metaharness_redblue MCP tool in ruflo-core's server).

Co-Authored-By: RuFlo <ruv@ruv.net>

* test(plugins): skip the bash-only ADR-506 bridge tests on Windows; hedge env-file mode wording

Co-Authored-By: RuFlo <ruv@ruv.net>

* chore(plugins): cost-tracker 0.29.0, metaharness 0.3.0 for ADR-506

Co-Authored-By: RuFlo <ruv@ruv.net>

---------

Co-authored-by: r <r@x>
2026-10-29 19:21:05 -04:00
rUvandr 76845f22d3 feat(cli): load ruflo plugins in headless claude -p workers (ADR-510) (#4586)
* feat(mods): load ruflo plugins in headless claude -p workers (ADR-510)

claude -p on a fresh config loads no marketplace plugins, so ruflo's own
headless workers ran without ruflo-mods' guard, routing and learning loop.

- resolvePluginPaths: --source local checkout, then the marketplace clone,
  then the install cache; a folder without .claude-plugin/plugin.json is
  reported missing, never returned; honours CLAUDE_CONFIG_DIR.
- The daemon's HeadlessWorkerExecutor and `hive-mind work` add
  --plugin-dir <ruflo-mods> and CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 (unless
  set), never duplicate a caller's own --plugin-dir, and record a missing
  plugin (logged once) as missingPlugins on the result.
- `ruflo plugins paths [--json]` for Agent SDK callers; README section.
- `ruflo doctor --component headless-plugins` runs a real claude -p and
  checks the init event, plugin_errors and the mod heartbeat (runner
  injectable; skipped without a model credential).

Co-Authored-By: RuFlo <ruv@ruv.net>

* docs(adr): ADR-510 status names PR #4586

Co-Authored-By: RuFlo <ruv@ruv.net>

* fix(mods): headless plugin paths never come from project settings; stage hive-mind spawn -p (ADR-510)

- resolvePluginPaths no longer reads extraKnownMarketplaces from the
  project's .claude/settings.json or settings.local.json. A cloned repo
  could point every daemon worker and `hive-mind work` at its own folder,
  loaded via --plugin-dir with function hooks on and no trust prompt, in
  place of the user's ruflo-mods. "Local" is now only a directory
  marketplace in Claude Code's user-level known_marketplaces.json, and a
  relative path is rejected.
- `hive-mind spawn --claude --non-interactive` builds a `claude -p` worker
  too: it now goes through withHeadlessPlugins (staged before the prompt)
  and reports missingPlugins on data.claude. Interactive launch unchanged.
- Tests: project-scope settings (absolute or ./x) resolve to clone/cache,
  never the repo; relative path rejected; spawn-mocked hive-mind spawn
  test. All four new assertions fail on the previous commit.

Co-Authored-By: RuFlo <ruv@ruv.net>

* docs(adr): ADR-510 trust-boundary note records the live resolver check

Co-Authored-By: RuFlo <ruv@ruv.net>

---------

Co-authored-by: r <r@x>
2026-10-29 19:07:05 -04:00
rUvandr 38112e0042 feat(mods): learning-loop gaming defences — taints, re-verify, anomaly gate (ADR-503) (#4590)
* feat(learning-loop): gaming defences for verified outcomes (ADR-503)

The verified-outcome loop (ADR-502) trusts a verifier's exit status, but the
model chooses what that verifier checks. Four downgrade-only layers:

- mod: a verified-success record carries taints when the turn edited a test
  file (edited-tests), a verifier config (edited-verifier-config), or decided
  on a weakened/narrowed command (narrowed-verifier); a per-process session
  token is written on every record. The outcome word never changes.
- CLI: a success with a taint not listed in .claude-flow/config.json
  learningLoop.allowTaint is counted under `tainted` and never reaches SONA.
- CLI: opt-in re-verify (learningLoop.reverify, off by default) re-runs a
  rotating allowlisted manifest check in a temp detached git worktree at HEAD
  with a timeout; failure, timeout or error downgrades to unknown. Only an
  explicit verified-ingest re-verifies; hot callers defer.
- CLI: anomaly gate holds would-be lessons that are perfect-and-tainted,
  only-narrowed, or from one session, listed as `held: <id> (<reason>)`.

Adds scripts/eval-learning-loop.mjs (manual, plan-only unless --run).

Co-Authored-By: RuFlo <ruv@ruv.net>

* docs(adr): ADR-503 status names PR #4590

Co-Authored-By: RuFlo <ruv@ruv.net>

* fix(learning-loop): shell edits of tests taint; test the real re-verify runner (ADR-503)

- A Bash command that writes, moves or deletes a test file or verifier
  config (rm, mv, cp, tee, truncate, sed -i/perl -i, output redirection,
  git rm/checkout/restore/...) now sets edited-tests /
  edited-verifier-config like an Edit of that file. Before this change,
  Edit src/a.ts + `sed -i 's/it(/it.skip(/' src/a.test.ts` + `npm test`
  produced an untainted verified-success. Downgrade-only: reads and test
  runs earn nothing.
- gitWorktreeRunner is now tested against a throwaway git repo: pass,
  fail, missing script, timeout (hung script's process verified dead),
  non-repo error. After each run only the main worktree remains and no
  ruflo-reverify-* dir is left. A negative control (kill only the direct
  child) makes the timeout test fail.
- ADR-503 implementation notes record both, plus the interpreter-write gap.

Co-Authored-By: RuFlo <ruv@ruv.net>

* test(learning-loop): give the hung-check re-verify test an 8s budget for cold CI runners

Co-Authored-By: RuFlo <ruv@ruv.net>

* chore(ruflo-mods): 0.9.0 for ADR-503

Co-Authored-By: RuFlo <ruv@ruv.net>

---------

Co-authored-by: r <r@x>
2026-10-29 18:57:12 -04:00
rUvandr 375e846c66 feat(mods): verified-outcome learning loop, on by default (learningLoop, #4581, ADR-502) (#4583)
* feat(mods): verified-outcome learning loop (learningLoop, #4581, ADR-502)

ruflo-mods 0.8.0 adds the learningLoop option (default off). Each main-loop
turn becomes a trajectory whose outcome is verified-success/verified-failure
only when a recognised test/build/typecheck/lint command ran after the
turn's last edit and the shell's exit status said so; otherwise unknown.
A masked status (|| true, pipes, ;, background, substitution) verifies
nothing, and the model's own words are never read.

The CLI ingests the records (ruflo hooks verified-ingest, the
hooks_intelligence_verified-ingest MCP tool, and automatically from
hooks_route and hooks_session-end): only verified records train SONA,
unknown ones are counted; each id once; PII-redacted. It writes
learned-lessons.json, and the mod adds at most three cited lessons at or
above the 0.6 gate to a matching prompt. doctor --component learning-loop
reports whether outcomes reach SONA.

Stages 5-7 of #4581 (pane, autonomous /loop-run, GEPA self-tuning) are
deferred; the on-by-default evaluation has not been run.

Co-Authored-By: RuFlo <ruv@ruv.net>

* fix(mods): learning loop needs an edit to verify; redact e-mails before writing (#4581)

A turn that edited nothing is unknown (a verifier verifies a change).
The mod replaces e-mail addresses in the stored task; ADR-502 states the
privacy limit (broader PII redaction runs at CLI ingest).

Co-Authored-By: RuFlo <ruv@ruv.net>

* feat(mods): learningLoop on by default (#4581)

Maintainer decision: ship the learning loop on by default. Set the
learningLoop option to false to turn it off. ADR-502 records that the
issue's 30-task evaluation has not been run yet.

Co-Authored-By: RuFlo <ruv@ruv.net>

* fix(cli): ADR-112 guidance on hooks_intelligence_verified-ingest (#4581)

Co-Authored-By: RuFlo <ruv@ruv.net>

---------

Co-authored-by: r <r@x>
2026-10-29 16:38:56 -04:00
Dragan SpiridonovandClaude Opus 5.5 8c0ad74e50 chore(marketplace): pin agentic-qe-fleet to v3.15.17 (#4574)
Move the external agentic-qe-fleet entry from v3.15.16 (4edfa469) to
v3.15.17 (b177b2315521376b83f2eed40e4994fd7581d067), so its MCP server
runs agentic-qe@3.15.17. The plugin folder changed only its version and
MCP pin. Updates the README links, the external-plugins test fixture and
the ADR-484 evidence section with the re-run install results.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 09:12:33 -04:00
Dragan SpiridonovandClaude Opus 5.5 49f9a313ea chore(marketplace): pin agentic-qe-fleet to v3.15.16 (#4560)
Move the external agentic-qe-fleet entry from v3.15.15 (1d0cc766) to
v3.15.16 (4edfa469d8f957b45bc0ea25424eb831b134f129), so its MCP server
runs agentic-qe@3.15.16. The plugin folder changed only its version and
MCP pin. Updates the README links, the external-plugins test fixture and
the ADR-484 evidence section with the re-run install results.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 05:39:48 -04:00
rUvandr 7d679ab425 fix(console): let Claude ack Project Anatole alerts via console_run (0.49.7) (#4545)
* fix(console): let Claude ack Project Anatole alerts via console_run

console_run anatole-ack-<id> failed with "command.run: called from a
tool.call hook, it would wait on the turn this hook is holding": the
console sent /protector and awaited its answer inside Claude's tool
call, and the host refuses a slash command while that call holds the
turn. A clock tick and immediate:true do not avoid it (probed against
Claude Code 2.1.289); a command started after the hook returns runs.

The Anatole specs now send /protector without waiting, retry for about
a minute while the host reports the turn as held, and say Queued until
the mod answers. Acks still pass the console confirm and Claude-control
level. ruflo-console 0.49.7.

Co-Authored-By: RuFlo <ruv@ruv.net>

* docs(console): link #4545 in the 0.49.7 changelog

Co-Authored-By: RuFlo <ruv@ruv.net>

---------

Co-authored-by: r <r@x>
2026-10-27 17:22:26 -04:00
Mario JauvinandRuFlo 065089344d fix(ruflo-console): offer to create a mission for a new goal once the active mission is over (0.49.6) (#4537)
* fix(ruflo-console): offer to create a mission for a new goal once the active mission is over

The active mission stayed active for ever, so after it finished (every task
done in the ruflo task store) or was cancelled, a goal planned after it showed
"Create the mission and its tasks" as done with the old id and no create
button. missionOfGoal() now says the goal has no mission yet when the active
one is over, so the create step is the next step with its mc-create button.
A mission still going keeps the re-plan in place; a finished mission's own
goal is not offered a second time; a cancelled mission's goal can be created
again. The create itself is unchanged and still asks first.

Co-Authored-By: RuFlo <ruv@ruv.net>

* chore(ruflo-console): 0.49.6

Co-Authored-By: RuFlo <ruv@ruv.net>

---------

Co-authored-by: RuFlo <ruv@ruv.net>
2026-10-27 14:22:25 -04:00
Dragan SpiridonovandClaude Opus 5.5 551428e39a chore(marketplace): pin agentic-qe-fleet to v3.15.15 (#4533)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 05:49:18 -04:00
rUvandr dafd38a4fe feat(ai-team): semantic memory via Cognitum embeddings, ordered listing, funnel logging, anon rate limit (0.4.0) (#4527)
* feat(ai-team): semantic memory via Cognitum embeddings, ordered listing, funnel logging, anon rate limit (0.4.0)

- memory_search ranks by meaning through /v1/embeddings (cognitum-embed, 384-dim) when a key is set;
  vectors persisted only for unchanged text, never returned; outage or no key falls back to the
  labelled lexical index
- listMemories reads newest first (composite index teamId+createdAt), falling back to the unordered
  read when the index is absent
- one structured ai_team_activation log line per workflow stage, hashed tenant, no content
- per-client limit on unauthenticated requests (last X-Forwarded-For entry; OAuth and /health exempt)

Co-Authored-By: claude-flow <ruv@ruv.net>

* fix(ai-team): keep plain mcp.tool registration sites; wrap registration for funnel logging

The repo-wide guard-tool-names check scans for .tool('name'; a local tool() helper hid them.

Co-Authored-By: claude-flow <ruv@ruv.net>

---------

Co-authored-by: r <r@x>
2026-10-26 17:37:25 -04:00
Mario JauvinandClaude Sonnet 5.5 60e951415b fix(ruflo-console): keep a project copy of the mission ledger (0.49.5) (#4524)
* fix(ruflo-console): keep a project copy of the mission ledger (0.49.5)

The ledger lives in the plugin's host store, a separate file per plugin
source. A console loaded inline in one session and from the marketplace
install in the next saw an empty store, so the project's mission
disappeared from Mission Control after a restart. Each save now also
writes .claude-flow/console/mission-ledger.json (git-ignored), and a load
that finds no ledger for the project in the store restores this project's
missions from it. A store that already has a ledger is left alone.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(ruflo-console): offer, never adopt, missions from the project copy

The copy is a file a cloned repository can ship. Missions read from it
are now only offered (same path as pre-per-project missions, one yes
adopts each); nothing is adopted, stored or made active unasked, `active`
in the copy is ignored, and an empty ledger no longer overwrites it.

Addresses review on #4524.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(ruflo-console): word the project-folder offer as what it is

Missions offered from .claude-flow/console/mission-ledger.json were shown
under "from before per-project storage, with no project recorded", which
is wrong for them. They now get their own heading that says where they
were found and that a cloned repo can ship the file; the old heading is
kept for missions that name no project.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-26 16:08:34 -04:00