From efcb4ac85b24dbfe0e7791ae907844d9a086cc43 Mon Sep 17 00:00:00 2001 From: Nick Beckley Date: Sat, 7 Nov 2026 21:21:25 +0000 Subject: [PATCH] Record paragraph-sync verification and controlled Windows18 handover --- .../2026-11-07-paragraph-sync-foundation.md | 2 + .../2026-11-07-paragraph-sync.md | 97 +++++++++++++++++++ Docs/WordCompanion/WindowsHandover/README.md | 10 +- 3 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 Docs/WordCompanion/WindowsHandover/2026-11-07-paragraph-sync.md diff --git a/Docs/WordCompanion/2026-11-07-paragraph-sync-foundation.md b/Docs/WordCompanion/2026-11-07-paragraph-sync-foundation.md index f485ad2b..35d9ff36 100644 --- a/Docs/WordCompanion/2026-11-07-paragraph-sync-foundation.md +++ b/Docs/WordCompanion/2026-11-07-paragraph-sync-foundation.md @@ -116,3 +116,5 @@ Acceptance evidence covers initial occurrence IDs, serialized reopen/reconnect s - Recovery-only deployed DLL SHA-256 matches the archived `2c0e02c` publication: `520762918cdd7cb5dc33f23ed17c6c55aba99d1bbe34679f302e68f5ec86ddf3`. For tracked test books, use the per-book Off preference to stop transfers while retaining the paragraph read/review infrastructure. Do not treat hiding the feature with a server-wide rollback as a qualified migration/recovery procedure. The portable backup extension remains a general-rollout blocker. + +Application source was committed as `5d755461078e1e6137fa2aa8a8a7af255ce6cf0a` on the existing shared branch. The subsequent Windows handover is a documentation-only descendant; see [the exact Windows instructions](WindowsHandover/2026-11-07-paragraph-sync.md). diff --git a/Docs/WordCompanion/WindowsHandover/2026-11-07-paragraph-sync.md b/Docs/WordCompanion/WindowsHandover/2026-11-07-paragraph-sync.md new file mode 100644 index 00000000..6499c72a --- /dev/null +++ b/Docs/WordCompanion/WindowsHandover/2026-11-07-paragraph-sync.md @@ -0,0 +1,97 @@ +# 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 ''`; 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-`. 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 '' ` + -ExpectedSourceCommit '' ` + -OutputDirectory '' ` + -CertificateThumbprint '' +``` + +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. diff --git a/Docs/WordCompanion/WindowsHandover/README.md b/Docs/WordCompanion/WindowsHandover/README.md index b0196547..6cbdb152 100644 --- a/Docs/WordCompanion/WindowsHandover/README.md +++ b/Docs/WordCompanion/WindowsHandover/README.md @@ -1,4 +1,12 @@ -# Current handover — native import correction, version17 +# Staged paragraph synchronisation — source 1.0.0.18 + +Read [the paragraph-sync handover](2026-11-07-paragraph-sync.md) for the next source build and its exact code pin, commands, tests and native acceptance requirements. The **qualified version17 installer is preserved**; version18 is not packaged, installed or Word-qualified. Development has only the separately approved import-recovery patch, not SQL 240 or the default-off paragraph feature. Use isolated books/server for this next qualification; paragraph evidence backup portability remains a rollout blocker. No unattended Word launch, desktop control or installation is authorised. + +The previous handovers below describe the retained installer/integration baselines; their source version pins are superseded for the next build. + +--- + +# Previous handover — native import correction, version17 Use [the version17 correction handover](2026-11-07-native-import-correction.md) first. It supersedes version15 build pins and preserves the subsequently qualified version16 installer baseline. Development now includes the matching server and migration239. Windows work is the existing unified installer build and focused native qualification, without redesigning the interface or authentication.