@model PlotLine.Models.ParagraphWorkspaceModel @{ ViewData["Title"]="Manuscript structure and evidence"; var state=Model.State; var scenePositions=state.Paragraphs.Where(p=>p.Story&&p.SceneId.HasValue).GroupBy(p=>p.SceneId!.Value).ToDictionary(g=>g.Key,g=>g.Min(p=>p.Occurrence.Ordinal)); var current=state.Scenes.Where(s=>!s.Retired).OrderBy(s=>scenePositions.GetValueOrDefault(s.Id,int.MaxValue)).ToArray(); var currentPage=Math.Clamp(Model.Page,1,Math.Max(1,(state.Paragraphs.Count+99)/100)); var evidencePage=Math.Clamp(Model.EvidencePage,1,Math.Max(1,(state.Evidence.Count+19)/20)); var rows=state.Paragraphs.Skip((currentPage-1)*100).Take(100).ToArray(); }
Back to @Model.BookTitle

Manuscript structure and evidence

Preview feature: book backup and saved-point replacement are blocked for tracked books until paragraph evidence portability is qualified. Use isolated test books; keep your original Word document.

Word remains the source of your prose. These tools organise saved paragraphs and story evidence; they never edit your Word document.

@if(Model.Message!=null){
@Model.Message
} @if(state.Paragraphs.Count==0){

Enable paragraph tracking

After completing a native manuscript import, adopt its accepted paragraph map. Existing unfinished imports are protected. No content is sent from Word by this action.

}else{ @if(state.Paragraphs.Any(p=>p.Story&&!p.PositionVerified)){
Some scene groupings need review. Their latest Word paragraphs are saved below; existing scene prose is retained until you confirm or adjust the grouping. Uncertain passages are not used as verified story evidence.
}

Saved manuscript

@state.Paragraphs.Count.ToString("N0") paragraphs · @current.Length scenes · Updated @state.UpdatedUtc.ToString("u")

Save/reconnect mode explicitly permits manuscript updates from this book's associated Word document. Only changed prose is transmitted when the agent has a matching snapshot. It never starts AI analysis.

Refresh saved snapshot

A different Word manuscript must be imported into a separate book. This preview never guesses evidence identity across documents.

Scenes

Split at a paragraph or move a boundary using the paragraph list. Move prose and reorder scenes in Word, then synchronise.

@foreach(var scene in current){var sceneIndex=Array.IndexOf(current,scene);var adjacent=sceneIndex+1@scene.Title @if(scene.NeedsRefinement){Needs refinement}

@state.Paragraphs.Count(p=>p.SceneId==scene.Id) paragraphs

@if(scene.NeedsRefinement&&scenePositions.ContainsKey(scene.Id)){
} @if(adjacent!=null&&adjacent.ChapterId==scene.ChapterId&&scenePositions.ContainsKey(scene.Id)&&scenePositions.ContainsKey(adjacent.Id)){
}}

Paragraphs

Page @currentPage of @Math.Max(1,(state.Paragraphs.Count+99)/100). Paragraph numbers describe this saved snapshot, not permanent identities.

@foreach(var row in rows){var scene=current.FirstOrDefault(s=>s.Id==row.SceneId);
Paragraph @(row.Occurrence.Ordinal+1) · @(scene?.Title??"Heading / front matter") @if(!row.PositionVerified&&row.Story){ · Position needs review}

@row.Occurrence.Text

@if(row.Story){var boundaryChoices=current.Where((s,i)=>i>0&&s.ChapterId==current[i-1].ChapterId&&scenePositions.ContainsKey(s.Id)&&scenePositions.ContainsKey(current[i-1].Id)&&(s.Id==row.SceneId||current[i-1].Id==row.SceneId)&&row.Occurrence.Ordinal>scenePositions[current[i-1].Id]).ToArray();
Adjust structure@if(scenePositions.GetValueOrDefault(row.SceneId!.Value,-1)!=row.Occurrence.Ordinal){
}else{

This paragraph already starts a scene.

} @if(boundaryChoices.Length>0){
}
}
}

Story evidence

Evidence changes never delete knowledge or relationship events. Unconfirmed primary evidence is excluded from verified continuity facts.

@if(state.Evidence.Count==0){

No paragraph evidence attached yet. Existing scene-based events continue to work.

} @foreach(var evidence in state.Evidence.OrderBy(e=>e.State=="Verified").Skip((evidencePage-1)*20).Take(20)){var item=Model.Events.FirstOrDefault(e=>e.Kind==evidence.EventKind&&e.Id==evidence.EventId);

@(item?.Description??"Saved event")

@evidence.State · @(evidence.Primary?"Primary evidence":"Supporting evidence")

Originally: @evidence.OriginalPosition
Now: @evidence.CurrentPosition

Original supporting passage

@evidence.OriginalText

Current passage

@(evidence.State=="Missing"?"Passage no longer found. Relink it below; the saved event is retained.":evidence.CurrentText)
@foreach(var action in new[]{"confirm","unlink"}){
}@if(item!=null){Edit or remove event in scene}
Relink to another passage
}
Attach evidence to an existing event

The event type and account scope are validated together before saving.

}