Commit Graph
260 Commits
Author SHA1 Message Date
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
Rudy Celekli 8d81c77e79 merge: refresh Windows doctor fix against current CI baseline
Signed-off-by: Rudy Celekli <47457359+rudycelekli@users.noreply.github.com>
2026-09-30 21:32:50 -04:00
ruv 07fc94197a fix(ci): deterministic browser pattern ids; macOS node-gyp Python for Build V3
reasoningbank-adapter: generatePatternId() appended Date.now(), so a repeated
successful trajectory merged into its existing pattern only when both calls
fell in the same millisecond. Otherwise it created a duplicate pattern with
usageCount 1 (the adapter never learned from repeats), and the
"update existing pattern" test failed intermittently in CI. The id is now a
pure function of the goal (slug + FNV-1a of the full normalized goal). A new
test pins Date.now to two different values; it fails on the old code.

v3-ci Build V3 (macos-latest): when the better-sqlite3/hnswlib-node prebuild
download times out, node-gyp compiles from source and macos-latest's Python
3.12 has no distutils. Pin Python 3.11 on macOS so the fallback works.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-09-29 12:54:20 -04:00
ruv 0423eaf7fb fix(release): preserve archives and refresh version witnesses 2026-09-28 17:16:02 -04:00
ruv e69bc340cf feat(federation): add guarded public registration and release 3.47.0 2026-09-28 17:16:02 -04:00
Rudy Celekli 665e62df2e ci(doctor): run Windows regression after workspace build 2026-09-28 10:17:46 -04:00
Rudy Celekli c3b025a9d1 fix(doctor): import MetaHarness modules via file URLs on Windows 2026-09-28 10:12:07 -04:00
Rudy Celekli ff4b2af271 fix(metaharness): handle help and reject unknown arguments before execution 2026-09-26 19:38:32 -04:00
ruv 012daa5fed Merge branch 'pr-3389' into integ/train-3.45.1 2026-09-26 11:32:48 -04:00
ruv 43901973b6 Merge branch 'pr-3343' into integ/train-3.45.1 2026-09-26 11:32:47 -04:00
ruv 4a6e063de7 Merge branch 'pr-3391' into integ/train-3.45.1 2026-09-26 11:32:47 -04:00
ruv 2f192d4eb9 Merge branch 'pr-3367' into integ/train-3.45.1 2026-09-26 11:32:47 -04:00
ruv 9be73667da Merge branch 'pr-3423' into integ/train-3.45.1 2026-09-26 11:32:47 -04:00
rUvandClaude 1e7a33a768 dream(security): #3384 add PATH/search-path family to validateEnv() denylist (evaluated, ACCEPT-scoped) (#3385)
* dream(security): #3384 add PATH/search-path family to validateEnv() denylist (evaluated, ACCEPT-scoped)

validateEnv()'s loader-hijack denylist blocked LD_PRELOAD/NODE_OPTIONS-class
vars but not PATH itself or the equivalent interpreter/VCS search-path
family (CWE-427) -- flagged grade-A by last night's security scan.

Adds PATH, PYTHONPATH, PERL5LIB, RUBYLIB, GIT_EXTERNAL_DIFF,
GIT_SSH_COMMAND, BASH_ENV, IFS to the denylist, closing the only
MCP-reachable exposure (terminal_create/terminal_execute). An independent
adversarial critic found the lookup was case-sensitive (path/Path bypass
it on case-insensitive Windows); fixed same session via .toUpperCase()
case-folding, which also hardens the original 9 names.

13 new discriminating tests (32/32 total), baseline-fails/candidate-passes
verified via git-stash isolation and independently reproduced twice by
the critic. Full suite failed-file set byte-identical to baseline (36
pre-existing environmental failures) -- zero new failures.

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

* docs(dream-cycle): update LEDGER.md with 2026-09-21 security row

Records tonight's PATH/search-path denylist fix, the new 2026-09-13/14
no-run gap (confirmed via git ls-remote), the 09-15..09-20 backlog
(confirmed real, not transcribed per established convention), and a
correction that search_pull_requests's merged field is stale/unreliable
(pull_request_read is authoritative).

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

* fix(ci): build+overlay local @claude-flow/cli-core before running the test ratchet

PR #3385's own new tests (validate-input-env.test.ts) passed locally but
failed in CI's Test Suite job: package-lock.json resolves
@claude-flow/cli-core from the published npm registry tarball, not an
npm workspace link (unlike @claude-flow/security, which the previous
step in this same job already handles for the same reason). Since
scripts/ci-test-ratchet.mjs runs vitest from repo root,
v3/@claude-flow/cli's tests resolve @claude-flow/cli-core by walking up
to root node_modules -- the stale published dist/, never the local
source. Building the local package and overlaying its dist/ onto the
installed one (same version, so not a version bump) makes CI test the
actual PR diff instead of a stale registry snapshot, without touching
package-lock.json.

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

* dream(security): #3384 re-validate persisted session.env at execute time

