fix(editor): #1025 analyse scripted-alarm predicates as bool Run(AlarmPredicateContext) — predicate mode on the analysis endpoints, Monaco and the ScriptEdit page
This commit is contained in:
+10
-2
@@ -190,8 +190,16 @@ the runtime would refuse rejects the deploy with `ScriptCompileFailed`, naming t
|
||||
script, the seam it was compiled for and the entities using it — so an error the
|
||||
editor showed can no longer be deployed silently. Two differences from the editor
|
||||
to know: the gate compiles each script **as the seam that uses it** (a predicate
|
||||
must return `bool`; the editor analyses every script as a VirtualTag body), and it
|
||||
only checks scripts something enabled uses. See `docs/VirtualTags.md`
|
||||
must return `bool`), and it only checks scripts something enabled uses. The editor
|
||||
matches the gate's seam since #1025: the analysis endpoints take an optional `mode`
|
||||
(`value` default | `alarmPredicate`), the editor wraps the source as
|
||||
`bool Run(ScriptGlobals<AlarmPredicateContext>)` in predicate mode, and the ScriptEdit
|
||||
page has an **Analyse as** selector that defaults to *predicate* when scripted alarms
|
||||
are the script's only users (a script also used as a VirtualTag/Calculation defaults to
|
||||
value; pick whichever seam you are authoring for). The per-equipment VirtualTag and
|
||||
Calculation editors are always value mode. Known remaining gap: a body that lacks a
|
||||
`return` on some path (CS0161) is not flagged while you type (a deliberate
|
||||
no-phantom-marker rule) but is refused at deploy. See `docs/VirtualTags.md`
|
||||
§"Deploy-time script compile gate" for modes, caching and the upgrade note.
|
||||
|
||||
### Runtime safety (what happens after publish)
|
||||
|
||||
Reference in New Issue
Block a user