The execution chain, in depth
MasterEngine is a governed business-mission execution platform. A mission is a unit of business work — "follow up on every open quote this week," "reconcile yesterday's invoices" — that the platform plans, authorizes, executes, and verifies. Every mission passes through eight stages, in order.
-
Contracts
Before anything runs, the mission states a contract: the goal, the definition of done, and bounds on value, cost, and risk. The contract is the yardstick the mission is judged against at the end — expected vs. actual.
-
Tenant boundary
The mission is bound to exactly one tenant. Isolation is enforced by PostgreSQL forced row-level security across organization, workspace, and environment — a mission cannot read, write, or even see another tenant's data, no matter what a model inside it suggests.
-
Verified identity
The mission executes as a verified identity. Authorization is identity-relative: what a mission may do depends on who (or which service) is verifiably running it.
-
Deterministic policy and authorization
A deterministic policy engine decides whether each proposed action is allowed. Deterministic means reproducible: the same inputs always yield the same verdict. Models propose actions; models never grant them.
-
Governed Action transaction
Authorized actions execute as transactions — atomic, bounded by the contract, and individually auditable. If an action would exceed its bounds, the transaction doesn't proceed.
-
Durable workflow
Missions run as durable workflows on Temporal. Long-running work survives restarts and infrastructure hiccups; retries are explicit policy, not silent hope; a mission can never quietly die mid-flight.
-
Connector or model execution
Connectors touch your systems (databases, APIs, tools); models do the cognitive work (planning, drafting, summarizing). Both operate strictly inside the authorizations granted in stage 4.
-
Evidence and outcome
Every stage lands on the evidence timeline: what was proposed, what was authorized, what ran, what it cost, and the outcome — compared against the contract from stage 1. A mission with no evidence doesn't count as complete.
Architecture principles
Models stay out of authorization
Proposed actions, authorization decisions, controlled execution, and verification are separated by design. A model's job is to propose and to execute; deciding what's allowed is the deterministic policy engine's job. This is the line that turns automation into governance.
Tenants are isolated at the database
Isolation isn't a middleware convention — it's PostgreSQL forced row-level security. The database itself refuses cross-tenant access, so a bug in application code can't become a data leak.
Modular monolith
The platform is built as a modular monolith: clear internal module boundaries with a single deployable. Fewer distributed-systems failure modes, same separation of concerns.
PostgreSQL is the source of truth
PostgreSQL is the authoritative store. Durable workflows run on Temporal; projections (such as graph views) are rebuildable from the source of truth, never the other way around.
The mission-spec format
A mission spec is the declarative document that describes one mission: its contract, its boundaries, and its authorized actions. The format below is a v1 draft — it will evolve as the platform ships, and every change will be recorded in the changelog.
This format is documented as a draft because the platform is in developer preview. Fields may change, gain, or lose meaning. Do not treat this as a stable public schema yet — treat it as the current shape of the thing we're building.
Fields
| Field | Type | Description |
|---|---|---|
| name | string | Human-readable mission name. Used in the approval inbox and evidence timeline. |
| version | string | Spec version this document targets (e.g. 1.0-draft). |
| tenant | object | The tenant boundary: organization, workspace, environment. Exactly one. |
| contract | object | Goal, definition of done, and bounds on value, cost, and risk. |
| identity | object | The verified identity the mission executes as. |
| policy | object | Deterministic policy references: which rule set authorizes this mission's actions. |
| actions | array | The ordered action plan. Each action is authorized individually before it runs. |
| evidence | object | What the mission must record: expected vs. actual value, cost, risk. |
Illustrative example
The example below is illustrative only — it shows the shape of a mission spec, not a schema you can submit anywhere today.
{
"name": "weekly-pipeline-followup",
"version": "1.0-draft",
"tenant": {
"organization": "example-org",
"workspace": "sales",
"environment": "production"
},
"contract": {
"goal": "Follow up on every open quote older than 7 days",
"definition_of_done": "Each open quote has a logged follow-up touch",
"max_cost_usd": 25,
"risk_bounds": ["no external sends without approval"]
},
"identity": { "type": "service", "id": "missions/sales-followup" },
"policy": { "rule_set": "sales-standard-v1" },
"actions": [
{ "kind": "read", "target": "quotes.open_older_than_7d" },
{ "kind": "draft", "target": "followup_message", "requires_approval": true },
{ "kind": "record", "target": "crm.followup_touch" }
],
"evidence": {
"record": ["quotes_touched", "messages_drafted", "actual_cost_usd"],
"compare": "expected_vs_actual"
}
}
Notice what's enforced by the format: one tenant, a named identity, a referenced policy rule set (not inline model judgment), per-action approval flags, and a contract the evidence is compared against. That's the execution chain, expressed as a document.
Want more worked examples? The recipe library adapts this format to common business missions — each recipe clearly marked illustrative.