Skip to main content

Module from_template

Module from_template 

Source
Expand description

A job made from a template, and a template’s update diff (docs/specs/SPEC_JOBS_AND_TEMPLATES_2026_10_24.md §5.4).

apply works on the definition as JSON, before it is parsed: it pins the job to the approved template (id, version, hash), checks the parameters against the template’s schema, renders the brief from them, and sets the outputs and secrets the template declares. A template that isn’t approved, or changed since it was, can’t make a job (resolve_approved). On a create it also fills in what the request left out from the template’s defaults (name, trigger, action, policy).

A job keeps the version it was made from. A newer one is offered with update_diff; accepting it is an edit that names the new version, which apply reads as an update and lays the template’s policy defaults over the job’s.

Structs§

ListChange
A list’s difference.
PolicyChange
One policy setting that accepting the update changes.
TemplatePinView
The template a job was made from, as the tab’s row shows it.
TemplateUpdateDiff
TemplateUpdateView
A newer version of a job’s template, installed.
TextChange
A text before and after.

Enums§

UpdateStatus
What jobs.templates.update_diff says about a job’s template.

Functions§

apply
Lay the approved template under def, a job definition as JSON. Does nothing when def names no template.
brief_of
The text an action carries: a task’s payload, else the brief.
edit_needs_render
Whether an edit (fields laid over before) changes what a template’s render depends on: its pin or parameters, or the brief itself. An action edit that leaves the brief as it was (a new target) needs none. One that leaves the brief out, or writes another, is rendered again, so the template stays the brief’s only author.
pin_view
pin as the row shows it. latest remembers each template read, so a list of jobs made from one reads it once.
update_diff
Compare job’s pinned template with the one installed now, as a job edit that accepts it would make it.

Type Aliases§

Latest
What the installed template is, for the pins that name it.