From 1ccb6c43220ca06725a53ae86b8fed775b9bdcea Mon Sep 17 00:00:00 2001 From: Nick Beckley Date: Sat, 7 Nov 2026 15:22:36 +0000 Subject: [PATCH] Document version15 UI delivery and focused Windows qualification --- .../WindowsHandover/2026-11-07-UI-Redesign.md | 70 +++++++++++++++++++ Docs/WordCompanion/WindowsHandover/README.md | 8 +++ 2 files changed, 78 insertions(+) create mode 100644 Docs/WordCompanion/WindowsHandover/2026-11-07-UI-Redesign.md diff --git a/Docs/WordCompanion/WindowsHandover/2026-11-07-UI-Redesign.md b/Docs/WordCompanion/WindowsHandover/2026-11-07-UI-Redesign.md new file mode 100644 index 00000000..7a56562e --- /dev/null +++ b/Docs/WordCompanion/WindowsHandover/2026-11-07-UI-Redesign.md @@ -0,0 +1,70 @@ +# Companion 1.0.0.15 — Windows handover + +Application commit: **5472e98b8fbc4dbe5829f3b71051e3194a163bdb**. Later handover-only commits do not change this application source. Shared branch: `codex/word-companion-native-phase1-20261104`. + +## Delivered source + +The existing WinForms tray agent now has a compact light/dark interface: branding/version, separate verified PlotDirector and Word status, account, manuscript selection, project/book details, in-memory book cover, Open PlotDirector and Settings. Switching active Word documents changes the displayed manuscript; another open document can also be selected explicitly. Changing a book uses one association dialog, with optional, confirmed Word metadata persistence. There is no separate analyser or manuscript upload action in the window. + +Settings contains account/server controls and a persistent **Advanced mode**, off by default. Advanced exposes connection checks, log-folder access, session diagnostics, identifier inspection, marker removal, association reset and confirmed clean/unlink. Sign-in uses the existing browser flow; pending approval and automatic renewal do not offer duplicate sign-in buttons. Window close hides; tray reopen reuses the same window; explicit Exit stops the process without revoking trust. + +Changed components: + +- `PlotDirector.NativeCompanion/Agent/TrayApplication.cs`, `CompanionSurfaces.cs`, `CompanionPresentation.cs`: UI, theme, status, actions and asynchronous cover handling. +- `Agent/CompanionStateStore.cs`, `CloudGateway.Authorization.cs`: Advanced preference and scoped association removal. Qualified DPAPI/renewal implementation retained. +- `Agent/CloudGateway.cs`: optional cancellation on the existing authenticated GET transport; obsolete cover requests cancel without changing connection health. +- `Protocol/DocumentMaintenancePolicy.cs`, `Messages.cs`, `AiContracts.cs`, `Client/AgentLink.cs`, `Agent/PipeHost.cs`, `TrayCoordinator.cs`: additive maintenance negotiation, exact-session commands, correlated acknowledgements, project/book metadata and cover DTO. +- `Vsto/WordAdapter.cs`: maintenance on the existing measured STA scheduler, one marker per scheduler turn; no retained collection RCWs between batches, no automatic save, no prose assignment. Content controls use Interop `Delete(false)`; bookmarks use `Delete()`. +- `PlotLine/Controllers/NativeCompanionController.cs`: additive book names and authenticated `/api/native-companion/books/{id}/cover`. Ownership checked before resolving the existing thumbnail; bounded PNG conversion supports Windows image decoding of stored WebP covers. No duplicate cover files created. + +Cleanup owns only `PD-CHAPTER-` / `PD-SCENE-` content-control tags, `_PD_CHAPTER_` / `_PD_SCENE_` bookmarks and the five explicitly listed native custom properties. It deliberately does not edit arbitrary custom XML or legacy Office.js private settings. Unrelated metadata is left alone. Protected/locked objects or a changed/closed document stop maintenance; partial metadata removal can occur and is reported, so inspect before retrying. Resetting an association does not remove structural markers; clean/unlink does both. Local unlink is confirmed only after a matching Word acknowledgement. This is not a transactional Word undo operation. + +## Atlas evidence + +- `dotnet build PlotLine.slnx --no-restore --disable-build-servers -m:1 /p:UseSharedCompilation=false`: success, zero warnings/errors; includes `net10.0-windows` managed WinForms target, excludes VSTO host. +- Native executable regression harness: **257 checks passed**. Covers preferences/restart, authorisation states, ownership policy, capability negotiation, document routing, failed cleanup and acknowledgement-gated unlink, plus existing IPC/recovery/import tests. +- Application executable harness: **416 checks passed**. +- `--native-companion-http`: passed real loopback HTTP authentication, foreign-book cover rejection before file lookup, bounded PNG response and existing AI/import/security regressions. +- `--native-tray` and `--native-installation`: passed. +- One initial native run hit a transient Linux broken-pipe failure at the pre-existing sequential handshake test; three subsequent full native runs passed (254, 256 after additional status tests, then 257 after the live-identity reset regression). No Windows pipe/ACL claim follows from these Linux tests. + +No Windows build, signing, packaging, installer execution, desktop automation or Word execution occurred on Atlas. No schema migration or new configuration setting is required. Development now serves the new cover API and project/book names. Deployment used web application commit `57c6bd5ca5f3d20c1e80fca9835b61b7fdd47f2c`; the later native-only fix does not change the web payload. + +- Release: `/srv/apps/plotdirector-dev/releases/57c6bd5-20261107T151928Z`. +- Preserved previous deployment: `/srv/apps/plotdirector-dev/current-before-57c6bd5-20261107T151928Z`. +- Published/deployed `PlotLine.dll` SHA-256: `a9c3f844e2796e99f02db07ed42197bc2ccc9a60becc567c0d63498cc88786c6`. +- Read-only active-work guard passed before restart; service active, local/public root GET 200, unauthenticated public cover GET 401; no recent warning entries. Authorised image retrieval was tested through the real loopback API with synthetic authentication/data, not a real author's live cover. No Production changes. + +## Windows Codex instructions + +1. Preserve the current worktree; discover its configured tracking remote. Fetch and fast-forward **this same branch**, stopping on divergence. Verify `git merge-base --is-ancestor 5472e98b8fbc4dbe5829f3b71051e3194a163bdb HEAD`. Do not switch branches, rebase or discard local work. +2. Preserve the qualified installed **1.0.0.14**, its original signed installer and its protected user settings. The baseline evidence is `PlotDirector.NativeCompanion/WindowsValidation/Setup/Qualification-2026-11-07-v1.0.0.14.md`. Do not clear `%LOCALAPPDATA%\PlotDirector\Companion` or force a new authorisation. +3. Build the Atlas-managed UI as delivered. Correct only proven Windows-specific compilation/runtime defects. Compile the updated VSTO host and verify the new `document-maintenance-v1` capability; an old host must refuse maintenance without breaking connection/import. Commit any fixes to the shared branch. +4. Application source is **1.0.0.15**; `Setup/Release.json` deliberately remains the qualified **1.0.0.14** baseline. Prepare **the existing unified installer** for 15 on Windows: align application/MSI versions, allocate a new ProductCode, retain the UpgradeCode and qualify the 14-to-15 upgrade using the existing scripts. Record the exact clean source SHA before building. Do not introduce another installer or substitute a `.vsto` file. +5. Use the existing commands from the repository root, with real local values: + + ```powershell + .\PlotDirector.NativeCompanion\WindowsValidation\Update-WordCompanion.ps1 + # For a clean, committed local Windows qualification fix not pushed yet: use -NoSync. + .\PlotDirector.NativeCompanion\WindowsValidation\Setup\Build-Setup.ps1 ` + -PackagePath '' ` + -ExpectedSourceCommit '' ` + -OutputDirectory '' ` + -CertificateThumbprint '' + .\PlotDirector.NativeCompanion\WindowsValidation\Setup\Test-SetupPackage.ps1 ` + -PackagePath '' -SetupDirectory '' ` + -BaselineMsi '' -ReportPath '' + ``` + + Update prepares `%USERPROFILE%\Downloads\PlotDirectorWordCompanion\1.0.0.15-` using the supported Downloads-folder resolver; it does not install. Setup produces `PlotDirectorCompanionSetup.exe`, the MSI and evidence in the supplied output directory. Use actual paths printed by the scripts rather than guessing the installed/profile location. Preserve all existing prerequisite/trust gates. +6. Run portable tests and the existing package/upgrade checks. Do not launch Word, control the desktop, close applications or install unattended. Distinguish the effective Codex identity/private registry from the normal interactive Windows profile. Registration is not proof that Word loaded the add-in. +7. Push validated Windows fixes and report their SHA, signed unified installer path/hash and the remaining manual checks. Do not redesign the managed UI or authentication again. + +## Human acceptance (scheduled Windows session) + +- Install the **unified version15 installer**, with Word closed by you. Verify settings/book associations and approved sign-in survive the version14 upgrade; no repeated browser approval on normal restart. +- Check light/dark, 100/150/200% scaling, keyboard focus, smallest window, long filenames/titles and resizing. Check covers for two different books and a book with no cover; rapid book/account switching must never leave another book's image. +- Confirm separate Word/server states, recovery after network loss and agent restart, close-to-tray, repeated reopen and explicit Exit/restart. Check Settings can be closed/reopened repeatedly and Advanced remains off until enabled, then persists. +- With **disposable saved document copies only**, inspect IDs; remove PD markers; reset association; clean/unlink. Include nested controls, unrelated bookmarks/custom properties, formatting, read-only/protected documents and multiple open books. Compare exact prose, formatting and unrelated metadata before/after. Cancel every confirmation once. Verify interrupted cleanup is reported, not claimed complete; saving remains under your control. +- Check the existing website import wizard still requests Word content only explicitly. Merely opening Companion, inspecting identifiers, changing books or reconnecting must not upload prose. +- Native appearance, focus behaviour, COM cleanup safety, scaling and actual Word responsiveness remain unverified until these Windows tests run. Do not qualify this build for general distribution on compilation alone. diff --git a/Docs/WordCompanion/WindowsHandover/README.md b/Docs/WordCompanion/WindowsHandover/README.md index 51e0913f..ad928d89 100644 --- a/Docs/WordCompanion/WindowsHandover/README.md +++ b/Docs/WordCompanion/WindowsHandover/README.md @@ -1,3 +1,11 @@ +# Current handover — compact Companion UI, version15 + +Use [the version15 UI handover](2026-11-07-UI-Redesign.md) first. It identifies the final application source commit, actual changed projects, Atlas test evidence, Development cover API deployment and focused Windows acceptance requirements. The managed interface is implemented; Windows owns native qualification and preparing the existing signed unified installer. **The qualified version14 installer baseline is preserved**, and its release pins must be deliberately advanced on Windows for version15. Do not install or drive Word during unattended qualification. + +The entries below are historical; their UI/version instructions are superseded by the linked handover. + +--- + # Persistent authorisation correction — current handover Read [Persistent authorisation](../Persistent-Authorisation.md) before the older handovers below. Source version **1.0.0.14** adds protected installation approval, automatic renewal/reconnection and persistent account-scoped associations/preferences. The fetched Windows **21f9eac / 1.0.0.13** qualification and installer baseline are preserved. Windows installation and live DPAPI/Word qualification remain with the author; do not repeatedly rebuild installers, install software, or use Computer Use during an unattended pass. One first-time approval after this upgrade is required because version13 never stored installation approval.