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) │ │ │ (DotNetObjectReference both ways) │
│ ▼ │ │ ▼ │
│ wwwroot/js/monaco-init.js ──registers──► completion / hover / signatureHelp / │ │ wwwroot/js/monaco-init.js ──registers──► completion / hover / signatureHelp / │
│ │ diagnostics / format / inlayHints │ │ │ diagnostics / format │
│ │ fetch POST /api/script-analysis/* │ │ │ 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 │ │ ScriptAnalysis/ScriptAnalysisService.cs ── Roslyn over OtOpcUa's real wrapper │
│ ├─ ScriptSandbox.Build(typeof(VirtualTagContext)) (imports + refs) │ │ ├─ 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` `src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/wwwroot/js/monaco-init.js`
Exposes `window.MonacoBlazor` with `createEditor / setValue / getValue / Exposes `window.MonacoBlazor` with `createEditor / setValue / getValue /
setMarkers / setEditorOption / format / dispose`. Registers the six Monaco setMarkers / setEditorOption / format / dispose`. Registers the four Monaco
language providers for the `csharp` language at load time; each provider POSTs 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 to the corresponding `/api/script-analysis/*` endpoint. Diagnostics are
debounced (~500 ms) to avoid firing on every keystroke. 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 ## 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 `ScriptAnalysisEndpoints.MapScriptAnalysisEndpoints()` (called from
`EndpointRouteBuilderExtensions.AddAdminUI` / `Host/Program.cs`) and gated by `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 | | 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/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/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/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`. DTO definitions live in `ScriptAnalysis/ScriptAnalysisContracts.cs`.
@@ -494,30 +493,22 @@ site.
- **Tag-path completion shows resolvable keys only.** Surfacing the UNS browse - **Tag-path completion shows resolvable keys only.** Surfacing the UNS browse
path as a completion *detail* (a non-inserted hint shown alongside the path as a completion *detail* (a non-inserted hint shown alongside the
resolvable key) for discoverability is a tracked follow-up. → #759 resolvable key) for discoverability is an open, optional enhancement.
- **Literal gate matches by method name, not receiver.** `anything.GetTag("…")` - **Language providers register globally at Monaco load.** The four providers
would also trigger tag-path completion (not just `ctx.GetTag("…")`). Harmless (completion, hover, signature help, document formatting) are registered for the
in the sandbox today — no other `GetTag` methods exist in the allowed reference `csharp` language on the global Monaco instance (loaded once per page in
set — but tighter binding to `ctx` / `VirtualTagContext` is a follow-up. (Reconcile: → #759) `App.razor`). Only pages gated by the `ConfigEditor` policy host a
- **Analysis runs synchronous Roslyn (CPU-bound).** Each endpoint call builds a `MonacoEditor` today, but if a read-only surface ever embeds the editor the
`CSharpCompilation` synchronously. This is intentional: the endpoints are providers will fire (harmlessly: they get 401/403 responses from the gated
admin-only, client-side debounced (~500 ms), and `Task.Run` offload adds endpoints and return empty results).
unnecessary complexity for infrequent admin use. If concurrency becomes a
concern under heavy admin usage, wrapping each `Analyze` call in `Task.Run` is Items removed from this list because they shipped or were dropped: inlay hints
the correct fix. (Reconcile: → #759) (provider and `/inlay-hints` endpoint dropped in Lane D, #745); creating a new
- **InlayHints is a stub.** `/api/script-analysis/inlay-hints` returns an empty script from the VirtualTagModal inline panel (shipped, `CreateNewScriptAsync` in
list. Filling it in (parameter name hints from the semantic model) is a `VirtualTagModal.razor`); the method-name-only literal gate (fixed by the
follow-up task. (Dropped — reconcile: → #759) `ctx`-receiver guard, see [Literal gate](#literal-gate)); and the synchronous
- **Language providers register globally at Monaco load.** The six providers are Roslyn analysis (every analysis now derives from one process-wide base
registered for the `csharp` language on the global Monaco instance (loaded once compilation and honours the request `CancellationToken`).
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)
--- ---
+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 then attach it to the virtual tag); the entire lifecycle now lives on the
equipment page. 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 The `/hosts` page renders per-driver-instance health rows, grouped per cluster
page. This item (H7-runtime) is **F7-runtime-blocked**: the runtime plumbing under a "Driver instances · Cluster ..." heading (`Hosts.razor`), alongside the
needed to surface per-instance health rows is not yet in place. It remains on cluster-membership view.
the backlog. (Stale — reconcile: → #759)
## Bulk import ## Bulk import