A dropdown offers a list of choices. Most lists are fixed; some are not. This page covers the
kinds of list a template can declare, and what the platform guarantees for each (issue #104).
| Kind | Example | Declared as | A change to it is |
|---|---|---|---|
| Fixed | Yes/No, verdicts, item types | values: [...] | a template change (a new version) |
| Recipe | spell-request's Executive Vote dates | choices: { recipe: "<expression>" } | a template change when the recipe changes; never when only its output moves with time |
| Data | Primes (spell-request, the Prime spell batch, allocation risk) | choices: { source: "primes" } | never a template change: the list is live data (see data sources) |
A recipe is a closed platform expression whose only input is the current instant. It returns the list of choices: distinct, non-empty strings of at most 256 characters, at most 500 of them.
{
key: "execDate",
type: "dropdown",
title: "Targeted Executive Vote",
mandatory: true,
// The next 10 cadence Thursdays at least 22 days out, skipping a no-vote date.
choices: { recipe: 'cadenceDates("2026-07-30", 14, isoDateAddDays(todayIsoDate(), 23), 10, ["2026-12-31"])' },
}
todayIsoDate(), and anything built on the
instant) and nothing else: not the process, the user, permissions or the form. The compiler
refuses a recipe that reads anything else (compileChoiceRecipe), and registration validation
refuses a compiled recipe whose input is anything but now. So the same instant always gives the
same list, in the browser and on the server.@processos/forms/choices, which uses the server's evaluator,
@processos/expressions/choices). The server evaluates it again, at the instant of the write,
whenever a request writes a new value to the field: a step edit or completion, or a value
seeded when a process starts (initial values and defaults). A value outside the list is refused
with 400 invalid-choice, naming the value and the choices offered at that instant. This holds
for every input policy (compatible and strict): the rule is the field's contract.choiceAudit: at, step, field, value). Replaying the recipe at at reproduces the
acceptance, so revalidation is deterministic. A step or field rename rewrites these entries like
the field audit (originals kept in the migration audit).item_list rows.Generic helpers for date recipes (domain/shared/src/declarative/calendar.ts); UTC calendar dates
as YYYY-MM-DD, and none reads the clock itself:
| Helper | Gives |
|---|---|
todayIsoDate() | Today's date at the instant of evaluation. |
isoDateAddDays(date, days) | date plus days whole days (negative goes back). |
cadenceDates(anchor, everyDays, onOrAfter, count, exclude) | The first count dates of the cadence anchor + k × everyDays on or after onOrAfter, skipping the dates in exclude. At most 100 dates and 100 exclusions. |
A data source is a named list of entries with stable ids and names that the deployment binds and the
server reads live (Phase 4 of the unified-platform plan). The one bound today is primes: the
ontology's Prime agents (organizations of type PRIME_AGENT).
{
key: "_prime",
type: "dropdown",
title: "Prime",
mandatory: true,
choices: { source: "primes" },
// The Prime the starter's affiliation names, by id, from the same live list.
defaultValue: "{{ matchOrgPrime(currentUser.organizationName) }}",
}
primes to GET /api/prime-agents?size=200 (every PRIME_AGENT
organization with its open profile) on
the templates' own ontology endpoint (PROCESS_ONTOLOGY_ORIGIN with the engine's token
PROCESS_ONTOLOGY_TOKEN, a principal holding ontology:read), read through the same protected-HTTP driver,
credential and egress policy as a template's ontologyRequest, under the asking template's grants
(choiceSourceBindings in applications/main/src/composition/application-configuration.ts; the reader is
@processos/runtime/choice-sources). No copy of the list lives in the deployment or the code. The read follows
the API's pages and refuses a partial or malformed answer. A successful read is reused for 30 seconds, so a
Prime added in the ontology is offered within that time, with no deploy.{ id, name } (@processos/contracts/choice-ref): the entry's ontology id,
and its name as a snapshot taken when it was accepted. A write names the id (the form sends the id; a name sent
with it is ignored), and the server stores the live entry's name. The choice audit records the id and the name
(value, label).400 invalid-choice. A stored reference sent back unchanged (the same
id) keeps its snapshot, even once retired. Clearing is always allowed. Seeded values at start (initial values,
defaults) are checked the same way.503 choice-source-unavailable (other fields still save); a template with a source field does not start (503);
matchOrgPrime matches nothing. Nothing unchecked is ever stored, and there is no fallback list.GET /api/templates/:key/choice-sources/:source (any signed-in member of
the template's application; no-store), through useChoiceSources in @processos/browser-session/react; the
generic, spell-review and allocation-risk renderers all use it. The entries are also the expression scope's
choiceSources.<name>, in the browser and at start on the server.matchOrgPrime(value) returns the id of the one live Prime whose name occurs in value (case-insensitive),
or "" when none does, or when more than one does (an ambiguous affiliation names no Prime: the person chooses).primes: reviewsOwnSpells,
forumCategoryUrl, from prime_agent_profiles). They are served with the list, never stored on runs.
primeAttribute(s01._prime, "reviewsOwnSpells") reads the attribute of the live Prime the stored reference names
(null without the list): a rule about a kind of Prime, never a Prime named in the template.choiceRule: "source:<name>".
A change to the list is data: no version, no migration, nothing in the template.A dropdown's choices are part of its contract (see template versions).
changeField(step, field, existing). A shape records a
recipe by its digest (choiceRule: "recipe:<sha256>"), never by its output, so a frozen shape does
not depend on the day it was taken.existing: "keep" is accepted: a recipe is checked when a
value is written, so there is nothing to validate stored values against.changeField(step, field, { existing: "keep" }) and
resolveChoice(step, field, source): each stored name that is exactly one live entry's name becomes its
reference; a name the source does not hold once refuses the process, and the publication commits nothing until
a person adds or renames the entry in the source or corrects the run (template versions).
spell-request v19 and spell-prime-batch v5 did this for the Primes.primes, not a new mechanism.primes source for new runs; its existing runs stay on
the build they were started on, with the Prime's name as text (no lineage, so no migration moves them).spawnChild copies completed
intake history, not a new answer); no template with a recipe spawns children today.