World's first open-source enterprise world model.
0010 · An unnamed relation stays empty
- Status: Implemented
- Written: 2026-08-30 (undated in the original; the day its migration ran) · condensed into English 2026-09-03
- Related: 0009 the twin on the type side;
0001 holds the sentence this record overturns;
0011 takes
mapped_tothe rest of the way
The problem
related_to encoded "the extractor found an edge but the ontology has no matching relation"
— a program state. Yet it sat in relation_types as a builtin relation, listed on the
ontology page beside acquired and works_at, as though someone had decided the relation
between the two things is called "related". Nobody had.
The cost was measured before deleting it: in one 348-chunk KB, 533 facts hung on it and
every one displayed as 有关联, while every one also carried the source's wording in
fact_evidence.proposed_predicate. The meaning was in the database all along, covered by a
fake vocabulary word.
Decisions
facts.predicate_idbecomes nullable andrelated_tois deleted. The reader sees more: on a real corpus (14,706 facts, 5,934 onrelated_to), 93 graph edges that all read "related" now readplaced_pressure_on/agreed_to_resign/countersued/revived_legal_action/license_from.- Display falls back to the source's wording through one SQL function,
fact_surface_predicate(uuid). The most frequent wording wins, ties by lexical order — the rulepredicate_match::merge_keyuses, and deterministic, so one edge has one name on the graph, in the panel and in the history. Only 3.0% of facts (16 of 533) had more than one wording. One function rather than a subquery in each of the eight read paths: eight copies diverge, and divergence here means different names on different pages. - The reader must see where a word comes from, or the lie is retold another way. Rows
carry
inferred: edges outside the ontology are drawn in a lighter gray; the panel and document output say on hover "not in the ontology; this is the source's wording"; facts with neither show an italic "unnamed relation" — never a made-up word. - Data changed in place, no migration path. The database held test data before release. Once users have run for half a year, 0001's "only new extractions; rebuild the backlog" applies again.
mapped_tofollows. Onlyrelated_towas excluded from the prompt, so the model usedmapped_to(entity → data-source schema) on entity↔entity pairs 41 times. It leaves the prompt, thenrelation_typesaltogether (0011): the same error, control flow written as vocabulary. TheFALLBACK_RELATION_*constant and branches, theextraction_dropsreason "no fallback relation", and the "fallback predicate" wording went with it.
Dead ends
- 0001's sentence "
related_tois honest vagueness; a wrong guess is confident error." The second half stands, the first is wrong. Staying at "I don't know" is more honest than guessing — but implementing that honesty as a word in the ontology turned it into an assertion: a relation displayed as "related" claims such a relation exists. The honest expression is empty, next to "the source saidacquired". 0001's aside "(kept in the ontology as the code-level fallback)" is void: the fallback now happens at read time. - Twenty inner joins the compiler cannot see. Once the column is nullable, every
JOIN relation_typeson a read path is a silent filter;cargo checkand clippy say nothing — the same three-valued trap as 0009'sNULL <> uuid. Eleven becameLEFT JOINplus fallback; six were already right (four filter byr.key, two readfunctional/temporal). Three misses were caught by the database and none by the compiler (anr.labelwithout COALESCE, anf.idreferenced outside its CTE, a stalert.id), plus two mis-numbered placeholders — the eighth time "SQL is invisible to the compiler" in this repository, so DB tests are not optional when SQL strings change. The most expensive miss:fact_snapshotthrough an inner join returnedNone, so rejecting a predicate-less fact would have left no ledger entry — and the ledger exists so the record survives the fact. - 420 legacy exceptions. Of 5,934 fallback facts, 420 have no source wording, all from
the two oldest KBs (
Industry Corpus275,General145), beforeadd_evidencerecordedproposed_predicateunconditionally. They now display empty; they used to display "related" — zero information either way. - End-to-end on the full clone: 5,934 facts go NULL and 5,514 recover their wording;
graph 457 edges — 364 ontology, 93 wording, 0 unnamed; rejecting a predicate-less fact
leaves a self-contained snapshot in the decision ledger.
no_predicate_still_shows.rsguards the line: a fact with no predicate must be visible on every read path, and turning anyLEFT JOIN relation_typesback intoJOINmakes it red (both controls verified).
Revisions
- 2026-08-30: we deleted the data, not the code, and it grew back in seven minutes.
Migration 0052 deleted the
relation_typesrow; the seed was code (DEFAULT_RELATION_TYPES), andensure_default_ontologyran at KB creation, on the ontology page and at every extraction — 0052 applied at 17:54,bench demo-autoextendre-created abuiltin=truerow at 18:01. Worse, 0052 also dropped the prompt's exclusion filter on the premise "no row now, so the escape hatch and the reminder disappear together"; the premise was false, sorelated_towas listed in the prompt for the first time — and 0001 had measured that of 359 uses, 321 were the model picking from the list. The two must change together; changing one is worse than neither. (#128 removed the function and the seed table; regrowth is now impossible.) - 2026-08-30: the guard assertion was empty.
SELECT count(*) FROM relation_types WHERE key = 'related_to' AND builtinpassed because the fixture built the KB with raw SQL and never calledensure_default_ontology— asserting on bare ground. The test now seeds first, and the control was verified (addingrelated_toback to the seed table turns it red). - 2026-09-02: two pieces of dead code.
graph.rsconfirmed_mappings()had zero callers (chat readsmappings::confirmed), and ther.key = 'mapped_to'join inconfirm_factmatched zero rows. Both removed since (0016 A3).
Status history
The status line as it stood on 2026-09-27, before status lines were cut to one line:
Implemented ·
facts.predicate_idis nullable,related_tois gone, display falls back to the source's wording throughfact_surface_predicate(uuid), guarded byno_predicate_still_shows.rs· bothmapped_tofollow-ups done with 0011 (#126); the seed table andensure_default_ontologyleft with #128 · the two pieces of dead code noted 2026-09-02 are cleared