# Domain Ontology: the Knowledge Form of the Epistemic Loop > The epistemic loop governs *what may be believed*. The domain ontology governs *the language in which it is said*. This document defines the domain ontology and specifies how it is represented, stored, added, revised and deprecated, and how it relates to the epistemic loop, the fact base and graph projection. > > This describes the `0.2.0` **design**. What is implemented and what is still a design target is governed by [Known gaps](known-gaps.md) and the [mechanism truth table](optimization/truth-table.md) — this document does not present itself as current behaviour. --- ## 1. The problem: facts need a form A fact today is a one-line statement (`text`), a boundary (`scope`), a support level (`level`) and a set of evidence references. It is epistemically complete — the *why believe it* is answered — but its content is prose, so three things cannot be done mechanically: - **Comparison**: whether two facts are about the same thing can only be decided by re-reading prose; - **Conflict detection**: two contradictory facts can sit on the shelf together with nobody told; - **Reuse**: citing "what is known" in the next round means re-reading the whole fact base instead of retrieving by concept. The loop therefore completes only half its work: it *earns* conclusions but does not *place* them into a structure that can keep growing. The starting point of this design is one sentence: > The product of the epistemic loop is not a string; it is **bounded knowledge** — assertion content (constrained by the ontology) times epistemic metadata (governed by the loop). **This re-centering says the conclusion out loud: the product form of research is the ontology.** The epistemic loop is the ontology's production process and facts are its content units — the direction of truth does not change (world → evidence → fact → grown into the ontology), so **the ontology adjudicates nothing; it only houses what has been adjudicated**. Vocabulary is convention and entries are experience; their authorities belong to admission and to verification respectively, and not one line of that boundary moves after the re-centering. --- ## 2. Three layers "Ontology" has two senses in this repository and they must be kept apart, or two entirely different kinds of authority get conflated. | Layer | What it is | Question it answers | Where authority comes from | Rate of change | |---|---|---|---|---| | **Process ontology** | [`verification-loop`](verification-loop.md): nine objects, state machines, L0–L4, who judges and who releases | **How** we come to know | Code declaration, assembly-time validation, per plugin release | Release-level | | **Domain ontology** | A project's domain language: concepts, predicates, value forms, constraints | **In what language** we say it | Convention: admitted with a basis, usage leaves traces, deprecation is sticky | Slow (convention layer) | | **Fact base** | Sentences written in that language that already passed the loop | **What** we know | The loop: evidence, levels, boundaries, evaluation, review | Fast (empirical layer) | ### 2.1 The domain ontology is a language, not an a priori frame In knowledge representation, an ontology is "an explicit specification of a conceptualization" (Gruber, 1993). ClearAI accepts the **form** (explicit, shareable, checkable) and rejects the **a-priority**: > **A domain ontology is the language layer of a project's knowledge base: a set of governed conventions about which concepts exist in this domain, how they relate, which units quantities use, and what form a conclusion takes.** That yields one cut which dissolves two deadlocks at once: - **Bootstrapping**: a fact needs promotion before it has epistemic standing. If the domain ontology were also defined as "facts that must pass the loop", then no vocabulary would exist while the first goal is still running. **A language may exist before any sentence does** — conventions are admitted by named verbs, not by promotion. - **Authority**: a term is a convention, not an empirical claim. The authority of a convention comes from being adopted, used and deprecable — not from an evidence level. Only empirical claims need L0–L4. So: **terms do not need verification; sentences written with terms do.** ### 2.2 The process ontology is the plugin's own backend flow The process ontology is not project knowledge — it is the **plugin's own backend flow structure**: which objects exist, who may push which transition, who judges at which level. Three boundaries follow: - **It does not enter the ledger**: the ledger records **instances** (`goal/set`, `step/advanced`, `fact/promoted`, …), not the machine. Recording the machine in a project ledger would turn a plugin upgrade into a rewrite of project history, and would hand the runtime the ability to rewrite the rules of knowing — exactly what "inexpressible beats unviolatable" exists to prevent. The machine changes by **release**, `STATE_VERSION` guards its shape, and the shelf states the current version plainly. - **It is not editable at runtime**: changing the machine means changing code and declaration (`preset/plugins/ontology.js`), through assembly-time validation and a release — never through the ontology tab. - **It is shown as a state shape, not as a document to maintain**: the user sees steps, lanes, gates and convergence in the worldlines tree, and sees propositions grouped by ontology state in Propositions and facts — that is what the process ontology looks like on screen. The `clear/ontology/verification-loop.md` shelf is first of all the **charter the model reads** (it must write criteria and deliveries against these objects) and only secondly a reference for a human who wants to read deeply. In one line: **the domain ontology answers "in what language is your knowledge written" (editable, ledgered, backed by a basis); the process ontology answers "where does your work stand right now" (release-level, not editable, invisible rules with visible states).** ### 2.3 The three layers ```mermaid flowchart TD accTitle: Three Layers Of ClearAI Knowledge accDescr: The process ontology is fixed per release and governs how claims earn status, the domain ontology is a project's governed vocabulary, and the fact base holds sentences that already passed the loop. subgraph process["Process ontology · code · per release"] loop["Nine objects · state machines · L0–L4 · human gates"] end subgraph domain["Domain ontology · ledger · convention layer"] vocab["Concepts · predicates · value forms · constraints"] end subgraph facts["Fact base · ledger · empirical layer"] know["Assertions + levels + boundaries + evidence"] end loop -->|"governs how status is earned"| domain loop -->|"governs promotion"| facts domain -->|"supplies vocabulary"| facts facts -->|"usage traces · pressure"| domain classDef code fill:#dbeafe,stroke:#2563eb,color:#1e3a5f classDef ledger fill:#dcfce7,stroke:#16a34a,color:#14532d class loop code class vocab,know ledger ``` --- ## 3. The graph model: the minimal set after Occam's razor No OWL, no RDF triples, no SHACL, no SPARQL, no graph database, no separate reasoner. Only the four node kinds and three edge kinds that serve the current loop. ### 3.1 Nodes | Node | Meaning | Independently governed | |---|---|---| | `concept` | A domain concept, e.g. "numerical scheme", "furnace batch", "ramp rate" | Yes — part of the domain ontology | | `value_type` | A built-in value form: `statement` / `quantity` / `formula` / `code` / `reference` | No — fixed by the system | | `instance` | A concrete object mentioned by a fact, e.g. "WENO5", "batch-2025-001" | No — projected from facts | | `literal` | A number, text, formula, or code reference used as an object | No — projected from facts | **Instances are not registered.** They are projected out of typed facts and have no separate lifecycle — otherwise a picture would cost a whole extra object model. Instances sharing a label collapse to one node; entity resolution (two names for one thing) is out of scope, see [Known gaps](known-gaps.md). ### 3.2 Edges | Edge | Meaning | Example | |---|---|---| | `is_a` | Concept subsumption | `WENO scheme → numerical scheme` | | `predicate` | A domain predicate: concept → concept, or concept → value form | `numerical scheme --convergence order--> quantity` | | `assertion` | One typed fact | `WENO5 --convergence order--> 5` | A predicate is a **first-class edge record** in the ontology graph, not a visible node. It carries: ```json { "id": "convergence_order", "label": "convergence order", "domain": "numerical_scheme", "range": { "form": "quantity", "unit": "order" }, "functional": true } ``` Predicates are promoted to nodes only when relations *between predicates* genuinely need expressing. **No meta-model in advance.** ### 3.3 Ontology graph and entity graph stay separate ```mermaid flowchart LR accTitle: Ontology Graph Versus Knowledge Graph accDescr: The ontology graph declares which concepts and predicates exist, while the entity graph shows the typed facts that were actually promoted. subgraph onto["Ontology graph · what may be said"] scheme["numerical scheme"] -->|is_a| method["scientific method"] scheme -->|"convergence order · quantity"| qty["quantity"] end subgraph kg["Entity graph · what is said"] weno["WENO5"] -->|"convergence order · L3"| five["5"] weno -->|"type"| scheme2["numerical scheme"] end classDef concept fill:#dbeafe,stroke:#2563eb,color:#1e3a5f classDef value fill:#fef3c7,stroke:#d97706,color:#78350f classDef inst fill:#dcfce7,stroke:#16a34a,color:#14532d class scheme,method,scheme2 concept class qty value class weno,five inst ``` Drawing a term definition and an empirical fact as the same kind of edge is the main mistake this design avoids: they differ in authority, in rate of change, and in the cost of being wrong. --- ## 4. Facts: assertion plus epistemic metadata ### 4.1 Definition > **A fact = an assertion written in the domain language + epistemic metadata.** The metadata is what exists today (level, boundary, evidence, evaluation, review, source goal, verification path) and loses nothing. What is new is the **assertion**: ```json { "subject": { "id": "WENO5", "type": "numerical_scheme" }, "predicate": "convergence_order", "object": { "kind": "quantity", "value": 5, "unit": "order" }, "qualifiers": { "regime": "smooth" } } ``` ### 4.2 Value forms: the direct answer to "what form?" Plain text, formulae and code are not three kinds of fact. They are the five **value forms an assertion object may take**: | Form | Object shape | Validation (strict once supplied) | |---|---|---| | `statement` | A short statement string | Non-empty, bounded length | | `quantity` | A number plus a unit string | The number parses; the unit is non-empty; no dimensional arithmetic in this version | | `formula` | LaTeX source | Non-empty; no semantic parsing in this version | | `code` | A workspace file path | The file really exists in the workspace (the same discipline as "a scale must reference a real file") | | `reference` | A ledger id or an on-disk path | The reference resolves | A relation predicate (`range: { term }`) takes an **instance** as its object — `{ kind: "instance", value: "