Skip to content
HARD

validate_world_element

the keystone — canonical check, fuzzy match, gap log

🛡 the keystone. every narrator should call this before claiming.

returns {canonical: bool, suggested?: string, distance?: number}. non-canonical values get fuzzy-matched against the canonical set (Levenshtein, type-tuned threshold). unmatched-but-Mibera-relevant queries land in coverage-gaps for periodic curator review.

input

{
  "type": "archetype",
  "value": "Freetech",
  "consumer_hint": "ruggy-v06"
}
fieldtyperequirednotes
typeenumone of zone, archetype, factor, grail, mibera
valuestringthe value to validate
consumer_hintstringoptionalfor the coverage-gap log — which agent and version asked

canonical match

{ "canonical": true, "type": "archetype" }

close miss

{
  "canonical": false,
  "suggested": "Freetekno",
  "distance": 3,
  "type": "archetype"
}

no match found

{ "canonical": false, "type": "archetype" }

when canonical: false and no suggested, the value is far enough from anything canonical that there's no useful guess. defer to LLM-OWNED prose, or admit uncertainty.

the recommended flow

1. agent extracts a candidate world-element from user input or its own draft
2. validate_world_element(type, value)
3. if canonical → use directly
4. if suggested → call the typed lookup on the suggestion, then disclose the correction
5. if neither → fall back to LLM-OWNED prose or ask the user

fuzzy thresholds

typethresholdrationale
zone2short slugs, small typos common (bearcavebear-cave)
archetype4longer canonical names; more drift allowed
factor3namespaced IDs; some structured drift
grail5long display names
miberan/anumeric ID; matches or doesn't

coverage-gap log

every canonical: false with a non-trivial consumer_hint appends to grimoires/codex-mcp/coverage-gaps.jsonl (gitignored, local). Gumi reviews periodically and decides: enrich, retire, or document why it's intentionally not canonical. see coverage-gaps.