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:
@@ -2,7 +2,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)
|
||||
@@ -16,9 +16,9 @@ def _bind_user():
|
||||
async def test_start_planning_tool_delegates_to_service():
|
||||
payload = {"task": {"id": 5}, "applicable_rules": [], "subscribed_rulebooks": [],
|
||||
"applicable_rules_truncated": False, "project_goal": "", "open_task_count": 0}
|
||||
with patch("fabledassistant.mcp.tools.tasks.planning_svc.start_planning",
|
||||
with patch("scribe.mcp.tools.tasks.planning_svc.start_planning",
|
||||
AsyncMock(return_value=payload)) as mock:
|
||||
from fabledassistant.mcp.tools.tasks import start_planning
|
||||
from scribe.mcp.tools.tasks import start_planning
|
||||
out = await start_planning(project_id=3, title="Plan it")
|
||||
assert out["task"]["id"] == 5
|
||||
assert mock.call_args.kwargs == {"user_id": 7, "project_id": 3, "title": "Plan it"}
|
||||
@@ -32,11 +32,11 @@ async def test_get_task_augments_plan_with_rules():
|
||||
note.to_dict.return_value = {"id": 9, "task_kind": "plan", "project_id": 3}
|
||||
applicable = {"rules": [{"id": 1, "title": "r"}], "truncated": False,
|
||||
"subscribed_rulebooks": [{"id": 2, "title": "rb"}]}
|
||||
with patch("fabledassistant.mcp.tools.tasks.notes_svc.get_note",
|
||||
with patch("scribe.mcp.tools.tasks.notes_svc.get_note",
|
||||
AsyncMock(return_value=note)), \
|
||||
patch("fabledassistant.mcp.tools.tasks.rulebooks_svc.get_applicable_rules",
|
||||
patch("scribe.mcp.tools.tasks.rulebooks_svc.get_applicable_rules",
|
||||
AsyncMock(return_value=applicable)):
|
||||
from fabledassistant.mcp.tools.tasks import get_task
|
||||
from scribe.mcp.tools.tasks import get_task
|
||||
out = await get_task(task_id=9)
|
||||
assert out["applicable_rules"] == [{"id": 1, "title": "r"}]
|
||||
assert out["subscribed_rulebooks"] == [{"id": 2, "title": "rb"}]
|
||||
@@ -49,11 +49,11 @@ async def test_get_task_work_kind_has_no_rules():
|
||||
note.parent_id = None
|
||||
note.project_id = 3
|
||||
note.to_dict.return_value = {"id": 9, "task_kind": "work", "project_id": 3}
|
||||
with patch("fabledassistant.mcp.tools.tasks.notes_svc.get_note",
|
||||
with patch("scribe.mcp.tools.tasks.notes_svc.get_note",
|
||||
AsyncMock(return_value=note)), \
|
||||
patch("fabledassistant.mcp.tools.tasks.rulebooks_svc.get_applicable_rules",
|
||||
patch("scribe.mcp.tools.tasks.rulebooks_svc.get_applicable_rules",
|
||||
AsyncMock()) as mock_rules:
|
||||
from fabledassistant.mcp.tools.tasks import get_task
|
||||
from scribe.mcp.tools.tasks import get_task
|
||||
out = await get_task(task_id=9)
|
||||
assert "applicable_rules" not in out
|
||||
assert not mock_rules.called
|
||||
|
||||
Reference in New Issue
Block a user