GenAI.Approval.Script (GenAI Approval v0.1.0)

Copy Markdown View Source

Parsed approval script: AST + metadata.

A script has four ordered sections — endpoint declarations (preamble), typed variable declarations, a body of steps and conditionals, and declared outputs. Expressions are data-only tuples (never code):

  • {:lit, term} — literal
  • {:lit_list, [expr]} — list literal
  • {:var, [segment, ...]} — dotted variable path
  • {:not, expr}
  • {:op, op, left, right}op in :== :!= :< :> :<= :>= :and :or
  • {:call, endpoint, command, [{name, expr}]} — call expression (assign RHS only)

Summary

Functions

All steps in document order (includes steps inside both branch arms).

Steps contained in a (possibly nested) body — used to mark untaken branches.

Types

t()

@type t() :: %GenAI.Approval.Script{
  body: term(),
  endpoints: term(),
  outputs: term(),
  source: term(),
  steps: term(),
  vars: term()
}

Functions

collect_steps(body)

All steps in document order (includes steps inside both branch arms).

step_ids(body)

Steps contained in a (possibly nested) body — used to mark untaken branches.