Skip to main content

Specification

Normative document for AI Parlance (v0.1). Defines grammar, semantics, builtins, policies, and block stability levels. Overview: Introduction. Syntax reference: Syntax.

Glossary


Scope and limits

AI Parlance currently covers:
  • data and API modeling (CRUD)
  • declarative authorization
  • limited domain workflows and events
It does not replace:
  • custom UI or design systems
  • complex algorithms or manual performance tuning
  • ad hoc integrations without a dedicated block
  • hand-written imperative SQL (a future custom block is reserved; not in v0.1)

Pipeline

.aip is the source; the AST is internal. Agents and humans edit .aip, not the AST directly. Toolchain (v0.1): parser, validator, and transpilers are not published yet. This document is the normative source; see spec/v0.1/grammar.ebnf for machine-oriented grammar.

Required app block

Every v0.1 spec must start with exactly one app block (version tag recommended):
Add auth when using authenticated, role, or permission in policy. Minimal example: examples/minimal.aip.

Grammar (EBNF summary)

Field modifier order: required | optionaluniquedefault(...). Line comments: // to end of line (ignored by the parser).

Stability levels

Top-level enum { } / relation { } blocks and has_one / has_many / many_to_many are roadmap, not v0.1. Beta blocks may change syntax between minor v0.x releases. Core is stable within v0.1; the overall spec remains draft until a reference toolchain ships.

Implicit fields

Every entity receives automatically (unless id: uuid is explicit): The timestamps modifier on entity is optional documentation sugar; it does not disable these fields. soft_delete on entity adds deleted_at: datetime optional.

Builtins

Unlisted builtins are invalid until added to the spec.

Lifecycle

System events (when triggers):
when Lead.created in workflow equals on created in lifecycle. Prefer lifecycle when an entity has multiple hooks.

Workflow statements (v0.1)

Inside workflow / lifecycle hooks: var, if / reject, assign, create, emit, notify, dispatch (optional after + duration). Durations: 15m, 1h, 1d (see Workflows). Forward references are allowed: emit and create may reference event / entity blocks declared later in the file.

Policies

Predicates supported in v0.1:
Requires Lead.seller as belongs_to User.

Default access

Entities without a policy block: transpilers should default to authenticated for CRUD when app has auth, or public when there is no auth. Explicit policy always wins.

Proposed (not in v0.1 grammar)

  • Top-level permission name declarations
  • endpoint blocks for per-route rate limits
Documented in Security as preview only until added to the grammar.

Validation

The semantic validator must reject:
  • missing or duplicate app block
  • references to missing entity / event / job
  • policy using authenticated or role without auth in app
  • owner(field) when field does not exist
  • workflow without when
  • duplicate or out-of-order modifiers (warning vs error per rule)
  • unregistered builtins

Transpiler matrix

LLM inference cost applies to editing .aip, not offline transpilation.

Reference spec

Full CRM example: examples/crm-reference.aip Domain chapters (Database, Security, Workflows) document extensions relative to this file.