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
13 changes: 13 additions & 0 deletions conformance/semantics/safety-critical-already-required/case.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"id": "MEDUI-CASE-SEMANTICS-SAFETY-CRITICAL-ALREADY-REQUIRED",
"phase": "semantics",
"source": "source.medui",
"inputs": {
"themeTokens": ["Theme.Colors.CriticalAction"],
"textPackages": [{ "locale": "en-US", "keys": ["STR-HALT"] }]
},
"expected": {
"valid": false,
"diagnostics": [{ "code": "MEDUI-E012", "line": 4, "column": 5 }]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Screen SafetyCriticalAlreadyRequired {
layout: Vertical { spacing: 0px; padding: 0px; }
@safety_critical(cv_check: [Bounds])
CriticalButton {
id: halt;
width: 200px;
height: 80px;
label: t("STR-HALT");
color: Theme.Colors.CriticalAction;
on_press: TriggerHalt;
}
}
7 changes: 5 additions & 2 deletions decisions/MEDUI-DEC-004-safety-and-goldens.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

Status: Accepted

An `@safety_critical` node requires an explicit requirement identifier. A positioned node receives
an automatic `Bounds` golden. When both rules apply, the compiler emits one merged entry with
An `@safety_critical` node requires an explicit requirement identifier: the annotation promotes
`requirement` to required regardless of the component's own field list, and its absence is
`MEDUI-E070`. A component that already requires `requirement` and omits it reports the ordinary
`MEDUI-E012` instead, so the two codes never overlap. A positioned node receives an automatic
`Bounds` golden. When both rules apply, the compiler emits one merged entry with
deduplicated checks. Dynamic content pins bounds and applicable color, not its changing value.

These mechanisms provide reviewable engineering evidence; they do not by themselves establish
Expand Down
13 changes: 13 additions & 0 deletions spec/component-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,18 @@ checks (`MEDUI-E071`), members outside a closed set (`MEDUI-E034`), and unknown
identifiers (`MEDUI-E035`) fail compilation. An unknown `charset` or screen `layout` kind is also
fatal and has no code assigned yet.

## Safety annotations

`@safety_critical(cv_check: [...])` marks a node for rendered-truth evidence (MEDUI-DEC-004). The
annotation **promotes `requirement` to required** on the node it annotates, whatever that
component's own row says: a `Button` or `TextInput`, where `requirement` is otherwise optional,
must carry one once annotated, and its absence reports `MEDUI-E070`.

`MEDUI-E070` is only ever the promotion failure. A component whose own row already requires
`requirement` — `CriticalButton`, `NumericDisplay`, `StatusIndicator` — that omits it reports the
ordinary `MEDUI-E012` (missing required field), annotated or not; the annotation adds no obligation
it did not already have. So the two codes never both apply to the same node: `MEDUI-E070` is reachable
only where the schema made `requirement` optional and the annotation made it required.

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.
Loading