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
- custom UI or design systems
- complex algorithms or manual performance tuning
- ad hoc integrations without a dedicated block
- hand-written imperative SQL (a future
customblock 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):
auth when using authenticated, role, or permission in policy. Minimal example: examples/minimal.aip.
Grammar (EBNF summary)
required | optional → unique → default(...).
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
Everyentity 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)
Insideworkflow / 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:Lead.seller as belongs_to User.
Default access
Entities without apolicy 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 namedeclarations endpointblocks for per-route rate limits
Validation
The semantic validator must reject:- missing or duplicate
appblock - references to missing
entity/event/job policyusingauthenticatedorrolewithoutauthinappowner(field)whenfielddoes not existworkflowwithoutwhen- 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.
