Intent

DocsLanguage

Language

A program is a version line, an application, and the members inside it. The formal subset lives in grammar/intent.peg.

File shape

shape
intent version "0.1"
application Catalog {    actor Merchant    enum Condition { New Used }    type Money { amount Number currency String }    resource Product { }}

Types

Primitives include String, Number, Boolean, UUID, DateTime, and Duration. User types, enums, optionals (T?), and collections ([T] or T[]) are valid. References to actors and resources are first-class.

Resource

A resource groups fields, constraints, permissions, behavior, and optional observability.

  • Constraints today: field between low and high
  • Permissions: Actor -> create or read, and the other verbs the validator accepts
  • Behavior: named operations with input, validate, action, and emit

Architecture and security

Programs may declare layer edges (frontend -> api, frontend !-> database), authentication, authorization, PII, and secrets. Illegal edges fail validation. Generated APIs honor declared actors through the X-Intent-Actor header. That header is application-level authorization, not a public identity proof.

Workflows and screens

workflow and screen members describe process and UI. The compiler records them and can emit workflow runners and frontend shells. They do not replace the resource model.