@model StoryIntelligenceProgressViewModel @using System.Security.Claims @inject IConfiguration Configuration @{ ViewData["Title"] = "Review analysis"; var adminEmails = Configuration.GetSection("Admin:AllowedEmails").Get() ?? []; var userEmail = User.FindFirstValue(ClaimTypes.Email); var isAdmin = !string.IsNullOrWhiteSpace(userEmail) && adminEmails.Any(email => string.Equals(email, userEmail, StringComparison.OrdinalIgnoreCase)); var chaptersNeedingReview = Model.Chapters.Count(NeedsReview); var readyToCreate = Model.Chapters.Count(chapter => chapter.CanCommit); }

Step 8 of 9

Review analysis

PlotDirector has finished reading your manuscript. Review the chapter results, then create scenes when you are ready.

@if (TempData["OnboardingStoryIntelligenceError"] is string error) {
@error
} @if (TempData["OnboardingStoryIntelligenceMessage"] is string message) {
@message
}
Nothing is added to your project until you choose Create scenes. This step only creates scenes, summaries and supported scene notes.
Chapters analysed @Model.CompletedChapterCount of @Model.ChapterCount
Scenes found @Model.TotalDetectedScenes.ToString("N0")
Ready to create @readyToCreate.ToString("N0")
Needs review @chaptersNeedingReview.ToString("N0")
@foreach (var chapter in Model.Chapters.OrderBy(chapter => chapter.ChapterNumber)) {

Chapter @chapter.ChapterNumber

@chapter.ChapterTitle

@FriendlyStatus(chapter)
Scenes found @((chapter.TotalDetectedScenes ?? 0).ToString("N0"))
Scenes ready @((chapter.CompletedScenes ?? 0).ToString("N0"))
Needs review @(((chapter.FailedScenes ?? 0) + chapter.Blockers.Count).ToString("N0"))
@if (!string.IsNullOrWhiteSpace(chapter.CommitMessage)) {

@chapter.CommitMessage

} @if (chapter.Warnings.Count > 0) {
Notes
    @foreach (var warning in chapter.Warnings) {
  • @warning
  • }
} @if (chapter.Blockers.Count > 0) {
Before scenes can be created
    @foreach (var blocker in chapter.Blockers) {
  • @blocker
  • }
} @if (!string.IsNullOrWhiteSpace(chapter.ErrorMessage)) {

@chapter.ErrorMessage

}
@if (chapter.HasCompletedCommit) { } else if (chapter.CanCommit && Model.BatchID.HasValue) {
} else if (chapter.IsActive && Model.BatchID.HasValue) { View progress } else { }
@if (isAdmin) {
Admin diagnostics
Run ID
@chapter.RunID
Status
@chapter.Status
Stage
@(chapter.CurrentStage ?? "-")
Failure stage
@(chapter.FailureStage ?? "-")
Tokens
@(chapter.TotalTokens?.ToString("N0") ?? "-")
}
}
@if (Model.BatchID.HasValue) { View progress }
@functions { private static bool NeedsReview(StoryIntelligenceOnboardingChapterViewModel chapter) => chapter.IsFailed || (chapter.FailedScenes ?? 0) > 0 || chapter.Blockers.Count > 0 || (!chapter.CanCommit && !chapter.HasCompletedCommit && chapter.IsRunComplete); private static string FriendlyStatus(StoryIntelligenceOnboardingChapterViewModel chapter) { if (chapter.HasCompletedCommit) { return "Scenes created"; } if (chapter.CanCommit) { return chapter.Warnings.Count > 0 ? "Ready with notes" : "Ready to create"; } return chapter.Status switch { StoryIntelligenceRunStatuses.Pending => "Waiting", StoryIntelligenceRunStatuses.Running => "Reading", StoryIntelligenceRunStatuses.Completed => "Needs attention", StoryIntelligenceRunStatuses.CompletedWithWarnings => "Needs attention", StoryIntelligenceRunStatuses.Failed => "Needs review", StoryIntelligenceRunStatuses.Cancelled => "Cancelled", _ => "Needs attention" }; } private static string StatusClass(StoryIntelligenceOnboardingChapterViewModel chapter) { if (chapter.HasCompletedCommit) { return "story-review-status story-review-status--created"; } if (chapter.CanCommit) { return "story-review-status story-review-status--ready"; } return chapter.IsActive ? "story-review-status story-review-status--active" : "story-review-status story-review-status--warning"; } }