Compare commits

...

5 Commits

25 changed files with 905 additions and 20 deletions

View File

@ -0,0 +1,9 @@
{
"confirmationWorstMs": 3616,
"confirmationMedianMs": 3380,
"samples": 10,
"source": "Browser performance.now console metrics and direct Word screenshots; not cross-machine wall-clock subtraction",
"requestMedianMs": 442.5,
"confirmationP90NearestRankMs": 3604,
"exactViewportLatency": "UNAVAILABLE"
}

View File

@ -0,0 +1,64 @@
{
"vsto": {
"warnings": 0,
"errors": 0,
"result": "PASS"
},
"wordObservation": {
"diagnosticSinkFailureIncluded": true,
"physical": false,
"checks": 13,
"result": "PASS"
},
"serverDeployment": "None",
"focusedApplication": {
"result": "PASS",
"suites": [
"--native-companion",
"--native-companion-http",
"--native-workflow",
"--native-tray",
"--native-import",
"--intent-assessment"
]
},
"chapterSync": {
"result": "PASS",
"checks": 453
},
"databaseChanges": "None",
"physical": {
"installedVersion": "1.0.0.41",
"timedWarmRequests": 10,
"endpoint": "Browser dispatch to native-confirmed completion",
"postChange": "NOT RUN: .42 installation requires human approval",
"viewportPaintMs": null
},
"configuration": "No application/server/security setting changes; new native release metadata only",
"source": "0e331eacb5c27f48a140615cb267e37eafb49e36",
"foundation": {
"result": "PASS",
"checks": 305
},
"browserAutomation": {
"result": "BLOCKED",
"reason": "Repository and global Node runtimes lack declared Playwright dependencies; no prerequisites installed"
},
"application": {
"result": "PASS",
"checks": 633
},
"migrations": "None",
"solution": {
"warnings": 0,
"errors": 0,
"result": "PASS"
},
"storedProcedures": "None",
"package": {
"installer": 106,
"upgrade": 34,
"payload": 42,
"mage": "Both manifests valid"
}
}

View File

@ -0,0 +1,14 @@
{
"exactOriginalCaretOffset": "Not recorded; returned to original scene start",
"rawUiAndPrivateInventory": "Not committed",
"newCandidateInstalled": false,
"authorNotesOrSessionsChanged": false,
"diagnosticDialogClosed": true,
"wordRemainedSaved": true,
"temporaryCdpNetworkCaptureDisabled": true,
"productionTouched": false,
"originalFocusAndSceneRestored": true,
"manuscriptContentEdits": false,
"forcedSave": false,
"installedVersion": "1.0.0.41"
}

View File

@ -0,0 +1,27 @@
{
"family": [
{
"Version": "1.0.41",
"Context": 2
}
],
"components": [
{
"relative": "PlotDirector.WordAddIn.dll",
"version": "1.0.0.41",
"sha256": "D87B851DC6AAFC225438E32E9C7193252EB9A9E2223B3BD1922C3EC515828E63"
},
{
"relative": "Agent\\PlotDirector.Companion.Agent.dll",
"version": "1.0.0.41",
"sha256": "C0B508E4A2CDC467DB53AEC608DD5A23F0030CC0C1A01D07574CA50DFCF26E6D"
},
{
"relative": "Agent\\PlotDirector.Companion.Agent.exe",
"version": "1.0.0.41",
"sha256": "805EAAA44A38DD2A8409BC7B6D8C686C3FAD088255A579FDB03572B1A2C0F73A"
}
],
"agentProcesses": 1,
"wordProcesses": 1
}

View File

@ -0,0 +1,286 @@
{
"passed": [
"Exact release payload source and setup evidence agree",
"Final EXE and MSI hashes agree with build evidence",
"Bootstrapper assembly and file versions match the release",
"EXE embeds the exact signed MSI with no external payload dependency",
"Setup has an explicit asInvoker execution manifest",
"PlotDirectorCompanionSetup.exe uses the existing developer signer",
"PlotDirectorCompanionSetup.exe signature is valid or limited solely by developer trust",
"PlotDirectorCompanion.msi uses the existing developer signer",
"PlotDirectorCompanion.msi signature is valid or limited solely by developer trust",
"MSI version and source metadata match the final application",
"Major upgrade changes ProductCode and preserves the baseline UpgradeCode (1.0.41)",
"MSI is authored strictly per-user",
"MSI summary is compressed x64 and requires no elevated privileges",
"Install root remains current-user LocalAppData Programs",
"Payload directory is application-only: Microsoft.Office.Tools.Common.dll",
"Embedded CAB hash matches verified payload: Microsoft.Office.Tools.Common.dll",
"MSI file size matches payload: Microsoft.Office.Tools.Common.dll",
"Component GUID remains stable from baseline 1.0.41: Microsoft.Office.Tools.Common.dll",
"Payload directory is application-only: Microsoft.Office.Tools.Common.v4.0.Utilities.dll",
"Embedded CAB hash matches verified payload: Microsoft.Office.Tools.Common.v4.0.Utilities.dll",
"MSI file size matches payload: Microsoft.Office.Tools.Common.v4.0.Utilities.dll",
"Component GUID remains stable from baseline 1.0.41: Microsoft.Office.Tools.Common.v4.0.Utilities.dll",
"Payload directory is application-only: Microsoft.Office.Tools.dll",
"Embedded CAB hash matches verified payload: Microsoft.Office.Tools.dll",
"MSI file size matches payload: Microsoft.Office.Tools.dll",
"Component GUID remains stable from baseline 1.0.41: Microsoft.Office.Tools.dll",
"Payload directory is application-only: Microsoft.Office.Tools.v4.0.Framework.dll",
"Embedded CAB hash matches verified payload: Microsoft.Office.Tools.v4.0.Framework.dll",
"MSI file size matches payload: Microsoft.Office.Tools.v4.0.Framework.dll",
"Component GUID remains stable from baseline 1.0.41: Microsoft.Office.Tools.v4.0.Framework.dll",
"Payload directory is application-only: Microsoft.Office.Tools.Word.dll",
"Embedded CAB hash matches verified payload: Microsoft.Office.Tools.Word.dll",
"MSI file size matches payload: Microsoft.Office.Tools.Word.dll",
"Component GUID remains stable from baseline 1.0.41: Microsoft.Office.Tools.Word.dll",
"Payload directory is application-only: Microsoft.Office.Tools.Word.v4.0.Utilities.dll",
"Embedded CAB hash matches verified payload: Microsoft.Office.Tools.Word.v4.0.Utilities.dll",
"MSI file size matches payload: Microsoft.Office.Tools.Word.v4.0.Utilities.dll",
"Component GUID remains stable from baseline 1.0.41: Microsoft.Office.Tools.Word.v4.0.Utilities.dll",
"Payload directory is application-only: Microsoft.VisualStudio.Tools.Applications.Runtime.dll",
"Embedded CAB hash matches verified payload: Microsoft.VisualStudio.Tools.Applications.Runtime.dll",
"MSI file size matches payload: Microsoft.VisualStudio.Tools.Applications.Runtime.dll",
"Component GUID remains stable from baseline 1.0.41: Microsoft.VisualStudio.Tools.Applications.Runtime.dll",
"Payload directory is application-only: package.json",
"Embedded CAB hash matches verified payload: package.json",
"MSI file size matches payload: package.json",
"Component GUID remains stable from baseline 1.0.41: package.json",
"Payload directory is application-only: PlotDirector.Companion.Client.dll",
"Embedded CAB hash matches verified payload: PlotDirector.Companion.Client.dll",
"MSI file size matches payload: PlotDirector.Companion.Client.dll",
"Component GUID remains stable from baseline 1.0.41: PlotDirector.Companion.Client.dll",
"Payload directory is application-only: PlotDirector.Companion.Protocol.dll",
"Embedded CAB hash matches verified payload: PlotDirector.Companion.Protocol.dll",
"MSI file size matches payload: PlotDirector.Companion.Protocol.dll",
"Component GUID remains stable from baseline 1.0.41: PlotDirector.Companion.Protocol.dll",
"Payload directory is application-only: PlotDirector.WordAddIn.dll",
"Embedded CAB hash matches verified payload: PlotDirector.WordAddIn.dll",
"MSI file size matches payload: PlotDirector.WordAddIn.dll",
"Component GUID remains stable from baseline 1.0.41: PlotDirector.WordAddIn.dll",
"Payload directory is application-only: PlotDirector.WordAddIn.dll.manifest",
"Embedded CAB hash matches verified payload: PlotDirector.WordAddIn.dll.manifest",
"MSI file size matches payload: PlotDirector.WordAddIn.dll.manifest",
"Component GUID remains stable from baseline 1.0.41: PlotDirector.WordAddIn.dll.manifest",
"Payload directory is application-only: PlotDirector.WordAddIn.vsto",
"Embedded CAB hash matches verified payload: PlotDirector.WordAddIn.vsto",
"MSI file size matches payload: PlotDirector.WordAddIn.vsto",
"Component GUID remains stable from baseline 1.0.41: PlotDirector.WordAddIn.vsto",
"Payload directory is application-only: Microsoft.Windows.SDK.NET.dll",
"Embedded CAB hash matches verified payload: Agent/Microsoft.Windows.SDK.NET.dll",
"MSI file size matches payload: Agent/Microsoft.Windows.SDK.NET.dll",
"Component GUID remains stable from baseline 1.0.41: Agent/Microsoft.Windows.SDK.NET.dll",
"Payload directory is application-only: PlotDirector.Companion.Agent.deps.json",
"Embedded CAB hash matches verified payload: Agent/PlotDirector.Companion.Agent.deps.json",
"MSI file size matches payload: Agent/PlotDirector.Companion.Agent.deps.json",
"Component GUID remains stable from baseline 1.0.41: Agent/PlotDirector.Companion.Agent.deps.json",
"Payload directory is application-only: PlotDirector.Companion.Agent.dll",
"Embedded CAB hash matches verified payload: Agent/PlotDirector.Companion.Agent.dll",
"MSI file size matches payload: Agent/PlotDirector.Companion.Agent.dll",
"Component GUID remains stable from baseline 1.0.41: Agent/PlotDirector.Companion.Agent.dll",
"Payload directory is application-only: PlotDirector.Companion.Agent.exe",
"Embedded CAB hash matches verified payload: Agent/PlotDirector.Companion.Agent.exe",
"MSI file size matches payload: Agent/PlotDirector.Companion.Agent.exe",
"Component GUID remains stable from baseline 1.0.41: Agent/PlotDirector.Companion.Agent.exe",
"Payload directory is application-only: PlotDirector.Companion.Agent.runtimeconfig.json",
"Embedded CAB hash matches verified payload: Agent/PlotDirector.Companion.Agent.runtimeconfig.json",
"MSI file size matches payload: Agent/PlotDirector.Companion.Agent.runtimeconfig.json",
"Component GUID remains stable from baseline 1.0.41: Agent/PlotDirector.Companion.Agent.runtimeconfig.json",
"Payload directory is application-only: PlotDirector.Companion.Protocol.dll",
"Embedded CAB hash matches verified payload: Agent/PlotDirector.Companion.Protocol.dll",
"MSI file size matches payload: Agent/PlotDirector.Companion.Protocol.dll",
"Component GUID remains stable from baseline 1.0.41: Agent/PlotDirector.Companion.Protocol.dll",
"Payload directory is application-only: WinRT.Runtime.dll",
"Embedded CAB hash matches verified payload: Agent/WinRT.Runtime.dll",
"MSI file size matches payload: Agent/WinRT.Runtime.dll",
"Component GUID remains stable from baseline 1.0.41: Agent/WinRT.Runtime.dll",
"CAB includes the complete runtime inventory plus package.json, without symbols or extra state",
"Replacement preflight inventory exactly matches every embedded MSI payload path",
"All MSI registry writes are limited to exact Companion HKCU keys",
"Word registration uses signed local manifest and LoadBehavior3",
"Start-menu and Startup shortcuts target the installed tray executable",
"Uninstall cleanup excludes user state, documents, credentials and logs",
"Older MSI removal is transactional and precedes new files",
"Standard MSI installation and unified removal actions are present",
"Upgrade range includes baseline 1.0.41 without migrating advertised feature state",
"Newer versions are detected without removal and blocked from downgrade",
"Tray depends on existing .NET10 Windows Desktop x64 runtime",
"Bootstrapper retains normal-user escape, native context checks and exact-product stale metadata handling"
],
"sourceCommit": "0e331eacb5c27f48a140615cb267e37eafb49e36",
"signatures": [
{
"message": "A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.",
"file": "PlotDirectorCompanionSetup.exe",
"status": "UnknownError",
"thumbprint": "4F3EE0D52D2C60214FB1F81DF6E479820A16487F"
},
{
"message": "A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.",
"file": "PlotDirectorCompanion.msi",
"status": "UnknownError",
"thumbprint": "4F3EE0D52D2C60214FB1F81DF6E479820A16487F"
}
],
"executeSequence": [
{
"Action": "FindRelatedProducts",
"Condition": "",
"Sequence": "25"
},
{
"Action": "LaunchConditions",
"Condition": "",
"Sequence": "100"
},
{
"Action": "ValidateProductID",
"Condition": "",
"Sequence": "700"
},
{
"Action": "CostInitialize",
"Condition": "",
"Sequence": "800"
},
{
"Action": "FileCost",
"Condition": "",
"Sequence": "900"
},
{
"Action": "CostFinalize",
"Condition": "",
"Sequence": "1000"
},
{
"Action": "InstallValidate",
"Condition": "",
"Sequence": "1400"
},
{
"Action": "InstallInitialize",
"Condition": "",
"Sequence": "1500"
},
{
"Action": "RemoveExistingProducts",
"Condition": "OLDPRODUCTS",
"Sequence": "1510"
},
{
"Action": "ProcessComponents",
"Condition": "",
"Sequence": "1600"
},
{
"Action": "UnpublishFeatures",
"Condition": "",
"Sequence": "1800"
},
{
"Action": "RemoveShortcuts",
"Condition": "",
"Sequence": "3200"
},
{
"Action": "RemoveRegistryValues",
"Condition": "",
"Sequence": "3300"
},
{
"Action": "RemoveFiles",
"Condition": "",
"Sequence": "3500"
},
{
"Action": "RemoveFolders",
"Condition": "",
"Sequence": "3600"
},
{
"Action": "CreateFolders",
"Condition": "",
"Sequence": "3700"
},
{
"Action": "InstallFiles",
"Condition": "",
"Sequence": "4000"
},
{
"Action": "CreateShortcuts",
"Condition": "",
"Sequence": "4500"
},
{
"Action": "WriteRegistryValues",
"Condition": "",
"Sequence": "5000"
},
{
"Action": "RegisterUser",
"Condition": "",
"Sequence": "6000"
},
{
"Action": "RegisterProduct",
"Condition": "",
"Sequence": "6100"
},
{
"Action": "PublishFeatures",
"Condition": "",
"Sequence": "6300"
},
{
"Action": "PublishProduct",
"Condition": "",
"Sequence": "6400"
},
{
"Action": "InstallFinalize",
"Condition": "",
"Sequence": "6600"
}
],
"manual": "Installation, upgrade/uninstall/rollback, trust, Word restart, visual/theme/DPI/accessibility and author workflow acceptance not performed.",
"msiProperties": {
"COMPANIONVERSION": "1.0.0.42",
"ProductName": "PlotDirector Companion",
"MSIINSTALLPERUSER": "1",
"ProductVersion": "1.0.42",
"ADDLOCAL": "Complete",
"ARPPRODUCTICON": "PlotDirectorIcon",
"ARPURLINFOABOUT": "https://dev.plotdirector.com/",
"ARPNOMODIFY": "1",
"SOURCECOMMIT": "0e331eacb5c27f48a140615cb267e37eafb49e36",
"ARPNOREPAIR": "1",
"UpgradeCode": "{641A087B-9779-458C-B290-BCBBAD49319A}",
"ProductCode": "{E9EB08DF-DFDD-477B-B556-337A1952617F}",
"Manufacturer": "Nick Beckley",
"ProductLanguage": "1033",
"SecureCustomProperties": "OLDPRODUCTS;NEWERPRODUCTS"
},
"version": "1.0.0.42",
"upgrade": [
{
"UpgradeCode": "{641A087B-9779-458C-B290-BCBBAD49319A}",
"VersionMin": "",
"VersionMax": "1.0.42",
"Language": "",
"Attributes": "0",
"Remove": "ALL",
"ActionProperty": "OLDPRODUCTS"
},
{
"UpgradeCode": "{641A087B-9779-458C-B290-BCBBAD49319A}",
"VersionMin": "1.0.42",
"VersionMax": "",
"Language": "",
"Attributes": "2",
"Remove": "",
"ActionProperty": "NEWERPRODUCTS"
}
]
}