Post-review fix on PR #3385: terminal_execute() trusted session.env from
the on-disk store unconditionally after terminal_create's one-time
validateEnv() call. A session persisted before a denylist update (or a
store.json edited/restored out of band) could carry a now-denylisted
env var (PATH, etc.) forever, silently bypassing tonight's fix -- and
the original 9-name denylist -- for every execute on that pre-existing
session.

terminal_execute now re-validates session.env via validateEnv() and
drops it to {} on failure rather than merging it unchecked, so a stale/
tampered session degrades to a clean environment instead of blocking.
2 new tests (stash-isolated: fails on the pre-fix handler, passes on
the fix); full package suite unaffected (same 36 pre-existing
environmental failures as before this commit).

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-26 10:07:43 -05:00
Rudy Celekli ea4661f815 fix(mcp): enforce opt-in policy in shipped stdio launchers 2026-09-25 14:01:48 -04:00
ruvnetandClaude Opus 5 1116724a65 ci(guard): make the leaf-publish diff check actually run in PR CI
The guard's first real CI run passed but reported:

  NOTE: diff check NOT EXERCISED — could not diff against 'origin/main' (shallow clone?)

So only the range check ran; check 2 — the half that replays #3335/#3390 by
catching a leaf source change with no version bump — sat out entirely. The
NOT EXERCISED note is what made that visible instead of reading as a pass,
which is precisely why a skipped check must never print like a clean one.

Two causes, both fixed:

  - `git fetch --depth=1 origin $GITHUB_BASE_REF` fetches the base tip with no
    shared history, so `base...HEAD` dies with "fatal: no merge base". Now
    fetches --depth=50 with an explicit
    +refs/heads/<base>:refs/remotes/origin/<base> refspec.
  - The script only attempted three-dot. It now falls back to two-dot, which
    needs no common ancestor, and reports which mode actually ran.

Verified against the exact failing condition — an orphan branch with no merge
base against origin/main, where `git diff origin/main...HEAD` returns
"fatal: no merge base": the guard now reports "diff check ran (two-dot ...)"
rather than skipping. NC1 re-confirmed: a leaf source change without a version
bump still fails, now accompanied by "diff check ran (three-dot ...)" proving
the check executed rather than being skipped into a pass.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 17:20:11 -04:00
ruvnetandClaude Opus 5 f02759cd6d ci(guard): fail when a non-bundled @claude-flow/* leaf changes without a publish
Adds scripts/audit-leaf-package-publish.mjs, wired into v3-ci.yml's existing
audit job (semver is already installed there).

Only four @claude-flow/* components are bundled into the release tarballs —
INTERNAL_RUNTIME_PACKAGES in stage-internal-runtime-bundles.mjs: security,
codex, mcp, plugin-agent-federation. cli-core, neural, shared and memory
resolve from the REGISTRY at whatever v3/@claude-flow/cli/package.json pins, so
a merged source change in one of those does NOT ship with the three-package
train: the release silently carries the last published copy.

This has bitten twice. #3334 fixed RUFLO_INTELLIGENCE_MODE in
@claude-flow/memory; v3.42.1 shipped the train only and a fresh consumer
install had zero references to the fix (#3335). #3390's reasoningBank
activation spanned cli/src/memory/memory-bridge.ts AND
memory/src/controller-registry.ts — publishing only the train would have
shipped the bridge half and left the embedder half unreachable, leaving
reasoningBank exactly as inert as before. It was caught by hand and
memory@3.0.0-alpha.25 went out alongside v3.42.5.

What makes it easy to miss is that CI goes GREEN: the leaf's own package tests
run against workspace source, so the change looks verified while being
unshippable.

The audit asserts:
  1. every non-bundled leaf's workspace version is covered by the CLI's
     declared range (a miss means the release resolves to OLDER code than
     this repo's source);
  2. diff mode — if a leaf's publishable source changed vs the base ref but
     its version did not, fail with remediation.

It imports INTERNAL_RUNTIME_PACKAGES rather than restating it, so the bundled
and non-bundled sets cannot drift apart; exits non-zero if it inspects zero
leaves, so a broken classifier can't report clean; and reports a skipped diff
check as NOT EXERCISED rather than as a pass.

@claude-flow/shared is entered as a time-boxed accepted finding (expires
2026-10-21): the CLI pins 3.0.0-alpha.7 while the workspace is at
3.0.0-alpha.8, which IS published — stale, not unshippable. Raising the pin
edits v3/@claude-flow/cli deps and so forces a pnpm-lock.yaml regen in the same
change (#2540 -> #2552), which wants its own PR. An EXPIRED entry fails the
guard rather than muting it.

Negative-controlled, all four paths:
  - memory source changed, no bump      -> FAIL (replays #3390)
  - same change with a version bump     -> pass
  - test-only change in a leaf          -> pass (not publishable)
  - waiver expiry backdated             -> FAIL, "no longer honoured"

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 16:49:17 -04:00