276 Commits
Author SHA1 Message Date
rUvandr 34a1eac1ce ci(supply-chain): extend two live accepted findings to 2026-12-17 (#5020)
browser/agentic-flow (expires 2026-11-19) and browser/zod (2026-11-23)
still match live findings on a fresh re-audit, with no upstream fix yet;
the zod 4 migration (#4535) is the removal path for zod. Extend both 30
days with a dated note. The graph-intelligence zod and @claude-flow/cli
entries no longer match any finding and are left to lapse.

Co-authored-by: r <r@x>
2026-11-17 14:05:03 -05:00
rUvandr 8966b06078 ci(supply-chain): accept dev-only vitest finding for picomatch GHSA-fc5q-39xc-vjpf (#5019)
The supply-chain audit started failing on main at 17:30Z with no dependency
change: GHSA-fc5q-39xc-vjpf (picomatch ReDoS) entered the npm audit
database and marks vitest HIGH in plugins/ruflo-graph-intelligence and
v3/@claude-flow/browser. The vulnerable range (<= 4.0.7) is every published
picomatch release and no patched version exists, so no bump clears it.
vitest is a devDependency only; accept it for 30 days (expires 2026-12-17).

Co-authored-by: r <r@x>
2026-11-17 13:10:54 -05:00
ordinary beingandrUv 15331cddd6 fix(release): keep the stale watermark mirror out of publish paths (#4993)
v3/@claude-flow/watermark is a stale 0.2.0 copy of the package now built from ruvnet/ai-text-watermark (npm 0.4.x, crates.io 0.3.x). The npm package was already private, but still declared publishConfig, and the Rust crate remained publishable, so a recursive release could overwrite the canonical artifacts with stale code (#4959).\n\n- remove the contradictory publishConfig from the npm package;\n- set publish = false on the ruflo-watermark crate;\n- replace the README's stale 0.2.0 install/API guide with a pointer to the canonical source;\n- add a regression test and run it in the stable release gates so reopening either publish path fails before packing.\n\nRegistry attribution for the already-published 0.4.2 metadata remains owner-scoped to the @claude-flow publisher.

Co-authored-by: rUv <ruv@ruv.net>
2026-11-17 11:19:22 -05:00
randRuFlo 0a311ac4c4 test(ruflo): run the tarball-contents test under vitest, where the CI ratchet collects it
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-10 11:54:50 -05:00
randRuFlo 3be90c22c2 fix(ruflo): ship the wrapper only, harden the bridge's outbound guard
Socket flags six files in ruflo@3.75.1, all under src/ (the chat UI, the MCP
bridge and deploy scripts). Nothing in bin/ reads src/, and the tarball never
included the compose files needed to run it, so it was 528 files of dead
weight in every install.

- package.json: drop src/** from `files`. Tarball goes from 531 files / 8.2 MB
  to 3 files / 33 KB. New test pins the contents.
- mcp-bridge (both copies): replace the SSRF regex with url-guard.js. The
  regex let through https://[::1]/, 169.254.169.254, 100.64/10,
  *.internal and IPv4-mapped loopback, and refused public hosts starting
  "fc"/"fd". The new guard also checks what the hostname resolves to and
  refuses redirects.
- mcp-bridge: pin agentic-flow (was @alpha) and gemini-mcp-server
  (third-party) to exact versions in the spawn specs and the Dockerfiles.
  ruvector and ruflo still follow latest.
- mcp-bridge: spawned backends no longer inherit MCP_AUTH_TOKEN.
- chat-ui: remove patch-mcp-url-safety.sh. Against today's upstream image
  it matches nothing and exits 0; where it did match it relaxed the check
  for every URL.
- ADR-166 lock: four new checks, plus the guard and tarball tests in CI.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-10 11:24:23 -05:00
ruv f6f9a7c0e6 fix(aidefence): make the documented AgentDB vector store work (3.2.0)
The README and createAIDefence JSDoc told users to pass `new AgentDB()` as
`vectorStore`. AgentDB has no store/search/get/delete, so the first
learnFromDetection threw "this.vectorStore.store is not a function".

- Add createAgentDBVectorStore(): imports the optional `agentdb` peer lazily,
  embeds with its EmbeddingService and indexes in its vector backend (async
  methods when the backend is async-only, as RuVector is). Falls back to
  InMemoryVectorStore with one warning when agentdb is missing.
- createAIDefence wraps an AgentDB instance passed as vectorStore, and rejects
  any other object lacking the VectorStore methods at construction.
- Real-import tests against agentdb 3.7.7 (devDependency), verified against the
  ^3.6.0 peer floor too; a fallback test; a CI workflow that runs them.
- Drop the unmeasured "150x-12,500x" / "0.1ms HNSW" AgentDB claims.
- Package metadata: homepage ruv.io, repository/bugs -> ruvnet/ruflo.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-11-09 21:42:36 -05:00
randclaude-flow ab18c33548 fix(deps): zod ^4.6.7 floor, integration agentic-flow ^2.0.14, mcp/codex/shared advisory floors
zod (GHSA-mrhx-c7xc-m3w5): shared, claims, the twelve v3 plugins,
ruvector-upstream, plugins/ruflo-{arena,ai-team,chatgpt-federation,x-gateway}
and goal_ui move to zod ^4.6.7. hooks declared zod but never imported it, so
the dependency is dropped.

gastown-bridge drops uuid/@types/uuid (GHSA-w5hq-g745-h8pq).

integration: peer agentic-flow ^2.0.0-alpha -> ^2.0.14 || ^3.0.0
(GHSA-vcv2-r9jh-99m5). The repo source already matched the published 3.0.2,
so this ships as 3.0.3. A patched agentic-flow leaves a ReasoningBank timer
alive, which made plugins/ruflo-cost-tracker/scripts/compact.mjs print its
result and never exit; compact.mjs now exits after stdout drains, guarded by
scripts/smoke-compact-exit.mjs (hangs on main, passes here) in
cost-tracker-smoke.

Stale ranges outside the cli: mcp ws ^8.21.0 (GHSA-96hv-2xvq-fx4p), express
^4.22.3 (GHSA-qw6h-vgh9-j6wx), ajv ^8.20.0 (GHSA-2g4f-4pwh-qvx6); codex yaml
^2.8.3 (GHSA-48c2-rrv3-qjmp); shared express ^4.22.3 || ^5.1.0. Each package
gets an advisory-ranges test over its own manifest.

ADR-356 metadata on every published manifest: homepage https://ruv.io,
canonical repository with directory, bugs, 8-20 keywords, description
<= 200 characters.

Versions: shared 3.0.8, hooks 3.0.3, claims 3.0.1, integration 3.0.3,
mcp 3.1.7, codex 3.0.7, gastown-bridge 0.1.6, prime-radiant 0.1.7, other
v3 plugins one alpha up. Marketplace plugin.json bumps for the five changed
plugins. The cli, claude-flow and ruflo pins are left for the release lane.

Lockfiles: v3/pnpm-lock.yaml drops the agentic-flow@2.0.0-alpha tree;
standalone plugin locks were regenerated with npm 11 (npm 10 crashed on a
stale optional peer in four of them).

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-11-09 02:21:15 -05:00
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
ruv fb0449f2df ci(stable-npm-release): wait for npm processing before the integrity check
Runs 36345167527 (3.47.0) and 36445956751 (3.47.1) uploaded all three
archives, then failed "does not match the verified archive integrity"
after ~30 s of polling. The registry had not finished processing the
uploads: the packument records 3.47.0 about 5 minutes and 3.47.1 about
14 minutes after `npm publish` returned, and both carry exactly the
verified integrity. Because the step failed, dist-tags were never moved
and the release-3-47-0 / release-3-47-1 candidate tags are still set.

- Read version and integrity straight from registry.npmjs.org with
  Cache-Control: no-cache instead of `npm view`, polling with backoff for
  up to 30 minutes (the 10-minute loop on main is still shorter than the
  14 minutes observed for 3.47.1).
- Keep failing immediately on a readable, different integrity.
- Make reruns safe: the "already published" probe is uncached, and a
  publish refused as previously published falls through to the wait.
- Verify dist-tags from the uncached dist-tags endpoint for up to 5 min.
- Raise the job timeout from 30 to 75 minutes to fit the wait.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-11-06 12:24:58 -05:00
randRuFlo 53f95e36e6 feat(funnel): honor opt-outs in the messages fetch, wire opt-in telemetry, fix clone tracker
Operational telemetry (ADR-309, legitimate interest):
- `hooks refresh-funnel` (SessionStart) checked only the RUFLO_FUNNEL env
  kill switch. `ruflo funnel disable`, project config, enterprise policy and
  a declined disclosure all still called funnel.ruv.io every session. It now
  resolves the full funnel precedence and makes no request when disabled.
- The fetch's User-Agent adds the CLI release and OS/CPU family only:
  `ruflo-funnel/messages ruflo/<v> (<platform>; <arch>)`, sanitized to token
  characters. The live endpoint accepts it.
- docs/privacy/funnel-legitimate-interest-assessment.md is the assessment
  ADR-309 requires. ADR-309 links it, and ADR-310's acceptance rule now names
  the one documented default request.

Opt-in telemetry (ADR-302/305):
- `ruflo funnel telemetry on|off|status` is the only way to grant the
  telemetry consent domain. Nothing granted it before, so the event queue
  never left the machine.
- With consent, refresh-funnel flushes queued events once per session.
- `funnel disable` and `telemetry off` revoke consent and delete the ID and
  the local queue.

Clone tracker:
- A failed traffic fetch was recorded as 0 clones (snapshots #15-#18 read 0
  while GitHub reported ~258k in 14 days). The script now exits 1 and writes
  nothing.
- The workflow reads TRAFFIC_TOKEN, falling back to GITHUB_TOKEN, because
  the traffic API needs push access.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-06 11:05:25 -05: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 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 1ed156ae73 fix(ruvocal): port the #4226 local-only browser guard to the ruvocal bridge
With no MCP_AUTH_TOKEN the ruvocal mcp-bridge now refuses a non-loopback
Host and any foreign Origin, the same guard src/mcp-bridge got in #4226.
The guard test runs against both bridges and is added to the ADR-166 job.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-04 21:48:22 -05:00
rUv a3d45e64b9 feat(core): governed context delegation with reproducible benchmark proof (#4648)
* feat(core): add bounded context delegation with source-bound benchmark proof

* feat(core): add governed Messages adapter and durable resumable live pilot

* fix(benchmarks): isolate pilot fixtures and record bounded live timeout proof

* fix(context-delegation): review fixes — pilot env allowlist, hash-before-import, real policy root; ADR-521

- subscription-pilot: the spawned claude gets an allowlisted environment
  (PATH, HOME, locale, XDG, CLAUDE_CONFIG_DIR, plus names in
  RUFLO_PILOT_CHILD_ENV_PASS) instead of the whole shell; a GH_TOKEN
  canary test proves it. Policy is evaluated for process.cwd(), not a
  hardcoded /home/ruv.
- provider-pilot: the --runtime entry and policy runtime are contained
  and hashed before they are imported.
- ADR renumbered 520 -> 521 (520 is agentdb episode CRUD on main).
- Evidence regenerated for the new snapshot (9301fbfd…, Node 24): 300/300
  quotes, coordinator bytes -97.56%, total boundary +3.83%; verify.mjs ok.

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

* fix(context-delegation): honour --worker-available through the CLI parser; scope evidence hashes to owned files

- context-plan read only f['worker-available'], but the parser camelCases
  flags, so the documented command always planned 'worker-unavailable'.
  Accept both spellings; new test drives the real CommandParser (fails
  without the fix).
- results.json no longer hashes hooks.ts, index.ts and global-ai-budget.ts.
  Those files change in unrelated PRs, which would have failed
  verify.mjs on the next one. Evidence regenerated (20491e6e…, 14 hashes),
  163/163 tests, verify ok.

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

* chore(release): 3.70.0

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-01 14:13:37 -05: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 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 5a008a150a feat(test): real-binary test tier for ruflo mods (ADR-504) (#4589)
* test(mods): real-binary test tier with a scripted mock model (ADR-504)

Runs the real `claude` binary headless against a local mock of the
Anthropic Messages API, with ruflo-mods loaded through --plugin-dir in a
throwaway project with its own HOME. No API key, no paid model.

- mock-model.mjs: scripted Messages server (streaming and not), logs
  every request; untool'd or unknown requests get a minimal answer.
- run.ts: runner with a minimal child environment, PATH recorders for
  dangerous commands, and readers for events, requests and files.
- loads.test.ts (contract 1): with every option on, the heartbeat is
  written, /ruflo-mods is registered and answered with no model request.
  Negative control: a #4485-shaped copy (second bare session.start) is
  refused silently by the real loader and fails those assertions.
- contracts.test.ts (contracts 2-5): verified-success record from a
  scripted fix turn; [RUFLO_LESSONS] reaches the request (and not below
  the gate); ruflo denies the root delete with its own reason and denies
  a listed command the engine allows (which runs without the plugin);
  the route block reaches the request (and not without the plugin).
- Excluded from the CLI, v3 and root-ratchet default runs; run with
  `npm run test:real-binary`. New CI job mods-real-binary pins Claude
  Code 2.1.289 and fails, naming the step, if the binary will not start.

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

* docs(adr): ADR-504 status names PR #4589

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

---------

Co-authored-by: r <r@x>
2026-10-29 18:43:03 -04:00
f5602c0091 fix(cli): declare @claude-flow/aidefence as an optional dependency (#4445)
* fix(cli): declare @claude-flow/aidefence as an optional dependency

security-tools.ts, auto-install.ts and others import @claude-flow/aidefence at runtime but the package was in no dependency field. Flat node_modules layouts (npm) resolve it by accident; pnpm's isolated layout (pnpm dlx) hides it, so aidefence_* tools fail with 'AIDefence package not available'. Optional keeps the existing graceful-degradation path.

* fix(cli): add @claude-flow/aidefence to pnpm-lock.yaml

Matches the optionalDependencies entry added to @claude-flow/cli so the
frozen-lockfile install in CI passes. Hand-edited per review rather than
regenerated, to avoid rewriting unrelated importers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Q8MPAof1TAgCWWkJKdDJy

* fix(cli): pin @claude-flow/aidefence exactly and lift it from the #2561 guard

Pin 3.0.2 (the workspace and a published version) like @claude-flow/memory,
and keep the pnpm lock specifier in step. Remove aidefence from the guard's
FORBIDDEN list per its escape clause: the published package has no
dependencies (agentdb is an optional peer) and cold-installs in about 2-3 s
and 150 KB, versus 139 s for the CLI itself.

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

* fix(ci): drop an apostrophe from a comment in the #2561 guard script

The guard body is a single-quoted node -e string in the workflow, so an
apostrophe in a JS comment ends the shell quote and the step fails with a
syntax error.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: RuFlo <ruv@ruv.net>
2026-10-27 16:26:02 -04:00
Lenin MookiahandLenin Mookiah 2be0b69d68 fix(ci): gate helper sync on import and manifest checks (#4507)
Co-authored-by: Lenin Mookiah <2639584+leninworld@users.noreply.github.com>
2026-10-26 09:56:35 -04:00
rUvandr db141ba70e feat: managed workflows, unified console runs and verified advisory learning (#4471)
* feat(agent): add bounded managed dynamic workflows and verified lifecycle observation

* feat(plugins): integrate managed workflows with mod policy and capability discovery

* feat(managed): unify console runs and verified advisory learning

* fix(managed): hydrate native recall receipts validated on ruOS

* docs(managed): record authenticated console host blocker

* docs(managed): qualify installed console and compatible native host

* feat(managed): integrate verified cycles and isolate native memory

* fix(managed): enforce offline native models and qualify feedback E2E

* fix(managed): independent security and correctness review findings

- gate managed_agent_interrupt through the managed_agent_control policy; terminate obeys the allowlist and deletes only its own environment when RUFLO_MANAGED_CONTROL=1
- track only events from the acknowledged message so a later poll cannot report the previous turn as finished
- require the canonical base64 verifier signature so one receipt cannot fill the ledger
- register RUFLO_MANAGED_AGENTS_BASE_URL as a trust-boundary env var (env-precedence audit) and key the credential scope marker with a per-process HMAC (CodeQL)
- best-effort local snapshot writes; report messageId when a prompt fails after it was sent
- console: rescheduling is running, budget/action-blocked sessions are active, not finished
- document the remaining known limits in ADR 0004

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

* docs: user guide section for managed cloud agents; correct ruflo-agent README counts

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

* fix(managed): scope marker is a generation number, never a hash of the API key (CodeQL)

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

---------

Co-authored-by: r <r@x>
2026-10-24 22:42:09 -04:00
Mario JauvinandRuFlo 9d94a5bcdb ci: require a plugin version bump when shipped plugin files change (#4447)
`/plugin marketplace update` compares plugin.json "version" with the installed
copy, so a fix merged without a bump never reaches existing installs (#4436
left ruflo-console at 0.45.1 until #4443 bumped it by chance).

scripts/audit-plugin-version-bump.mjs diffs <base>...HEAD and fails when a
plugin has shipped changes but its plugin.json version did not increase. New
plugins pass. Not counted as shipped: tests/, docs/, README*.md, CHANGELOG*.md,
*.spec.* and *.test.* files, and scripts/smoke*, scripts/test-*, scripts/bench*
(smoke scripts and tests that pin the version are edited together with a bump).
SKILL.md, commands/*.md and agents/*.md do count, since they ship.

.github/workflows/plugin-version-bump.yml runs it on PRs touching plugins/**.
The label skip-plugin-version-check skips the job.

Verified against history: #4436 (43a395435) fails, #4443 (7564f7cef) passes.
The workflow itself has not run on GitHub yet.

Co-authored-by: RuFlo <ruv@ruv.net>
2026-10-23 23:51:58 -04:00
rUvandr 2bc73c0994 fix(deps): zod 4.6.7 in graph-intelligence and browser, time-boxed accepted entries for nested zod 3 (#4442) (#4444)
* fix(deps): zod 4.6.7 in graph-intelligence and browser; time-boxed accepted entries for nested zod 3 (#4442)

GHSA-mrhx-c7xc-m3w5 (zod <4.6.6) turned the supply-chain audit red for every PR.
Both projects' own zod dependency moves ^3.22.4 -> ^4.6.7; the only code change zod 4
needs is a key schema on z.record (7 calls). The regenerated locks are now consistent
with package.json (npm ci works). The audit still names zod because other packages
(@claude-flow/cli|hooks|security|plugin-gastown-bridge, agentic-flow) keep nested zod
3.25.76 copies; two time-boxed accepted entries (expire 2026-11-23, tracked in #4442)
cover those. Needs CODEOWNER review (policy file).

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

* fix(deps): pnpm lock follows the browser package's zod 4.6.7

The first commit changed v3/@claude-flow/browser/package.json but not v3/pnpm-lock.yaml,
so every 'pnpm install --frozen-lockfile' job failed with ERR_PNPM_OUTDATED_LOCKFILE.
Minimal edit: the browser importer's zod specifier/version and the /zod@4.6.7 package
block (registry integrity). Proved with a clean 'pnpm install --frozen-lockfile', then
pnpm -r build, browser tsc --noEmit and its tests (231 passed).

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

---------

Co-authored-by: r <r@x>
2026-10-23 22:28:25 -04:00
1af3abedd7 feat(marketplace): install Agentic QE (agentic-qe-fleet) from the ruflo marketplace (#3950)
* feat(marketplace): list Agentic QE (agentic-qe-fleet) as an external, pinned plugin

The ruflo marketplace now lists agentic-qe-fleet by a git-subdir source pinned
to agentic-qe v3.15.0 (1363bc7d), so `/plugin install agentic-qe-fleet@ruflo`
installs the plugin from its own repository: 11 QE agents, 9 skills, 9 commands,
the agentic-qe MCP server pinned to 3.15.0, and the aqe-mod guard.

Tooling that assumed every entry is a local ./plugins folder now handles an
external one:
- validate-marketplace.yml checks an external entry (git-subdir, https url,
  path without .., full sha, description) instead of failing on it
- smoke-all-plugins checks out each external entry at its sha and runs its own
  scripts/smoke.sh (--skip-external to omit); the workflow also runs when
  marketplace.json changes
- ruflo-console 0.40.9: plugin-map line (Dev Tools), the coverage test requires
  a line for every external entry, and the Plugin Catalog reads an external
  plugin from its install path in installed_plugins.json (EXT badge)
- README and plugins/README rows; ADR-484 records the decision and evidence

* docs(adr-484): record what Claude Code before 2.1.69 does with the external entry, and main's existing floor

* fix(ci): fence the external-plugin smoke: github-only sources, realpath containment, scrubbed env and cwd, read-only token

Review findings 1 and 2 on #3950:
- scripts/external-plugins.mjs: sources must be https://github.com/<owner>/<repo>(.git);
  the plugin folder, its manifest and smoke.sh must stay inside the checkout after realpath;
  the external smoke.sh runs with only PATH, LANG, TERM and CI kept (no GITHUB_TOKEN,
  ACTIONS_*, *_TOKEN, *_KEY, *SECRET*), a temporary HOME, and its checkout (in a temp
  folder outside the workspace) as cwd; git fetch runs with the same env
- validate-marketplace.yml applies the same github-only allowlist and path rule
- all-plugins-smoke.yml: permissions contents: read, persist-credentials: false,
  runs tests/external-plugins.test.mjs
- tests/external-plugins.test.mjs: non-github host and lookalikes refused by both
  validators, symlink escapes refused, child env has no GITHUB_TOKEN and cwd is outside
  the workspace

* ci(all-plugins-smoke): raise the smoke-all timeout from 10 to 15 minutes

Review finding 4 on #3950: green runs on main take 9m40-9m50s, so the job sat on the
10-minute cap and was cancelled at 10m16s on this PR.

* test(console): an external plugin's description, version, source line and docs are stripped of escapes and bidi controls

Review finding 3 on #3950: the catalog reader already passes every external manifest
string through plain() (ESC/CSI/OSC sequences, C0/C1 controls, U+202A-202E and
U+2066-2069 removed); this test holds it to that.

* ci(test-ratchet): tests/external-plugins.test.mjs runs under node --test, not the root vitest

all-plugins-smoke.yml runs it with node --test; vitest reported "No test suite found".

* feat(marketplace): move the agentic-qe-fleet pin to v3.15.1 (4f0f8412)

agentic-qe v3.15.1 changes only the aqe-mod guard (#920: hardened, still tighten-only,
same engine API and events as 3.15.0) and pins agentic-qe@3.15.1 in .mcp.json.

* docs(adr-484): install evidence re-run at the v3.15.1 pin

* feat(marketplace): move the agentic-qe-fleet pin to v3.15.2 (9db36edf)

agentic-qe v3.15.2: aqe-mod reports its real version, keeps guard totals and the last
refusal across sessions (additive totals/lastRefusal in status.json), and never reads or
writes its status file through a symlink (adds $.fs.read and $.fs.stat); guard judging
unchanged. .mcp.json pins agentic-qe@3.15.2. ADR-484 evidence re-run at this pin.

* fix(marketplace): plain-name paths for external plugins, pin-review note, one marketplace for agentic-qe-fleet

- both validators (scripts/external-plugins.mjs, validate-marketplace.yml) require the
  plugin path to match ^[A-Za-z0-9._-]+(/[A-Za-z0-9._-]+)*$ with no . or .. segment:
  %2e%2e, a\..\b, a//b and a trailing slash are refused; tests cover both validators
- ADR-484: every pin bump needs a review of the pinned scripts/smoke.sh
- READMEs: install agentic-qe-fleet from the agentic-qe or the ruflo marketplace, not both

* feat(marketplace): move the agentic-qe-fleet pin to v3.15.3 (d7e5ffa7)

The plugin at v3.15.3 differs from v3.15.2 only in its version and its MCP
pin (agentic-qe@3.15.3). ADR-484's evidence records the install re-run at
the new pin.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(plugins): pin agentic-qe to v3.15.4 (bec02b13)

The plugin at v3.15.4 differs from v3.15.3 only in its version and its MCP
pin (agentic-qe@3.15.4). ADR-484's evidence records the install re-run at
the new pin.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(plugins): pin agentic-qe to v3.15.5 (d65ede14)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(console): leave the console version bump to the maintainer at merge

The console version and CHANGELOG entry collided with every console release on
main (four rebases on 2026-10-12, each only plugins/ruflo-console/CHANGELOG.md).
plugin.json, hooks/version.ts, scripts/smoke.sh and CHANGELOG.md now match
main; ADR-484 and its index row say 'next console release'.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(plugins): pin agentic-qe to v3.15.6 (0fa34d24)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(plugins): pin agentic-qe to v3.15.7 (7f2d091d)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(plugins): pin agentic-qe to v3.15.8 (d9ce98f7)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(plugins): pin agentic-qe to v3.15.9 (d1c33d2b)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(plugins): pin agentic-qe to v3.15.10 (e5814a2f)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: rUv <ruv@ruv.net>
2026-10-19 22:55:58 -04:00
rUvandr 663c58a091 fix(ci): add live-registry audit for unpublished leaf pins (#4303) (#4304)
* fix(ci): add live-registry audit for unpublished leaf pins (#4303)

audit-wrapper-dep-ranges.mjs and audit-leaf-package-publish.mjs only check
that a non-bundled @claude-flow/* leaf's CLI pin agrees with the workspace's
own version. Neither asks npm whether that version was ever published.

#4279 bumped @claude-flow/memory to 3.0.6 in the workspace and pinned the CLI
to match; both existing audits were green since workspace and pin agreed with
each other, but the standalone `npm publish` for memory was never run. 3.57.2
shipped depending on a version of memory that did not exist, breaking every
fresh install with ETARGET.

Add audit-leaf-versions-published.mjs, which queries the live npm registry
for each non-bundled leaf and fails if the version the CLI's pin resolves to
was never published. Wired into the plugin-package-audit CI job (same gate as
the two existing leaf audits) and documented as a required pre-tag step in
CLAUDE.md's publishing rules.

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

* fix: use encodeURIComponent instead of a first-occurrence .replace for the registry URL

CodeQL flagged name.replace('@', '%40') as incomplete string escaping —
String.replace with a string pattern only touches the first match. It
happened to be harmless for npm scope names (exactly one leading @), but
it's the wrong tool for escaping a URL path segment. encodeURIComponent
also correctly escapes the scope separator (%2F), verified against the
live registry (200 OK for @claude-flow/memory).

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

* fix(ci): baseline the new audit test file like its plain-script sibling

scripts/__tests__/audit-leaf-versions-published.test.mjs is a bare Node
script (console.log + node:assert/strict), the same shape as the
already-baselined scripts/__tests__/audit-supply-chain.test.mjs — it has
no vitest-discoverable describe/it block, so the root vitest ratchet
reports "No test suite found in file" and fails CI's Test Suite job.

This is not a real regression: the file was never runnable by vitest in
the first place (same category as its sibling, which IS correctly listed
here already). The test itself passes fine when run directly via
`node scripts/__tests__/audit-leaf-versions-published.test.mjs` (6/6, see
the PR description).

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

---------

Co-authored-by: r <r@x>
2026-10-19 22:55:54 -04:00
Devesh Maheshwari f6aacd57ea feat(codex): inspect helper activity from an existing session (#3962)
* feat(codex): inspect helper activity from an existing session

* fix(codex): keep the selected helper visible in small terminals

* test(codex): address activity viewer review feedback
2026-10-19 21:50:20 -04:00
Dragan Spiridonov b6f3988de7 fix(ruflo-mods): classify risky host calls and intercepting hooks (#3802)
* fix(ruflo-mods): trust gate also treats the agent.spawn, prompt.submit, tool.call, command.run, session.append and agent.register calls and the tool.describe and session.append hooks as risky (#3787, #3801)

Adversarial review of the previous commit: risk was checked per scanned
`calls` and `events` separately, and only the events side had agent.spawn
and prompt.submit, so a mod CALLING $.agent.spawn / $.prompt.submit /
$.tool.call still loaded under refuse-risky ("no risky calls or hooks").
session.append and agent.register, and the tool.describe and
session.append hooks (rewriting what the model reads).

Docs follow the code: README hardening note lists the first-party mods that
now need modTrustAllow under refuse-risky (agentdb, ruos, intelligence,
graph-intelligence, goals, iot-cognitum beside swarm and console), the
modTrust row and plugin.json description name the categories, and the
create-mod skill's list matches.

* fix(ruflo-mods): trust gate judges a glob or negation by what it selects; covers prompt sections/context, peer receive, model requests (#3801)

Re-review: the scan reports hook patterns as written, and riskOf matched
names exactly, so `on('tool.*')` or `on('!tool.describe')` loaded under
refuse-risky with "no risky calls or hooks" and could answer tool
permission verdicts (shown: tool.check returned allow). A glob now maps to
every risky event it selects, a negation to `*`, and any classic.* pattern
to the classic risk. Lookups use Object.hasOwn.

Same-category hooks added: prompt.section, prompt.context,
prompt.attachment, skill.prompt, session.receive, turn.step, and hooks on
process.run / http.fetch / mcp.call (they can answer other mods' calls).

Docs: every first-party mod with function hooks (43 of 43) is risky under
the gate's sets, so the README now says to allow-list each ruflo mod you
use under refuse-risky and points to `claude plugin validate`.

* fix(ruflo-mods): a hook on a risky call is a risky hook (fs.write, env.set, process.spawn, ...) (#3801)

Third review: every $ call is also an event a hook above the caller can
rewrite or answer for every other mod. Under refuse-risky a mod hooking only
fs.write loaded clean and redirected ruflo-mods' own heartbeat write to
.claude/settings.json; one hooking env.set rewrote RUFLO_MODS_OWNS; one on
process.spawn rewrote an allow-listed mod's argv; fs.* loaded too.

Hook risk is now derived: every RISKY_CALLS entry is also a risky event
("can rewrite or answer another mod's <call>"), on top of RISKY_EVENTS
(+ tool.register). Globs match against the union. Tests: fs.write, env.set
and fs.* refused (each fails on the previous head); the harmless-glob
control is clock.*, since command.run is a risky call. README and the
create-mod skill say so.

* fix(ruflo-mods): trust gate treats hooks that forge what other mods read, or replace the conversation, as risky (#3801)

Fourth review: a mod hooking only fs.stat (answer ENOENT for the policy
projection) or fs.read (return an empty observe projection) loaded under
refuse-risky and turned ruflo's own enforced deny into allow; one hooking
session.compact replaced the whole conversation. Added fs.read, fs.stat,
fs.exists, fs.list, settings.read, env.get, session.compact, prompt.edit
and attribution.text to the risky hooks; three tests (each fails on the
previous head). README states the gate is a list over the 2.1.289 engine
API, so an event added later is not judged until listed.

* fix(ruflo-mods): session.root, session.cwd, fs.ancestors and command.register hooks are risky; docs name ruflo-ruos (#3801)

Fifth review: a mod hooking only session.root moved ruflo-mods' project
root, so the enforced policy projection was read from elsewhere and a deny
became allow (the round-4 exploit through another input). Added those
inputs and command.register (consistent with tool.register), with a
root-forger test (fails on the previous head). Derived messages read
"another mod's fs.write, which writes files ..." instead of nesting
parentheses.

Docs: ruflo-ruos hooks only prompt.submit, so it is newly risky under
refuse-risky (#3787); README and PR body said every first-party mod was
already risky via a status file or tool.call, which was false for it.

* test(router): seed Thompson sampler convergence trajectory

* ci: retain one plugin smoke execution and its report

* Register smoke workflow test with its dedicated Node runner

* Prevent same-millisecond hierarchy embedding index collisions
2026-10-19 21:48:15 -04:00
randRuFlo 2ca1a247c4 Merge origin/main into fix/tui-zero-width-terminal (keep the new skill MCP audit step, drop the duplicate smoke run as intended)
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-14 05:22:37 -04:00
Dragan Spiridonov 0ecc5b0f04 fix(ci): save the smoke report without running every plugin twice 2026-10-13 19:48:35 +02:00
Muhammad Zubair be0f7dc521 ci(skills): run the skill MCP tool audit in all-plugins-smoke (#4141) 2026-10-13 13:38:45 +05:00
rUv a502a8f449 Merge pull request #4099 from proffesor-for-testing/fix/v3-ci-test-collection
fix(ci): run every v3 root-suite test file and stop accepting a crashed run as a pass
2026-10-12 12:34:45 -07:00
Dragan Spiridonov a94997281e ci(v3): run Test V3 Packages on Node 22
On Node 20 (end of life since 2026-04-30) an import that throws while its
module graph evaluates still raises an unhandled rejection after the caller
has caught it. sharp is never built in this workspace, so agentic-flow's
reasoningbank import fails that way and run 38265587493 reported 12
unhandled errors that are not defects in the code under test. Node 22 and 24
keep the caught failure caught.
2026-10-12 19:36:58 +02:00
randRuFlo c84a6d0a18 chore(shared): 3.0.4 (RVF tail recovery + runtime dependencies), CLI/root pins, fresh-consumer smoke
Carries #4031 (rudycelekli) and #4091 (proffesor-for-testing); oversized-tail and permission-safe
recovery per rUv's review and martinvlad's fresh-consumer finding. Adds scripts/smoke-shared-fresh-consumer.mjs
(packed tarball, plain Node) and a CI step for it.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-12 11:21:58 -04:00
Dragan Spiridonov de829e6faa fix(ci): run every root-suite test file and stop accepting a crashed run as a pass
Test V3 Packages has been passing on runs that executed 7-9 test files.
Three causes compounded:

- v3/vitest.config.ts excluded a bare 'node_modules', which matches only
  the top level. pnpm links workspace packages into their dependents'
  node_modules, so the @claude-flow/** globs collected the same files
  again through those links: 3,228 collected, 608 distinct.
- Under pool 'threads', four files (bug-cluster-2219-2226, mcp-tools-deep,
  neural-package-bridge, sona-embeddings-validation) pass and then exit 139.
  The crash comes after their results, and in a worker thread it kills the
  whole vitest process mid-suite, before any summary.
- The workflow tolerated exit 139 unconditionally, although its comment
  said "only ... after all tests reported".

Changes:

- Exclude **/node_modules/**, **/dist/** and **/.git/** at any depth.
- pool 'forks'; drop poolOptions and poolMatchGlobs, which vitest 4
  removed (router-bandit's chdir works under forks).
- Collect @claude-flow/shared/src/**/*.test.ts (6 files, 63 tests,
  including the #3865 EventStore regression), which no config collected.
- Exclude __tests__/appliance/**: node:test files that vitest reports as
  "No test suite found".
- Quarantine, by name and with the failure noted, the 21 files that fail
  on main once the suite runs (with CI=true); files that skip themselves
  under CI are not listed.
- Run vitest through its bin shim, so a segfault surfaces as 139 (pnpm
  reports a signalled child as 1), and also write a JSON report. Tolerate
  139 only when that report exists and says success, and the log shows no
  unhandled or close-time errors. The JSON report alone is not enough: it
  reports success with unhandled errors, and tests that spawn vitest print
  their own "Test Files" lines, so the text summary alone cannot prove the
  top-level run finished either.

Local, Node 24, CI=true, through the workflow step: 580 passed and 8
skipped of 588 files; 8,718 tests passed and 224 skipped; about 65 s; no
segfault; step exit 0. The same result on three runs.
2026-10-12 16:45:25 +02:00
randRuFlo 9cf03b3ab9 ci(tui): build the TUI bundle for the e2e matrix with an esbuild installed on its own (RUFLO_ESBUILD_DIR)
A root npm install crashes in arborist on this workspace; the tui leg only needs esbuild. build-tui.mjs looks in the repo first, then in RUFLO_ESBUILD_DIR.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-11 17:04:46 -04:00
randRuFlo 7718a142b4 feat(tui): the AI page: ask Codex (read-only, pinned) or OpenRouter, each question after a card (ADR-489 phase 3)
Page 6. Reuses harness.send and the conversation bridge's sendTo, not a second harness. Host.spawn runs only the pinned Codex 0.162.0
release (never current or PATH), read-only, from a fixed argument allow-list; Host.httpSend sends only https POST to openrouter.ai or a
convoTargets host, never follows a redirect, and a key is read by variable name and never drawn. Enter shows a card of exactly what would be
sent; a lone y answers it only while it was drawn in full (#3983); spend cap from the provider-reported cost. e2e host matrix gets a tui leg
(keyless in CI, live gated). Not in this PR: the workspace-write toggle.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-11 16:54:16 -04:00
randRuFlo b4716d5dcb ci(e2e): build the whole workspace like v3-ci (cli now needs cli-core, memory, neural)
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-11 12:52:57 -04:00
randRuFlo 98f2eb5213 feat(e2e): three-host integration loop (Claude Code, Codex, OpenRouter); fix MCP resources capability and Codex plugin clone budget
ADR-490 (loop), ADR-491 (mods host integration, Proposed). The loop's first run found two defects, fixed test-first:
- ruflo mcp start advertised resources but answered resources/* with -32601 (3 stdio servers).
- init --dual's marketplace clone ran under a 20 s budget (17.5 s measured), swallowing the real error.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-11 12:43:14 -04:00
randRuFlo a457cbf4dc fix(plugins): clean claude.ai plugin-validator findings (nested manifest, unknown keys, XML tags in skill descriptions)
- ruflo-plugin-creator 0.4.2: mod template manifest is plugin.json.tmpl (no nested plugin); scripts/scaffold-mod.mjs + test-scaffold-mod.mjs validate and test a scaffolded mod
- ruflo-workflows 0.6.5 / ruflo-arena 0.2.4 / ruflo-graph-intelligence 0.2.0-alpha.5: drop unused components / categories keys
- ruflo-metaharness 0.2.5: seven harness-* descriptions use {braces}, not angle brackets
- ruflo-ai-team 0.2.3 (+directory 0.1.1) / ruflo-x-gateway 0.9.5 (+directory 0.8.2): documentationUrl points at main, not the feat branch; store-listing keys kept (the directory reads them)
- scripts/check-plugin-manifests.mjs wired into all-plugins-smoke

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-09 10:18:04 -04:00
rUv 54628be615 Merge branch 'main' into fix/console-0.40.2-security 2026-10-08 15:02:44 -07:00
randRuFlo 5db1c788b6 ci: run the native Codex hook tests with node --test, not the root vitest ratchet
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-08 17:52:51 -04:00
r 4a133615c7 Merge branch 'pr-3523' into feat/release-3.56.0-batch 2026-10-08 16:54:34 -04:00
Mr. Makandruflo 2015071b98 fix(plugins): run the installed ruflo CLI before npx @claude-flow/cli@latest in cost-tracker, adr and metaharness (#3558)
A plugin installed from the Claude Code marketplace is copied on its own to
~/.claude/plugins/cache/<marketplace>/<plugin>/<version>/, with no CLI next
to it. ruflo-cost-tracker and ruflo-adr always spawned
`npx -y @claude-flow/cli@latest` for their memory/hooks calls, and #3366's
resolveRufloCli() in ruflo-metaharness only looks for the CLI that ships the
plugin or a repo checkout, so all three fell back to npx @latest there. For
cost-tracker that is every turn (its Stop hook): a registry round trip per
call, and a different CLI than the one the user installed, including a
release published minutes earlier. Each such run also refreshes
~/.claude/helpers ahead of the installed CLI.

All three plugins now resolve the CLI in the same order:
1. CLI_CORE=1: unchanged (npx @claude-flow/cli-core@alpha, ADR-100); adr
   still ignores it (#2781).
2. The CLI that ships the plugin, or a repo checkout, with #3366's guards
   (package.json named @claude-flow/cli + bin/cli.js + dist/src/index.js).
3. New: `ruflo`, then `claude-flow`, on PATH. fs-only probe (X_OK + isFile),
   shell: false; relative and empty PATH entries are skipped; on win32 an npm
   `.cmd` shim is mapped to its package's bin entry and run with node, and
   anything unmappable is skipped, never run through cmd.exe.
4. The unchanged npx @latest fallback.

- ruflo-cost-tracker: new scripts/_ruflo-cli.mjs; spawnNpxSync() in _npx.mjs
  sends `@claude-flow/cli@latest` to the resolved CLI (signature unchanged,
  no call-site edits).
- ruflo-adr: new scripts/lib/ruflo-cli.mjs; import.mjs, reindex.mjs and
  verify.mjs use it (verify too, so reader and writers share a store, #2781).
- ruflo-metaharness: step 3 added to resolveRufloCli() in _invoke.mjs.
- Test seams RUFLO_PLUGIN_SKIP_LOCAL_CLI=1 / RUFLO_PLUGIN_SKIP_PATH_CLI=1
  (same style as RUFLO_METAHARNESS_SKIP_LOCAL). The existing npx-stub tests
  (import-root-exit-3097, verify-read-safety-3147, test-no-tool-time-npx)
  set them; without that they fail on any machine with ruflo on PATH.
- New regression tests for each plugin, run in a marketplace-style plugin
  cache with fake ruflo/claude-flow/npx on PATH: fail on 49da6ecc4
  (cost-tracker 5/12, adr 2/6, metaharness 5/8), pass with the fix (14/14,
  6/6, 8/8). Wired into v3-ci.yml and metaharness-ci.yml.

Co-Authored-By: ruflo <ruv@ruv.net>
2026-10-05 09:57:49 -07:00
ruv 02e4305ff9 ci: run the status-forwarding tripwire in the fleet smoke workflow (ADR-450 T7)
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-05 05:40:35 -04:00
ruv 84c435df0d ci: install esbuild (0.25.0, into RUNNER_TEMP) before the fleet smoke — the guard-probe row needs it
smoke-all and smoke-without-metaharness failed on this PR with 'probe-mod-guards: esbuild not found'.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-04 21:48:13 -04:00
ruv b1a6243a86 Merge remote-tracking branch 'origin/main' into loop/screen-vendor
# Conflicts:
#	.github/workflows/all-plugins-smoke.yml
2026-10-04 21:06:45 -04:00
ruv 71bf281bf0 refactor(mods): one source for the secret screen — sync-mod-screen.mjs regenerates the shared region of 37 screen.ts copies, --check in all-plugins-smoke (ADR-445)
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-04 19:03:37 -04:00
ruv 00eed549d4 test(mods): check that every tool name a plugin guard watches exists in the registry
Adds scripts/check-guard-tool-names.mjs, an allowlist for tools other servers
serve, node:test tests, and a step in the all-plugins-smoke workflow. Fails
loud when nothing is extracted or the registry is empty.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-04 19:02:02 -04:00
rUv 1b62011183 fix(guidance): close source identity, offline export and serialization edge cases 2026-10-04 13:43:46 -07:00
rUv 2207f8779a feat(guidance): bind mod exports to Git blobs and explain review signals 2026-10-04 13:38:29 -07:00