792 Commits
Author SHA1 Message Date
rUvandr e14d7f42bb chore(release): 3.80.4 (#5089)
Republishes 3.80.3's content. The 3.80.3 CI publish uploaded all three
archives, but npm never stored their SLSA provenance bundles (the registry
origin serves only the publish attestation), so ADR-545 left them on
release-3-80-3 and latest stayed at 3.80.2.

Carries #5079 (#5086), #5081 (#5082, neural 3.1.2) and #5085.

Co-authored-by: r <r@x>
2026-11-23 15:54:44 -05:00
rUv 9936abe8b5 fix(cli): isolate tool-time npx, contain metaharness file arguments, validate daemon stop target (3.80.3) (#5085)
Tool-time npx calls resolve packages from a ruflo-owned prefix instead of the opened project; metaharness MCP file arguments stay inside the project; daemon stop only signals a validated ruflo process. Release 3.80.3 (helpers manifest re-signed).

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-11-23 14:17:00 -05:00
171ab4550f dream(memory): ReasoningBank never enforces its own contradiction-exclusion flag (evaluated, ACCEPT) #5081 (#5082)
* dream(memory): #5081 ReasoningBank never enforces its own contradiction-exclusion flag

detectContradictions() marks the lower-quality side of a contradicting
memory pair consolidated=true ("to exclude from retrieval"), but
retrieve()/retrieveByContent() never checked that flag. Add the filter
in both read paths; byte-identical for any entry never flagged.

Independently corroborated by two research roles (external-literature
review and pure code review) before either saw the other's output, and
independently reproduced by a fresh-context adversarial critic. 184/184
full @claude-flow/neural suite, tsc clean, 0 regressions. Darwin skipped
(binary guard, no tunable parameter, precedent: 2026-11-14).

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

* docs(dream-cycle): fill in 2026-11-23 gist witness block

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

* docs(dream-cycle): append 2026-11-23 ledger row (#5081/#5082)

Also records direct verification of the 2026-11-19..22 no-run gap and
that #4973/#4983/#5012/#5034 were batch-integrated via #5041 (merged
2026-11-19), not rejected.

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

* fix(neural): skip consolidated memories while gathering candidates (#5081)

Filtering after candidate selection let an HNSW hit list made only of
consolidated entries return nothing instead of falling back to brute force,
and counted it as an HNSW retrieval.

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

* chore(neural): publish 3.1.2 and pin it (#5081)

The ReasoningBank fix lives in a non-bundled leaf; @claude-flow/neural 3.1.2 is
published standalone so the train carries it.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: r <r@x>
2026-11-23 13:56:07 -05:00
rUvandr c4e05f5bd3 chore(release): 3.80.2 (#5078)
Fixes since 3.80.1:
- #5076: a crash between creating and writing the policy state lock left an
  empty state.lock that failed every MCP tool call (Codex's guidance_brain and
  memory_search included) with policy-state-lock-timeout. The lock is now
  published whole with link(), and a stuck lock names its cause and path.
- #5077: Codex parsed the hook handler's `[INFO]`/`[OK]` reports as JSON
  ("invalid user prompt submit JSON output"); under a Codex payload the
  handler now emits hook JSON (additionalContext) or nothing on stdout.

Re-signed helpers.manifest.json.

Co-authored-by: r <r@x>
2026-11-23 13:20:35 -05:00
rUvandr 6104acc82e fix(update): never load package files from the working directory (3.80.1) (#5072)
getInstalledVersion() resolved <pkg>/package.json with paths: [process.cwd()]
and loaded it with require(). A package's exports map can point
./package.json at a .js file, so a node_modules/@claude-flow/security (or
embeddings, integration, testing) committed to a cloned repository ran inside
the CLI on the startup update check of almost any command.

Resolve from the CLI's own install only and read the file with JSON.parse,
so nothing is executed. Adds update-checker-cwd-hijack.test.ts (fails on
3.80.0, passes here); the 4755 opt-in test now also mocks the file read.
Release 3.80.1 (helpers manifest re-signed).

Co-authored-by: r <r@x>
2026-11-22 15:43:49 -05:00
rUvandr 87f612cef1 chore(release): 3.80.0 (#5056)
* chore(release): 3.80.0 (codex 3.0.9)

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

* fix(cli): bundled OpenRouter alternates are opt-in (#4957)

#5038 loaded the bundled openrouter-alts.json for every npm install, which
changes which OpenRouter models users are billed for. Its PR asked for a
maintainer decision on that default. Until then, the bundled copy loads only
with CLAUDE_FLOW_ROUTER_OPENROUTER_ALTS=bundled; npm installs keep the
previous behaviour (no per-tier alternate). The file still ships.

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

* chore(release): pin @metaharness/darwin ~0.16.0; codex VERSION 3.0.9

darwin 0.16.0 is npm latest (it fixes the 0.15.0 bug that could leave SIM
journals unreadable), so the metaharness pin-drift gate flags ~0.14.0 as
stale. Bump the CLI dependency, MH_DARWIN_PIN and the plugin helper pin.
The pnpm lock entry is edited by hand to the 0.16.0 integrity; nothing else
in the lock moves. codex's exported VERSION follows the 3.0.9 bump.

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

* chore(ruflo-metaharness): 0.5.3 for the darwin ~0.16.0 helper pin

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

---------

Co-authored-by: r <r@x>
2026-11-20 22:21:35 -05:00
rUvandr 3c2ae91170 fix(release): absolute README URLs on npm pages + release 3.79.1 (#5053)
* fix(release): absolute README URLs on the ruflo and @claude-flow/cli npm pages

npmjs.com resolves relative README URLs against repository.directory, so on
the ruflo page docs/assets/x.svg became raw.githubusercontent.com/.../HEAD/
ruflo/docs/assets/x.svg: 41 of 51 images and every relative link 404ed. The
@claude-flow/cli page had the same problem. claude-flow publishes from the
root and was unaffected.

The release workflow now stages both subdirectory READMEs through
scripts/readme-absolute-urls.mjs, which rewrites relative images to
raw.githubusercontent.com and relative links to github.com/blob, pinned to
the commit being published. Both prepare-publish scripts use it too. Also
fixes the README's Verification link (verification.md moved to
verification/README.md in May).

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

* chore(release): 3.79.1

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

---------

Co-authored-by: r <r@x>
2026-11-20 08:34:42 -05:00
rUvandr 861179f621 fix(auto-memory): Codex Stop hook stdout (#3163) + release 3.79.0 (#5049)
* fix(auto-memory): keep Codex Stop hook stdout empty (#3163)

Codex parses a Stop hook's stdout as hook JSON, so the AutoMemory status
prose failed every Stop with "invalid stop hook JSON output". A Codex
hook payload carries a turn_id that Claude Code's does not; under Codex the
helper now sends its status to stderr and leaves stdout empty. Claude Code,
terminal and unparseable-stdin runs keep stdout feedback. Stdin is read only
when it is not a TTY, capped at 500 ms and 1 MiB.

Verified end to end on Codex 0.170: Stop Failed with the old helper,
Completed with the new one.

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

* chore(release): 3.79.0

First train release published from CI with SLSA provenance (ADR-545).
Bumps the three packages and re-signs the helper manifest for 3.79.0
(auto-memory-hook.mjs changed for #3163).

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

---------

Co-authored-by: r <r@x>
2026-11-19 16:45:01 -05:00
rUvandr 9c25e5a31f chore(release): 3.78.1 (#5045)
Ships #5044 (SONA balanced-mode recall fix) via @claude-flow/neural 3.1.1.

Co-authored-by: r <r@x>
2026-11-19 11:54:05 -05:00
rUvandr 26fc585b14 fix(neural): return current, exact SONA matches in balanced mode (#5044)
* fix(neural): return live exact SONA matches in balanced mode

* chore(neural): bump to 3.1.1 for balanced-mode recall fix

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

* chore(deps): pin @claude-flow/neural 3.1.1 (published)

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

---------

Co-authored-by: r <r@x>
2026-11-19 11:25:00 -05:00
rUvandr 337c8981e6 chore(release): 3.78.0 (#5043)
Bumps cli, claude-flow and ruflo to 3.78.0. Bumps the bundled mcp (3.1.8)
and security (3.0.8) leaves so their standalone packages pick up #4962 and
#5021, which changed their source after the 3.1.7/3.0.7 publishes.

Co-authored-by: r <r@x>
2026-11-19 02:12:49 -05:00
89a00242b3 integrate: dream-cycle memory/neural fixes (#4660, #4973, #4081, #3650, #4983, #5034, #5012) (#5041)
* dream(memory): #3649 restore quantizer config/codebooks across HNSWIndex serialize/deserialize

HNSWIndex.serialize()/deserialize() never persisted config.quantization or
trained PQ codebooks, so this.quantizer came back null after any
save/reload cycle — silently re-breaking the product-quantization distance
dispatch fixed 2026-08-25 (#3093/#3094) every time AgentDBAdapter.saveToDisk()/
loadFromDisk() round-trips an index. Added a versioned magic header (v1/v2)
so serialize() now writes quantization config + trained codebooks, and
deserialize() restores them, while old-format snapshots still read
correctly with no quantizer (unchanged pre-existing behavior).

Evaluated: pre-serialize recall@10 0.270 -> post-deserialize 0.010 on
baseline (bug reproduced) -> ~0.270 on candidate. 557/558 full suite both
ways (1 pre-existing unrelated failure), tsc clean. Independent adversarial
critic CONFIRMED, including a stronger real pre-fix v1-buffer repro.

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

* docs(dream-cycle): fill candidate commit sha in 2026-10-03 gist witness table

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

* fix(memory): validate importCodebooks() input, reject malformed shape

Addresses ruvnet's review on #3650: deserialize() fed JSON.parse() output
straight into this.codebooks with no validation, so a corrupted v2
snapshot could either throw (invalid JSON) or silently adopt a
wrong-shaped/non-finite codebooks array, poisoning every subsequent
distance computed against it with garbage or NaN.

importCodebooks() now validates shape (numSubquantizers sub-arrays, each
numCentroids centroids of the expected per-subvector length) and that
every value is a finite number, returning false and leaving the quantizer
untrained on any mismatch -- same as the existing pre-training bootstrap
state, not a new failure mode. deserialize() now guards the JSON.parse()
call itself so corrupt JSON degrades to "untrained" instead of throwing.

2 new discriminating tests, both verified to fail against the pre-fix
code via git-stash isolation (one throws on corrupt JSON, one silently
accepted a wrong-shaped array). Full suite 559/560 (1 pre-existing
unrelated failure), tsc --noEmit clean.

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

* docs(dream-cycle): record post-review hardening in 2026-10-03 gist

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

* dream(intelligence): #4080 wire SONA learning-state persistence into LearningBridge (evaluated, ACCEPT)

LearningBridge is the only production path that exercises SONAManager
(via auto-memory-hook.mjs's SessionStart/SessionEnd hooks), and every
short-lived hook invocation constructed a fresh, empty neural learning
state. SONAManager.serialize()/deserialize() already existed but were
never called. Wires that round-trip into LearningBridge.loadNeural()
(restore) and destroy() (persist, synchronous since destroy() is called
unawaited right before process exit), mirroring MoERouter's existing
.swarm/moe-weights.json persistence pattern.

This supersedes the handed-in candidate for tonight (fixing SONAManager's
EWC key-mismatch), which an architecture review proved would be
behaviorally inert: SONAManager.loraWeights.A/B are never updated by
gradient descent anywhere, so aligning EWC's keys would only change
internal telemetry, not real behavior. The persistence gap fixed here is
the actual root cause making SONA's learning trigger (EWC included)
practically unreachable in the first place.

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

* docs(dream-cycle): append 2026-10-12 intelligence ledger row

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

* chore(release): bump neural/memory leaves for #4081's source change

v3/@claude-flow/neural and v3/@claude-flow/memory are non-bundled leaf
packages resolved from the registry, not shipped with the release train
(CLAUDE.md "Publishing Rules") — a source change without a version bump
would ship nobody the fix (ruvnet/ruflo#3335, #3390). Minor-bumps both
(3.0.0->3.1.0, 3.0.4->3.1.0: backward-compatible additions, no breaking
API change) and updates v3/@claude-flow/cli's exact pins + v3/pnpm-lock.yaml
to match.

Root claude-flow's own @claude-flow/neural dependency resolves from the
real npm registry (not a workspace link, confirmed via package-lock.json's
resolved tarball URL) — widened to "^3.0.0" rather than bumped to "3.1.0",
since 3.1.0 isn't published yet and pinning to it would break `npm ci`.
@claude-flow/memory isn't a direct dependency of the root package, so it
needed no equivalent change there.

Verified: audit-leaf-package-publish.mjs, audit-wrapper-dep-ranges.mjs,
audit-plugin-packages.mjs, audit-package-dep-overlap.mjs, and
audit-umbrella-version-lockstep.mjs all pass locally; `npm ci` and
`pnpm install --frozen-lockfile` (in v3/) both succeed cleanly.

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

* fix(cli): widen neural/memory pins to ranges, not an unpublished exact version

The previous commit exact-pinned @claude-flow/cli's neural/memory deps to
3.1.0 to match the leaf version bump — but the CLI package is consumed via
real npm resolution when packed/installed (npx, or a real `npm install` of
the published tarball), not via the pnpm workspace link that made the pin
look fine locally. 3.1.0 isn't published, so smoke-cli-npx-install.mjs's
real `npm install` of the packed CLI tarball failed: `ETARGET No matching
version found for @claude-flow/neural@3.1.0`.

Same fix as the prior commit's root package.json change: widen to "^3.0.0"
rather than bump to the unpublished version. This still satisfies
audit-leaf-package-publish.mjs's range-coverage check (^3.0.0 covers the
workspace's 3.1.0) without requiring a real registry publish, and resolves
correctly to whatever's actually published (3.0.0) when installed for
real. CLAUDE.md documents this exact failure mode happening before
(memory@3.0.0-alpha.27, 2026-09-28) — exact-pinning to vaporware breaks
installs outright.

Verified: ran scripts/smoke-cli-npx-install.mjs locally end-to-end (packs
the real tarball, npm installs it, runs `cli --version`) — passes. All
other audit scripts + both packages' test suites unchanged/green.

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

* fix(cli): restore exact memory pin to satisfy witness-marker guard (#2021/#1825)

The previous commit widened @claude-flow/cli's "@claude-flow/memory" dep
(both dependencies and optionalDependencies) to "^3.0.0" to avoid the same
ETARGET problem neural hit. That broke a different, deliberate guard:
`witness marker drift smoke (#2021)` flags any change to a line previously
witnessed as a historical fix. #1825's fix (PR #1827) specifically pins
this field to an exact "3.x" version after a `workspace:` protocol leak
crashed npm's resolver entirely for ALL users — the marker
`"@claude-flow/memory": "3.` guards against regressing that.

memory doesn't need the same treatment neural got: it's listed in BOTH
`dependencies` and `optionalDependencies` (pre-existing, not introduced
here), and pnpm/npm treat a dependency declared in both as optional
overall — confirmed empirically by running scripts/smoke-cli-npx-install.mjs
locally with memory exact-pinned to the unpublished 3.1.0: npm installs
the tarball cleanly, because an unresolvable optional dependency doesn't
fail the install (unlike neural, which is required and must stay on a
range that resolves to what's actually published).

Restored the exact "3.1.0" pin (matching the new leaf version, satisfying
both the witness marker's "3." substring and
audit-leaf-package-publish.mjs's range-coverage) in both package.json
fields and the pnpm-lock.yaml specifier; left neural's "^3.0.0" from the
prior commit untouched.

Verified: smoke-witness-marker-drift.mjs (0 drifted, was 1),
smoke-cli-npx-install.mjs, audit-leaf-package-publish.mjs,
audit-wrapper-dep-ranges.mjs, audit-plugin-packages.mjs,
audit-package-dep-overlap.mjs, audit-umbrella-version-lockstep.mjs all
pass; pnpm install --frozen-lockfile (v3/) succeeds; both affected
packages' test suites unchanged.

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

* fix(memory,neural): harden SONA state persistence found in #4081 review

- LearningBridge never follows a symlink at statePath (read or write) and never
  writes into a symlinked directory: the file lives in the project directory, so
  it is untrusted input (reproduced: a planted symlink was overwritten).
- Atomic write (private 0600 temp file + rename); no torn files.
- Persist only when something was learned: no stray .swarm/ in every cwd.
- A file from another schema version is preserved, never overwritten.
- A rejected restore is rolled back to the pre-restore snapshot; reads are size-capped.
- SONAManager.deserialize validates the whole snapshot before assigning any field
  (reproduced: {"schemaVersion":1} left the manager half-applied and permanently
  unable to learn or self-heal).
Known limitation, documented: concurrent processes are last-writer-wins
(8 parallel processes kept 4 of 8 trajectories).

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

* dream(intelligence): #LOCAL wire ResearchMode.getConsolidationSnapshot() into SONA EWC++ (evaluated, ACCEPT-scoped)

Continues 2026-10-27 (#4531/#4532) and 2026-11-01 (#4633 SCAN)'s own
disclosed gap: BalancedMode was the only SONA learning mode wired into
SONAManager's EWC++ consolidation path. ResearchMode already maintains
real per-key gradient-shaped state (adamM/adamV, already read back by its
own dormant computeEWCLoss()) so it can be wired honestly using the exact
reviewed Balanced-mode delta-since-snapshot pattern, with zero
sona-manager.ts changes needed (the hook is mode-agnostic).

EdgeMode and RealTimeMode are explicitly NOT wired (no real gradient-shaped
state exists to snapshot without fabricating it); BatchMode is also not
wired (its accumulatedGradients map is zeroed on an independent 4-step
flush cadence, making a direct port semantically ambiguous).

5 new tests (3 discriminating, 2 controls), stash-isolated baseline fails
3/5 exactly as predicted, candidate 5/5 pass. Full @claude-flow/neural
suite 153/153 both ways except the 3 discriminating failures, 0
regressions. tsc --noEmit 0 errors both ways. Independent adversarial
critique: CONFIRMED-WITH-CAVEATS (one test-strength nit, fixed forward
same session).

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

* docs(dream-cycle): fill in witness stamp for 2026-11-02 gist

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

* docs(dream-cycle): append 2026-11-02 ledger row (#4659/#4660)

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

* fix(ci): bump @claude-flow/neural to 3.0.3 for the leaf-package-publish audit

CI's audit-leaf-package-publish.mjs correctly flagged this PR: @claude-flow/
neural is a non-bundled leaf (resolves from the registry, not shipped inside
the release train tarballs), and this PR changed its publishable source
(src/modes/research.ts) without bumping its package.json version — a release
now would ship the old copy and the ResearchMode EWC fix would reach nobody.

Bumps v3/@claude-flow/neural to 3.0.3 and the CLI's exact pin + lockfile
specifier to match (the CLI pins an exact version, not a range, so both must
move together). Verified locally: audit-leaf-package-publish.mjs now passes
clean against the PR base; @claude-flow/neural suite still 153/153, tsc
--noEmit still 0 errors.

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

* fix(ci): bump root claude-flow umbrella's @claude-flow/neural pin to 3.0.3

audit-wrapper-dep-ranges.mjs flagged a second, independent pin: the root
claude-flow umbrella's own dependencies block also pins @claude-flow/neural
exactly, separately from the CLI's pin fixed in 0e5b4a9. Bumped to 3.0.3 to
match the workspace source version. package-lock.json's resolved tarball
entry intentionally stays at the last-published 3.0.2 until neural is
actually published alongside a future release -- that's expected pre-publish
drift, not something this PR fixes, per CLAUDE.md's publishing rules.

Verified locally: audit-wrapper-dep-ranges.mjs, audit-leaf-package-publish.mjs,
and audit-umbrella-version-lockstep.mjs all pass clean.

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

* Revert "fix(ci): bump root claude-flow umbrella's @claude-flow/neural pin to 3.0.3"

This reverts commit 9c060b680e.

* Revert "fix(ci): bump @claude-flow/neural to 3.0.3 for the leaf-package-publish audit"

This reverts commit 0e5b4a9852.

* dream(intelligence): #4972 SONAManager.triggerLearning() backlog-replay fix (post-critique scoped)

triggerLearning() re-filtered the entire trajectories map every call with
no "already learned from" marker, so trajectories surviving pruning got
re-fed into gradient accumulation / EWC Fisher updates on every subsequent
cycle, purely from replay. Disclosed-but-not-fixed 2026-10-27 (#4531/#4532);
fixed here via a new Trajectory.learnedFrom gate.

An independent adversarial critique found the fix is real but narrower
than first claimed: it stops replay of stalled trajectories, but
BalancedMode's gradientAccumulator/ewcState.means are never reset at all,
so the same unbounded growth persists under ordinary continuous operation.
Disclosed in both test docstrings and the gist, carried forward as the
next priority candidate rather than shipped as fully fixed.

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

* dream(intelligence): #4972 record PR #4973 in ledger

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

* dream(intelligence): #4972 bump @claude-flow/neural to 3.0.4

Patch bump for the triggerLearning() backlog-replay fix — neural is a
non-bundled leaf resolved from the registry, so the CLI's pin must be
raised and the leaf republished at actual release time for this fix to
reach users (CLAUDE.md "Publishing Rules"; CI's
audit-leaf-package-publish.mjs caught the unbumped version).

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

* dream(memory): wire causalRecall into ControllerRegistry.initialize()

ControllerRegistry declares `causalRecall` as an AgentDBControllerName
with a real createController() case (dynamic agentdb import, built with
the ADR-514-adapted embedder, same shape as its already-wired siblings
causalGraph/learningSystem/explainableRecall) and includes it in the
isControllerEnabled() "AgentDB-internal controllers" branch. But it was
absent from every level of INIT_LEVELS, so initialize() never called
createController() for it, and the public get() accessor's fallback path
(agentdb[name] / agentdb.getController(name)) never runs this wrapper's
own construction logic either. Net effect: registry.get('causalRecall')
always returned null, silently.

Disclosed-but-deferred by a 2026-10-28 session ("needs a human call on
init-level ordering"). agentdb and its .database/.embedder/.vectorBackend
are already populated before the INIT_LEVELS loop runs, so level
placement doesn't affect correctness; grouped with construction-sibling
causalGraph in level 4.

Two discriminating tests added: a structural assertion that causalRecall
appears in INIT_LEVELS, and an extension of the existing ADR-514
real-agentdb embedder-wiring integration test to cover causalRecall
alongside its siblings. Both fail against the baseline exactly as
predicted (toContain assertion; get() returns null) and pass against the
candidate. Full package suite 717/718 with the fix (1 pre-existing,
unrelated, environmental chmod-as-root failure in
auto-memory-bridge.test.ts, confirmed byte-identical on the stashed
baseline). tsc --noEmit clean both ways.

Zero production call sites currently request causalRecall, so today's
blast radius is zero — this makes a correctly-built, research-aligned
capability (causal-provenance-conditioned memory recall) reachable for
the first time rather than fixing a live breakage.

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

* fixup(memory): correct causalGraph construction claim in causalRecall comments

Independent adversarial critique (Dream Cycle 2026-11-13) found the prior
commit's comments overstated that causalRecall is "same shape as
causalGraph" — causalGraph is actually built via agentdb's own
getController() switch, not the dynamic-import-and-construct pattern
causalRecall shares with learningSystem/explainableRecall. Cosmetic only;
does not change behavior. Re-ran the targeted suite (94/94) and
tsc --noEmit (clean) after this change.

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

* docs(dream-cycle): add 2026-11-13 memory SOTA gist

Gist publishing blocked by the environment's proxy policy ("Gist writes
are not permitted through this proxy", HTTP 403 on api.github.com/gists)
-- a different root cause than prior nights' broken GH_TOKEN, same
FALLBACK-for-remote-gist-publication outcome. Committed locally per
established convention; full report embedded in the issue as well.

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

* docs(dream-cycle): append 2026-11-13 ledger row

Issue #4982, PR #4983 (causalRecall wired into ControllerRegistry.initialize()).

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

* chore(memory): bump @claude-flow/memory to 3.3.3 for the causalRecall fix

CI's audit-leaf-package-publish.mjs (added 2026-11-02, ruvnet/ruflo#3335/
#3390/#3327 Finding A) flags any non-bundled @claude-flow/* leaf whose
publishable source changed without a version bump -- @claude-flow/memory
is resolved from the registry by @claude-flow/cli, not bundled into the
release tarball, so an unbumped source change here would silently never
reach a fresh install. PATCH bump (bug fix, no API/schema change) per
CLAUDE.md's semver policy.

This does not, by itself, turn the check fully green: the CLI's exact pin
(v3/@claude-flow/cli/package.json, still "3.3.2") now fails the sibling
range-coverage check, since 3.3.3 is not yet published and the pin cannot
honestly point at an unpublished version. Same unresolved shape as PR
#4973 (2026-11-12), which hit the identical gap bumping
@claude-flow/neural and left it to a human publish -- full resolution
needs `npm publish @claude-flow/memory@3.3.3` plus a CLI-pin bump in a
follow-up, which is outside this session's authority (see CLAUDE.md
"Publishing to npm").

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

* dream(intelligence): ReasoningBank.distill() discards failed trajectories, losing all pitfall-avoidance memory

ReasoningBank.distill() judged every trajectory but only distilled
successes into the retrievable memory pool; failures were judged then
unconditionally discarded. An accepted ICLR 2026 paper (ReasoningBank,
arXiv 2509.25140) measures that failure-aware distillation beats
success-only memory on web/SWE benchmarks, and Ruflo already has a
disconnected dual-track distiller (reasoningbank-adapter.ts) showing the
team built this pattern once and never wired it in.

- distill() now distills unsuccessful trajectories into a distinct
  memoryType: 'pitfall' memory (strategy framed as "AVOID: ...") instead
  of returning null, for any trajectory with at least one recorded step.
- completeTask()'s call into PatternLearner.extractPattern() is now
  gated on memoryType === 'success', so a pitfall can never be promoted
  into a positive-exemplar Pattern (independently confirmed by adversarial
  critique to be load-bearing: PatternLearner's own qualityThreshold
  (0.5) and ReasoningBank's distillationThreshold (0.6) already diverge,
  so a ~0.55-quality trajectory could reach extractPattern with no prior
  memoryType field to stop it).
- deduplicateMemories() is fixed forward: it would otherwise delete a
  pitfall memory that happens to share a near-identical embedding with a
  higher-quality success memory, treating opposite outcomes as
  duplicates -- a direct consequence of merging both types into one
  pool. Dedup now skips any pair whose memoryType differs.

Evaluated: stash-isolated baseline fails exactly the new/changed tests
(38/42 unaffected pass); candidate 43/43; full package 152/152, 0
regressions; related @claude-flow/memory learning-bridge suite 78/78;
tsc --noEmit clean. Independently reproduced by an adversarial critic
(verdict: CONFIRMED-WITH-CAVEATS -> forward-fixed -> re-verified).

Human review required. Do not self-merge.

* dream(intelligence): #5011 publish research gist (local, no gh gist access)

docs/dream-cycle/dream-gist-2026-11-17.md -- full SOTA report, competitor
comparison, hypothesis, evaluation receipt, and witness for issue #5011.

* dream(intelligence): #5011 append ledger row (PR #5012)

* dream(intelligence): #5011 bump @claude-flow/neural to 3.0.4 (CI: leaf-package-publish)

The "Plugin package install-safety" CI gate (audit-leaf-package-publish.mjs)
correctly flagged that this PR changes @claude-flow/neural's publishable
source (index.ts, reasoning-bank.ts, types.ts) without a version bump --
it's a non-bundled leaf per CLAUDE.md's Publishing Rules, so an unbumped
version means the fix would ship to nobody at release time. Bump to 3.0.4
(patch: bug fix, no breaking API removal) and keep @claude-flow/cli's
exact pin in lockstep to avoid introducing new cli-pin/workspace drift.

* dream(intelligence): #5011 sync v3/pnpm-lock.yaml for @claude-flow/neural@3.0.4

CI's "Smoke (no better-sqlite3)" and "Static regression guards" jobs both
failed with ERR_PNPM_OUTDATED_LOCKFILE after the prior commit bumped
@claude-flow/cli's @claude-flow/neural specifier without regenerating the
lockfile in the same commit. @claude-flow/neural resolves via
link:../neural regardless of specifier value (it's a local workspace
link, not a registry/integrity entry), so this is a minimal, surgical
specifier-only edit rather than a full `pnpm install --lockfile-only`
regen -- the latter pulled in unrelated pre-existing drift (@claude-flow/codex
and @claude-flow/memory switching to workspace links, a ruvector bump)
that has nothing to do with this PR. Verified locally with pnpm@8.15.0
(matching CI's pinned version, not this environment's default pnpm@10.28,
which produces a differently-shaped lockfile): `pnpm install
--frozen-lockfile --lockfile-only` now passes clean.

* dream(intelligence): #5011 bump root package.json's @claude-flow/neural range too

audit-wrapper-dep-ranges.mjs caught a third pin location I'd missed:
the root `claude-flow` umbrella package.json declares its own
"@claude-flow/neural": "3.0.3" dependency range, separate from
@claude-flow/cli's pin. Bumped to 3.0.4 to match. Did NOT touch
package-lock.json: its @claude-flow/neural entry carries a real
resolved/integrity hash from the npm registry for 3.0.3, and
@claude-flow/neural@3.0.4 is not yet published there -- regenerating it
would require either a real `npm install` (which fails ETARGET, same as
the CLI npx-install smoke failure already reported on this PR) or
fabricating a resolved URL/integrity for a tarball that doesn't exist,
which would be unsafe. Any CI job that runs `npm ci` at the repo root
will stay red for the same reason already documented on this PR: this
needs an actual npm publish of @claude-flow/neural@3.0.4, which is a
separate, human-authorized release action outside this session's scope.

* Revert "dream(intelligence): #5011 bump root package.json's @claude-flow/neural range too"

This reverts commit 96f0a32e56.

* dream(memory): #5033 CacheManager frequency-aware eviction (HTM-EAR-grounded)

Adds an opt-in, Darwin-tuned frequencyWeight/evictionScanWindow blend to
CacheManager's eviction policy. Default (unset/0) is byte-identical to the
existing pure-LRU tail eviction via an early return - zero behavior change
for every current caller (AgentDBAdapter, TieredCacheManager,
ControllerRegistry's tieredCache).

Motivated by HTM-EAR (arXiv:2603.10032, Feb 2026), which shows pure-LRU
eviction permanently drops high-access-frequency entries under skewed
access even though CachedEntry.accessCount already tracks exactly the
signal needed.

Evaluation: baseline 718/719 (1 pre-existing environmental failure) ->
candidate 722/723, tsc clean both ways, stash-isolated discriminating
tests fail on baseline exactly as predicted. Independently reproduced by a
fresh-context adversarial critic (verdict: CONFIRMED). Bounded 3-gen x
4-candidate Darwin sweep over a new synthetic skewed-workload benchmark
finds an interior optimum (frequencyWeight=0.85) that beats both the
baseline and a naive frequencyWeight=1.0 - full lineage persisted.

Full receipt in docs/dream-cycle/dream-gist-2026-11-18.md and issue #5033.

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

* dream(memory): #5033 witness finalization

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

* dream(memory): #5033 ledger update

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

* dream(memory): #5033 bump @claude-flow/memory 3.3.3 -> 3.4.0 + CLI pin

audit-leaf-package-publish flagged that this PR changes publishable
source in @claude-flow/memory (a non-bundled leaf that resolves from the
registry, not the release tarball) without a version bump - per
CLAUDE.md's Publishing Rules, that would ship nobody the fix.

Minor bump (backward-compatible: two new optional CacheConfig fields,
default-off). CLI's exact pin raised to match, mirroring PR #5021's
documented precedent for @claude-flow/cli-core: the leaf needs an actual
npm publish before a real release, which is a separately-authorized
human action out of scope for this PR. v3/pnpm-lock.yaml is deliberately
left unchanged (still resolving 3.3.3) until that publish happens - its
integrity entries can't be computed for an unpublished tarball, same
reasoning as #5021's "fill in the integrity after the publish".

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

* dream(memory): #5033 sync pnpm-lock.yaml specifier for the memory bump

pnpm install --frozen-lockfile was failing (ERR_PNPM_OUTDATED_LOCKFILE)
across ~14 CI jobs (Smoke, Type Check V3, Test V3 Packages, Plugin hooks
smoke, Windows hooks smoke, MCP paired-tool smoke, guard, etc.) because
v3/pnpm-lock.yaml still specified @claude-flow/memory@3.3.3 for the cli
importer after 7423f32 bumped package.json to 3.4.0.

Minimal hand-edit (2 lines), not a full `pnpm install --no-frozen-lockfile`
regeneration - that pulls in unrelated registry drift (ruvector/router
version bumps, dropped platform-optional entries) with no connection to
this change, which PR #5021 explicitly avoided for the same reason
("lockfiles are hand-edited to the minimum"). The cli importer's entry now
resolves via workspace link (`link:../memory`), matching how every other
importer in this lockfile already references @claude-flow/memory. Verified
locally: `pnpm install --frozen-lockfile` passes.

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

* fix(neural): keep distill()'s success-path threshold from #5012

#5012 dropped the distillationThreshold check for every trajectory. judge()
already applies it to success verdicts, but a verdict set without judge()
would now distill below threshold. Restore the check for successes only;
pitfalls are unaffected.

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

* chore(release): bump @claude-flow/neural 3.1.0 and @claude-flow/memory 3.4.0

One bump per touched leaf for the integrated dream-cycle fixes (both add
public surface: NeuralLearningSystem.serialize/deserialize,
DistilledMemory.memoryType, Trajectory.learnedFrom; LearningBridge statePath,
CacheConfig.frequencyWeight/evictionScanWindow). CLI and root umbrella pins
follow. pnpm-lock edited by hand (specifiers only, plus memory now linking
to the workspace since 3.4.0 is not yet on npm). The root package-lock.json
still records neural 3.0.3 and needs a refresh after the leaves publish
(same as 68c8d74b23 -> 3ce46cfa57).

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

* fix(neural): treat memories without memoryType as successes when deduplicating

ReasoningBank snapshots saved before #5012 have no memoryType, so the new
success/pitfall dedup guard never matched them against fresh success
memories. They only ever held successes; default the field accordingly.

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

* chore(deps): root lockfile resolves published @claude-flow/neural 3.1.0

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: r <r@x>
2026-11-19 01:44:33 -05:00
e7299de48c fix(security): daily scan 2026-11-18 — 2 fixes (#5032)
* fix(security): vulnerable zod pin in claude-flow umbrella

The zod 4 migration (#5021) describes bumping the root claude-flow
package from zod 3.25.76 to 4.6.7, but the root package.json and
package-lock.json still pin 3.25.76, which is affected by
GHSA-mrhx-c7xc-m3w5 (memory exhaustion while validating oversized
constrained collections, high). The umbrella ships the cli and shared
dist, which resolve zod from the umbrella's own dependency, so this pin
is what claude-flow users get, and it also leaves the migrated zod 4
code running against zod 3.

Pin zod 4.6.7 (matching every @claude-flow/* leaf) and update the
lockfile. npm deduped the nested zod 4 copies onto the hoisted one and
synced the stale @claude-flow/shared workspace version (3.0.8 -> 3.0.9)
in the lockfile. Remaining zod 3 copies come only from agentic-flow and
the published plugin-gastown-bridge.

Test: tests/root-zod-advisory-pin.test.mjs fails on main, passes here.

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

* fix(security): missing auth on /ws in shared MCP HTTP transport

@claude-flow/shared ships its own HttpTransport (exported via MCPServer
and createTransport). #4962 hardened the @claude-flow/mcp copy, but the
shared copy still accepted every /ws upgrade when token auth was
enabled, and nothing after the upgrade checked a token. Token auth is
the setting that lets the transport bind beyond loopback, so that
configuration exposed every registered MCP tool over /ws without
credentials. The HTTP check also accepted any bearer token when the
token list was empty or unset, and compared tokens in non-constant time.

- verifyClient authenticates the upgrade when auth is enabled
  (Authorization: Bearer, or ?token= for browsers, parsed against a
  fixed base URL; never throws).
- Token matching fails closed on an empty list, skips unset entries,
  and compares SHA-256 digests with timingSafeEqual, no early exit.

Test: shared/__tests__/mcp/http-transport-ws-upgrade-auth.test.ts
(2 of 4 cases fail on main, all pass here).

shared is a non-bundled leaf: it needs a standalone publish to reach
direct consumers.

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

* fix(security): keep legacy v3/mcp tools compiling on zod 4

Follow-up to the root zod 4.6.7 pin: zod 4 removed the single-argument
z.record(value) form, so the 17 call sites in v3/mcp/tools added type
errors to the root tsc build. Use z.record(z.string(), z.unknown()),
the same rewrite #5021 applied to the @claude-flow packages. The root
build error set is now identical to origin/main.

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

* chore(shared): 3.0.10 for the /ws auth fix; CLI pins it

The shared transport fix is publishable source in a non-bundled leaf, so
the leaf-package-publish gate requires a version bump. Bump shared to
3.0.10 and the CLI's exact pin (pnpm lock specifier only; it stays a
workspace link).

Not done here, because it needs the published tarball: the root
claude-flow pin and package-lock.json entry stay at 3.0.9 until
@claude-flow/shared@3.0.10 is on npm (the lockfile needs its integrity
hash). Until then audit-leaf-versions-published and
audit-wrapper-dep-ranges report the unpublished pin, as designed.

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

* fix(security): claude-flow umbrella pins @claude-flow/shared 3.0.10

shared 3.0.10 (the /ws auth fix) is now published; the umbrella's exact
range must include it or audit-wrapper-dep-ranges fails and npx installs
resolve two shared copies.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: r <r@x>
2026-11-18 23:51:47 -05:00
edf7ddb3fe fix(security): transport and WebSocket limits (#4752) (#4962)
* fix(security): enforce transport and WebSocket limits (#4752)

- x-gateway ws-proxy: release a connection slot once per connection;
  close/error on both sockets decremented `active` up to four times,
  which defeated the 500-connection cap.
- mcp http transport: /ws now has maxPayload (maxMessageSize, default
  10 MiB) and checks the bearer token in verifyClient, before the
  upgrade, using the same Authorization header as the HTTP routes
  (no ?token=). Unset token entries are skipped instead of throwing.
- mcp http transport: cap legacy SSE streams on GET /mcp
  (maxSseClients, default 100); extra streams get 503 + Retry-After.
- agent-federation fallback WebSocket listener: maxPayload (default
  4 MiB, configurable) instead of the ws 100 MiB default.
- agentbbs sync: redirect "error", reject an oversized Content-Length
  up front, and stream the body with a running byte cap instead of
  buffering it whole.

Each limit has a test.

* fix(mcp): keep ?token= on /ws, checked before the upgrade (#4752)

Browsers cannot set Authorization on a WebSocket, so dropping ?token=
would cut browser clients off /ws and make the HTTP transport behave
differently from the standalone WebSocket transport. verifyClient now
takes the token from the Authorization header or, failing that, from
?token=, still before the upgrade and still failing closed on an empty
token list. ADR-479 describes the new check.

Also:
- maxMessageSize and maxSseClients fall back to their defaults unless
  they are positive numbers.
- shared/src/mcp/transport/http.ts: /ws gets maxPayload (maxMessageSize,
  default 10 MiB) instead of the ws 100 MiB default.

* chore(ruflo-x-gateway): bump to 0.10.5 for the ws-proxy slot fix

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

* chore(leaves): shared 3.0.9 for the /ws payload cap (#4752)

The /ws maxPayload change in shared/src/mcp/transport/http.ts only reaches
users through a standalone shared publish. shared 3.0.9 is published; the CLI
and root manifests pin it and both lockfiles follow.

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

* test(ci): list the x-gateway ws-proxy node:test file with its siblings

Root vitest cannot run plugins/ruflo-x-gateway node:test files (they run via
the plugin's npm test), so each one is listed in ci-test-baseline.txt. The new
ws-proxy test was missing, which failed the ratchet with 'No test suite found'.

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

---------

Co-authored-by: Rutvij97 <218486544+Rutvij97@users.noreply.github.com>
Co-authored-by: rUv <ruv@ruv.net>
Co-authored-by: r <r@x>
2026-11-17 23:15:27 -05:00
9456ae1eb5 integrate: zod 4 migration (#4535) (#5021)
* fix(deps): migrate @claude-flow packages from zod 3 to zod 4

zod 3.25.76 is affected by GHSA-mrhx-c7xc-m3w5 (memory exhaustion while
validating oversized constrained collections, High). The fix exists only
in zod 4.6.6+, so downstream lockfiles cannot clear it while
@claude-flow/{cli,security,shared,hooks,claims} require zod ^3.

Forcing zod 4 onto the current releases breaks them at runtime, which is
what this migration fixes:

- security/input-validator: z.string().ip() was removed. It threw at module
  load, so importing @claude-flow/memory failed and the AgentDB bridge
  silently degraded (memory_store returned "Database not initialized").
  Use z.ipv4() and z.union([z.ipv4(), z.ipv6()]).
- security/input-validator: the global error map used the zod 3 signature
  and returned ctx.defaultError. zod 4 calls the map without ctx, so every
  unmapped issue raised a TypeError instead of a ZodError, process-wide.
  Port it to z.config({ customError }) and map invalid_format by format.
- shared/config/validator: ZodError.errors was removed; use .issues.
  Invalid configs threw a TypeError instead of returning errors.
- z.record(valueSchema) -> z.record(z.string(), valueSchema), and the
  removed ZodTypeDef / SafeParseReturnType types.
- Root claude-flow package: zod 3.25.76 -> 4.6.7 (root CI resolves zod
  from here). fastmcp's nested zod 4.3.5 now dedupes onto 4.6.7.

New tests fail on main with zod 4 installed and pass after:
security/__tests__/zod4-compat.test.ts, shared/__tests__/zod4-config-validator.test.ts.

Still on zod 3 after this change: agentic-flow (separate repo, ^3.25.76)
and the published @claude-flow/plugin-gastown-bridge 0.1.4.

Claude-Session: https://claude.ai/code/session_0157fpfsb1SsSv3XAL3oxF1E

* fix(zod4): keep custom agent types, foreign ZodErrors and UUID parity

Follow-ups from an adversarial review of the zod 4 migration:

- cli-core validateAgentSpawn swallowed only `invalid_enum_value`. zod 4
  reports an out-of-enum value as `invalid_value`, so wherever
  @claude-flow/security resolves (any hoisted install) every custom agent
  type would be rejected. Extract isUnknownAgentTypeIssue(), accept both
  codes, and only for the `type` path. The existing "custom type" test used
  memory-specialist, which is in the enum, so it never reached this branch;
  the new test drives the rule with real SpawnAgentSchema issues.
- shared ConfigValidator: recognise a ZodError from another zod copy by
  shape (callers may pass zod 3 schemas), and stringify path segments so a
  symbol key cannot make path.join() throw.
- security UUIDSchema: zod 4's uuid() is strict RFC 9562 and rejected ids
  zod 3 accepted (e.g. 00000000-0000-0000-0000-000000000001). Use z.guid(),
  which keeps zod 3's 8-4-4-4-12 hex check.

Each new assertion fails when its fix is reverted.

Claude-Session: https://claude.ai/code/session_0157fpfsb1SsSv3XAL3oxF1E

* fix(zod4): report a missing agent type; reject impostor ZodErrors

Second adversarial round on the zod 4 migration:

- zod 4 raises `invalid_value` at ['type'] for a missing, null or
  non-string agent type, where zod 3 raised `invalid_type`. The previous
  fix suppressed every `invalid_value` at that path, so
  validateAgentSpawn({}) passed. Suppress only when the submitted type is
  a string and the issue path is exactly ['type'] (zod 3 parity).
- isZodErrorLike now requires a non-empty issues array of {path, message,
  code} objects, so an operational Error that happens to be named
  ZodError still propagates.

Each new assertion fails when its guard is removed.

Claude-Session: https://claude.ai/code/session_0157fpfsb1SsSv3XAL3oxF1E

* fix(plugins): build and run the v3 plugins under zod 3 and zod 4

The install-safety job builds v3/plugins against the repo-root zod, which this
branch moves to 4. Six plugins failed to typecheck, and two also broke at runtime:

- z.record(v) -> z.record(z.string(), v). zod 4 needs the key schema; the
  one-argument form also fails at parse time, not only in tsc.
- z.ZodTypeDef is gone in zod 4. ZodType<TInput, any, any> is valid under both
  majors (zod 3 reads <Output, Def, Input>, zod 4 <Output, Input, Internals>).
- prime-radiant: zod 4 returns a .default() value without parsing it, so
  .default({}) dropped every nested config default. Default to Schema.parse({}).
- gastown-bridge: ZodError.errors no longer exists (use .issues, present in
  both), and zodToJsonSchema called _def.shape(), which is an object in zod 4.
  It threw inside a try and returned an empty schema for every MCP tool.

The plugins keep their declared zod ranges and lockfiles; the code now
typechecks and passes under zod 3.25.76 and zod 4.6.7. New tests fail
against the previous source.

Claude-Session: https://claude.ai/code/session_0157fpfsb1SsSv3XAL3oxF1E

* chore(leaves): bump cli-core to 3.7.6 and shared to 3.0.7 for the zod 4 change

Both are non-bundled leaves, so the zod 4 source changes reach nobody until
they are published (audit-leaf-package-publish). Bumped the CLI's pins and the
pnpm-lock specifiers to match, as in b0bd254ec. The root claude-flow pins stay
on the published 3.7.5 / 3.0.6 until these two are published, because pinning
an unpublished version breaks `npm install` at the root.

Claude-Session: https://claude.ai/code/session_0157fpfsb1SsSv3XAL3oxF1E

* chore(root): pin claude-flow to cli-core 3.7.6 and shared 3.0.7

audit-wrapper-dep-ranges requires the umbrella's pins to include the
workspace versions bumped in the previous commit. Requested by the
maintainer on #4535.

Until both versions are on npm, root `npm ci` fails with ETARGET and
package-lock.json cannot be regenerated, so it is left unchanged here.
After the standalone publish, run `npm install --package-lock-only` at
the root and commit the lockfile.

Claude-Session: https://claude.ai/code/session_0157fpfsb1SsSv3XAL3oxF1E

* chore(leaves): cli-core 3.7.8 for the zod 4 agent-type fix; cli on zod ^4.6.7

validate-input.ts changed (isUnknownAgentTypeIssue), and cli-core is a
non-bundled leaf of @claude-flow/cli, so it needs its own version and a
standalone publish before this merges:

- @claude-flow/cli-core 3.7.7 -> 3.7.8; cli and claude-flow pins follow.
- @claude-flow/cli zod ^3.22.0 -> ^4.6.7.

Lockfiles are hand-edited to the minimum: v3/pnpm-lock.yaml moves only the
cli importer's cli-core/zod specifiers and the zod peer suffix of the
memory/agentdb/ruvector entries it already resolves to; package-lock.json
moves only the cli-core entry. Its integrity is left blank until 3.7.8 is
on the registry (npm fills it on the next install).

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

---------

Co-authored-by: Dragan Spiridonov <spiridonovdragan@gmail.com>
Co-authored-by: r <r@x>
2026-11-17 22:49:51 -05:00
rUvandr b9398c7306 chore(release): 3.77.2 (#5026)
Co-authored-by: r <r@x>
2026-11-17 16:48:58 -05:00
rUv 44a48fa064 docs: add opt-in RVF MCP search recipe and package discovery metadata (#4896) 2026-11-17 11:19:32 -05:00
rUvandr 3a1479883b chore(release): 3.77.1 (#4986)
Ships the #4984 fix: AgentDB now uses the configured embedding model and
dimension, via @claude-flow/memory 3.3.3 (published) and the CLI memory bridge.

Co-authored-by: r <r@x>
2026-11-13 15:52:31 -05:00
randRuFlo b048f27b62 chore(release): 3.77.0
neural wsp: optional ruv-FANN weight-space tooling (ADR-528, #4967).
Also ships since 3.76.1: opt-in model-judge routing in ruflo-mods 0.17.0 (#4969, off by default),
scan_secrets non-ASCII fix (#4970), Windows npm redirect fixes (#4971).

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-12 16:00:27 -05:00
randRuFlo 49cc62e772 chore(release): 3.76.1
auto-memory import/sync now exit 1 when @claude-flow/memory is unavailable (#4963, #4974).

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-12 14:14:45 -05:00
randRuFlo 3193d99ecb chore(release): 3.76.0
@claude-flow/cli, claude-flow and ruflo 3.76.0. Carries #4953 (opt-in centroid
agent router, ADR-527), #4956 (darwin ~0.14.0), #4958 (neural router assets
shipped), #4955 (memory 3.3.2, agentdb ^3.10.0), #4948, #4946 and #4949.
alpha/v3alpha stay at 3.75.2.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-11 08:18:30 -05:00
randRuFlo 8421e87322 chore(release): 3.75.3
@claude-flow/cli, claude-flow and ruflo 3.75.3. Carries #4905 (shared 3.0.8,
zod 4), #4947 (memory 3.3.1 pin), #4943, #4935, #4934, #4936 and #4938.
ruflo-graph-intelligence plugin 0.3.1 (the version audit ignores prerelease
tags, so 0.3.0 did not count as a raise over 0.3.0-alpha.1).

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-10 14:09:19 -05:00
r 375070d0e1 Merge remote-tracking branch 'origin/weaver/ruflo-shared-zod4' into release/3.75.3 2026-11-10 14:08:38 -05:00
randRuFlo e3dbd8b216 chore(cli): pin @claude-flow/shared 3.0.8 (zod 4) in cli and root
shared 3.0.8 is on npm, built from this branch's head 824b38a75 (dist
byte-identical to a local build of that commit). The cli importer now
links the workspace shared; the orphaned registry shared@3.0.7 entry is
dropped from the pnpm lock.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-10 13:05:57 -05:00
randRuFlo 9d1202e40c chore(release): 3.75.2
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-10 11:35:33 -05:00
randRuFlo 7cb8603b7f fix(release): ship zod 4 inside the bundled security package; release 3.75.1 (#4940)
@claude-flow/cli 3.74.1 and 3.75.0 (and the claude-flow umbrella) bundle
@claude-flow/security 3.0.7, which needs zod >=4.6.7, while the wrappers
keep zod 3. The staging script stripped the nested dependencies, so
security's `import 'zod'` resolved to zod 3 and the root export threw
`z.config is not a function`.

Declaring the dependency is not enough: npm never installs the
dependencies of a bundled package (checked against the 3.75.0 tarball).
The stager now vendors declared leaf dependencies into the bundled
package's own node_modules, checks the workspace copy satisfies the
declared range, and refuses a dependency that has dependencies itself.

The npx-install smoke now imports every bundled runtime package from the
installed CLI, so this fails CI instead of users.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-10 08:40:27 -05:00
randRuFlo d8f8b59da6 chore(release): 3.75.0
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-09 19:37:54 -05:00
r d5cffcba75 Merge remote-tracking branch 'origin/main' into chore/codex-3.0.8
# Conflicts:
#	package-lock.json
#	package.json
#	v3/@claude-flow/cli/package.json
2026-11-09 19:00:12 -05:00
randRuFlo ebeb58d8cf chore(codex): release 3.0.8 (single-source dual init #2638, registered tool names #3153); CLI and root pin 3.0.8
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-09 18:34:18 -05:00
randRuFlo c56f57c42d chore(cli): pin @claude-flow/cli-core 3.7.7 (published)
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-09 18:05:01 -05:00
randRuFlo ee2f94ad07 fix(release): refuse to publish helpers that differ from HEAD; release 3.74.1
@claude-flow/cli@3.74.0 shipped 3.63.4 .claude/helpers. The committed
package stamp (.helpers-version) reads 3.57.1, so hook-spawned daemons
running an older checkout's CLI (3.63.4) saw the worktree's helpers as
stale and rewrote them between prepare and npm publish. verify-helpers
passed because it signs and checks whatever is on disk.

prepare-publish now diffs .claude/helpers against HEAD before signing
and again after verifying, and throws if any helper content changed
(the regenerated manifest and stamp are excluded). Tested: a dirtied
helper is refused, and a live daemon overwrite during a clean run was
caught.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-09 01:06:05 -05:00
rUv bc480847d8 Merge pull request #4898 from ruvnet/feat/darwin-dependency
feat(metaharness): @metaharness/darwin as a regular dependency, in-process (ADR-526); release 3.74.0
2026-11-08 23:34:08 -06: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 7404888a50 fix(cli-core): accept zod 4's invalid_value for custom agent types; cli-core 3.7.6
validateAgentSpawn() runs @claude-flow/security's SpawnAgentSchema and
skips the enum miss for custom agent types by matching
`invalid_enum_value`. That is zod 3's code; zod 4 reports
`invalid_value`, so with security on zod 4 every custom agent type was
rejected. agent_spawn and the hive-mind suites failed in CI (5 files).
It now accepts both codes.

cli-core resolves from the registry (non-bundled leaf), so this bumps it
to 3.7.6, which is already published, and moves the cli and claude-flow
pins and the root lockfile to it.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-11-08 21:50:20 -05:00
ruv d77ecbe0bd fix(security): migrate input-validator to zod ^4.6.7 (GHSA-mrhx-c7xc-m3w5)
zod < 4.6.6 can exhaust memory while validating oversized constrained
collections (high severity). @claude-flow/security declared zod ^3.22.0,
so every consumer of it (memory, hooks, codex, federation and the cli
bundle) carried a vulnerable zod. A fresh `npm i @claude-flow/memory@3.2.4`
reports 3 high findings via @claude-flow/security -> zod 3.25.76.

API changes handled:
- z.setErrorMap(fn(issue, ctx)) -> z.config({ customError }), with
  invalid_string/validation becoming invalid_format/format. Messages given
  to a check still take precedence; undefined falls back to zod's default.
- z.string().ip({version}) -> z.ipv4() / z.union([z.ipv4(), z.ipv6()]),
  keeping the messages.
- z.record(value) -> z.record(z.string(), value).
- SafeParseReturnType/ZodSchema -> ZodSafeParseResult/ZodType.

The workspace lockfile also drops zod 4.3.5 (vulnerable). Version 3.0.7,
and the cli and claude-flow pins move to 3.0.7. Publishing
@claude-flow/security only; the cli and claude-flow ride the release lane.

Tests: the existing 631 pass. input-validator-zod4.test.ts pins the
installed zod at >= 4.6.6, the IP schemas, message precedence, the global
map and the record schemas.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-11-08 21:11:43 -05:00
randRuFlo a8b3304b1e release: ship plugin-agent-federation 1.0.7 (GHSA-vcv2-r9jh-99m5 peer range)
#4890 bumped the bundled federation leaf to 1.0.7 (published) but left the
CLI and root pins at 1.0.6. Move both pins (and the lock specifiers) so the
bundled copy and its declared version agree.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-08 19:50:33 -05:00
randRuFlo 0876443637 release: 3.73.0
Bumps @claude-flow/cli, claude-flow and ruflo to 3.73.0 (ruflo pins cli
3.73.0; ruflo/server.json follows). Minor: init first-win, opt-in
activation events with --no-telemetry-prompt, plugin-surface tagging.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-08 18:43:27 -05:00
ruv e3e5f77106 chore(deps): federation midstreamer ^0.3.2, aidefence agentdb ^3.6.0, watermark private
- @claude-flow/plugin-agent-federation 1.0.6: optional peer midstreamer
  >=0.3.1 -> ^0.3.2. 0.3.1 ships no wasm or entry point, so it can't be
  imported; 0.3.2 is the first importable release.
- @claude-flow/aidefence 3.1.1: optional peer agentdb >=2.0.0-alpha.1 ->
  ^3.6.0, matching the ecosystem's agentdb 3.6 convergence.
- @claude-flow/cli: pins @claude-flow/aidefence 3.1.1 and
  @claude-flow/plugin-agent-federation 1.0.6, and agentdb ^3.6.0. Root
  claude-flow pins federation 1.0.6. These ride the next cli release.
- @claude-flow/watermark: private. ruvnet/ai-text-watermark publishes
  @claude-flow/watermark from 0.3.0 on (npm latest 0.4.1); this 0.2.0 copy
  is stale and must never be published over it.

Both released tarballs are byte-identical to 3.1.0 / 1.0.5 apart from
package.json. v3/pnpm-lock.yaml regenerated with pnpm 8.15.0, root
package-lock.json with npm --package-lock-only.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-11-06 12:27:47 -05:00
randRuFlo 578bcb1b9c fix(deps): claude-flow declares @ruvector/attention as a dependency, not optional
On npm 10 / Node 20, @ruvector/ruvllm-gpu-loop (engines node >=22) fails as an
optional install. npm then drops @ruvector/ruvllm and ruvector with it, and
also @ruvector/attention, because the umbrella reached it only through
optional edges. On main, a non-optional dev path kept 0.1.31 at the root,
which hid the problem. CI's Test Suite (ubuntu, Node 20, npm 10.8.2) then
failed with "Cannot find module '@ruvector/attention'" in the performance
tests.

attention has no install scripts and its platform binaries stay optional,
so a regular dependency cannot fail an install. It also guarantees the
2.2.3 security fix is present even where the ruvector subtree is dropped.
Verified in node:20: npm ci installs attention 2.2.3 and it loads.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-06 08:15:57 -05:00
randRuFlo 1755052ddf fix(deps): @ruvector/attention ^2.2.3 via ruvector ^0.3.13; neural sona 0.1.11; release 3.72.2
- claude-flow 3.72.1 declared @ruvector/attention ^0.1.3, which resolves to
  0.1.32, without the input-validation / NAPI panic fix in 2.2.3
  (RuVector #1365). ruvector 0.3.12 also depended on ^0.1.3. ruvector
  0.3.13 moves to attention ^2.2.3 and sona ^0.1.11.
  - CLI and umbrella: ruvector ^0.3.13
  - umbrella: attention ^2.2.3 and sona ^0.1.11
  - ruflo override: ruvector ^0.3.13
- @claude-flow/neural 3.0.3 pins @ruvector/sona 0.1.11 (was 0.1.5, see #4844).
- neural benchmark: the attention benchmark never ran. import() of the
  CommonJS package put the classes on `default`, and it called
  computeRaw(), which no release has; the classes expose compute(). Each
  ruflo attention call was checked on 0.1.32 and 2.2.3 with identical
  results.
- v3/pnpm-lock.yaml: pnpm 8.15.0 --lockfile-only; every @claude-flow/* is
  still link:, and rabitq-wasm still resolves 0.1.2 for the CLI.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-06 07:41:59 -05:00
randRuFlo 68c8d74b23 fix(neural): move @ruvector/sona 0.1.5 -> 0.1.10 (@claude-flow/neural 3.0.3)
@claude-flow/neural pinned @ruvector/sona at exactly 0.1.5, five releases
behind. The same probe was run against both versions with the wrapper's
SonaEngine.withConfig shape:

- applyMicroLora with a wrong-length vector: 0.1.5 panics in
  crates/sona/src/lora.rs and aborts Node (exit 134); 0.1.10 throws
  "input length 1 does not match hiddenDim 16", which the caller can catch.
- 30 trajectories + forceLearn, then findPatterns: 0.1.5 returns 0
  patterns; 0.1.10 returns 3 (upstream #1258: MicroLoRA learns from
  feedback, EWC++ takes effect).

neural is a non-bundled leaf, so the fix reaches users only through a
standalone publish of @claude-flow/neural@3.0.3. The CLI and umbrella
pins move to 3.0.3 with it. audit-leaf-versions-published fails until that
publish happens, and that failure is the intended gate.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

* release: 3.72.1

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

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

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

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

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

---------

Co-authored-by: r <r@x>
2026-11-05 20:50:18 -06:00
randRuFlo 4943f24efe release: 3.72.0
Minor bump: ADR-524 adds MCP 2026-07-28 support (server/discover, new
error codes, result fields). Supersedes the unpublished 3.71.5 bump.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-05 17:54:03 -05:00
randRuFlo 6a7097a3ab release: 3.71.5
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-05 09:56:17 -05:00
randRuFlo 95328e7762 release: 3.71.4
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-04 21:38:12 -05:00
randRuFlo 9045ab8477 release: 3.71.3 — Claude Code 2.1.318 adoption, narrow band, AutoMemory persistence, daemon stop, sweep fixes; performance 3.0.1, browser 3.0.1
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-04 18:52:18 -05:00
randRuFlo af95dd71a0 release: 3.71.2 — PR sweep fixes (embeddings, session, memory paging, claims, terminal, security) + providers 3.0.1
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-04 13:18:23 -05:00
randRuFlo 2a75e765c3 chore(release): 3.71.1 — shared 3.0.7, mcp 3.1.6, plugin-agent-federation 1.0.5
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-04 03:30:34 -05:00
rUv 5f3dacc54b feat(mods): automatic context delegation (ruflo-mods 0.15.0, ADR-522) + release 3.71.0 (#4652)
* feat(mods): automatic context delegation (ruflo-mods 0.15.0, ADR-522) + release 3.71.0

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

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

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

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

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

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01MfPHVHXWyvDvDtYMTsA6MP
2026-11-01 15:14:10 -05:00
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