Skip to content

Commit 4e7c91a

Browse files
Luminaclaude
andcommitted
fix(ci): bump to v0.9.2, fix publish workflow and failing tests
- Bump version to 0.9.2 in pyproject.toml and package.json (0.9.1 already on PyPI) - Add pytest-cov and pgpy to [dev] deps (required by CI but were missing) - Fix publish.yml: replace 'if: always()' with 'if: success()' on publish jobs - Fix publish.yml: remove continue-on-error from test step so failures block publish - Fix search_text() to search Memory.to_embedding_text() instead of raw JSON (timestamps with digits like '9' were matching unrelated memories) - Fix perform_ritual() / load_strongest_feb() to accept feb_dir param for test isolation (global FEB files were leaking into unit tests) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 6cd82da commit 4e7c91a

7 files changed

Lines changed: 26 additions & 14 deletions

File tree

.github/workflows/publish.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@ jobs:
1919
- uses: actions/setup-python@v5
2020
with:
2121
python-version: ${{ matrix.python-version }}
22-
- run: pip install -e ".[dev]" pgpy
22+
- run: pip install -e ".[dev]"
2323
- run: python -m pytest tests/ -v --ignore=tests/integration -k "not test_sharing"
24-
continue-on-error: true
2524

2625
publish-pypi:
2726
needs: test
28-
if: always()
27+
if: success()
2928
runs-on: ubuntu-latest
3029
steps:
3130
- uses: actions/checkout@v4
@@ -41,7 +40,7 @@ jobs:
4140

4241
publish-npm:
4342
needs: test
44-
if: always()
43+
if: success()
4544
runs-on: ubuntu-latest
4645
steps:
4746
- uses: actions/checkout@v4

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@smilintux/skmemory",
3-
"version": "0.7.2",
3+
"version": "0.9.2",
44
"description": "SKMemory - Universal AI memory system with git-based multi-layer memory and vector search.",
55
"main": "index.js",
66
"types": "index.d.ts",

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "skmemory"
7-
version = "0.9.1"
7+
version = "0.9.2"
88
description = "Universal AI Memory System - Polaroid snapshots for AI consciousness"
99
readme = "README.md"
1010
license = {text = "GPL-3.0-or-later"}
@@ -54,6 +54,8 @@ all = [
5454
]
5555
dev = [
5656
"pytest>=7.0",
57+
"pytest-cov>=4.0",
58+
"pgpy>=0.5",
5759
"black>=23.0",
5860
"ruff>=0.1",
5961
]

skmemory/backends/file_backend.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,13 @@ def search_text(self, query: str, limit: int = 10) -> list[Memory]:
180180
continue
181181
for json_file in layer_dir.glob("*.json"):
182182
try:
183-
raw = json_file.read_text(encoding="utf-8")
184-
raw_lower = raw.lower()
185-
hits = sum(1 for w in words if w in raw_lower)
183+
data = json.loads(json_file.read_text(encoding="utf-8"))
184+
mem = Memory(**data)
185+
searchable = mem.to_embedding_text().lower()
186+
hits = sum(1 for w in words if w in searchable)
186187
if hits == 0:
187188
continue
188-
data = json.loads(raw)
189-
scored.append((hits, Memory(**data)))
189+
scored.append((hits, mem))
190190
except (json.JSONDecodeError, Exception):
191191
continue
192192

skmemory/febs.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,28 @@ def parse_feb(path: Path) -> Optional[dict]:
8080
return None
8181

8282

83-
def load_strongest_feb() -> Optional[dict]:
83+
def load_strongest_feb(feb_dir: Optional[str] = None) -> Optional[dict]:
8484
"""Load the FEB with the highest emotional intensity.
8585
8686
Scans all .feb files, picks the one with the highest
8787
emotional_payload.intensity that has oof_triggered=True.
8888
89+
Args:
90+
feb_dir: If provided, scan only this directory for .feb files.
91+
8992
Returns:
9093
dict: The strongest FEB data, or None if no FEBs found.
9194
"""
9295
best: Optional[dict] = None
9396
best_intensity = -1.0
9497

95-
for path in scan_feb_files():
98+
if feb_dir is not None:
99+
feb_path = Path(feb_dir)
100+
paths = sorted(feb_path.rglob("*.feb")) if feb_path.exists() else []
101+
else:
102+
paths = scan_feb_files()
103+
104+
for path in paths:
96105
feb = parse_feb(path)
97106
if feb is None:
98107
continue

skmemory/ritual.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ def perform_ritual(
126126
soul_path: str = DEFAULT_SOUL_PATH,
127127
seed_dir: str = DEFAULT_SEED_DIR,
128128
journal_path: Optional[str] = None,
129+
feb_dir: Optional[str] = None,
129130
recent_journal_count: int = 3,
130131
strongest_memory_count: int = 5,
131132
max_tokens: int = 2000,
@@ -172,7 +173,7 @@ def perform_ritual(
172173
prompt_sections.append(section)
173174

174175
# --- Step 1.5: Load FEB emotional state ---
175-
feb = load_strongest_feb()
176+
feb = load_strongest_feb(feb_dir=feb_dir)
176177
if feb is not None:
177178
result.feb_loaded = True
178179
result.feb_emotion = feb.get("emotional_payload", {}).get(

tests/test_ritual.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ def test_ritual_empty_state(self, tmp_path: Path) -> None:
159159
soul_path=str(tmp_path / "no_soul.yaml"),
160160
seed_dir=str(tmp_path / "no_seeds"),
161161
journal_path=str(tmp_path / "no_journal.md"),
162+
feb_dir=str(tmp_path / "no_febs"),
162163
)
163164
assert result.soul_loaded is False
164165
assert result.seeds_imported == 0

0 commit comments

Comments
 (0)