Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions conformance/semantics/unknown-image-id/case.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"id": "MEDUI-CASE-SEMANTICS-UNKNOWN-IMAGE-ID",
"phase": "semantics",
"source": "source.medui",
"inputs": { "imageIds": ["LOGO-PRIMARY"] },
"expected": {
"valid": false,
"diagnostics": [{ "code": "MEDUI-E035", "line": 7, "column": 17 }]
}
}
9 changes: 9 additions & 0 deletions conformance/semantics/unknown-image-id/source.medui
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Screen UnknownImage {
layout: Vertical { spacing: 0px; padding: 0px; }
Image {
id: logo;
width: 64px;
height: 64px;
source: img("LOGO-MISSING");
}
}
13 changes: 13 additions & 0 deletions conformance/semantics/unknown-template/case.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"id": "MEDUI-CASE-SEMANTICS-UNKNOWN-TEMPLATE",
"phase": "semantics",
"source": "source.medui",
"inputs": {
"themeTokens": ["Theme.Colors.Digits"],
"templates": ["TPL-SEDATION-INDEX-160"]
},
"expected": {
"valid": false,
"diagnostics": [{ "code": "MEDUI-E035", "line": 8, "column": 19 }]
}
}
12 changes: 12 additions & 0 deletions conformance/semantics/unknown-template/source.medui
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Screen UnknownTemplate {
layout: Vertical { spacing: 0px; padding: 0px; }
NumericDisplay {
id: score;
width: 128px;
height: 64px;
requirement: "REQ-UT-001";
template: "TPL-MISSING";
source: "SCORE";
color: Theme.Colors.Digits;
}
}
9 changes: 5 additions & 4 deletions decisions/MEDUI-DEC-005-diagnostics-and-conformance.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ checked rather than tolerated, so gaining precision is a manifest change and nev
A phase claimed at reduced precision is still claimed.

Semantic cases may provide implementation-neutral `inputs`: `themeTokens` is the complete set of
known colour-token names, and each `textPackages` entry is the complete key view for one approved
locale. An omitted collection is empty. Tokens, locale names, and keys are non-empty and unique;
locale order has no semantic meaning. These logical views deliberately do not prescribe an
implementation's package, file, or runtime representation.
known colour-token names, `imageIds` and `templates` are the complete sets of baked image and
display-template identifiers, and each `textPackages` entry is the complete key view for one
approved locale. An omitted collection is empty. Tokens, identifiers, locale names, and keys are
non-empty and unique; locale order has no semantic meaning. These logical views deliberately do not
prescribe an implementation's package, file, or runtime representation.
10 changes: 10 additions & 0 deletions schemas/case.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@
"uniqueItems": true,
"items": { "type": "string", "minLength": 1 }
},
"imageIds": {
"type": "array",
"uniqueItems": true,
"items": { "type": "string", "minLength": 1 }
},
"templates": {
"type": "array",
"uniqueItems": true,
"items": { "type": "string", "minLength": 1 }
},
"textPackages": {
"type": "array",
"items": {
Expand Down
23 changes: 16 additions & 7 deletions spec/component-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,19 @@ Closing `on_press` is what keeps a critical control honest: a screen that can na
can name one the host does not implement, and the press of a critical button is the worst place to
discover it.

`charset` stays open and is **not** covered by `MEDUI-E034`. It names a baked character set rather
than a member of a fixed vocabulary, so what resolves it is the implementation's own packages rather
than this contract. An unresolved `charset` fails compilation and has no code assigned; giving it
one would require the case schema to carry charset-package inputs, so that a case could state which
sets exist before asserting that one does not.
## Resource identifiers

`img("ID")` names a baked image and `template` names a baked display template. Neither is a member
of a closed set — the identifiers a screen may use are whichever ones the product baked — so an
identifier that does not resolve reports `MEDUI-E035` (unknown resource identifier), with the kind
named in the message. A semantic case declares the resolvable identifiers with the `imageIds` and
`templates` `inputs` collections, the same way `themeTokens` declares the known colour tokens.

`charset` also names an implementation resource rather than a member of a fixed vocabulary, but it
stays **outside** `MEDUI-E035`: an unresolved `charset` fails compilation with no code assigned,
because a case cannot yet declare which character sets exist. An unknown screen `layout` kind is
likewise fatal and unassigned; whether it is a closed named value (`Vertical`, `Horizontal`) or a
grammar production is still open.

Node IDs are unique after synthetic row-background nodes are included. `position` requires fixed
dimensions and removes the node from flow; a positioned node whose `width` or `height` is `Fill`
Expand All @@ -76,8 +84,9 @@ containing box and must not overlap other non-background nodes. Images render at
dimensions. Text keys must
exist for every approved locale, and every static or bounded-dynamic text value must fit its box in
the worst approved case. Unknown theme tokens (`MEDUI-E030`), text keys (`MEDUI-E031`), CV
checks (`MEDUI-E071`), and members outside a closed set (`MEDUI-E034`) fail compilation. Unknown
image IDs, templates and charsets also fail compilation and have no code assigned yet.
checks (`MEDUI-E071`), members outside a closed set (`MEDUI-E034`), and unknown image or template
identifiers (`MEDUI-E035`) fail compilation. An unknown `charset` or screen `layout` kind is also
fatal and has no code assigned yet.

Compiled output is a flat, locale-free sequence of nodes with absolute rectangles and a finite
draw budget. Implementation-specific output fields beyond these shared semantics are permitted.
1 change: 1 addition & 0 deletions spec/diagnostics.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ fails at every precision.
| `MEDUI-E032` | semantics | text key missing for an approved locale |
| `MEDUI-E033` | semantics | field value has the wrong semantic kind |
| `MEDUI-E034` | semantics | named value outside its closed set |
| `MEDUI-E035` | semantics | unknown resource identifier |
| `MEDUI-E050` | layout | text budget exceeded |
| `MEDUI-E051` | layout | layout overflow |
| `MEDUI-E052` | layout | surface exceeded |
Expand Down
Loading