fix: ADR-0059 — RvfBackend swap, CJS bug fixes, packaging fixes#1528
Closed
sparkling wants to merge 1 commit intoruvnet:mainfrom
Closed
fix: ADR-0059 — RvfBackend swap, CJS bug fixes, packaging fixes#1528sparkling wants to merge 1 commit intoruvnet:mainfrom
sparkling wants to merge 1 commit intoruvnet:mainfrom
Conversation
Fixes ruvnet#1526 ## ADR-0059 changes (this session) auto-memory-hook.mjs — createBackend() prefers RvfBackend (same package, atomic persist, zero native deps). Falls back to AgentDBBackend then JsonFileBackend. AgentDBBackend silently degraded to in-memory Map — data lost every session. intelligence.cjs — ID collision (entries.length suffix), ML-006 scope (current project only, not all 51 dirs), ranked dedup (deduped.map not store.map). hook-handler.cjs — tool_input (snake_case) before toolInput (camelCase). Claude Code sends snake_case; every edit was recorded as "unknown". cli/package.json — @claude-flow/memory: optional → required. memory/package.json — better-sqlite3: optional → required, pinned 11.10.0. github-safe.js → .mjs — ESM syntax fix. ## Prerequisite patches included (required for ADR-0059 to work) auto-memory-hook.mjs also includes: WM-003: createBackend() factory + config.json reader intelligence.cjs also includes: IN-003/IN-004: CJS snapshot reader + signal writer dc179d6: dedup guard (creates 'deduped' variable ADR-0059 references) Co-Authored-By: claude-flow <ruv@ruv.net>
a587f19 to
161ea12
Compare
Author
|
Closing — this work is being tracked in ruflo-patch ADR-0059/0065 instead. The RvfBackend swap and CJS fixes are applied in our fork pipeline. |
sparkling
added a commit
to sparkling/ruflo-patch
that referenced
this pull request
Apr 6, 2026
…, fork hygiene Phase 1: RvfBackend preferred in auto-memory-hook createBackend() Phase 2: ID collision fix, ML-006 scope, tool_input snake_case, ranked dedup Acceptance: 12 ADR-0059 checks + removed 9 phantom checks for tools/controllers that never existed in any upstream branch. Fixed e2e-causal-edge tool name (underscore→hyphen). Suite: 60/60, ADR-0059: 12/12. Harness: removed --ignore-scripts (match real user installs). Attention check: accept success:true without results field. CLAUDE.md: test pyramid with cascading pipeline, per-change-type table. ADR-0060: fork patch hygiene rules (10 fix-on-fix patterns identified). Upstream: ruvnet/ruflo#1526 (issue), ruvnet/ruflo#1528 (PR, 1 commit, 6 files). Co-Authored-By: claude-flow <ruv@ruv.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Fixes #1526
Summary
1 commit, 6 files, 214 insertions, 63 deletions. ADR-0059 fixes + their direct prerequisites only. No version bumps, no unrelated changes.
ADR-0059 Changes
auto-memory-hook.mjscreateBackend(): RvfBackend preferred → AgentDBBackend fallback → JsonFileBackend. Fixes silent data loss — AgentDBBackend degraded to in-memory Map every session.intelligence.cjshook-handler.cjstool_input(snake_case) beforetoolInput(camelCase) — Claude Code sends snake_case; every edit was recorded as "unknown"cli/package.json@claude-flow/memory: optional → required (0 controllers is not a valid state)memory/package.jsonbetter-sqlite3: optional → required, pinned11.10.0(confirmed prebuilts for darwin-arm64/x64, linux-x64)github-safe.js → .mjs.jsextension failsnode -cPrerequisite Patches Included
These prior patches are bundled because ADR-0059 cannot work without them:
WM-003 (in
auto-memory-hook.mjs):createBackend()factory withconfig.jsonreader and backend selection. ADR-0059's RvfBackend swap is a change TO this function — it must exist first. Upstream only has a hardcodedJsonFileBackendinstantiation.IN-003/IN-004 (in
intelligence.cjs): CJS snapshot reader + signal writer. Provides the intelligence pipeline (init,getContext,recordEdit,consolidate,feedback) that ADR-0059's bug fixes target.dc179d6 (in
intelligence.cjs): Dedup guard — creates thededupedvariable. ADR-0059 changesstore.map(...)todeduped.map(...)in two places. Without this, the code throwsReferenceError: deduped is not defined.Root Cause
AgentDBBackend.initialize()doesimport('@claude-flow/agentdb')— a cross-package dynamic import that fails silently in the hook subprocess. Data writes to an in-memoryMap, lost on process exit. The.rvffile is never created. The session-boundary drain (ADR-048) has never worked.Test Results
🤖 Generated with claude-flow