|
| 1 | +--- |
| 2 | +title: Business ontology — the executable definition the runtime runs |
| 3 | +navTitle: Business Ontology |
| 4 | +description: "What ObjectStack means by business ontology: the executable definition the runtime runs, its projections, what it is not, and how AI writes and uses it." |
| 5 | +--- |
| 6 | + |
| 7 | +**The ontology is the software.** One executable business ontology. AI writes it, the |
| 8 | +runtime runs it, agents operate it, you own it. This page is the authority on what that |
| 9 | +word means here; the [glossary entry](/docs/getting-started/glossary#business-ontology) |
| 10 | +is the short form. |
| 11 | + |
| 12 | +## What the ontology is |
| 13 | + |
| 14 | +The ontology is the definition of your business that the runtime executes: authored as |
| 15 | +typed metadata in `objectstack.config.ts`, compiled into the `objectstack.json` artifact. |
| 16 | +Its core is six kinds of thing: |
| 17 | + |
| 18 | +| Core | What it declares | |
| 19 | +| :--- | :--- | |
| 20 | +| **Objects and fields** | The entities of the business and their typed attributes — validation, formulas, defaults, files | |
| 21 | +| **Relations** | Lookups and master-detail links between objects | |
| 22 | +| **Actions** | The operations a user or an agent may invoke on a record, and the conditions under which they show | |
| 23 | +| **Permissions** | Who may read, create, edit and delete what — RBAC, row-level and field-level security, sharing | |
| 24 | +| **Flows** | The business processes — DAG flows, record triggers, scheduled jobs, approvals, workflows | |
| 25 | +| **Agent and tool definitions** | The AI agents the app ships with, the tools they may call, and the skills that shape them | |
| 26 | + |
| 27 | +It is one definition, open and versioned. It lives in your repository as ordinary |
| 28 | +TypeScript, is reviewable as a diff, and is specified and licensed Apache-2.0 — not a |
| 29 | +graph held inside a vendor's system and reachable only through that vendor's console. |
| 30 | +The runtime derives everything else from it. |
| 31 | + |
| 32 | +## What the projections are |
| 33 | + |
| 34 | +Views, dashboards, apps, and translations are **projections** of the ontology — authored |
| 35 | +in metadata too, validated by the same gate, but not part of the ontology. A list view |
| 36 | +projects an object's fields and permissions onto a grid; a dashboard projects queries over |
| 37 | +objects onto charts; an app groups objects, views and actions into a navigable product; a |
| 38 | +translation projects every label into a locale. Change the core and the projections |
| 39 | +follow; remove a projection and the business it showed is unchanged. The distinction |
| 40 | +bounds what an agent must hold to reason about the business: the core, not every screen. |
| 41 | + |
| 42 | +## What it is not |
| 43 | + |
| 44 | +- **Not a knowledge ontology.** OWL, RDF and knowledge graphs *describe* a domain, carry |
| 45 | + class inheritance and axioms, and are *reasoned over* by an inference engine. |
| 46 | + ObjectStack has no object inheritance, no axioms and no reasoner: the definition is |
| 47 | + *validated* — by Zod schemas and `os validate` — and then *run*. The `abstract` key was |
| 48 | + removed from the spec for exactly that reason (ADR-0049). |
| 49 | +- **Not the industry's semantic layer.** A semantic layer is a read-only mapping over |
| 50 | + existing systems: it describes the business but does not run it. ObjectStack's ontology |
| 51 | + *is* the system — the database, API, UI and agent tools are derived from it. Federating |
| 52 | + an external datasource is possible, read-only by default and early; see |
| 53 | + [External Datasources](/docs/data-modeling/external-datasources). These docs also use |
| 54 | + *semantic layer* in a narrower sense, for the analytics `dataset` layer that reports and |
| 55 | + dashboards bind to; see [Analytics & Datasets](/docs/data-modeling/analytics). |
| 56 | +- **Not a formal ontology in the philosophical sense.** It makes no claim about what |
| 57 | + exists in general. It is one business's application, defined precisely enough to run. |
| 58 | + |
| 59 | +## How the runtime executes it |
| 60 | + |
| 61 | +```text |
| 62 | +objectstack.config.ts -> objectstack.json -> ObjectStack runtime -> database · REST / realtime API · UI · MCP server |
| 63 | +``` |
| 64 | + |
| 65 | +From the compiled artifact the runtime **derives** the database schema on an |
| 66 | +interchangeable driver, a generated REST and realtime API, server-driven UI for the |
| 67 | +Console, and an MCP server — and it **enforces** the definition on every call. RBAC, |
| 68 | +row-level and field-level security, sharing, and audit apply to a REST request, a Console |
| 69 | +click and an agent's tool call alike. Nothing is reasoned over at runtime: what runs is |
| 70 | +what was validated. |
| 71 | + |
| 72 | +Code does not disappear — it moves into the runtime. Hooks, action bodies, and the CEL |
| 73 | +expressions in formulas, predicates and policies run inside the runtime's permission and |
| 74 | +audit fence; constrained JSX in pages is parsed into a server-driven UI tree, never |
| 75 | +executed as code. None of it is scattered across a codebase the ontology would then have |
| 76 | +to describe. [Protocol Architecture](/docs/concepts/architecture) covers the layers; |
| 77 | +[Metadata-Driven Development](/docs/concepts/metadata-driven) shows what one definition |
| 78 | +derives. |
| 79 | + |
| 80 | +## How AI writes it and uses it |
| 81 | + |
| 82 | +**Writing it.** The scaffolder installs the AI skills bundle and writes an `AGENTS.md`, so |
| 83 | +a coding agent starts with the protocol's rules loaded rather than generic priors. The |
| 84 | +agent writes the definition as typed metadata; strict TypeScript and Zod reject shape |
| 85 | +errors in the editor, and `os validate` rejects metadata that type-checks but would fail |
| 86 | +silently at runtime — dangling bindings, bad CEL predicates, a missing security posture — |
| 87 | +as located, corrective text the agent reads and fixes itself. You approve a small, |
| 88 | +readable diff in the Console. The loop end to end is |
| 89 | +[Build with Claude Code](/docs/getting-started/build-with-claude-code); why it is fast |
| 90 | +and safe is [How AI Development Works](/docs/getting-started/how-ai-development-works). |
| 91 | + |
| 92 | +**Using it.** The running app is an MCP server, on by default: every object is a tool, |
| 93 | +every exposed action is a tool, permissions decide what an agent may call, and audit |
| 94 | +records what it did. An agent operates the app through the same typed, permission-aware |
| 95 | +surface as a human — never raw SQL or scraped UI. See |
| 96 | +[Connect an MCP Client](/docs/ai/connect-mcp). |
| 97 | + |
| 98 | +Size is what makes both halves work. An app whose definition fits in one context window |
| 99 | +is one an agent can read whole, reason about whole, and refactor whole — apps small |
| 100 | +enough for AI to hold whole. |
0 commit comments