13 KiB
Native VSTO chapter-range synchronisation
This implementation stays within the existing VSTO add-in, named-pipe protocol, tray coordinator and chapter synchronisation endpoints. It introduces no Office.js integration, service, database migration or installer. The code is intended for source qualification; real Word extraction cost and responsiveness are not established by the portable tests.
Reading strategy
The initial accepted-manuscript opening retains the qualified 1.0.0.32 reader. Subsequent checks prefer chapter ranges. Existing Word length/saved-state observations request a check after three seconds; periodic checks discover changes that those signals miss. Cursor position can prioritise a range, but is never evidence that other chapters are unchanged.
Each saved plain chapter uses one Range.Text extraction. A changed content fingerprint proceeds to the existing detailed reader. Matching text is insufficient to certify native identity: the reader exports that chapter's XML and checks complete native paragraph IDs, outline, paragraph partition, heading identity, next heading and the accepted identity/content hashes. XML parsing runs outside Word's STA, with at most two comparisons pending. A successful comparison emits the existing compact live-text identity frames, not the XML package. It performs no native paragraph identity traversal.
Incomplete XML IDs fall back to the existing bounded native identity batches while retaining XML structural validation. Drawings, floating anchors, native position gaps, fields, revisions, footnotes, unsupported structures and section/page breaks retain the qualified detailed paths. Ambiguous boundaries remain review cases. No missing native identity is accepted merely because text matches; a regression also closes an existing empty-ID acceptance gap in ChapterFingerprint.Identity.
For a new Word revision, unchanged proofs use the existing batch reuse endpoint. Only changed chapters submit reconciliation prose. For an unchanged periodic pass within the same Word revision, matching absolute positions and fingerprint evidence retain the already accepted live checkpoints without any reuse, individual acceptance or finish requests. Position shifts update navigation hints for subsequent chapter reads; actual native ranges still require verification before acceptance.
Scheduling and lifecycle
- A three-second debounce coalesces observed document revisions and saved-state transitions. Scheduler pumping from normal selection observations and the existing coordinator tick prevents the debounce from waiting for the slower presence refresh interval.
- After completion, the existing scheduler requests another bounded chapter-range pass at approximately 60 seconds. Word's author-priority scheduling, document closure/revision guards and COM busy handling remain in force. The interval is an opportunity, not a deadline that overrides a busy Word UI.
- Manual Synchronise immediately requests the same range path in OnSave mode, joins active work, and can retry a failed check. Manual authority modes retain the explicit permit path. Repair retains its explicit recovery permit and broader verification.
- Per-session processing exclusion prevents a superseding revision from starting another reconciliation while an older server operation is still finishing. New document revisions retire old commands and remain scheduled for the next pass.
- Older canonical-revision presence replies cannot clear newly accepted work, overwrite final progress or restore old Context. Current-cursor, book, manuscript, authentication and Word-revision guards remain intact.
- The ribbon retains its layout and distinguishes Checking from Synchronising, with verified/pending counts based on acknowledged live checkpoints. A completed operation remains authoritative over an older presence progress reply.
Unsaved in-memory edits
Once an accepted baseline exists, read-only chapter range observations also run against unsaved text. They detect same-length changes and Undo while Word remains already dirty. They send only chapter identity, bounds and changed/matching metadata, not prose or accepted-position proposals. Heading identity is checked before attributing an observation to a chapter.
Native-position acceptance and prose reconciliation still wait for a save. This is a coherence limitation of the existing bounded reader: Word can be edited between its UI-thread steps, and an already-unsaved document supplies no monotonic mutation token that detects every intervening edit. Periodic fingerprints locate changes but do not make a multi-step native-position read atomic. The saved-state fence is therefore retained and checked through transport; a document becoming dirty aborts that evidence. No save is forced. Saving automatically schedules selective reconciliation, so a manual Synchronise click is unnecessary.
Unsaved observations do not label native positions or Context as currently verified. Accepted server checkpoints remain intact. Full unsaved reconciliation and verified current-position Context during arbitrary in-memory edits are not claimed by this implementation.
Measurements and interpretation
The supplied historical Word log has 40 complete initial-pass chapter begin/end pairs: 61.2 ms minimum, 214.9 ms median, 541.1 ms maximum, 8,890.9 ms summed. These are real full-reader protocol wall times, including identity traversal, scheduling and IPC. They do not isolate Range.Text extraction.
The portable range fixture preallocates 48 chapter texts before timing content fingerprints. Its CPU timing excludes Word extraction, XML export, COM and UI responsiveness. The HTTP lifecycle fixture uses real coordinator scheduling with a virtual clock, synthetic Word replies and an in-memory HTTP handler. It includes a deliberately delayed presence reply to test a race; its elapsed time is not a Word performance benchmark.
The single saved-edit lifecycle asserts:
- Three-second debounce, with repeated edits coalesced and the cursor deliberately outside the edited chapter.
- 48 range comparisons, 47 matching chapters avoiding native paragraph traversal, and one detailed chapter read.
- Two bounded checkpoint-reuse requests for 47 unchanged chapters, two existing validation requests for the edited chapter, and exactly one prose reconciliation.
- Automatic return to 48 verified chapters without a ribbon command.
- An unchanged periodic pass retaining all 48 live checkpoints with zero chapter server requests.
Existing production instrumentation separately records chapter-range-text, chapter-probe-range-xml, worker comparison time, full reader COM/queue/active time, native paragraph visits and fallback counts. The existing read-only Word benchmark separately times Range.Text, WordOpenXML and SHA-256 against a human-selected disposable chapter without saving or closing Word. It can be used with the existing installation; a new installer is not needed to measure extraction.
Real Word must establish whether its exported ranges contain complete native IDs and whether XML extraction is cheaper than the qualified native batch reader. When IDs are absent, the safe fallback can still traverse unchanged chapters' native identities. The portable one-detailed-read result must not be presented as a universal Word performance guarantee. The unchanged-opening path is preserved, but its approximately 16-second baseline has not been remeasured here.
Regression scope
Native fixtures exercise initial reopening, automatic single-chapter edits, repeated edits, two-chapter edits with length changes, periodic same-length detection, debounce and periodic intervals, Undo/Redo, unsaved observations, automatic save follow-up, manual Synchronise, Repair, stale presence replies and actual IPC encoding. Existing fixtures cover interrupted acknowledgements, closed/revised documents, failed requests, independent sessions and current-cursor Context.
Chapter and structural regressions retain heading rename, insertion/deletion, reordering, cross-boundary changes, paragraph split/merge, canonical GUID/scene preservation, floating anchors, native position gaps, missing/stale checkpoints and structural fallback. No test edits the protected manuscript. Development SQL qualification uses only newly provisioned synthetic projects through the existing guarded regression harness.
Windows Office/VSTO compilation and real Word execution remain distinct from the Atlas build, portable tests and VSTO syntax check. No Word UI responsiveness, new-code real extraction timing or real Word performance acceptance is claimed. No installer was prepared or installed.
Atlas qualification results
- Solution build: zero warnings and errors.
- Focused native/chapter suite: 453 PASS.
- Chapter/structural engine suite: 71 PASS.
- Native foundation suite: 273 PASS.
- Full application executable: 457 PASS.
- Existing guarded real Development SQL reuse suite: 121 PASS; synthetic project 8201 archived.
- New guarded real Development SQL incremental suite (
--chapter-incremental-dev <fixture-owner-id>): 13 PASS; synthetic project 8202 archived. It verifies all canonical paragraph GUIDs and scene identities, 47 retained durable checkpoints, eligibility for batch reuse after reconciliation, shifted downstream positions, final 48 accepted live checkpoints and unaffected-chapter Context. - VSTO source syntax check: two changed files, zero syntax errors. This is not an Office type check or a Windows build.
The final portable range-only fingerprint measurement was 30.5 ms for 48 preallocated texts / 1,530,278 UTF-16 units. The synthetic coordinator cycle measured 1,402.9 ms after virtual debounce, including a deliberately held presence reply. Neither measures Word extraction.
The existing real SQL scale fixture measured 188,822.6 ms for the 48-individual-acceptance baseline versus 2,785.7 ms for two batch-reuse requests with zero individual acceptances or reconciliations. The new single-edit SQL fixture measured 5,245.9 ms for reconciliation and acceptance, 7,926.1 ms total, with one reconciled chapter, 47 retained checkpoints, one unchanged reuse batch and zero unchanged individual acceptances. All are in-process service/SQL measurements; none includes Word, HTTP or debounce.
The shared-branch delivery commit is the source identity for this report. No package version or signed installer has been produced; the installed 1.0.0.33 binaries remain distinct from this source implementation. An eventual installer requires a new version and the existing Windows packaging and approval gates.
Development server delivery
Implementation commit: 0cfd6984f96bef9a2f1962175387ddf5829801e7, pushed to the existing shared branch. This is also the source commit of the Development server publish. The follow-up report commit changes documentation only. A future installer must use a new version (at least 1.0.0.34); none was built or installed here.
The Development-only server deployment makes the earlier checkpoint-status preservation correction available to the existing endpoints. No SQL migration was required. Immediately before deployment, the verified Development database reported zero queued/running import, Story Intelligence, synthesis or enrichment work across ten relevant status tables.
- Release:
/srv/apps/plotdirector-dev/releases/0cfd698-20261112T211016Z. - Application backup:
/srv/apps/plotdirector-dev/current-before-0cfd698-20261112T211016Z. - Published/deployed PlotLine.dll SHA-256:
69e1f2426c5bd6bd25a5786ad48a073fd6b2bf567b715cae6c1236d982b1a854. - Published/deployed protocol DLL SHA-256:
62c75d26fc9992396cd4f50586e31349ec1f1443b5654e3129f21c96c5ff31d5. - Deployed application metadata includes the exact implementation commit. Service active; local HTTP GET and public Development HTTPS GET both returned 200 with normal TLS validation.
Configuration, data-protection keys, uploads and logs were preserved. Startup log review found the existing reverse-proxy HTTPS-port warning category and no application failure category. Production and Windows installations were not changed. These deployment checks do not qualify Word extraction or the new VSTO runtime path.
Windows 1.0.0.34 package and installation
The signed Windows package was built from e60053ad57949bb7d705acd2253cdf9a1db2e050, which contains the Atlas implementation and the Windows version metadata for 1.0.0.34 (MSI 1.0.34). The existing signing identity and upgrade family were preserved. The configured Development endpoint returned HTTP 200.
- Release solution and signed VSTO builds passed with zero warnings or errors.
- Focused Windows checks passed: 453 native/chapter and 71 chapter/structural.
- Payload, MSI/CAB and upgrade gates passed 42, 97 and 34 checks.
- Setup SHA-256
498637C95C0946DE536D17E2F30B443170B170D3F9ADE4990E5F281A790B1940 - MSI SHA-256
8D8656DF7DCD40A7EAEFB9C89533BA474F19F849DE625878EE4257D396B8065F
The approved interactive upgrade completed on 12 November 2026 at 21:35 UTC. Windows Installer and VSTO both returned 0, the MSI Complete feature was Local (state 3), and the installed add-in DLL, tray EXE and tray DLL reported 1.0.0.34 and matched the signed payload by SHA-256.
Live Word acceptance is pending identification of the authorised disposable Discovery document and its separate Development test book. Baseline reopening, the saved Chapter 14 edit, retained checkpoint counts, Word responsiveness and Writing Context still require real Word evidence. The protected Discovery manuscript and its checkpoints were left untouched.