| 1 | # 0003 · The ontology grows out of the corpus |
| 2 | |
| 3 | - **Status**: Built and running (#44; switch `knowledge_bases.auto_extend_ontology`, default on). Its |
| 4 | starting point has moved: `related_to` is deleted ([0010](0010-no-relation-is-no-relation.md)) and |
| 5 | the seed ontology retired (#125, #128), so a new KB starts from an ontology pack |
| 6 | ([0008](0008-ontology-packs-as-cold-start.md)) and this loop fills the gaps a pack leaves. |
| 7 | "Dismissal has memory" redone per [0007](0007-who-decides-what-becomes-a-relation.md). Two of three |
| 8 | known gaps closed (`adopt_proposed_types` + `entity_retypes`; `ontology_proposals`, #112); the "new |
| 9 | phrasings since you last looked" reminder still pending. Checked against the code 2026-09-02. |
| 10 | - **Written**: 2026-08-28 · condensed into English 2026-09-03 |
| 11 | - **Related**: [0001](0001-ontology-import-and-governance.md) P3b and P4 are the plan, this is what |
| 12 | grew; [0007](0007-who-decides-what-becomes-a-relation.md); [0008](0008-ontology-packs-as-cold-start.md); |
| 13 | [0010](0010-no-relation-is-no-relation.md); [0012](0012-the-ontology-is-a-contract-not-a-suggestion.md) |
| 14 | |
| 15 | ## The problem |
| 16 | |
| 17 | The extractor reads "《星球大战:零号连队》可在 GeForce NOW 上玩", the ontology has no "playable on", and |
| 18 | the fact lands as `related_to`, which says nothing. On real corpora 40.5% of edges were like that, and |
| 19 | every new KB began with ten seed relations nobody had chosen. The extraction side (0001 P3b) removed |
| 20 | the escape hatch and kept the original phrasing on `fact_evidence.proposed_predicate`. This record is |
| 21 | the other half: turning kept phrasings back into relations, with a person somewhere in the loop. |
| 22 | |
| 23 | That world is gone: an unmapped fact now has a null predicate and shows its phrasing through |
| 24 | `fact_surface_predicate()`, and a new KB has no relations until a pack is installed. 0012 measured |
| 25 | 25.6% null predicates on ai-timeline-ends × schema.org, all 41 relations from the pack and none grown |
| 26 | by this loop. The loop itself is unchanged and still on by default. |
| 27 | |
| 28 | ## Decisions |
| 29 | |
| 30 | 1. **Adoption rewrites the facts waiting for it.** Add used to create the relation type and leave the |
| 31 | facts saying "related to". Now it also rewrites every fact whose phrasings all fall inside the |
| 32 | adopted set (a fact with several phrasings across chunks is left alone; under 1% of cases), and |
| 33 | the proposal says "will reclassify N" with the phrasings merged. The rewrite is an append (new row |
| 34 | with `supersedes`, old row invalidated), the same path as human correction, so entity history |
| 35 | reads "recorded as related to, refined to available on, by whom". `predicate_match` runs first: an |
| 36 | equivalent relation already in the ontology (including `_by` inverses) absorbs the group with |
| 37 | subject and object swapped (#109). The canonical key is the group's most frequent real phrasing. |
| 38 | 2. **Undo is per batch.** `fact_adoptions` records batch, predicate, old fact, new fact, and whether |
| 39 | the new row superseded or merged into an existing assertion. Undo invalidates the new rows and |
| 40 | revives the old; the relation type stays (facts pointed at it, and both the adoption and the undo |
| 41 | happened). Light confirmation, no typed unlock. |
| 42 | 3. **Three tiers**: Add one (a person, picking), Add all (a person, one decision), automatic (the |
| 43 | switch). |
| 44 | 4. **The switch governs adoption, never attention.** Off, unmatched phrasings still accumulate in the |
| 45 | Unmatched panel as proposals, and the copy must say so, since "stop extending" reads as "stop |
| 46 | noticing". Default-on is justified because every automatic action is visible and reversible: the |
| 47 | Ontology page banner (`last_auto_extension`) shows what was added, how many facts changed, and |
| 48 | undo. The audit ledger is for later verification, never a notification. |
| 49 | 5. **No axiom is set automatically**, `functional` first and now all of them (`Axioms::default()` on |
| 50 | the cold-start path). Criterion: a reversible action may be automatic; one that triggers cascading |
| 51 | writes may not. `functional` drives auto-closing and conflicts, and undoing that means unpicking |
| 52 | supersede chains; `part_of` mislabelled once produced 59 false conflicts from 28 press releases. |
| 53 | 6. **Dismissal remembers an attitude, and counts go on.** `ontology_misses.dismissed_at`; |
| 54 | `record_miss` keeps counting; suppression happens on read, with dismissed entries listed |
| 55 | separately with current counts, revocable (0007). |
| 56 | 7. **Automatic adoption needs a phrasing in at least two documents**, `MIN_SIGNALS = 3` counted over |
| 57 | predicate and type signals together (counting predicates alone skipped a corpus that lacked only |
| 58 | entity types). The reason is quality: the ontology feeds back into the extraction prompt, so one |
| 59 | document's accidental wording would become a standing instruction. |
| 60 | |
| 61 | ## Dead ends |
| 62 | |
| 63 | - **Opposing automation.** Synonym explosion (four "available" phrasings, four relations), generic |
| 64 | verbs (`is`, `has`), frequency taken for meaning, a guessed `functional`. The arguments stand; the |
| 65 | hidden premise "being wrong is expensive" does not, because adoption supersedes and destroys |
| 66 | nothing. The axis is the cost of an error. What gets automated is approval; synonyms and verbs |
| 67 | call for clustering, and merging stays human. |
| 68 | - **"Has the ontology been touched" as the trigger.** Inferring intent from behavior fails both |
| 69 | ways: one click on Add stops the loop, and once false it never turns true again, freezing the |
| 70 | vocabulary on the first batch while RSS keeps delivering. The declared switch (a user's |
| 71 | suggestion) removed a bad mechanism. |
| 72 | - **`dismiss` as `DELETE FROM ontology_misses`.** The next extraction re-inserted it. The first fix, |
| 73 | "stop counting after dismissal", was a one-way door: a judgment made at count 1 applied to twenty |
| 74 | later documents, count frozen, invisible. |
| 75 | - **A merge branch that made history lie.** When the target assertion already existed, the old row |
| 76 | was invalidated with no successor and entity history rendered "retracted" for a fact merged intact. |
| 77 | `fact_adoptions` exists because of this. |
| 78 | - **Triggering when no other document is in flight.** True at once for a batch of one, so a single |
| 79 | document could set the whole ontology; the two-document threshold fixes it. |
| 80 | - **Automatic merging of phrasings.** A suggestion folded `optimized_for` into `runs_on` ("optimized |
| 81 | for RTX" is not "runs on RTX"); the merged phrasings were visible in the tooltip and a person |
| 82 | caught it. This is the direct evidence for keeping merges human. |
| 83 | |
| 84 | ## Revisions |
| 85 | |
| 86 | - 2026-08-30 (#112): proposals persist in `ontology_proposals`; what used to be lost was the |
| 87 | clustering, the only thing that lets a person check a merge, never the raw misses. |
| 88 | - 2026-09-02: the measured rows (49 rewrites for `available_on`, 24 undone for `supports`, a cold |
| 89 | start growing 5 relations and rewriting 19 facts) rest on `related_to` and the seeds; history, no |
| 90 | longer a baseline. |
| 91 | |
| 92 | ## Open questions |
| 93 | |
| 94 | - With the switch off there is no "88 new phrasings since you last looked"; the index |
| 95 | `ontology_proposals_open_idx` was laid for it and the reminder never built. The only banner today |
| 96 | is `last_auto_extension`, which reports the last automatic run. |