From fb843de1ce41158d0c81f72022fb41c7977a3627 Mon Sep 17 00:00:00 2001 From: Nick Beckley Date: Sat, 21 Nov 2026 16:49:37 +0000 Subject: [PATCH] Record SignalR Development qualification and .44 Windows handover --- .../20261121T164237Z-signalr-atlas/README.md | 33 +++++ .../development-smoke.cs.txt | 44 ++++++ .../development.json | 38 +++++ .../qualification.json | 39 +++++ ...mpanion-SignalR-Architecture-Assessment.md | 34 +++++ ...Word-Companion-SignalR-Windows-Handover.md | 135 ++++++++++++++++++ ...iter-Phase3B4-Navigation-Latency-Report.md | 17 ++- 7 files changed, 339 insertions(+), 1 deletion(-) create mode 100644 Docs/Writer/Evidence/Phase3B4/20261121T164237Z-signalr-atlas/README.md create mode 100644 Docs/Writer/Evidence/Phase3B4/20261121T164237Z-signalr-atlas/development-smoke.cs.txt create mode 100644 Docs/Writer/Evidence/Phase3B4/20261121T164237Z-signalr-atlas/development.json create mode 100644 Docs/Writer/Evidence/Phase3B4/20261121T164237Z-signalr-atlas/qualification.json create mode 100644 Docs/Writer/Word-Companion-SignalR-Windows-Handover.md diff --git a/Docs/Writer/Evidence/Phase3B4/20261121T164237Z-signalr-atlas/README.md b/Docs/Writer/Evidence/Phase3B4/20261121T164237Z-signalr-atlas/README.md new file mode 100644 index 00000000..d5ffb06e --- /dev/null +++ b/Docs/Writer/Evidence/Phase3B4/20261121T164237Z-signalr-atlas/README.md @@ -0,0 +1,33 @@ +# Atlas SignalR qualification — 21 November 2026 + +Implementation source `964ec5e9f798b60a283ad2c7415ef6a3c0e030f1`; shared branch `codex/word-companion-native-phase1-20261104`. All recorded gates exited zero. This evidence is Linux/server/portable-native/browser-fixture qualification only; Windows .44 packaging/install, installed PWA, real Word navigation and performance remain unqualified. + +## Reproduction and scope + +From repository root, run serially: + +```bash +dotnet build PlotLine.slnx -m:1 -nr:false -p:UseSharedCompilation=false +dotnet run --no-build --project PlotDirector.NativeCompanion/Tests/PlotDirector.Companion.Tests.csproj +dotnet run --no-build --project PlotDirector.NativeCompanion/Tests/PlotDirector.Companion.Tests.csproj -- --chapter-sync +dotnet run --no-build --project PlotLine.Tests/PlotLine.Tests.csproj -- --native-signalr +dotnet run --no-build --project PlotLine.Tests/PlotLine.Tests.csproj +``` + +`qualification.json` records counts; full application PASS lines include nested HTTP/SignalR checks, not 683 independent top-level gates. Foundation includes portable R1 observation fixtures. SignalR integration uses real Kestrel/native authentication/HTTP Presence and standard .NET client, with repository test doubles and synthetic messages, no live DB. Raw native hub connections exercise real WebSockets. Actual CloudGateway test uses standard SignalR LongPolling to exercise its supported transport fallback, not a custom notification endpoint. Agent timing assertions prove scheduler behavior under the fixture, not Word performance. + +Browser: use the existing `dotnet run --no-build --project PlotLine.Tests/PlotLine.Tests.csproj -- --toolbar-browser-host` in a separate terminal (fixture default port5238), `npm ci` in `PlotLine.Tests/Browser`, then `node .cjs` there, serially. Keep TLS verification enabled for package/browser download. Use the already available Playwright browser or approved vendor install procedure; do not change machine security/settings. Run suites corresponding to retained `browser-*.log`: writer-word-notifications, writer-phase21-word, writer3-word, writer-word-selection, writer-phase3b1-review, writer-phase21-review, focus-synchronisation, manuscript-reader, reader-word-freshness, writing-context-follow-recovery, word-destination-badges, writer3-navigation. Stop only the test host normally after completion. Actual scripts/Razor run in Chromium; native events/receipt content and PWA display mode are simulated. Shared fixture Focus setup is explicit in the amended suites. No physical Word/installed PWA inference. + +## Development deployment + +`development.json` records current release/version/matching DLL/JS SHA256, service and local/public GET status. `active-work.log` shows all eight queued/processing sources zero immediately before the approved restart. Publish was Release from the pushed source commit using the documented Development-only backup/rsync procedure; existing settings, keys and uploads preserved. No migration, schema, stored procedure or configuration change. Immediate local GET initially preceded startup readiness; subsequent local/public checks were200 without another restart. + +Journal inspection through the authenticated smoke/cleanup found no failure/critical category and two known framework warning categories: local HTTPS-port discovery (1), antiforgery response cache headers (1). Raw journal excluded to avoid unnecessary personal/request information. Production and installed .43 untouched. Release and `current-before` directory preserved as named in the attestation. + +## Authenticated public smoke and cleanup + +`dev-identity.log`, `dev-smoke.log`, `dev-cleanup.log` record the normal verified disposable-account flow. Existing guarded `DevBrowserIdentity` verified effective database PlotDirector_Development and created a unique COPY_ONLY/CHECKSUM backup with nonempty-file verification before provisioning. No migration or real account/manuscript modification. Cleanup used normal login/CSRF/HardDeleteAccount and confirmed absent repository lookup; private0600 credentials file removed. No test project/book/canonical snapshot was created. Native installation was revoked by its owner before deletion. Transport-only presence used BookId0 and no content. + +`development-smoke.cs.txt` is the exact safe helper source used outside the repository, supplied for review rather than installed as application code. It compiled as a net10.0 console project with Microsoft.AspNetCore.App framework and a ProjectReference to the existing Agent project. Input is exclusively a private identity file from the guarded helper, never checked into Git. It logs no password/token/PKCE code. It uses normal TLS, browser login, PKCE approval/redemption, public browser/native WebSocket hubs, actual production CloudGateway default client (no factory injection), renewal into a new process, browser invalidation and owner revocation. It prints only PASS labels / failure exception type. This is not an unattended instruction to create or delete other users or reset native pairing. No live navigation is claimed from a BookId0 transport check; exact queue/adapter/receipt behavior is covered by the disposable loopback/native/browser fixtures. + +All committed logs contain synthetic fixture identifiers/check labels or sanitized deployment metadata. Private identity, environment/configuration, raw HTTP responses, access tokens, browser state, protected native state and private manuscript material are excluded. diff --git a/Docs/Writer/Evidence/Phase3B4/20261121T164237Z-signalr-atlas/development-smoke.cs.txt b/Docs/Writer/Evidence/Phase3B4/20261121T164237Z-signalr-atlas/development-smoke.cs.txt new file mode 100644 index 00000000..b0c3bf71 --- /dev/null +++ b/Docs/Writer/Evidence/Phase3B4/20261121T164237Z-signalr-atlas/development-smoke.cs.txt @@ -0,0 +1,44 @@ +using System.Net; +using System.Net.Http.Json; +using System.Security.Cryptography; +using System.Text; +using System.Text.Json; +using System.Text.RegularExpressions; +using Microsoft.AspNetCore.SignalR.Client; +using Microsoft.AspNetCore.Http.Connections; +using PlotDirector.Companion.Agent; +using PlotDirector.Companion.Protocol; + +try{await Run(args.Single());}catch(Exception e){Console.Error.WriteLine("FAIL Development SignalR verification: "+e.GetType().Name);Environment.ExitCode=1;} +static void Check(bool ok,string message){if(!ok)throw new InvalidOperationException(message);Console.WriteLine("PASS Development "+message);} +static string Token(string html){var match=Regex.Match(html,"]*\\bname=\"__RequestVerificationToken\")[^>]*\\bvalue=\"([^\"]+)\"");return match.Success?WebUtility.HtmlDecode(match.Groups[1].Value):throw new InvalidOperationException("Antiforgery missing");} +static async Task Until(Func predicate,int seconds=20){using var timeout=new CancellationTokenSource(TimeSpan.FromSeconds(seconds));while(!predicate())await Task.Delay(50,timeout.Token);} +static async Task Run(string path) +{ + using var file=JsonDocument.Parse(await File.ReadAllTextAsync(path));var who=file.RootElement;var email=who.GetProperty("Email").GetString()!; + if(who.GetProperty("Database").GetString()!="PlotDirector_Development"||!email.StartsWith("pwa-browser-")||!email.EndsWith("@example.invalid"))throw new InvalidOperationException("Dedicated Development identity required"); + const string site="https://dev.plotdirector.com/";var cookies=new CookieContainer();using var browser=new HttpClient(new HttpClientHandler{CookieContainer=cookies,AllowAutoRedirect=false}){BaseAddress=new Uri(site)}; + var login=await browser.GetStringAsync("Account/Login");using var signedIn=await browser.PostAsync("Account/Login",new FormUrlEncodedContent(new Dictionary{{"Email",email},{"Password",who.GetProperty("Password").GetString()!},{"__RequestVerificationToken",Token(login)}}));Check(signedIn.StatusCode==HttpStatusCode.Found&&signedIn.Headers.Location?.OriginalString=="/Projects","normal isolated-account login"); + using var native=new HttpClient(new HttpClientHandler{AllowAutoRedirect=false,UseCookies=false}){BaseAddress=new Uri(site)}; + var runtime=Guid.NewGuid();var verifier=Convert.ToHexString(RandomNumberGenerator.GetBytes(32));var challenge=Convert.ToHexString(SHA256.HashData(Encoding.UTF8.GetBytes(verifier))); + using var start=await native.PostAsJsonAsync("api/native-companion/pair",new{challenge,persistent=true,connectionId=runtime,deviceName="Disposable Atlas SignalR qualification"});start.EnsureSuccessStatusCode();using var startData=JsonDocument.Parse(await start.Content.ReadAsStringAsync());var code=startData.RootElement.GetProperty("code").GetString()!; + var approval=await browser.GetStringAsync("native-companion/authorize?code="+Uri.EscapeDataString(code));var csrf=Token(approval); + using var approved=await browser.PostAsync("native-companion/authorize",new FormUrlEncodedContent(new Dictionary{{"code",code},{"__RequestVerificationToken",csrf}}));approved.EnsureSuccessStatusCode(); + using var redeemed=await native.PostAsJsonAsync("api/native-companion/token",new{code,verifier});redeemed.EnsureSuccessStatusCode();using var tokens=JsonDocument.Parse(await redeemed.Content.ReadAsStringAsync());var data=tokens.RootElement;var installation=data.GetProperty("installationId").GetGuid();var access=data.GetProperty("accessToken").GetString()!; + Check(installation!=Guid.Empty,"normal PKCE browser approval and persistent installation redemption"); + await using var web=new HubConnectionBuilder().WithUrl(site+"hubs/native-companion",o=>{o.Cookies=cookies;o.Transports=HttpTransportType.WebSockets;}).Build();var invalidation=new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);web.On("NativePresenceChanged",value=>{if(value.GetProperty("bookId").GetInt32()==0)invalidation.TrySetResult();});await web.StartAsync();Check(web.State==HubConnectionState.Connected,"existing cookie browser SignalR hub over public TLS/WebSockets"); + await using var raw=new HubConnectionBuilder().WithUrl(site+"hubs/native-companion-agent",o=>{o.AccessTokenProvider=()=>Task.FromResult(access);o.Transports=HttpTransportType.WebSockets;}).Build();await raw.StartAsync();Check(raw.State==HubConnectionState.Connected,"new native bearer SignalR hub over public TLS/WebSockets"); + var memory=new MemoryState(new(){Server=site,AccountId=who.GetProperty("UserID").GetInt32(),Active=new(){Site=site,AccountId=who.GetProperty("UserID").GetInt32(),AccountName="Disposable qualification",InstallationId=installation,Credential=data.GetProperty("deviceSecret").GetString()!,RefreshExpiresUtc=data.GetProperty("refreshExpiresUtc").GetDateTimeOffset()}}); + using var cloud=new CloudGateway(browser:_=>throw new InvalidOperationException("Unexpected approval restart"),stateStore:memory);using var stop=new CancellationTokenSource();var loop=cloud.RunConnectionLoop(stop.Token);var notifications=cloud.RunCommandNotifications(stop.Token); + try{ + await Until(()=>cloud.NotificationState=="Connected"&&cloud.Status().Health?.State=="Connected");await Until(()=>raw.State==HubConnectionState.Disconnected); + Check(true,"actual agent default client renews into new process identity and connects; old process hub closes"); + var context=cloud.Status().AuthenticationContext;var instance=Guid.NewGuid();var session=Guid.NewGuid();var reply=await cloud.Presence(instance,session,new(){WordAvailable=false,WordRunning=false,BookId=0,Revision=0,Sequence=1,DocumentTitle="Disposable connection qualification"},context); + await invalidation.Task.WaitAsync(TimeSpan.FromSeconds(10));Check(reply.Navigation==null,"authenticated transport-only Presence triggers existing browser invalidation without manuscript or command"); + using var revoked=await browser.PostAsync($"native-companion/installations/{installation:D}/revoke",new FormUrlEncodedContent(new Dictionary{{"__RequestVerificationToken",csrf}}));Check(revoked.StatusCode==HttpStatusCode.Found,"owner-authenticated installation revocation"); + await Until(()=>cloud.NotificationState!="Connected");var rejected=false;try{await cloud.Get("api/native-companion/connection",context);}catch(InvalidOperationException){rejected=true;}Check(rejected,"revocation closes native hub and rejects its current HTTP authority"); + }finally{stop.Cancel();await notifications;await loop;await cloud.StopAsync();} + await web.StopAsync();Console.WriteLine("PASS Development SignalR verification complete; no book, accepted snapshot, Word or manuscript content created/modified."); +} +sealed class MemoryState(CompanionState value):ICompanionStateStore +{private CompanionState current=value;public CompanionState Load()=>JsonSerializer.Deserialize(JsonSerializer.Serialize(current))!;public void Save(CompanionState state)=>current=JsonSerializer.Deserialize(JsonSerializer.Serialize(state))!;} diff --git a/Docs/Writer/Evidence/Phase3B4/20261121T164237Z-signalr-atlas/development.json b/Docs/Writer/Evidence/Phase3B4/20261121T164237Z-signalr-atlas/development.json new file mode 100644 index 00000000..9186b057 --- /dev/null +++ b/Docs/Writer/Evidence/Phase3B4/20261121T164237Z-signalr-atlas/development.json @@ -0,0 +1,38 @@ +{ + "environment": "Development only", + "url": "https://dev.plotdirector.com/", + "deploymentStartedUtc": "2026-11-21T16:43:02Z", + "release": "964ec5e9-20261121T164301Z", + "version": "1.0.0+964ec5e9f798b60a283ad2c7415ef6a3c0e030f1", + "service": "active", + "localGet": 200, + "publicTlsGet": 200, + "initialImmediateGet": "connection refused before startup completed; subsequent GET passed, no second restart", + "files": { + "PlotLine.dll": { + "publishedSha256": "e218ead1311eb13cd8327745c55d90123fd9880a45d56b3fdff9992def3ddfc3", + "deployedSha256": "e218ead1311eb13cd8327745c55d90123fd9880a45d56b3fdff9992def3ddfc3", + "matches": true + }, + "wwwroot/js/writer-word.js": { + "publishedSha256": "26bc2424e0a495285be5fee8ba955165fa47730e16603d46564624c48b9e6d57", + "deployedSha256": "26bc2424e0a495285be5fee8ba955165fa47730e16603d46564624c48b9e6d57", + "matches": true + }, + "wwwroot/js/native-companion-status.js": { + "publishedSha256": "7bee0ca6ceee59f663c95f2d1280b58db3c90d810816c8eb0269a5ab734b45b8", + "deployedSha256": "7bee0ca6ceee59f663c95f2d1280b58db3c90d810816c8eb0269a5ab734b45b8", + "matches": true + } + }, + "warningErrorCategoryCounts": { + "warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware": 1, + "warn: Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery": 1 + }, + "databaseMigration": "none required or applied", + "configurationChange": "none", + "fixture": "one isolated verified account and native installation; no book/manuscript/accepted snapshot", + "cleanup": "normal owner account deletion completed, repository lookup absent, private credential file removed", + "production": "untouched", + "installedWindows43": "untouched" +} diff --git a/Docs/Writer/Evidence/Phase3B4/20261121T164237Z-signalr-atlas/qualification.json b/Docs/Writer/Evidence/Phase3B4/20261121T164237Z-signalr-atlas/qualification.json new file mode 100644 index 00000000..23904cc3 --- /dev/null +++ b/Docs/Writer/Evidence/Phase3B4/20261121T164237Z-signalr-atlas/qualification.json @@ -0,0 +1,39 @@ +{ + "scope": "Atlas automated qualification; not physical Windows, Word, installed PWA or physical performance", + "sourceCommit": "964ec5e9f798b60a283ad2c7415ef6a3c0e030f1", + "nativeSourceVersion": "1.0.0.44", + "installedWindowsVersion": "1.0.0.43 (unchanged on Atlas)", + "signalRClientVersion": "10.0.15", + "build": { + "exitCode": 0, + "warnings": 0, + "errors": 0 + }, + "checks": { + "nativeFoundation": 309, + "chapterSync": 453, + "focusedSignalR": 47, + "focusedIntegrationPassLinesIncludingOuterChecks": 49, + "fullApplicationPassLinesIncludingNestedIntegration": 683 + }, + "allCommandsExitCode": 0, + "browserSuites": [ + "browser-writing-context-follow-recovery.log", + "browser-writer-phase3b1-review.log", + "browser-focus-synchronisation.log", + "browser-reader-word-freshness.log", + "browser-writer-word-selection.log", + "browser-writer3-navigation.log", + "browser-manuscript-reader.log", + "browser-word-destination-badges.log", + "browser-notifications.log", + "browser-writer-phase21-word.log", + "browser-writer3-word.log", + "browser-writer-phase21-review.log" + ], + "limitations": [ + "Native adapter and browser/PWA fixtures simulated; no physical Word", + "Standard SignalR real WebSockets and built-in LongPolling tested; no bespoke command long-poll", + "Physical .44 package/sign/install and latency remain Windows gates" + ] +} diff --git a/Docs/Writer/Word-Companion-SignalR-Architecture-Assessment.md b/Docs/Writer/Word-Companion-SignalR-Architecture-Assessment.md index a651db5a..f30c1dcb 100644 --- a/Docs/Writer/Word-Companion-SignalR-Architecture-Assessment.md +++ b/Docs/Writer/Word-Companion-SignalR-Architecture-Assessment.md @@ -1,5 +1,39 @@ # Word Companion: SignalR architecture assessment + +## Implemented checkpoint — 21 November 2026, approved Option C + +User approval supersedes the investigation-only restriction below. Implementation **`964ec5e9f798b60a283ad2c7415ef6a3c0e030f1`** is qualified on Atlas and deployed to **Development only**. Native source is **1.0.0.44**; installed Windows **1.0.0.43 remains untouched**. No .44 Windows installer exists from this work. [Windows execution handover](Word-Companion-SignalR-Windows-Handover.md) supplies packaging and physical acceptance steps without another architecture audit. + +### Final implementation + +- Browser `native-companion-status.js` forwards the existing `NativePresenceChanged` hint immediately, before its general-status debounce. Writer installs a pending listener before POST, checks the receipt immediately after acceptance, coalesces hints/in-flight work, and retains one-second fallback and the existing bounded timeout. Completion requires the authoritative receipt with exact navigation, instance, session, manuscript and revision matching. A notification or 202 cannot complete navigation. Disposal/selection loss removes pending listeners and timers. +- Agent-only `CloudGateway.Notifications.cs` uses **Microsoft.AspNetCore.SignalR.Client 10.0.15**, one connection loop per process, native Bearer headers, existing access/refresh/protected state and approved HTTPS origin. HTTP/negotiation redirects off that authority/path are refused, cookies disabled, normal TLS validation retained. SignalR is not referenced by VSTO/COM. Automatic reconnect (0/2/10/30 seconds), bounded initial/exhausted backoff (up to 30 seconds plus jitter), connection/token-generation replacement and immediate reconciliation on connect/reconnect coexist with existing HTTP health/polling. Missing hubs and notification failures do not falsely mark HTTP unhealthy. The standard client's own fallback transports remain allowed; there is **no bespoke HTTP notification long-poll API**. +- New native-only `/hubs/native-companion-agent` has no invokable application command/group methods. Server claims derive ownership; registry/group identity is user + native process grant, never a requested user/document/group. `DesktopAuthentication` now sets ticket `ExpiresUtc`; the native hub closes on authentication expiry. Existing renewal rotates access through the original store. Revocation, process replacement and sign-out remove associated subscriptions; security stamp, lockout, installation/process validity and expiry are revalidated before publication and at 15-second idle intervals. Publication targets validated connection IDs, avoiding a removed group member. HTTP retrieval independently reauthorizes every command. +- The existing store signals a bounded **256-key**, per-user/grant/instance/session coalesced hint channel on accepted shared-queue operations. Dispatcher checks current pending command/grant/revision/identity/expiry, performs no I/O under store lock, and bounds sends at two seconds. Overflow/send/diagnostic failure drops a hint only. Registry limits **4096 total / 16 per user**. No prose, ranges or credentials in hints; three UUIDs identify instance/session/command. Store remains process-local; restart loses pending commands and requires a fresh explicit request. +- Agent `WakePresence` coalesces into a one-slot semaphore and existing document flags. Matching adapter results wake the same worker immediately. Per-session requests remain single flight; at most two regular / four total requests reserve capacity for notified/inactive selected documents. In-flight consuming Presence requests are allowed to finish, avoiding command loss through cancellation. HTTP fallback, snapshots, command expiry, native range checks and acknowledgement rules remain authoritative. Notifications never advance `WordObservedUtc`, choose a document, invent mapping or weaken R1/R2. +- Added UUID-tagged monotonic **server-enqueue-to-take** timing in `NativePresenceStore` and browser **notification-to-receipt** timing in Writer. Existing queue/adapter/publication/HTTP spans remain. Timing logs contain no manuscript content or credentials; diagnostic failure cannot consume commands. Browser time measures receipt checking, not viewport paint. Server queue time includes all time until actual HTTP take; spans overlap and must not be summed blindly. + +No database schema, stored procedure, migration or deployed configuration change is required. Existing HTTP contracts remain compatible with .43 and older agents; only .44 can use native SignalR notifications. Browser receipt fields are additive; new optional expected-manuscript/revision query checks protect the new client without breaking older queries. Production was not accessed/deployed. + +### Qualification and deployed evidence + +[Machine-readable qualification](Evidence/Phase3B4/20261121T164237Z-signalr-atlas/qualification.json), [authenticated integration](Evidence/Phase3B4/20261121T164237Z-signalr-atlas/authenticated-signalr.log), [Development attestation](Evidence/Phase3B4/20261121T164237Z-signalr-atlas/development.json), [public authenticated smoke](Evidence/Phase3B4/20261121T164237Z-signalr-atlas/dev-smoke.log). + +Build: zero warnings/errors. Native foundation **309**; chapter sync **453**; focused authenticated integration **47 SignalR checks** (49 PASS lines including outer checks); full executable application regression **683 PASS lines including nested integrations**, all exit 0. Browser suites cover notifications/races, Writer Word, R2 chooser, F1 Review, Phase21 Review, focus synchronisation, manuscript Reader/freshness, writing-context recovery, destination badges, and **168 Writer navigation combinations**. Fixtures use actual production browser scripts with simulated native/PWA transport; no installed-PWA or physical Word claim. + +Integration uses real authenticated SignalR WebSockets and the actual standard .NET client's built-in LongPolling fallback against loopback. It covers native/cookie separation, cross-user/process/session routing, same-process renewal/new-process invalidation, real ticket expiry, revocation/stamp/lockout, reconnect/exhaustion/unsupported hub, missed/duplicate/out-of-order hints, stale revision, cancellation, command expiry, server-store restart, false/late acknowledgements, inactive multiple documents/slow peer request, single flight, queue/connection bounds, origin rejection, send failure and diagnostic/abort failures. Existing native/HTTP/browser regressions retain R1 freshness, R2 pinning and F1/F2 provenance gates. + +Development runs assembly **1.0.0+964ec5e9f798b60a283ad2c7415ef6a3c0e030f1**; source/deployed DLL and changed JS hashes match, public TLS GET/local GET 200, service active. All eight active-work checks were zero before the authorized restart. Normal isolated-account login, PKCE approval, persistent redemption, both native and browser public **WebSocket** hubs, actual default CloudGateway renewal/process replacement, transport-only Presence invalidation and owner revocation/current-HTTP denial passed. The disposable account/installation was cleaned through normal account deletion; no manuscript/book/canonical snapshot was created or edited. See deployment evidence for exact release/backup identity and warning categories. + +### Remaining acceptance gates + +**Atlas implementation/server qualification is complete; physical qualification remains open.** Build/sign .44 on Windows, preserve verified .43 rollback, obtain the separate installation/Word-interruption approval, verify actual loaded versions/dependencies and repeat the controlled .43 sequence with physical target checks. Test native renewal/reconnect/long idle, two/inactive documents, R1/R2, cancellation/revision/expiry, missed hints and resource usage in actual Word. Run the existing Phase3B4 acceptance matrix and PWA return checks using disposable fixtures. Confirm warm <2s and assess ~1s goal with foreground/side-by-side and true visible landing measurements. No physical .44 latency, signing, installation or Windows compatibility is inferred from Atlas. + +## Historical investigation — assessment commit 10a542c + +Everything below describes the pre-approval .43 baseline and the alternatives considered. Its “not implemented” and approval statements are historical, superseded by the implemented checkpoint above; Option B is not the implementation. + 21 November 2026. Investigation baseline **`ea5a62b14783316e643e2297357539e9d9fcf707`**. Read the latest checkpoint in [the physical navigation latency report](Writer-Phase3B4-Navigation-Latency-Report.md), not its superseded “.42 not installed” sections. Current native source/installed evidence is .43; the report records a 3373ms median, 3533ms p90 and 3549ms worst across ten warm requests. This assessment changes documentation only: no implementation, database/manuscript access, package, deployment or Windows operation. ## Recommendation diff --git a/Docs/Writer/Word-Companion-SignalR-Windows-Handover.md b/Docs/Writer/Word-Companion-SignalR-Windows-Handover.md new file mode 100644 index 00000000..02d3f0fe --- /dev/null +++ b/Docs/Writer/Word-Companion-SignalR-Windows-Handover.md @@ -0,0 +1,135 @@ +# Word Companion .44 — SignalR Windows execution handover + +## Baseline and scope + +Implementation: **964ec5e9f798b60a283ad2c7415ef6a3c0e030f1**, approved Option C from assessment **10a542c**, existing shared branch **codex/word-companion-native-phase1-20261104**. Fetch its current documentation descendant and record exact HEAD; confirm the implementation is an ancestor. Development already runs application **1.0.0+964ec5e9f798b60a283ad2c7415ef6a3c0e030f1** at **https://dev.plotdirector.com/**. No new server deployment, migration or configuration is required. Production remains untouched. [Development attestation](Evidence/Phase3B4/20261121T164237Z-signalr-atlas/development.json) records DLL/JS hashes and rollback release. + +Native source **1.0.0.44**, MSI **1.0.44**, ProductCode **{8245E12F-39A8-4FC3-B1A0-9FB6AEB62F1A}**; UpgradeCode unchanged **{641A087B-9779-458C-B290-BCBBAD49319A}**. Sources: `PlotDirector.NativeCompanion/DeveloperVersion.props`, `Vsto/Properties/AssemblyInfo.cs`, `WindowsValidation/Setup/Release.json`. No protocol/capability version bump. Agent adds pinned **Microsoft.AspNetCore.SignalR.Client 10.0.15** and its transitive dependencies; VSTO retains its existing COM/IPC path and must not acquire SignalR packages. + +Installed **.43 is the control and must remain installed until a separately approved installation window**. Atlas did not create a Windows package, sign, install, touch the Windows machine or measure physical Word performance. This document supersedes the old .41 build/version instructions in [Phase3B4 handover](Writer-Phase3B4-Windows-Handover.md); retain its fixture/evidence/recovery procedures and the [91-case physical matrix](Writer-Phase3B4-Acceptance-Matrix.md). In those historical cases substitute matched .44 add-in/agent, 1.0.44 MSI and this source/server baseline for literal .41 versions. Preserve all safety, identity, provenance and physical-evidence conditions. + +## Prerequisites and read-only inventory + +Use the existing Windows development checkout and x64 PowerShell 7. Inspect actual Windows version, Word desktop version/build/architecture, Visual Studio Office/VSTO workload and x64 MSBuild, .NET 10 SDK and **Microsoft.WindowsDesktop.App 10.x x64** runtime, .NET Framework 4.8/targeting pack, VSTO runtime, existing SDK NETFX 4.8 `mage.exe`, and existing approved code-signing certificate/private-key accessibility. The supported pipeline discovers/checks these; do not install prerequisites or change certificate trust automatically. Supported Word execution remains the established Windows desktop/VSTO setup; browser Word/Office.js is not equivalent. Record actual versions, not assumed support from an Atlas build. + +Inspect installed add-in registration/manifest path, actual installed/running agent path/version and Troubleshooting version read-only. Compare installed .43 payload against its preserved inventory. Existing logs are produced by `PlotDirector.NativeCompanion/Agent/Program.cs` (`AgentLog`) under `%LOCALAPPDATA%\PlotDirector\Companion`; inspect the current logger's filenames, retain only sanitized UUID/stage/timing excerpts. Never copy protected `state.json`, refresh secrets, bearer headers, PKCE codes, cookies or raw account/manuscript dumps into evidence. + +Before build, locate and verify the **preserved .43 EXE and MSI**, and copy them to a new clearly labelled private rollback directory without overwriting anything. Last reported candidate directory: `C:\Users\Nick\Downloads\PlotDirectorCompanion-1.0.0.43-d46ed116`; this is historical evidence, **not proof it still exists**. Recorded EXE SHA-256 **6094E9857A6D0A43852576DB98F6FBE2EA179A08C9D14C6149FC08895B96ED7F**, MSI **20E45867E5B68304EFB885B8D734BA29CDE9ED8930E02C45F9F357810DCA9C92**; .43 ProductCode **{D7159670-480D-42D6-A93B-9F9145D8201E}**. Verify current hashes/signatures and inventory before treating these as rollback artefacts. Existing signer was **4F3EE0D52D2C60214FB1F81DF6E479820A16487F**; verify its current validity/approved ownership, never create a replacement silently. No verified .43 rollback package means **stop before installation and request the preserved package**. Older .42 recovery remains historical; do not substitute an unverified package or force a downgrade. + +Use an approved disposable Development account/project and synthetic Word manuscripts per the existing fixture strategy. Do not use real author manuscripts for edits, sync interruption or fault injection. Normal Development account verification/pairing must bind the correct Development account/server; never reset existing user binding to make tests pass. Refresh the browser and installed PWA to load the deployed JS, confirm actual origin/version and capture browser/PWA versions. Atlas Chromium fixtures were simulated PWA, not installed-PWA acceptance. + +## Build, managed gates and signed packaging + +Build only; no Office Clean, F5 registration, legacy direct install or automatic process termination. Keep all generated evidence/staging outside Git until clean-tree build/package gates finish. Check every external exit code. The existing update script can reuse an exact existing package without rerunning gates; record reuse and run the explicit checks below regardless. + +```powershell +$ErrorActionPreference = 'Stop' +function Check-Exit { if ($LASTEXITCODE -ne 0) { throw "Native command failed: $LASTEXITCODE" } } +$branch = 'codex/word-companion-native-phase1-20261104' +git status --short --branch; Check-Exit +if ((git branch --show-current).Trim() -ne $branch) { throw 'Wrong shared branch; preserve state' } +if (git status --porcelain=v1) { throw 'Preserve local changes; do not reset/stash automatically' } +git fetch origin; Check-Exit +git pull --ff-only; Check-Exit +git merge-base --is-ancestor 964ec5e9f798b60a283ad2c7415ef6a3c0e030f1 HEAD; Check-Exit +$source = (git rev-parse HEAD).Trim(); Check-Exit +$native = 'PlotDirector.NativeCompanion' +$wv = "$native/WindowsValidation" +$release = Get-Content "$wv/Setup/Release.json" -Raw | ConvertFrom-Json +$version = ([xml](Get-Content "$native/DeveloperVersion.props" -Raw)).Project.PropertyGroup.ApplicationVersion +if ($version -ne '1.0.0.44' -or $release.version -ne $version -or $release.msiVersion -ne '1.0.44') { throw 'Wrong native release' } +if ($release.productCode -ne '{8245E12F-39A8-4FC3-B1A0-9FB6AEB62F1A}') { throw 'Unexpected product identity' } +Get-Content "$native/Vsto/Properties/AssemblyInfo.cs" | Select-String 'AssemblyVersion|AssemblyFileVersion' +$PSVersionTable +dotnet --info; Check-Exit +dotnet --list-runtimes; Check-Exit +. "$wv/DeveloperPackage.ps1" +$runId = [DateTime]::UtcNow.ToString('yyyyMMddTHHmmssZ') + '-signalr-windows-' + $source.Substring(0,8) +$stage = Join-Path (Get-DownloadsFolder) ("PlotDirectorQualification/" + $runId) +if (Test-Path -LiteralPath $stage) { throw 'Use a new run directory' } +New-Item -ItemType Directory -Path $stage | Out-Null +``` + +Set `$thumbprint` to the **locally verified approved existing certificate thumbprint** (public identifier only), then: + +```powershell +& "$wv/Update-WordCompanion.ps1" -CertificateThumbprint $thumbprint -NoSync +``` + +Actual supported sequence in that script: `dotnet build PlotLine.slnx -c Release --disable-build-servers -m:1 /p:UseSharedCompilation=false` (restores dependencies); foundation plus six focused native application suites; Office-equipped Visual Studio MSBuild `PlotDirector.NativeCompanion\Vsto\PlotDirector.WordAddIn.csproj /restore /t:Build;VisualStudioForApplicationsBuild` with Release, `PrepareForRunDependsOn=CopyFilesToOutputDirectory`, signing and ApplicationVersion from props; SDK `mage.exe` update/sign; agent `dotnet publish PlotDirector.NativeCompanion/Agent/PlotDirector.Companion.Agent.csproj -f net10.0-windows10.0.19041.0 -c Release -r win-x64 --self-contained false`; source/signer/hash inventory and atomic developer-package promotion. **Use the script** to preserve the exact quoting/signing policy. No new script or installer argument is needed for SignalR. Verify agent `.deps.json`/publish inventory includes SignalR Client/Core, Http.Connections.Client, SignalR Common/JSON protocol and transitive runtime files; package/CAB test must hash every payload file. SignalR package restore failure blocks packaging, never remove the dependency/security checks. + +Run managed gates serially, capture transcripts privately and check exit codes: + +```powershell +dotnet run --no-build -c Release --project "$native/Tests/PlotDirector.Companion.Tests.csproj"; Check-Exit +dotnet run --no-build -c Release --project "$native/Tests/PlotDirector.Companion.Tests.csproj" -- --word-observation; Check-Exit +dotnet run --no-build -c Release --project "$native/Tests/PlotDirector.Companion.Tests.csproj" -- --chapter-sync; Check-Exit +dotnet run --no-build -c Release --project PlotLine.Tests/PlotLine.Tests.csproj -- --native-signalr; Check-Exit +dotnet run --no-build -c Release --project PlotLine.Tests/PlotLine.Tests.csproj; Check-Exit +``` + +If update reused a package, also run its focused `--native-companion`, `--native-companion-http`, `--native-workflow`, `--native-tray`, `--native-import`, `--intent-assessment` using the same application command syntax. New SignalR tests run inside the HTTP fixture and full harness. Atlas references are 309 native foundation, 453 chapter, 47 focused SignalR checks / 49 focused total PASS lines, 683 full harness PASS lines including nested integrations; investigate failures rather than treating counts as performance promises. The observation suite is a portable managed/IPC fixture already included in the Atlas foundation run; its Windows run still does not establish physical Word behavior. Existing browser fixture entry points are in `PlotLine.Tests/Browser/`; new `writer-word-notifications.cjs` runs against the existing disposable Razor fixture host, not a real user's tab/account. Do not run fixture mutation scripts against the public Development manuscript. + +```powershell +$package = Join-Path (Get-DownloadsFolder) "PlotDirectorWordCompanion/$version-$($source.Substring(0,8))" +$inventory = Test-DeveloperPackage $package +if ($inventory.commit -ne $source -or $inventory.version -ne '1.0.0.44') { throw 'Wrong payload' } +$setup = Join-Path $stage 'setup' +& "$wv/Setup/Test-DeveloperPayload.ps1" -PackagePath $package -ReportPath (Join-Path $stage 'payload.json') +& "$wv/Setup/Build-Setup.ps1" -PackagePath $package -ExpectedSourceCommit $source -OutputDirectory $setup -CertificateThumbprint $thumbprint +# $baselineMsi: actual preserved, hash/signature-verified .43 MSI (no guessed path). +& "$wv/Setup/Test-SetupPackage.ps1" -PackagePath $package -SetupDirectory $setup -BaselineMsi $baselineMsi -ReportPath (Join-Path $stage 'package.json') +# $failedSetup: set only to actual historical failed version12 fixture directory if verified available. +$failedSetup = $null +if ($failedSetup) { + & "$wv/Setup/Test-UpgradeRegression.ps1" -FailedSetupDirectory $failedSetup -CorrectedSetupDirectory $setup -ReportPath (Join-Path $stage 'upgrade-regression.json') +} +Get-FileHash (Join-Path $setup 'PlotDirectorCompanionSetup.exe') -Algorithm SHA256 +Get-FileHash (Join-Path $setup 'PlotDirectorCompanion.msi') -Algorithm SHA256 +Get-AuthenticodeSignature (Join-Path $setup 'PlotDirectorCompanionSetup.exe') | Select-Object Status,StatusMessage,SignerCertificate +Get-AuthenticodeSignature (Join-Path $setup 'PlotDirectorCompanion.msi') | Select-Object Status,StatusMessage,SignerCertificate +``` + +Record unavailable historical negative control as BLOCKED; never fabricate inputs. Required .43 baseline/rollback and full payload/CAB/signature checks cannot be waived. Build-Setup checks exact source/version, source ancestry, manifests with `mage -Verify`, signs EXE/MSI and writes setup evidence. Test-SetupPackage independently verifies every CAB hash, per-user/asInvoker install, stable components and upgrade identity/ranges. Current developer signing policy allows only the specifically diagnosed untrusted developer-chain status, not invalid digest/expiry/wrong signer/other unknown failure. Do not weaken signing, install certificates, bypass execution policy or change trust stores. Present any normal trust prompt to the human. + +## Installation gate and recovery + +**Stop after presenting concrete .44 source/package hashes, signature results, test results and verified .43 rollback to the human. Ask for installation and a normal Word save/close window.** Existing authorization is to prepare .44, not to replace installed .43 unattended. Do not remotely install, use silent MSI switches or invoke bootstrapper internal command modes. Following approval, the human launches the unified EXE from Explorer in the established normal-user session. Save/close only approved documents normally; do not kill Word. + +Verify per-user Complete feature is Local (3), expected manifest/registration, installed .44 agent EXE/DLL and VSTO/client hashes match the package, actual running process path, loaded add-in Troubleshooting version .44, correct Development origin/account, one agent process and connected native/HTTP health. Existing binding/state must be retained. Native log `native-signalr connected` confirms subscription; inspect network/diagnostics for actual transport instead of inferring WebSockets from library selection. Standard SignalR transport fallback is allowed; ordinary HTTP fallback remains available when disconnected. An old .43 agent should continue using HTTP on the new server, without a new native hub connection. + +Build/sign failure: preserve logs and .43; diagnose prerequisites/signer without installation/security bypass. Installation/add-in/agent load failure: preserve setup/registration/file inventory and normal Troubleshooting logs, stop qualification and ask before repair/uninstall. Pairing failure: verify origin/account/server and expiry/revocation; never erase protected state/reset binding to force a pass. Word unresponsive: stop issuing commands, allow recovery and human save/close; no destructive crash/hang experiment. Sync failure: preserve synthetic saved/accepted/physical distinctions, do not replay content or reset a book automatically. Server incompatibility: stop and report expected/actual version; no redeploy from Windows. + +Rollback is the supported **separately approved normal uninstall followed by verified .43 unified EXE reinstall**, with Word saved/closed normally. Major upgrade does not authorize forced downgrade, registry edits, registration bypass or data deletion. Keep current protected binding and author content; no account reset. Development server backup is `/srv/apps/plotdirector-dev/current-before-964ec5e9-20261121T164301Z`; Linux operator must recheck active-work safety and compatibility before any separately authorized server rollback. Windows must not operate it. + +## Ordered physical SignalR supplement + +After installation verification, run the existing 91-case matrix A→G with the version override above, plus these ordered cases. All use only owned synthetic fixtures. Each result needs UTC start/end, exact source/package/server/installed versions, instance/session/navigation aliases, expected/actual result, PASS/FAIL/BLOCKED and cleanup. A notification/queued request is never proof of actual Word execution. For timed cases capture click, matching authoritative receipt, actual Word landing and separate viewport observation. Any wrong document, stale completion or unauthorized content change fails immediately; stop dependent tests and preserve evidence. + +| ID / purpose | Preconditions and exact actions | Pass/fail condition | Evidence and cleanup | +| --- | --- | --- | --- | +| SR01 Startup/one connection | Matched installed .44, Small saved, paired Dev. Start agent then Word/browser; repeat Word-before-agent and browser-before-Word normally. Inspect process/subscription logs and actual network transport. | One agent process/subscription; native/HTTP connected; no automatic navigation. Missing tooling to count connections is BLOCKED for that measurement. | Sanitized start/connect/reconnect logs, process paths, transport; return to one normal running agent. | +| SR02 Warm navigation | Small and Medium verified. Use the original .43 ten-target sequence (scene forward/back/repeat, chapter start, cross-chapter scenes, chapter back/forward, current scene) with normal verification enabled; include foreground and side-by-side as labelled branches. | Every completed receipt matches exact ID/instance/session/manuscript/revision and actual range. Record all results; physical <2s warm confirmation target must be met on the agreed trials, report median/p90/worst, ~1s is a goal. Do not call a faster receipt alone success. | UUIDs, new server enqueue→take/browser notification→receipt and existing native spans, range screenshots, actual visible landing timing; restore fixture focus with excluded cleanup trial. | +| SR03 Duplicate / receipt race | Verified Small; browser and agent logs available. Repeat same-target navigations with distinct requests; use only existing controlled fixture hooks for same-ID duplication/pre-202 race. | No duplicate physical execution for same ID or false completion; distinct explicit requests supported. No safe physical same-ID hook → that part BLOCKED, retain managed proof separately. | Receipt/adapter UUID trace and counts, retain logs; no request forgery/injection into author session. | +| SR04 Inactive selected document | Two fixture sessions A/B, explicitly A in Writer, B active in Word. Navigate to A, then switch active windows repeatedly without chooser action. | Hint wakes exact A, actual A range selected; no automatic B substitution or Global Focus rewrite. | Both identities, selected key, range and timelines; restore normal A choice. | +| SR05 Selected close/reopen (R2) | A explicitly selected, B open. Close saved A normally; attempt navigation without choosing; reopen A, then explicitly reselect. | No silent B/new-session fallback; old session unavailable until deliberate selection; then exact fresh target works. | Selection/status/native execution counters; restore A explicitly. | +| SR06 Freshness (R1) | Small saved and freshly observed. Execute existing C-group safe observation-stall hook only if available/authorized, while agent/hub remain alive; wait beyond45s, attempt navigation, recover hook. | Transport/hint cannot renew producer UI proof; stale navigation refused; fresh observation restores eligibility. No safe hook → BLOCKED, never hang/crash Word. | Producer vs agent timestamps, hint/receipt refusal/recovery; remove only run hook. | +| SR07 Network loss / missed hint | Synthetic saved fixtures, no content upload. Use approved reversible network control for this process/Dev only; obtain human approval before firewall/network changes. Disconnect notification path, queue one navigation, restore connectivity, inspect reconciliation. If control isolates nothing safely, BLOCKED. | HTTP fallback/reconnect recovers eligible unexpired command at most once; expired command cannot execute; no false completion from reconnect. | Actual transport loss/restoration, retry/HTTP/ack times, command expiry; restore exact prior network settings immediately. | +| SR08 Renewal and idle | Owned disposable account; keep Word idle/normal observations beyond access lifetime (10min) and record token renewal/reconnect **without tokens**; then navigate inactive A. | Existing protected lifecycle renews/reconnects, one current process subscription, exact command completes; no spurious pairing/account change. | Sanitized expiry/renewal/connect state and result, CPU/memory/requests while idle; retain binding. | +| SR09 Revocation / authority | Dedicated disposable installation only; approval to revoke it. Owner revokes through normal Development installation UI while connected. Attempt a fixture command, then re-pair normally if authorized. | Subscription closes, current HTTP denied, no command or success; fresh approved pairing required. | Revoke/connect/HTTP denial, zero execution; restore only test binding with explicit approval, never revoke user's normal installation. | +| SR10 Revision/cancel/expiry | Synthetic Small copy, saved baseline. Use existing D-group controls for revision change/cancel before take/execution and >25s expiry. Do not fabricate grants/ranges. | Existing adapter/server checks refuse stale/cancelled/expired ID, late ack cannot complete; new explicit fresh request may succeed. | Native result/receipt state and saved/accepted/position versions; restore synthetic content normally. Missing safe timing hook BLOCKS that branch. | +| SR11 Agent restart / server loss | Saved A/B, no import/sync in flight; normal tray quit/start (approved). Inspect pending requests and reconnection. Server-restart branch only on separately authorized disposable harness, not remote Dev stop. | No same-ID duplicate or stale queued execution; reconcile eligible state, old identity never becomes another document. Server restart loses in-memory queue and cannot invent completed receipt. | Before/after session/process/command IDs; normal restart recovery, fresh explicit choice if required. | +| SR12 PWA/Review provenance | Existing F-group fixtures including chapter-only/unmapped scene and stale historical AI review. Run browser refresh, installed PWA return, dirty-editor deferral and explicit passage reselection. | F1/F2 retained, notes/decisions readable, stale precision/Word target cleared/refused; notification only wakes exact pending receipt. | Actual installed PWA screenshots/versions, selected targets/notes (synthetic only); clean only approved synthetic drafts. | +| SR13 Large/contention/resource | Owned 190k and250k synthetic fixtures; baseline open/start/full verification, saved single/same-length/multiple edits, periodic verification, switching/cancel/recovery. Run original G-group measurements during notification use. | No typing/scroll/ribbon regression, starvation, stale/wrong target or duplicate ack; record resource/timing distribution. Enforce software bounds: hint256, registry16/user4096total, per-agent max4 requests/max2 regular and one per session. Physical resource thresholds without agreement are proposed, not historical guarantees. | CPU/private bytes, Word UI/COM latency, queue depths, HTTP requests/bytes, reconciliation/checkpoint counts and durations; restore synthetic baselines. No synthetic hashing substitute for Word. | + +Missing physical fault hooks/tool access are explicit BLOCKED items, not permission to improvise a Word hang or mutate real data. Managed queue/server-restart/duplicate notification tests provide supplemental evidence, never fill physical rows automatically. The .43 control may be remeasured read-only **before installation** with approval; afterwards do not repeatedly uninstall/reinstall merely for a sample without human agreement. Preserve differences in document/session count/background verification in comparisons. + +## Evidence, completion and ready-to-paste Windows prompt + +Create a NEW `Docs/Writer/Evidence/Phase3B4/-signalr-windows-/` only after clean build/package gates, copying sanitized results from `$stage`. Record OS/Word/VS/.NET/browser/PWA versions, native installed/loaded paths+versions+hashes, source, EXE/MSI hash/signature/cert validity, Development version, timestamps, every matrix ID and SR ID, measured scope/units and failures/reproduction/cleanup. JSONL results plus CSV trial/performance data and concise Markdown report; no whole HAR, tokens, private state or author manuscript content. Preserve cold/warm and actual-visible/ack distinction and all samples. Keep artifacts/private logs outside Git, commit sanitized evidence and updated reports only; normal fetch/push shared-branch workflow, no force-push or unrelated edits. + +Physical completion requires all required installation/security/provenance/freshness/navigation/sync/workflow checks passed, accepted performance criteria and complete cleanup. Any BLOCKED/NOT_RUN means qualification remains incomplete. Atlas source/server readiness is established; Windows prerequisites/cert availability, verified preserved .43 artifacts, installation approval, real loaded .44 and physical latency/resources remain Windows gates. + +Paste into a fresh Windows Codex session: + +> Read `Docs/Writer/Word-Companion-SignalR-Windows-Handover.md`, the latest implemented checkpoint in `Docs/Writer/Word-Companion-SignalR-Architecture-Assessment.md`, and `Docs/Writer/Writer-Phase3B4-Navigation-Latency-Report.md`. Implemented source 964ec5e9f798b60a283ad2c7415ef6a3c0e030f1 is already qualified/deployed to Development. Follow this handover's exact clean shared-branch fetch/version/build/test/sign/package order for native1.0.0.44 (standard SignalR client10.0.15). Do not redo architecture or substitute a custom transport. Preserve installed .43 and verified rollback artifacts. Build/sign/inspect first, then stop and present exact package/signature/test evidence for human installation/Word-save-close approval; never install/kill Word/change certificates or bindings unattended. After approval verify actual installed/loaded .44 and run existing Phase3B4 matrix A→G with this handover's version override plus SR01–SR13 in order. Use only owned disposable synthetic fixtures and safe existing hooks; stop on unsafe behavior, genuine source/server mismatch, missing rollback/cert/tooling or any need for disruptive action beyond approval. Mark unsupported physical faults BLOCKED. Record all UUID-correlated monotonic spans and actual physical range landing; repeat controlled .43 warm sequence, median/p90/worst, foreground/side-by-side and large-manuscript resources. Never infer physical Word/installed PWA performance from Atlas fixtures. Do not deploy servers, touch Production, reset account/author data or weaken security. Sanitize run-specific evidence and update reports; fetch/commit/push only intended changes normally. Report exact source/package/loaded/server versions, physical results, cleanup and remaining blockers. diff --git a/Docs/Writer/Writer-Phase3B4-Navigation-Latency-Report.md b/Docs/Writer/Writer-Phase3B4-Navigation-Latency-Report.md index bf1f78b5..ab58ef5a 100644 --- a/Docs/Writer/Writer-Phase3B4-Navigation-Latency-Report.md +++ b/Docs/Writer/Writer-Phase3B4-Navigation-Latency-Report.md @@ -1,6 +1,21 @@ # Writer Phase 3B.4 — Word navigation latency investigation -## Current checkpoint — 21 November, installed .43 physical benchmark +## Current implementation checkpoint — approved SignalR, .44 source / Development + +**Approved Option C is implemented and deployed to Development at `964ec5e9f798b60a283ad2c7415ef6a3c0e030f1`. Installed Windows remains .43; the physical result below remains the latest measured result.** The former bespoke long-poll proposal is superseded by the approved [SignalR assessment](Word-Companion-SignalR-Architecture-Assessment.md#implemented-checkpoint--21-november-2026-approved-option-c). No .44 package, installation, Word operation or physical benchmark occurred on Atlas. + +The implementation removes scheduled waiting from the healthy notification path: a bounded server hint wakes authenticated Presence acquisition; an actual valid adapter result wakes acknowledgement publication; the existing browser SignalR hint wakes an immediate authoritative receipt GET. Immediate first receipt check and one-second lost-notification fallback coexist. SignalR is in the background agent only, standard client **10.0.15**, one authenticated connection per process, native source **1.0.0.44** / MSI **1.0.44**. Existing .43 HTTP polling continues unchanged in the compatible new server. Notifications never execute ranges or assert completion. + +The new diagnostics close the missing **server enqueue → actual HTTP take** and **browser notification → receipt response** spans, keyed by navigation UUID and measured on each process's monotonic clock. The former is logged by `NativePresenceStore` as `Stage=server-enqueue-to-take Milliseconds=...`; the latter by Writer console as `notification-to-receipt ms`. A false/mismatched receipt cannot become success. Notification-to-receipt includes request time and scheduler coalescing, not Word landing/paint; logging must be preserved in Windows evidence without manuscript payloads or bearer credentials. Correlate UUIDs and report coverage; do not subtract unsynchronised clocks or add overlapping child spans. + +[Atlas qualification](Evidence/Phase3B4/20261121T164237Z-signalr-atlas/qualification.json): clean build (0 warnings/errors), 309 foundation, 453 chapter, 47 focused SignalR checks; full executable regression 683 PASS lines including nested integrations; selected current browser/native-compatible suites passed, including 168 Writer layout/navigation combinations. Real loopback WebSockets/custom-native-auth expiry, revocation, renewal/process changes, authenticated standard SignalR fallback, reconnect/missed/duplicate hints, command cancellation/expiry/stale revision, false completion, inactive multiple documents and resource bounds passed. Browser/PWA fixtures simulate transport and native execution. Fixture timing assertions are regression gates, **not physical performance results**. + +[Development deployment and hashes](Evidence/Phase3B4/20261121T164237Z-signalr-atlas/development.json) establish assembly 1.0.0+964ec5e9f798b60a283ad2c7415ef6a3c0e030f1, matching published/deployed DLL and JS, active service and local/public TLS GET 200. No active import/analysis/synthesis/enrichment/build work before restart; no migration/config change. [Authenticated public smoke](Evidence/Phase3B4/20261121T164237Z-signalr-atlas/dev-smoke.log) verified both real WebSocket hubs, normal PKCE pairing, actual agent default client/renewal, old process disconnect, owner revocation and HTTP rejection. Only a backed-up disposable account/native installation and BookId=0 transport presence were used, followed by normal account deletion. Production and installed .43 were untouched. + +**No new end-to-end figure is available.** Healthy warm <2s remains unproven; ~1s remains an engineering goal. [Windows handover](Word-Companion-SignalR-Windows-Handover.md) contains exact build/sign/version, rollback preservation and ordered physical checks. Repeat at least the original ten warm targets, preserving normal periodic verification and controlling document/session count. Report all trial median/nearest-rank p90/worst, foreground/side-by-side branches, cold startup, enqueue→take and notification→receipt plus existing native spans, actual target landing and separately observed viewport timing. Measure CPU/memory/request count/queue resources, lost-hint recovery and large-manuscript contention. Keep the broader 91-case Phase3B4 qualification open until physical evidence exists. + +## Latest physical checkpoint — 21 November, installed .43 benchmark + **.43 is installed and verified; the ten-trial end-to-end performance target FAILED.** Its local pickup correction works, but the measured confirmation median is **3373ms**, p90 **3533ms**, worst **3549ms**. Only two of ten requests completed below two seconds. Do not describe .43 as achieving the requested warm-navigation result.