PlotDirector/Docs/WordCompanion/2026-11-08-import-progress-navigation.md

7.9 KiB
Raw Blame History

Existing import progress and resume regression — 8 November 2026

Today's actual import (read-only investigation)

Project 8174, book 10152, The Alpha Flame. All times below are London/GMT.

The Development access log records:

  • 18:10:15 — start import; writing software/project selected; book saved at 18:11:00.
  • 18:39:06 — Word capture POST returned HTTP 403, followed immediately by the existing client's request-cleanup DELETE, which returned 200.
  • 18:49:25 and 18:56:10 — the normal POST /onboarding/start-import action was used again. The old implementation cleared scan state and software selection instead of resuming.
  • 18:56:13–14 — Back actions left the saved wizard at Welcome.

Before any changes/deployment, the database had zero accepted captures, zero manuscript builds and no Story Intelligence jobs/runs. Book 10152 has not completed import or scene detection. The prior transfer failed, rather than continuing in the background. Its intermediate reading/chapter-discovery progress is not recoverable from an accepted server snapshot. The source Word document was not changed by this investigation. No scan, import or analysis was restarted, cancelled, reset or duplicated by Atlas.

The precise 403 validation reason was not logged. The existing native capture request has a fixed 20-minute lifetime; elapsed time from book selection to submission was approximately 28 minutes, making expiry a plausible cause, not a proven diagnosis. User/project/document/session/grant checks can also reject submission. This navigation correction does not weaken those checks, claim to recover the rejected payload or silently retry it.

Why the bar disappeared

The strip with the right-hand Book button still existed in _Layout.cshtml, StoryIntelligenceGlobalProgressService and story-intelligence-global-progress.js. Its discovery/visibility logic queried only active Story Intelligence run summaries. Word scanning and core chapter/scene review do not create those run records, so the strip was hidden during that earlier phase. Recent migrations 242/243 did not remove it; today's onboarding completion timestamp was null. The former long-running analysis strip and the early Word capture stage were different states in the existing flow.

A second confirmed navigation defect made the failure look like nothing had started: the Projects/ribbon Import a manuscript action called StartManuscriptImportSetupAsync, which unconditionally cleared the existing scan and reset setup. Access history confirms that reset action was invoked after the failed submission.

Correction — existing components only

  • The existing global progress model/service now also projects the current authorised unfinished wizard, scan and build state. No new session store, import engine, hub, database table or parallel progress strip.
  • The same strip and button area show Word reading, chapter review, scene detection, location/character review, failure or saved setup as appropriate. The strip text links to the existing matching wizard route/preview; the right-hand Book button keeps its original book-details destination. Pending setup is not labelled as running analysis.
  • Core capture completion alone does not remove the strip: it remains through mandatory review, and disappears when persistent core completion is recorded. Optional Story Intelligence continues to use its existing counts, events and Book action independently.
  • Existing in-memory scene-build progress has a read-only getter and is hydrated on wizard reload. The existing scene-detection button stays disabled while that build is running; re-entry does not launch another build.
  • While core work exists, the existing authoritative SignalR watcher refreshes its snapshot every 15 seconds on a visible page and on return/reconnect. No extra connection or scanning request is created.
  • The normal global and same-book Import actions resume an unfinished selected-book setup without clearing capture/session/preferences. Explicit creation of a new setup after completed onboarding remains available through the existing flow.

Returning to today's book

https://dev.plotdirector.com/onboarding opens the existing saved setup. For this attempt it is Welcome, not the lost scan progress screen. There is no accepted capture to link to chapter review. The change prevents another navigation reset and restores visibility/resume for future in-flight stages; it does not manufacture missing progress or automatically restart the failed transfer. Project/book selection is retained.

Verification

Focused managed regressions use the real existing scan store and durable-capture interface: navigation/refresh retain the same ScanID; Import never invokes Clear; accepted capture reload restores its exact review preview; running scene detection and required location/character review remain discoverable; genuine core completion removes core progress; optional analysis retains the original Book link; revoked permission hides stale book information.

Browser regression exercises the actual shared progress script with its existing SignalR watcher, recreated-page restore, correct links and core-to-optional transition, and asserts that no Start/Scan/Build request is invoked by progress navigation. Existing native import connectivity tests are retained.

Deployment evidence is appended after rollout. The failed transfer was already cleaned up before this task; service replacement is permitted only after checking that no new import or running job has started.

Development deployment and final status

  • Deployed application commit: 0d11a6b408, shared branch unchanged. This includes the original right-hand Book action and resume guards for both global and same-book Import entry points.
  • Release: /srv/apps/plotdirector-dev/releases/0d11a6b-20261108T192633Z; matching previous-current application backup retained. Published/deployed DLL SHA-256 both 6b41a4a615c5d09b76229f15c83dd5f2db462f0571b65d28cf3b58a74d6c9ca0.
  • plotdirector-dev active; public HTTPS and local GET both 200 after Kestrel finished startup. The first immediate readiness probe saw transient 502 before the listener opened; subsequent probes succeeded. Existing proxy HTTPS-port warning is unrelated to import state.
  • No database migration, account creation, author-data repair or capture retry. Existing configuration, uploaded files, native installation trust and Word installation were preserved. Production was untouched.
  • Pre-deployment checks found no active import/Story Intelligence/synthesis/enrichment work. Additional checks confirmed the current wizard was still Welcome, software unset, Companion preference false, with no newly arrived capture. The earlier rejected request had already received a successful cleanup DELETE at 18:39:06, before this task.
  • Post-deployment database verification: book 10152, The Alpha Flame, still Welcome; its setup update timestamp remains 18:56:14.9879636; accepted captures/builds remain zero. No reset, cancellation or duplicate import was performed by this task.
  • Build: zero warnings/errors. Full regression harness: 455 passing checks. Focused navigation suite: 10 passing checks, including global and same-book re-entry without Clear/reset. Browser tests passed for the shared progress script and existing native import connectivity/state handling.

Refresh a normal application page to load the updated shared strip. Its status text links to the saved wizard/review stage; Book retains the existing book-details destination. Today it must show saved setup rather than invented scanning progress. The prior scan's intermediate progress cannot be recovered from a capture that was rejected and then cleared. The exact underlying 403 rejection reason remains unproven; this narrowly scoped fix restores navigation/progress discovery and prevents another silent reset, not capture authorisation redesign.