refactor: rename package fabledassistant -> scribe (code-only)
Renames src/fabledassistant -> src/scribe and all imports, plus the default DB name and DB user/password (fabled -> scribe) in config + compose. 952 refs / 154 files. Reverses the old 'internal name stays fabledassistant' convention. Code-only: live databases are still physically named 'fabledassistant'. Deployed environments must set POSTGRES_DB / POSTGRES_USER (or rename the DB) since the defaults now resolve to 'scribe'. Repo (FabledScribe), git host (fabledsword), MCP (fabled-git) and the image name (fabledscribe) are intentionally unchanged. ruff check src/ clean locally; CI (typecheck + pytest) is the gate. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,7 @@ from unittest.mock import AsyncMock, MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from fabledassistant.mcp._context import _user_id_ctx
|
||||
from scribe.mcp._context import _user_id_ctx
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
@@ -24,7 +24,7 @@ def _fake_note(id=1, title="Drift Audit", note_type="process"):
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_create_process_requires_title_and_body():
|
||||
from fabledassistant.mcp.tools.processes import create_process
|
||||
from scribe.mcp.tools.processes import create_process
|
||||
with pytest.raises(ValueError):
|
||||
await create_process(title="", body="something")
|
||||
with pytest.raises(ValueError):
|
||||
@@ -34,9 +34,9 @@ async def test_create_process_requires_title_and_body():
|
||||
@pytest.mark.asyncio
|
||||
async def test_create_process_sets_note_type():
|
||||
created = _fake_note()
|
||||
with patch("fabledassistant.services.notes.create_note",
|
||||
with patch("scribe.services.notes.create_note",
|
||||
AsyncMock(return_value=created)) as mock_create:
|
||||
from fabledassistant.mcp.tools.processes import create_process
|
||||
from scribe.mcp.tools.processes import create_process
|
||||
out = await create_process(title="Drift Audit", body="the prompt", tags=["audit"])
|
||||
assert out["note_type"] == "process"
|
||||
# the service was asked to create a process
|
||||
@@ -47,9 +47,9 @@ async def test_create_process_sets_note_type():
|
||||
@pytest.mark.asyncio
|
||||
async def test_get_process_returns_body_and_candidates():
|
||||
note = _fake_note(id=7)
|
||||
with patch("fabledassistant.services.notes.resolve_process",
|
||||
with patch("scribe.services.notes.resolve_process",
|
||||
AsyncMock(return_value=(note, [{"id": 9, "title": "Drift Audit Notes"}]))):
|
||||
from fabledassistant.mcp.tools.processes import get_process
|
||||
from scribe.mcp.tools.processes import get_process
|
||||
out = await get_process("drift")
|
||||
assert out["id"] == 7
|
||||
assert out["other_matches"] == [{"id": 9, "title": "Drift Audit Notes"}]
|
||||
@@ -57,9 +57,9 @@ async def test_get_process_returns_body_and_candidates():
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_get_process_not_found_raises():
|
||||
with patch("fabledassistant.services.notes.resolve_process",
|
||||
with patch("scribe.services.notes.resolve_process",
|
||||
AsyncMock(return_value=(None, []))):
|
||||
from fabledassistant.mcp.tools.processes import get_process
|
||||
from scribe.mcp.tools.processes import get_process
|
||||
with pytest.raises(ValueError):
|
||||
await get_process("missing")
|
||||
|
||||
@@ -67,15 +67,15 @@ async def test_get_process_not_found_raises():
|
||||
@pytest.mark.asyncio
|
||||
async def test_update_process_rejects_non_process_note():
|
||||
plain = _fake_note(id=3, note_type="note")
|
||||
with patch("fabledassistant.services.notes.get_note",
|
||||
with patch("scribe.services.notes.get_note",
|
||||
AsyncMock(return_value=plain)):
|
||||
from fabledassistant.mcp.tools.processes import update_process
|
||||
from scribe.mcp.tools.processes import update_process
|
||||
with pytest.raises(ValueError):
|
||||
await update_process(process_id=3, title="x")
|
||||
|
||||
|
||||
def test_register_attaches_four_tools():
|
||||
from fabledassistant.mcp.tools import processes
|
||||
from scribe.mcp.tools import processes
|
||||
names: list[str] = []
|
||||
|
||||
class FakeMcp:
|
||||
|
||||
Reference in New Issue
Block a user