Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

Merge branch 'pr-3378' into integ/train-3.45.1

ruvf13a853749d3
diff --cc docs/dream-cycle/LEDGER.md
index db6fb6c957,4e3a0734f6..16fc6f4567
--- a/docs/dream-cycle/LEDGER.md
+++ b/docs/dream-cycle/LEDGER.md
@@@ -193,22 -193,6 +193,25 @@@ as a first-class, high-priority candida
| 2026-09-11 | security | `hive-mind_consensus` accepted votes from any caller-supplied `voterId` with no check against `state.workers` (a single caller could cross any strategy's quorum by voting under fabricated identities β€” a Sybil attack on consensus); fail-closed roster-membership check added. **Update (ruvnet review):** REJECTed the initial scoped fix on the caveat the adversarial critic had already disclosed (`hive-mind_join`/`leave` fully unauthenticated β€” the roster itself could be Sybil'd) plus a required-CI cold-install failure (`@claude-flow/security` missing a `prepare` script, so root `npm ci` never built its dist/). Both addressed same-session: `join`/`leave`/`vote` now capability-bound to a `hiveToken` minted by `hive-mind_init` (32-byte random, constant-time comparison, fail-closed β€” zero state change for denied calls, verified via a fresh state.json reload simulating restart; a same-machine-only token reader lets the CLI's own subcommands keep working without exposing the token over any MCP response); `@claude-flow/security`'s `package.json` gained a `prepare: npm run build` so root `npm ci` builds it automatically for every consumer, not just this CI job | #3290 | #3291 | yes | ACCEPT-scoped (post-review) | stash-isolated 2/3 fail baseline (forged votes silently accepted) β†’ 3/3 pass candidate; full `@claude-flow/cli` suite failures 46β†’28 after the CI fix (remainder pre-existing/unrelated); adversarial critic CONFIRMED-WITH-CAVEATS pre-review, both caveats closed post-review | 55d67b4a... | rebased onto main (post #3086/#3094/#3103/#3110/#3119/#3123/#3130/#3139/#3152/#3160/#3232/#3266 merges), awaiting fresh CI as of 2026-09-14 |
| 2026-09-12 | intelligence | `LocalReasoningBank.findSimilar()` overwrote every returned pattern's `confidence` (learned reliability) with the per-query cosine similarity score instead of the already-declared `PatternMatch.similarity` field, inverting `distillLearning()`'s "only distill from high-confidence matches" gate (it tested query-similarity, not reliability) and forcing `findSimilarPatterns()`'s public API into an unsafe cast that made `confidence`/`similarity` always identical; `findSimilar()` now preserves real `confidence` and returns `similarity` separately, with the one affected consumer (`memory-bridge.ts`'s search-ranking score) migrated accordingly | #3301 | #3302 | yes | ACCEPT | 4 new discriminating tests, baseline-fails/candidate-passes via stash isolation; full suite 90-vs-91-failed-files identical except the new test file; `tsc --noEmit` byte-identical (463 errors both ways); independent adversarial critique CONFIRMED, no blocking caveats | cb60b43b... | rebased onto main (post #3086/#3094/#3103/#3110/#3119/#3123/#3130/#3139/#3152/#3160/#3232/#3266/#3291 merges), awaiting fresh CI as of 2026-09-14 |
+**Note (2026-09-22):** rows for 2026-09-15 (performance, #3329/#3330), 09-16 (security, #3338/#3339), 09-17 (intelligence, #3349/#3350), 09-18 (memory, #3351/#3352), 09-19 (swarm, #3356/#3357), 09-20 (performance, #3377/#3378), and 09-21 (security, #3384/#3385) all ran (verified via `git ls-remote --heads origin "dream/*"` and `list_pull_requests`/`search_pull_requests`, not inferred β€” same "rows only reach `main` via PR merge" structural gap noted since 2026-08-19) but are not transcribed as rows here, to avoid another copy stuck on another unmerged branch. All 7 are OPEN/draft, all <14d old (none stale). Trailing-7-night merge rate since the 09-14/15 backlog sweep: 0/7 β€” worth watching but not yet actionable (no single night is stale, no repeated-direction pattern).
+
+| 2026-09-22 | intelligence | `EWCConsolidator.updateFisherFromConfidences()` (`ewc-consolidation.ts`, wired into production at `intelligence.ts:413` via #3110) ran its online-Fisher EMA backwards vs. its two sibling `globalFisher`-updating methods in the same class (`computeFisherMatrix()`, `recordGradient()`) β€” new batch got 99% weight, accumulated importance got 1%, discarding ~99% of accumulated Fisher on every `distillLearning()` pass and defeating EWC++'s anti-catastrophic-forgetting purpose; flagged as lead candidate by 09-21's scan finding, independently re-verified against the code and the EWC++ literature (Chaudhry et al. ECCV 2018, arXiv:1801.10112), fixed to match the sibling sites. **Update (ruvnet evidence-gate review, same session):** initial fix REJECTed pending lifecycle hardening β€” no guard against non-finite input, a no-op update still decayed/persisted Fisher, no validation on loaded persisted state, receipt bound the pre-session base commit not the candidate. All addressed: non-finite samples dropped before folding in; zero-sample updates leave state untouched; `loadFromDisk()` validates/quarantines a malformed `globalFisher`; witness rebound to the hardened candidate commit; 3 new regression tests confirmed via stash isolation; also verified against the compiled `dist/` output directly (not just vitest's transform) | #3394 | #3395 | yes | ACCEPT-scoped (post-review) | 5 EMA-direction/consistency tests + 3 hardening regression tests (non-finite-input drop, no-op-no-persist, corrupted-state quarantine), all baseline-fails/candidate-passes via stash isolation; independently reproduced by adversarial critic pre-review (CONFIRMED) and by ruvnet's evidence-gate review post-review (REJECT β†’ all items closed); full `@claude-flow/cli` suite byte-identical 96-file failure set throughout; `tsc --noEmit` byte-identical (463 errors) throughout | fc2088df... | 09-15..09-21 (7 nights) all still open/draft, none merged since the 09-14/15 backlog sweep, none stale |
+**Note (2026-09-19):** 2026-09-15 (performance, #3329/#3330), 2026-09-16 (security, #3338/#3339), 2026-09-17 (intelligence, #3349/#3350), and 2026-09-18 (memory, #3351/#3352) all exist as real branches+issues+draft-PRs (verified via `mcp__github__search_pull_requests`, not inferred) but are not transcribed as rows here β€” same "ledger rows only reach `main` via PR merge" structural gap noted repeatedly since 2026-08-19/09-03/09-05/09-09. GitHub-verified fates for the trailing 7 nights before tonight's own row (via `mcp__github__pull_request_read`, `gh` CLI unavailable this session): #3302 (09-12) **MERGED**; #3291 (09-11) **MERGED**; #3266 (09-10) **MERGED**; #3330 (09-15) OPEN/draft 4d old; #3339 (09-16) OPEN/draft 3d old; #3350 (09-17) OPEN/draft 2d old; #3352 (09-18) OPEN/draft 1d old β€” none STALE. A large batch (18 dream PRs spanning 08-14..09-12) merged together on 2026-09-14. Swarm surface specifically: #3086 (08-24), #3123 (08-29), #3243 (09-09) β€” 3/3 merged, 100% historical rate.
+| 2026-09-19 | swarm | `TopologyManager.createEdgesForNode()` mirrored a new node's edge onto its connection target only for `type === 'mesh'` β€” for hierarchical/centralized/hybrid, the queen/coordinator's own `connections`/`adjacencyList` permanently never gained any worker (not just transiently stale: neither `shouldRebalance()` nor any `rebalance*()` guard, which checks the worker's side instead of the leader's, could ever repair it); fixed by mirroring whenever the connection target already exists in the topology | #3356 | #3357 | yes | ACCEPT-scoped | baseline 3/3 new tests fail (`expected [] to include`), candidate 233/233 full-suite pass (was 230/230 pre-diff), `tsc` clean; independent adversarial critique CONFIRMED β€” disclosed caveat: no shipped caller of `getNeighbors()`/`findOptimalPath()` exists yet and `swarm-tools.ts`'s `getStatus()` has a separate pre-existing type-drift bug, so the repaired state is correct/live but not yet externally visible | 2cd2ea40... | 08-24..09-12 merge status above; 09-15..09-18 still open/draft, none stale |
+**No-run gap (2026-09-13, 2026-09-14):** no branch/PR/issue exists for either date (verified via `git ls-remote --heads origin "dream/*"` and `search_pull_requests`, 2026-09-18). Tonight's automation SCAN confirms no in-repo cron/workflow drives this trigger, so the gap is genuinely unexplained from repo config, not a local misconfiguration β€” same open question as the 2026-08-20..23 gap.
+| 2026-09-15 | performance | wire MoE gate's load-balance loss into the actual weight update (title-derived backfill; full PR body not re-verified tonight) | #3329 | #3330 | yes | ACCEPT-scoped | see issue #3329 / PR #3330 | n/a (backfill) | unmerged draft as of 2026-09-18, 3d old |
+| 2026-09-16 | security | gate `hive-mind_spawn`/`propose`/`broadcast`/`shutdown`/`memory`/`optimize-memory` + `hive-mind_init`'s own credential issuance, round 2 (title-derived backfill; full PR body not re-verified tonight) | #3338 | #3339 | yes | ACCEPT | see issue #3338 / PR #3339 | n/a (backfill) | unmerged draft as of 2026-09-18, 2d old |
+| 2026-09-17 | intelligence | wire `CLAUDE_FLOW_PRIOR_DECAY` env override for `ModelRouter`'s dormant discounted-Thompson-sampling decay primitive (#3049), recommended by 2026-09-12's own gist; real benchmark receipt (low-complexity bucket: recovery 26.5β†’21.9 rounds, t=7.0; med-complexity bucket: stationary Ξ”=βˆ’0.08pp, t=βˆ’3.01, accepted within pre-declared Β±1pp tolerance) | #3349 | #3350 | yes | ACCEPT-with-caveats | 16/16 tests; full suite byte-identical 221 pre-existing failures both ways; independent adversarial critic CONFIRMED-WITH-CAVEATS (net-positive low-complexity, negligible-but-real med-complexity cost) | 91d8edc3... | unmerged draft as of 2026-09-18, 1d old |
+| 2026-09-18 | memory | `AgentDBAdapter.store()` (default in-process write path) never checked for an existing entry under the same `(namespace,key)` before writing β€” a fresh random id every call left the prior occupant an orphan, unreachable via `getByKey()` but still live in `entries`/`namespaceIndex`/`tagIndex` and, for embedded entries, still a point in the HNSW index, so `search()`/`semanticSearch()` returned stale duplicates forever; fixed by evicting the prior occupant via a shared `evictEntry()` primitive before storing. Independently flagged by two prior nightly scans (09-12, 09-17) as a future-night candidate. **Post-review (ruvnet, same night):** two further public-path gaps found and fixed β€” `bulkInsert()` bypassed the same-key dedup entirely (fixed: pre-existing + intra-batch duplicate-key eviction), and `store()` deleted the prior occupant *before* validating the replacement embedding, risking data loss on a rejected write (fixed: validate/index first, evict on success) | #3351 | #3352 | yes | ACCEPT-scoped (post-review) | 9 discriminating tests total (4 original + 5 post-review, incl. a hand-built two-gate harness proving `setTimeout` can't reproduce the disclosed concurrency race); full suite 517β†’526 passed (1 pre-existing unrelated failure, unchanged); `tsc --noEmit` clean; independent adversarial critique CONFIRMED-WITH-CAVEATS pre-review, human review found 2 further blocking gaps post-review, both closed same night β€” concurrent-store race (not bulkInsert/atomicity) remains the one disclosed, still-open follow-up | d4d02062... | 09-08..09-12 (5 nights) MERGED in a 2026-09-14/15 batch; 09-15/09-16/09-17 still open/draft, none stale (<4d old); 09-13/09-14 no-run gap noted above |
+
+**Note (2026-09-17):** verified via GitHub MCP tools (not inferred) before tonight's own row: **2026-09-13 and 2026-09-14 are genuine no-run gaps** β€” no `dream/2026-09-13-*`/`dream/2026-09-14-*` branch, no matching issue/PR, same class as the earlier 2026-08-20..23 gap. **2026-09-15 ran** (`performance`, #3329 β€” MoE gate load-balance loss computed but never applied to weights) and **2026-09-16 ran** (`security`, #3338 β€” hive-mind consensus bypass); neither transcribed as its own row here (out of scope for tonight's `intelligence` slot to backfill in full β€” flagging their existence is enough to keep STEP 1's gap-detection honest). Trailing-14 PR merge rate: **14/14 MERGED** β€” a bulk human-review sweep on 2026-09-14/15 cleared the entire backlog from #3086 through #3302 in one pass. This is the opposite extreme from the "0 of last 14" signal earlier nights tracked, so tonight did **not** bias toward an artificially small candidate on that basis β€” but the bulk-sweep nature (many PRs merged together) is a weaker scrutiny signal than a steady one-by-one trickle, noted for future nights' calibration.
+
+| 2026-09-17 | intelligence | `ModelRouter`'s discounted-Thompson-sampling `priorDecay` primitive (built/tested/benchmarked in #3049, 2026-08-17) shipped permanently inert β€” `DEFAULT_CONFIG.priorDecay` hardcoded to `1` (disabled), no env/config override unlike sibling `maxUncertainty`; added `envPriorDecay()` mirroring the existing `envMaxUncertainty()` pattern exactly, acting on 09-12's own gist recommendation for a future `intelligence` night | #3349 | #3350 | yes | ACCEPT-scoped | stash-isolated: 1/3 new tests fail reverted, 16/16 pass restored; full `@claude-flow/cli` suite + `tsc --noEmit` byte-identical baseline vs candidate outside the 3 new tests (221 failures / 463 errors both ways); benchmark re-run byte-identical to 2026-08-17 receipt β€” real non-stationary recovery win in 'low' bucket (t=7.0), small but statistically real stationary-accuracy cost in 'med' bucket (t=-3.01, 0.08pp, inside the original Β±1pp tolerance); independent adversarial critic CONFIRMED-WITH-CAVEATS, disclosed not oversold | 91d8edc3... | 08-24..09-11 backlog (10 PRs) + 09-12 (#3302) all MERGED 2026-09-14/15 in a bulk sweep; 09-13/09-14 no-run gap, 09-15/09-16 ran but not transcribed (see note above) |
+| 2026-09-15 | performance | `MoERouter.route()` computed a Switch-Transformer-style load-balance auxiliary loss every call and returned it in `RoutingResult`, but `updateExpertWeights()` (the sole mutator of gate weights) never read that loss or its coefficient in its REINFORCE gradient math β€” the regularizer the module's own header claims had zero actual training effect; wired the analytic (softmax-Jacobian) gradient into the existing update path, using a per-`route()` fraction snapshot for consistency | #3329 | #3330 | yes | ACCEPT-scoped | 4 new discriminating tests, baseline-fails/candidate-passes via stash isolation (reproduced independently by critic); full `@claude-flow/neural` suite 132/132β†’136/136, 0 regressions; `tsc --noEmit` clean; independent adversarial critique CONFIRMED (scoping caveat: `updateExpertWeights()` has zero production callers today, though `route()` itself is live) | 5e719b96... | trailing 7 nights (#3086,#3139,#3152,#3160,#3232,#3243,#3266,#3291,#3302) all MERGED 2026-09-14 β€” full prior backlog cleared, reversing the earlier "0 of 14" signal |
+
+**Note (2026-09-21):** #3302 confirmed **MERGED** 2026-09-15 via `pull_request_read` (authoritative) — `search_pull_requests`'s `merged` field is stale/unreliable (it reported `merged:false` with a populated `merged_at` for this same PR; do not trust it for merge-state checks, use `pull_request_read`/`get`). **New no-run gap, confirmed via `git ls-remote --heads origin "dream/*"`**: 2026-09-13 and 2026-09-14 have no branch, issue, or PR — same verification standard as the documented 08-20..08-23 gap, root cause still undiagnosed. 2026-09-15 through 2026-09-20 all ran (real branches confirmed): #3329/#3330 (perf, MoE load-balance), #3338/#3339 (security, hive-mind capability-token round 2), #3349/#3350 (intelligence, ModelRouter prior-decay env override), #3351/#3352 (memory, AgentDBAdapter upsert-orphan fix), #3356/#3357 (swarm, topology mirror-edge fix), #3377/#3378 (performance, UnifiedSwarmCoordinator busy-poll→event-driven, ~487x measured) — not transcribed row-by-row here per the established "ledger rows only reach `main` via PR merge" convention; all currently open/draft, none stale (<14d old as of tonight).
+
+| 2026-09-21 | security | `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 09-20's security scan; added PATH/PYTHONPATH/PERL5LIB/RUBYLIB/GIT_EXTERNAL_DIFF/GIT_SSH_COMMAND/BASH_ENV/IFS to the denylist. Adversarial critique found the lookup was case-sensitive (`path`/`Path` bypassed it on case-insensitive Windows) β€” fixed same session via `.toUpperCase()` case-folding, also hardening the original 9 names | #3384 | #3385 | yes | ACCEPT-scoped | 13 new discriminating tests (32/32 total); baseline-fails/candidate-passes via stash isolation, independently reproduced twice by the critic; full suite failed-file set byte-identical (36 pre-existing environmental failures); `tsc --noEmit` 14 pre-existing errors, unchanged; independent adversarial critique CONFIRMED-WITH-CAVEATS β†’ caveat closed same session | 03142288... | 09-15..09-20 (6 nights) all open/draft, none stale; 08-24..09-11 backlog (10 PRs) still unmerged since the 09-14/09-15 batch that cleared 09-03/09-05/09-07/09-12 |
+ **Note (2026-09-20):** the pre-09-14 backlog (#3086 through #3302, ~18 PRs) was fully cleared by human review on 2026-09-14 (confirmed via `search_pull_requests`: every one now shows `state: closed`) β€” the "0 of last 14 merged" bias condition from earlier nights no longer applies. Nights 09-15 (performance, #3330), 09-16 (security, #3339), 09-17 (intelligence, #3350), 09-18 (memory, #3352), and 09-19 (swarm, #3357) all ran and produced real branches/issues/draft PRs (verified via `git ls-remote`/`search_pull_requests`, not inferred) but aren't transcribed as rows here β€” same "ledger rows only reach `main` via PR merge" structural gap noted since 2026-08-19/09-03/09-05/09-09; none of the five is stale (>14d) as of tonight. Not backfilling their full rows here to avoid yet another copy stranded on yet another unmerged branch (per the 2026-09-03 note's own reasoning) β€” see their own PR bodies (#3330/#3339/#3350/#3352/#3357) for full detail.
+
+ | 2026-09-20 | performance | `UnifiedSwarmCoordinator.waitForTaskCompletion()`/`waitForQueuedTask()` busy-polled `state.tasks` via `setInterval(...,100)` despite the coordinator already extending `EventEmitter` and already firing `task.completed`/`task.failed` at every terminal task-status transition (`handleTaskComplete`, `handleTaskFail`'s non-retry branch, `cancelTask`) — the exact candidate 2026-09-15 scored 4.45/5 but deferred; tonight's independent research re-scored it 4.75/5 and selected it | #3377 | #3378 | yes | ACCEPT | 4 new discriminating tests, baseline-fails-3-of-4/candidate-passes-4-of-4 via stash isolation; real wall-clock benchmark 100.359ms→0.206ms mean (~487x, N=20); 234/234 full-suite both ways (230 pre-existing + 4 new), `tsc` clean; independent adversarial critique CONFIRMED-WITH-CAVEATS→fixed (missing `setMaxListeners` would have spammed `MaxListenersExceededWarning` at >10 concurrent waiters; fixed same session, re-verified) | 12f7a08e... | 09-15..09-19 (5 nights) all open/draft, none stale; pre-09-14 backlog (18 PRs) fully cleared 2026-09-14 |