* 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>
* 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>
`/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>
* 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>
* 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>
* 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
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.
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>
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.
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>
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>
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>
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>
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>
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>
* 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>
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>
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>
The v3.42.5 release (run 35641592705) failed at "Install root release-audit
dependencies", 9 steps before any publish. `npm ci --omit=dev --omit=optional`
triggers v3/@claude-flow/security's "prepare": "npm run build" (it is both a
root workspace and a root dependency). That package does not declare
@types/node, relying on a hoist from the root dev tree, so --omit=dev leaves
tsc with no Node types and --omit=optional removes @napi-rs/keyring:
TS2591: Cannot find name 'crypto' / 'Buffer' / 'process'
TS2307: Cannot find module '@napi-rs/keyring'
The step only needs `semver` for audit-umbrella-version-lockstep.mjs, so it
should not link or build workspaces. Verified locally against the tagged tree:
the current command reproduces the CI failure exactly; adding --workspaces=false
installs 175 packages and the lockstep audit passes.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>