100 lines
12 KiB
Markdown
100 lines
12 KiB
Markdown
> **Superseded rollout status:** Companion 1.0.0.18 is now installed. Development rollout, automatic import capture and portable backup support are documented in [completion report](../2026-11-07-development-paragraph-sync.md). Earlier staged/off/backup restrictions below describe the historical foundation, not the current rollout.
|
||
|
||
# Windows handover — paragraph synchronisation source 1.0.0.18
|
||
|
||
## Scope and starting point
|
||
|
||
Use only `/srv/repos/PlotDirector`'s shared remote branch **`codex/word-companion-native-phase1-20261104`**, in your existing Windows checkout. The source handover commit is recorded below after Atlas verification; a later documentation-only descendant is acceptable. Inspect `git status`, identify the configured tracking remote (`git config --get branch.codex/word-companion-native-phase1-20261104.remote`), fetch it and fast-forward safely. Do not switch branches, create worktrees/branches, rebase, merge histories or discard local work. Stop Git synchronisation if a fast-forward is impossible.
|
||
|
||
**No Computer Use, mouse/desktop automation or Word launch by default.** Builds and non-interactive tests must let the author continue using the laptop. Do not close documents, stop Visual Studio, modify workloads/PATH/trust stores, launch installer approval screens, or install anything without a separately agreed installation window. Determine the effective Windows identity/profile; private registry/application-data views do not establish the real user's installation state.
|
||
|
||
Atlas owns the managed implementation. Do not redesign the tray UI, add another process, move COM to background threads, introduce another sync engine or change authentication. Correct only proven Windows-specific defects, then commit/push them to this same branch with evidence.
|
||
|
||
## What changed
|
||
|
||
- Protocol: optional `paragraph-snapshots-v1`, native paragraph hint, capture/delta fields and canonical-ID acknowledgements.
|
||
- Agent: `ParagraphSnapshotCache.cs`, `TrayCoordinator.cs`, `PipeHost.cs`, capture response bound in `CloudGateway.cs`.
|
||
- Client: capability advertisement in `Client/AgentLink.cs`.
|
||
- VSTO: `Vsto/WordAdapter.cs` uses a measured first-character `Range.WordOpenXML` per paragraph only for opted-in captures, retains existing scheduler/COM ownership, optionally persists a missing manuscript GUID on explicit capture, and distinguishes already-unchanged saves. No new permanent scene/paragraph markers and no manuscript prose writing.
|
||
- Native source versions: `DeveloperVersion.props` and `Vsto/Properties/AssemblyInfo.cs` are **1.0.0.18**.
|
||
- Server: additive SQL 240, feature-gated owner workspace, paragraph reconciliation/evidence/continuity and versioned integer-confidence chapter contract. See [implementation report](../2026-11-07-paragraph-sync-foundation.md).
|
||
|
||
**The qualified unified installer baseline remains 1.0.0.17.** Its release manifest and qualification evidence were not changed or rebuilt on Atlas.
|
||
|
||
## Non-interactive build and tests
|
||
|
||
From the repository root, use the existing workflow:
|
||
|
||
```powershell
|
||
.\PlotDirector.NativeCompanion\WindowsValidation\Update-WordCompanion.ps1
|
||
```
|
||
|
||
If signing-certificate discovery is ambiguous, rerun with the existing certificate's `-CertificateThumbprint '<thumbprint>'`; do not create trust or certificates merely to bypass the check. The script locates installed build tools, builds/tests the managed components and signed VSTO, publishes the agent and reports its verified developer package path. It does not install. Expected directory follows the existing script: the user's actual Downloads known folder, `PlotDirectorWordCompanion\1.0.0.18-<first-eight-source-SHA>`. Verify `package.json` records the exact source commit and both binaries report 1.0.0.18.
|
||
|
||
Focused gates (run serially):
|
||
|
||
```powershell
|
||
dotnet build PlotLine.slnx
|
||
dotnet run --project PlotLine.Tests/PlotLine.Tests.csproj -- --paragraph-manuscripts
|
||
dotnet run --project PlotLine.Tests/PlotLine.Tests.csproj -- --paragraph-view
|
||
dotnet run --project PlotLine.Tests/PlotLine.Tests.csproj -- --native-import-corrections
|
||
dotnet run --project PlotDirector.NativeCompanion/Tests/PlotDirector.Companion.Tests.csproj
|
||
```
|
||
|
||
Managed/pipe tests are not proof that Word loads the VSTO or stays responsive. Do not turn registration/file checks into claims of native success.
|
||
|
||
## Unified packaging — after native compatibility checks
|
||
|
||
Use the existing `WindowsValidation/Setup/Build-Setup.ps1`, not a `.vsto`-only installer or a new installation mechanism. Its **current** `Release.json` deliberately rejects version18 payloads because it still selects qualified version17.
|
||
|
||
Preserve the version17 installer, identity, hashes and settings. After verifying the source/payload and agreeing to qualify version18, prepare the next candidate using the existing release rules: application 1.0.0.18, MSI 1.0.18, a new ProductCode, unchanged established UpgradeCode, and the verified version17 baseline identity/hashes. Do not invent a baseline hash or change pins simply to make a failing package pass. Record this as a Windows packaging commit.
|
||
|
||
The actual command is:
|
||
|
||
```powershell
|
||
.\PlotDirector.NativeCompanion\WindowsValidation\Setup\Build-Setup.ps1 `
|
||
-PackagePath '<exact verified developer package path>' `
|
||
-ExpectedSourceCommit '<exact clean package source SHA>' `
|
||
-OutputDirectory '<new candidate output directory>' `
|
||
-CertificateThumbprint '<existing certificate thumbprint>'
|
||
```
|
||
|
||
Follow `WindowsValidation/Setup/README.md` and the existing `Test-SetupPackage.ps1`/upgrade procedures with their documented parameters. The deliverable remains **PlotDirectorCompanionSetup.exe containing both VSTO and tray agent**. Do not install during unattended build. Preserve account trust, server/account selection, book associations and user preferences. Never infer a real-user upgrade from Codex's private registry alone.
|
||
|
||
## Server prerequisite — currently NOT live
|
||
|
||
Atlas deployed only the separately committed range-recovery fix to Development after explicit restart approval. The author may have resumed their import. **That earlier approval does not authorise another restart.** Migration 240 and the paragraph feature have been tested only on a guarded synthetic database, not deployed to Development.
|
||
|
||
New native binaries remain compatible with the ordinary existing capture flow against the current server, but the new paragraph workflow requires a matching server, migration 240 and `Features:ParagraphManuscripts=true` (environment key `Features__ParagraphManuscripts`). Coordinate an isolated test server/book or a later safe Development window with Atlas; do not change Development configuration from Windows or interfere with an active import.
|
||
|
||
**Do not use a primary author book:** paragraph evidence backup portability is not yet qualified. The staged feature deliberately refuses legacy backup/replacement for tracked projects instead of losing evidence. This must be resolved before general author rollout. Do not bypass the guard.
|
||
|
||
## Scheduled interactive Word qualification
|
||
|
||
Only after explicit author authorisation, with a disposable Word document/new test book on the isolated server:
|
||
|
||
1. Confirm both updated binaries, existing sign-in/tray behaviour and unchanged minimal ribbon. Normal startup/opening must not upload manuscript prose.
|
||
2. Import explicitly through the existing web wizard with paragraph opt-in. Verify durable acceptance, original raw paragraph ordering, Heading 1 sections, exclusion of a deliberately deselected chapter, and fallback/refinement for a rejected AI boundary. No per-scene approval is required.
|
||
3. Check the document's text and formatting before/after. Only approved PlotDirector metadata may change. Save once if a new persistent manuscript GUID was written. Close/reopen and restart the agent; stable paragraphs/events must remain associated.
|
||
4. Attach primary/supporting evidence to a test knowledge/relationship event from the book workspace. Move its paragraph in Word, save, and verify the canonical event scene changes only when resolved. Copy it: the copy must get a different occurrence identity and must not copy the event.
|
||
5. Repeat with identical short dialogue; edit evidence, inspect original/current passages and confirm or relink. Delete its passage: the event must remain Missing, not disappear or remain a verified continuity fact. For an uncertain grouping, confirm that raw Word paragraphs are retained but canonical scene prose is unchanged until the author explicitly adjusts/confirms that grouping; evidence confirmation is a separate decision.
|
||
6. Split/move/merge scene boundaries and undo in PlotDirector. Check exact saved prose and Word's unchanged text. Move/reorder complete scenes in Word and reconcile; verify GUID continuity and canonical ordering. Retired scene planning remains historical; this prototype does not merge divergent planning automatically.
|
||
7. Test Manual, On Save and Off. Ordinary cursor motion must not send prose. An unchanged save should not rescan. Failed/cancelled saves must not claim a successful sync. Word save must never wait for network/AI/agent completion.
|
||
8. Open three independently associated manuscripts. Switch/close while extracting, cancel, terminate/restart the agent, disconnect networking and reconnect. No cross-book results or stale live Context/Intent scene may appear; stale revisions must show no trustworthy live scene until accepted.
|
||
9. Measure 190k and 250k+ words, many short/repeated paragraphs and a long paragraph. Record individual COM/XML calls, batch timings, tick delays, queue depth, agent CPU/memory, and typing/scroll/save/close behaviour. A 20–30 ms operation target is measured, never guaranteed. If XML costs are excessive, retain the scheduler and conservative fallback; do not move Word COM off-thread.
|
||
10. Verify a current 97-structural/99-source fixture cannot be converted into an apparently valid clamped AI result. Test new strict schema2 provider execution separately; older retained imports must retain their old checkpoint contract.
|
||
|
||
Stop if prose/formatting changes unexpectedly, identity becomes confidently wrong, Word stalls, a stale revision is shown as live, evidence disappears, or cross-book routing occurs. Preserve logs **without manuscript text or credentials**, keep the previous installer available, and report the failing scenario. Do not reset databases, clear accepted captures, disable authentication or bypass guards as recovery.
|
||
|
||
## Report categories
|
||
|
||
Separate: passed portable/build checks; failed checks; blocked server/environment prerequisites; actual Word runtime measurements; human visual acceptance; installer/upgrade evidence. Commit/push narrowly validated Windows-specific fixes and confirm the remote SHA. An Atlas compilation or a private registry entry is not native qualification.
|
||
|
||
## Atlas verification record
|
||
|
||
**Expected application source commit: `5d755461078e1e6137fa2aa8a8a7af255ce6cf0a`.** Verify it is an ancestor of the fetched shared branch. Any later documentation-only handover commit is acceptable; build/package metadata must still identify the actual clean HEAD that was built. Inspect later code commits rather than assuming they are equivalent.
|
||
|
||
Atlas gates passed: solution build with zero warnings/errors; application harness **455 reported PASS checks**; focused paragraph suite **38**; import/range/integer-contract suite **19**; native agent suite **270**; actual compiled Razor render and both Playwright fixtures; guarded SQL migration/round-trip/negative probes with all fixtures rolled back. The 250,000+ word in-memory reconciliation fixture measured **372 ms**. No Word responsiveness or Windows ACL/COM/installer success is claimed.
|
||
|
||
Synthetic backup `/var/opt/mssql/backup/paragraph-foundation-20261107-201718.bak` was COPY_ONLY/CHECKSUM and verified. SQL 240 remains absent from Development. Development's recovery-only DLL hash was compared successfully with the archived `2c0e02c` publication. The source commit and this handover do not authorise a new Development restart.
|