26 KiB
Writer Phase 3B.4 — Word navigation latency investigation
Current checkpoint — 21 November, installed .42 physical diagnostics
The user installed .42 successfully without certificate/security warnings. Computer use now works through the reconnected Chrome extension. The actual browser URL is Development (https://dev.plotdirector.com/Writer/Review); Word Troubleshooting explicitly reported PlotDirector 1.0.0.42, Agent: connected, authenticated heartbeat and one document. Running agent/file inventory matched .42. Word retained 48 verified chapters and 154,925 words. No manuscript text was edited or saved. The .42 package and hashes are recorded in the historical package section below.
Ten real warm .42 trials completed with matching native acknowledgement and inspected Word targets. The original Writer scene focus was restored with a separate excluded navigation. Initial warmup and cleanup are excluded. Browser foreground and side-by-side arrangements were not independently controlled; exact viewport paint time remains unmeasured. These are click-to-native-confirmation timings with physical target checks, not invented click-to-paint measurements.
| Trial | Target operation | Acceptance ms | Confirmation ms | Server target/queue ms |
|---|---|---|---|---|
| 1 | Scene forward | 448 | 2513 | unavailable |
| 2 | Scene backward | 453 | 2504 | 424.67 |
| 3 | Repeat same scene | 458 | 2524 | 431.96 |
| 4 | Chapter start | 176 | 2217 | 136.38 |
| 5 | Scene forward | 474 | 1495 | 445.00 |
| 6 | Scene forward across chapters | 462 | 2542 | 434.63 |
| 7 | Scene backward across chapters | 468 | 2532 | 440.78 |
| 8 | Chapter backward | 171 | 2221 | 135.92 |
| 9 | Chapter forward | 159 | 2216 | 135.10 |
| 10 | Scene in current chapter | 476 | 3568 | 456.52 |
| Installed version | Warm samples | Median ms | p90 ms | Worst ms |
|---|---|---|---|---|
| .41 baseline | 10 | 3380 | 3604 | 3616 |
| .42 diagnostic repeat | 10 | 2508.5 | 2542 | 3568 |
| .43 correction | NOT RUN | — | — | — |
Percentiles use nearest rank. .42 contains diagnostics, not a performance correction; the 25.8% lower median cannot be attributed to a speed fix. Sampling phase/background variation matters with layered polling. The under-two-second result is not yet qualified.
Confirmed delay and measurement boundaries
All native spans use process-local Stopwatch timing correlated by navigation UUID. Browser timings use performance.now()/CDP monotonic timing. No cross-machine UTC subtraction is used. Per-command raw spans and coverage are in physical .42 evidence and stage summary.
| Native stage | Samples | Median ms | Worst ms |
|---|---|---|---|
| Acquiring presence HTTP roundtrip | 10 | 88.695 | 92.12 |
| Already acquired agent command → pipe delivery | 10 | 650.72 | 999.21 |
| Agent queue → adapter result (includes delivery/execution) | 10 | 737.78 | 1334.77 |
| UI dispatch | 6 | 0.245 | 0.30 |
| Word scheduler wait | 7 | 47.45 | 60.10 |
| Identity/target check | 7 | 0.12 | 0.17 |
| Word Range selection | 7 | 26.26 | 46.61 |
| Adapter result → acknowledgement publish start | 10 | 280.475 | 380.56 |
| Acknowledgement HTTP roundtrip | 10 | 89.29 | 93.40 |
The confirmed native bottleneck is the one-second idle AgentLink pipe poll, not a large-document range scan. The agent already possessed each command during the measured 27–999ms delivery wait. Word selection is direct verified Range selection and was tens of milliseconds. Some UI metrics were lost through the existing bounded metrics queue; seven selection spans are reported, not ten inferred values. Metric log emission UTC is delayed and is not execution time. The enclosing queue-to-result span overlaps its child stages; these numbers must not be summed.
The wider 3.38-second baseline is consistent with stacked waits: unchanged agent presence acquisition polling (two-second stable-presence throttle plus 500ms heartbeat scheduling), up to one-second local delivery, up to 500ms acknowledgement scheduling, and one-second browser receipt polling, in addition to validated acceptance. Browser CDP captured 135–457ms server target/queue work and roughly 16–32ms receipt HTTP calls; receipt requests began about one second after acceptance and repeated about one second apart. The first native acquisition roundtrip does not measure prior server queue residence. Exact server queue age and viewport paint remain unavailable, so a complete additive attribution of every baseline millisecond is not claimed.
Smallest correction and next installation gate
Proposed .43 changes only AgentLink's idle local pipe interval from 1000ms to 100ms. Its worker already wakes every 25ms. Maximum idle local exchanges increase from about one to ten per second per connected Word instance, with no increased cloud/DB requests, no new worker or navigation architecture, and the same cancellation, timeout and bounded mailbox. Busy traffic still takes priority and existing chapter fast polling is unchanged. This is a bounded local tradeoff; physical CPU/resource impact remains to be observed after installation.
No R1 producer timestamp/freshness logic, R2 selection, identity, saved/revision/provenance proof, expiry, cancellation, server authorisation, target positions or execution acknowledgement has changed. Only five native source/release/test files are modified: AgentLink, its executable regression harness, version props, VSTO assembly metadata and Setup Release.json. No database, migration, stored procedure, application/server source or configuration changes are required. Production remains untouched.
A real named-pipe regression with no Word selection/metrics traffic verifies exact command delivery, pickup below 500ms and bounded pacing rather than a busy loop. Its first run observed maximum 134.64ms and mean 122.07ms over six idle exchanges; native foundation passed 308 checks. Complete Release solution build passed with zero warnings/errors. Further regression, signing and package qualification are in progress at this source checkpoint. .43 must not replace installed .42 until qualification and explicit installation approval; preserve the signed .42 installer as rollback. No .43 physical speedup is claimed before that gate.
Historical evidence below
The remaining numbered sections record the earlier .41 baseline and .42 pre-installation qualification. Their installation status and next-action statements are historical and superseded by this current checkpoint. The 91-case acceptance matrix remains unchanged and Phase 3B.4 is not formally accepted.
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, summary.
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 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
0e331eacb5. - 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, setup/source metadata, installed state.
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.