Skip to content

Commit 14dfd64

Browse files
tmoostingclaude
andcommitted
The words check reads test code too
Published text names no one inside the team, and the tests ship in the public repository. About fifty names and attributions in test comments and test data were reworded (a ruling keeps its date); a recorded LegendKeeper element's name, which the tests look up, is one constant on one allowed line. scripts/public_words.py now scans tests/, leaving out tests/fixtures/ (world data and recorded exports, where a name can match a team word). Watched failing on a name planted in a test file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent b317b5d commit 14dfd64

18 files changed

Lines changed: 66 additions & 61 deletions

‎scripts/public_words.py‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
python scripts/public_words.py --commits A..B scan the messages of the commits B adds to A
1313
Exit 1 and one line per finding; exit 0 when the tree is clean.
1414
15-
Not scanned: CHANGELOG.md (the dated record, kept as written), tests/ and their fixtures,
16-
and codegen/schema-dist/ and codegen/tools/ (vendored and hash-verified).
15+
Not scanned: CHANGELOG.md (the dated record, kept as written), tests/fixtures/ (world data
16+
and recorded exports, where a name can match a team word), and codegen/schema-dist/ and
17+
codegen/tools/ (vendored and hash-verified).
1718
"""
1819

1920
from __future__ import annotations
@@ -35,8 +36,9 @@
3536
"AGENTS.md",
3637
"SECURITY.md",
3738
"pyproject.toml",
39+
"tests",
3840
]
39-
VENDORED = ("codegen/schema-dist/", "codegen/tools/")
41+
VENDORED = ("codegen/schema-dist/", "codegen/tools/", "tests/fixtures/")
4042

4143
# Each row: a pattern, and what a writer puts instead.
4244
PATTERNS: list[tuple[re.Pattern[str], str]] = [
@@ -93,6 +95,7 @@
9395
# Lines allowed by their exact text (trimmed; the first 16 hex of its sha256), never by file.
9496
EXEMPT_LINES = {
9597
"012d30a55f7b2ad2", # README: the one line that says who maintains the repository
98+
"dede553184687120", # tests: an element's name in a recorded LegendKeeper project
9699
}
97100

98101

‎tests/test_calendar.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ def test_the_defensive_read() -> None:
487487
{"version": 1, "grain": "day", "eras": [{"name": "X"}]},
488488
):
489489
assert read_calendar_config(value) is None, value
490-
# The profile's grain is required and a string; an empty string is no grain (Quillon's Unreal port).
490+
# The profile's grain is required and a string; an empty string is no grain (the Unreal port).
491491
for bad in ("", 1, None, ["day"]):
492492
assert read_calendar_config({"version": 1, "grain": bad}) is None, bad
493493
assert read_calendar_config({"version": 2, "grain": bad}) is None, bad

‎tests/test_campfire.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""The Campfire door (onlyworlds.campfire) on a real Campfire export.
22
33
``fixtures/campfire/campfire-export.html`` is the file Campfire's web app gave on 2026-10-23
4-
(File, Export Elements, html, Select all Elements) for a project Seethe made on a free account
5-
(Boss read it: no script, form, image or tracker, no mail, key, token or handle, one Google Fonts import).
4+
(File, Export Elements, html, Select all Elements) for a project made on a free account
5+
(read for secrets: no script, form, image or tracker, no mail, key, token or handle, one Google Fonts import).
66
Its bytes are kept. Two elements: Ada Okafor (a Character: a description, Full Name, Place of
77
Residence "The quay", a Bio naming Mara Voss) and The Ferry Quay (a Location: a description).
88
The file names no module, has no ids, no links and no hidden marks; what it does not show runs
@@ -155,7 +155,7 @@ def test_namespace_producer_and_tables_are_pinned() -> None:
155155

156156

157157
def test_the_module_table_is_as_ruled() -> None:
158-
"""Skeld's ruling: the whole table; every other module an Article Narrative."""
158+
"""Ruled: the whole table; every other module an Article Narrative."""
159159
assert MODULE_TYPES == {
160160
"characters": "character",
161161
"locations": "location",
@@ -276,7 +276,7 @@ def test_nothing_is_hidden_and_the_report_says_the_files_limits(tmp_path: Path)
276276

277277

278278
def test_the_report_names_each_elements_module_evidence(tmp_path: Path) -> None:
279-
"""Per element: which panel words matched which module (Skeld's ruling)."""
279+
"""Per element: which panel words matched which module (as ruled)."""
280280
_, report = run(tmp_path)
281281
ev = {e.element: e for e in report.evidence}
282282
assert [e.element for e in report.evidence] == ["Ada Okafor", "The Ferry Quay"]
@@ -379,7 +379,7 @@ def test_an_element_of_no_known_module_is_an_article(tmp_path: Path) -> None:
379379

380380

381381
def test_a_magic_module_is_a_construct(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
382-
"""Skeld's ruling: a magic system is how the world works, so a Construct (believed)."""
382+
"""Ruled: a magic system is how the world works, so a Construct (believed)."""
383383
monkeypatch.setitem(campfire.TEMPLATE_MODULES, "magic", frozenset({("rules", "source")}))
384384
rules = element("Tidecalling", ("Rules", [("Source", "The river")]))
385385
out, report = run(tmp_path, with_elements(tmp_path, rules))
@@ -475,7 +475,7 @@ def test_a_panel_kind_not_yet_seen_is_read_as_text(tmp_path: Path) -> None:
475475
assert "'Ada Okafor' / 'Allies': a panel-list panel, not yet seen in a real export; read as text" in report.notes
476476

477477

478-
# --- the project name (--project; Skeld's ruling) ---------------
478+
# --- the project name (--project; as ruled) ---------------
479479

480480

481481
def world_of(out: Path) -> dict[str, Any]:

‎tests/test_client.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ def test_patch_world_drops_the_read_only_keys_keel_refuses(make_client: MakeClie
860860
"owner_character": None,
861861
# served on every GET /world, an unknown key to PATCH (written as source and producer)
862862
"origin": {"source": {"server": "https://www.onlyworlds.com", "world": "w0", "at": "a"}, "producer": None},
863-
# a keyless read's counts, an unknown key to PATCH (Quillon)
863+
# a keyless read's counts, an unknown key to PATCH
864864
"counts": {"total": 1, "types": {"character": 1}},
865865
}
866866
make_client(t).patch_world(body)

‎tests/test_doctor.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656

5757
def clean() -> Elements:
58-
"""A world no flag finds anything in. The Law and the Narrative are Seethe's case: an empty
58+
"""A world no flag finds anything in. The Law and the Narrative are a real case: an empty
5959
description, their text in ``declaration`` and ``story``."""
6060
return {
6161
"location": [{"id": L1, "name": "Harbor", "description": "A port."}],
@@ -178,7 +178,7 @@ def test_3_an_event_ending_before_it_starts(tmp_path: Path) -> None:
178178

179179

180180
def test_3_says_how_little_it_compared(tmp_path: Path) -> None:
181-
# Seethe's hand run on the Manifest: 0 of 28 Events carried both dates; a clean count alone reads as a pass
181+
# A hand run on a real world: 0 of 28 Events carried both dates; a clean count alone reads as a pass
182182
r = folder_report(tmp_path, edit(clean(), "event", E1, end_date=None))
183183
assert found(r, "3") == []
184184
assert r.compared["3"] == {"n": 0, "of": 1}
@@ -235,7 +235,7 @@ def test_4_never_calls_a_stub_linkless(tmp_path: Path) -> None:
235235

236236

237237
def test_fold_name() -> None:
238-
assert fold_name("Kael, Inspector") == fold_name("kael inspector") == "kael inspector"
238+
assert fold_name("Ada, Inspector") == fold_name("ada inspector") == "ada inspector"
239239
assert fold_name("\uff21\uff4e\uff4e") == "ann" # NFKC: full-width letters
240240
assert fold_name("STRASSE") == fold_name("straße") # casefold, not lower
241241
assert fold_name(" ... ") == ""
@@ -1552,7 +1552,7 @@ def spine() -> Elements:
15521552
"location": [{"id": REPO_L, "name": "sdk repo", "supertype": "Repo", "x_spine_status": "live"}],
15531553
"construct": [{"id": STD, "name": "the schema", "supertype": "Standard"}],
15541554
"law": [{"id": CHARTER, "name": "Spine Charter", "supertype": "Charter", "declaration": "One owner a row."}],
1555-
"character": [{"id": KAEL, "name": "Kael", "supertype": "Mind"}],
1555+
"character": [{"id": KAEL, "name": "Ada", "supertype": "Mind"}],
15561556
"species": [{"id": SPECIES, "name": "Mind", "supertype": "Not on any list"}],
15571557
}
15581558

@@ -1841,7 +1841,7 @@ def test_13_two_rows_of_one_type_share_a_name_once_trimmed_and_folded(tmp_path:
18411841
def test_13_name_uniqueness_is_the_rows_not_every_element(tmp_path: Path) -> None:
18421842
"""Serial 60: "a row's name unique within its row type once folded (the four row types; a Seat or any
18431843
other element is outside the rule)". Flag 5 still names two Characters, or two Seats, that share a name."""
1844-
base = with_(spine(), "character", {"id": C1, "name": "kael ", "supertype": "Mind"})
1844+
base = with_(spine(), "character", {"id": C1, "name": "ada ", "supertype": "Mind"})
18451845
r = folder_report(tmp_path, base)
18461846
assert spine_found(r) == [] and len(found(r, "5")) == 1
18471847
seat_name = spine()["title"][0]["name"]

‎tests/test_fixture_identifiers.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""No account identifier of a real export in any fixture or test file, checked by hash.
22
3-
The fixtures are real exports scrubbed by Boss's script (Skeld's
4-
doctrine: a fixture carries no account identifier). The identifiers themselves stay
3+
The fixtures are real exports scrubbed by a script (the
4+
rule: a fixture carries no account identifier). The identifiers themselves stay
55
out of the package: only their sha256 hex digests are here, and every word-start window of each
66
file's text, lowercased, of each identifier's length is hashed and compared (so an identifier is
77
found inside a longer word too, such as a file name). A zip is read member by member, names and

