Repository navigation
Import doors declare and count the names they make - #33
Merged
Merged
Conversation
A name an element gets that is not one string of the export taken as written is now declared and told, by kind and count, beside the elements and never in them. Two kinds of made name: joined (the export's words with the door's between them, a LegendKeeper map document's Map named "<resource>: <document>") and the door's own, for a thing the export gives no name (a frame's corner Marker "<frame>: corner 1", an arrow with no label "Board link"). Each door lists its kinds in MADE_NAMES, a tuple of MadeName (kind, type, pattern, source, regex; MadeName.fits(type, name) reads one), in a shared private module. Notion's is empty. Each ImportReport gains made_names, kind to count, and prints one line a kind with its count and pattern. A LegendKeeper card whose page is not in the project, already named "Untitled card (<shape id>)", is counted too. Tests: every real export the doors' tests read is converted and every name is either the export's text (the rule of the outside converter gate, ported) or fits exactly one declared kind of its type, with the report counting what the names show (LegendKeeper 80 of 280 and 78, Kanka 2 a file, the rest none); each declared kind is produced by a test's input and its count checked through a conftest fixture; a meta test fails when a declared kind has no such check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Each import door now declares the names it makes (
MADE_NAMES, a tuple ofMadeName: kind, type, pattern, joined or the door's own, and a regex a reader applies withfits) and its report counts them, one line a kind, beside the elements and never in them.On the real exports in the tests: LegendKeeper 80 of 280 elements (page-document 17, map-document 6, frame-corner 56, untitled-pin 1), 78 on the
.lk; Kanka 2 (hidden-details); World Anvil, Campfire and Notion none. A test holds every name on all eleven exports: either the export's text, or a fit of exactly one declared kind of its type, counted under it.Counted a second time apart from the tests: an outside name check over each door's real output gave the same counts, and every made name fit exactly one declared kind.
🤖 Generated with Claude Code