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,8 +3,8 @@ from unittest.mock import AsyncMock, MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from fabledassistant.mcp._context import _user_id_ctx
|
||||
from fabledassistant.mcp.tools.milestones import (
|
||||
from scribe.mcp._context import _user_id_ctx
|
||||
from scribe.mcp.tools.milestones import (
|
||||
list_milestones, create_milestone, update_milestone,
|
||||
)
|
||||
|
||||
@@ -29,7 +29,7 @@ def _fake_ms(**overrides) -> MagicMock:
|
||||
async def test_list_milestones_returns_dict_with_progress():
|
||||
rows = [{"id": 1, "title": "MS1", "status": "active", "task_count": 2}]
|
||||
with patch(
|
||||
"fabledassistant.mcp.tools.milestones.milestones_svc.get_project_milestone_summary",
|
||||
"scribe.mcp.tools.milestones.milestones_svc.get_project_milestone_summary",
|
||||
AsyncMock(return_value=rows),
|
||||
):
|
||||
out = await list_milestones(project_id=1)
|
||||
@@ -40,7 +40,7 @@ async def test_list_milestones_returns_dict_with_progress():
|
||||
async def test_create_milestone_passes_through():
|
||||
m = _fake_ms(id=5)
|
||||
mock = AsyncMock(return_value=m)
|
||||
with patch("fabledassistant.mcp.tools.milestones.milestones_svc.create_milestone", mock):
|
||||
with patch("scribe.mcp.tools.milestones.milestones_svc.create_milestone", mock):
|
||||
out = await create_milestone(project_id=1, title="new", description="d")
|
||||
assert out["id"] == 5
|
||||
assert mock.call_args.kwargs["project_id"] == 1
|
||||
@@ -52,7 +52,7 @@ async def test_create_milestone_passes_through():
|
||||
async def test_create_milestone_empty_description_becomes_none():
|
||||
m = _fake_ms()
|
||||
mock = AsyncMock(return_value=m)
|
||||
with patch("fabledassistant.mcp.tools.milestones.milestones_svc.create_milestone", mock):
|
||||
with patch("scribe.mcp.tools.milestones.milestones_svc.create_milestone", mock):
|
||||
await create_milestone(project_id=1, title="t", description="")
|
||||
assert mock.call_args.kwargs["description"] is None
|
||||
|
||||
@@ -61,7 +61,7 @@ async def test_create_milestone_empty_description_becomes_none():
|
||||
async def test_update_milestone_only_sends_non_default_fields():
|
||||
m = _fake_ms()
|
||||
mock = AsyncMock(return_value=m)
|
||||
with patch("fabledassistant.mcp.tools.milestones.milestones_svc.update_milestone", mock):
|
||||
with patch("scribe.mcp.tools.milestones.milestones_svc.update_milestone", mock):
|
||||
await update_milestone(project_id=1, milestone_id=5, status="done")
|
||||
args, kwargs = mock.call_args
|
||||
assert args == (7, 5)
|
||||
@@ -73,7 +73,7 @@ async def test_update_milestone_order_index_negative_is_omitted():
|
||||
"""order_index=-1 sentinel means leave unchanged."""
|
||||
m = _fake_ms()
|
||||
mock = AsyncMock(return_value=m)
|
||||
with patch("fabledassistant.mcp.tools.milestones.milestones_svc.update_milestone", mock):
|
||||
with patch("scribe.mcp.tools.milestones.milestones_svc.update_milestone", mock):
|
||||
await update_milestone(project_id=1, milestone_id=5, order_index=-1)
|
||||
assert "order_index" not in mock.call_args.kwargs
|
||||
|
||||
@@ -83,7 +83,7 @@ async def test_update_milestone_order_index_zero_is_explicit():
|
||||
"""order_index=0 is a real value (top of list), not a sentinel."""
|
||||
m = _fake_ms()
|
||||
mock = AsyncMock(return_value=m)
|
||||
with patch("fabledassistant.mcp.tools.milestones.milestones_svc.update_milestone", mock):
|
||||
with patch("scribe.mcp.tools.milestones.milestones_svc.update_milestone", mock):
|
||||
await update_milestone(project_id=1, milestone_id=5, order_index=0)
|
||||
assert mock.call_args.kwargs["order_index"] == 0
|
||||
|
||||
@@ -91,7 +91,7 @@ async def test_update_milestone_order_index_zero_is_explicit():
|
||||
@pytest.mark.asyncio
|
||||
async def test_update_milestone_raises_when_not_found():
|
||||
with patch(
|
||||
"fabledassistant.mcp.tools.milestones.milestones_svc.update_milestone",
|
||||
"scribe.mcp.tools.milestones.milestones_svc.update_milestone",
|
||||
AsyncMock(return_value=None),
|
||||
):
|
||||
with pytest.raises(ValueError, match="milestone 999 not found"):
|
||||
|
||||
Reference in New Issue
Block a user