Reference

Directive Reference

Alphabetical TOML directive reference for create_resource, link_resources, copy_property, control, and output.

Directive Reference

Alphabetical list of TOML directives used in models/, compliance/, output/, and actions/.

origin_resource

Defines the subject resource type for following model rules. In model files, rescile scans raw text before TOML deserialization and starts a new model chunk at every declaration matching ^origin_resource\s*=.

The declaration must begin at column zero. A model file may contain several origin chunks. Generic whole-file TOML parsing does not represent their rescile execution scope; use rescile validation and saved-graph assertions.

[[create_resource]]

Creates a new resource based on the origin_resource or header lists.

Directive Description
resource_type The type of the new resource.
relation_type The type of the relationship from the origin resource.
name String template for the primary key.
properties Key-value table of properties.
relation_properties Key-value table for edge properties.
match_on Array of operators to conditionally apply rule.
create_from Creates via { property = "..." } or { list = "..." }.

Links existing resources (the “pull” join).

Directive Description
with The type of the remote resource.
join { local = "...", remote = "..." } join condition.
match_with Array of operators to filter the remote resources.
copy_properties Array of properties to copy from the target.
create_relation { type = "..." } relation to create.

Note: A standalone [[create_relation]] array-of-tables is not a valid directive. The relation is declared inline inside [[link_resources]].

Origin semantics: [[link_resources]] links vertices of the model’s origin_resource type — the relation’s start vertex is the origin type, not resources created by a [[create_resource]] rule in the same model. If you create resources of type admin from an emergency_admin origin and then link with = "secret", the resulting edges are emergency_admin -> USES_SECRET -> secret, not admin -> USES_SECRET -> secret. To link the created resources, declare a separate model with origin_resource = "admin" (the model stabilization loop re-runs rules until the graph is stable, so the created resources are visible), or declare the relation on the origin type in your schema.

[[copy_property]]

Pushes data to a connected resource.

Directive Description
to The destination resource type.
properties Array of strings or tables { from, as, template }.

[[retype_relation]]

Overrides asset implicit relation creation.

Directive Description
property_key Column header name.
new_type The overridden relationship type.
target_resource_type The overridden target resource type.

[[control]]

Defines a compliance rule in compliance/.

Directive Description
id Standard identifier.
name Human-readable name.
[[control.target]] Array of mutation targets (origin_resource_types).
[control.config] Table of values applied as compliance payload.

[[output]]

Generates an artifact in output/. Strict validation is enforced: any unrecognized or misspelled keys produce an immediate parse error.

Directive Description
resource_type Output resource type classification.
name Primary key of the generated artifact node.
filename Downloadable filename.
mimetype Content MIME type.
relation Optional relation to bind to; expands once per matching outgoing edge.
match_on Optional array of match filters to restrict origin nodes.
template Tera template string rendering JSON.
jsonnet Jsonnet evaluation string rendering JSON.

Action Specification (actions/*.toml)

Defines an executable business logic action.

Directive Description
name The name of the action.
description Human-readable description, exposed to MCP Agents.
[[input]] Defines the expected input schema (name, description, type).
[runtime] Execution environment configuration (engine, flake, files).
[runtime.result_callback] Optional HTTP URL to invoke when the action finishes asynchronously.
[[runtime.on_complete]] Optional array of graph mutations (target_asset, action, record) to apply automatically upon completion.
[[mount]] Mounts generated output artifacts from the graph context. Resolved by rendered filename within resource_type.
[env] Secure credentials mapping (fetches from Vault).
exec Command array to execute the action.

Contract Specification (contracts/*.toml)

Defines a custom API endpoint for atomic, intent-based state mutations and graph queries.

Directive Description
name The unique name of the contract, exposed as /api/contracts/:name.
[[input]] Defines the expected incoming JSON payload schema.
[[write]] State mutations (target_asset, action, record, lookup_by) applied atomically.