Record navigation latency investigation and physical trace prerequisites

This commit is contained in:
nick 2026-11-21 13:27:17 +00:00
parent 4b968d6526
commit 062cc06dd5
4 changed files with 162 additions and 0 deletions

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,101 @@
# Writer Phase 3B.4 — navigation latency investigation
Status on 21 November 2026: **investigation pending physical navigation traces; no root cause or optimisation qualified**. Approximately four seconds is the author's reported observation, not an independently measured baseline. The below-two-second warm median target remains unverified. This report is an investigation checkpoint, not task completion or Phase 3B.4 acceptance.
## 1. Environment and versions
The clean existing shared branch `codex/word-companion-native-phase1-20261104` was fetched and fast-forward checked; it was already current at `4b968d652604fdf3e02f50e4a57a31f32c2a1d89`. Read the handover/acceptance contracts and latest recovery evidence; do not assume their earlier installed-version status persists.
Read-only current-user MSI inspection now confirms **MSI 1.0.41**, per-user context 2. Installed add-in, agent EXE and agent DLL are each **1.0.0.41**, and all three hashes equal the previously qualified `ea1aabb3` developer payload. One Word process and one agent process were observed. This updates the earlier evidence's .40 observation; no installation was performed during this task. Current raw identity/profile inventory stays private.
The agent log shows live Word IPC and chapter transfer on a single session in the sampled window. It does not independently establish the author's intended book, authenticated cloud eligibility, fully verified warm manuscript, Word About build, or viewport. Manuscript size of approximately 155,000 words and visible side-by-side arrangement are user-reported, not measured. No manuscript text or document title was collected.
At 13:25:09 UTC, Development's public `writer-word.js` SHA-256 remained `58123F11F50145323DB3C086768C0DD77E3442D16FE8B1D9D8720C7F9B130D54`, matching source/handover. Actual server assembly version/DLL hash requires a fresh authorised read-only attestation; previous `1.0.0+80f7cb5...` evidence is historical, not current verification. No deployment/server/database operation was performed.
Computer-use inventory exposed only empty in-app/MCP browsers, with no connected Chromium/PWA tab or native Word surface. Consequently physical clicks, foreground changes and viewport updates could not be observed or driven through the available UI tools. Human assistance has been requested for navigation-only trials. No alternate synthetic browser, mocked Word or direct API navigation was substituted.
Evidence: [installed hashes](Evidence/Phase3B4/Navigation-20261121T132321Z/installed-hashes.json), [readiness](Evidence/Phase3B4/Navigation-20261121T132321Z/readiness.json), [passive handler summary](Evidence/Phase3B4/Navigation-20261121T132321Z/passive-log-summary.json).
## 2. Reproduction and physical sampling procedure
First confirm the intended Development book and exact Writer-selected live session, normal saved/verified state and no active manuscript reconciliation that would make a trial non-warm. Do not save, edit, rebind or interrupt an author manuscript to establish this. Existing log samples contained chapter-transfer activity, so cannot establish warm idle conditions.
Keep the same document, application versions and arrangement for before/after comparison. Select targets in the existing Global Focus controls and click Chapter/Scene only; never change an objective or manuscript. Capture cold/initial navigation separately, then at least ten warm trials with different targets. Suggested coverage, without replacing any acceptance-matrix case:
| Trial | Target action | Arrangement to record |
| --- | --- | --- |
| 1 | Forward scene within chapter | Word visible beside Writer |
| 2 | Backward scene within chapter | Word visible beside Writer |
| 3 | Forward scene in another chapter | Word visible beside Writer |
| 4 | Backward scene in another chapter | Word visible beside Writer |
| 5 | Repeat the same target | Word visible beside Writer |
| 6 | Chapter forward | PlotDirector foreground |
| 7 | Chapter backward | PlotDirector foreground |
| 8 | Different scene | Word foreground before returning to click Writer |
| 9 | Different chapter | Word foreground before returning to click Writer |
| 10 | Repeat an earlier target | Restore side-by-side arrangement |
Record actual foreground at click separately: clicking Writer normally foregrounds it, so Word foreground immediately before returning is not proof that it stayed foreground at dispatch. A true foreground-at-dispatch branch must be genuinely observed or marked unavailable, not simulated with a different API.
For each trial retain locally: trial/target aliases, cold/warm, foreground/arrangement, actual command UUID, exact-session proof, browser request milliseconds, response Server-Timing, browser confirmation milliseconds/state, observed click-to-correct-visible-Word milliseconds, actual Word navigation counter/last command and correct landing. Do not publish title/prose/token/author identifiers. Existing console messages are `Word navigation <UUID> server request ms ...` and `... confirmation ms ...`; DevTools may require Verbose messages. Use the Network Timing pane for Server-Timing, not an unsanitised HAR export.
Use one continuous screen recording/observer monotonic timer for actual click-to-visible landing when available and authorised. HTTP acceptance, range selection return and browser acknowledgement are distinct endpoints; none alone proves painted viewport timing. No recording/tracing tool was enabled automatically. If recording includes manuscript content, keep it private and export only timings/target aliases. Stop on wrong document/target, unresponsiveness or unexpected state; do not induce a stall or force termination.
## 3. Current instrumentation map and gaps
Existing navigation UUID flows from browser `navigationId` to `AdapterCommand.Id`, native `SnapshotId` result, `NavigationAcknowledgedId` and browser receipt lookup. This is the appropriate shared correlation identity. `Message.CorrelationId` instead identifies an individual IPC exchange and cannot be silently treated as the navigation UUID.
| Stage | Existing implementation/evidence | Missing measurement |
| --- | --- | --- |
| 1. Click handler | `writer-word.js` invokes `navigate`; `performance.now()` dispatch marker | Marker starts after initial guard/copy/UUID work, not hardware input |
| 2. Request preparation | Browser builds exact identity/revision/target form; monotonic request duration is logged | Separate preparation/fetch duration and actual trial console capture |
| 3. Server receipt | `WriterWordController.Navigate` | No receipt-to-exit trace for full action; timer starts after initial ownership DB lookup |
| 4. Target validation | `WriterWordService.Navigate` checks ownership, unique target, exact lease and accepted/live proof | Per-operation durations, including all database/network waits |
| 5. Queue | `NativePresenceStore.Navigate` creates bounded outcome/command under lock | Per-command queue timestamp and same-server enqueue-to-take monotonic duration |
| 6. Agent acquisition | `TrayCoordinator.Heartbeat` receives command in presence response | Command UUID with monotonic poll/request/receive duration |
| 7. Native dispatch | Agent bounded queue, `AgentLink.ExchangeAsync`; VSTO `navigation-ui-dispatch` metric | UUID-correlated agent queue/IPC/STA and scheduler wait samples |
| 8. COM execution | VSTO scheduler command validates `NavigationPolicy`; `navigation-identity-and-target` metric | Per-command complete native timing, not aggregated metric only |
| 9. Target selection | Direct verified numeric Word range then `Select`; `navigation-word-selection`; last command/counter | Per-command metric association and actual correct-range observation |
| 10. Viewport | Actual Word UI | No measured paint/visible-landing timestamp; COM return is not paint proof |
| 11. Native acknowledgement | `Reply` posts `adapter-result` with command ID/revision after execution | Command-correlated enqueue/send/receipt elapsed spans |
| 12. Server acknowledgement | Agent result becomes next presence; store matches grant/book/manuscript/revision/expiry/UUID | Native-ack-to-presence and server receipt/update timings |
| 13. Browser confirmation | One-second receipt loop, monotonic dispatch-to-confirm log | Actual correlated receipt history and confirmation-to-visible distinction |
End-to-end instrumentation is **not yet complete**. No production diagnostics patch has been installed. Existing aggregated native metrics and ordinary per-exchange log durations are insufficient to manufacture the missing spans.
Clock policy: use `performance.now` for browser spans and Stopwatch within each native/server process. Correlate by UUID, store spans with explicit endpoints, and use monotonic enqueue/take in the same process. Use network round trips measured locally or bounded clock-offset uncertainty for handoffs; do not subtract browser, agent and server UTC values to create cross-machine latency. Do not sum overlapping spans or infer missing time as Word execution. Future diagnostics should be bounded and opt-in, metadata only, using the existing UUID rather than a parallel navigation system.
## 4. Baseline measurements and four-second breakdown
**Physical sample count: 0. Median: unavailable. p90: unavailable. Worst: unavailable. Before/after comparison: unavailable.** The reported approximately four seconds has not been allocated to measured stages.
Passive sampled rotating logs contained 8,755 chapter-chunk handlers across 15 chapter-begin/end records, with maximum handler duration 6.75ms, plus short ping/metrics/selection handlers. They contained no adapter-result record in that sample. These are synchronous handler measurements during observed transfer activity, not complete IPC/network/COM/navigation durations. Rotated samples are incomplete and must not be used to infer that navigation never occurred, establish p90, or rule out Word/STA/network bottlenecks. Some selection frames reported `awaiting-structure`, which is a protocol/session status, not proof of server book eligibility or precise-navigation availability.
## 5. Hypotheses to resolve with actual traces
- `TrayCoordinator.Heartbeat` wakes every 500ms and normally spaces unchanged acknowledged-document presence requests by at least two seconds after the last successful response. Changed keys can send earlier; sequential document/network work can add delay. The two-second condition is source behavior, not a measured contribution to this incident.
- `AgentLink` receives commands on mailbox exchanges, otherwise an approximately one-second idle ping; 25ms fast polling is bounded to existing chapter-command waits. Activity changes the effective wait, so do not add nominal polling intervals into a supposed four-second measurement.
- `HandleCommand` posts another scheduler item after STA delivery. Existing UI-dispatch timing does not include the complete subsequent scheduler queue wait.
- Scene navigation loads accepted manuscript data and resolves the scene's first verified paragraph, then checks live position. It may have different validation costs from chapter navigation. No query/CPU bottleneck has been measured, and no cache/provenance shortcut is justified.
- Browser receipt polling waits one second before each confirmation query. This can delay displayed acknowledgement, but cannot itself explain when Word visibly moved. Speeding only this poll would not satisfy the requested responsiveness goal.
- Word selection uses a direct existing verified range offset, not a paragraph-by-paragraph search in the shown navigation branch. Its real COM/viewport cost still requires measurement on the open manuscript.
Confirmed root cause: **not established**. No safe limiting stage has yet been demonstrated. Do not claim the delay is inherent to Word or fixed by changing polling.
## 6. Correction, regression and physical qualification
No application/native/browser behavior was changed. No polling interval, freshness bound, revision check, identity, expiry, queue, acknowledgement, ribbon feedback, notification, Review or responsive layout was altered. The 91-case matrix is unchanged.
No new build/regression run is claimed for this documentation/read-only investigation. The earlier recovery's 633 application checks and native foundation/chapter results remain historical evidence, not qualification of a new optimisation. Once a measured bottleneck justifies a correction, run the required native foundation/chapter/navigation, application, browser/Writer, R1/R2 and full regression gates, then repeat the same physical trials under equivalent conditions. Warm median below two seconds and no material p90/target/acknowledgement regression remain required.
## 7. Packaging, deployment and acceptance impact
No new native version/package, installation, server deployment, configuration/migration or Production operation occurred. Existing .41 bytes remain installed and unchanged. Any future native correction needs a new release per existing versioning/signing rules, valid package/hash/recovery verification and approval before replacement. Any server correction must be qualified and deployed only to Development with running version/hash verification.
This navigation investigation does not change any existing physical acceptance result or demonstrate a performance pass. Phase 3B.4 remains unaccepted; lack of current physical measurements is an evidence prerequisite, not a defect waiver.
## 8. Exact next actions
Human-assisted access to the actual current Development Writer/PWA and Word is required because this session has no exposed UI surface. Confirm the correct book/session and warm saved state using the existing UI, then perform the ten navigation-only trials above, retaining actual landing/counter and browser UUID/timing evidence. Do not send manuscript content, credentials, cookies, bearer headers or full HAR. Existing Word/Companion diagnostics can provide navigation count/last command and available native metric summaries; provide only navigation-related sanitized values.
A fresh authorised read-only Development assembly/hash attestation is also needed. Use the correlated traces to decide whether temporary bounded additional diagnostics are required for the missing stage spans. Implement only the measured, smallest justified correction; repeat physical measurements and all applicable regression/package/deployment gates. Until then the requested latency explanation and optimisation are **pending**, not complete.