rename(547): the server is grimoire — package, image, DB defaults, backups
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 12s
CI & Build / TypeScript typecheck (push) Successful in 56s
CI & Build / integration (push) Successful in 1m4s
CI & Build / Python tests (push) Successful in 1m55s
CI & Build / Build & push image (push) Successful in 44s
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 12s
CI & Build / TypeScript typecheck (push) Successful in 56s
CI & Build / integration (push) Successful in 1m4s
CI & Build / Python tests (push) Successful in 1m55s
CI & Build / Build & push image (push) Successful in 44s
Step 2 of the Scribe -> Grimoire rename. - src/scribe -> src/grimoire, and every import, patch target, module path, hypercorn entry point and `python -m grimoire.restore` with it; pyproject, uv.lock and the frontend package are named grimoire. - Image git.fabledsword.com/bvandeusen/fabledgrimoire; CI's Postgres service runs as grimoire / grimoire_test. - Compose files default the DB user, database and (prod) volume to grimoire, each overridable from .env, so an install created as Scribe keeps its data by setting POSTGRES_USER, POSTGRES_DB and PGDATA_VOLUME. - Backups are written as grimoire-<ts>.tar with format grimoire-backup-tar. Archives named scribe-* with the scribe-backup-tar manifest still restore and are still counted at the destination (folder and S3), with tests. - Exports, the MCP auth realm, the ASGI scope key and the persistent logger carry the new name. Kept on purpose: the secret-sealing key label stays "scribe.secrets.v1", because every stored secret was derived under it. Plugin identity (plugin name, hooks, env vars, .scribe marker, skills) is step 3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,10 +16,10 @@ from unittest.mock import AsyncMock, patch
|
||||
import pytest
|
||||
import pytest_asyncio
|
||||
|
||||
from scribe.models import async_session
|
||||
from scribe.services.system_usage import empty_system_usage
|
||||
from grimoire.models import async_session
|
||||
from grimoire.services.system_usage import empty_system_usage
|
||||
# Bound at import, before conftest's autouse stub replaces the module attribute.
|
||||
from scribe.services.system_usage import usage_for_systems as real_usage_for_systems
|
||||
from grimoire.services.system_usage import usage_for_systems as real_usage_for_systems
|
||||
from tests.helpers import ensure_user
|
||||
|
||||
|
||||
@@ -31,13 +31,13 @@ async def test_get_system_carries_its_usage():
|
||||
from tests.helpers import fake_system
|
||||
|
||||
shown = {**empty_system_usage(), "surfaced_count": 4, "pull_count": 1}
|
||||
with patch("scribe.mcp.tools.systems.current_user_id", return_value=1), \
|
||||
patch("scribe.mcp.tools.systems.systems_svc") as svc, \
|
||||
patch("scribe.services.system_usage.usage_for_systems",
|
||||
with patch("grimoire.mcp.tools.systems.current_user_id", return_value=1), \
|
||||
patch("grimoire.mcp.tools.systems.systems_svc") as svc, \
|
||||
patch("grimoire.services.system_usage.usage_for_systems",
|
||||
AsyncMock(return_value={3: shown})):
|
||||
svc.get_system = AsyncMock(return_value=fake_system(id=3))
|
||||
svc.list_records_for_system = AsyncMock(return_value=[])
|
||||
from scribe.mcp.tools.systems import get_system
|
||||
from grimoire.mcp.tools.systems import get_system
|
||||
result = await get_system(system_id=3)
|
||||
assert result["usage"] == shown
|
||||
|
||||
@@ -53,7 +53,7 @@ def test_the_zero_shape_matches_the_client_type():
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_an_empty_id_list_reads_nothing():
|
||||
with patch("scribe.services.system_usage.async_session") as session:
|
||||
with patch("grimoire.services.system_usage.async_session") as session:
|
||||
assert await real_usage_for_systems([]) == {}
|
||||
session.assert_not_called()
|
||||
|
||||
@@ -64,9 +64,9 @@ async def test_an_empty_id_list_reads_nothing():
|
||||
@pytest_asyncio.fixture
|
||||
async def ruled_areas():
|
||||
"""An owner, a project and two Systems, with usage rows on both."""
|
||||
from scribe.models.project import Project
|
||||
from scribe.models.system import System
|
||||
from scribe.models.system_usage import SystemUsageEvent
|
||||
from grimoire.models.project import Project
|
||||
from grimoire.models.system import System
|
||||
from grimoire.models.system_usage import SystemUsageEvent
|
||||
|
||||
async with async_session() as s:
|
||||
owner = await ensure_user(s, "system_usage_owner")
|
||||
@@ -129,7 +129,7 @@ async def test_usage_for_systems_counts_each_system(ruled_areas):
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.usefixtures("_dispose_engine")
|
||||
async def test_the_telemetry_block_names_the_areas_and_offers_no_ratio(ruled_areas):
|
||||
from scribe.services.retrieval_telemetry import retrieval_summary
|
||||
from grimoire.services.retrieval_telemetry import retrieval_summary
|
||||
|
||||
ids = ruled_areas
|
||||
block = (await retrieval_summary(ids["owner"], days=30))["system_usage"]
|
||||
@@ -152,7 +152,7 @@ async def test_the_telemetry_block_names_the_areas_and_offers_no_ratio(ruled_are
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.usefixtures("_dispose_engine")
|
||||
async def test_a_fresh_install_reads_zero_not_failed():
|
||||
from scribe.services.retrieval_telemetry import retrieval_summary
|
||||
from grimoire.services.retrieval_telemetry import retrieval_summary
|
||||
|
||||
block = (await retrieval_summary(990031, days=30))["system_usage"]
|
||||
assert "system_usage_failed" not in block
|
||||
|
||||
Reference in New Issue
Block a user