Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "brainlayer"
version = "1.2.0"
version = "1.2.2"
description = "Persistent memory MCP server for AI agents — 13 tools, semantic search, knowledge graph, on-device SQLite"
license = {text = "Apache-2.0"}
readme = "README.md"
Expand Down
4 changes: 2 additions & 2 deletions server.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "io.github.etanhey/brainlayer",
"title": "BrainLayer",
"description": "Persistent memory for AI agents — local-first semantic search, knowledge graph, and 12 MCP tools with ToolAnnotations. One SQLite file, no cloud, no API keys.",
"version": "1.2.0",
"version": "1.2.2",
"websiteUrl": "https://brainlayer.etanheyman.com",
"repository": {
"url": "https://github.com/EtanHey/brainlayer",
Expand All @@ -14,7 +14,7 @@
"registryType": "pypi",
"registryBaseUrl": "https://pypi.org",
"identifier": "brainlayer",
"version": "1.2.0",
"version": "1.2.2",
"runtimeHint": "pipx",
"transport": {
"type": "stdio"
Expand Down
2 changes: 1 addition & 1 deletion src/brainlayer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""BrainLayer (זיכרון) - Local knowledge pipeline for Claude Code conversations."""

__version__ = "1.2.0"
__version__ = "1.2.2"
38 changes: 28 additions & 10 deletions tests/test_stability_health_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,43 @@


@pytest.fixture(autouse=True)
def _isolate_default_queue_dir(tmp_path_factory, monkeypatch):
"""Isolate the default HealthCheckConfig queue_dir from the live queue.

Tests that build HealthCheckConfig without an explicit queue_dir otherwise
read the developer's real ~/.brainlayer/queue; a populated live queue then
makes them spuriously report `queue_backed_up`. We redirect _queue_stats
so the live default path is treated as the empty isolated dir, while tests
that pass an explicit queue_dir are honored unchanged.
def _isolate_default_live_paths(tmp_path_factory, monkeypatch):
"""Isolate HealthCheckConfig defaults that point at live developer state.

Several tests build HealthCheckConfig without overriding every path, so they
inherit the developer's real ~/.brainlayer/queue and
~/.local/share/brainlayer/pause.sentinel. A populated live queue then makes
them spuriously report `queue_backed_up`, and a live pause sentinel
suppresses `watcher_stalled`. We redirect the queue-stats and
pause-sentinel readers so the live default paths resolve to empty/absent
isolated locations, while tests that pass explicit paths are honored.
"""
empty_queue = tmp_path_factory.mktemp("hc-queue")
live_default = Path("~/.brainlayer/queue").expanduser()
live_queue_default = Path("~/.brainlayer/queue").expanduser()
real_queue_stats = health_check._queue_stats

def _isolated_queue_stats(queue_dir, now):
if queue_dir.expanduser() == live_default:
if queue_dir.expanduser() == live_queue_default:
queue_dir = empty_queue
return real_queue_stats(queue_dir, now)

monkeypatch.setattr(health_check, "_queue_stats", _isolated_queue_stats)

# Redirect the live default pause-sentinel path to an absent tmp file so a
# real `brainlayer pause` sentinel cannot leak into tests that don't
# override pause_sentinel_path.
absent_sentinel = tmp_path_factory.mktemp("hc-sentinel") / "pause.sentinel"
live_sentinel_default = Path("~/.local/share/brainlayer/pause.sentinel").expanduser()
real_pause_state = health_check._pause_sentinel_state

def _isolated_pause_state(config, now):
if config.pause_sentinel_path.expanduser() == live_sentinel_default:
from dataclasses import replace

config = replace(config, pause_sentinel_path=absent_sentinel)
return real_pause_state(config, now)

monkeypatch.setattr(health_check, "_pause_sentinel_state", _isolated_pause_state)
yield


Expand Down
Loading