PlotDirector/Docs/Writer/Writer-Phase3B4-Windows-Codex-Prompt.md

12 KiB

Ready-to-paste Windows Codex execution prompt

Copy the text below into Codex on the Windows development machine, in the existing PlotDirector checkout. It does not authorise installation or desktop interaction before the explicit interactive gate.


You are executing PlotDirector Writer Phase 3B.4 physical Windows/Microsoft Word Companion qualification. Atlas has completed preparation, not physical acceptance. Use the existing shared branch codex/word-companion-native-phase1-20261104. Production is forbidden. Do not deploy server code, apply SQL/configuration changes, create a new architecture/focus/synchronisation system, change native version, add test hooks, or use real author manuscripts.

Read repository AGENTS.md, then these three documents (repository-relative):

  1. Docs/Writer/Writer-Phase3B4-Windows-Handover.md
  2. Docs/Writer/Writer-Phase3B4-Acceptance-Matrix.md
  3. Docs/Writer/Writer-Phase3B2-3B3-Completion.md for evidence context only.

The handover contains the actual supported build/package commands, local prerequisites, neutral fixture recipe, recovery and evidence schema. Follow it; no fresh architecture audit is required. Current source and verified local environment outrank historical version headings. Stop and report a concrete inconsistency rather than improvising a new build/installation path.

Baseline: application ancestor 80f7cb516b52bcf1a0d42493700f0bde85ac776c, documentation ancestor 5b7eb27, matched native add-in/agent 1.0.0.41, MSI 1.0.41. Development only: https://dev.plotdirector.com/. Atlas observed deployed version 1.0.0+80f7cb516b52bcf1a0d42493700f0bde85ac776c, DLL hash 5d7f9b4db127f89a7fb866a932b2c14af5d5b7b96cae4b1bd25fc43e10d3c16d, Word-widget JS hash 58123f11f50145323db3c086768c0dd77e3442d16fe8b1d9d8720c7f9b130d54. Recheck freshness of this attestation through authorised read-only means; the website need not expose its assembly version publicly. If the server differs or authenticated book capabilities are incompatible, record the discrepancy and stop connected testing; ask for an Atlas readiness investigation, not permission to deploy from Windows.

Proceed in these phases:

1. Unattended preflight/build/package only.

  • Inspect current branch/status, fetch tracking remote and fast-forward as specified. Preserve unrelated changes. If wrong branch, dirty/untracked worktree, divergence or later application/native changes, stop with exact details; do not reset, force-push, switch branches or discard work to make the build helper run.
  • Verify source ancestry, .41 metadata, existing Windows/Word/VS/runtime/PowerShell tools, normal-user context and approved existing signer. Inspect existing installation read-only with WindowsValidation/Setup/Inspect-UserInstallation.ps1; raw identity/profile report stays private.
  • Use existing x64 PowerShell 7 and the handover's exact Update-WordCompanion.ps1 -CertificateThumbprint $thumbprint -NoSync workflow after safe sync. It restores/builds/tests/signs a developer payload; it never installs. No VS launch/Clean/F5, dependency installation/repair, certificate creation/export/trust changes or execution-policy bypass. Never print private keys, tokens or protected state.
  • Keep all raw staging/evidence outside Git while clean-worktree gates execute. Record full actual build SHA, not only the implementation ancestor. If the script reuses a validated existing package, record this and run the explicit required checks; never claim a build/test ran merely because a directory existed.
  • Run additional foundation/--word-observation/--chapter-sync and full executable application regression commands from the handover, serially. Portable/managed fixtures cannot establish physical COM behaviour.
  • Build the existing unified installer via WindowsValidation/Setup/Build-Setup.ps1; run Test-DeveloperPayload.ps1 and Test-SetupPackage.ps1 with a locally verified preserved older-family MSI. Run Test-UpgradeRegression.ps1 only when its actual failed-setup artefact exists. Do not invent inputs or assume .41 installer availability from source version.
  • Verify hashes, signer, mage manifests, MSI/CAB/version/upgrade evidence. Developer trust-only signature warnings require explicit review per handover; invalid signing/digests stop. Locate a suitable human-approved, signed known-good rollback package and record its actual path/hash/availability. Historical .10/.33 reports are not proof those files exist now.

2. Stop for human interactive authorisation.

Complete the concrete preflight first. Present the candidate source, package path/hash/version/signer, static test results, current installation, preserved rollback package, missing prerequisites, proposed disposable fixture/account/book scope and performance thresholds. Ask the human to approve a scheduled interactive installation/physical-test window, normal Word saving/closure, fixture creation/import/notes/sessions and any separately required AI cost. Explain that this handover requires the gate because setup changes installed add-in/agent registration and the tests control Word and mutate synthetic Development records. Do not launch Setup/Word, drive desktop/PWA, provision accounts or mutate manuscript data before this authorisation. Do not repeatedly ask for actions already covered by the approved scope.

If an existing prerequisite must be installed, trust store changed, account switched/revoked, tracing/debugger/network fault injection enabled, software uninstalled/rolled back, or an unresponsive process forcibly terminated, stop for specific additional human action/approval. Never terminate or suspend Word, reset pairing state or remove author data to force a test to pass. If Codex has no authorised desktop-control mechanism, ask the human to perform the exact documented action and wait for evidence; do not simulate it and claim acceptance.