View File

@ -0,0 +1,48 @@
{
"passed": [
"Payload version and release publisher match",
"PlotDirector.WordAddIn.vsto identity matches release AnyCPU",
"PlotDirector.WordAddIn.vsto embeds the existing developer certificate",
"PlotDirector.WordAddIn.vsto reference resolves with exact size: PlotDirector.WordAddIn.dll.manifest",
"PlotDirector.WordAddIn.vsto SHA256 reference matches: PlotDirector.WordAddIn.dll.manifest",
"PlotDirector.WordAddIn.dll.manifest identity matches release AnyCPU",
"PlotDirector.WordAddIn.dll.manifest embeds the existing developer certificate",
"PlotDirector.WordAddIn.dll.manifest reference resolves with exact size: Microsoft.Office.Tools.dll",
"PlotDirector.WordAddIn.dll.manifest SHA256 reference matches: Microsoft.Office.Tools.dll",
"PlotDirector.WordAddIn.dll.manifest reference resolves with exact size: Microsoft.Office.Tools.Common.dll",
"PlotDirector.WordAddIn.dll.manifest SHA256 reference matches: Microsoft.Office.Tools.Common.dll",
"PlotDirector.WordAddIn.dll.manifest reference resolves with exact size: Microsoft.Office.Tools.Common.v4.0.Utilities.dll",
"PlotDirector.WordAddIn.dll.manifest SHA256 reference matches: Microsoft.Office.Tools.Common.v4.0.Utilities.dll",
"PlotDirector.WordAddIn.dll.manifest reference resolves with exact size: Microsoft.Office.Tools.Word.dll",
"PlotDirector.WordAddIn.dll.manifest SHA256 reference matches: Microsoft.Office.Tools.Word.dll",
"PlotDirector.WordAddIn.dll.manifest reference resolves with exact size: Microsoft.Office.Tools.Word.v4.0.Utilities.dll",
"PlotDirector.WordAddIn.dll.manifest SHA256 reference matches: Microsoft.Office.Tools.Word.v4.0.Utilities.dll",
"PlotDirector.WordAddIn.dll.manifest reference resolves with exact size: Microsoft.Office.Tools.v4.0.Framework.dll",
"PlotDirector.WordAddIn.dll.manifest SHA256 reference matches: Microsoft.Office.Tools.v4.0.Framework.dll",
"PlotDirector.WordAddIn.dll.manifest reference resolves with exact size: Microsoft.VisualStudio.Tools.Applications.Runtime.dll",
"PlotDirector.WordAddIn.dll.manifest SHA256 reference matches: Microsoft.VisualStudio.Tools.Applications.Runtime.dll",
"PlotDirector.WordAddIn.dll.manifest reference resolves with exact size: PlotDirector.Companion.Client.dll",
"PlotDirector.WordAddIn.dll.manifest SHA256 reference matches: PlotDirector.Companion.Client.dll",
"PlotDirector.WordAddIn.dll.manifest reference resolves with exact size: PlotDirector.Companion.Protocol.dll",
"PlotDirector.WordAddIn.dll.manifest SHA256 reference matches: PlotDirector.Companion.Protocol.dll",
"PlotDirector.WordAddIn.dll.manifest reference resolves with exact size: PlotDirector.WordAddIn.dll",
"PlotDirector.WordAddIn.dll.manifest SHA256 reference matches: PlotDirector.WordAddIn.dll",
"Signed VSTO deployment publisher is Nick Beckley",
"Application file version matches release: PlotDirector.WordAddIn.dll",
"Application file version matches release: Agent\\PlotDirector.Companion.Agent.exe",
"Application file version matches release: Agent\\PlotDirector.Companion.Agent.dll",
"Supporting library retains its declared stable version: PlotDirector.Companion.Client.dll",
"Supporting library retains its declared stable version: PlotDirector.Companion.Protocol.dll",
"Supporting library retains its declared stable version: Agent\\PlotDirector.Companion.Protocol.dll",
"Published tray apphost is native Windows x64",
"Native context guard accepts the existing current-user version10 upgrade",
"Native context guard accepts the working current-user version12 upgrade",
"Native context guard accepts the working current-user version13 upgrade",
"Native context guard accepts the working current-user version14 upgrade",
"Native context guard refuses machine without mutation",
"Native context guard refuses foreign-user without mutation",
"Native context guard refuses newer-version without mutation"
],
"sourceCommit": "0e331eacb5c27f48a140615cb267e37eafb49e36",
"version": "1.0.0.42"
}

View File

