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.auth import resolve_bearer, resolve_bearer_to_user_id
|
||||
from scribe.mcp.auth import resolve_bearer, resolve_bearer_to_user_id
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@@ -22,7 +22,7 @@ async def test_resolve_bearer_malformed_header_returns_none():
|
||||
@pytest.mark.asyncio
|
||||
async def test_resolve_bearer_unknown_token_returns_none():
|
||||
with patch(
|
||||
"fabledassistant.mcp.auth.lookup_key",
|
||||
"scribe.mcp.auth.lookup_key",
|
||||
AsyncMock(return_value=None),
|
||||
):
|
||||
assert await resolve_bearer_to_user_id("Bearer fmcp_doesnotexist") is None
|
||||
@@ -33,7 +33,7 @@ async def test_resolve_bearer_valid_token_returns_user_id():
|
||||
fake_key = MagicMock()
|
||||
fake_key.user_id = 42
|
||||
with patch(
|
||||
"fabledassistant.mcp.auth.lookup_key",
|
||||
"scribe.mcp.auth.lookup_key",
|
||||
AsyncMock(return_value=fake_key),
|
||||
):
|
||||
uid = await resolve_bearer_to_user_id("Bearer fmcp_validkey")
|
||||
@@ -46,7 +46,7 @@ async def test_resolve_bearer_calls_lookup_with_stripped_token():
|
||||
fake_key = MagicMock()
|
||||
fake_key.user_id = 1
|
||||
mock_lookup = AsyncMock(return_value=fake_key)
|
||||
with patch("fabledassistant.mcp.auth.lookup_key", mock_lookup):
|
||||
with patch("scribe.mcp.auth.lookup_key", mock_lookup):
|
||||
await resolve_bearer_to_user_id("Bearer fmcp_abc123 ")
|
||||
mock_lookup.assert_awaited_once_with("fmcp_abc123")
|
||||
|
||||
@@ -58,13 +58,13 @@ async def test_resolve_bearer_returns_user_id_and_scope():
|
||||
fake_key = MagicMock()
|
||||
fake_key.user_id = 9
|
||||
fake_key.scope = "read"
|
||||
with patch("fabledassistant.mcp.auth.lookup_key", AsyncMock(return_value=fake_key)):
|
||||
with patch("scribe.mcp.auth.lookup_key", AsyncMock(return_value=fake_key)):
|
||||
assert await resolve_bearer("Bearer fmcp_x") == (9, "read")
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_resolve_bearer_none_for_invalid():
|
||||
with patch("fabledassistant.mcp.auth.lookup_key", AsyncMock(return_value=None)):
|
||||
with patch("scribe.mcp.auth.lookup_key", AsyncMock(return_value=None)):
|
||||
assert await resolve_bearer("Bearer nope") is None
|
||||
assert await resolve_bearer(None) is None
|
||||
|
||||
@@ -73,7 +73,7 @@ async def test_resolve_bearer_none_for_invalid():
|
||||
|
||||
def test_body_calls_write_tool_classifies_correctly():
|
||||
import json
|
||||
from fabledassistant.mcp.server import _body_calls_write_tool
|
||||
from scribe.mcp.server import _body_calls_write_tool
|
||||
|
||||
def call(name):
|
||||
return json.dumps({"jsonrpc": "2.0", "id": 1, "method": "tools/call",
|
||||
|
||||
Reference in New Issue
Block a user