diff --git a/conformance/semantics/unknown-image-id/case.json b/conformance/semantics/unknown-image-id/case.json new file mode 100644 index 0000000..11e0025 --- /dev/null +++ b/conformance/semantics/unknown-image-id/case.json @@ -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 }] + } +} diff --git a/conformance/semantics/unknown-image-id/source.medui b/conformance/semantics/unknown-image-id/source.medui new file mode 100644 index 0000000..c931099 --- /dev/null +++ b/conformance/semantics/unknown-image-id/source.medui @@ -0,0 +1,9 @@ +Screen UnknownImage { + layout: Vertical { spacing: 0px; padding: 0px; } + Image { + id: logo; + width: 64px; + height: 64px; + source: img("LOGO-MISSING"); + } +} diff --git a/conformance/semantics/unknown-template/case.json b/conformance/semantics/unknown-template/case.json new file mode 100644 index 0000000..2374a29 --- /dev/null +++ b/conformance/semantics/unknown-template/case.json @@ -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 }] + } +} diff --git a/conformance/semantics/unknown-template/source.medui b/conformance/semantics/unknown-template/source.medui new file mode 100644 index 0000000..85ad93d --- /dev/null +++ b/conformance/semantics/unknown-template/source.medui @@ -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; + } +} diff --git a/decisions/MEDUI-DEC-005-diagnostics-and-conformance.md b/decisions/MEDUI-DEC-005-diagnostics-and-conformance.md index f76eeba..d1295d7 100644 --- a/decisions/MEDUI-DEC-005-diagnostics-and-conformance.md +++ b/decisions/MEDUI-DEC-005-diagnostics-and-conformance.md @@ -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. diff --git a/schemas/case.schema.json b/schemas/case.schema.json index aa5bc46..85b124c 100644 --- a/schemas/case.schema.json +++ b/schemas/case.schema.json @@ -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": { diff --git a/spec/component-model.md b/spec/component-model.md index 8155812..202a640 100644 --- a/spec/component-model.md +++ b/spec/component-model.md @@ -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` @@ -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. diff --git a/spec/diagnostics.md b/spec/diagnostics.md index f3a4d7f..02d071f 100644 --- a/spec/diagnostics.md +++ b/spec/diagnostics.md @@ -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 |