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:
@@ -9,19 +9,19 @@ import inspect
|
||||
|
||||
|
||||
def test_rulebooks_blueprint_registered():
|
||||
from fabledassistant.routes.rulebooks import rulebooks_bp
|
||||
from scribe.routes.rulebooks import rulebooks_bp
|
||||
assert rulebooks_bp.name == "rulebooks"
|
||||
assert rulebooks_bp.url_prefix == "/api"
|
||||
|
||||
|
||||
def test_rulebooks_blueprint_registered_in_app():
|
||||
from fabledassistant.app import create_app
|
||||
from scribe.app import create_app
|
||||
app = create_app()
|
||||
assert "rulebooks" in app.blueprints
|
||||
|
||||
|
||||
def test_rulebook_handlers_callable():
|
||||
from fabledassistant.routes import rulebooks as rb_routes
|
||||
from scribe.routes import rulebooks as rb_routes
|
||||
for name in (
|
||||
"list_rulebooks", "create_rulebook", "get_rulebook",
|
||||
"update_rulebook", "delete_rulebook",
|
||||
@@ -30,7 +30,7 @@ def test_rulebook_handlers_callable():
|
||||
|
||||
|
||||
def test_topic_handlers_callable():
|
||||
from fabledassistant.routes import rulebooks as rb_routes
|
||||
from scribe.routes import rulebooks as rb_routes
|
||||
for name in (
|
||||
"list_topics", "create_topic", "update_topic", "delete_topic",
|
||||
):
|
||||
@@ -39,7 +39,7 @@ def test_topic_handlers_callable():
|
||||
|
||||
def test_service_signatures_require_user_id():
|
||||
"""Routes must call services with user_id — verify the contract."""
|
||||
from fabledassistant.services import rulebooks as svc
|
||||
from scribe.services import rulebooks as svc
|
||||
for fn_name in (
|
||||
"create_rulebook", "list_rulebooks", "get_rulebook",
|
||||
"update_rulebook", "delete_rulebook", "find_rulebook_by_title",
|
||||
@@ -57,7 +57,7 @@ def test_service_signatures_require_user_id():
|
||||
|
||||
def test_rule_model_carries_project_id_and_topic_id_nullable():
|
||||
"""Migration 0059 made topic_id nullable and added project_id."""
|
||||
from fabledassistant.models.rulebook import Rule
|
||||
from scribe.models.rulebook import Rule
|
||||
assert "project_id" in Rule.__table__.columns
|
||||
assert Rule.__table__.columns["topic_id"].nullable is True
|
||||
assert Rule.__table__.columns["project_id"].nullable is True
|
||||
@@ -65,13 +65,13 @@ def test_rule_model_carries_project_id_and_topic_id_nullable():
|
||||
|
||||
def test_create_project_rule_route_exists():
|
||||
"""POST /api/projects/<id>/rules — the frontend fast-path endpoint."""
|
||||
from fabledassistant.routes import rulebooks as rb_routes
|
||||
from scribe.routes import rulebooks as rb_routes
|
||||
assert callable(getattr(rb_routes, "create_project_rule"))
|
||||
|
||||
|
||||
def test_suppression_route_handlers_exist():
|
||||
"""The 4 suppression endpoint handlers are registered as Python callables."""
|
||||
from fabledassistant.routes import rulebooks as rb_routes
|
||||
from scribe.routes import rulebooks as rb_routes
|
||||
for name in (
|
||||
"suppress_project_rule", "unsuppress_project_rule",
|
||||
"suppress_project_topic", "unsuppress_project_topic",
|
||||
@@ -83,7 +83,7 @@ def test_suppression_association_tables_declared():
|
||||
"""Migration 0060 created two new association tables; the models module
|
||||
must declare matching Table() objects so the rest of the service layer
|
||||
can reference them via .c.<column>."""
|
||||
from fabledassistant.models import rulebook as rb_models
|
||||
from scribe.models import rulebook as rb_models
|
||||
for tbl_name in ("project_rule_suppressions", "project_topic_suppressions"):
|
||||
tbl = getattr(rb_models, tbl_name, None)
|
||||
assert tbl is not None, f"models.rulebook missing {tbl_name}"
|
||||
@@ -94,7 +94,7 @@ def test_suppression_association_tables_declared():
|
||||
|
||||
def test_rulebook_model_carries_always_on():
|
||||
"""Migration 0058 added rulebooks.always_on — verify the model declares it."""
|
||||
from fabledassistant.models.rulebook import Rulebook
|
||||
from scribe.models.rulebook import Rulebook
|
||||
assert "always_on" in Rulebook.__table__.columns
|
||||
col = Rulebook.__table__.columns["always_on"]
|
||||
assert col.nullable is False
|
||||
@@ -107,13 +107,13 @@ def test_update_rulebook_route_accepts_always_on():
|
||||
include always_on or toggling from the UI silently drops the field.
|
||||
"""
|
||||
import inspect as _inspect
|
||||
from fabledassistant.routes import rulebooks as rb_routes
|
||||
from scribe.routes import rulebooks as rb_routes
|
||||
src = _inspect.getsource(rb_routes.update_rulebook)
|
||||
assert "always_on" in src, "update_rulebook handler missing always_on in field whitelist"
|
||||
|
||||
|
||||
def test_rule_and_subscription_handlers_callable():
|
||||
from fabledassistant.routes import rulebooks as rb_routes
|
||||
from scribe.routes import rulebooks as rb_routes
|
||||
for name in (
|
||||
"list_rules", "create_rule", "get_rule", "update_rule", "delete_rule",
|
||||
"subscribe_project", "unsubscribe_project", "get_project_rules",
|
||||
|
||||
Reference in New Issue
Block a user