@ -0,0 +1,18 @@
[
{
"file": "PlotDirectorCompanionSetup.exe",
"sha256": "8C75694DA4403621082CD96FB1B91EDEF68B3F437E6EEB719DC3CCAE976B6BF1",
"status": "UnknownError",
"message": "A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.",
"signer": "4F3EE0D52D2C60214FB1F81DF6E479820A16487F",
"expiresUtc": "2026-12-04T20:57:39.0000000Z"
},
{
"file": "PlotDirectorCompanion.msi",
"sha256": "7C0BFBE14EB676A0943172A9C76A4BC7FD58AE472A43CFBFB6D32A7113E7C333",
"status": "UnknownError",
"message": "A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.",
"signer": "4F3EE0D52D2C60214FB1F81DF6E479820A16487F",
"expiresUtc": "2026-12-04T20:57:39.0000000Z"
}
]

View File

@ -0,0 +1,16 @@
[
{
"file": "PlotDirectorCompanionSetup.exe",
"sha256": "4220664759B48F09931A318D80FD7E84BA441F791A8AE0C796FCC0C290FBDFD4",
"status": "UnknownError",
"message": "A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.",
"signer": "4F3EE0D52D2C60214FB1F81DF6E479820A16487F"
},
{
"file": "PlotDirectorCompanion.msi",
"sha256": "1EFE374F8F7BEF9AC6A3958B331D3A783F61BECE40A53B8F12FB4657D89D8012",
"status": "UnknownError",
"message": "A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.",
"signer": "4F3EE0D52D2C60214FB1F81DF6E479820A16487F"
}
]

View File

@ -0,0 +1,13 @@
{
"msiVersion": "1.0.42",
"builtUtc": "2026-11-21T14:02:56.9285672Z",
"setupSha256": "8C75694DA4403621082CD96FB1B91EDEF68B3F437E6EEB719DC3CCAE976B6BF1",
"applicationCommit": "0e331eacb5c27f48a140615cb267e37eafb49e36",
"atlasBaseline": "9fed339879887964d526cff00772ffc4dc522c5d",
"msiSha256": "7C0BFBE14EB676A0943172A9C76A4BC7FD58AE472A43CFBFB6D32A7113E7C333",
"upgradeCode": "{641A087B-9779-458C-B290-BCBBAD49319A}",
"payloadPackage": "%USERPROFILE%\\Downloads\\PlotDirectorWordCompanion\\1.0.0.42-0e331eac",
"installerCommit": "0e331eacb5c27f48a140615cb267e37eafb49e36",
"version": "1.0.0.42",
"productCode": "{E9EB08DF-DFDD-477B-B556-337A1952617F}"
}

View File

@ -0,0 +1,46 @@
{
"passed": [
"Regression fixture records the real advertised-feature/no-file-action failure",
"Negative control: original released version12 MSI fails all four local-install invariants",
"Corrected MSI cannot inherit the recorded advertised feature selection",
"New release has its own major-upgrade identity, distinct from the failed version12 package",
"Compiled bootstrapper requests local files: version10 advertised-feature major upgrade",
"Compiled bootstrapper chooses correct repair mode: version10 advertised-feature major upgrade",
"Compiled bootstrapper requests local files: same-release advertised repair",
"Compiled bootstrapper chooses correct repair mode: same-release advertised repair",
"Strict check rejects and diagnoses old/mixed files: 1.0.0.10 / 1.0.0.10",
"Strict check rejects and diagnoses old/mixed files: 1.0.0.12 / 1.0.0.12",
"Strict check rejects and diagnoses old/mixed files: 1.0.0.13 / 1.0.0.13",
"Strict check rejects and diagnoses old/mixed files: 1.0.0.14 / 1.0.0.14",
"Strict check rejects and diagnoses old/mixed files: 1.0.0.42 / 1.0.0.10",
"Strict check rejects and diagnoses old/mixed files: 1.0.0.10 / 1.0.0.42",
"Strict check accepts matching release files",
"Compiled control flow explicitly promotes feature state 1 to Local before accepting versions",
"Compiled control flow explicitly promotes feature state 2 to Local before accepting versions",
"Compiled control flow explicitly promotes feature state 4 to Local before accepting versions",
"Already Local feature is not needlessly configured again",
"Compiled feature transition refuses native-error instead of trusting result0 or old files",
"Compiled feature transition refuses still-advertised instead of trusting result0 or old files",
"Compiled feature transition refuses unknown-state instead of trusting result0 or old files",
"Unknown native state is rejected before any configuration request",
"Bootstrapper wires explicit native Local configuration before strict version validation",
"Required file belongs to the locally selected Complete feature: PlotDirector.WordAddIn.dll",
"Required file belongs to the locally selected Complete feature: PlotDirector.Companion.Agent.exe",
"Replacement preflight accepts unlocked/missing payload without changing bytes",
"Actual Windows sharing lock on the reported DLL blocks setup before registration/MSI changes",
"Read-only replacement refusal reports access denied without relaxing permissions",
"Installer holds the existing tray singleton contract against shortcut/sign-in restart during copying",
"Singleton guard releases for later tray launch and payload bytes remain unchanged",
"Compiled replacement preflight inventory covers the whole MSI payload including the failed DLL and tray",
"Copy preflight precedes registration and all VSTO/MSI mutation",
"Singleton guard releases on failure and before the installed tray is started"
],
"correctedSetupSha256": "8C75694DA4403621082CD96FB1B91EDEF68B3F437E6EEB719DC3CCAE976B6BF1",
"scope": "Read-only MSI tables, compiled policy and disposable Windows file-lock fixtures only. No installed upgrade was executed.",
"rejectedOriginalAuthoring": [
"No explicit local Complete feature selection",
"Complete can be advertised or absent",
"Old advertised feature state is eligible for migration",
"MigrateFeatureStates action is scheduled"
]
}

View File

@ -0,0 +1,128 @@
[
{
"id": "8a70c935-adc5-4deb-9c92-a4131287fa58",
"trial": 1,
"note": "Word screenshot/ribbon checked after acknowledgement; exact paint latency not measured",
"result": "completed",
"confirmationMs": 2506,
"mode": "physical installed .41",
"kind": "scene-forward-same-chapter",
"requestMs": 464,
"correctDocumentAndTargetObserved": true,
"visibleLandingMs": null
},
{
"id": "d6bd090b-0050-4f42-8860-a9743f6f7d8e",
"trial": 2,
"note": "Word screenshot/ribbon checked after acknowledgement; exact paint latency not measured",
"result": "completed",
"confirmationMs": 3604,
"mode": "physical installed .41",
"kind": "scene-backward-same-chapter",
"requestMs": 503,
"correctDocumentAndTargetObserved": true,
"visibleLandingMs": null
},
{
"id": "bbc6f089-f6b4-4003-9a28-46f11c924e1f",
"trial": 3,
"note": "Word screenshot/ribbon checked after acknowledgement; exact paint latency not measured",
"result": "completed",
"confirmationMs": 3534,
"mode": "physical installed .41",
"kind": "scene-backward-same-chapter",
"requestMs": 445,
"correctDocumentAndTargetObserved": true,
"visibleLandingMs": null
},
{
"id": "d0a1e185-488f-478c-b403-5f9696bf940b",
"trial": 4,
"note": "Word screenshot/ribbon checked after acknowledgement; exact paint latency not measured",
"result": "completed",
"confirmationMs": 3616,
"mode": "physical installed .41",
"kind": "scene-repeat",
"requestMs": 517,
"correctDocumentAndTargetObserved": true,
"visibleLandingMs": null
},
{
"targetAndQueueMs": 139.43,
"result": "completed",
"mode": "physical installed .41",
"visibleLandingMs": null,
"confirmationMs": 2228,
"note": "Word screenshot/ribbon checked after acknowledgement; exact paint latency not measured",
"trial": 5,
"correctDocumentAndTargetObserved": true,
"kind": "chapter-backward-within-chapter",
"id": "0a14bdcc-056d-4969-afc7-a79443b48ecc",
"requestMs": 168
},
{
"targetAndQueueMs": 377.9,
"result": "completed",
"mode": "physical installed .41",
"visibleLandingMs": null,
"confirmationMs": 3505,
"note": "Word screenshot/ribbon checked after acknowledgement; exact paint latency not measured",
"trial": 6,
"correctDocumentAndTargetObserved": true,
"kind": "scene-forward-cross-chapter",
"id": "ac174f5f-eb31-4f86-8a7f-fc0ee4ac35c4",
"requestMs": 404
},
{
"targetAndQueueMs": 414.54,
"result": "completed",
"mode": "physical installed .41",
"visibleLandingMs": null,
"confirmationMs": 3519,
"note": "Word screenshot/ribbon checked after acknowledgement; exact paint latency not measured",
"trial": 7,
"correctDocumentAndTargetObserved": true,
"kind": "scene-backward-cross-chapter",
"id": "f96b67af-e78a-437d-95c5-05e195e5e263",
"requestMs": 440
},
{
"targetAndQueueMs": 135.26,
"result": "completed",
"mode": "physical installed .41",
"visibleLandingMs": null,
"confirmationMs": 3255,
"note": "Word screenshot/ribbon checked after acknowledgement; exact paint latency not measured",
"trial": 8,
"correctDocumentAndTargetObserved": true,
"kind": "chapter-backward",
"id": "90f13fde-d89f-4515-af15-c1746857b927",
"requestMs": 165
},
{
"targetAndQueueMs": 137.6,
"result": "completed",
"mode": "physical installed .41",
"visibleLandingMs": null,
"confirmationMs": 2230,
"note": "Word screenshot/ribbon checked after acknowledgement; exact paint latency not measured",
"trial": 9,
"correctDocumentAndTargetObserved": true,
"kind": "chapter-forward-cross-chapter",
"id": "72a0a24f-6fa0-4937-8cf8-5623122eddae",
"requestMs": 162
},
{
"targetAndQueueMs": 453.06,
"result": "completed",
"mode": "physical installed .41",
"visibleLandingMs": null,
"confirmationMs": 2577,
"note": "Word screenshot/ribbon checked after acknowledgement; exact paint latency not measured",
"trial": 10,
"correctDocumentAndTargetObserved": true,
"kind": "scene-same-chapter",
"id": "7285750a-3710-44c2-bd06-8e2ebeadd3a0",
"requestMs": 513
}
]

View File

@ -0,0 +1,17 @@
[
{
"file": "PlotDirector.WordAddIn.dll",
"version": "1.0.0.41",
"matchesQualifiedPayload": true
},
{
"file": "Agent/PlotDirector.Companion.Agent.exe",
"version": "1.0.0.41",
"matchesQualifiedPayload": true
},
{
"file": "Agent/PlotDirector.Companion.Agent.dll",
"version": "1.0.0.41",
"matchesQualifiedPayload": true
}
]

View File

