2.0.0-rc.26
Pre-releaseRelease candidate 26 for 2.0.0. Delta since 2.0.0-rc.25 — see that release for the 2.0 story.
This RC closes the last of the riddlg/ossum.tech/riddl-examples reports and finishes the diagnostic-rule work. Both corpora migrated against a staged binary before the tag, so it ships green.
Type-checking reaches every value position — and literals finally have a type
put, return and require … with are type-checked now. They appeared to be already: they compared types, but only when BOTH sides resolved to a NAMED type, and valueType yields None for a predefined one — so exactly the case a generator trips over was skipped in silence. The named comparison is kept where it applies, since RIDDL treats a declared alias as a distinct name rather than a transparent synonym, and the new check runs only where the named one could not, so the two cannot double-report.
The reason this had been easy to miss: a literal had no type at all. Every check built on valueTypeExpr passed silently on the string and boolean literals whose types are most obvious. A check that cannot see a literal is not a lenient check, it is an absent one — and it presents as leniency.
It immediately exposed a defect it had been masking. A comment inside a record made the record incompatible with itself: the arity comparison built its list from the other side's VALUES and compared against all its CONTENTS, which includes comments. One comment anywhere made the counts disagree, and the message printed both sides character-for-character identical, because format renders the comment as part of the type. Unactionable as well as wrong. Reported by riddl-generator with a 24-line repro, and the root cause was exactly where they pointed.
A written type prefix must be true — and is never demanded
The two halves are separate decisions rather than a compromise.
- Never demanded. A field's type admits only a type, so a prefix there disambiguates nothing; demanding it would have cost 542 sites in reactive-bbq alone for nothing a reader gains.
- True when written.
TypeRef's rule holds even for a bare reference, because the positions it covers — a portlet's type, a function'srequires/returns— admit several KINDS, and the prefix is precisely what tells them apart.
Keyed off what the target was declared as, never off what the reference carries: an alternation declared type XEvent is one of { … } genuinely is a type even though every member is an event.
UI modality and container checks
Three rulings from ossum.tech's report, decided on the vocabulary as evidence rather than on any corpus count.
- A presentation verb that contradicts its output's kind —
haptic Buzz shows …— is a StyleWarning. It reads wrongly, but a model saying it is not self-contradictory, and RIDDL does not invalidate a model over how it reads. - A menu with no choice and a popup nothing can open are CompletenessWarnings. A choice is any input or a nested group — a submenu is a choice, and the obvious phrasing ("selectable inputs") would have flagged most real menus.
- The compound-output consistency warning was DECLINED. Mixing modalities in one output is the normal case, not a defect: a notification that is visual, audible and haptic at once is one output by design.
The verb→modality map is deliberately partial. presents and emits admit everything; diffuses, serve, offer and taste have no output modality to check against. A verb absent from the map contradicts nothing — a partial map that is silent where it does not know beats a total one that invents an answer.
Diagnostics
- Every path into an Accumulator now requires a rule id. The eight
addXhelpers already did; the five lowercase ones did not and went straight toadd(Message(...)). riddl-examples put it best: "mandatory to PASS is not the same as mandatory to BE." - A rule may carry a COMPUTED fix.
mechanicalFixwas anOption[String]— a constant — so a fix whose replacement depends on what it matched could not be expressed.quoted-constant-literal(constant N: Integer = "5"→5) is a pure span replacement that was excluded purely for want of a way to say so. riddlc find's unknown-typeis now an error rather than a silent empty result.
dump --json
Statements carry their value operand. A set-statement record named its target and refused to say what was assigned to it — half the fact, and the half a consumer asking what a model DOES needs most. Nine statement kinds gained their operands, including require's condition and its with argument, foreach's element and collection, and match's subject.
Other
numDoStatementsreplacesnumPromptStatements, which remains as a deprecated derived accessor — not a second field, because two fields describing one count can disagree.- The Scala.js logger override is gone; it had been returning a fresh logger, which broke
withLoggerand zeroed the message counters on JS.
Feedback wanted
Whether the new put/return/require type errors are actionable in your models, and whether the UI modality StyleWarning fires anywhere it should not. Install with brew install ossuminc/tap/riddlc-rc.