@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

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){

Import your manuscript from Word

Companion 1.0.0.18 establishes paragraph identities and scene mappings automatically during manuscript import. Once it finishes, this workspace contains your scenes and story evidence.

Open manuscript import
}else{ @if(state.Paragraphs.Any(p=>!p.PositionVerified&&(p.Story||(p.Occurrence.Outline!=1&&p.ChapterId>0)))){
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
Full snapshot fallback

For content which cannot be validated chapter by chapter, the existing bounded full reader is available. Large manuscripts can take substantially longer. It never reimports the book or reruns AI.

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

Accepted chapter checkpoints

These are saved evidence checkpoints, not proof that the current Word session is connected. Live session validation appears in the Word connection dialog. Older imports acquire checkpoints through verified repair; they do not need to be reimported.

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

No chapter checkpoints have been adopted yet.

}else{
@foreach(var checkpoint in state.ChapterCheckpoints.OrderBy(c=>c.Order)){}
ChapterParagraphsLast acceptedState
@(state.Chapters.FirstOrDefault(c=>c.CanonicalId==checkpoint.ChapterId)?.Title??"Saved chapter")@checkpoint.ParagraphCount@(checkpoint.LastSuccessfulSyncUtc!=DateTime.MinValue?checkpoint.LastSuccessfulSyncUtc.ToString("u"):"Not yet accepted")@checkpoint.Status
@checkpoint.Message
}

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??(row.Occurrence.Outline!=1&&row.ChapterId>0?"Scene unresolved in this chapter":"Heading / front matter")) @if(!row.PositionVerified&&(row.Story||(row.Occurrence.Outline!=1&&row.ChapterId>0))){ · 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.

}