mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-12-03 22:12:01 +09:00
dream(intelligence): fix guidance_brain's dead coveragePercent/classifiedToolCount (evaluated, ACCEPT) #5003 (#5004)
* dream(intelligence): fix guidance_brain's dead coveragePercent/classifiedToolCount metrics buildCapabilityBrain() (v3/@claude-flow/cli/src/mcp-tools/capability-brain.ts) hardcoded coveragePercent to 100 and classifiedToolCount to the raw unique-tool count, regardless of how many tools fell back to the generic runtime-services domain -- a declared-but-dead metric reachable through the live guidance_brain MCP tool that CLAUDE.md instructs agents to call before complex work, and a direct violation of ADR-329's own coverage-gate invariant. classifiedToolCount now subtracts the number of distinct fallback-classified tool names, and coveragePercent is computed from it instead of being a constant. An independent adversarial critique found and this session fixed forward a related edge case: a duplicate tool name that also falls back to runtime-services could drive the count negative; fixed by deduping via a Set before subtracting. 3 new discriminating/control tests added to guidance-brain.test.ts. Stash-isolated baseline fails the predicted test; candidate is 11/11, tui-command.test.ts (the other real consumer-adjacent suite) is 13/13 (+3 pre-existing skips), 0 regressions. tsc --noEmit: 0 errors in either changed file. Research: tonight's DEEP=intelligence slot surfaced a stronger-evidenced EWC gradient-accumulator-decay candidate, but an independent architecture review disqualified it from tonight's production_value score (its output is currently discarded by learn(), never reaching a real weight update) -- this SCAN=capabilities finding scored higher and is a disclosed SCAN-override, same precedent as 2026-10-29/2026-11-10. Full research and evaluation receipt in docs/dream-cycle/dream-gist-2026-11-16.md. Also backfills three missing ledger rows (2026-11-12/13/14) that each pushed a real, evaluated, witnessed draft PR but never appended their ledger row -- a genuine STEP 25 gap found during tonight's STEP 1 ledger check. Co-Authored-By: RuFlo <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01ReiDH5iHMWcLWYvovKagBj * dream(intelligence): finalize witness block and append ledger row for #5003/#5004 Co-Authored-By: RuFlo <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01ReiDH5iHMWcLWYvovKagBj --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
65fc26d0fa
commit
db712a64eb
4 files changed
+123
-2
No files matched your search
@@ -257,5 +257,11 @@ as a first-class, high-priority candidate, not a background note.
|
||||
**Correction (2026-11-01, post-review via PR #4634 comment thread, verified against repo source same session):** the 11-01 row above overstates in-repo reachability. An accepted inbound `trust-change`/`topology-change` message only reaches `inbound-dispatcher.ts`'s generic `eventBus.emit(\`federation:inbound:${message.type}\`, ...)` — per ADR-109's explicit "event emission, not direct callback" design, nothing in this package subscribes to that event itself; acting on it is the integrator's job. `plugin.ts:263`'s separate `federation:trust-change` emission comes from `TrustEvaluator`'s own interaction-scoring callback, not from inbound messages. So the fix closes a real authorization-boundary gap at the gate governing what reaches any integrator-registered listener, not a live, self-contained in-repo privilege escalation. The fix, its 7 tests, and the defense-in-depth property are all unaffected — only the reachability framing in the issue/PR write-up was corrected (not the witnessed gist text, per the 2026-10-16 precedent of recording a correction here rather than re-editing/re-witnessing a prior night's gist). Also noted: PR #4580 (external contributor, open since 10-29) proposes the same write/memory/spawn-floor fix already shipped 10-31 via #4618/#4619 — flagged for a maintainer to close as superseded, not actioned from this session since it isn't this session's PR.
|
||||
**Note (2026-11-10):** confirmed via GitHub MCP tools before tonight's own row: a genuine 5-night run gap 11-03 through 11-07 (no branch/issue/PR for any date, already disclosed by the 11-08/11-09 nights, not re-investigated further). 11-02 (intelligence, #4659/#4660) still OPEN/draft, 8 days, not stale. 11-08 (memory, `LearningBridge` post-consolidation signal-starvation fix, #4884) closed via PR #4910 **CLOSED, not merged**. 11-09 (swarm, `QueenCoordinator` failover/delegation-cap fix, #4902) closed via PR #4908 **MERGED**, plus a follow-on release PR #4927 **MERGED**. Both 11-08 and 11-09 ran with real detailed issues but neither pushed a `dream/*` branch (STEP 20-24 silently skipped or diverged from convention both nights — #4908/#4910 exist as PRs without a matching `dream/2026-11-08-memory`/`dream/2026-11-09-swarm` branch in `git ls-remote`), a distinct gap from the already-tracked "ledger rows only reach main via PR merge" issue; worth a future automation/meta night's attention. Trailing-decided-PR merge rate: 7/9 merged over the last 9 nights with a decision (11-08's #4910 is the one non-merge).
|
||||
**Note (2026-11-11, resolved post-row):** the `dream/2026-11-10-hive-mind` branch (not mentioned by the 2026-11-10 note above) is a disclosed SCAN override: 2026-11-10 was `DEEP=performance, SCAN=security,hive-mind`, and its own issue #4937 explicitly scored the hive-mind-surface `RaftConsensus` legacy `requestVote()` finding (4.9/5) above every performance-DEEP candidate considered (next-best 3.95) and named the 2026-09-24/2026-10-20 override precedent — not an undisclosed deviation. Confirmed via GitHub MCP: issue #4937, PR #4938, **MERGED** 2026-11-10. 11-10's own gist publish was blocked by the auto-mode permission classifier ("Public Data-Sharing Upload" denial, not a `gh`-auth failure — a third distinct cause beyond the usual FALLBACK, also seen 11-08/11-09), full report embedded in #4937 §13 instead. 11-10 did not itself score a prior gist (it scored 11-09's, 10/10, embedded in #4902). Tonight's own STEP 1.2 prior-gist score is still **not scored** below — the fate-check that surfaced the above also produced a real, useful supplementary swarm finding (see issue #4960's own follow-up comment: `RaftConsensus.appendEntries()`'s legacy path still has zero log-contiguity check, directly adjacent to and explicitly deferred by 11-10's own fix — a strong ~4.65/5 candidate for a near-future swarm/hive-mind night) but did not return a clean 11-10-gist score before this row was finalized.
|
||||
**Backfill note (2026-11-16, STEP 1):** 2026-11-12/13/14 each pushed a real `dream/*` branch with an evaluated, witnessed draft PR (confirmed via `git ls-remote` + PR body, not assumed — see STEP 1 guard against inferring failure from a sparse table), but none appended its ledger row (a real STEP 25 gap, three nights running). Backfilled below from each PR's own evaluation receipt. 2026-11-15 (performance slot) has no `dream/*` branch at all — a genuine skipped night, not backfilled (no evidence to backfill from).
|
||||
|
||||
| 2026-11-12 | intelligence | `SONAManager.triggerLearning()` (`v3/@claude-flow/neural/src/sona-manager.ts`) re-filtered the *entire* trajectory backlog every cycle with no "already learned from" marker, continuing 10-27's own disclosed follow-up. Added `Trajectory.learnedFrom` flag set post-`learn()` success. Post-critique correction: fix removes the O(backlog-size) multiplier on EWC-means growth but leaves a deeper O(cycle-count) unbounded-accumulator cause (in `BalancedMode.accumulateGradient()`) disclosed, not fixed — named top follow-up | #4972 | #4973 | yes | ACCEPT-scoped (post-critique) | 4 new tests, stash-isolated 3/4 fail baseline → 4/4 candidate; full `@claude-flow/neural` suite 152/152 (148+4), 0 regressions; `tsc --noEmit` clean both ways; independent adversarial critique CONFIRMED-WITH-CAVEATS — found and disclosed the deeper unbounded-accumulator growth the original write-up overclaimed as fixed | 4cfe2017... | gist local-only (`dream-gist-2026-11-12.md`), remote publish not attempted this row; not yet merged, 4 days old, not stale |
|
||||
| 2026-11-13 | memory | `ControllerRegistry.initialize()`'s `INIT_LEVELS` never listed `causalRecall`, so `get('causalRecall')` always returned `null` despite a correct, already-written `createController()` case (same declared-but-unreachable-config shape as 10-28's `.set()` fix). Added `causalRecall` to Level 4 | #4982 | #4983 | yes | ACCEPT (evaluated) | 2 new discriminating tests, stash-isolated baseline fails as predicted → 94/94 candidate; full `@claude-flow/memory` suite 717/718 (1 pre-existing unrelated environmental failure, byte-identical); `tsc --noEmit` clean both ways; independent adversarial critique CONFIRMED-WITH-CAVEATS (1 non-blocking comment-accuracy nit, fixed forward) | 6d7d059d... | gist local-only (`dream-gist-2026-11-13.md`), `gh gist create` blocked by proxy policy (HTTP 403, not a GH-auth failure); not yet merged, 3 days old, not stale |
|
||||
| 2026-11-14 | swarm | `ByzantineConsensus`/`GossipConsensus` never called `setMaxListeners(0)` despite the identical per-proposal listener-growth pattern `RaftConsensus` already guards against (`raft.ts:60-64`) — real `MaxListenersExceededWarning` under >10 concurrent proposals. Mirrored Raft's existing guard in both constructors | #4988 | #4989 | yes | ACCEPT | 2 new discriminating tests, stash-isolated baseline captures the real warning → 6/6 candidate; full `@claude-flow/swarm` suite 382/382 (380+2), 0 regressions, `tsc --noEmit` clean; independent adversarial critique confirmed no evaluator gaming, re-ran baseline from scratch, 50-concurrent-proposal stress test clean | 0e31d2b1... | gist local-only (`dream-gist-2026-11-14.md`), `gh gist create` blocked by proxy policy (HTTP 403); not yet merged, 2 days old, not stale |
|
||||
| 2026-11-11 | security | `v3/@claude-flow/cli/src/init/settings-risk-scanner.ts`'s `scanAllowRuleForRisk()` (the heuristic `ruflo init --upgrade` runs against a target project's existing `.claude/settings.json`) flagged `permissions.allow` rules pre-approving `bash/sh/python/ruby/perl/curl/wget`+dangerous-words with no per-call confirmation, but had no entry for `node`/`deno`/`bun`/`php` — GTFOBins-documented shell-breakout interpreters in the same tier as the four already covered. This repo's own committed `.claude/settings.json` (lines 14/29) carries a live, unscoped `Bash(node:*)` allow-rule this exact scanner silently passed as clean before tonight; confirmed not a documented design tradeoff (`ruflo init`'s own `generateSettings()` never emits a node-related allow rule by default, so the gap wasn't forced by avoiding a false positive on Ruflo's own output). Fixed via a new `INTERPRETER_WORDS` list feeding only `RISKY_PREAPPROVE_WORDS`, deliberately kept out of `SHELL_EXEC_WORDS` so the separate `scanCommandStringForRisk` (hook command strings, where `node <script>` is legitimate) stays untouched. Also corrected a stale 2026-10-30 deferred finding: `http_fetch`'s DNS-rebind SSRF gap is already closed (`http-fetch-pinned.ts`'s `pinnedLookup`, ADR-164 §5.1.8) — no action needed, REJECT-with-evidence on reopening it. SCAN: intelligence (10-27/11-01's EWC++ per-mode gap confirmed still open tonight, mitigated since every mode-construction site defaults to `'balanced'` — narrower blast radius than previously framed; third disclosure without action), swarm (11-01's `TaskOrchestrator.failTask()` agent-stranding finding confirmed **already fixed** via direct code read of `releaseWorker()` — not reused) | #4960 | #4961 | yes | ACCEPT | 10 new/extended tests (`settings-risk-scanner.test.ts` + a CJS/TS parity case), stash-isolated baseline fails 5/54 exactly as predicted → candidate 54/54 pass, 75/75 across all three affected test files after the critic's own fix + this session's follow-up regression test; benchmark-corpus recall 0.75→1.0, precision 1.0 both ways (0 false positives); `tsc --noEmit` 512 pre-existing unrelated errors (unbuilt siblings) byte-identical per the critic's own line-for-line diff, 0 in changed files; full-package suite timed out at 170s (environmental); independent adversarial critique (fresh context, re-ran stash-isolation + `tsc` diff itself, independently verified the live `Bash(node:*)` rule rather than trusting the write-up) CONFIRMED + PASS, and on its own initiative found and fixed forward a real cross-file parity gap (this session's TS-only change would have left the `hook-handler.cjs` CJS mirror used by the `session-restore` boot hook out of sync on these exact cases) plus extended the parity test; one remaining caveat (untested prefix-collision safety for `nodemon`/`phpunit`/`bunx`/`denoland`, verified correct by hand) closed same session with a dedicated test | 6bfe9cf4... | 10-26/10-27/10-28 MERGED (per 2026-11-01's confirmed state, not re-verified tonight); 10-31 #4619 MERGED; 11-01 #4634 status not re-checked tonight (budget — see pre-row note above); 11-02 #4660 open/draft as of 11-10's note, 9 days old, not stale; 11-08 #4910 CLOSED not merged; 11-09 #4908/#4927 MERGED; `dream/2026-11-10-hive-mind` (#4937/#4938, disclosed SCAN override, `RaftConsensus` legacy `requestVote()` fix) **MERGED**. Prior-night gist score: not scored (see note above) |
|
||||
| 2026-11-16 | intelligence (SCAN override to capabilities, see issue #5003 §2 for the override rationale) | `buildCapabilityBrain()`'s `coverage.coveragePercent` (`v3/@claude-flow/cli/src/mcp-tools/capability-brain.ts`) was hardcoded to `100` and `classifiedToolCount` unconditionally equaled the raw unique-tool count, ignoring `fallbackClassifiedTools` entirely — a declared-but-dead metric reachable through the live `guidance_brain` MCP tool, violating ADR-329's own coverage-gate invariant. DEEP=intelligence's own top candidate (decay the never-decaying EWC `gradientAccumulator` in `balanced.ts`, mirroring Ruflo's own upstream `@ruvector/sona@0.1.11` dependency's already-shipped EMA decay) scored lower once an architecture review found its output is currently discarded by `learn()` — disclosed as a strong candidate for a near-future night, not fixed tonight. Also: DEEP=security was rejected before research began (3rd occurrence of the `.harness/mcp-policy.json` false shell/network-surface claim, disclosed 2026-10-26/2026-10-27 — STEP 1.1 duplicate-direction rule). SCAN: memory (`CacheManager.clear()`'s `previousSize` always-0 bug, disclosed 2026-10-27, confirmed still live, not yet fixed) | #5003 | #5004 | yes | ACCEPT (post-critique) | 3 new tests (2 discriminating, 1 control; one discriminating test added post-critique), stash-isolated baseline fails the original discriminating test exactly as predicted → 11/11 pass; `tui-command.test.ts` 13/13 (+3 skips), 0 regressions; `tsc --noEmit` 0 errors in changed files; independent adversarial critique found and this session fixed forward a real edge case (duplicate tool name + fallback classification drove the metric negative), re-verified 11/11 after the fix, verdict CONFIRMED | 634d0afc... | Backfilled 3 missing ledger rows tonight (2026-11-12/13/14 each had a real evaluated draft PR that never got a ledger row — a genuine STEP 25 gap found during tonight's STEP 1 check, see rows above). 11-12 #4973/11-13 #4983/11-14 #4989 all open/draft, 2-4 days old, not stale. 11-11 #4961 status not re-checked tonight. Prior gist (11-11, security) scored 9/10 (2+2+2+2+0(2065 words)+1) — this is the last gist actually available to read; 11-12/13/14's own gists are local-only on their unmerged branches, not fetched tonight (budget) |
|
||||
| 2026-11-10 | hive-mind (SCAN override of performance DEEP, see issue #4937 §3 for the override rationale) | `RaftConsensus`'s no-transport "legacy in-process" `requestVote()` path (`v3/@claude-flow/swarm/src/consensus/raft.ts`) granted votes on a bare `currentTerm > peer.currentTerm` comparison — no vote-once-per-term check, no log-up-to-date check — unlike the transport RPC path and `handleInboundRaftMessage()` a few lines above it, both of which correctly implement Raft §5.2/§5.4. Confirmed production-reachable (no call site in `v3/` ever wires a `ConsensusTransport`; `UnifiedSwarmCoordinator` calls `consensusEngine.addNode()` for every real spawned agent onto this exact path). A candidate whose term was inflated by retries alone (not log progress) could out-vote a more log-advanced peer (unsafe over-grant, a real Leader Completeness violation); the same strict `>` check also wrongly denied a legitimate same-term, equally-fresh-log candidate (spurious under-grant). Fixed by mirroring the file's own two already-correct implementations. DEEP=performance's own deferred lead (`CacheManager.estimateSize()`, scored 4.85 on 10-20) was investigated first and REJECTED with evidence: regression test #4481 requires exact size accounting even without `maxMemory`, so "skip when unset" does not survive scrutiny — not re-proposed as-is. SCAN: security (http-fetch/path-containment/claims-tools reviewed, no new finding), hive-mind (Byzantine/Gossip sanity-checked for an analogous gap — none found, architected differently) | #4937 | #4938 | yes | ACCEPT | 4 new tests (2 discriminating, 2 controls), stash-isolated baseline 378/380 (2 predicted failures) → candidate 380/380, independently reproduced byte-identical by a separate fresh-context adversarial-critic subagent from its own stash/pop cycle, which also independently re-verified the production-reachability claim from scratch; full `@claude-flow/swarm` suite 380/380 (376+4 new), 0 regressions, `tsc --noEmit` clean both ways; `metaharness mcp-scan` MEDIUM(3)/0-high, byte-identical to baseline; independent critique CONFIRMED, no blocking issues (3 non-blocking caveats disclosed: `appendEntries()`'s analogous gap left unfixed, a possible pre-existing zero-peer self-election edge case, private-field test casts matching existing convention) | 5af6b216... | 10-26 through 11-01 all MERGED where a decision exists; 11-02 open/draft not stale; 11-08 #4910 CLOSED-not-merged; 11-09 #4908/#4927 MERGED; 11-03..11-07 confirmed no-run gap (5 nights). Prior gist (11-09, swarm) scored 10/10 on the same rubric per its own issue §2 |
|
||||
@@ -0,0 +1,72 @@
|
||||
# Intelligence SOTA Report — 2026-11-16
|
||||
|
||||
**TL;DR**: Tonight's deep dive is continual learning for AI agents (2026 SOTA), motivated by Ruflo's disclosed-but-unfixed bug: `BalancedMode`'s EWC `gradientAccumulator` never decays, so its EWC anchor (`means`) drifts unboundedly. Research found Ruflo's own upstream Rust dependency, `@ruvector/sona@0.1.11`, already implements the standard fix (EMA Fisher decay, γ≈0.999) one layer down the stack — Ruflo's hand-rolled TS EWC bookkeeping never adopted it. Strong evidence, but an independent architecture review found a disqualifying caveat: `computeEWCPenalty()`'s output is discarded by `learn()`, never reaching a real weight update — fixing the accumulator alone changes no live behavior tonight. A competing SCAN-surface finding — `guidance_brain`'s capability-coverage report always claiming 100% tool classification even when tools silently fall back to an unclassified domain — scored higher (production-reachable, zero caveats) and is tonight's shipped candidate: a disclosed SCAN-override of DEEP=intelligence, same precedent as 2026-10-29/2026-11-10.
|
||||
|
||||
## What's New in 2026
|
||||
|
||||
| Finding | Source | Confidence |
|
||||
|---|---|---|
|
||||
| Standard "online EWC" fix for an unbounded Fisher/accumulator is EMA decay (`Fisher_t = γ·Fisher_{t-1} + (1-γ)·grad²`) — established pre-2026 baseline technique, still cited by current literature | Progress & Compress lineage; corroborated via 2026 lit search context | A |
|
||||
| Ruflo's own upstream Rust crates already implement this: `ruvector-dag` (docs.rs 2.0.4) defaults Fisher decay to 0.99; `ruvector-sona` (docs.rs 0.1.7) uses EMA Fisher decay 0.999. `@ruvector/sona@0.1.11` is a direct dependency of `@claude-flow/neural` (confirmed by grep of its package.json) | docs.rs primary source + in-repo dependency confirmation | A |
|
||||
| "Elastic Weight Consolidation Done Right" (Liu & Chang, arXiv:2603.18596, CVPR 2026, code released) fixes FIM gradient-vanishing via Logits Reversal — real peer-reviewed result, but orthogonal to Ruflo's bug (Ruflo doesn't compute a true FIM; it uses a squared-reward-gradient estimator) | arXiv 2603.18596 | A (paper), not directly applicable |
|
||||
| ProCL (arXiv:2605.13162, EMNLP 2026 Findings): continual LoRA using an internal "program memory" instead of an external replay buffer, better retention than other continual-LoRA baselines on text classification/QA | arXiv 2605.13162 | B (single paper, no second-source replication) |
|
||||
| "Modular Memory is the Key to Continual Learning Agents" (arXiv:2603.01761): most production agents today rely on frozen weights + externalized context/memory rather than in-weight continual learning | arXiv 2603.01761 (Dagstuhl seminar position paper) | B |
|
||||
| Industry-wide pattern confirmed by competitor review below: no major agent framework (LangGraph, AutoGen, CrewAI, OpenAI Agents SDK, Letta, Mem0) updates model weights in production; all push "learning" into externalized, inspectable context | Cross-checked against primary vendor/project sources | B |
|
||||
|
||||
**Why the competitor table isn't "None across the board" without explanation**: zero surveyed competitors do in-weight continual learning, but this is a **deliberately-avoided approach**, not an unsolved problem. Letta's Dec-2025 essay ("Continual Learning in Token Space") frames it as a design choice: naive online weight updates on a shared, multi-tenant model reliably degrade existing capability (catastrophic forgetting), so the industry externalizes "learning" into context/memory instead. Ruflo's SONA+EWC++ stack is the only approach surveyed operating in weight space — orthogonal to, not simply ahead of, the field. Open question: does Ruflo's approach have independent, reproduced benchmarks at production multi-tenant scale — the same validation gap already flagged for Flash Attention.
|
||||
|
||||
## Ruflo Current Capability
|
||||
|
||||
`v3/@claude-flow/neural/src/sona-manager.ts`'s `consolidateEWC()` (lines 568-582) genuinely decays Fisher importance (`fisher[i] *= 0.9`) each cycle — real and wired, driven by `updateEWCConsolidation()` (596-621), which only folds in a per-mode delta snapshot for modes implementing the optional `getConsolidationSnapshot()` hook. `BalancedMode` is the *only* mode that implements it (`modes/balanced.ts:333-367`); `research`/`batch`/`real-time`/`edge` get zero catastrophic-forgetting protection (disclosed 2026-10-27, re-disclosed 2026-11-01 and 2026-11-11 — a 3rd+ disclosure without action, exhausted per this pipeline's duplicate-direction rule).
|
||||
|
||||
Independently, `computeEWCPenalty()` (`balanced.ts:284-300`, called from `learn()` at line 158) diffs the **raw, never-decayed `gradientAccumulator`** against `means` — unbounded between consolidations. Unchanged since the file's last real commit (`1b783e0`, 2026-11-01); the 2026-11-12 disclosure (PR #4973, open/unmerged) postdates that commit, so it's genuinely still open. Critically, its result feeds a local `totalGradientNorm` that `learn()` discards — no real weight update today. A reference decay pattern exists at `v3/plugins/cognitive-kernel/src/bridges/sona-bridge.ts::computeFisher()`, but its `consolidate()` is an empty stub — nothing usable to wire from there.
|
||||
|
||||
Separately, CLAUDE.md's "MoE gate converges — confidence 0.13→0.88" claim is real and reproducible (`scripts/benchmark-intelligence.mjs::benchMoeGate()`) but benchmarks the wrong file: `q-learning-router.ts` (softmax confidence, no mixture-of-experts structure), not the actual gate at `moe-router.ts` (`MoERouter`, REINFORCE expert-weight updates). A true number with a false label — flagged for a future night, out of scope for tonight's single small patch.
|
||||
|
||||
## Competitor Comparison
|
||||
|
||||
| Competitor | Mechanism | Continual-learning approach | Grade |
|
||||
|---|---|---|---|
|
||||
| LangGraph / AutoGen / CrewAI | Graph/conversation orchestration over a frozen foundation model; state = checkpoints, message history, optional vector-store RAG | None update model weights or run consolidation — orchestration + retrieval around a frozen model, not learning | C (taxonomy-inferred, no framework-specific primary doc denying a hidden fine-tune loop) |
|
||||
| OpenAI Agents SDK / Assistants API | `Sessions` = conversation-history replay across runs; a reported April-2026 SDK update added cross-session "long-term memory," inspectable/editable like a file | File/context-based persistence, not weight updates; the long-term-memory claim is third-party-only, not confirmed in OpenAI's own release notes | B/C |
|
||||
| Letta (formerly MemGPT) | Working/recall/archival memory tiers, context paging; Feb-2026 added git-based versioned "Context Repositories" | Explicitly, publicly rejects weight-space learning — "Continual Learning in Token Space" (Letta's own Dec-2025 essay) names this a deliberate design philosophy, not a gap | A (architecture, primary source) |
|
||||
| Mem0 / Zep | Extraction → consolidation (ADD/UPDATE/DELETE/NOOP) → graph/temporal recall over a vector+graph store | Same category as Letta — store-level consolidation, not weight-space regularization; "continual learning agent" framing is a marketing stretch of normal memory-store consolidation | B |
|
||||
|
||||
## Hypothesis
|
||||
|
||||
> Given `buildCapabilityBrain()`'s coverage report (`v3/@claude-flow/cli/src/mcp-tools/capability-brain.ts`), which feeds the live `guidance_brain` MCP tool, when `coverage.coveragePercent` is computed as `(classifiedToolCount / registeredToolCount) × 100` (with `classifiedToolCount = registeredToolCount − fallbackClassifiedTools.length`) instead of the current hardcoded `100`, then a tool registry containing one or more tools that fall back to the generic `runtime-services` domain should report a `coveragePercent` strictly below 100 and a `classifiedToolCount` below `registeredToolCount`, matching ADR-329's own stated coverage-gate invariant ("the coverage invariant is percentage and exact assignment") — relative to today's baseline, where both fields are structurally incapable of moving regardless of input — subject to: zero change to `fallbackClassifiedTools`'s own reporting (already correct), the existing zero-fallback case still reporting exactly 100, zero regression to the existing `guidance-brain`/`tui-command` test suites, deterministic $0 Vitest evaluation. Frozen before evaluation; not modified after.
|
||||
|
||||
## Benchmarks
|
||||
|
||||
No agent-task benchmark applies — this is a deterministic metadata-computation correctness fix (a percentage derived from two already-tracked counts), evaluated via discriminating Vitest unit tests against the existing test file, same class as several prior nights' binary/structural fixes (e.g. 2026-10-16, 2026-10-31). `.harness/bench.json` does not exist in this checkout.
|
||||
|
||||
## Evaluation
|
||||
|
||||
**evaluated: accepted — ACCEPT** (pending this session's independent adversarial critique, run concurrently; see Issue for the final critic verdict).
|
||||
|
||||
Real evaluator: Vitest 4.1.8, package `@claude-flow/cli`. 3 new tests in `__tests__/guidance-brain.test.ts` (2 discriminating + 1 control — the 3rd added post-critique, see below). Stash-isolated baseline (`capability-brain.ts` reverted via `git stash`, test file kept): the discriminating test fails exactly as predicted (`classifiedToolCount` returns `2` instead of `1` for a 2-tool registry with one fallback-classified tool); the control (zero-fallback, `coveragePercent === 100`) passes both ways, as it must. Candidate (stash restored, post-critique fix applied): **11/11 pass**. Related-suite check (`tui-command.test.ts`): **13/13 pass** (+3 pre-existing skips), 0 regressions. `tsc --noEmit -p .`: pre-existing unrelated module-resolution errors from unbuilt `@claude-flow/shared`/`@claude-flow/swarm` siblings (same environmental class disclosed nearly every prior night), **zero errors** in either changed file. Full-package `vitest run __tests__/` timed out at 170s — environmental per established precedent (2026-10-26, 2026-11-11); the targeted + related-suite run is the primary evidence.
|
||||
|
||||
No reward-hacking: the diff is purely additive/corrective (two hardcoded-`100` expressions replaced with real computations over fields already present in the same object; `fallbackClassifiedTools`'s own reporting is untouched). No existing test, threshold, or gold data was touched. Both new tests are genuinely discriminating/control, not tautological.
|
||||
|
||||
**Independent adversarial critique**: a fresh-context critic re-ran the stash-isolation itself (confirmed byte-identical), ran `tui-command.test.ts` itself, traced `guidance_brain`'s live reachability through `mcp-client.ts`/`mcp-tools/index.ts`, and grepped the repo for any other caller with a hardcoded expectation this could break (none found — the two unrelated `coveragePercent` fields in `hooks.ts`/`@claude-flow/swarm` are a different line-coverage metric). It found one real edge case the original fix missed: a **duplicate tool name that also falls back to `runtime-services`** drove `classifiedToolCount`/`coveragePercent` negative, because `fallbackClassifiedTools` counts one entry per loop iteration (including re-occurrences of a duplicate name) while `uniqueToolCount` counts unique names only. **Fixed forward same session**: `classifiedToolCount` now subtracts `new Set(fallbackClassifiedTools).size` instead of the raw array length; a dedicated regression test added (`guidance-brain.test.ts`, duplicate+fallback case, asserts `coveragePercent === 0` rather than negative). Re-verified 11/11 (guidance-brain) + 13/13 (tui-command) after the correction. Critic's verdict: **CONFIRMED**, safe to ship with the forward fix applied.
|
||||
|
||||
## Darwin Results
|
||||
|
||||
Skipped — this is a binary/structural metadata-computation fix (a percentage derived exactly from two already-tracked integer counts), not a continuous/categorical tunable parameter. Same skip class as nearly every prior ACCEPT of this shape in the ledger.
|
||||
|
||||
## SOTA Proof & Witness
|
||||
|
||||
Session commit: 3a1479883b55b7f786ef0bf3141478e4dfb9444f
|
||||
Candidate commit: c38714a8d9789a57cd3784b28b78a61e52808c5a
|
||||
Gist SHA-256 (pre-witness, this block held to the literal text `PENDING`): 338f218d9c2b5c903917e9286288cb78955b0ff5d92271b652fb20e1db88f3f5
|
||||
Witness stamp: 634d0afc9f4b4c07d678cd4c9f64c41f855de72497240078c250d2911b628841
|
||||
|
||||
Verifier: fetch this file, replace this block's three dynamic values with the literal text `PENDING` (as they were before this computation), SHA-256 the result, concatenate with the Session commit above, SHA-256 again — must equal the Witness stamp.
|
||||
|
||||
Evaluation receipt identity: 3 new tests in `guidance-brain.test.ts` (2 discriminating + 1 control, one discriminating test added post-critique), stash-isolated baseline fails the original discriminating test exactly as predicted → 11/11 pass on the candidate; `tui-command.test.ts` 13/13 (+3 skips), 0 regressions; `tsc --noEmit` 0 errors in changed files. Flywheel evidence identity: none (`.claude-flow/flywheel/` does not exist in this checkout, consistent with every prior night). Darwin lineage identity: none (skipped — binary/structural metadata fix).
|
||||
|
||||
## Recommended Next Steps
|
||||
|
||||
1. **Wire `computeEWCPenalty()`'s output into a real weight update, and/or decay `gradientAccumulator` itself** (`balanced.ts:256-279`, EMA γ≈0.99-0.999, mirroring `@ruvector/sona@0.1.11`'s own already-shipped pattern). Tonight's architecture review scored this 3.60 on this pipeline's own formula — strong research evidence, but disqualified from tonight's slot by a real production-value caveat (the penalty's output is currently discarded, so the fix alone changes no live behavior). This is the single best-evidenced candidate for a near-future intelligence night, provided it's paired with (or explicitly scoped around) the discard-path issue.
|
||||
2. **Correct CLAUDE.md's "MoE gate converges — confidence 0.13→0.88" attribution**: the benchmark is real but measures `q-learning-router.ts`, not the actual MoE gate at `moe-router.ts`. A future night should either retarget the benchmark at the real MoE gate or correct the doc's claim — currently a true number with a false label, not a fabricated number.
|
||||
3. **EWC++ per-mode wiring gap** (`research`/`batch`/`real-time`/`edge` modes lack `getConsolidationSnapshot()`) is now disclosed a 3rd+ time (2026-10-27, 2026-11-01, 2026-11-11) without action — explicitly exhausted as a candidate direction per this pipeline's own duplicate-direction rule; a future night should either implement the other four modes' snapshot hooks or explicitly accept the risk in writing, not re-disclose it a 4th time.
|
||||
@@ -55,6 +55,42 @@ describe('Ruflo capability brain', () => {
|
||||
expect(brain.cliCommands).toContain('harness');
|
||||
});
|
||||
|
||||
it('drops coveragePercent and classifiedToolCount below 100% when a tool falls back to runtime-services (2026-11-16)', () => {
|
||||
const brain = buildCapabilityBrain([
|
||||
{ name: 'memory_search' },
|
||||
{ name: 'zzz_unrouted_probe' },
|
||||
]);
|
||||
|
||||
expect(brain.coverage.registeredToolCount).toBe(2);
|
||||
expect(brain.coverage.fallbackClassifiedTools).toEqual(['zzz_unrouted_probe']);
|
||||
expect(brain.coverage.classifiedToolCount).toBe(1);
|
||||
expect(brain.coverage.coveragePercent).toBe(50);
|
||||
});
|
||||
|
||||
it('never reports a negative coveragePercent when a duplicate tool name falls back to runtime-services (2026-11-16, post-critique)', () => {
|
||||
const brain = buildCapabilityBrain([
|
||||
{ name: 'zzz_unrouted_probe' },
|
||||
{ name: 'zzz_unrouted_probe' },
|
||||
]);
|
||||
|
||||
expect(brain.coverage.registeredToolCount).toBe(1);
|
||||
expect(brain.coverage.duplicateToolNames).toEqual(['zzz_unrouted_probe']);
|
||||
expect(brain.coverage.fallbackClassifiedTools).toEqual([
|
||||
'zzz_unrouted_probe',
|
||||
'zzz_unrouted_probe',
|
||||
]);
|
||||
expect(brain.coverage.classifiedToolCount).toBe(0);
|
||||
expect(brain.coverage.coveragePercent).toBe(0);
|
||||
});
|
||||
|
||||
it('reports 100% coverage only when there truly are zero fallback-classified tools', () => {
|
||||
const brain = buildCapabilityBrain([{ name: 'memory_search' }, { name: 'claims_check' }]);
|
||||
|
||||
expect(brain.coverage.fallbackClassifiedTools).toEqual([]);
|
||||
expect(brain.coverage.classifiedToolCount).toBe(brain.coverage.registeredToolCount);
|
||||
expect(brain.coverage.coveragePercent).toBe(100);
|
||||
});
|
||||
|
||||
it('does not confuse registration with runtime health or authorization', () => {
|
||||
const brain = buildCapabilityBrain([{ name: 'memory_search' }]);
|
||||
const memory = brain.domains.find((domain) => domain.id === 'memory-knowledge')!;
|
||||
|
||||
@@ -786,7 +786,14 @@ export function buildCapabilityBrain(
|
||||
});
|
||||
|
||||
const uniqueToolCount = seen.size;
|
||||
const classifiedToolCount = uniqueToolCount;
|
||||
// `fallbackClassifiedTools` pushes once per loop iteration (capability-brain.ts above),
|
||||
// including re-occurrences of a duplicate name; dedupe before subtracting from the
|
||||
// unique-name count, or a duplicate-named fallback tool drives classifiedToolCount
|
||||
// negative (found by adversarial critique, 2026-11-16).
|
||||
const classifiedToolCount = uniqueToolCount - new Set(fallbackClassifiedTools).size;
|
||||
const coveragePercent = uniqueToolCount === 0
|
||||
? 100
|
||||
: Number(((classifiedToolCount / uniqueToolCount) * 100).toFixed(2));
|
||||
return {
|
||||
schemaVersion: 'ruflo.capability-brain/v1',
|
||||
generatedAt: now.toISOString(),
|
||||
@@ -807,7 +814,7 @@ export function buildCapabilityBrain(
|
||||
coverage: {
|
||||
registeredToolCount: uniqueToolCount,
|
||||
classifiedToolCount,
|
||||
coveragePercent: uniqueToolCount === 0 ? 100 : 100,
|
||||
coveragePercent,
|
||||
fallbackClassifiedTools: fallbackClassifiedTools.sort(),
|
||||
duplicateToolNames: [...duplicates].sort(),
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user