3. Approved normal-user installation and fixture setup.

  • Have the human save/close all Word windows normally and run the unified EXE from normal File Explorer. Do not use --install as a silent bypass. Wait for actual completion; inspect native MSI current-user context, Complete=3, file hashes/versions, installed manifest, actual loaded VSTO .41 and running installed agent .41. A setup parent exit zero or LoadBehavior=3 alone is insufficient.
  • Use only authorised disposable Development account/project/books and new local synthetic files. Follow the existing generator plus handover neutralisation recipe before opening its raw outputs: generator IDs/tags are not real authorised server associations. Check OOXML opens without repair; verify real Word counts/structure. Build small, medium, 190k and 250k baselines and deliberate same-property copies. Hash and retain pristine originals privately.
  • Establish actual Development account/server/book association, real saved capture/acceptance and mapped/unmapped scene fixtures through supported UI. No direct SQL, Production data, private author reviews or existing manuscript edits. F2 requires a genuine authorised synthetic historical native review/source fixture; if unavailable mark that row BLOCKED instead of inventing a database record or unsupported creation workflow.

4. Execute the matrix in strict A → B → C → D → E → F → G order.

Record every stable ID with prerequisites, exact actual actions, evidence, UTC start/end, physical/managed-only mode, result and cleanup. Save before/after diagnostics and actual Word range/identity evidence when navigation is expected. Repeat required browser/PWA cases in a genuinely installed PWA; standalone flags and mocked transports do not establish physical acceptance.

Critical contracts:

  • R2: explicitly selected A remains disconnected if A disappears; never silently becomes B, including same-title/property copies, restart and same-tab refresh/return. Initial sole-document convenience is allowed only without prior explicit choice.
  • R1: transport liveness is independent from UI observation freshness. Matched .41 selection frames stamp before COM reads; at >=45s age, cached saved/cursor/chapter/scene proof cannot authorise precise navigation. No safe dedicated stall hook was found in the production runtime. Follow C04: without a verified safe authorised mechanism, mark true blocked-UI/stall cases BLOCKED. Inactive-document expiry and managed-clock success are different evidence; never suspend/crash Word or add a runtime hook to manufacture a result.
  • Navigation: exact live document/session/manuscript/revision/range; HTTP 202 means requested. Completed requires actual matching native execution acknowledgement. Delayed/expired command/result rows require a safe authorised control; a lucky race or fabricated packet cannot pass them. Command expiry is 25s; record actual timeline.
  • Synchronisation: unsaved Word text, accepted canonical prose and verified physical positions are separate. No forced saves, identity/scene guesses, stale commits or rewrites of annotation provenance. Changes are synthetic and reversible only within the approved fixture scope.
  • F1: chapter-only/unmapped Review fallback clears obsolete precise passage/scene/Word target; dirty editors defer without losing drafts. F2: stale/unverifiable historical AI-review positions refuse navigation while reading/decisions remain usable.
  • Global Narrative Focus, actual Word position, saved objective and session/Review selection stay independent except explicit author actions. Do not implement optional Context/Intent I1 during acceptance.
  • Measure real 190k/250k Word opening/verification/edits, typing/scroll/ribbon responsiveness, COM/queue/network/reconciliation metrics per G. Obtain approval for proposed thresholds; absent agreement report measured values with performance acceptance NOT AGREED. Never substitute hashing fixtures, scheduler budgets or aggregate max values for physical responsiveness/percentiles.

Stop immediately on wrong-document/range execution, corrupted/lost data, unexpected account/server/source, invalid signing or material Word unresponsiveness. Preserve evidence and drafts, follow the handover recovery table, and mark dependent rows BLOCKED. Do not silently fix source or repackage during this acceptance task; produce a separate defect reproduction/request for any necessary implementation work.

5. Evidence, cleanup and documentation-only handoff.

After clean packaging gates, place only sanitised evidence under Docs/Writer/Evidence/Phase3B4/<new-UTC-run-id>-windows-<shortSHA>/. Follow handover schema for environment/package/readiness/results/performance/thresholds/cleanup and concise report.md. Never overwrite an earlier run. Keep raw profiles, credentials, cookies, DPAPI state, pairing codes/URLs, certificate keys, registry exports, unsanitised HAR/traces and DOCX contents outside Git.

Complete only authorised synthetic cleanup via supported UI; retain known-good packages and necessary private failure fixtures. Confirm no author data/state changed and normal test-only settings restored. Classify remaining items as confirmed defect, unverified risk, physical qualification requirement or optional improvement. A run with required physical rows blocked is partial, never “Phase 3B.4 passed.”

Fetch safely, commit only qualification documentation/sanitised evidence on the shared branch, push normally, preserve unrelated changes. No force push, installer binaries, native/application code changes, Production operation or server deployment. Final response: actual source/package/installed/server versions, physical results and blocked cases, performance/threshold decision, cleanup, evidence/report paths and commit hash. Stop after reporting; no distribution/Production rollout is implied.