feat(content): promote Duncarrow; build client/server artifacts
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HuHRPE7VfppUJEaoGBEUqZ
This commit is contained in:
37
tools/content_build/tests/test_duncarrow.py
Normal file
37
tools/content_build/tests/test_duncarrow.py
Normal file
@@ -0,0 +1,37 @@
|
||||
"""End-to-end: the real promoted Duncarrow bible builds green and routes the
|
||||
Crell secret correctly (body server-only; the id ships in the gate skeleton)."""
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
from content_build.__main__ import _load_world, check
|
||||
from content_build.emit import build_trees
|
||||
|
||||
REPO = Path(__file__).resolve().parents[3]
|
||||
LORE = REPO / "content" / "lore"
|
||||
WORLD = REPO / "content" / "world"
|
||||
SERVER = REPO / "content" / "server"
|
||||
|
||||
|
||||
def test_duncarrow_builds_and_check_is_clean():
|
||||
assert check(LORE, WORLD, SERVER) == 0
|
||||
|
||||
|
||||
def test_secret_body_is_server_only():
|
||||
client, server = build_trees(_load_world(LORE))
|
||||
assert "topics/crell-runs-slave-trade.json" in server
|
||||
# the secret's descriptive id ships in the gate skeleton (schema property)...
|
||||
npc = client["npcs/mayor-oswin-crell.json"]
|
||||
assert any(k["fact_id"] == "secret.crell-runs-slave-trade"
|
||||
and k["gate"] == "never" for k in npc["knows"])
|
||||
# ...but its BODY never reaches any client artifact
|
||||
blob = json.dumps(client)
|
||||
assert "elf-slaving" not in blob and "sells them into slavery" not in blob
|
||||
|
||||
|
||||
def test_mera_never_holds_the_secret():
|
||||
client, _ = build_trees(_load_world(LORE))
|
||||
fenn = client["npcs/mera-fenn.json"]
|
||||
facts = {k["fact_id"] for k in fenn["knows"]}
|
||||
assert "secret.crell-runs-slave-trade" not in facts
|
||||
assert "fact.crells-guard-acts-alone" in facts
|
||||
Reference in New Issue
Block a user