The map compiler: dex-map writes state/map.json - #126
Merged
Conversation
One mechanical compile inverts what is already on disk — taxonomy, entity-members, corpus and wiki — into the cached artifact the query surface will read: every topic (uncategorized-shares excluded — a ledger, not a topic) with description, sorted members, count, has-page and the newest member's share date; every entity with kind, aliases and members; and a typed edge list with implicit nodes — directed wikilink edges kept only between taxonomy names, and weighted shared-items intersections for topic-topic and entity-topic pairs, each stored once, smaller name first. The bytes are deterministic — sorted names, sorted ids, fixed edge order — so a freshness check can diff a recompile against the file. A missing taxonomy or entity-members file compiles an honestly empty map; a malformed one refuses loudly with nothing written; a corpus or wiki file that will not read contributes nothing, as in serve — lint is what reports broken files. The [[wikilink]] extraction lifts out of serve/library.py into wikitext.py, THE one extraction both readers share; serve behavior is unchanged. Instance gains map_path, KNOWN_VERBS gains map, and the entry point, shim usage line and README command table move together per the standing rule. Co-Authored-By: Claude Fable 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.
PR1 of the instance-map stack (design: #125). The mechanical compile:
dex-mapreads taxonomy, entity-members, corpus and wiki and writesstate/map.json— every topic and entity with members, counts, has-page and newest date, plus the typed relation graph (directed wikilink edges, weighted shared-member edges). Deterministic to the byte, atomic write, loud refusal on malformed judgment files, honestly-empty map for young instances. Wikilink extraction lifted towikitext.py, shared with serve unchanged.63 tests; mutation audit run on both new modules (survivors read — all equivalent).
🤖 Generated with Claude Code