refactor(modules)!: de-UO core's copy, and enforce it (phase 3, slice 4) #140
Reference in New Issue
Block a user
No description provided.
Delete Branch "feature/module-de-uo-core"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Phase 3 slice 4 — the slice that makes acceptance criterion 1 a fact rather than a promise. Pairs with Module-uo#5 (merge that one first) and docs#139.
637 server (+17) and 157 client tests pass; manifest unchanged at 158 public + 2 internal; OpenAPI spec byte-identical.
1. The bindings were dead a whole slice before anyone noticed
client/src/api/client.jsstill carried 190 lines of UO namespaces —shard,atlas, both SSE URLs,admin.shard/shardOps/atlas/userShard, the uo-link and town-crier calls,player.shard— with zero core consumers since slice 3 deleted the views that called them. Nothing failed, nothing warned, the client build was happy: an API binding with no caller is inert. Only the check below would have found it.Five assertions went with them, to Module-uo#5 — core's
apiClient.test.jswas still testing UO URLs, so deleting the bindings would have deleted the coverage. The encoding test that usedgovernorHistoryis re-pointed at a core route rather than dropped: what it guards isreq's encoding, which is core's.2. The copy
About,Screenshots,Website's cards,Wiki,SiteFooter, the default hero,brand.js's tagline and description, the seeded wiki categories, and two user-visible NavEditor strings that named a module's admin screen by its proper name ("Shard Visibility").Statusis the interesting one — it reports site mode, has never had anything to do with a game server, and was called "Shard Status" purely by habit.Nothing live changes wording. An instance already has three places to say which game it is:
BRAND_*(and.env.uomysticmoon.examplesets both brand strings explicitly), the hero editor, and CMS pages.heroLayout.defaultLayoutis both the rendered default and the editor's starting point, which is the argument for keeping the words in code and making them neutral rather than inventing a config surface for prose.Wiki page slugs are deliberately untouched:
seedDefault*only inserts a row that is absent, so renamingmaps-atlasadds a ninth page to every install rather than renaming anything.3. The check —
scripts/checkModuleIdentifiers.jsnpm run check:modules, and the first step of the server-tests job, beforenpm ci— it is plain Node with no dependency of its own, so a boundary break is the first thing a reviewer sees rather than something found under a pile of unrelated failures.It reads code, not prose (MODULE_API.md §5.2): file names, import specifiers, route path literals, declared identifiers, property names. Core's English may still say "shard" where saying it is worth more than the word costs.
Four things it gets right only because getting them wrong was tried first:
defaultImage— which contains "ultIma" — and did so four times in this repo on its first run.uo+linkandtown+criermatch only as adjacent pairs; "link" alone is ordinary core vocabulary.checkImports.jslesson for the third time: a comment contains quotes, a string contains//. Masked rather than deleted, so offsets survive and line numbers stay honest.LEGACY_TABLE_PREFIXESandLEGACY_STREAM_IDS/LEGACY_LEGSare maps keyed by module id, and grandfathering cannot be written down without naming who is grandfathered. An exemption that stops matching fails the build.git ls-files, not a directory walk. An operator's gitignoredserver/db/data/spawnAtlas.art.jsonsits in the tree of anyone who has run the atlas import and would otherwise report a violation no commit could fix.server/test/checkModuleIdentifiers.test.js— 17 tests. A boundary check is written when the boundary is already clean, so it never fires again and nothing distinguishes "still checking" from "quietly broken". Every "must not catch" case in it is a false positive an earlier version really produced.Breaking change
Core no longer seeds
game_account_signuporuo_link_protocol_3_migrated; module-uo's fragment does (Module-uo#5, which also repairs the one-shot migration core's ordering had silently disabled). An install running core without module-uo keeps whatever rows it has and gains no new ones — nothing in core reads either key.Also removed: an orphan comment block in
schema.sqldescribing the spawn-atlas tables slice 1 took away.Verified
The pair run together — module built and copied into
modules/uo, core booted against a real MariaDB:check:modulesclean with the module installed (it skipsmodules/, as it must)./site/about,/site/status,/sitecards, the footer, the module's nine nav rows and its/uo/shardpage — zero console errors, zero CSP reports. The only console line is the module's ownregistered against core API 1.3.0.Deferred, deliberately
README.md's 48 UO mentions, including a whole## Shard integration (uo-link)section and the architecture diagram. §5.2 does not cover prose, and core's README is a rewrite that belongs with slice 5's phase-closing documentation pass rather than half-done inside a code slice.