docs: reconcile stale deferrals in ScriptEditor.md and Uns.md (lmxopcua#759)

Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
This commit is contained in:
Joseph Doherty
2026-11-09 12:27:52 -05:00
parent acfb4fbaca
commit 8ddf737a2a
2 changed files with 26 additions and 36 deletions
+22 -31
View File
@@ -43,10 +43,10 @@ The replacement:
│ │ (DotNetObjectReference both ways) │
│ ▼ │
│ wwwroot/js/monaco-init.js ──registers──► completion / hover / signatureHelp / │
│ │ diagnostics / format / inlayHints │
│ │ diagnostics / format │
│ │ fetch POST /api/script-analysis/* │
│ ▼ │
│ ScriptAnalysis/ScriptAnalysisEndpoints.cs (minimal-API group, FleetAdmin) │
│ ScriptAnalysis/ScriptAnalysisEndpoints.cs (minimal-API group, ConfigEditor) │
│ ▼ │
│ ScriptAnalysis/ScriptAnalysisService.cs ── Roslyn over OtOpcUa's real wrapper │
│ ├─ ScriptSandbox.Build(typeof(VirtualTagContext)) (imports + refs) │
@@ -88,8 +88,8 @@ External `Value` changes are pushed to the editor via `window.MonacoBlazor.setVa
`src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/wwwroot/js/monaco-init.js`
Exposes `window.MonacoBlazor` with `createEditor / setValue / getValue /
setMarkers / setEditorOption / format / dispose`. Registers the six Monaco
language providers for the `csharp` language at load time; each provider POSTs
setMarkers / setEditorOption / format / dispose`. Registers the four Monaco
language providers (completion, hover, signature help, document formatting) for the `csharp` language at load time; each provider POSTs
to the corresponding `/api/script-analysis/*` endpoint. Diagnostics are
debounced (~500 ms) to avoid firing on every keystroke.
@@ -114,10 +114,10 @@ The analysis seam is the private `Analyze(userSource)` method, which:
## HTTP Endpoints
All six endpoints live under the `/api/script-analysis` group, registered by
All five endpoints live under the `/api/script-analysis` group, registered by
`ScriptAnalysisEndpoints.MapScriptAnalysisEndpoints()` (called from
`EndpointRouteBuilderExtensions.AddAdminUI` / `Host/Program.cs`) and gated by
the `FleetAdmin` authorization policy (requires the `Administrator` role).
the `ConfigEditor` authorization policy (`AdminUiPolicies.ConfigEditor`: Administrator or Designer).
| Route | Request DTO | Response DTO | Purpose |
|-------|-------------|--------------|---------|
@@ -126,7 +126,6 @@ the `FleetAdmin` authorization policy (requires the `Administrator` role).
| `POST /api/script-analysis/hover` | `HoverRequest(CodeText, Line, Column)` | `HoverResponse(Markdown?)` | Type + XML doc markdown |
| `POST /api/script-analysis/signature-help` | `SignatureHelpRequest(CodeText, Line, Column)` | `SignatureHelpResponse(Label?, Parameters?, ActiveParameter)` | Parameter help |
| `POST /api/script-analysis/format` | `FormatRequest(Code)` | `FormatResponse(Code)` | `NormalizeWhitespace()` formatting |
| `POST /api/script-analysis/inlay-hints` | `InlayHintsRequest(Code)` | `InlayHintsResponse(Hints)` | Inline type hints (stub — returns empty) |
DTO definitions live in `ScriptAnalysis/ScriptAnalysisContracts.cs`.
@@ -494,30 +493,22 @@ site.
- **Tag-path completion shows resolvable keys only.** Surfacing the UNS browse
path as a completion *detail* (a non-inserted hint shown alongside the
resolvable key) for discoverability is a tracked follow-up. → #759
- **Literal gate matches by method name, not receiver.** `anything.GetTag("…")`
would also trigger tag-path completion (not just `ctx.GetTag("…")`). Harmless
in the sandbox today — no other `GetTag` methods exist in the allowed reference
set — but tighter binding to `ctx` / `VirtualTagContext` is a follow-up. (Reconcile: → #759)
- **Analysis runs synchronous Roslyn (CPU-bound).** Each endpoint call builds a
`CSharpCompilation` synchronously. This is intentional: the endpoints are
admin-only, client-side debounced (~500 ms), and `Task.Run` offload adds
unnecessary complexity for infrequent admin use. If concurrency becomes a
concern under heavy admin usage, wrapping each `Analyze` call in `Task.Run` is
the correct fix. (Reconcile: → #759)
- **InlayHints is a stub.** `/api/script-analysis/inlay-hints` returns an empty
list. Filling it in (parameter name hints from the semantic model) is a
follow-up task. (Dropped — reconcile: → #759)
- **Language providers register globally at Monaco load.** The six providers are
registered for the `csharp` language on the global Monaco instance (loaded once
per page in `App.razor`). There is no impact today because only
`Administrator`-reachable pages host a `MonacoEditor`, but if a read-only
surface ever embeds the editor the providers will fire (harmlessly — they just
get 401 responses from the `FleetAdmin`-gated endpoints and return empty
results).
- **Creating a new script from the VirtualTagModal inline panel** is deferred.
The current inline panel loads and saves an existing `Script` row; creating a
brand-new script requires a separate create flow and is a follow-up. (Shipped — reconcile: → #759)
resolvable key) for discoverability is an open, optional enhancement.
- **Language providers register globally at Monaco load.** The four providers
(completion, hover, signature help, document formatting) are registered for the
`csharp` language on the global Monaco instance (loaded once per page in
`App.razor`). Only pages gated by the `ConfigEditor` policy host a
`MonacoEditor` today, but if a read-only surface ever embeds the editor the
providers will fire (harmlessly: they get 401/403 responses from the gated
endpoints and return empty results).
Items removed from this list because they shipped or were dropped: inlay hints
(provider and `/inlay-hints` endpoint dropped in Lane D, #745); creating a new
script from the VirtualTagModal inline panel (shipped, `CreateNewScriptAsync` in
`VirtualTagModal.razor`); the method-name-only literal gate (fixed by the
`ctx`-receiver guard, see [Literal gate](#literal-gate)); and the synchronous
Roslyn analysis (every analysis now derives from one process-wide base
compilation and honours the request `CancellationToken`).
---
+4 -5
View File
@@ -526,12 +526,11 @@ This removes the previous two-step flow (create a script on a separate page,
then attach it to the virtual tag); the entire lifecycle now lives on the
equipment page.
## Hosts page per-driver-instance rows (deferred)
## Hosts page per-driver-instance rows
Phase 6 did **not** implement per-driver-instance status rows on the Hosts
page. This item (H7-runtime) is **F7-runtime-blocked**: the runtime plumbing
needed to surface per-instance health rows is not yet in place. It remains on
the backlog. (Stale — reconcile: → #759)
The `/hosts` page renders per-driver-instance health rows, grouped per cluster
under a "Driver instances · Cluster ..." heading (`Hosts.razor`), alongside the
cluster-membership view.
## Bulk import