Architecture overview — principles and runtime shape
What ObjectStack is built as: a metadata-native backend that humans and AI agents can both operate safely — its principles, runtime shape and non-goals.
ObjectStack is the metadata-native backend for business software that humans and AI agents can both operate safely. The platform makes the business system explicit: data models, views, flows, permissions, actions, AI tools, and runtime requirements are typed metadata instead of scattered ad-hoc code. In the enterprise-AI vocabulary, the ontology is the software.
The goal is a small, inspectable, governed application surface:
Zod metadata -> compiled environment artifact -> ObjectStack runtime -> REST / UI / MCP / AI toolsThis page is the architecture. Where the project is headed and what comes first — its goals and priority ladder — is the North Star.
Principles
- Zod first. Zod schemas are the source of truth. Types and JSON Schemas are derived from them.
- Metadata is the app contract. Objects, fields, views, flows, actions, agents, permissions, datasets, and translations are structured metadata.
- Runtime identity is environment identity. Use
environment, notproject, for deployment/runtime scoping:OS_ENVIRONMENT_ID,X-Environment-Id,/api/v1/environments/:environmentId, andenvironment_id. - Deployment config is not artifact content. Database URLs, secrets,
runtime credentials, and hostnames are injected by the host or Cloud control
plane. They do not belong in
objectstack.json. - AI exposure is governed. Actions become AI tools only through explicit
ai: { exposed: true, description: ... }metadata. - Automation is Flow-first. Event automation, scheduled work, approvals, waits, screens, and notifications are modeled as Flow nodes. State machines model strict lifecycles.
- The console is a consumer, not the source of truth. The framework serves
the published ObjectUI console bundle; source UI work happens in sibling repo
../objectui.
Runtime Shape
This framework repo owns:
- protocol schemas in
packages/spec - kernel/runtime/bootstrap in
packages/coreandpackages/runtime - REST, ObjectQL, metadata, services, plugins, adapters, CLI, examples, docs
- bundled console integration in
packages/console - docs site in
apps/docsand account app inpackages/apps/account
Cloud control-plane distribution, public SaaS operations, and ObjectUI source development live outside this repo.
Environment Artifact
os compile produces the local runtime bundle (dist/objectstack.json,
validated against ObjectStackDefinitionSchema). When published to Cloud it is
wrapped in the immutable environment artifact envelope defined by
EnvironmentArtifactSchema in
packages/spec/src/system/environment-artifact.zod.ts (the single
declaration, published on @objectstack/spec/system).
The artifact contains:
schemaVersionenvironmentIdcommitIdchecksum— a SHA-256 hex digest (string) of the canonicalmetadataserializationmetadata— the compiledObjectStackDefinitionitself- optional
builtAt/builtWithprovenance - optional
grantedPermissions— the install-time GRANTED permission set per plugin, keyed by the plugin manifestid; consent state the control plane re-emits on each assembly (absent = no consent record,{}= consented to nothing), sitting besidemetadataand outside thechecksumdigest
The artifact is enough to describe what the runtime should load. It is not enough to deploy by itself; the host still supplies deployment config.
Request Resolution
Environment-aware hosts resolve data-plane requests in this order:
/api/v1/environments/:environmentId/...- hostname through the environment registry
X-Environment-Idsession.activeEnvironmentId- configured default environment
- one unambiguous environment
Cloud control-plane endpoints such as /api/v1/cloud/environments/:id manage
environments and are not themselves scoped data-plane requests.
Non-Goals
- Do not reintroduce
namespaceortableNameas object identity fields. - Do not put business logic in
packages/spec. - Do not hand-edit
content/docs/references/. - Do not expose every UI action to AI by default.
- Do not treat Cloud control-plane deployment as part of this framework repo's local dev server.