/entity/convergence-synthesis-neuroinflammation-core (and ~most wiki_page cards on
/artifacts?artifact_type=wiki_page) return HTTP 404. The wiki pages themselves
are intact in wiki_pages and render correctly at /wiki/<slug> and
/artifact/wiki-<slug> — only the URL emitters are wrong.
Two emitters strip the wiki- prefix from a wiki_page artifact id and route
the resulting slug to /entity/<slug>. The /entity/{name} handler resolves
names against wiki_entities / knowledge_edges / hypotheses, so composite
slugs like convergence-synthesis-, gaps-, mechanisms-, ai-tool-
never match and 404. The existing slug-fallback only catches <type>-<symbol>
shapes whose suffix-after-first-dash matches a wiki_entities.entity_name.
This affects the artifacts gallery and any callsite of _infer_local_url
(exports, atproto/ap publishes, RSS, share links).
Three edits in api.py:
/wiki/<slug> instead of /entity/<slug> for wiki_page artifacts._infer_local_url: same change; this propagates the canonical URL outward to all consumers./entity/{name} defence-in-depth: when no wiki_entities/KG/hypothesis match exists but wiki_pages.slug = entity_name, 301-redirect to /wiki/<slug>. Catches external bookmarks and any emitter we haven't found.Plus _clear_all_caches() post-deploy (page cache holds entity: and artifacts: keys).
/entity/convergence-synthesis-neuroinflammation-core → 301 → /wiki/convergence-synthesis-neuroinflammation-core (HTTP 200)/entity/gaps-research-priorities → 301 → /wiki/.../entity/mechanisms-er-mitochondria-contact-sites → 301 → /wiki/.../entity/<slug> → none return 404/entity/APOE, /entity/MAPT, /entity/TREM2 → still 200 (primary handler unchanged)/entity/genes-foxp3 → still 301 → /entity/FOXP3 (existing <type>-<symbol> fallback runs first)/artifacts?artifact_type=wiki_page — every card href targets /wiki/<slug>Duplicate consolidation: 17,470 paired wiki-<slug> + <slug> artifact rows.
Tracked separately — needs its own audit + LLM-assisted merge plan to avoid
content loss in differing-title and non-default-metadata cases.