Summary
The Brain Console's compactionSurvival probe does not recognise the session snapshots emitted by the configured Ruflo PreCompact hook. A project can have persisted session snapshots and still be shown as:
no PreCompact snapshot found for this project yet
This is a producer/detector contract mismatch that creates a false health warning and depresses the memory-quality score.
Verified implementation mismatch
On current main, scripts/onboarding-console.mjs only accepts two files:
const snap = fs.existsSync(path.join(projectDir, 'agentdb-sessions.jsonl')) ||
fs.existsSync(path.join(projectDir, '.swarm/agentdb-sessions.jsonl'));
The current Ruflo hooks session-end --save-state true implementation instead writes snapshots under:
<project>/.claude/sessions/session-*.json
Existing Ruflo installations can also contain valid archived snapshots under:
<project>/.claude-flow/sessions/session-*.json
A live reproduction had eight snapshots in .claude-flow/sessions/, a configured PreCompact hook invoking ruflo hooks session-end --save-state true, and no recognised agentdb-sessions.jsonl; the Console therefore reported warn despite the persisted artifacts.
Reproduction
-
Configure Claude Code's PreCompact hook to invoke:
ruflo hooks session-end --save-state true
-
Run the hook and verify a session snapshot exists under .claude/sessions/, or use a project with existing .claude-flow/sessions/session-*.json snapshots.
-
Open the Brain Console.
-
Inspect Your memory, across every project → Compaction survival.
-
The Console still reports no PreCompact snapshot because it checks only the two agentdb-sessions.jsonl locations.
Impact
- False warning on a healthy persistence path.
- The tested dimension receives half credit (
warn) instead of full credit (ok).
- The 0–100 memory-quality score understates observed health.
- Users are encouraged to repair persistence that may already be working.
Expected behaviour
The snapshot producer and Brain Console detector should share one explicit, versioned artifact contract. The Console should recognise the canonical artifact produced by the configured PreCompact hook and report its location and freshness.
Suggested acceptance criteria
- Choose and document the canonical PreCompact snapshot path and minimal schema.
- Make
ruflo hooks session-end --save-state true and probeMemory() use that same contract.
- Recognise or explicitly migrate legacy
.claude-flow/sessions/session-*.json snapshots.
- Validate a snapshot's structure and freshness rather than passing on arbitrary file existence alone.
- Add fixtures proving:
- valid canonical snapshot →
ok;
- supported legacy snapshot →
ok or a clear migration state;
- absent snapshot →
warn;
- unrelated or malformed file → does not produce
ok.
- Keep the separate
project-state-current* coverage warning unchanged; that probe represents a different invariant.
Source locations
scripts/onboarding-console.mjs (probeMemory, compactionSurvival)
- Ruflo's
hooks_session-end implementation in @claude-flow/cli/dist/src/mcp-tools/hooks-tools.js
Summary
The Brain Console's
compactionSurvivalprobe does not recognise the session snapshots emitted by the configured RufloPreCompacthook. A project can have persisted session snapshots and still be shown as:This is a producer/detector contract mismatch that creates a false health warning and depresses the memory-quality score.
Verified implementation mismatch
On current
main,scripts/onboarding-console.mjsonly accepts two files:The current Ruflo
hooks session-end --save-state trueimplementation instead writes snapshots under:Existing Ruflo installations can also contain valid archived snapshots under:
A live reproduction had eight snapshots in
.claude-flow/sessions/, a configuredPreCompacthook invokingruflo hooks session-end --save-state true, and no recognisedagentdb-sessions.jsonl; the Console therefore reportedwarndespite the persisted artifacts.Reproduction
Configure Claude Code's
PreCompacthook to invoke:Run the hook and verify a session snapshot exists under
.claude/sessions/, or use a project with existing.claude-flow/sessions/session-*.jsonsnapshots.Open the Brain Console.
Inspect Your memory, across every project → Compaction survival.
The Console still reports no PreCompact snapshot because it checks only the two
agentdb-sessions.jsonllocations.Impact
warn) instead of full credit (ok).Expected behaviour
The snapshot producer and Brain Console detector should share one explicit, versioned artifact contract. The Console should recognise the canonical artifact produced by the configured PreCompact hook and report its location and freshness.
Suggested acceptance criteria
ruflo hooks session-end --save-state trueandprobeMemory()use that same contract..claude-flow/sessions/session-*.jsonsnapshots.ok;okor a clear migration state;warn;ok.project-state-current*coverage warning unchanged; that probe represents a different invariant.Source locations
scripts/onboarding-console.mjs(probeMemory,compactionSurvival)hooks_session-endimplementation in@claude-flow/cli/dist/src/mcp-tools/hooks-tools.js