‎tests/test_kanka.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""The Kanka door (onlyworlds.kanka) on a real Kanka JSON export.
22
33
``fixtures/kanka/quay-export-world_20261023_074706.zip`` is the file Kanka 3.15 gave on 2026-10-23
4-
for a campaign Seethe made on a free account and typed in Kanka's own editor (Boss read it for keys,
5-
tokens, mail and sessions and found none), its account identifiers scrubbed by Boss's script:
4+
for a campaign made on a free account and typed in Kanka's own editor (read for keys,
5+
tokens, mail and sessions, none found), its account identifiers scrubbed by script:
66
the username, the user id and the campaign id each a placeholder
77
of the same length, so the campaign id that keys the ids is 910001; every other byte as exported.
8-
What she typed: two Characters (Ada Okafor, Ferry clerk; Mara Voss, Route planner), two Locations
8+
What was typed: two Characters (Ada Okafor, Ferry clerk; Mara Voss, Route planner), two Locations
99
(The quay; The ferry crossing, under The quay), one Organisation (The Ferry Guild), one Note (The
1010
ledger of the first crossing), a two-way "friend" relationship Ada to Mara, and a post on Ada; the
1111
relationship and the post were made twice by a script rerun. Kanka seeded four starter entries in
@@ -425,7 +425,7 @@ def test_deterministic(tmp_path: Path) -> None:
425425

