7.3 KiB
Saved manuscript setup cleanup and wizard theme correction
Development only, 21 November 2026. Production was not accessed.
Root cause and discovered state
User 1 (Nick Beckley), onboarding state 2, project 8174 (The Alpha Flame), book 10152 (The Alpha Flame: Discovery) had CurrentStep=WritingSoftware, WritingJourney=ManuscriptMostlyComplete, no software preference and no completion timestamp. Its last update before cleanup was 19:01:01.4374149 UTC.
The global progress service deliberately returns Continue manuscript setup for an incomplete manuscript journey with a selected book and no current scan preview. GetWizardAsync restores that persisted state. A banner is not evidence of an active import. Starting a new import clears completion through UserOnboarding_SaveWritingJourney, clears software and deactivates current capture state while retaining the previously selected project/book. This explains the saved shape; there is no audit event proving which UI action reopened it.
The existing capture 2fde9b12-42fe-4c65-ae45-d91f5ce5f477 was already non-current. Build 7081 was Complete: 48 chapters, 290 scenes, Word document association 7078. Location review completed on 8 November; the book pipeline and character review completed on 9 November. There were no consent records or Story Intelligence jobs. All 48 analysis runs were terminal (12 Completed, 36 CompletedWithWarnings); synthesis and enrichment were Completed. Live authenticated Companion status showed no capture request or paragraph transfer, including the affected open Word document. No worker needed cancellation.
The preview store keeps scan/build sessions in memory and restores accepted source through OnboardingManuscriptCaptures; it does not run a resumable import merely because setup is incomplete. Native pending captures require an explicit capture request. No temporary files were deleted: the retained capture, build maps and Word association are genuine existing manuscript provenance.
Checkpoint and exact cleanup
Created COPY_ONLY backup with CHECKSUM at /var/opt/mssql/backup/PlotDirector_Development_onboarding_20261121.bak (876,773,376 bytes). Verified its existence and successfully ran RESTORE VERIFYONLY WITH CHECKSUM using the container administrator after the application principal lacked verification permission. No restore was performed; verification is not a restore test.
Used existing dbo.UserOnboarding_CompleteCoreImport with UserID 1, OnboardingID 2, BookID 10152 and the original preview above. An outer transaction checked the exact saved state/timestamp, account/project/book, absence of a current capture and active analysis, and completed pipeline/character review. The existing procedure additionally checks ownership, a completed/built import, scene mappings and completed location review. This closes a reopened setup for an already completed import; it does not assert that unfinished manuscript processing succeeded.
Only onboarding state 2 changed:
CurrentStep: WritingSoftware -> Complete.OnboardingCompletedUtc: null -> 2026-11-21 20:41:47.3643272 UTC.UpdatedUtc: updated to the same timestamp.
Repeating the guarded operation was a no-op. No records, capture source, jobs, book content, preferences, Word association or synchronisation state were removed. No schema migration or new cancellation architecture was required.
Preservation evidence
The adjacent JSON evidence records identical before/after counts and SHA-256 fingerprints for 26 complete tables, including every book/account in those tables. These cover canonical manuscript payloads, 118,400 paragraph-position rows, chapters, scenes, scene manuscript sources, structural sources, Word documents, import maps, accepted capture, native reviews/imports, characters, locations and pipeline history.
The affected canonical payload contains 8,459 paragraphs. Its unchanged whole-payload fingerprint covers paragraph text, GUIDs, paragraph/chapter/scene mappings, manuscript identity, revision and retained history. All 626 chapters and 868 scenes across Development remained identical, including the imported 48 chapter and 290 scene map rows. The Word document row, including document GUID and sync metadata, remained identical. The sole onboarding record retained its account/project/book and software fields.
Theme correction
Shared onboarding.css mixed translucent white surfaces with theme-dependent light text, hardcoded dark text and dark-only border colours. Replaced those surface and border literals with existing theme/body tokens across shared wizard/review components. Corrected badge/status/summary text, analysis select surfaces, progress tracks and the current-step label. Scoped primary-button foreground/background variables to the onboarding panel so dark-theme navigation remains readable. Layout, routes, workflow and SignalR/Companion code are unchanged.
Selection cards now style their direct surface child, retain selected borders, have a visible keyboard-focus outline and a dashed disabled state. Disabled cards do not animate on hover.
Validation
- Solution build: passed, zero warnings/errors.
- Full executable regression harness: passed, 683 PASS checks.
- Existing focused core-import completion checks: passed (review gates, interrupted mapping, scoped completion, retry timestamp and durable recovery).
- Added isolated compiled-Razor fixtures for all 11 wizard steps. No real import is advanced.
- Browser and actual Chromium installed-PWA fixtures cover all 11 steps in warm light/dark and modern light/dark themes; software headings, descriptions, badges and the primary button meet 4.5:1 contrast. Selection, hover, keyboard focus and disabled states are checked. Fixture requests cannot submit onboarding/manuscript changes.
- Live authenticated onboarding, book and Writer GETs returned 200 after cleanup; banner and Writing Software prompt were absent.
Development deployment scope
Runtime change is one stylesheet. Deployed the tested wwwroot/css/onboarding.css atomically from commit 7e63280, with release onboarding-theme-7e63280-20261121T204745Z and matching current-before stylesheet backup. Preserved the current Development application assembly and the separately deployed toast project. A full application replacement would unnecessarily roll back or bundle that unrelated work. No service restart is needed for this asset change; Razor uses a content-versioned stylesheet URL and the PWA worker has no fetch/cache handler.
Verified public/local GETs returned 200, the service remained active and no new warning/error journal entries appeared. Authenticated browser book/Writer/onboarding GETs and refresh passed. An actual installed Chromium PWA opened the affected book and Writer, refreshed, then closed/restarted into a new session; the unwanted banner remained absent throughout.
The public content-versioned CSS, release copy and deployed file all have SHA-256 f2dc9c827f2d8f196915ba5f7f4eb0c0beacceccda098677fd329536afe05a0c. The unchanged deployed assembly has SHA-256 14c675c65560081c372c8e80b585f0c2fb4b0e70d1fc57ec728ce03c7b7afb73. Final database comparison after deployment again found all 26 protected table fingerprints and the closed onboarding state unchanged.
Word Companion .44 physical acceptance remains a separate outstanding task; it was not repeated or claimed complete. This fix does not provide a general cancellation UI for genuinely unfinished imports.