Skip to content

ManifestoSemantic State for AI-Governed Applications

Build applications where every state change is deterministic, traceable, and governed by explicit authority.

Understand Manifesto in 10 Minutes โ€‹

What is Manifesto? โ€‹

Manifesto is a semantic state layer for building AI-governed applications with deterministic computation and full accountability.

It solves the fundamental problem: How do we build applications where AI agents can safely read, reason about, and modify application state?

Traditional state management scatters logic across components, middleware, and callbacks. Manifesto takes a radically different approach:

Core computes what the world should become.
Host makes it so.
World governs who can do what.

The fundamental equation:

typescript
compute(schema, snapshot, intent, context) โ†’ (snapshot', requirements, trace)

This equation is:

  • Pure: Same inputs MUST always produce same outputs
  • Total: MUST always return a result (never throws)
  • Traceable: Every step MUST be recorded
  • Complete: Snapshot MUST be the whole truth

Quick Example โ€‹

Here's a complete counter application in Manifesto:

typescript
import { z } from "zod";
import { defineDomain } from "@manifesto-ai/builder";

// Define domain with Zod schema
const CounterDomain = defineDomain(
  z.object({
    count: z.number().default(0),
  }),
  ({ state, actions, expr, flow }) => {
    const { increment, decrement } = actions.define({
      increment: {
        flow: flow.patch(state.count).set(expr.add(state.count, 1)),
      },
      decrement: {
        flow: flow.patch(state.count).set(expr.sub(state.count, 1)),
      },
    });

    return { actions: { increment, decrement } };
  }
);

MEL equivalent:

mel
domain Counter {
  state {
    count: number = 0
  }

  action increment() {
    when true {
      patch count = add(count, 1)
    }
  }

  action decrement() {
    when true {
      patch count = sub(count, 1)
    }
  }
}

That's it. Five lines of actual logic. No reducers, no middleware, no thunks.

What just happened?

  • State schema defined with Zod (type-safe)
  • Actions declared as pure flows (deterministic)
  • No execution code (Host handles that)
  • Zero string paths (TypeScript autocomplete works)
  • Fully serializable (AI can generate this)

Key Concepts (5-Minute Overview) โ€‹

1. Snapshot: The Single Source of Truth โ€‹

typescript
type Snapshot = {
  data: { count: 0 };              // Domain state
  computed: { doubled: 0 };        // Derived values
  system: { status: 'idle' };      // Runtime state
  input: unknown;                  // Transient input
  meta: { version: 1 };            // Metadata
};

Critical principle: All communication happens through Snapshot. There is no other channel.

If it's not in Snapshot, it doesn't exist.

2. Intent: What You Want to Happen โ€‹

typescript
type IntentBody = {
  type: "increment";    // Action name
  input?: unknown;      // Optional data
};

Intents are requests to perform actions. They trigger Flow execution.

3. Flow: Declarative Computation โ€‹

Flows are data structures that describe computations:

typescript
{
  kind: "seq",
  steps: [
    { kind: "patch", op: "set", path: "count", value: { kind: "lit", value: 0 } }
  ]
}

Flows:

  • Do NOT execute; they describe
  • Do NOT return values; they modify Snapshot
  • Are NOT Turing-complete; they always terminate
  • Have no memory between executions

4. Effect: External Operations โ€‹

typescript
// Declare effect (Core)
flow.effect("api:fetchUser", { userId: "123" });

// Execute effect (Host)
host.registerEffect("api:fetchUser", async (type, params) => {
  const user = await fetch(`/api/users/${params.userId}`).then(r => r.json());
  return [{ op: "set", path: "user", value: user }]; // Return patches
});

Effects are declarations of IO. Core declares them. Host executes them.

5. World: Governance Layer โ€‹

typescript
// Submit intent through World
const proposal = await world.submitProposal(actor, intent);

// Authority evaluates
world.registerAuthority("todos:delete", async (proposal, context) => {
  if (context.actor.role !== "admin") {
    return { approved: false, reason: "Only admins can delete" };
  }
  return { approved: true };
});

World manages who can do what, and records every decision.

Why Manifesto? โ€‹

The Problem Manifesto Solves โ€‹

Modern applications have three fundamental problems:

1. Unpredictability โ€‹

Traditional state management:

  • Side effects mixed with logic
  • Hidden execution context
  • Non-deterministic behavior
  • "Works on my machine" bugs

Manifesto solution: Pure computation. Same input โ†’ same output, always.

2. Unaccountability โ€‹

Traditional systems:

  • Who changed this value?
  • Why did this happen?
  • Can't replay production bugs
  • No audit trail

Manifesto solution: Full lineage. Every change traceable to Actor + Authority + Intent.

3. Untestability โ€‹

Traditional testing:

  • Mock everything
  • Brittle tests
  • Integration tests required
  • Can't test determinism

Manifesto solution: Test Core without mocks. It's pure.

What Makes Manifesto Different? โ€‹

Traditional State ManagementManifesto
Logic scattered across componentsLogic in declarative schemas
Side effects mixed with logicEffects as pure declarations
Non-deterministic executionGuaranteed determinism
No built-in governanceWorld Protocol for authority
Exceptions for errorsErrors as values in Snapshot
Testing requires mocksCore testable without mocks
Hard to explain "why"Every value can answer "why?"

Manifesto is NOT โ€‹

Before you dive deeper, understand what Manifesto is NOT:

Manifesto IS:
  โœ“ A semantic calculator for domain state
  โœ“ Schema-first and JSON-serializable
  โœ“ Deterministic and reproducible
  โœ“ Explainable at every step
  โœ“ Pure (no side effects in Core)

Manifesto IS NOT:
  โœ— An AI agent framework
  โœ— A workflow orchestrator
  โœ— A database or ORM
  โœ— A replacement for React/Redux
  โœ— A Turing-complete runtime

See Manifesto vs. Others for detailed comparisons.

Architecture at a Glance โ€‹

Manifesto is structured as six distinct layers, each with a single responsibility:

Key separations:

  • Core computes semantic meaning (pure)
  • Host executes effects and applies patches (impure)
  • World governs who can do what (authority)
  • Bridge connects external events to intents (routing)
  • Builder provides type-safe DSL (developer experience)
  • React (or any UI) presents state (view)

See Architecture Overview for complete details.

Data Flow โ€‹

Understanding how data flows through Manifesto is critical:

Critical principle: Information flows ONLY through Snapshot. No hidden channels.

See Data Flow for step-by-step explanation.

Get Started โ€‹

Ready to build with Manifesto?

Installation โ€‹

bash
npm install @manifesto-ai/builder @manifesto-ai/core @manifesto-ai/host zod
# or
pnpm add @manifesto-ai/builder @manifesto-ai/core @manifesto-ai/host zod

Next Steps โ€‹

PathFor WhomStart Here
Quick StartDevelopers new to ManifestoGetting Started
Deep DiveUnderstanding the architectureCore Concepts
ExamplesLearning by doingTodo App Example
SpecificationsImplementers & reviewersSpecifications

Learn More โ€‹

Who Should Use Manifesto? โ€‹

Perfect Fit โœ… โ€‹

Use Manifesto if you need:

  • Deterministic computation (same input โ†’ same output)
  • AI agent governance (LLMs proposing actions)
  • Full accountability (audit trails, compliance)
  • Explainability (every value can answer "why?")
  • Testability without mocks (pure computation)
  • Schema-first design (AI-generated logic)

Good Fit โœ”๏ธ โ€‹

Use Manifesto if you have:

  • Complex domain logic with side effects
  • Multi-actor systems with authorization
  • Need for time-travel debugging
  • Reproducible computation requirements

Poor Fit โŒ โ€‹

Don't use Manifesto if you only need:

  • Simple local UI state (use useState or Zustand)
  • Rapid prototyping without governance (use Redux)
  • Workflow orchestration (use Temporal)
  • Event-driven architecture (use Event Sourcing)

See When to Use Manifesto for detailed decision tree.

Community โ€‹

Contributing โ€‹

We welcome contributions! See our Contributing Guide.

License โ€‹

MIT ยฉ 2025 Manifesto AI


Ready to build deterministic, AI-governed applications?

Get Started โ†’