426426

427427
def test_ids_do_not_move_with_the_supertype(tmp_path: Path) -> None:
428-
"""No tool name in a supertype (Skeld's ruling): the real export's ids are those
428+
"""No tool name in a supertype (as ruled): the real export's ids are those
429429
0.41.0 gave (the sha256 of the sorted ids, one a line; 0.41.0 run on the scrubbed file, whose
430430
campaign id moved the ids from those it gave on the unscrubbed one)."""
431431
out, _ = run(tmp_path)

‎tests/test_legendkeeper.py‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
"""The LegendKeeper door (onlyworlds.legendkeeper) on Boss's recorded wire answers.
1+
"""The LegendKeeper door (onlyworlds.legendkeeper) on recorded wire answers.
22
33
The three files in ``fixtures/legendkeeper/`` are real answers of the LegendKeeper API v3, read
4-
live on 2026-10-22 on Titus's project (made-up content, no key, no email; Boss's findings). They
4+
live on 2026-10-22 on Titus's project (made-up content, no key, no email). They
55
are specimens, not a whole walk, so ``answers()`` composes the walk the door makes from them and says what it fills in:
66
77
- the project answer (``getProject``) was not recorded: ``{"id": PID, "name": "Sikelia"}``, the
@@ -57,6 +57,8 @@
5757
ROOT = Path(__file__).resolve().parents[1]
5858
LINT = ROOT / "codegen" / "schema-dist" / "walk" / "lint_folder.py"
5959
FIX = Path(__file__).resolve().parent / "fixtures" / "legendkeeper"
60+
#: An element's name as the recorded project has it.
61+
WIRE_TEST = "Boss wire test (delete me)"
6062
PID = "sikelia0"
6163
P = f"/projects/{PID}"
6264
KEY = "lk_test_SECRET_never_written"
@@ -161,7 +163,7 @@ def test_the_tree_converts_to_the_element_set(tmp_path: Path) -> None:
161163
assert aldric["x_legendkeeper_aliases"] == ["Lord Veyra", "the Ash Lord"]
162164
assert aldric["x_legendkeeper_parent"] == eid(BOSS)
163165
assert "supertype" not in aldric
164-
for name in ("Sikelia", "Boss wire test (delete me)", "Order of the Ash", "Castle Veyra"):
166+
for name in ("Sikelia", WIRE_TEST, "Order of the Ash", "Castle Veyra"):
165167
assert els[name]["type"] == "narrative" and els[name]["supertype"] == "Article", name
166168
assert "x_legendkeeper_parent" not in els["Sikelia"]
167169
assert els["Order of the Ash"]["x_legendkeeper_tags"] == ["faction"]
@@ -195,7 +197,7 @@ def test_a_location_under_a_location_gets_its_parent_field(tmp_path: Path) -> No
195197
item["tags"] = ["Location"] # a type name, any case
196198
out, _ = run(tmp_path, ans, type_map=MAP)
197199
els = by_name(out)
198-
assert els["Boss wire test (delete me)"]["type"] == "location"
200+
assert els[WIRE_TEST]["type"] == "location"
199201
assert els["Castle Veyra"]["parent_location"] == eid(BOSS)
200202
assert els["Castle Veyra"]["x_legendkeeper_parent"] == eid(BOSS)
201203

@@ -341,7 +343,7 @@ def visible(out: Path) -> str:
341343

342344

343345
def test_a_secret_block_becomes_its_own_hidden_narrative(tmp_path: Path) -> None:
344-
"""Skeld's rule: what the source hides, we hide, never drop and never publish."""
346+
"""The rule: what the source hides, we hide, never drop and never publish."""
345347
out, report = run(tmp_path)
346348
els = by_name(out)
347349
secret = els["Aldric Veyra: Secret"]
@@ -462,7 +464,7 @@ def test_the_report_names_everything_not_placed(tmp_path: Path) -> None:
462464

