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:
@@ -13,8 +13,8 @@ from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from scribe.services import backup_file
|
||||
from scribe.services.backup_file import (
|
||||
from grimoire.services import backup_file
|
||||
from grimoire.services.backup_file import (
|
||||
ArchiveError, archive_name, is_archive, read_archive, write_archive,
|
||||
write_archive_to,
|
||||
)
|
||||
@@ -50,7 +50,7 @@ def _members(payload: dict) -> dict[str, bytes]:
|
||||
|
||||
|
||||
def test_the_name_is_dated_in_utc_and_sorts():
|
||||
assert archive_name(AT) == "scribe-20261015T030000Z.tar"
|
||||
assert archive_name(AT) == "grimoire-20261015T030000Z.tar"
|
||||
local = datetime(2026, 10, 14, 23, 0, 0).astimezone()
|
||||
assert archive_name(local).endswith("Z.tar")
|
||||
|
||||
@@ -147,7 +147,7 @@ def test_is_archive_tells_a_tar_from_the_json_download():
|
||||
|
||||
def test_write_archive_lands_under_the_dated_name_only(tmp_path):
|
||||
path = write_archive(_payload(), tmp_path, AT, app_version="v")
|
||||
assert path == tmp_path / "scribe-20261015T030000Z.tar"
|
||||
assert path == tmp_path / "grimoire-20261015T030000Z.tar"
|
||||
assert [p.name for p in tmp_path.iterdir()] == [path.name]
|
||||
with open(path, "rb") as f:
|
||||
assert read_archive(f) == _payload()
|
||||
@@ -196,6 +196,25 @@ def test_a_newer_format_is_refused_by_name():
|
||||
read_archive(_rewrite(members))
|
||||
|
||||
|
||||
def test_an_archive_written_under_the_name_scribe_still_reads():
|
||||
"""Grimoire was called Scribe; its archives say so in the manifest."""
|
||||
members = _members(_payload())
|
||||
assert b"grimoire-backup-tar" in members["manifest.json"]
|
||||
members["manifest.json"] = members["manifest.json"].replace(
|
||||
b"grimoire-backup-tar", b"scribe-backup-tar",
|
||||
)
|
||||
assert read_archive(_rewrite(members)) == _payload()
|
||||
|
||||
|
||||
def test_another_tools_tar_is_refused():
|
||||
members = _members(_payload())
|
||||
members["manifest.json"] = members["manifest.json"].replace(
|
||||
b"grimoire-backup-tar", b"someone-elses-tar",
|
||||
)
|
||||
with pytest.raises(ArchiveError, match="not a Grimoire backup"):
|
||||
read_archive(_rewrite(members))
|
||||
|
||||
|
||||
def test_garbage_is_not_an_archive():
|
||||
with pytest.raises(ArchiveError):
|
||||
read_archive(io.BytesIO(b"not a tar at all" * 100))
|
||||
|
||||
Reference in New Issue
Block a user