@ -0,0 +1,38 @@
{
"adapterResults": [],
"groups": [
{
"operationAndStatus": "chapter-begin, ok",
"count": 15,
"maxHandlerMs": 0.24
},
{
"operationAndStatus": "chapter-chunk, ok",
"count": 8755,
"maxHandlerMs": 6.75
},
{
"operationAndStatus": "chapter-end, ok",
"count": 15,
"maxHandlerMs": 1.87
},
{
"operationAndStatus": "metrics, ok",
"count": 10,
"maxHandlerMs": 0.47
},
{
"operationAndStatus": "ping, ok",
"count": 16,
"maxHandlerMs": 0.47
},
{
"operationAndStatus": "selection, awaiting-structure",
"count": 13,
"maxHandlerMs": 0.49
}
],
"checkedUtc": "2026-11-21T13:25:08.7827915Z",
"scope": "Available rotating agent log operation handlers only; not end-to-end navigation",
"missing": "No command-ID-based cross-stage trace; IPC correlation is per exchange"
}

View File

@ -0,0 +1,6 @@
{
"jsSha256": "58123F11F50145323DB3C086768C0DD77E3442D16FE8B1D9D8720C7F9B130D54",
"assemblyVersion": "Not independently verified",
"checkedUtc": "2026-11-21T13:25:09.1045037Z",
"server": "https://dev.plotdirector.com/"
}

View File

@ -0,0 +1,148 @@
# Writer Phase 3B.4 — Word navigation latency investigation
**Measured baseline: ten real warm requests on installed .41 have a 3,380ms median native-confirmation time, 3,604ms p90 and 3,616ms worst. Median server acceptance is 442.5ms.** The requested under-two-second warm navigation outcome is not yet established. Exact click-to-visible-viewport timing remains unmeasured; screenshots verified landings after acknowledgement.
A signed **1.0.0.42 diagnostics candidate** is built and statically qualified. It supplies command-correlated native timings needed to separate acquisition, queue, COM selection and acknowledgement. It has **not been installed**. No polling/selection optimisation or speed improvement is claimed. Installation approval is the next gate; the overall investigation and Phase 3B.4 acceptance remain incomplete.
## 1. Environment and versions
Used the existing shared branch `codex/word-companion-native-phase1-20261104`. The original investigation checkpoint is `062cc06d`; final native diagnostics/package source is **`0e331eacb5c27f48a140615cb267e37eafb49e36`**. No branch/reset/force-push or unrelated cleanup was used.
Read-only MSI inventory and hashes confirm installed **MSI 1.0.41**, add-in/agent EXE/agent DLL **1.0.0.41**, matching the qualified `ea1aabb3` payload. One Word process, one installed agent, and one live document session were observed. The actual Companion UI confirmed Development, authenticated account/book association, saved Word revision 20, current scene proof, and 48 verified chapters. Account names, manuscript titles, book/session identifiers and prose are omitted here. Word's status bar reported approximately **154,925 words** during sampling; its count is not a new content audit. The manuscript was already open and loaded. Normal periodic verification remained enabled; some screenshots showed Checking with zero pending chapters.
This is the Windows 11/.NET 10/Office environment described by the existing preflight. Word About/hardware/power settings were not changed or independently requalified during these samples. Current physical app access became available after restart through computer use; its earlier unavailability is historical. A later automation connection reset interrupted one sample, which was excluded from statistics. Its eventual landing was checked before issuing another request.
Development's public `writer-word.js` SHA-256 matched `58123F11F50145323DB3C086768C0DD77E3442D16FE8B1D9D8720C7F9B130D54`. The earlier server assembly `1.0.0+80f7cb5...` attestation remains historical: a fresh authorised read-only assembly/DLL attestation is still needed. No server source, deployment, configuration or SQL change was made.
## 2. Reproduction procedure
On the existing authenticated Development Writer/Review tab, use Global Focus to choose known mapped chapters/scenes, then click the existing ribbon Chapter or Scene control. Leave manuscript content, objectives, notes and sessions unchanged. Confirm actual Word chapter/scene/visible landing after native acknowledgement. Separate the first uncontrolled console record and the connection-reset trial from the controlled warm set.
The ten timed samples include same-chapter forward/backward scenes, a repeated scene target, chapter-start requests and forward/backward cross-chapter requests. The same real document/session stayed selected. Word was observed visibly and was brought forward by navigation. Exact foreground-at-dispatch and side-by-side arrangements were not independently isolated, so those requested branches remain incomplete; a programmatic browser click is not proof of foreground policy. No cold/opening trial was run because the document was already open. No author document was closed, edited, rebound or forced to save.
## 3. Baseline measurements
All timings below are the page's existing `performance.now()` spans, paired by the actual navigation UUID. `requestMs` ends after the accepted response is processed; `confirmationMs` ends after a matching native-completed receipt is observed. These are not cross-machine UTC subtractions or exact viewport paint times.
| Trial | Request | Request ms | Confirmed ms | Server target/queue ms |
| --- | --- | ---: | ---: | ---: |
| 1 | Same-chapter scene forward | 464 | 2506 | unavailable |
| 2 | Same-chapter scene backward | 503 | 3604 | unavailable |
| 3 | Another scene backward | 445 | 3534 | unavailable |
| 4 | Same scene repeated | 517 | 3616 | unavailable |
| 5 | Current chapter start | 168 | 2228 | 139.43 |
| 6 | Scene forward across chapters | 404 | 3505 | 377.90 |
| 7 | Scene backward across chapters | 440 | 3519 | 414.54 |
| 8 | Chapter start after scene | 165 | 3255 | 135.26 |
| 9 | Chapter forward across chapters | 162 | 2230 | 137.60 |
| 10 | Scene in that chapter | 513 | 2577 | 453.06 |
Median confirmation **3380ms**, p90 **3604ms** using nearest rank, worst **3616ms**. Median request **442.5ms**. Full UUIDs and measurements: [warm-baseline.json](Evidence/Phase3B4/20261121T133321Z-navigation-physical/warm-baseline.json), [summary](Evidence/Phase3B4/20261121T133321Z-navigation-physical/baseline-summary.json).
An uncontrolled pre-existing console record showed 463ms request / 4606ms completed confirmation. It supports the reported symptom but is excluded from the controlled ten. Cleanup navigation back to the original scene took 437ms request / 3512ms confirmation, also excluded. The interrupted trial has no retained trustworthy timing and is not a performance failure or pass.
Word screenshots/ribbon context agreed with the intended chapters/scenes; one chapter-first scene remained near the chapter boundary in the visible window, so the screenshots cannot certify a precise caret-to-viewport paint deadline. After trial 10, native diagnostics reported 19 cumulative navigation executions and last command `7285750a-3710-44c2-bd06-8e2ebeadd3a0`, matching that request. The cumulative count is not asserted to be an isolated ten-execution delta because no starting counter was captured.
## 4. Observed delay breakdown
For six requests, Chrome network events supplied matching accepted-response Server-Timing: chapter target/queue **135–139ms**, scene target/queue **378–453ms**. The controller starts this timer after an initial ownership lookup, so it is not the entire server action. The browser total includes that lookup, transport, JSON processing and browser scheduling; do not call their residual a separate measured database span.
Subsequent receipt requests were approximately 13–18ms at response headers and occurred at the existing one-second polling cadence, generally requiring two or three polls in the captured requests. Thus the observed seconds are mostly **after HTTP acceptance**. This does not determine how much was command pickup, Word execution, native acknowledgement publication or browser polling. Faster receipt polling alone cannot demonstrate faster visible Word navigation.
Earlier passive rotating-log handler maxima and process-wide chapter timing counters are retained in the prior evidence directory. They are not per-command navigation execution costs. Native diagnostics during this run showed periodic chapter work, zero COM busy/errors, and aggregate historical COM/queue waits. No aggregate maximum is used as a navigation percentile or a measured share of the four-second symptom.
## 5. Instrumentation points and clock policy
Use the existing browser `navigationId` / `AdapterCommand.Id` / native `SnapshotId` / `NavigationAcknowledgedId` as the shared command identity. IPC `Message.CorrelationId` identifies a frame exchange, not that command. Proposed .42 adds an optional `UiMetric.NavigationId` without changing protocol version or required capabilities.
| Stage | Existing/candidate observation | Limit |
| --- | --- | --- |
| 1. Browser click | Existing dispatch `performance.now()` marker | Starts after initial handler guards, not physical input hardware |
| 2. Request preparation | Existing monotonic request log and Chrome Network events | Preparation is not separately timed |
| 3. Server receipt | Network round trip plus existing Server-Timing | Initial ownership lookup outside Server-Timing; exact receipt span unavailable |
| 4. Target/session validation | Existing `word-target-and-queue` span | Per-query split unavailable |
| 5. Server queue | Existing exact-session in-memory command | Server enqueue-to-take duration still unavailable |
| 6. Agent acquisition | .42 `presence-acquisition-roundtrip` | Times the acquiring request, not waiting until the next presence opportunity |
| 7. Agent dispatch | .42 `agent-queue-to-delivery` | Monotonic per-command local queue duration |
| 8. STA/scheduler | .42 `navigation-ui-dispatch`, `navigation-scheduler-wait` | Distinct waits; preserve existing scheduler/guards |
| 9. Validation/selection | .42 tagged `navigation-identity-and-target`, `navigation-word-selection` | Real COM call durations, not screen paint |
| 10. Viewport update | Actual Word screenshots | Exact paint timestamp remains unavailable |
| 11. Native acknowledgement | .42 `agent-queue-to-adapter-result` | Includes dispatch/execution/return; overlaps subspans |
| 12. Ack publication | .42 `adapter-result-to-ack-presence`, `ack-presence-roundtrip` | Successful publication request timing, not a new success assertion |
| 13. Browser confirmation | Existing UUID-tagged monotonic confirmation log | Includes receipt polling; completed still requires native evidence |
Durations are captured within each process with Stopwatch or browser performance.now. Correlate process-local spans by UUID and their defined endpoints; UTC log timestamps are ordering metadata only. Do not subtract unsynchronised browser/server/native wall clocks or sum overlapping spans. Unknown spans, dropped bounded metrics and missing paint samples remain unavailable, never zero.
Full thirteen-stage instrumentation is not yet complete. The candidate addresses the native blind spots without a second navigation architecture or risky runtime hook. Server queue residence and actual painted-viewport timing may still require additional safe evidence after the native spans are known.
## 6. Root cause and optimisation decision
**Confirmed:** warm native-confirmation latency exceeds two seconds in these samples, and server acceptance accounts for hundreds of milliseconds rather than the entire multi-second delay.
**Not yet confirmed:** the dominant source of actual visible Word latency. Existing two-second presence spacing, idle IPC pickup, Word scheduler/COM work, periodic verification and one-second receipt polling remain hypotheses to separate. Scene validation is measurably slower than chapter validation in the captured requests; that alone does not justify replacing accepted/live provenance checks or full manuscript reads with unsafe cached positions.
No performance correction was made and no best-safe limiting stage has been demonstrated. The task's completion criterion remains unmet until real post-acceptance spans and visible landing evidence explain the symptom and justify either an optimisation or a measured external limit.
## 7. Diagnostics correction implemented
Native candidate source `0e331eac...` adds bounded UUID-tagged timing metadata to existing metrics/logs. It measures the existing STA and scheduler waits, target validation/selection, agent delivery/result spans and acknowledgement publication. Logging contains command IDs/stage/duration only; no prose, account identifiers or credentials. Existing metric/frame limits and rotating log infrastructure are reused; high-frequency chapter/selection metrics are not newly logged individually. The coordinator timing sink is isolated from command execution if it throws.
Acknowledgement ID, result and its monotonic event timestamp are captured atomically. Publication timing starts after that snapshot, avoiding an acknowledgement arriving during request preparation being represented as a negative wait. No polling interval, queue capacity, target resolver, focus behavior, ribbon feedback, UI layout, freshness lifetime, expiry, identity, revision/provenance check or native success criterion was relaxed.
Source changes: `Agent/TrayCoordinator.cs`, `Agent/TrayApplication.cs`, `Agent/PipeHost.cs`, `Vsto/WordAdapter.cs`, optional metric field in `Protocol/Messages.cs`, focused tests in `Tests/Program.cs` and `Tests/WordObservationTests.cs`, and the existing three native release metadata files. No application/server code, historical SQL, migrations or stored procedures changed. Version metadata advances to **1.0.0.42 / MSI 1.0.42** with a new ProductCode and the same UpgradeCode. Earlier uninstalled candidates remain private at distinct source-specific paths and are superseded; no released package was overwritten.
## 8. Automated qualification
Final candidate built fresh through the supported update pipeline from exact source `0e331eacb5c27f48a140615cb267e37eafb49e36`:
- Complete solution and Office-equipped VSTO builds: **PASS, zero warnings/errors**.
- Native foundation: **305 PASS**, including optional UUID/timing codec preservation.
- Native observation/navigation: **13 PASS**, including command identity and a deliberately throwing diagnostic sink, plus existing stale-observation/recovery/acknowledgement guards.
- Native chapter synchronisation: **453 PASS**.
- Six focused native application suites: **PASS**.
- Full executable application harness: **633 PASS**, exit 0; no dotnet-test substitution.
- Developer payload **42**, MSI/CAB/package **106**, historical failed-upgrade regression **34** assertions: **PASS**. Both mage manifests have valid signatures.
The repository/global Node runtimes lack the declared Playwright dependencies. Automated browser/Writer/R2 scripts were **BLOCKED**, not claimed as passed; no prerequisites installed automatically. Web chooser source is unchanged. The real .41 samples above do not replace the automated fixtures or post-change .42 physical tests. No physical stalled-Word or two-document R2 test was fabricated on the author manuscript.
[Qualification evidence](Evidence/Phase3B4/20261121T133321Z-navigation-physical/checks.json) records scope and counts. Raw build/test/inventory logs remain private outside Git.
## 9. Signed candidate and rollback
Reviewable final installer:
`C:\Users\Nick\Downloads\PlotDirectorCompanion-1.0.0.42-0e331eac\PlotDirectorCompanionSetup.exe`
- Version **1.0.0.42**, MSI **1.0.42**.
- Source/application/installer SHA **0e331eacb5c27f48a140615cb267e37eafb49e36**.
- EXE SHA-256 **8C75694DA4403621082CD96FB1B91EDEF68B3F437E6EEB719DC3CCAE976B6BF1**.
- MSI SHA-256 **7C0BFBE14EB676A0943172A9C76A4BC7FD58AE472A43CFBFB6D32A7113E7C333**.
- Signer CN=PlotDirector Phase 1 Local Developer; thumbprint **4F3EE0D52D2C60214FB1F81DF6E479820A16487F**; expires 4 December 2026 20:57:39 UTC.
Authenticode reports **UnknownError solely because the developer chain terminates in an untrusted root**, matching the existing signer and documented developer policy. Mage signatures/digests are valid; independent package assertions passed. This is not public distribution trust. Human review of the trust prompt remains required; no trust-store or security setting was changed.
The installed working .41 and preserved signed rollback EXE/MSI remain available at `C:\Users\Nick\Downloads\PlotDirectorQualification\20261121-recovery\setup`. Rechecked EXE hash **4220664759B48F09931A318D80FD7E84BA441F791A8AE0C796FCC0C290FBDFD4**, MSI **1EFE374F8F7BEF9AC6A3958B331D3A783F61BECE40A53B8F12FB4657D89D8012**. The .41 MSI was used for static upgrade/component continuity qualification. Its existing signatures carry the same developer-root-only warning. Rollback would require separately approved normal uninstall before the older unified EXE; no downgrade bypass or blind registration restore is proposed.
[Signatures](Evidence/Phase3B4/20261121T133321Z-navigation-physical/qualified-signatures.json), [setup/source metadata](Evidence/Phase3B4/20261121T133321Z-navigation-physical/setup-evidence.json), [installed state](Evidence/Phase3B4/20261121T133321Z-navigation-physical/installation-after-sanitized.json).
## 10. Installation and deployment status
**Installed version remains .41; .42 is not installed.** No server deployment/restart, schema/configuration or Production operation occurred. Current server/native capability compatibility for unchanged navigation contracts is exercised by .41; .42 adds optional native diagnostics and does not require a server protocol/migration change. Actual loaded .42 and its diagnostics still need physical verification after approval.
The handover requires normal Word saving/closure and human launch of the unified EXE from File Explorer during an approved interactive window. The latency task explicitly requires approval before replacing the installed Companion. Do not install automatically, close an author document, dismiss trust UI or terminate an agent/Word process to force a test.
## 11. Physical qualification and before/after
Before: ten warm real .41 requests, confirmed and target-inspected, with the limits above. After: **NOT RUN**, pending installation approval. No latency improvement, p90 non-regression, exact viewport deadline, physical R1/R2 completion or final navigation qualification is claimed for .42.
After installation, verify per-user Complete=3, actual .42 loaded add-in/installed running agent and package hashes; keep the approved .41 rollback available. Repeat the same targets and normal periodic-check condition, capture UUID-tagged native spans and browser network timings, and obtain precise visible-landing timing with an approved safe observation method. Include foreground/side-by-side branches explicitly and separate cold from warm. Use a disposable copy for anything requiring edits, sync interruption or diagnostic disruption. Only then choose the smallest demonstrated safe performance correction and requalify affected components.
## 12. Cleanup, assumptions and remaining blockers
Only navigation/focus and read-only diagnostics were exercised in the author document. It remained Saved; no text, properties, markers, annotations, objectives or sessions were edited. Global Focus and Word were returned to the original scene start; the exact starting caret offset was not recorded, so exact-offset restoration is not asserted. Word's diagnostics modal and Companion settings dialog were closed; no settings were changed. Temporary Chrome Network capture was disabled. No manuscript screenshots, prose, identity/profile report, credentials, tokens, registry export or installer binaries enter Git.
Remaining prerequisites: explicit .42 installation/trust approval; fresh server assembly/hash attestation; available browser regression dependencies; post-change physical traces, including missing server queue/viewport timing; explicit arrangement/foreground branches. Existing synthetic stall/provenance requirements in the acceptance matrix remain separate. Timing samples include normal background periodic verification; they are not an add-in-disabled baseline or a cold-start study.
## 13. Impact on Phase 3B.4
The 91-case acceptance matrix and earlier run history are unchanged. These navigation-only author-document observations are separate investigation evidence, not wholesale acceptance-case passes requiring disposable fixtures/P0. Phase 3B.4 is **not formally accepted**. The next concrete action is approval of the verified diagnostics installation; the overall latency task remains active until the symptom is explained with measured spans and safely improved or demonstrated to be externally limited.

