Extend Development restart gate to illustration and core import work
This commit is contained in:
parent
597915f7ae
commit
b523a86c19
21
Docs/Sprints/2026-11-03-phase2-deployment-gate.sql
Normal file
21
Docs/Sprints/2026-11-03-phase2-deployment-gate.sql
Normal file
@ -0,0 +1,21 @@
|
||||
-- Read-only Development restart gate; not a schema migration.
|
||||
IF DB_NAME() <> N'PlotDirector_Development' THROW 51000, 'Refusing restart inspection outside PlotDirector_Development.', 1;
|
||||
DECLARE @Active int =
|
||||
(SELECT COUNT(*) FROM dbo.StoryIntelligenceRuns WHERE Status IN ('Pending','Queued','Running','Processing')) +
|
||||
(SELECT COUNT(*) FROM dbo.StoryIntelligenceJobs WHERE Status IN ('Pending','Queued','Running','Processing')) +
|
||||
(SELECT COUNT(*) FROM dbo.WholeBookPlotSynthesisRuns WHERE Status IN ('Pending','Queued','Running','Processing')) +
|
||||
(SELECT COUNT(*) FROM dbo.CharacterEnrichmentRuns WHERE Status IN ('Pending','Queued','Running','Processing')) +
|
||||
(SELECT COUNT(*) FROM dbo.StoryIntelligenceImportCommits WHERE Status IN ('Pending','Queued','Running','Processing')) +
|
||||
(SELECT COUNT(*) FROM dbo.StoryIntelligenceReviewCandidateGenerations WHERE Status IN ('Pending','Queued','Running','Processing','Preparing')) +
|
||||
(SELECT COUNT(*) FROM dbo.StoryIntelligenceBookPipelines WHERE Status IN ('Pending','Queued','Running','Processing'));
|
||||
IF @Active > 0 THROW 51000, 'Deployment deferred: background work is active.', 1;
|
||||
IF EXISTS (SELECT 1 FROM sys.dm_exec_requests r CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) t
|
||||
WHERE r.database_id=DB_ID() AND r.session_id<>@@SPID AND (t.text LIKE '%Import%' OR t.text LIKE '%Synthesis%'))
|
||||
THROW 51000, 'Deployment deferred: import or synthesis request is active.', 1;
|
||||
IF EXISTS (SELECT 1 FROM dbo.IllustrationLibraryItems WHERE Status IN ('Queued','Generating') OR GenerationStatus IN ('Queued','Generating'))
|
||||
THROW 51000, 'Deployment deferred: illustration generation is queued or active.', 1;
|
||||
IF EXISTS (SELECT 1 FROM dbo.OnboardingManuscriptBuilds
|
||||
WHERE Status NOT IN ('Built','Complete','Completed','Failed','Cancelled')
|
||||
OR (Status = 'Built' AND COALESCE(MarkerStatus, '') NOT IN ('UserConfirmedSave','Completed','Complete')))
|
||||
THROW 51000, 'Deployment deferred: core import or marker completion is unfinished.', 1;
|
||||
SELECT 'Development deployment gate: idle';
|
||||
@ -91,3 +91,7 @@ The expanded real-Hub test reproduced two additional failures before repair:
|
||||
Verification: build passed (0 warnings/errors); full-layout Writer browser/PWA test passed with real heartbeat injection, second-book window creation, first-book preservation, restoration to the first scope, reconnect, identity/reload/focus tests and repeated navigation/header commands. Chapter-goal suite, including Help and concurrent edits, passed again. Fixture book data now honours the requested scope; no production routing or database schema changes.
|
||||
|
||||
Urgent Writer release is still pending this final broader gate; an earlier publish was superseded before installation. Next: publish committed verified fixes, run the idle-work gate immediately before Development restart, smoke-check, then continue the rendered visual inventory.
|
||||
|
||||
### Restart safety checkpoint and visual work
|
||||
|
||||
Final Writer checkpoint: full harness passed again (405 checks, exit 0); both Writer browser/PWA suites passed. Phase 2 remains undeployed. Expanded read-only restart inspection found two illustration records marked Generating. The tracked restart gate now includes illustration and unfinished core-import work, verifies Development database identity, and refuses restart while these exist. Its controlled exit 2 was verified; no service restart or database mutation occurred. Live authenticated Writer acceptance remains deferred. Proceeding to Writer spacing and systematic rendered visual coverage independently.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user