463465

464466
def test_ids_do_not_move_with_the_supertype(tmp_path: Path) -> None:
465-
"""Untyped is supertype Article now (no tool name in a supertype, Skeld's ruling);
467+
"""Untyped is supertype Article now (no tool name in a supertype, as ruled);
466468
the ids are those 0.41.0 gave: the sha256 of the sorted ids, one a line. The Region map's Map,
467469
made since 0.53.0, the timeline's Narrative and its lane's, since 0.56.0, and the Gregorian
468470
calendar's Construct, since 0.57.0, are the ids added."""
@@ -671,7 +673,7 @@ def test_a_pushed_element_comes_back_with_its_own_id_and_conventions(tmp_path: P
671673
assert aldric["atlas_aliases"] == ["Al", "the Heir"] and aldric["x_house_motto"] == "Ever onward"
672674
assert not [k for k in aldric if "onlyworlds" in k]
673675
assert report.ow_unmapped == ["'Aldric Veyra': rivals: 1 link(s) outside the slice"]
674-
assert by_name(out)["Boss wire test (delete me)"]["supertype"] == "Ledger"
676+
assert by_name(out)[WIRE_TEST]["supertype"] == "Ledger"
675677
assert not [tag for tag in report.untyped_tags if tag.startswith("ow-")]
676678
assert any(n.startswith("1 element take their id from their 'onlyworlds-id' row") for n in report.notes)
677679
# every link to Aldric uses that id
@@ -692,7 +694,7 @@ def test_an_onlyworlds_id_that_is_not_a_uuid_or_is_claimed_twice_is_not_the_id(t
692694
assert els["Aldric Veyra"]["id"] == OW_ALDRIC
693695
assert els["Castle Veyra"]["id"] == eid(CASTLE)
694696
assert els["Castle Veyra"]["x_legendkeeper_onlyworlds-id"] == OW_ALDRIC # kept, never dropped
695-
boss = els["Boss wire test (delete me)"]
697+
boss = els[WIRE_TEST]
696698
assert boss["id"] == eid(BOSS) and boss["x_legendkeeper_onlyworlds-id"] == "not-a-uuid"
697699
assert any("is another resource's ('Aldric Veyra')" in n for n in report.notes)
698700

‎tests/test_legendkeeper_file.py‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
"""The LegendKeeper door's file source (onlyworlds.legendkeeper.FileSource) on a real export.
22
33
``fixtures/legendkeeper/the-quay-world.lk`` is the file LegendKeeper gave on 2026-10-23 (export
4-
version 1) for a project Seethe made on a 14-day Pro trial, nothing paid (Boss read it
5-
for secrets and found none). What she typed: six pages, Ada Okafor, Mara
4+
version 1) for a project made on a 14-day Pro trial, nothing paid (read
5+
for secrets, none found). What was typed: six pages, Ada Okafor, Mara
66
Voss, The quay, The ferry crossing, The Ferry Guild and The ledger of the first crossing, with no
7-
tags, properties or links; she renamed the project home "The quay world", and left three
7+
tags, properties or links; the project home renamed "The quay world", and three
88
"Untitled" pages (two empty strays, one made from the Character template). The rest is the
99
tutorial and templates LegendKeeper seeds a new project with: 3 hidden tabs, 13 Secret blocks,
10-
maps, a board and a timeline. Nothing in the project is a hidden page. Banked as Boss's scrubbed
10+
maps, a board and a timeline. Nothing in the project is a hidden page. Banked as a scrubbed
1111
copy: the account's ``createdBy`` id a placeholder of the same
1212
length, every other byte as exported; the door's folder from it is the unscrubbed file's.
1313
14-
The JSON type of the same export (a minute later; Boss found it equal but for ``exportId``,
14+
The JSON type of the same export (a minute later; found equal but for ``exportId``,
1515
``exportedAt`` and ``hash``, pretty-printed) is not banked, at 576 KB: ``json_twin`` makes it from
1616
the ``.lk`` the same way. The real twin was checked to give a byte-identical folder when this
1717
door was built.
@@ -22,8 +22,8 @@
2222
quay, and one near the map's right edge with no name and no uri (the name she typed was not kept).
2323
Five map documents in three cases: her map (an image address and bounds), the tutorial's Realm of
2424
Tutoria (a bare asset id, bounds, 16 pins with no name of their own) and three templates' maps
25-
with no ``map`` object at all. Banked as Boss's scrubbed copy: the account's
26-
``createdBy`` id and her map image's asset id each a placeholder of the same length; LegendKeeper's
25+
with no ``map`` object at all. Banked as a scrubbed copy: the account's
26+
``createdBy`` id and the map image's asset id each a placeholder of the same length; LegendKeeper's
2727
tutorial asset ids and its authors' ids as exported, and every other byte.
2828
"""
2929

@@ -389,7 +389,7 @@ def element_digests(out: Path) -> tuple[str, str]:
389389

390390

391391
def test_the_first_export_gives_its_old_folder_but_for_the_supertype(tmp_path: Path) -> None:
392-
"""No tool name in a supertype (Skeld's lane rule): untyped is Article now,
392+
"""No tool name in a supertype (as ruled): untyped is Article now,
393393
and nothing else of the first export's folder moved, its ids least of all; its maps are added."""
394394
out, report = run(tmp_path)
395395
assert element_digests(out) == (OLD_FOLDER, OLD_IDS)
@@ -429,9 +429,9 @@ def test_the_first_export_gives_its_old_folder_but_for_the_supertype(tmp_path: P
429429
ASSET = re.compile(
430430
r"https://(?:dev-)?assets\.legendkeeper\.com/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"
431431
)
432-
#: Boss's same-length placeholder for her map image's asset id
432+
#: The same-length placeholder for the map image's asset id
433433
MAP_ASSET = "00000000-0000-4000-8000-000000000001"
434-
#: her map image's real asset id and the account's id, by hash (sha256), so neither is in the package
434+
#: the map image's real asset id and the account's id, by hash (sha256), so neither is in the package
435435
MAP_ASSET_SHA256 = "d04851f3065f8a3cc2d7624db15d65a8ca528f0d1978dd5f2af89c3cb21e27fe"
436436
ACCOUNT_SHA256 = "fceeab8b4d7652711e65241ff1c880b3bbb28fb71e63ca5815b278d7acc74156"
437437
CREATED_BY = re.compile(r'"createdBy": ?"([^"]*)"')

‎tests/test_notion.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
The built tree is what the module's docstring believes (the 32-hex suffix, ``_all.csv``, a
55
database's rows in a folder named like its CSV, sub-pages in a folder named like their page,
66
relation cells as ``Title (path)``). The real ones, in ``fixtures/notion/``, are a free account's
7-
page export with sub-pages, Markdown & CSV (Boss, 2026-10-24; invented content, no personal data):
7+
page export with sub-pages, Markdown & CSV (2026-10-24; invented content, no personal data):
88
``notion-page-export-with-subpages.zip`` with "Create folders for subpages" off, flat, every page
99
and CSV in one directory; ``notion-page-export-folders-locations.zip`` with it on, the same
1010
workspace with Places renamed Locations and Home renamed Location, its folders named by title alone.
@@ -181,7 +181,7 @@ def test_untyped_rows_are_narratives(imported: tuple[Path, ImportReport]) -> Non
181181

182182

183183
def test_ids_do_not_move_with_the_supertype(imported: tuple[Path, ImportReport]) -> None:
184-
"""No tool name in a supertype (Skeld's ruling): the fixture's ids are those 0.41.0
184+
"""No tool name in a supertype (as ruled): the fixture's ids are those 0.41.0
185185
gave (the sha256 of the sorted ids, one a line), on the fixture built here."""
186186
out, _ = imported
187187
ids = sorted(bodies(out))

0 commit comments

Comments
 (0)