View File

@ -65,7 +65,7 @@ public sealed class PipeHost(string pipeName, SessionManager sessions, Action<st
var message = await ReadWithTimeout(pipe,cancellation,TimeSpan.FromMinutes(2));
if (message.Version != ProtocolVersion.Current || message.WordInstanceId != instance) throw new InvalidDataException("Peer changed protocol/instance.");
if(message.Metrics==null||message.Metrics.Length>32||message.Metrics.Any(m=>m==null||m.Operation==null||m.Operation.Length>48||!double.IsFinite(m.Milliseconds)||m.Milliseconds<0||m.Milliseconds>600000))throw new InvalidDataException("Invalid metric frame.");
foreach(var metric in message.Metrics)timings.Record(metric);
foreach(var metric in message.Metrics){timings.Record(metric);if(metric.NavigationId!=Guid.Empty&&metric.Operation.StartsWith("navigation-",StringComparison.Ordinal))log?.Invoke(FormattableString.Invariant($"navigation id={metric.NavigationId:N} stage={metric.Operation} elapsedMs={metric.Milliseconds:F2}"));}
var watch = Stopwatch.StartNew();
var answer = sessions.Apply(lease,message);
if(control!=null&&trayAdapter)answer=control.Exchange(instance,message,answer,lease);

View File

@ -13,7 +13,7 @@ internal static class TrayApplication
catch(IOException){try{using var pipe=new NamedPipeClientStream(".",endpoint+".activate",PipeDirection.Out,PipeOptions.CurrentUserOnly);pipe.Connect(2000);pipe.WriteByte(1);}catch(IOException){}catch(TimeoutException){}return 0;}
using(singleton)using(var shutdown=new CancellationTokenSource())using(var cloud=new CloudGateway(settingsPath:Path.Combine(directory,"server-url.txt")))using(var ai=new ChapterAiWork(cloud)){
Application.SetHighDpiMode(HighDpiMode.PerMonitorV2);Application.EnableVisualStyles();Application.SetCompatibleTextRenderingDefault(false);
var log=new AgentLog(directory);var sessions=new SessionManager(cloud,ai,new DocumentWorkspaceWork(cloud));var control=new TrayCoordinator(sessions,cloud,ai);
var log=new AgentLog(directory);var sessions=new SessionManager(cloud,ai,new DocumentWorkspaceWork(cloud));var control=new TrayCoordinator(sessions,cloud,ai,navigationTrace:log.Write);
var media=new WindowsMediaControl();var audio=new WindowsAudioReview(cloud,control,media,directory);
control.AudioRequested+=audio.Request;
control.AudioStatus=session=>audio.ForSession(session) is { } source

View File

@ -2,7 +2,7 @@ using PlotDirector.Companion.Protocol;
namespace PlotDirector.Companion.Agent;
// One control centre in the existing agent. Exact-session commands only; no COM or UI objects.
public sealed partial class TrayCoordinator(SessionManager sessions,CloudGateway cloud,ChapterAiWork ai,TimeProvider? synchronisationClock=null)
public sealed partial class TrayCoordinator(SessionManager sessions,CloudGateway cloud,ChapterAiWork ai,TimeProvider? synchronisationClock=null,Action<string>? navigationTrace=null)
{
// Match the existing server lease window; transport heartbeats cannot renew UI evidence indefinitely.
private static readonly TimeSpan WordObservationLifetime=TimeSpan.FromSeconds(45);
@ -13,6 +13,7 @@ public sealed partial class TrayCoordinator(SessionManager sessions,CloudGateway
private readonly HashSet<Guid> acknowledgedNavigationInstances=[];private readonly HashSet<Guid> rangeInstances=[];private readonly HashSet<Guid> paragraphInstances=[];private readonly HashSet<Guid> chapterInstances=[];
private readonly object gate=new();private readonly Dictionary<Guid,TrayDocument> documents=[];
private readonly Dictionary<Guid,Queue<AdapterCommand>> commands=[];private readonly Dictionary<Guid,Guid> leases=[];private readonly HashSet<Guid> captureInstances=[];private readonly HashSet<Guid> maintenanceInstances=[];private readonly Dictionary<Guid,(Guid Session,Guid Manuscript,Guid Authentication,string Kind,DateTime Started)> maintenance=[];private readonly Dictionary<(Guid,Guid),(Guid Manuscript,Guid Authentication,int Book,DateTime Expires)> reconnectBindings=[];
private void TraceNavigation(Guid id,string stage,double elapsedMs){try{navigationTrace?.Invoke(FormattableString.Invariant($"navigation id={id:N} stage={stage} elapsedMs={elapsedMs:F2}"));}catch{/* Diagnostics must not change command execution. */}}
public event Action? OpenRequested;
internal event Action<Guid,string>? AudioRequested;
internal Func<Guid,(string State,string[] Operations)>? AudioStatus { get; set; }
@ -59,7 +60,8 @@ public sealed partial class TrayCoordinator(SessionManager sessions,CloudGateway
if(request.Kind=="snapshot-fragment")doc.Progress=answer.Progress;
if(request.Kind=="snapshot-end"&&answer.Status=="analysis-complete"){doc.Chapters=sessions.Chapters(instance,doc.Session);doc.Status=$"Detected {doc.Chapters.Length} Heading 1 / existing-marker chapters. Scenes require explicit server AI analysis.";doc.Progress=100;}
if(request.Kind=="adapter-result"&&doc.PendingNavigation!=Guid.Empty&&request.SnapshotId==doc.PendingNavigation){
if(request.Revision==doc.NavigationRevision&&request.Revision==doc.Revision&&DateTime.UtcNow<=doc.NavigationExpires){doc.NavigationAcknowledgedId=request.SnapshotId;doc.NavigationResult=request.OperationMessage=="ok"?"completed":"failed";doc.LastPresenceKey="";doc.LastPresenceUtc=DateTime.MinValue;}doc.PendingNavigation=Guid.Empty;
if(doc.NavigationQueuedTimestamp!=0)TraceNavigation(request.SnapshotId,"agent-queue-to-adapter-result",System.Diagnostics.Stopwatch.GetElapsedTime(doc.NavigationQueuedTimestamp).TotalMilliseconds);
if(request.Revision==doc.NavigationRevision&&request.Revision==doc.Revision&&DateTime.UtcNow<=doc.NavigationExpires){doc.NavigationAckTimestamp=System.Diagnostics.Stopwatch.GetTimestamp();doc.NavigationAcknowledgedId=request.SnapshotId;doc.NavigationResult=request.OperationMessage=="ok"?"completed":"failed";doc.LastPresenceKey="";doc.LastPresenceUtc=DateTime.MinValue;}doc.PendingNavigation=Guid.Empty;
}
else if(request.Kind=="adapter-result"&&maintenance.Remove(request.SnapshotId,out var operation)&&operation.Session==doc.Session){doc.MaintenanceReport=request.OperationMessage;if(request.OperationMessage.StartsWith("Complete:",StringComparison.Ordinal)&&operation.Kind is "reset" or "clean"){cloud.ForgetBinding(operation.Manuscript,operation.Authentication);doc.Book=0;doc.AssociationRequest=Guid.Empty;doc.AssociationNeedsSave=false;doc.AssociationNotice="";doc.RememberedBook=null;doc.AssociationSite="";doc.ChapterId=null;doc.SceneId=null;doc.LastPresenceKey="";_=cloud.RemovePresence(doc.Instance,doc.Session,doc.PresenceSequence);} }
else if(request.Kind=="adapter-result"&&request.SnapshotId==doc.AssociationRequest&&doc.AssociationRequest!=Guid.Empty){
@ -81,13 +83,13 @@ public sealed partial class TrayCoordinator(SessionManager sessions,CloudGateway
if(connection.Health?.Authentication=="verified"&&AudioStatus?.Invoke(activeDocument.Session) is { } audio)
{ answer.AudioState=audio.State;answer.AudioOperations=audio.Operations; }
}
if(commands.TryGetValue(instance,out var queue))while(queue.Count>0){var queued=queue.Dequeue();if(queued.Kind=="navigate"&&(!documents.TryGetValue(queued.SessionId,out var target)||!FreshWordObservation(target)))continue;answer.Command=queued;break;}
if(commands.TryGetValue(instance,out var queue))while(queue.Count>0){var queued=queue.Dequeue();if(queued.Kind=="navigate"&&(!documents.TryGetValue(queued.SessionId,out var target)||!FreshWordObservation(target)))continue;if(queued.Kind=="navigate"&&documents.TryGetValue(queued.SessionId,out var queuedDoc)&&queuedDoc.NavigationQueuedTimestamp!=0)TraceNavigation(queued.Id,"agent-queue-to-delivery",System.Diagnostics.Stopwatch.GetElapsedTime(queuedDoc.NavigationQueuedTimestamp).TotalMilliseconds);answer.Command=queued;break;}
return answer;
}
}
public void Disconnected(Guid instance,Guid lease=default){lock(gate){if(lease!=Guid.Empty&&leases.GetValueOrDefault(instance)!=lease)return;leases.Remove(instance);acknowledgedNavigationInstances.Remove(instance);rangeInstances.Remove(instance);chapterInstances.Remove(instance);paragraphInstances.Remove(instance);captureInstances.Remove(instance);maintenanceInstances.Remove(instance);foreach(var expired in reconnectBindings.Where(p=>p.Value.Expires<=DateTime.UtcNow).Select(p=>p.Key).ToArray())reconnectBindings.Remove(expired);foreach(var doc in documents.Values.Where(d=>d.Instance==instance).ToArray()){if(doc.Book>0&&reconnectBindings.Count<256)reconnectBindings[(instance,doc.Session)]=(doc.Manuscript,doc.Authentication,doc.Book,DateTime.UtcNow.AddMinutes(2));Remove(doc.Session);}commands.Remove(instance);}}
private void Remove(Guid session){chapterWork.Remove(session);paragraphSnapshots.Remove(session);foreach(var key in maintenance.Where(p=>p.Value.Session==session).Select(p=>p.Key).ToArray())maintenance.Remove(key);if(documents.Remove(session,out var doc)){Cancel(doc);_ = cloud.RemovePresence(doc.Instance,doc.Session,doc.PresenceSequence);}}
private bool Queue(TrayDocument doc,AdapterCommand command){if(command.Kind=="navigate"&&!FreshWordObservation(doc)){doc.Status="Word position awaits a fresh UI observation. Nothing was requested.";return false;}if(!commands.TryGetValue(doc.Instance,out var queue))commands[doc.Instance]=queue=new();if(queue.Count>=16){doc.Status="Word request queue is busy. Retry after current operation.";return false;}command.SessionId=doc.Session;command.Revision=doc.Revision;queue.Enqueue(command);return true;}
private bool Queue(TrayDocument doc,AdapterCommand command){if(command.Kind=="navigate"&&!FreshWordObservation(doc)){doc.Status="Word position awaits a fresh UI observation. Nothing was requested.";return false;}if(!commands.TryGetValue(doc.Instance,out var queue))commands[doc.Instance]=queue=new();if(queue.Count>=16){doc.Status="Word request queue is busy. Retry after current operation.";return false;}command.SessionId=doc.Session;command.Revision=doc.Revision;queue.Enqueue(command);if(command.Kind=="navigate")doc.NavigationQueuedTimestamp=System.Diagnostics.Stopwatch.GetTimestamp();return true;}
public bool CanMaintain(Guid session){lock(gate)return documents.TryGetValue(session,out var d)&&maintenanceInstances.Contains(d.Instance);}
public void Maintain(Guid session,string kind)
{
@ -168,7 +170,7 @@ public sealed partial class TrayCoordinator(SessionManager sessions,CloudGateway
public async Task Heartbeat(CancellationToken cancellation)
{
while(!cancellation.IsCancellationRequested){await Task.Delay(TimeSpan.FromMilliseconds(500),cancellation);var available=Documents.Where(d=>d.Authentication==cloud.Status().AuthenticationContext&&cloud.Status().Health?.Authentication=="verified").ToArray();
foreach(var doc in available){var freshObservation=FreshWordObservation(doc);if(doc.LastPresenceKey==""&&DateTime.UtcNow-doc.LastPresenceUtc<TimeSpan.FromSeconds(2))continue;var key=$"{freshObservation}:{doc.Capture?.RequestId}:{(doc.Capture!=null?doc.Progress/5:0)}:{doc.WordSaved}:{doc.Book}:{doc.Revision}:{doc.ChapterId}:{doc.SceneId}:{doc.Active}:{doc.NavigationAcknowledgedId}:{doc.NavigationResult}:{(ParagraphCapable(doc.Instance)||!doc.SceneId.HasValue?doc.Cursor:0)}";if(key==doc.LastPresenceKey&&DateTime.UtcNow-doc.LastPresenceUtc<TimeSpan.FromSeconds(acknowledgedNavigationInstances.Contains(doc.Instance)?2:15))continue;try{var reply=await cloud.Presence(doc.Instance,doc.Session,new(){CanAcknowledgeNavigation=acknowledgedNavigationInstances.Contains(doc.Instance),NavigationAcknowledgedId=doc.NavigationAcknowledgedId,NavigationResult=doc.NavigationResult,CaptureRequestId=doc.Capture?.RequestId,CaptureProgress=doc.Progress,ChapterIssue=ChapterIssue(doc),CanChapterSync=ChapterCapable(doc.Instance),CanParagraphSync=ParagraphCapable(doc.Instance),CanCapture=captureInstances.Contains(doc.Instance),WordRunning=true,WordSaved=freshObservation?doc.WordSaved:null,CursorStart=freshObservation?doc.Cursor:null,ManuscriptId=doc.Manuscript,BookId=doc.Book,Revision=doc.Revision,Sequence=doc.PresenceSequence=Interlocked.Increment(ref presenceSequence),ChapterId=freshObservation?doc.ChapterId:null,SceneId=freshObservation?doc.SceneId:null,Active=doc.Active,DocumentTitle=doc.Title},doc.Authentication);lock(gate){if(documents.GetValueOrDefault(doc.Session)!=doc||(ChapterCapable(doc.Instance)&&reply.Revision!=doc.Revision)||doc.Authentication!=cloud.Status().AuthenticationContext)continue;if(ChapterCapable(doc.Instance)&&chapterWork.TryGetValue(doc.Session,out var currentChapters)&&currentChapters.Manifest!=null&&reply.ParagraphRevision>0&&reply.ParagraphRevision<currentChapters.Manifest.Revision)continue;doc.LastPresenceKey=key;doc.LastPresenceUtc=DateTime.UtcNow;doc.ChapterProgress=reply.ChapterProgress;if(ChapterCapable(doc.Instance))ChapterCursorEvidence.Apply(doc,reply);else{doc.ChapterTitle=reply.ChapterTitle;doc.SceneTitle=reply.SceneTitle;}ObserveChapterPresence(doc,reply);}
foreach(var doc in available){var freshObservation=FreshWordObservation(doc);if(doc.LastPresenceKey==""&&DateTime.UtcNow-doc.LastPresenceUtc<TimeSpan.FromSeconds(2))continue;var key=$"{freshObservation}:{doc.Capture?.RequestId}:{(doc.Capture!=null?doc.Progress/5:0)}:{doc.WordSaved}:{doc.Book}:{doc.Revision}:{doc.ChapterId}:{doc.SceneId}:{doc.Active}:{doc.NavigationAcknowledgedId}:{doc.NavigationResult}:{(ParagraphCapable(doc.Instance)||!doc.SceneId.HasValue?doc.Cursor:0)}";if(key==doc.LastPresenceKey&&DateTime.UtcNow-doc.LastPresenceUtc<TimeSpan.FromSeconds(acknowledgedNavigationInstances.Contains(doc.Instance)?2:15))continue;try{var presenceClock=System.Diagnostics.Stopwatch.StartNew();Guid? publishedNavigation;long publishedAckTimestamp;string publishedResult;lock(gate){publishedNavigation=doc.NavigationAcknowledgedId;publishedAckTimestamp=doc.NavigationAckTimestamp;publishedResult=doc.NavigationResult;}var presenceStarted=System.Diagnostics.Stopwatch.GetTimestamp();var reply=await cloud.Presence(doc.Instance,doc.Session,new(){CanAcknowledgeNavigation=acknowledgedNavigationInstances.Contains(doc.Instance),NavigationAcknowledgedId=publishedNavigation,NavigationResult=publishedResult,CaptureRequestId=doc.Capture?.RequestId,CaptureProgress=doc.Progress,ChapterIssue=ChapterIssue(doc),CanChapterSync=ChapterCapable(doc.Instance),CanParagraphSync=ParagraphCapable(doc.Instance),CanCapture=captureInstances.Contains(doc.Instance),WordRunning=true,WordSaved=freshObservation?doc.WordSaved:null,CursorStart=freshObservation?doc.Cursor:null,ManuscriptId=doc.Manuscript,BookId=doc.Book,Revision=doc.Revision,Sequence=doc.PresenceSequence=Interlocked.Increment(ref presenceSequence),ChapterId=freshObservation?doc.ChapterId:null,SceneId=freshObservation?doc.SceneId:null,Active=doc.Active,DocumentTitle=doc.Title},doc.Authentication);if(reply.Navigation?.Kind=="navigate")TraceNavigation(reply.Navigation.Id,"presence-acquisition-roundtrip",presenceClock.Elapsed.TotalMilliseconds);if(publishedNavigation.HasValue&&doc.LastTracedNavigationAck!=publishedNavigation.Value){if(publishedAckTimestamp!=0)TraceNavigation(publishedNavigation.Value,"adapter-result-to-ack-presence",System.Diagnostics.Stopwatch.GetElapsedTime(publishedAckTimestamp,presenceStarted).TotalMilliseconds);TraceNavigation(publishedNavigation.Value,"ack-presence-roundtrip",presenceClock.Elapsed.TotalMilliseconds);doc.LastTracedNavigationAck=publishedNavigation.Value;}lock(gate){if(documents.GetValueOrDefault(doc.Session)!=doc||(ChapterCapable(doc.Instance)&&reply.Revision!=doc.Revision)||doc.Authentication!=cloud.Status().AuthenticationContext)continue;if(ChapterCapable(doc.Instance)&&chapterWork.TryGetValue(doc.Session,out var currentChapters)&&currentChapters.Manifest!=null&&reply.ParagraphRevision>0&&reply.ParagraphRevision<currentChapters.Manifest.Revision)continue;doc.LastPresenceKey=key;doc.LastPresenceUtc=DateTime.UtcNow;doc.ChapterProgress=reply.ChapterProgress;if(ChapterCapable(doc.Instance))ChapterCursorEvidence.Apply(doc,reply);else{doc.ChapterTitle=reply.ChapterTitle;doc.SceneTitle=reply.SceneTitle;}ObserveChapterPresence(doc,reply);}
if(reply.ParagraphRevision>0&&!ChapterCapable(doc.Instance))lock(gate)if(documents.GetValueOrDefault(doc.Session)==doc&&reply.Revision==doc.Revision&&doc.Authentication==cloud.Status().AuthenticationContext){doc.ChapterId=reply.ChapterId;doc.SceneId=reply.SceneId;}
if(reply.Navigation is {Kind:"wizard-capture",BookId:>0} requested&&requested.SessionId==doc.Session&&requested.Revision==doc.Revision&&doc.Book==0){await cloud.CheckConnection();lock(gate){if(doc.Book==0&&requested.SessionId==doc.Session&&requested.Revision==doc.Revision&&doc.Authentication==cloud.Status().AuthenticationContext&&cloud.Allows(doc.Authentication,requested.BookId)&&documents.GetValueOrDefault(doc.Session)==doc){doc.Book=requested.BookId;cloud.RememberBinding(doc.Manuscript,doc.Book,doc.Authentication);doc.LastPresenceKey="";}}}
if(reply.Navigation!=null)lock(gate)if(documents.GetValueOrDefault(doc.Session)==doc&&reply.Navigation.SessionId==doc.Session&&reply.Navigation.Revision==doc.Revision){if((reply.Navigation.Kind is "wizard-capture" or "paragraph-snapshot")&&captureInstances.Contains(doc.Instance)&&(reply.Navigation.BookId==0||reply.Navigation.BookId==doc.Book)&&cloud.Allows(doc.Authentication,doc.Book)){if(uploading!=0||documents.Values.Any(d=>d.Capture!=null)){_=cloud.FailCapture(reply.Navigation.Id,doc.Authentication);continue;}var retained=doc.RetryCapture;var reusable=retained!=null&&doc.RetryAuthentication==doc.Authentication&&doc.RetryBook==doc.Book&&retained.ManuscriptId==doc.Manuscript&&retained.Revision==doc.Revision&&retained.ParagraphTracking==reply.Navigation.ParagraphTracking;
@ -225,7 +227,7 @@ public sealed class TrayDocument
{
internal long AudioTextChanges;
public PlotDirector.Companion.Protocol.Manuscript.ChapterSyncProgress? ChapterProgress;
public Guid? NavigationAcknowledgedId;public string NavigationResult="";public Guid PendingNavigation;public long NavigationRevision;public DateTime NavigationExpires;public string LastPresenceKey="";public DateTime LastPresenceUtc;public Guid Instance,Session,Manuscript,Authentication,Job;public long Revision,PresenceSequence;public string Title="",AssociationSite="",ChapterTitle="",SceneTitle="",Status="Link this manuscript to a book, then use Import manuscript in PlotDirector.",ReviewPath="";
public long NavigationQueuedTimestamp,NavigationAckTimestamp;public Guid LastTracedNavigationAck;public Guid? NavigationAcknowledgedId;public string NavigationResult="";public Guid PendingNavigation;public long NavigationRevision;public DateTime NavigationExpires;public string LastPresenceKey="";public DateTime LastPresenceUtc;public Guid Instance,Session,Manuscript,Authentication,Job;public long Revision,PresenceSequence;public string Title="",AssociationSite="",ChapterTitle="",SceneTitle="",Status="Link this manuscript to a book, then use Import manuscript in PlotDirector.",ReviewPath="";
internal ManuscriptCapture? RetryCapture;internal Guid RetryAuthentication;internal int RetryBook;
public long CaptureBaseRevision;public string CaptureBaseHash="";public ManuscriptCapture? Capture;public List<ParagraphFragment> CaptureFragments=[];public bool? WordSaved;public long? AcceptedRevision;
internal string LastRibbonCommand="",LastRibbonOutcome="",PendingRibbonCommand="",LastChapterInterruption="";

View File

@ -1 +1 @@
<Project><PropertyGroup><ApplicationVersion>1.0.0.41</ApplicationVersion></PropertyGroup></Project>
<Project><PropertyGroup><ApplicationVersion>1.0.0.42</ApplicationVersion></PropertyGroup></Project>

View File

@ -119,6 +119,7 @@ public sealed class UiMetric
{
[DataMember] public string Operation { get; set; } = "";
[DataMember] public double Milliseconds { get; set; }
[DataMember(EmitDefaultValue=false)] public Guid NavigationId { get; set; }
}
// Optional v1 capability: pages contain suggestions, never authorized server identities.

View File

@ -87,8 +87,9 @@ using(var malformed=new MemoryStream(new byte[]{255,255,255,127}))
}
using(var frame=new MemoryStream())
{
var original=new Message{Kind="selection",WordInstanceId=Guid.NewGuid(),SessionId=Guid.NewGuid(),Start=99};await FrameCodec.WriteAsync(frame,original,CancellationToken.None);frame.Position=0;
var navigationId=Guid.NewGuid();var original=new Message{Kind="selection",WordInstanceId=Guid.NewGuid(),SessionId=Guid.NewGuid(),Start=99,Metrics=[new(){Operation="navigation-word-selection",Milliseconds=12.5,NavigationId=navigationId}]};await FrameCodec.WriteAsync(frame,original,CancellationToken.None);frame.Position=0;
var copy=await FrameCodec.ReadAsync(frame,CancellationToken.None);Check(copy.CorrelationId==original.CorrelationId&&copy.Start==99,"versioned frame round-trip retains identity");
Check(copy.Metrics.Length==1&&copy.Metrics[0].NavigationId==navigationId&&copy.Metrics[0].Milliseconds==12.5,"navigation metric keeps command correlation and monotonic duration through IPC");
}
var queueDirectory=Path.Combine(Path.GetTempPath(),"pd-phase1-outbox-"+Guid.NewGuid().ToString("N"));

View File

@ -7,7 +7,7 @@ internal static class WordObservationTests
public static async Task Run(Action<bool,string> check)
{
var clock=new Clock();using(var wire=new MemoryStream()){await FrameCodec.WriteAsync(wire,new Message{Kind="selection",WordObservedUtc=clock.Now.UtcDateTime},CancellationToken.None);wire.Position=0;check((await FrameCodec.ReadAsync(wire,CancellationToken.None)).WordObservedUtc?.ToUniversalTime()==clock.Now.UtcDateTime,"Word observation timestamp survives actual IPC encoding");}
using var handler=new TrayTests.Server();using var cloud=new CloudGateway(handler,_=>{});cloud.Connect("https://fixture.invalid/");await Until(()=>cloud.Status().Books.Length>0);using var ai=new ChapterAiWork(cloud);var sessions=new SessionManager(cloud,ai);var tray=new TrayCoordinator(sessions,cloud,ai,clock);
using var handler=new TrayTests.Server();using var cloud=new CloudGateway(handler,_=>{});cloud.Connect("https://fixture.invalid/");await Until(()=>cloud.Status().Books.Length>0);using var ai=new ChapterAiWork(cloud);var sessions=new SessionManager(cloud,ai);var traces=new System.Collections.Concurrent.ConcurrentQueue<string>();var tray=new TrayCoordinator(sessions,cloud,ai,clock,entry=>{traces.Enqueue(entry);throw new IOException("Isolated diagnostic sink failure");});
var instance=Guid.NewGuid();var lease=Guid.NewGuid();var session=Guid.NewGuid();var manuscript=Guid.NewGuid();long sequence=0;
sessions.Attach(instance,lease);tray.Attach(instance,lease,true,acknowledgedNavigation:true);
Message Send(Message value){if(value.Kind=="selection"&&!value.WordObservedUtc.HasValue)value.WordObservedUtc=clock.Now.UtcDateTime;value.WordInstanceId=instance;value.Sequence=++sequence;return tray.Exchange(instance,value,sessions.Apply(lease,value),lease);}
@ -24,6 +24,7 @@ internal static class WordObservationTests
Send(new(){Kind="selection",SessionId=session,Revision=1,Start=15,WordSaved=true});await Until(()=>handler.Observations.Last(p=>p.BookId==3).CursorStart==15);check(handler.Observations.Last(p=>p.BookId==3).WordSaved==true,"new UI observation recovers without reconnect or reimport");
handler.Command=new(){Id=Guid.NewGuid(),Kind="navigate",BookId=3,ManuscriptId=manuscript,SessionId=session,Revision=1,ExpiresUtc=DateTime.UtcNow.AddSeconds(20),Chapter=new(){Start=15}};doc.LastPresenceUtc=DateTime.MinValue;doc.LastPresenceKey="";await Until(()=>handler.Command==null&&doc.PendingNavigation!=Guid.Empty);var command=Send(new(){Kind="ping"}).Command;check(command?.Kind=="navigate","recovered exact-session navigation works");
var ack=Send(new(){Kind="adapter-result",SessionId=session,Revision=1,SnapshotId=command!.Id,OperationMessage="ok"});Console.WriteLine($"ACK status={ack.Status} expected={command.Id} pending={doc.PendingNavigation} received={doc.NavigationAcknowledgedId} result={doc.NavigationResult} expiresIn={(doc.NavigationExpires-DateTime.UtcNow).TotalSeconds:F1}s");check(doc.NavigationAcknowledgedId==command.Id&&doc.NavigationResult=="completed","only correlated native execution result completes navigation");
check(traces.Any(t=>t.Contains($"id={command.Id:N} stage=agent-queue-to-delivery",StringComparison.Ordinal))&&traces.Any(t=>t.Contains($"id={command.Id:N} stage=agent-queue-to-adapter-result",StringComparison.Ordinal)),"navigation traces retain exact command identity and failing diagnostics do not prevent execution acknowledgement");
var acknowledged=doc.NavigationAcknowledgedId;doc.PendingNavigation=Guid.NewGuid();doc.NavigationRevision=1;doc.NavigationExpires=DateTime.UtcNow.AddSeconds(-1);Send(new(){Kind="adapter-result",SessionId=session,Revision=1,SnapshotId=doc.PendingNavigation,OperationMessage="ok"});check(doc.NavigationAcknowledgedId==acknowledged,"late expired acknowledgement cannot claim new completion");
tray.Disconnected(instance,lease);var replacement=Guid.NewGuid();sessions.Attach(instance,replacement);tray.Attach(instance,replacement,true,acknowledgedNavigation:true);lease=replacement;Send(new(){Kind="reconcile",Documents=[descriptor]});check(tray.Documents.Single().WordSaved==null,"agent restart/reconcile cannot mint saved UI observations");
}finally{stop.Cancel();try{await loop;}catch(OperationCanceledException){}}

View File

@ -3,6 +3,6 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTitle("PlotDirector Word Companion — Native development")]
[assembly: AssemblyCompany("Nick Beckley")]
[assembly: AssemblyProduct("PlotDirector")]
[assembly: AssemblyVersion("1.0.0.41")]
[assembly: AssemblyFileVersion("1.0.0.41")]
[assembly: AssemblyVersion("1.0.0.42")]
[assembly: AssemblyFileVersion("1.0.0.42")]
[assembly: ComVisible(false)]

View File

@ -33,7 +33,7 @@ namespace PlotDirector.WordAddIn
private readonly Stopwatch metricClock = Stopwatch.StartNew();
private readonly Stopwatch selectionClock = Stopwatch.StartNew();
private readonly Dictionary<string,double[]> chapterMetrics=new Dictionary<string,double[]>();
private void Metric(string name,double milliseconds)
private void Metric(string name,double milliseconds,Guid navigationId=default(Guid))
{
if(name.StartsWith("chapter-",StringComparison.Ordinal))
{
@ -41,7 +41,7 @@ namespace PlotDirector.WordAddIn
if(totals!=null){totals[0]++;totals[1]+=milliseconds;totals[2]=Math.Max(totals[2],milliseconds);}
}
if(pendingMetrics.Count==256)pendingMetrics.Dequeue();
pendingMetrics.Enqueue(new UiMetric{Operation=name,Milliseconds=milliseconds});
pendingMetrics.Enqueue(new UiMetric{Operation=name,Milliseconds=milliseconds,NavigationId=navigationId});
}
private UiMetric[] DrainMetrics()
{
@ -107,7 +107,7 @@ namespace PlotDirector.WordAddIn
if((message.Action=="tray-sync"||message.Action=="tray-repair")&&message.Status!="ok")PostToUi(()=>{
if(active?.Session==message.SessionId)ShowChapterCommandFailure("Companion could not accept this command ("+message.Status+"). Check the current document and retry.");
});
if(message.Command!=null){var delivery=Stopwatch.StartNew();PostToUi(()=>{if(message.Command.Kind=="chapter-check")Metric("chapter-command-ui-dispatch",delivery.Elapsed.TotalMilliseconds);if(message.Command.Kind=="navigate")Metric("navigation-ui-dispatch",delivery.Elapsed.TotalMilliseconds);HandleCommand(message.Command);});}
if(message.Command!=null){var delivery=Stopwatch.StartNew();PostToUi(()=>{if(message.Command.Kind=="chapter-check")Metric("chapter-command-ui-dispatch",delivery.Elapsed.TotalMilliseconds);if(message.Command.Kind=="navigate")Metric("navigation-ui-dispatch",delivery.Elapsed.TotalMilliseconds,message.Command.Id);HandleCommand(message.Command);});}
if(message.WordCount.HasValue)PostToUi(()=>{var doc=documents.Values.FirstOrDefault(d=>d.Session==message.SessionId&&d.Revision==message.Revision);if(doc!=null)doc.WordCount=message.WordCount;});
if(message.Status!="ok"&&message.Status!="ready")lastResult=message.Status;
};
@ -252,7 +252,9 @@ namespace PlotDirector.WordAddIn
{
var doc=documents.Values.FirstOrDefault(d=>d.Session==command.SessionId);
if(doc==null||doc.Revision!=command.Revision){Reply(command,"Document closed or changed; request again.");return;}
var commandClock=Stopwatch.StartNew();
if(!scheduler.Post("command:"+doc.Session,()=>{
if(command.Kind=="navigate")Metric("navigation-scheduler-wait",commandClock.Elapsed.TotalMilliseconds,command.Id);
if(!documents.ContainsKey(doc.Document)||doc.Revision!=command.Revision){Reply(command,"Document changed; request again.");return;}
try{
if(doc.Maintenance!=null){var previous=doc.Maintenance;scheduler.Cancel("maintenance:"+doc.Session);Reply(previous,"Stopped: superseded by a new document request. Inspect before retrying cleanup.");}
@ -281,7 +283,7 @@ namespace PlotDirector.WordAddIn
if(!NavigationPolicy.Current(command,doc.Session,doc.Revision,doc.Identity,DateTime.UtcNow,Com(()=>doc.Document.Saved)))throw new InvalidOperationException("Navigation expired or document changed.");
if(completedNavigationIds.Contains(command.Id)){Reply(command,"ok");return;}
var position=command.Chapter.Start;if(position<0||position>DocumentEnd(doc.Document))throw new InvalidOperationException("Position no longer exists.");
Metric("navigation-identity-and-target",navigationClock.Elapsed.TotalMilliseconds);navigationClock.Restart();Word.Range range=null;try{range=Com(()=>doc.Document.Range(position,position));Com(()=>{range.Select();return true;});Metric("navigation-word-selection",navigationClock.Elapsed.TotalMilliseconds);navigationExecutions++;lastNavigationId=command.Id;if(completedNavigationIds.Count==64)completedNavigationIds.Dequeue();completedNavigationIds.Enqueue(command.Id);}finally{Release(range);}
Metric("navigation-identity-and-target",navigationClock.Elapsed.TotalMilliseconds,command.Id);navigationClock.Restart();Word.Range range=null;try{range=Com(()=>doc.Document.Range(position,position));Com(()=>{range.Select();return true;});Metric("navigation-word-selection",navigationClock.Elapsed.TotalMilliseconds,command.Id);navigationExecutions++;lastNavigationId=command.Id;if(completedNavigationIds.Count==64)completedNavigationIds.Dequeue();completedNavigationIds.Enqueue(command.Id);}finally{Release(range);}
}
else if(command.Kind=="associate"){
if(command.Remember){

View File

@ -1,7 +1,7 @@
{
"version": "1.0.0.41",
"msiVersion": "1.0.41",
"productCode": "{EF24354B-9ADC-4C69-9F8C-9BD261CB0291}",
"version": "1.0.0.42",
"msiVersion": "1.0.42",
"productCode": "{E9EB08DF-DFDD-477B-B556-337A1952617F}",
"upgradeCode": "{641A087B-9779-458C-B290-BCBBAD49319A}",
"atlasBaseline": "9fed339879887964d526cff00772ffc4dc522c5d",
"baselineProductCode": "{98F46939-764D-407F-BD1F-1D88315D010A}",