All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Entries for unreleased work are not written here directly. Each issue drops a
fragment in changelog.d/; the fragments are assembled
into a version section at release. See that README for the format and for when a
change warrants an entry at all.
[0.9.0] 2026-11-26
A minor release that adds to the vocabulary. A screen may carry the display
types image, divider and link, an image and a link held to one URL
rule. A text question takes the date, time and datetime formats and the
style and step hints; a text takes a style hint, a choice question
takes chips as a style, a searchable hint and an option description;
any element may carry an accessible_label and an accessible_description;
and a question may carry checks, conditions its author writes, evaluated at
validation, a check the root does not decide reported in undecidable_checks.
The package also ships a strict authoring schema and per-type instruction
text, generated from the type registry by mix riddler.authoring. A document
that uses none of them resolves and validates as in 0.8.0, apart from the one
fix: a min or max that is not a number under the integer or number
format is now refused at admit. A document written for 0.8.0 that already
carried one of the new fields, which 0.8.0 dropped at admit, now has it read,
and refused where it is not in its shape.
Added
- The
imageelement type, in a document of eitherschema_version: a requiredsrcand a requiredalt, a template whose empty string marks the image decorative, and the optional hintssizeandfit, which a renderer reads. A screen that uses no image resolves and validates as before. - One URL rule for an image's
src: anhttps://URL naming a host, a host-relative URL beginning with a single/, or, written in the document itself, a base64data:image of typeimage/png,image/jpeg,image/giforimage/webpof at most 65,536 bytes. Any other scheme,http:,javascript:anddata:image/svg+xmlamong them, is refused, as is a URL carrying whitespace, a control character, template syntax, or, in anhttps://URL, a backslash; nothing is trimmed or rewritten. - A
srcbeginningcontext.is a path, read from the context when the image is shown; where it reaches nohttps://or host-relative URL, the image is left out of the resolved screen and the path, never the value, is reported inmissing_variables. - The refusals an image brings:
document.invalid_urlfor a literalsrcthe rule refuses,document.invalid_context_pathfor asrcbeginningcontext.that is not a path under it,document.invalid_hintfor asizeorfitthat is not a string,document.invalid_templatefor analtoutside the template subset, anddocument.missing_fieldfor an image withoutsrcoralt. - The presented-answer schema enumerates
image, requiring itskey,srcandaltas strings and typingsizeandfitas strings. An answer carrying an image still validates against an earlier release's schema, and a client built to it does not render the image. - The
date,timeanddatetimeformats on atext_question:dateisYYYY-MM-DD, a calendar date that exists;timeisHH:MMorHH:MM:SS, 24-hour;datetimeis a date and a time joined byT, thenZor an offset+HH:MMor-HH:MM, with no fraction of a second and no lower-casetorz. The response stays the string the visitor typed, read with the whitespace around it set aside; one that is not a string in the format's shape isresponse.format, and one beforeminor aftermaxisresponse.out_of_range, both bounds inclusive. AtimewrittenHH:MMis the same time asHH:MM:00, and twodatetimevalues are compared as the instants they name. - The refusal the date and time formats bring:
document.invalid_bound, itsfieldthe bound, for aminormaxon a date, time or datetime question that is not a string in the format's shape, and, itsfield"max", for aminafter itsmax. A bound under a format that reads none is still consulted by nothing and raises nothing. - The presented-answer schema enumerates
date,timeanddatetimeamong a text question's formats. An answer carrying one of them does not validate against an earlier release's schema; a screen that uses none of them validates against both. accessible_labelandaccessible_descriptionon every element, of every type, in a document of eitherschema_version: each optional and each a template in the subset.accessible_labelis the name an assistive technology gives the element where its visible text is not enough, andaccessible_descriptiona longer account it may read after the name. Each is rendered at resolve, a missing variable reported under the element's key, and the resolved and presented element carries each only where the document wrote it. Avariantcarries its winner's pair, not its own.- The refusals these fields bring:
document.invalid_templatefor an accessible field that is not a string or holds a construct outside the template subset, anddocument.secret_referencefor one that names a secret question's response. A document that uses neither field is admitted, validated, resolved and presented as before. - The screen document schema describes both fields on every element and types neither, so a value that is not a string is the finding above against an admitted document. The presented-answer schema types both as strings on every type it enumerates; an answer carrying either still validates against an earlier release's schema.
- A question may carry
checks, a list of conditions its author writes, each an object of a predicatorconditionovercontextandresponses, an author'scodein thecheck.namespace and a plain-stringmessage. Every question type takes it. Response validation evaluates a shown question's checks after its built-in checks, against the root an element's condition reads, so no check reads a secret question's response: the first check the root decides false raises one finding, itscodethe check's, itsfield"checks", itsauthor_messagethe check'smessage, and amessagethat quotes no response. A question a condition hid, a question the built-in checks already refuse, and a question whose response is nothing answered have none of their checks evaluated. - A check the root does not decide raises no finding and is reported in a third list of the diagnostics,
undecidable_checks, an entry of the question'skey, the check'scodeand itscondition, on whatresolve/2,resolve_screen/3andRiddler.Journey.present/3answer. The key is there only where it holds an entry, so a screen with no check, or none undecided, resolves and presents exactly as before. The presented-answer schema names it as an optional property, and no resolved or presented question carrieschecks. - The refusals checks bring:
document.invalid_check, itsfield"checks", forcheckson an element that is not a question,checksthat is not a list, an entry that is not an object or lacks acondition,codeormessage, acodeoutside thecheck.namespace (a code this package raises included), amessagethat is not a string or is empty, and acodeanother check on the same question already carries; anddocument.invalid_conditionanddocument.secret_reference, theirfield"checks", for a check's condition that is not a string, does not parse, or reads a secret question's response. - A host whose documents already carry a
checkskey, which riddler 0.8.0 dropped on every element: a well-formedcheckson a question is now enforced when a response is validated, and any otherchecksis now refused byRiddler.Screens.Document.validate/1. Remove acheckskey a document does not mean, or write it in the shape above. styleon atext_question, a hint a renderer owns:multiline, a field for more than one line of text, andsliderandstepper, read with theintegerandnumberformats, are the names offered. The hint stays open: any string is passed through to the renderer, and a renderer that draws no slider or stepper draws the field it would draw with nostyle.stepon atext_question, a hint for the increment a slider or a stepper moves by, read only with the numeric formats: withintegeran integer above zero, a number with no fractional part counting as one, and withnumbera number above zero. With any other format, or none, astepthat is a number is consulted by nothing, and one that is not a number is refused. Response validation does not read it: a response between the bounds is accepted whatever the step. The resolved and presented question carrystyleandstepwhere the document wrote them.- The refusals these fields bring:
document.invalid_stylefor a text question'sstylethat is not a string, anddocument.invalid_step, itsfield"step", for astepthat is not a number, whatever the format, and for one under theintegerornumberformat that is not a number above zero, or, underinteger, has a fractional part. A document that uses neither field is admitted, validated, resolved and presented as before. - The presented-answer schema types a text question's
styleas a string and itsstepas a number. An answer carrying either still validates against an earlier release's schema. chipsis offered as a name for a choice question'sstyle, for eitherselect. The hint stays open: any string is passed through to the renderer, as before.searchableon a choice question, a boolean hint, false when absent: true asks a renderer to let the visitor filter the options. It changes nothing a response is checked against. The resolved and presented question carry it where the document wrote it.descriptionon an authored option of a choice question, besidevalueandlabel: a template in the subset, a line a renderer shows under the option's label, rendered at resolve with a missing variable reported under the question's key. An option read from context byanswer_options_fromcarries its value and label only; adescriptionin the host's list is not read.- The refusals these fields bring:
document.invalid_hintfor asearchablethat is not a boolean;document.invalid_templatefor an optiondescriptionthat is not a string or holds a construct outside the template subset; anddocument.secret_referencefor an optiondescriptionthat names a secret question's response. A document that uses none of them is admitted, validated and resolved as before. - The presented-answer schema types a choice question's
searchableas a boolean and an option'sdescriptionas a string. An answer carrying either still validates against an earlier release's schema. - The
dividerelement type, in a document of eitherschema_version: a rule between the elements around it, carrying no field of its own; it resolves to itstypeandkey. - The
linkelement type, in a document of eitherschema_version: a requiredlabel, a template, a requiredhref, and an optionalstylehint,inlineandbuttonbeing the names offered. A link raises no outcome: anoutcome,writesorvalidateswritten on one is dropped at admit, and a presented screen never lists a link among itsoutcomes. - A link's
hrefis held to the image's URL rule with nodata:form: anhttps://URL naming a host or a host-relative URL beginning with a single/, and nothing else. Anhrefbeginningcontext.is a path, read from the context when the link is shown; where it reaches no such URL, the link is left out of the resolved screen and the path, never the value, is reported inmissing_variables. styleon atext, a hint a renderer owns:bodyandcaptionare the names offered, and a text with none isbody. A text with nostyleresolves with none.- The refusals a link, a divider and a text style bring:
document.invalid_urlfor a literalhrefthe rule refuses, adata:URL among them;document.invalid_context_pathfor anhrefbeginningcontext.that is not a path under it;document.invalid_stylefor a link's or a text'sstylethat is not a string;document.invalid_templatefor a link'slabeloutside the template subset; anddocument.missing_fieldfor a link withoutlabelorhref. A divider brings none of its own. A document that uses none of these types or fields is admitted, validated and resolved as before. - The presented-answer schema enumerates
dividerandlink, requiring a divider'skeyand a link'skey,labelandhrefas strings, and types a link's and a text'sstyleas strings. An answer carrying either type still validates against an earlier release's schema, and a client built to it does not render that element. - An authoring schema,
priv/authoring/screen-authoring.schema.json, that an authoring tool validates a screen document against while it is written: the element types are enumerated, each type takes exactly the fields the type registry names for it and the fields every element shares, and a field the runtime does not read is refused rather than dropped. A documentRiddler.Screens.Document.validate/1accepts, and carrying no field it drops, validates against it. The transport schema,priv/schemas/screen-document.schema.json, is unchanged, andtypestays an open string there. - Element instructions,
priv/authoring/screen-elements.md: a short plain text per element type, saying what the type is and the fields it requires and takes. Both files are generated from the type registry bymix riddler.authoring, ship in the package, and are never edited by hand;mix riddler.authoring --checkreports a committed copy that differs.
Changed
- A document written for 0.8.0 that already carried
accessible_labeloraccessible_descriptionhad it dropped at admit; it is now read, rendered, and refused as above where it is not a template. - A document written for 0.8.0 that already carried
styleorstepon a text question had it dropped at admit; it is now kept, and refused as above where it is not in its shape. - A 0.8.0 document whose authored options already carried a
descriptionhad it dropped at admit; it is now kept, rendered at resolve and presented, and refused asdocument.invalid_templatewhen it is not a string or holds a construct outside the template subset.
Fixed
- A
minormaxthat is not a number on a question whose format isintegerornumberis refused at admit asdocument.invalid_bound, itsfieldthe bound. riddler 0.8.0 admitted it and it bounded nothing, so a document carrying one, such as"min": "18"or"max": null, is now refused: write the bound as a number, or leave it out. A numericminabove itsmaxis admitted as before.
[0.8.0] 2026-11-24
A minor release that renames what riddler answers. The presented answer, the
resolved screen and every finding now spell elements and element_key where
0.7.0 spelled nodes and node_key, so a host reading nodes or node_key
must change. A screen document may declare schema_version 2, which spells the
children of a screen elements; a version 1 document is still admitted and
resolves to the same content under the new key. The upgrading page,
docs/upgrading/from-0-7-0.md, and mix riddler.upgrade are how a host moves.
Added
- A screen document may declare
schema_version2, which spells the children of a screen and of avariantelements; a version 1 document, or one declaring no version, still spells themnodesand is admitted, validated and resolved as before. document.other_version_spellingrefuses a screen or avariantcarrying the other version's key,nodesat version 2 orelementsat version 1, with one finding naming the key; nothing under that key is read, and nothing is rewritten at admit. At version 1 the refusedelementsmay hold any value, as 0.7.0 dropped it.mix riddler.upgrade PATHrewrites the screen document in one file from version 1 to version 2, in place:schema_versionbecomes2and thenodesof every screen and everyvariantbecomeselements, every other byte as written. A version 2 document is left as it is; a file that is not JSON, a documentadmit/1answersnilfor, a version 1 document already carrying anelementskey and a document of another version, and a file whose edited text would not decode to the documentupgrade/1answers, are refused with exit status 1, writing nothing.Riddler.Screens.upgrade/1makes the same rewrite on a decoded document, for a host's own migration, answering{:ok, document}or{:error, :not_a_document | :other_version_spelling | :unsupported_version}. Nothing at admit rewrites a document.
Changed
- The presented answer
Riddler.Journey.present/3returns carries a screen's children under"elements"where it carried"nodes", for a document of either version; a version 1 document presents the same content under the new key. Readscreen["elements"]where you readscreen["nodes"]. - The data form of a
Riddler.Findingcarries"element_key"where it carried"node_key", the same value by the same rule; a client readsfinding["element_key"]. - The conformance corpus states a resolved screen's children under
elementsand every finding's element underelement_key, for a document of either version; a runtime vendoring the corpus answers in the new spelling. priv/schemas/presented-answer.schema.jsonrequires a screen'selementswhere it requirednodes, and names its child definitionelementwhere it wasnode;priv/schemas/finding.schema.jsonrequireselement_keywhere it requirednode_key;priv/schemas/screen-document.schema.jsonnames its child definitionelementwhere it wasnode, adds the version 2 definitionelement_version_2, and still types a version 1 document'snodes. A host validating against these schemas takes the new ones.Riddler.Finding's fieldnode_keyiselement_key, the same value by the same rule; readfinding.element_keywhere you readfinding.node_key.- The admitted
Riddler.Screens.Documentand the resolvedRiddler.Screens.Resolvedcarry a screen's and avariant's children aselementswhere they carriednodes, for a document of either version; read or matchelements. Riddler.Screens.Type.node_t/0isRiddler.Screens.Type.element/0, andRiddler.Screens.Type.Variantnames its candidates:elementsinfields/0and"elements"in the field of its own findings when it is called directly (Riddler.Screens.Document.validate/1at version 1 still answers"nodes").- A version 1 document whose screen or
variantcarries anelementskey, which was dropped before, is refused withdocument.other_version_spelling: remove the key from the document, or write the document at version 2. - The screen document schema types
elementsbesidenodes, requires a screen to carry one of the two, and typeselementson a screen and an element only where a document is read fromelements, at version 2; a host validating documents against it before admitting them takes the new schema. - A document at a schema version this package does not implement, written in the
elementsform, is now admitted and refused withdocument.invalid_schema_version, where 0.7.0 answerednilfor it.
[0.7.0] 2026-11-23
A minor release for the contract between a host and the Journeys it runs.
Riddler.Journey.Scope is the scope a Journey runs under,
Riddler.Journey.Access the behaviour a host implements to say who may see
and step a Journey with the one pure check a renderer asks, and
Riddler.Journey.Host the behaviour for a host's own loop.
Riddler.Journey.present/3 carries a progress the host supplies on a
screen answer. Every change is an addition: a host that implements neither
behaviour and passes no progress sees every 0.6.0 answer unchanged.
Added
Riddler.Journey.Host, the behaviour for a host's own loop, so that a renderer drives any host through the same four callbacks:start/2answers{:ok, journey, answer},present/1answers{:ok, scope, answer}, andsubmit/2andback/2answer{:ok, answer}or{:error, findings}, each answer being whatRiddler.Journey.present/3answers, and every one of the four may answer{:error, :no_such_journey}, the refusalRiddler.Journey.Access.check/4gives; this package calls none of them and steps nothing, and a host that does not implement it sees every existing answer unchanged.Riddler.Journey.Access, the behaviour a host implements to say who may see and step a Journey -member?/2,scopes/1and an optionalallowed?/3per operation (:present,:submit,:back) - withcheck/4, the one pure check a renderer asks, answering:okor{:error, :no_such_journey}, the same refusal for a Journey that is not the actor's as for one that does not exist, andcheck_kind/2, answering:okwhen a scope's kind is the kind the host's Path record names, byte for byte, and{:error, :wrong_scope_kind}otherwise; a host that does not implement it sees every existing answer unchanged, and the conformance corpus's newjourney.checkandjourney.check_kindcapabilities state what both checks answer.Riddler.Journey.Scope, the scope a Journey runs under:new/2answers{:ok, %Scope{kind: kind, id: id}}for two strings of at least one byte and{:error, :invalid_scope}otherwise,to_data/1gives the data form a host keeps,%{"kind" => kind, "id" => id}, andfrom_data/1reads that form back, refusing anything else, a struct included; neither string is read for what it means, and the conformance corpus's newjourney.from_datacapability states what the data form and the values near it read back to.Riddler.Journey.present/3reads a"progress"screen option, a map of"step"and"of", each an integer of at least 1 with"step"not above"of", and carries it beside"moves"on the screen answer as%{"step" => n, "of" => m}; a malformed one answers{:error, :unknown_status}, and a host that passes no"progress"sees every answer unchanged. The presented answer schema admits the optionalprogressobject, and the conformance corpus'sjourney.presentcases state both.
[0.6.0] 2026-11-20
A minor release for the back request and for a button's outcome.
Riddler.Journey.decode_submit/1 decodes what a client sends when the
visitor goes back, {"screen" => key, "back" => true}, as its own shape,
where 0.5.0 answered it a finding, and the submit schema and the corpus
describe it. A document whose button carries an outcome that is not a
string, which 0.5.0 accepted, is now refused with
document.invalid_outcome.
Changed
Riddler.Journey.decode_submit/1decodes a back request, a map with no"outcome"whose"back"istrue, to{:ok, %{"screen" => key, "back" => true}}, dropping every other key it carries,"responses"included, where 0.5.0 answered it asubmit.missing_fieldfinding on"outcome"; a missing or non-string"screen"beside it is the onesubmit.missing_fieldorsubmit.invalid_fieldfinding. A map carrying"outcome"is a submit whatever its"back"holds, and a"back"that is nottrueleaves the map a submit, both decoded as in 0.5.0.priv/schemas/submit.schema.jsondescribes the back request beside the submit as a second shape,"screen"a string and"back"the constanttruewith no"outcome", and the conformance corpus'sjourney.decode_submitcases state what the back request and the shapes near it decode to.Riddler.Screens.Document.validate/1refuses a button whoseoutcomeis there and is not a string,nullincluded, with a newdocument.invalid_outcomefinding (itsfield"outcome", itsnode_keythe button's key), where 0.5.0 accepted the document; write each button'soutcomeas a string. A button with nooutcomeis stilldocument.missing_fieldonly, and the conformance corpus'sscreens.admitcases state the refusal.
[0.5.0] 2026-11-18
A minor release for the answer a client renders and posts back, for a secret
question, and for the fields a question carries. Riddler.Journey.present/3
admits a waiting reason and retry hint, a done result and screen opts, and
every screen answer lists its allowed moves;
Riddler.Journey.decode_submit/1 checks what a client sends back, and the
presented answer, the submit and a finding each have a JSON Schema exported
with the corpus. A secret_question is presented as held and never echoed,
and Riddler.Screens.seal_secrets/4 seals its response through the host's
sealer. A question carries value from a held response, a prefill or a
default, a help template and author messages, and a choice question may
read its options from context. A document that carries two buttons one
screen shows together with the same outcome, or a malformed default,
prefill, help, messages or answer_options_from that 0.4.0 dropped, is
now refused, and every finding carries author_message.
Added
- A
text_question,choice_question,boolean_questionorsecret_questiontakesmessages, an object mapping a finding code its type raises on a response to a plain string its author shows for it; the resolved and presented question carries it as written, andpriv/schemas/presented-answer.schema.jsontypes it as an optional object of strings on all four question types. Riddler.Findinggainsauthor_message, a string ornil:Riddler.Screens.validate_screen/3and/4set it on a finding raised on a question's response whose code that question'smessageskeys, and leavemessagethis package's own sentence. Every other finding carriesnil, and the finding's data form carries the key on every finding.priv/schemas/finding.schema.jsonnamesauthor_message, a string or null, as a required sixth key.- A resolved or presented
secret_questionnode carriesheld,truewhere the root holds the sealed form for it andfalseotherwise, and never the plaintext, the sealed string or avalue;Riddler.Screens.resolve/2,Riddler.Screens.resolve_screen/3andRiddler.Journey.present/3all answer it, andpriv/schemas/presented-answer.schema.jsonenumerates the type, requiringheldand refusingvalue. Riddler.Journey.present/3admits{:done, result}and answers the done state with"result"beside it, the host's map carried whole in the answer's data form; aresultthat is not a map, a struct included, answers{:error, :unknown_status}, and:doneanswers as before.- The conformance corpus's
journey.presentcases state what a done status with a result answers, its refusals included. Riddler.Journey.present/3admits{:screen, key, opts}, whereoptsis a string-keyed map whose"back", where present, is a boolean;{:screen, key, %{}}answers exactly what{:screen, key}answers, and anoptsthat is not a map, a struct included, or whose"back"is not a boolean answers{:error, :unknown_status}.- The conformance corpus's
journey.presentcases state what a screen status with opts answers, its refusals included, and itsscreens.admitcases state the new refusal of a repeated outcome and its variant exception. Riddler.Screens.seal_secrets/4takes a document, a screen key, the responses and the host's sealer, a function answering{:ok, string}or{:error, reason}, and replaces each plaintext response to the screen's secret questions with the sealed form{"sealed": string}, leaving every other response untouched; it refuses a wrong shape withresponse.invalid_shape, a plaintext to another screen's secret question withresponse.unsealed_secret, and a sealer answer that is not a sealed string withresponse.seal_failed, and no finding carries the plaintext or the sealer's reason.- The conformance corpus gains the capability
screens.seal_secrets, with its cases incorpus/screens/seal_secrets.jsonand the fixed test sealer every runtime supplies described in the corpus case schema. - A
text_question,choice_questionorboolean_questiontakeshelp, a line of guidance shown beside the question and a template likelabel:Riddler.Screens.resolve/2,Riddler.Screens.resolve_screen/3andRiddler.Journey.present/3render it, report a variable the root does not carry inmissing_variablesunder the question's key, andpriv/schemas/presented-answer.schema.jsontypes it as an optional string on all four question types. - A
choice_questiontakesanswer_options_from, a path undercontextsuch as"context.branches", in place ofanswer_options:Riddler.Screens.resolve/2,Riddler.Screens.resolve_screen/3andRiddler.Journey.present/3read the question's options from the root's"context"at that path, a list of objects each carrying a key-shaped"value"and a string"label", no value twice, and carry them asanswer_options, each its value and its label as the host gave them and not rendered as a template. A path that reaches no such list resolves the question with no options and is reported inmissing_variables, itsvariablethe path as written; an empty list is no options and is not reported. Riddler.Screens.validate_screen/3and/4check a response to such a question against the options the root's"context"holds when they are called, so a value the context no longer offers isresponse.not_an_option.Riddler.Screens.Document.validate/1refuses a choice question carrying bothanswer_optionsandanswer_options_fromasdocument.conflicting_options, ananswer_options_fromthat is not a dotted path of key-shaped segments undercontextasdocument.invalid_context_pathwithfield"answer_options_from", and anydefaulton a choice question that reads its options from context asdocument.invalid_default. A choice question carrying neither is stilldocument.missing_fieldonanswer_options.priv/schemas/presented-answer.schema.jsonrefusesanswer_options_fromon a presented choice question and describes itsanswer_optionsas either the document's options or the options read from context, possibly none.mix riddler.corpusexports the presented answer, submit and finding schemas beside the screen document and corpus case schemas, so a runtime in another language vendors every schema the corpus cases are written against.Riddler.Journey.decode_submit/1checks the shape of a submit a client sends back ("screen"and"outcome"strings,"responses"an object) and answers{:ok, submit}with exactly those three keys, or{:error, findings}codedsubmit.not_an_object,submit.missing_fieldorsubmit.invalid_field, one per defect; it never raises on a value a client can send.priv/schemas/submit.schema.jsonandpriv/schemas/finding.schema.json, JSON Schemas (draft 7) for the submit and for a finding as a host sends it to a client, every one of its keys present.- The conformance corpus gains the capability
journey.decode_submit, with its cases incorpus/journey/decode_submit.json. priv/schemas/presented-answer.schema.json, a JSON Schema (draft 7) for whatRiddler.Journey.present/3returns inside{:ok, ...}, so a client can check an answer and generate its node types from it: the three states, the screen with its nodes typed forheading,text,text_question,choice_question,boolean_question,secret_questionandbutton, andmoves,reason,retry_after_msandresultoptional on their states; a node of any other type still validates.Riddler.Journey.present/3admits{:waiting, info}and answers the waiting state with"reason"(a string) and"retry_after_ms"(a non-negative integer) beside it, each only whereinfocarries it; aninfothat is not a map, or carries either key with the wrong type, answers{:error, :unknown_status}.- The conformance corpus's
journey.presentcases state what a waiting status with info answers, its refusals included. - A
secret_questionnode type, for a response such as a PIN that is never echoed: it carrieskey,label,requiredand ahelptemplate, and a document giving it adefaultor aprefillis refused withdocument.secret_initial_value. - A document whose template, condition or button
writesreads a secret question's response is refused withdocument.secret_reference; a document carrying no secret question is admitted as before. - Resolution removes every secret question's response from the root a condition or a template reads, so a document no one validated renders the empty string for it and reports the condition as undecidable.
Riddler.Screens.validate_screen/3and/4check a secret question on the plaintext the visitor typed: nothing answered isresponse.requiredwhere it is required, the sealed form{"sealed": string}is a held value that satisfiesrequired, and any other shape isresponse.invalid_shape; no finding carries the response.
Changed
- Every finding now carries
author_message,nil(nullin its data form) when nothing sets it, so the data form of a finding has six keys where 0.4.0 gave five.priv/schemas/finding.schema.json, new in this release, requires all six, so a finding encoded by 0.4.0, which carries noauthor_message, does not validate against it; a client validating findings with this schema reads them from this release on. - A
messageson a question, which 0.4.0 admitted and dropped, is now kept, carried on the resolved and presented question, and checked:Riddler.Screens.Document.validate/1refuses one that is not an object, or holds a value that is not a string, asdocument.invalid_messages, and a key that is not a code the question's type raises on a response asdocument.unknown_message_code. Fix such a document by correcting the messages or removing them. - Every screen answer of
Riddler.Journey.present/3carries"moves"beside"screen":{"outcomes": [...], "back": boolean}, the outcome of each shown button in document order andbacktrue only where the host passed"back" => truein the screen opts. A client reads what it may submit from"moves"rather than from the nodes; the existingjourney.presentscreen cases in the corpus are restated with it, and the presented answer schema now requires it on a screen state. Riddler.Screens.Document.validate/1refuses a document in which two buttons that one screen can show together raise the sameoutcome, with the new findingdocument.duplicate_outcomeon the later button (field"outcome"); buttons in different candidates of one variant are never shown together and are not compared. A document that was accepted before and has two such buttons is now refused: give each button its own outcome, or put the buttons in different candidates of a variant.- A
helpon a text, choice or boolean question, which 0.4.0 admitted and dropped, is now kept and rendered, andRiddler.Screens.Document.validate/1refuses one that is not a string or holds a construct outside the template subset asdocument.invalid_template. Fix such a document by correcting the help or removing it. - An
answer_options_fromon a choice question, which 0.4.0 admitted and dropped, is now read. A question carrying it and noanswer_options, which 0.4.0 refused asdocument.missing_field, is now admitted and takes its options from context. A question carrying both, which 0.4.0 resolved from itsanswer_options, is now refused asdocument.conflicting_options: remove one of the two. A question whoseanswer_options_fromis not a path undercontext, or that carries one and adefault, is now refused: correct the path, or remove the default. - A resolved or presented
text_question,choice_questionorboolean_questionnode carriesvalue: the response the root holds for it, as written, else the value its newprefillpath reads fromcontext, else its newdefault, each of those two only where it is of the question's response shape (and, on a choice question, among its options); a node none of them yields one for carries novalue, and a resolved node never carriesdefaultorprefill. A host that resolves a screen whose root already holds responses now sees them asvalueonRiddler.Screens.resolve/2,Riddler.Screens.resolve_screen/3andRiddler.Journey.present/3.valueis not a response:validate_screen/3,4still reads only the responses the root holds. - A
defaultorprefillon a text, choice or boolean question, which 0.4.0 admitted and dropped, is now read, andRiddler.Screens.Document.validate/1refuses one that is malformed:document.invalid_defaultfor a default not of the question's response shape or naming a value none of its options carries,document.invalid_context_pathfor a prefill that is not a dotted path of key-shaped segments undercontext. Fix such a document by correcting the field or removing it.
[0.4.0] 2026-10-20
A minor release for questions that ask a visitor to choose, for presenting a
Journey as data, and for the template subset's refusals. A screen document may
carry choice_question and boolean_question nodes, and
Riddler.Screens.validate_screen/3 and /4 check a response to either.
Riddler.Journey presents the status a host passes as a screen, waiting or
done, and replaces a root's context whole. The template subset reports the
refusals a tag the parser does not know used to hide, refuses a misplaced
keyword as itself, and refuses a tag carrying text it throws away. A
schema_version written as 1.0 reads as version 1, a metadata written as
null is not a document, and the response.undecidable message says what the
evaluator answered.
Added
- A screen document may carry a
choice_questionnode, which asks a visitor to pick one option or several (selectof"one"or"many") fromanswer_options, each option avaluein the key shape and alabeltemplate, with an optionalstylehint,required, andmin_selectionsandmax_selectionsunder"many"; a document using it was refuseddocument.unknown_typebefore, and no document admitted before changes its answer. - A screen document may carry a
boolean_questionnode, a lone checkbox or toggle with alabeltemplate and an optionalrequired; a document using it was refuseddocument.unknown_typebefore. Riddler.Screens.Document.validate/1refuses a choice question's defects with five new codes, each naming the question's key:document.invalid_select,document.empty_answer_options,document.invalid_option,document.duplicate_option_valueanddocument.invalid_selection_bounds; an option label outside the template subset isdocument.invalid_template, anddocument.invalid_stylenow covers a choice question'sstyle; thedocument.unknown_typemessage, which lists the types this version knows, now also nameschoice_questionandboolean_question.Riddler.Screens.Document.admit/1and the document schema refuse a choice question whoseanswer_optionsis not a list of objects with stringvalueandlabelfields, as for every field the schema types; on any other nodeanswer_optionsis still dropped whatever it holds.Riddler.Screens.resolve/2andresolve_screen/3render each choice question option'slabelagainst the root, reporting a missing variable under the question's key, and leave eachvalueas written; a selection bound written with no fractional part is admitted and resolved as its integer.Riddler.Screens.validate_screen/3andvalidate_screen/4check a response to achoice_questionand aboolean_questionwhatever the question declares, with at most one finding per question naming its key: nothing selected on a required question isresponse.required, a response not of the shape the type fixes (one string underselect: "one", a list of different strings under"many",trueorfalsefor a boolean question) is the newresponse.invalid_shape, a required boolean question answeredfalseisresponse.required, a value no option carries is the newresponse.not_an_option, and under"many"a count outsidemin_selectionsormax_selectionsisresponse.out_of_range; aformaton either type is never applied to its response, and no answer for any other node type changes.Riddler.Journey.present/3presents the status a host passes -{:screen, key},:waitingor:done- as a string-keyed map whose"state"is"screen","waiting"or"done", a screen carrying its resolved nodes and diagnostics, andRiddler.Journey.put_context/2replaces a root's"context"whole with the responses untouched; the corpus holds both asjourney.presentandjourney.put_context.
Changed
Riddler.Screens.Document.admit/1reads aschema_versionwritten with no fractional part as its integer, sovalidate/1accepts a document declaring1.0where it refused it withdocument.invalid_schema_version, andRiddler.Screens.resolve/2carries1onto the resolved document; aschema_versionwith a fractional part is still not a document.Riddler.Template.compile/1reports every refusal the parser used to hide when a template holds a tag the parser does not know: a branch or closing keyword written where no block of its own is open is refused as itself beside every other refusal, the closing tag of a block the author opened is no longer refused (outside the parts of a block the parser throws away, such as what stands before acasetag's firstwhen), a tag such asincludeno longer hides a refused tag, filter or liquid tag beside it, and a liquid tag holding such a tag now reports the liquid tag and the tags inside it where it reported a parse error, so a host that matched on the old findings should match on the new list.- A template whose tag carries text after its name that the tag does not read (a string on an
endif, a word on anelse,endunless,endfor,endcaptureorendraw, a note on acommentopener or anendcomment) is refused withtemplate.trailing_text_not_allowednaming that tag, where it compiled before; delete the text, or move a note into the comment's body. - The
messageof aresponse.undecidablefinding for a condition that compiles now says what the evaluator answered: a name the root does not carry, a value that is not true or false, or a condition that fails to evaluate; where the answer does not tell a missing key from an operand of the wrong type it says only that the condition could not be decided. Thecode,field,node_keyandpositionare unchanged, so a host that matches on the code reads what it read before; a host that matched the old sentence "could not be decided against the root this screen was validated with" matches the code instead.
Fixed
Riddler.Screens.Document.admit/1answersnilfor a document whosemetadatais written asnull, as it does for any other value that is not an object, because the document schema typesmetadataas an object; a document that leavesmetadataout is admitted exactly as before. A host that wrote"metadata": nullwrites an object, or leavesmetadataout.
[0.3.1] 2026-10-05
A documentation release. The code and the behavior of the package are the
same as in 0.3.0; what changes is what a reader finds on hexdocs, on hex.pm and
in the README. Documentation takes no changelog.d fragment, so this section
is written by hand.
Added
- An explanation page, "What Riddler is for: elements, templates and
conditions", at
docs/explanation/what-riddler-is-for.md. It is published on hexdocs and ships in the package, because the README links it by a relative path.
Changed
- The hexdocs sidebar groups pages by the kind of page they are. The README and this changelog stay ungrouped at the top, and the explanation page sits under Explanation.
- The decision records under
docs/adr/are no longer published as hexdocs pages. They are a record for contributors, and the README links them on GitHub. - The README is rewritten as an introduction: what the package is, why it exists, installation, one worked example, and a Documentation section that maps the pages under Learn, Do, Look up and Understand.
[0.3.0] 2026-09-19
The conformance release after 0.2.0, and the first tag a runtime written in
another language can vendor the conformance corpus from. The corpus capability
screens.validate_responses is screens.validate_screen, and
mix riddler.corpus no longer reads RIDDLER_SPEC_PATH or defaults to
../riddler_spec: it refuses to run without --to. The template subset
refuses {% liquid %} wherever the parser reads one; 0.2.0 admitted it in some
spellings after a raw or comment marker, a conformance gap: a template this
runtime admitted in a spelling a runtime implementing the subset need not
accept. Riddler.Screens.Document.admit/1 answers nil for field values and a
nodes the published document schema already refused, and the
document.invalid_condition and response.undecidable findings carry a source
position in position where there is one.
Added
- The conformance corpus states that a refused tag inside an
ifblock is the one finding, and that the closing tag ending the block is not refused; this package already answered that way. - The conformance corpus states that a
whenoperand the root does not carry is reported in both render modes: lenient mode renders the branch that holds and names the operand, and strict mode returns it as an error; this package already answered that way.
Changed
- Breaking: the conformance corpus capability
screens.validate_responsesis nowscreens.validate_screen, and its cases moved fromcorpus/screens/validate_responses.jsontocorpus/screens/validate_screen.json. The capability was named for a function this package removed; it now names the one it calls. Nothing else about the cases changed and every case answers what it answered before. A runtime held to this corpus should dispatch on the new string and read the renamed file: the old string is an unknown capability, not an alias. - The
document.invalid_conditionfinding carries the source position its own message names, inposition, for a condition the parser refused and located. A condition that never reached the parser - one that is not a string - still carries none, and its sentence still names none. The code, field, node key and message are unchanged, so a host switching on any of them needs no edit; a host readingpositionto point an author at the condition no longer has to parse that sentence for the line and the column. - The
response.undecidablefinding now says which of three things left the condition undecided - the root could not decide it, it is not valid predicator, or it is not a string - and carries the source position the compiler or the evaluator gave for it inpositionand in the message, where there is one. The code, field and node key are unchanged, so a host switching on the code needs no edit; a host asserting on the message text reads a new sentence.
Removed
mix riddler.corpusno longer reads theRIDDLER_SPEC_PATHenvironment variable. Pass the export directory as--to PATHinstead.mix riddler.corpusno longer defaults to../riddler_spec, and it refuses to run without--to,--checkincluded. Pass--to PATHnaming the directory to export into, or the directory holding the copy to compare.
Fixed
- The characters of an excluded tag written as a bracket subscript, as in
{{ responses["{% liquid %}"] }}, render as text instead of being refused, matching what the same characters in an ordinary string literal already did. - A tag or filter outside the template subset written inside an
elsifbody or acasebranch body is refused, where it compiled before. - A variable guarded by
defaultinside anelsifbody or acasebranch body is missing in neither render mode, as it already was everywhere else. Riddler.Screens.Document.admit/1answersnilfor a document whoseid,kind, screenkeyortitle, or nodekey,typeorconditionis there and is not a string,nullincluded, or whoseschema_versionis there and is not an integer. The published document schema already refused every one of them; 0.2.0 admitted them. Write each of those fields as a string, andschema_versionas an integer, or leave it out.document.invalid_idanddocument.invalid_titleare no longer raised: the only values that raised them are not a document.- A finding
Riddler.Screens.validate_screen/3and/4raise carries anode_keythat is a string ornil, as document validation's already did; a node keyed with anything else put that raw value on the finding before, which a host indexing findings by that field cannot look a node up by. Give every node a stringkey, whichRiddler.Screens.Document.validate/1already asks for asdocument.invalid_key. {% liquid %}, which the template subset excludes as an alternate spelling for tags it already admits, is refused where a template printed the characters of araworcommentblock's markers around it - from a string literal or from a bracket subscript - and so hid it from the check.Riddler.Screens.Document.admit/1answersnilfor a document carrying anodesthat is not a list of nodes on a node whose type reads none - every type butvariant, and a type the package does not know. The published document schema already refused it; 0.2.0 admitted it and said nothing. Remove thatnodes, or write it as a list of nodes, which is admitted and ignored.- Response validation reports a screen's findings where a button carrying no
key declared
validatesasfalseand the call named no pressed button; it answered:okwith every finding silenced before. Give every button in the document akey, whichRiddler.Screens.Document.validate/1already asks for asdocument.invalid_key. {% liquid %}, which the template subset excludes as an alternate spelling for tags it already admits, is refused wherever the parser reads one. In 0.2.0 a liquid tag holding only admitted tags compiled after araworcommentmarker written in a string that anendif,else,endfor,commentorendcommenttag discards, after a comment whose opener carried trailing text, or after araworcommentblock whose closer carried trailing text. That was a conformance gap: a template this runtime admitted in a spelling a runtime implementing the subset need not accept.- The characters of a liquid tag inside a
raworcommentblock are text where the block's opener or closer carries trailing text, as they are everywhere else inside such a block; 0.2.0 refused the template.
[0.2.0] 2026-09-18
The residue wave after the first release. Riddler.Screens.validate_responses/3
and /4 give way to Riddler.Screens.validate_screen/3 and /4, which validate
against the same root the host resolved the screen with, and
Riddler.Screens.resolve_screen/3 answers its diagnostics alongside the screen.
A condition the root cannot decide is a finding rather than a silent pass, and a
button that declares it validates nothing is unaffected. A pattern the format
cannot compile is refused against the document before a visitor arrives, the
document schema is emitted as schemas/screen-document.schema.json and the
schemas ship in the package, and the emitted corpus header names no version, so
an emitted corpus is byte-identical across releases. A finding carries the
position in the source it refused, and a template the parser refuses without
saying where answers a finding rather than raising.
Added
- A finding carries
:position, the%{line: line, column: column}in the source it refused, so an editor can point at a refused template construct without parsing the message. A template refusal sets it, and adocument.invalid_templatefinding carries the position of the template refusal it wraps; every other finding leaves itnil. The message goes on naming the position in its own words wherever there is one. Riddler.Screens.validate_screen/3and/4validate against the root the host resolved with, so a required question acontextcondition showed the visitor is one the visitor can fail, where the removed pair resolved against an emptycontextand let the blank through.- The JSON schemas ship in the package, so a host that validates a document
against one at runtime can read it from
Application.app_dir(:riddler, "priv/schemas")instead of vendoring a copy.
Changed
- Breaking:
Riddler.Screens.resolve_screen/3answers{:ok, screen, diagnostics}where it answered{:ok, screen}; match on the three-element tuple and readmissing_variablesandundecidable_conditionsfromdiagnostics, which is the shaperesolve/2already carries on a resolved document, narrowed to the one screen. A caller that only wants the screen matches{:ok, screen, _diagnostics}.{:error, :no_such_screen}is unchanged, and so is every other function in the module. - Breaking:
Riddler.Screens.validate_screen/3and/4answer{:error, [%Riddler.Finding{code: "response.undecidable"}]}where they answered:okfor a screen carrying a condition the root could not decide; the finding names the node innode_keyand"condition"infield. A button declaringvalidatesasfalseis unaffected and still answers:okwithout running a check. Carry in the root everycontextandresponseskey the document's conditions read, giving a key the visitor has not answered yet its blank value rather than leaving it out, or change the condition to one that decides against a root without it. - A question that asks for the
patternformat and declares apatternthat format cannot compile is now a finding against the document,document.invalid_patternfromRiddler.Screens.Document.validate/1, raised before a visitor arrives. Response validation no longer reports it: the defect is in the document, and nothing a visitor could type would satisfy such a pattern. This is breaking for a host that matched the oldresponse.formatfinding with the fieldpatternon submission for such a question - readdocument.invalid_patternfrom document validation instead, and correct the expression in that question. Apatternon a question that asks for another format, or for none, is unchanged: it is a field nothing consults, and it carries no finding at either layer whatever it says. A question naming thepatternformat and declaring no pattern at all is unchanged too and still answersresponse.formatwith the fieldpattern, under new wording that names the missing pattern rather than calling it unusable. - The document schema is emitted as
schemas/screen-document.schema.json; point a consumer that reads the schema by its old path at the new one. - The
generated_byheadermix riddler.corpuswrites into each emitted case file names the source file and no version, so an emitted corpus is byte-identical across releases; re-emit once to pick up the new header, and point anything that parsed a version out of that string at the request that carried the emit instead. Riddler.Screens.Document.validate/1reports the envelope and boolean shapes the screen document record states, each only where the document carries the field:document.invalid_schema_versionfor aschema_versionother than 1,document.invalid_idfor anidthat is not a string,document.invalid_titlefor a screentitlethat is not a string,document.invalid_requiredfor a question'srequiredthat is not a boolean, anddocument.invalid_validatesanddocument.invalid_stylefor a button'svalidatesthat is not a boolean andstylethat is not a string. A document that carried one of these off-shape validated clean before and now carries a finding; correct the field in the document, or omit it, since an absent field is unchanged and still raises nothing.
Removed
- Breaking:
Riddler.Screens.validate_responses/3and/4are gone; callRiddler.Screens.validate_screen/3or/4with the same root you resolved the screen with, moving the responses map you used to pass into that root under"responses".
Fixed
- A variable used only in the condition of an
unlessis no longer reported as missing, in either render mode, which is what anifcondition already did. Riddler.Template.compile/1andRiddler.Screens.Document.validate/1answer findings rather than raising for a template the parser refuses without saying where, such as{% render %}or{% assign e %}; the finding carries thetemplate.parse_errorcode, no position, and a message that names no place.Riddler.Screens.Document.validate/1tells an author that a node or screen key is not a string instead of telling them there is no key: a key of the wrong form keepsdocument.invalid_keyand now carries a message naming the key that was written, distinct from the message for a key that is absent. A host matching on the message rather than on the code sees the new wording.- A finding's
node_keyis always a string ornil, asRiddler.Finding's typespec has always said. A node whose key was not a string used to put that key on every other finding about the node; those findings now carrynil, the same as a node that declares no key at all, and the key is named in the message. A host indexing findings bynode_keyno longer has to expect a value it cannot look a node up by. - A template that prints the characters of a
{% liquid %}opener from a string literal compiles and renders them, instead of being refused as though it held the tag.
[0.1.0] 2026-09-14
The first release. Riddler is a dynamic content runtime: a host authors content as JSON documents - screens now; emails, images and feature flags forthcoming - and Riddler resolves each against a visitor's context, while the host renders, sends or serves what comes back. A document is admitted and validated on its own, resolved against a host's context and a visitor's responses into the nodes that visitor is shown, its templates compiled and rendered against the subset, and the responses it collects validated against the screen they were shown. The conformance corpus is authored here and emitted into riddler_spec so a second implementation runs the same cases.
Added
Riddler.Template.compile/1accepts a template only when every tag and filter in it is inside the template subset, reporting oneRiddler.Findingper refused construct rather than the first.Riddler.Template.render/3renders a compiled template as text in lenient or strict mode, returning the paths that were missing in lenient and an error carrying them in strict.- A screen document is admitted from decoded JSON and validated on its own, with every reason it is refused reported at once: unknown node types, duplicate or misshapen keys, missing fields, heading levels out of range, conditions that do not parse, templates outside the subset, malformed writes, unknown formats, and variants that are empty or bury a default.
- A visitor's responses are validated against the screen they were shown:
required, theemail,phone,pattern,integerandnumberformats, andminandmaxon the numeric ones, with a question a condition hid unable to fail and a button declaringvalidatesfalse able to submit without any check at all. A question may now carrypattern,minandmaxbeside itsformat. - A screen document resolves against a host's context and a visitor's responses into the nodes that visitor is shown, with hidden nodes absent, every container collapsed to its winner, every template rendered, and what could not be decided reported rather than refused.
mix riddler.corpusemits the conformance corpus and the JSON schemas into a riddler_spec checkout, byte-stable and with agenerated_byheader naming the version and the source file, refusing to emit a corpus this implementation does not satisfy;--checkreports drift instead of writing.- A document's envelope carries
kind, the content kind it belongs to. It is an optional string and it defaults toscreens, so a document that names none is a screen document; the decided kind is carried through to the resolved document, and a kind this package has no runtime for is adocument.unknown_kindfinding naming the value.
Changed
- The screens kind is named after the kind rather than after the nodes inside
a screen:
Riddler.Elementsand everything under it is nowRiddler.Screens, and the corpus capabilitieselements.admit,elements.resolveandelements.validate_responsesare nowscreens.admit,screens.resolveandscreens.validate_responses, emitted fromcorpus/screens/. NoRiddler.Elementsname and noelements.*capability survives this release.templates.renderis unchanged.