Skip to content
Merged
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
553 changes: 553 additions & 0 deletions ROOT_DIRECTORY_AUDIT.json

Large diffs are not rendered by default.

File renamed without changes.
78 changes: 0 additions & 78 deletions mcp_config.json

This file was deleted.

4 changes: 2 additions & 2 deletions run_semantic_tests.sh → scripts/run_semantic_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ export TRANSFORMERS_NO_TF=1
export TF_USE_LEGACY_KERAS=1
export TF_CPP_MIN_LOG_LEVEL=3

# Run the test script
python test_semantic_integration.py
# Run the test script from project root
python tests/integration/test_semantic_integration.py
36 changes: 36 additions & 0 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""Pytest fixtures for integration tests."""
import os
import pytest
from pathlib import Path
import tempfile
import shutil

# Set environment variables before any imports
os.environ['TRANSFORMERS_NO_TF'] = '1'
os.environ['TF_USE_LEGACY_KERAS'] = '1'
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'

from mapify_cli.playbook_manager import PlaybookManager, SEMANTIC_SEARCH_AVAILABLE


@pytest.fixture(scope="module")
def manager(tmp_path_factory):
"""Create PlaybookManager with semantic search for integration tests."""
if not SEMANTIC_SEARCH_AVAILABLE:
pytest.skip("sentence-transformers not installed")

# Create temporary directory for test playbook
test_dir = tmp_path_factory.mktemp("semantic_test")
playbook_path = test_dir / "playbook_test.json"

# Initialize manager
manager = PlaybookManager(
playbook_path=str(playbook_path),
use_semantic_search=True
)

yield manager

# Cleanup
if playbook_path.exists():
playbook_path.unlink()
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,24 @@
from pathlib import Path

# Add src to path for imports
sys.path.insert(0, str(Path(__file__).parent / "src"))
project_root = Path(__file__).parent.parent.parent
sys.path.insert(0, str(project_root / "src"))

from mapify_cli.playbook_manager import PlaybookManager, SEMANTIC_SEARCH_AVAILABLE


def test_initialization():
def test_initialization(manager):
"""Test PlaybookManager initialization with semantic search."""
print("\n" + "="*70)
print("TEST 1: PlaybookManager Initialization")
print("="*70)

if not SEMANTIC_SEARCH_AVAILABLE:
print("❌ FAILED: sentence-transformers not installed")
print(" Install with: pip install -r requirements-semantic.txt")
return False

manager = PlaybookManager(
playbook_path=".claude/playbook_test.json",
use_semantic_search=True
)

if manager.semantic_engine is None:
print("❌ FAILED: Semantic engine not initialized")
return False
assert manager.semantic_engine is not None, "Semantic engine not initialized"

print("✓ PlaybookManager initialized with semantic search")
print(f" Model: {manager.semantic_engine.model_name}")
print(f" Cache dir: {manager.semantic_engine.cache_dir}")

return manager


def test_add_bullets(manager):
"""Test adding bullets via delta operations."""
Expand Down