diff --git a/Docs/WordCompanion/2026-11-04-windows-qualification.md b/Docs/WordCompanion/2026-11-04-windows-qualification.md new file mode 100644 index 00000000..494a8e72 --- /dev/null +++ b/Docs/WordCompanion/2026-11-04-windows-qualification.md @@ -0,0 +1,29 @@ +# Native Word Companion Windows qualification + +4 November 2026. Phase 1 baseline 472ab581. Desktop acceptance pending. + +## Environment and build + +- Windows 11 Home x64, build 26300. Ryzen 9 8945HS, 16 GB RAM. +- Desktop Word x64 16.0.20527.20112. Office PIAs resolved at compile time. VSTO runtime loaders present for x64 and x86. +- Visual Studio Community 2026 18.11.3 with Office development workload and Word VSTO template. .NET Framework 4.8 targeting pack present. .NET SDK 10.0.403, runtime 10.0.14, PowerShell 7.6.9. +- Full managed solution built with zero warnings and errors. The developer script built the .NET Framework 4.8 add-in and its client and protocol dependencies with zero warnings and errors, emitted signed VSTO manifests, and published the framework-dependent win-x64 agent beside the add-in. +- The developer script now selects an Office-equipped Visual Studio MSBuild. The original discovery selected SQL Server Management Studio's incomplete MSBuild. The Windows solution uses the C# project type for the flavored project and consistent platform mappings. The add-in host blueprint, designer and project metadata follow the locally installed Word template, and WordAdapter explicitly selects the protocol Message type. +- Signing used a short-lived self-signed certificate in the current user's Personal store. No trust-store change or certificate file was required for compilation. + +## Tests and evidence + +- Native executable harness passed all 118 assertions on Windows. Coverage includes protocol negotiation, Windows named-pipe transport, separate document/instance sessions, position resolution, coalescing, queue limits, cancellation, stale rejection, disconnect and host restart/reconciliation. The peer-owner rejection case injects a callback, so it does not exercise the VSTO SID check. +- A separate smoke test launched the published agent, negotiated a correlated ready response through its production endpoint, verified a duplicate process exited successfully while the first continued serving, terminated the first process, and handshook with the restarted executable. Graceful executable shutdown and five-minute idle exit remain untested. +- The application harness stopped at CoreImportWizardOrdersScenesBeforeCharacters with “Saving chapter review should validate only structure before scene import.” That application path was outside this qualification change. +- The fixture generator produced Discovery-190k, Reckoning-250k, Redemption-many-short and Long-paragraph-250k plus fixtures.json. Opening the files in Word without repair is pending. + +## Desktop acceptance still required + +A parallel IDE launch showed a legacy project-system failure during project reload. The activity log identified LegacyProjectSystemRegistrationPackage and SVsLegacyProjectSystemHelperPrivate. The user identified the existing Visual Studio instance as the correct one to use. Desktop automation was stopped before a retry there, so F5, Word load, ribbon and live Word-agent communication remain unverified. + +Resume in the existing Visual Studio instance with the Windows solution. Reload the changed projects if prompted, select PlotDirector.WordAddIn as startup project and use the signed local developer output in a controlled profile. Begin with a blank synthetic document. Check startup, ribbon, agent connection, selection and close/reconciliation before opening large fixtures. + +Use a separate nonprivileged Windows account to test cross-user pipe denial and server SID rejection. Collect add-in-disabled and enabled Word trials using the Windows validation checklist, including interactive typing and scrolling, save and close, multi-document switching, agent loss and recovery, per-call COM and batch timings, UI delays, queue depth and process resource use. No Word responsiveness measurements are available yet. + +Database, migrations, stored procedures and server configuration were outside this change. No deployment was performed. diff --git a/PlotDirector.NativeCompanion/NativeCompanion.Windows.sln b/PlotDirector.NativeCompanion/NativeCompanion.Windows.sln index 862efb37..dca3fffa 100644 --- a/PlotDirector.NativeCompanion/NativeCompanion.Windows.sln +++ b/PlotDirector.NativeCompanion/NativeCompanion.Windows.sln @@ -6,7 +6,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlotDirector.Companion.Prot EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlotDirector.Companion.Client", "Client\PlotDirector.Companion.Client.csproj", "{DC2B7CCF-B29B-4AAE-BAD4-3528CB2B751A}" EndProject -Project("{BAA0C2D2-18E2-41B9-852F-F413020CAA33}") = "PlotDirector.WordAddIn", "Vsto\PlotDirector.WordAddIn.csproj", "{42996908-DB24-4A55-AFF1-1017A31D7206}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlotDirector.WordAddIn", "Vsto\PlotDirector.WordAddIn.csproj", "{42996908-DB24-4A55-AFF1-1017A31D7206}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -22,9 +22,9 @@ Global {DC2B7CCF-B29B-4AAE-BAD4-3528CB2B751A}.Debug|Any CPU.Build.0 = Debug|Any CPU {DC2B7CCF-B29B-4AAE-BAD4-3528CB2B751A}.Release|Any CPU.ActiveCfg = Release|Any CPU {DC2B7CCF-B29B-4AAE-BAD4-3528CB2B751A}.Release|Any CPU.Build.0 = Release|Any CPU - {42996908-DB24-4A55-AFF1-1017A31D7206}.Debug|Any CPU.ActiveCfg = Debug|AnyCPU - {42996908-DB24-4A55-AFF1-1017A31D7206}.Debug|Any CPU.Build.0 = Debug|AnyCPU - {42996908-DB24-4A55-AFF1-1017A31D7206}.Release|Any CPU.ActiveCfg = Release|AnyCPU - {42996908-DB24-4A55-AFF1-1017A31D7206}.Release|Any CPU.Build.0 = Release|AnyCPU + {42996908-DB24-4A55-AFF1-1017A31D7206}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {42996908-DB24-4A55-AFF1-1017A31D7206}.Debug|Any CPU.Build.0 = Debug|Any CPU + {42996908-DB24-4A55-AFF1-1017A31D7206}.Release|Any CPU.ActiveCfg = Release|Any CPU + {42996908-DB24-4A55-AFF1-1017A31D7206}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/PlotDirector.NativeCompanion/Vsto/PlotDirector.WordAddIn.csproj b/PlotDirector.NativeCompanion/Vsto/PlotDirector.WordAddIn.csproj index 5322afaa..c1f82e3b 100644 --- a/PlotDirector.NativeCompanion/Vsto/PlotDirector.WordAddIn.csproj +++ b/PlotDirector.NativeCompanion/Vsto/PlotDirector.WordAddIn.csproj @@ -16,7 +16,7 @@ true true - true + true PlotDirector.Companion.Protocol @@ -29,7 +29,7 @@ - - + + diff --git a/PlotDirector.NativeCompanion/Vsto/ThisAddIn.Designer.cs b/PlotDirector.NativeCompanion/Vsto/ThisAddIn.Designer.cs index 7e1bbc63..cc30e345 100644 --- a/PlotDirector.NativeCompanion/Vsto/ThisAddIn.Designer.cs +++ b/PlotDirector.NativeCompanion/Vsto/ThisAddIn.Designer.cs @@ -1,18 +1,237 @@ -// VSTO host-item plumbing. Validate/regenerate against the supported Windows VS -// Office template before accepting a desktop build; this is not a COM add-in shim. -namespace PlotDirector.WordAddIn -{ - [Microsoft.VisualStudio.Tools.Applications.Runtime.StartupObject(0)] - public sealed partial class ThisAddIn : Microsoft.Office.Tools.AddInBase - { +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 414 +namespace PlotDirector.WordAddIn { + + + /// + [Microsoft.VisualStudio.Tools.Applications.Runtime.StartupObjectAttribute(0)] + [global::System.Security.Permissions.PermissionSetAttribute(global::System.Security.Permissions.SecurityAction.Demand, Name="FullTrust")] + public sealed partial class ThisAddIn : Microsoft.Office.Tools.AddInBase { + + internal Microsoft.Office.Tools.CustomTaskPaneCollection CustomTaskPanes; + + internal Microsoft.Office.Tools.SmartTagCollection VstoSmartTags; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "18.0.0.0")] + private global::System.Object missing = global::System.Type.Missing; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "18.0.0.0")] internal Microsoft.Office.Interop.Word.Application Application; - public ThisAddIn(Microsoft.Office.Tools.Word.ApplicationFactory factory, System.IServiceProvider provider) - : base(factory, provider, "AddIn", "ThisAddIn") { } - protected override void Initialize() - { - base.Initialize(); - Application = GetHostItem(typeof(Microsoft.Office.Interop.Word.Application), "Application"); + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + public ThisAddIn(global::Microsoft.Office.Tools.Word.ApplicationFactory factory, global::System.IServiceProvider serviceProvider) : + base(factory, serviceProvider, "AddIn", "ThisAddIn") { + Globals.Factory = factory; + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "18.0.0.0")] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + protected override void Initialize() { + base.Initialize(); + this.Application = this.GetHostItem(typeof(Microsoft.Office.Interop.Word.Application), "Application"); + Globals.ThisAddIn = this; + global::System.Windows.Forms.Application.EnableVisualStyles(); + this.InitializeCachedData(); + this.InitializeControls(); + this.InitializeComponents(); + this.InitializeData(); + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "18.0.0.0")] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + protected override void FinishInitialization() { + this.InternalStartup(); + this.OnStartup(); + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "18.0.0.0")] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + protected override void InitializeDataBindings() { + this.BeginInitialization(); + this.BindToData(); + this.EndInitialization(); + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "18.0.0.0")] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + private void InitializeCachedData() { + if ((this.DataHost == null)) { + return; + } + if (this.DataHost.IsCacheInitialized) { + this.DataHost.FillCachedData(this); + } + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "18.0.0.0")] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + private void InitializeData() { + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "18.0.0.0")] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + private void BindToData() { + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + private void StartCaching(string MemberName) { + this.DataHost.StartCaching(this, MemberName); + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + private void StopCaching(string MemberName) { + this.DataHost.StopCaching(this, MemberName); + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + private bool IsCached(string MemberName) { + return this.DataHost.IsCached(this, MemberName); + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "18.0.0.0")] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + private void BeginInitialization() { + this.BeginInit(); + this.CustomTaskPanes.BeginInit(); + this.VstoSmartTags.BeginInit(); + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "18.0.0.0")] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + private void EndInitialization() { + this.VstoSmartTags.EndInit(); + this.CustomTaskPanes.EndInit(); + this.EndInit(); + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "18.0.0.0")] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + private void InitializeControls() { + this.CustomTaskPanes = Globals.Factory.CreateCustomTaskPaneCollection(null, null, "CustomTaskPanes", "CustomTaskPanes", this); + this.VstoSmartTags = Globals.Factory.CreateSmartTagCollection(null, null, "VstoSmartTags", "VstoSmartTags", this); + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "18.0.0.0")] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + private void InitializeComponents() { + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + private bool NeedsFill(string MemberName) { + return this.DataHost.NeedsFill(this, MemberName); + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "18.0.0.0")] + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + protected override void OnShutdown() { + this.VstoSmartTags.Dispose(); + this.CustomTaskPanes.Dispose(); + base.OnShutdown(); + } + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "18.0.0.0")] + internal sealed partial class Globals { + + /// + private Globals() { + } + + private static ThisAddIn _ThisAddIn; + + private static global::Microsoft.Office.Tools.Word.ApplicationFactory _factory; + + private static ThisRibbonCollection _ThisRibbonCollection; + + internal static ThisAddIn ThisAddIn { + get { + return _ThisAddIn; + } + set { + if ((_ThisAddIn == null)) { + _ThisAddIn = value; + } + else { + throw new System.NotSupportedException(); + } + } + } + + internal static global::Microsoft.Office.Tools.Word.ApplicationFactory Factory { + get { + return _factory; + } + set { + if ((_factory == null)) { + _factory = value; + } + else { + throw new System.NotSupportedException(); + } + } + } + + internal static ThisRibbonCollection Ribbons { + get { + if ((_ThisRibbonCollection == null)) { + _ThisRibbonCollection = new ThisRibbonCollection(_factory.GetRibbonFactory()); + } + return _ThisRibbonCollection; + } + } + } + + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "18.0.0.0")] + internal sealed partial class ThisRibbonCollection : Microsoft.Office.Tools.Ribbon.RibbonCollectionBase { + + /// + internal ThisRibbonCollection(global::Microsoft.Office.Tools.Ribbon.RibbonFactory factory) : + base(factory) { } - protected override void FinishInitialization() { InternalStartup(); OnStartup(); } } } diff --git a/PlotDirector.NativeCompanion/Vsto/ThisAddIn.Designer.xml b/PlotDirector.NativeCompanion/Vsto/ThisAddIn.Designer.xml index 5de658fd..526c0bbe 100644 --- a/PlotDirector.NativeCompanion/Vsto/ThisAddIn.Designer.xml +++ b/PlotDirector.NativeCompanion/Vsto/ThisAddIn.Designer.xml @@ -1,3 +1,5 @@ - + + + \ No newline at end of file diff --git a/PlotDirector.NativeCompanion/Vsto/WordAdapter.cs b/PlotDirector.NativeCompanion/Vsto/WordAdapter.cs index 824b9f21..9a088d30 100644 --- a/PlotDirector.NativeCompanion/Vsto/WordAdapter.cs +++ b/PlotDirector.NativeCompanion/Vsto/WordAdapter.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using System.Windows.Forms; +using Message = PlotDirector.Companion.Protocol.Message; using PlotDirector.Companion.Client; using PlotDirector.Companion.Protocol; using Word = Microsoft.Office.Interop.Word; diff --git a/PlotDirector.NativeCompanion/WindowsValidation/Build-Developer.ps1 b/PlotDirector.NativeCompanion/WindowsValidation/Build-Developer.ps1 index 8a8945f7..74f78cb6 100644 --- a/PlotDirector.NativeCompanion/WindowsValidation/Build-Developer.ps1 +++ b/PlotDirector.NativeCompanion/WindowsValidation/Build-Developer.ps1 @@ -2,7 +2,7 @@ param([Parameter(Mandatory=$true)][string]$CertificateThumbprint) $ErrorActionPreference='Stop' $root=Split-Path $PSScriptRoot -Parent $vswhere=Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\Installer\vswhere.exe' -$msbuild=& $vswhere -latest -products '*' -find 'MSBuild\**\Bin\MSBuild.exe' | Select-Object -First 1 +$msbuild=& $vswhere -latest -requires Microsoft.VisualStudio.Workload.Office -find 'MSBuild\**\Bin\amd64\MSBuild.exe' | Select-Object -First 1 if(!$msbuild){throw 'Visual Studio MSBuild with Office/VSTO development tools is required.'} $project=Join-Path $root 'Vsto\PlotDirector.WordAddIn.csproj' & $msbuild $project /restore /t:Build /p:Configuration=Debug /p:SignManifests=true "/p:ManifestCertificateThumbprint=$CertificateThumbprint"