mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-09 14:04:06 +09:00
* dream(intelligence): wire real Fisher-information estimation into SONAManager's EWC++ path
SONAManager's EWC++ catastrophic-forgetting mechanism was completely inert:
ewcState.fisher/.means were initialized empty and never written anywhere in
the core @claude-flow/neural package; consolidateEWC() (the only method
touching fisher post-init) only decayed an always-empty map and had zero
callers. Every computeEWCPenalty/computeEWCLoss call across all 5 learning
modes therefore always evaluated to exactly 0, in production (SONAManager
backs NeuralLearningSystem, loaded by @claude-flow/memory's learning-bridge).
Scoped fix (default 'balanced' mode only): BalancedMode now exposes
getConsolidationSnapshot(), deriving Fisher as squared-gradient and means as
the raw gradient from its existing gradientAccumulator (mirroring a working
reference pattern already in this monorepo's
plugins/cognitive-kernel/src/bridges/sona-bridge.ts). SONAManager's
triggerLearning() folds this into ewcState via the existing (unchanged)
consolidateEWC() decay step, then additive accumulation - online-EWC style.
Also removes 6 stale, never-gitignored .js files under
v3/@claude-flow/neural/src/modes/ that shadowed the current .ts sources for
any explicit .js-extension import (Vite/Vitest resolve a literal file on
disk over transforming a sibling .ts) and were themselves circularly broken
- this was blocking any vitest test of SONAManager/mode classes from ever
exercising real logic, confirmed via git-stash to reproduce identically on
the pre-candidate baseline and to be a necessary precondition for tonight's
evaluation, not part of the EWC logic change itself.
Disclosed scope limit: this makes the EWC *state* real and measurable; the
computed penalty is not yet wired into the gradient update itself (same gap
already disclosed as a stub in the reference plugin's own consolidate()).
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH3LBmCGHLADvSaqWs2
* dream(intelligence): fix forward per independent adversarial critique
Round-2 fixes from an independent adversarial-critic pass on commit
2c5bcb177:
- getConsolidationSnapshot() now reports the CHANGE in gradientAccumulator
since the last consolidation (a delta), not the raw lifetime-cumulative
accumulator. Squaring the ever-growing cumulative value directly (the
original candidate) made Fisher/means diverge without bound over a
long-running session - confirmed empirically by the critic (25 cycles:
0.00012 -> 0.68) and reproduced independently here (150 cycles). The
delta-based version is a strict improvement (Fisher now reflects "what
changed", the theoretically appropriate EWC quantity) but does NOT fully
solve divergence by itself: traced the remaining growth to a separate,
deeper, pre-existing behavior one layer up - triggerLearning() reprocesses
every completed trajectory still held by the manager on every call (no
"already learned from" tracking; only pruneTrajectories()'s 50%-capacity
threshold ever removes one), so BalancedMode.learn()'s gradient movement
per cycle grows with the historical backlog, not just what's new. Fixing
that is a distinct, larger-blast-radius change (trajectory lifecycle, not
EWC) - disclosed in the test file's docstring and carried forward as a
priority candidate for a future night, explicitly ahead of ever wiring
computeEWCPenalty() into a real gradient update.
- Rescoped the "Fisher == means^2" test to state plainly it's a
single-cycle construction-time identity (true by the snapshot's own
arithmetic when there's no prior snapshot to diff against), not an
ongoing system invariant - confirmed by the critic to break after cycle 2.
- Finished the stale-build-artifact cleanup in src/modes/ that the prior
commit started: removed the remaining tracked .d.ts/.d.ts.map/.js.map
siblings (12 files) plus a stray tmp.json, same never-gitignored,
out-of-sync-with-source bug class as the .js files removed in the prior
commit. src/modes/ now contains only .ts sources.
- Fixed a path citation (plugins/... -> v3/plugins/...) in comments/tests.
143/143 tests pass, 0 tsc errors, build clean - re-verified after each
change in this commit.
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH3LBmCGHLADvSaqWs2
* dream(intelligence): add research gist for 2026-10-27
Full SOTA report: 5-role parallel research fan-out, 6-row graded 2026
external-research table, 5-row competitor comparison (genuine "None" across
LangGraph/AutoGen/CrewAI/OpenAI agent tooling, explained), the frozen
hypothesis with explicit scope disclosure, the evaluation receipt including
the independent adversarial critique's findings and this session's fix
forward, and 4 deferred/scored candidates plus 2 scan findings
(capabilities, memory) carried to a future night. Witness stamp computed
from the final file content.
No gh gist create / gist-equivalent MCP tool reachable this session (same
disclosed FALLBACK as every night since 2026-09-30) - committed here
instead, per established convention.
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH3LBmCGHLADvSaqWs2
* docs(dream-cycle): append 2026-10-27 ledger row
Issue #4531 / PR #4532 / witness 7b524483... — ACCEPT-scoped, post-critique.
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH3LBmCGHLADvSaqWs2
* fix(neural): bump @claude-flow/neural to 3.1.0 for the EWC fix
CI's audit-leaf-package-publish.mjs (ruvnet/ruflo#3335/#3390 guard) failed:
@claude-flow/neural is a non-bundled leaf that resolves from the npm
registry at release time, not from this PR's source. Its publishable
source changed (the EWC Fisher-wiring fix) but package.json's version was
still 3.0.0 - a release right now would ship the OLD, still-broken copy
and this fix would reach nobody.
Bumped neural 3.0.0 -> 3.1.0 (adds a new optional ModeImplementation
member, getConsolidationSnapshot, in addition to the bug fix - a
backward-compatible addition, MINOR per CLAUDE.md's versioning policy) and
the CLI's exact pin to match. Verified locally: audit script passes
(version bumped, CLI range satisfied), full neural suite 143/143, build
clean.
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH3LBmCGHLADvSaqWs2
* fix(deps): regenerate v3/pnpm-lock.yaml for the neural version bump
The 3.0.0 -> 3.1.0 bump to @claude-flow/cli's @claude-flow/neural dependency
spec (previous commit) was made by hand, without regenerating the lockfile
- CI's --frozen-lockfile installs correctly rejected it with
ERR_PNPM_OUTDATED_LOCKFILE across every job that runs one (Memory import
smoke, Windows hook execution smoke, statusline generator delegation smoke,
Smoke (no better-sqlite3), and others).
Regenerated via `pnpm install --no-frozen-lockfile` (the repo's own
tooling, not a hand edit) inside v3/. The only intended change is the
@claude-flow/neural specifier; the diff also picked up an incidental
@opentelemetry/api 1.9.0 -> 1.9.1 transitive bump across vitest's
resolution entries, which is pnpm's own resolver picking a newer
compatible published patch, not something this PR intentionally touches.
Verified locally: `pnpm install --frozen-lockfile` now succeeds, full
@claude-flow/neural suite still 143/143.
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH3LBmCGHLADvSaqWs2
* fix(cli): revert neural pin to the published 3.0.0, not an unpublished 3.1.0
My previous fix bumped @claude-flow/cli's @claude-flow/neural dependency
spec to 3.1.0 to satisfy the "Plugin package install-safety" leaf-publish
audit - but 3.1.0 has never been published to npm (confirmed: `npm view
@claude-flow/neural versions` lists only up to 3.0.0). That pin broke a
REAL, more severe check: "CLI npx-install smoke" packs the actual CLI
tarball and runs a real `npm install` against it, which failed with
`ETARGET: No matching version found for @claude-flow/neural@3.1.0` - i.e.
a real `npx @claude-flow/cli` user would hit this exact error today.
Publishing @claude-flow/neural@3.1.0 to npm is a human-gated release
action (signing keys, GCP secrets, WebAuthn - see CLAUDE.md's "Publishing
to npm"), not something this session does autonomously from an unreviewed
nightly research PR. Reverted the CLI's pin to 3.0.0 (the real published
version) and regenerated the lockfile to match.
This leaves one disclosed, expected finding in "Plugin package
install-safety": @claude-flow/neural's own package.json is now ahead of
the CLI's pin (3.1.0 source vs 3.0.0 pinned) - exactly the state CLAUDE.md
describes as needing a human to "publish @claude-flow/neural@3.1.0 and
raise the range" as part of an actual release, not a code fix. Noted on
the PR rather than resolved by further pushes.
@claude-flow/neural's own suite remains 143/143, build clean - unaffected,
since its tests exercise the local TS source directly.
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH3LBmCGHLADvSaqWs2
* fix(neural): drop the 3.1.0 bump and restore main's lockfile
The bump broke the umbrella's @claude-flow/neural range check and forced a
lockfile regen that flipped @claude-flow/memory to a registry copy. The EWC
change ships as the next neural release, bumped at release time.
Co-Authored-By: RuFlo <ruv@ruv.net>
* fix(neural): anchor EWC means on the parameters at consolidation
computeEWCPenalty() measures current - means against the cumulative
gradient accumulator, so means must be that accumulator at consolidation
(theta*). Storing the per-cycle delta made the penalty start at roughly the
previous parameter value instead of zero. New test fails on the delta and
passes on the fix; neural suite 144/144, tsc clean.
Co-Authored-By: RuFlo <ruv@ruv.net>
* chore(neural): bump to 3.0.1 for the EWC++ consolidation fix (#4531)
The CLI and root pins move with it so the release carries the fix.
Co-Authored-By: RuFlo <ruv@ruv.net>
* chore: lock @claude-flow/neural 3.0.1 from the registry
Co-Authored-By: RuFlo <ruv@ruv.net>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: r <r@x>