583 lines
41 KiB
Markdown
583 lines
41 KiB
Markdown
# Plot Lines, Scene Contribution, and Timeline Simplification Investigation
|
||
|
||
Date: 29 October 2026
|
||
Scope: read-only source/schema investigation; no application, database, prompt, or data changes
|
||
|
||
## A. Executive summary
|
||
|
||
PlotDirector is substantially closer to the proposed direction than the current Timeline suggests. The canonical model already separates scenes, plot abstractions, scene-anchored plot developments, chronology, and scenario ordering:
|
||
|
||
- A `PlotLine` is a project-owned, optionally book-scoped narrative abstraction.
|
||
- A `PlotThread` is a stateful strand inside a plot line.
|
||
- A `ThreadEvent` is the effective scene-to-thread—and therefore scene-to-plot-line—association. It classifies what happened at that scene and can describe branch, split, merge, and other plot structure.
|
||
- A `Scene` owns manuscript order and story-time fields.
|
||
- A `ScenarioSceneOrder` overlays an alternative order without changing canonical scenes until explicitly applied.
|
||
- `SceneManuscriptSources` retains complete imported scene text and source ranges.
|
||
|
||
The sparse Timeline is principally a presentation problem. `BuildPlotLanes` deliberately expands every visible plot line over every ordered scene, creating an empty slot for non-contributing scenes. A dedicated Plot Lines workspace can instead query the same `ThreadEvents`, keep only their scenes, and order those scenes by canonical or scenario order. No new scene/plot join table is needed merely to produce single-line or multi-line narrative views.
|
||
|
||
There are, however, material semantic gaps. Canonical membership is currently event-based and effectively binary. `ThreadEvent.EventTypeID` provides a useful contribution role and `Confidence` is retained for imported events, but canonical events do not have an independent significance/weight or a durable evidence excerpt. Whole-book Story Intelligence knows more: it produces plot-line significance, per-event confidence, descriptions, and evidence, and persists those in review/synthesis records. Acceptance only materialises some of that information into `PlotLines`, `PlotThreads`, and `ThreadEvents`. A future contribution model should extend this existing event association rather than introduce a parallel membership system.
|
||
|
||
The main Timeline can safely lose Plot Line and Character lanes without deleting either domain. Plot filters/focus, scene-card character chips, the Scene Inspector, character quick-add, and all canonical associations are independent of the lane rows. Plot-lane removal is not entirely cosmetic, though: the client currently draws branch/split/merge connectors and computes several plot-health warnings there. Those capabilities should be preserved in the dedicated Plot Lines/Story Health experience before removing their only visualisation. Character-lane removal has lower domain risk; its unique rich appearance tooltip should be checked against the Character and Scene Inspector pages before retirement.
|
||
|
||
The recommended direction is therefore reuse-first:
|
||
|
||
1. establish a contribution read model over existing `ThreadEvents` and synthesis evidence;
|
||
2. build the dedicated, compact Plot Lines workspace;
|
||
3. integrate scenario ordering through `ScenarioSceneOrder`;
|
||
4. relocate plot-only health and structural visualisation;
|
||
5. remove both lane presentations and their settings from Timeline;
|
||
6. only then add persisted role/significance/evidence fields where the confirmed UX cannot be satisfied by existing records.
|
||
|
||
No development/test database count was included. The repository has no isolated fixture that represents a fully analysed imported book, and accessing the shared development database was unnecessary for the architectural conclusions. The report includes a safe count definition for a later read-only audit.
|
||
|
||
## B. Current Plot Line architecture
|
||
|
||
### Canonical hierarchy
|
||
|
||
```text
|
||
Project
|
||
└─ PlotLine (optionally scoped to Book)
|
||
└─ PlotThread
|
||
└─ ThreadEvent ──> Scene ──> Chapter ──> Book
|
||
└─ PlotEventTargetPlotLines ──> other PlotLines
|
||
```
|
||
|
||
There is no direct `ScenePlotLine` table or model. A scene participates in a plot line when a non-archived thread in that plot line has a `ThreadEvent` attached to the scene. Multiple events and multiple threads can attach the same scene to the same or different plot lines.
|
||
|
||
Primary implementation references are:
|
||
|
||
- schema and current timeline procedure: `PlotLine/Sql/004_Phase1C_PlotThreads.sql` and `PlotLine/Sql/053_Phase6A_PlotLineDataModel.sql`;
|
||
- models: `PlotLine/Models/CoreModels.cs`;
|
||
- persistence: `PlotLine/Data/Repositories.cs` (`PlotRepository`, `TimelineRepository`);
|
||
- domain/UI services: `PlotLine/Services/CoreServices.cs` (`PlotService`, `TimelineService`);
|
||
- management UI: `PlotLine/Controllers/PlotLinesController.cs`, `PlotLine/Controllers/PlotThreadsController.cs`, `PlotLine/Views/PlotLines`, `PlotLine/Views/PlotThreads`;
|
||
- scene-level management: `PlotLine/Views/Shared/SceneInspectorV2/_SceneThreadsEditor.cshtml`;
|
||
- Timeline presentation: `PlotLine/Views/Timeline/Index.cshtml`, `PlotLine/wwwroot/js/site.js`, and `PlotLine/wwwroot/css/site.css`.
|
||
|
||
### Relevant field matrix
|
||
|
||
| Concept/field | Storage and population | Reads/UI | Status |
|
||
|---|---|---|---|
|
||
| Plot line name and description | `PlotLines.PlotLineName`, `Description`; manual Plot Line editor or accepted Story Intelligence candidate | Plot list/editor, thread pages, Timeline labels, filters, Story Intelligence context | Active |
|
||
| Ownership/scope | required `ProjectID`, optional `BookID`; manual selection or synthesis book | Lists and Timeline include project-wide lines plus matching book | Active; no direct chapter ownership |
|
||
| Type/category | `PlotLineTypeID` lookup: Main Plot, Side Plot, Mystery, Emotional Arc, Relationship Arc, Character Arc, Object Trail, Investigation, Location Plot, Theme | Stored and shown on Plot Line list; editor currently posts a hidden type field instead of offering the former type selector | Active data, incompletely exposed in current editor |
|
||
| Plot importance | `PlotImportanceID`: Primary, Secondary, Minor | Plot list/editor and synthesis materialisation default | Active, line-level only |
|
||
| Parent/emergence | `ParentPlotLineID`, `EmergesFromPlotLineID` | Plot editor and model/list reads | Active structural metadata; not used to decide scene membership |
|
||
| Sort and colour | `SortOrder`, `Colour` | Plot list and Timeline lane ordering/colour | Active; presentation metadata reusable in a dedicated workspace |
|
||
| Timeline visibility | `IsVisibleOnTimeline` | Plot editor/list and `Timeline_GetByProject` | Active but Timeline-specific; becomes legacy when plot lanes leave Timeline |
|
||
| Archive state | `IsArchived` | All canonical list/read procedures | Active lifecycle field |
|
||
| Thread title/summary/type | `PlotThreads.ThreadTitle`, `Summary`, `ThreadTypeID` | Thread management, Scene Inspector, Timeline tooltip/context | Active |
|
||
| Thread state | `ThreadStatusID`: Planned, Introduced, Developing, Dormant, Ready for Payoff, Resolved, Abandoned | Thread editor and Timeline/health logic | Active; this is thread state, not plot-line state |
|
||
| Thread importance | integer `Importance` (1–10) | Thread UI and Timeline marker prioritisation/tooltip | Active; thread-level, not per-scene contribution significance |
|
||
| Thread boundary scenes | `IntroducedSceneID`, `PlannedResolutionSceneID`, `ActualResolutionSceneID` | Thread management and health/context | Active, but separate from individual event associations |
|
||
| Scene association | `ThreadEvents.SceneID` plus `PlotThreadID` | Scene Inspector, plot/thread lists, Timeline/filter/focus, Story Health | Active canonical membership mechanism |
|
||
| Contribution/development role | `ThreadEvents.EventTypeID` → Introduced, Mentioned, Developed, Complicated, Clue Planted, Question Raised, Question Answered, False Lead, Revealed, Payoff, Resolved, Contradicted, Retconned, Note | Event editor, markers/tooltips, scenario checks, synthesis output constraint | Active and close to proposed “Role,” though vocabulary differs |
|
||
| Structural plot event | `PlotEventTypeID` → Start, Progress, Reveal, Twist, Branch, Split, Merge, Resolve, Abandon | Event editor and Timeline connector drawing | Active; imported events are currently materialised as `Progress`, which loses this dimension |
|
||
| Event targets | legacy single `TargetPlotLineID` plus many-to-many `PlotEventTargetPlotLines` | Event editing and Timeline branch/split/merge connectors | Active; expresses structural links, not shared event identity |
|
||
| Event description | `EventTitle`, `EventDescription` | Scene Inspector and Timeline tooltips | Active; can contain an explanation, but has no enforced semantics |
|
||
| Provenance/confidence | `Source`, `SourceReferenceID`, `SourceKey`, `Confidence` | populated by Story Intelligence acceptance; mainly persistence/idempotency and review traceability | Active backend data, minimally exposed in canonical UI |
|
||
| Plot-line status | none on `PlotLines` | Whole-book candidate has `BookStatus`; canonical status is inferred from threads/events | Does not exist canonically |
|
||
| Direct character/relationship/asset/location link | none on `PlotLines` | Indirectly discoverable by joining shared scenes; whole-book prompt receives character context | Does not exist |
|
||
|
||
Plot lines are included in project backup/restore and permanent-deletion handling. They are not merely transient Timeline constructs.
|
||
|
||
### Services and UI behavior
|
||
|
||
`PlotService` is a conventional Dapper/stored-procedure service for list, create, edit, save, and archive. The plot list describes each line and links to Timeline focus and thread creation. The editor exposes name, importance, book scope, parent, emergence, sort, colour, description, and Timeline visibility. The current editor carries `PlotLineTypeID` as a hidden input, so category is not presently editable there even though it remains canonical.
|
||
|
||
Threads and thread events provide the operational development model. Events can be maintained from thread pages and from a scene’s inspector. This is important for the future workspace: manual books already have a supported way to create membership and contribution records; imported books materialise the same canonical records after review.
|
||
|
||
## C. Scene/Plot Line association
|
||
|
||
### Exact membership rule
|
||
|
||
For canonical/accepted data:
|
||
|
||
```text
|
||
Scene X belongs to Plot Line Y
|
||
iff an active ThreadEvent references X
|
||
and its active PlotThread references Y.
|
||
```
|
||
|
||
The current Timeline implements the same rule. `Timeline_GetByProject` joins `ThreadEvents → PlotThreads → PlotLines → Scenes`. `BuildPlotLanes` groups those events by `PlotLineID` and `SceneID`, then creates one slot for every scene. The latter expansion creates the visual sparsity; it is not a storage limitation.
|
||
|
||
### Cardinality and ordering
|
||
|
||
- One scene can have zero, one, or many thread events.
|
||
- Those events can belong to multiple threads and multiple plot lines, so scene-to-plot-line membership is effectively many-to-many.
|
||
- Multiple events in the same line and scene are permitted.
|
||
- Membership has no independent sort field. Plot developments inherit manuscript order from `Book.SortOrder`, `Chapter.SortOrder`, and `Scene.SortOrder`/`NarrativeSceneOrder`.
|
||
- In a scenario they inherit the overlay order from `ScenarioSceneOrder.ProposedChapterID` and `ProposedSortOrder`.
|
||
- Story-time position is inherited from the linked scene’s chronology fields.
|
||
|
||
### Manual versus imported books
|
||
|
||
Manual membership is authored by adding a thread event to a scene. The author selects the thread, event type, structural plot-event type/targets, title, and description.
|
||
|
||
Imported membership has two stages:
|
||
|
||
1. proposed membership in Story Intelligence candidate/event/evidence tables;
|
||
2. canonical membership only after review acceptance creates or matches a plot line/thread and materialises `ThreadEvents`.
|
||
|
||
Pending or rejected candidates do not make a scene a member for Timeline/filter purposes. Consequently “no canonical plot line” and “the analysis found no possible plot line” are not equivalent.
|
||
|
||
### Binary, weighted, classified, or inferred?
|
||
|
||
- Membership itself is binary and inferred from existence of at least one canonical event.
|
||
- It is classified by event type and optionally structural plot-event type.
|
||
- A thread has importance 1–10; a plot line has Primary/Secondary/Minor importance.
|
||
- Imported events may carry confidence.
|
||
- There is no canonical per-scene/per-plot-line significance or contribution weight.
|
||
- Imported evidence/reasoning exists in review records but is not part of the canonical membership row.
|
||
|
||
## D. Existing contribution/significance data
|
||
|
||
The proposed “Role” and “Significance” should remain distinct because existing data already demonstrates that distinction.
|
||
|
||
### Role
|
||
|
||
`ThreadEventType` is the strongest reusable role concept. It covers introduction, mention, development, complication, clue/question mechanics, false leads, revelation, payoff, resolution, contradiction, retcon, and notes. `PlotEventType` adds structural semantics—start/progress/reveal/twist/branch/split/merge/resolve/abandon. Scene purpose labels add broader scene functions such as Advances Plot, Setup, Payoff, Reveal, Exposition, Emotional Recovery, Transition/Travel, Consequence, and Reversal.
|
||
|
||
These sources can support an initial read model, but they are not interchangeable:
|
||
|
||
- thread event type describes the scene’s contribution to one thread;
|
||
- plot event type describes structural behavior between plot lines;
|
||
- scene purpose describes the whole scene and is not line-specific.
|
||
|
||
The illustrative future roles can be mapped approximately for display, but “Escalation,” “Turning Point,” “Aftermath,” “Reflection,” and “Transition” are not consistently encoded as line-specific event roles. Derivation should be labelled as derived, not presented as author-confirmed data.
|
||
|
||
### Significance
|
||
|
||
Available signals are:
|
||
|
||
- `PlotImportance` at line level (Primary/Secondary/Minor);
|
||
- `PlotThread.Importance` at thread level (1–10);
|
||
- Story Intelligence candidate `Significance` at candidate/plot/thread level;
|
||
- candidate event and canonical imported event `Confidence`;
|
||
- scene metrics and scene purpose, which describe the scene globally;
|
||
- event type and recurrence, from which prominence could be heuristically ranked.
|
||
|
||
None is a canonical per-scene contribution significance. Critical/Major/Supporting/Minor cannot be faithfully represented without either a clearly documented derivation or new persisted information. A first workspace can operate without it and show role, confidence, line/thread importance, and evidence separately.
|
||
|
||
### Explanation and evidence
|
||
|
||
Manual `EventDescription` and imported candidate-event `Description` are explanations. `StoryIntelligenceNarrativeCandidateEvents.Evidence` and `StoryIntelligenceNarrativeCandidateEvidence.Evidence` retain textual evidence. Canonical `ThreadEvents` do not have an evidence column. When accepted, evidence may become the event description only when no event description exists; otherwise the distinct evidence is not copied.
|
||
|
||
## E. Story Intelligence import
|
||
|
||
### Discovery point and inputs
|
||
|
||
The current path is whole-book plot synthesis after character resolution. `WholeBookPlotIntelligenceService` supplies the synthesis with:
|
||
|
||
- complete canonical scene sequence and full `SceneManuscriptSources.SourceText`;
|
||
- scene summaries, setting, POV, and chronology context;
|
||
- canonical characters and aliases;
|
||
- existing plot lines and threads;
|
||
- optional author plot seeds/context.
|
||
|
||
The prompt asks for sustained plot lines, subordinate threads, and every meaningful scene touch. It explicitly distinguishes meaningful narrative contribution from mere character presence. Per-event output is constrained to the existing thread-event vocabulary.
|
||
|
||
An older per-scene consolidation path in `StoryIntelligenceNarrativeReviewService.EnsureCandidatesAsync` can read `SceneIntelligenceNarrativeArc` values (title, description, arc type, scale, change type, significance, matching IDs, evidence, and confidence). Current review GET behavior uses persisted whole-book candidates and does not generate candidates during rendering; this older path should be treated as legacy/fallback behavior, not the current authority.
|
||
|
||
### What is returned and persisted
|
||
|
||
Whole-book output includes:
|
||
|
||
- plot-line title, description, significance, book status, existing-line match/confidence/reason, and author-seed match/confidence/reason;
|
||
- subordinate thread details and match data;
|
||
- per-scene event key, `SceneID`, event type, title, description, evidence, confidence, and sort order.
|
||
|
||
Persistence is deliberately redundant for audit/review:
|
||
|
||
- `WholeBookPlotSynthesisRuns.ResultJson` keeps the raw result, request/response metadata, model, token counts, status, and errors;
|
||
- `StoryIntelligenceNarrativeCandidates` keeps line/thread candidates, significance, state/change information, matches, confidence, source, and review decision;
|
||
- `StoryIntelligenceNarrativeCandidateEvents` keeps structured scene touches and evidence;
|
||
- `StoryIntelligenceNarrativeCandidateEvidence` keeps scene-keyed contribution/evidence rows.
|
||
|
||
This means useful AI output is not merely transient.
|
||
|
||
### Materialisation losses
|
||
|
||
On acceptance, `StoryIntelligenceNarrativeReviewService` creates or matches canonical entities and events. The following reductions occur:
|
||
|
||
- a new line is materialised with canonical importance defaulted to Primary rather than preserving a candidate-level significance scale;
|
||
- a new thread receives importance 5 rather than a synthesis-derived value;
|
||
- per-event type, title/description, source reference/key, and confidence survive;
|
||
- distinct evidence does not have a canonical destination;
|
||
- candidate-level `Significance` does not become a per-scene contribution value;
|
||
- imported `PlotEventTypeID` is set to Progress, so structural start/reveal/twist/branch/merge semantics are not inferred/materialised even where event type wording may imply them.
|
||
|
||
The review/synthesis records remain available, but ordinary Plot Line/Timeline reads do not join them. The current UI therefore exposes considerably less than the import knows.
|
||
|
||
## F. Manuscript text availability
|
||
|
||
Migration `150_Phase24I_SceneManuscriptSource.sql` establishes `SceneManuscriptSources`, with one durable row per scene containing:
|
||
|
||
- complete `SourceText` (`nvarchar(max)`);
|
||
- project, book, chapter, and scene IDs;
|
||
- word and character counts;
|
||
- source start/end paragraph;
|
||
- Word start/end paragraph index;
|
||
- source kind and timestamps.
|
||
|
||
The row is efficiently retrievable by its primary-key `SceneID`, and repository procedures list scene sources by chapter/book. Complete scene text is therefore already available for a future inspector without re-running AI or reparsing the raw document.
|
||
|
||
`ManuscriptStructuralChapterSources` also retains whole chapter text, a paragraph map JSON document, structural parse JSON, and narrator/POV context. Scenes and chapters retain `ManuscriptDocumentID` and external/link metadata. `ManuscriptDocuments` provides the document identity/binding record.
|
||
|
||
Precision limits are important:
|
||
|
||
- scene and chapter paragraph ranges are retained;
|
||
- full scene text is retained;
|
||
- candidate evidence contains free-text excerpts/reasoning;
|
||
- there is no normalized passage entity or durable character/paragraph offset tying a particular candidate event evidence string to an exact source span;
|
||
- edits in Word can make imported numeric paragraph indices stale, while the Word content-control markers are intended to remain the live anchors.
|
||
|
||
Consequently a future workspace can already show summary, complete imported scene text, and stored AI evidence. It can associate all of them with the same scene/contribution. Exact highlighted passages in the imported text would require evidence-to-source alignment or new persisted offsets; that capability does not presently exist.
|
||
|
||
## G. Word Companion integration
|
||
|
||
The Word Companion is a hosted Office add-in (`PlotDirector.WordCompanion`) backed by `WordCompanionController`, `WordCompanionService`, and SignalR presence/hub services.
|
||
|
||
Existing capabilities include:
|
||
|
||
- document identity and manuscript structure retrieval;
|
||
- hidden content controls/bookmarks tagged `PD-CHAPTER-{id}` and `PD-SCENE-{id}`;
|
||
- paragraph-range scanning to resolve the current scene;
|
||
- scene/manuscript sync and link updates;
|
||
- pushing Word’s current scene into PlotDirector and broadcasting `storyPositionChanged`;
|
||
- web pages following the current Word position;
|
||
- server-to-add-in requests to rescan the current position.
|
||
|
||
A future plot development can immediately link to the PlotDirector scene route and load the stored imported text by `SceneID`. The same `SceneID` is also the logical Word anchor.
|
||
|
||
What is not currently present is a reverse “open/select this scene in Word” command from an arbitrary web page. The existing hub connection, companion registration, and `PD-SCENE` markers make this extension feasible, but it requires a new command and add-in handler. Numeric paragraph positions alone should not be the preferred live navigation mechanism after document edits; tagged content controls are the stronger reusable anchor.
|
||
|
||
## H. Events and chronology
|
||
|
||
PlotDirector does not currently have a generic, independent story-world `Event` entity. “Plot events” are `ThreadEvents` attached to scenes. Other event-like domains—asset events, relationship events, character attribute events, custody/knowledge changes—are also scene-anchored.
|
||
|
||
Story chronology is primarily stored on `Scene`:
|
||
|
||
- `TimeModeID`;
|
||
- `StartDateTime` and `EndDateTime`;
|
||
- duration amount/unit;
|
||
- relative time text;
|
||
- time confidence.
|
||
|
||
Thus a plot development inherits chronology through its `SceneID`. This already supports the proposed two-axis interpretation:
|
||
|
||
- manuscript/narrative position from scene order;
|
||
- story-world time from the scene’s chronology.
|
||
|
||
The Story Calendar already sorts dated scenes by story date/time and separates unplaced scenes. Story Intelligence’s temporal resolver derives canonical scene chronology from temporal analysis/clues. Continuity validation and scene dependencies detect date/order, travel, knowledge, reveal/setup, action-consequence, relationship, object, location, and other consistency issues. Timeline warning infrastructure can be reused for selected contribution scenes.
|
||
|
||
Limitations:
|
||
|
||
- a `ThreadEvent` has no own date/time, so two distinct events within one scene cannot occupy different story-world moments;
|
||
- a plot event cannot exist independently of a scene;
|
||
- temporal clues may survive in analysis JSON, but the durable canonical result is scene chronology rather than a normalized event timeline;
|
||
- branch/merge targets describe plot structure, not chronology.
|
||
|
||
The dedicated Plot Lines workspace can initially anchor developments to scene chronology with no new event system. A generic independent Event model would only be justified by requirements that cannot be represented at scene granularity.
|
||
|
||
## I. Scenario reuse
|
||
|
||
Scenarios are a good fit and should be reused.
|
||
|
||
`Scenario_Create` snapshots the canonical `NarrativeSceneOrder` into `ScenarioSceneOrder`. Each row keeps the same `SceneID` while overlaying a proposed chapter and sort order. Moves update only the overlay. Canonical chapter/scene ordering changes only after explicit Apply to Main.
|
||
|
||
Because plot membership, characters, assets, location, manuscript text, and chronology are keyed to `SceneID`, all of them automatically follow a moved scenario scene. `Scenario_Timeline` already demonstrates this by returning thread, asset, character, location, time, and warning labels in proposed order.
|
||
|
||
Scenario validation currently checks:
|
||
|
||
- hard “Must Occur Before” scene dependencies;
|
||
- adjacent exact-date reversals;
|
||
- reveal/payoff before a setup event in the same thread;
|
||
- validating asset dependency order;
|
||
- large pacing/emotional metric jumps.
|
||
|
||
The plot-thread setup check is weaker than its label suggests: it searches for an event type containing “Setup,” while the canonical thread-event lookup does not currently include a type named Setup. It should not be relied upon without correction or mapping (for example, treating Introduced/Clue Planted/Question Raised as setup semantics).
|
||
|
||
Reuse considerations for a filtered Plot Lines workspace:
|
||
|
||
- the scenario must retain a full-book order even when the UI displays only selected plot scenes;
|
||
- moving a visible scene relative to another visible scene must define its position among hidden scenes deterministically;
|
||
- validation should run against the full scenario, not just the filtered subset;
|
||
- the existing Scenario page uses forms/up/down/chapter moves rather than the rich Timeline drag UI, so interaction code may need extension, but the storage model should not be duplicated.
|
||
|
||
## J. Multi-Plot-Line feasibility
|
||
|
||
### Shared scenes
|
||
|
||
Fully supported. Group canonical `ThreadEvents` by `SceneID` and select scenes associated with two or more selected `PlotLineID` values. A shared scene can show all contributing threads/events without ambiguity.
|
||
|
||
### Shared events
|
||
|
||
Partially supported. Different plot lines can have events in the same scene, which provides a useful scene-level intersection. A single canonical `ThreadEvent` belongs to one `PlotThread`, and therefore one source plot line. `PlotEventTargetPlotLines` supplies cross-line targets for branch/split/merge behavior, but it does not establish one shared event identity across lines.
|
||
|
||
### Sequential interaction
|
||
|
||
Supported as a query/read-model concern. Union the selected lines’ scenes, order by `NarrativeSceneOrder` or scenario order, and label each scene with all selected memberships. Adjacent contributions and dormant stretches can be computed without new persistence.
|
||
|
||
### Cause and effect
|
||
|
||
Partially supported:
|
||
|
||
- `SceneDependencies` explicitly model source/target scene relationships including Reveal Setup, Action Consequence, Relationship, Knowledge, Object, Location, Travel, and Must Occur Before;
|
||
- plot branch/split/merge targets model structural relationships between lines;
|
||
- character knowledge and other continuity records can supply supporting causal context;
|
||
- Story Intelligence descriptions/evidence may state causal reasoning in free text.
|
||
|
||
There is no direct structured “contribution in line A causes contribution in line B” edge. Existing scene dependency edges should be surfaced first. A plot-specific causal edge should only be added if scene dependencies and plot targets prove semantically insufficient.
|
||
|
||
## K. Unattributed scenes
|
||
|
||
Canonical unattributed scenes are directly identifiable: active scenes for which no active `ThreadEvent → PlotThread → PlotLine` path exists. The count should be computed per project/book with the same archive/scope rules as canonical plot reads.
|
||
|
||
Three populations should be reported separately:
|
||
|
||
1. **canonically attributed** — at least one accepted thread event;
|
||
2. **proposed but not canonical** — no canonical event, but pending/rejected candidate events or candidate evidence exist;
|
||
3. **no known attribution** — neither canonical nor proposed evidence.
|
||
|
||
This distinction avoids labelling a review backlog or rejected suggestion as an AI miss.
|
||
|
||
Existing data that can explain an unattributed scene includes:
|
||
|
||
- scene purpose labels (including Character Development, Relationship Development, Setup, Exposition, Emotional Recovery, Comic Relief, Transition/Travel, Location Change, Time Passage, Consequence, and Reversal);
|
||
- purpose/outcome notes and scene/chapter summaries;
|
||
- POV, characters, relationships, assets, location, and character-state/knowledge data;
|
||
- scene dependencies and continuity warnings;
|
||
- metrics such as tension/emotional weight/action;
|
||
- Story Intelligence raw result, per-scene parsed narrative arcs, candidate evidence, and temporal clues;
|
||
- manuscript text itself.
|
||
|
||
This information can support editorial categories, but the system does not currently persist a definitive reason a scene is intentionally plot-unattributed. “Breathing scene,” “world building,” “aftermath,” or “missing plot association” would be inference unless explicitly authored or added as review state.
|
||
|
||
A later read-only development audit should report counts by book and the three populations above. It should not equate zero canonical events with an unnecessary scene.
|
||
|
||
## L. Timeline Plot Line removal
|
||
|
||
### Server-side components
|
||
|
||
- `ProjectTimelineSettings.ShowPlotLines` model, view model, service mapping, repository parameter, SQL column/default/save procedure, backup/restore, and Settings checkbox.
|
||
- `needsPlotTimelineData` in `TimelineService.GetAsync`.
|
||
- `TimelineData.PlotLines`, `TimelineData.ThreadEvents`, `TimelineViewModel.PlotLanes`, `PlotLineLaneViewModel`, and slot models, to the extent they are lane-only.
|
||
- `BuildPlotLanes` and lane enrichment.
|
||
- Timeline SQL result sets controlled by `@IncludePlotLines`.
|
||
|
||
Plot/thread filter and focus still use `ThreadEvents` and remain useful on a lean scene Timeline. Removing lanes must not accidentally stop loading the event data needed by those filters. A cleaner read path may load only membership IDs when lanes are gone.
|
||
|
||
### Razor and interactions
|
||
|
||
- plot lane board, labels, scene slots, event markers/tooltips, and SVG overlay in `Views/Timeline/Index.cshtml`;
|
||
- “Plot lines” View toggle;
|
||
- plot-line items in “Jump to lane item”;
|
||
- lane-specific event links/focus styling;
|
||
- the Plot Lines list’s Timeline “Focus” link remains valid if plot focus remains a scene filter; its wording may need to change.
|
||
|
||
No plot lane drag/drop was found. Plot event editing is handled elsewhere, so lane removal does not remove canonical authoring.
|
||
|
||
### JavaScript/state
|
||
|
||
- `plotline.timeline.visibility` key’s `plot-lines` member and hide class;
|
||
- plot SVG sizing, marker coordinates, path drawing, branch/split/merge connectors, layout observers, and resize/redraw handling;
|
||
- client plot-health calculations: neglected stretches, dangling branch/merge targets, questionable resolution, and abandoned-line notices;
|
||
- preset `VisibilityJson` contains lane visibility. `LoadPreset` currently deserializes `FilterJson` but does not apply `VisibilityJson`, making saved visibility effectively dead on load already. Existing stored JSON can be tolerated during migration and later cleaned/ignored.
|
||
|
||
### CSS, tests, and documentation
|
||
|
||
- lane-board, plot lane/slot/marker/SVG/path/connector/tooltip/health styles in `site.css`;
|
||
- Timeline browser coverage and the regression harness should gain assertions that lanes and retired controls are absent while plot filtering/focus still works;
|
||
- update `Help/Articles/Timeline/PlotLines.md`, `PlotThreadLanes.md`, `Overview.md`, `FiltersAndFocus.md`, and visibility/settings help;
|
||
- update `Help/Articles/PlotLines/Fields/Visibility.md` and Plot Line list/editor wording because `IsVisibleOnTimeline` becomes obsolete;
|
||
- retain Plot Lines/Threads and Scene Inspector help, but redirect visualization guidance to the new workspace.
|
||
|
||
### Functionality that must be preserved elsewhere
|
||
|
||
- branch/split/merge visualization based on event targets;
|
||
- event marker role/tooltip information;
|
||
- dormant/neglected/dangling/resolution/abandoned plot-health signals;
|
||
- plot line/thread focus over scenes;
|
||
- fast navigation from plot structure to a scene.
|
||
|
||
The first three are the main sequencing dependency: move them to the dedicated workspace or Story Health before deleting their Timeline implementation.
|
||
|
||
## M. Timeline Character lane removal
|
||
|
||
### What the lanes display
|
||
|
||
`BuildCharacterLanes` loads `CharacterTimeline_GetByProject`, groups `SceneCharacters` by character and scene, ranks characters by importance/classification and appearance roles, and creates an empty-or-populated slot for every ordered scene. Markers/tooltips expose presence, role/POV, introduction/exit, location, entry/exit, emotional and physical state, outfit/appearance notes, knowledge notes, and warnings.
|
||
|
||
### Affected implementation
|
||
|
||
- `ProjectTimelineSettings.ShowCharacterAppearances` across model/view model/service/repository/SQL/defaults/backup/restore;
|
||
- `needsCharacterTimelineData` and `BuildCharacterLanes`/`CharacterLanePriority`;
|
||
- `CharacterLaneViewModel`/slot data and `TimelineViewModel.CharacterLanes`;
|
||
- character lane board and entity-jump options in the Timeline view;
|
||
- the `characters` local visibility member/hide class;
|
||
- lane-specific CSS and any layout-observer selectors;
|
||
- `Help/Articles/Timeline/CharacterAppearances.md`, Timeline Overview/settings/view help, and any lane references in character help;
|
||
- browser/regression assertions for character-lane rendering and setting behavior.
|
||
|
||
### What should remain
|
||
|
||
- `SceneCharacters` and every appearance field;
|
||
- character filter/focus on the scene Timeline;
|
||
- POV filter and POV labels;
|
||
- characters shown on scene cards/Scene Inspector;
|
||
- Character details, scene appearance history, knowledge, relationships, and dedicated character features;
|
||
- Timeline quick-add palette and dropping a character onto a scene. This workflow targets scene cards and is independent of character lanes;
|
||
- character-derived continuity warnings.
|
||
|
||
The rich lane tooltip is the only concentrated presentation of several appearance-state fields. Before removal, verify equivalent discoverability in Character details and the Scene Inspector; add navigation there if necessary. No other domain feature depends on the lane rows themselves.
|
||
|
||
## N. Lean Timeline after removal
|
||
|
||
The resulting Timeline can retain:
|
||
|
||
- book/chapter bands and ordered scene cards;
|
||
- scene summaries, purpose, POV, location, character/asset chips, warnings, and dependency counts;
|
||
- metric shape, if still useful;
|
||
- story-time labels and chronological indicators;
|
||
- scene selection and the Scene Inspector;
|
||
- scene reorder/drop behavior;
|
||
- asset lanes only if they materially communicate chronological custody/state; this report does not recommend their removal;
|
||
- scene filters/focus for plot line, plot thread, character, POV, asset, location, purpose, revision, and warnings;
|
||
- quick-add/drop workflows on scene cards;
|
||
- saved filter views.
|
||
|
||
Immediate simplification opportunities are:
|
||
|
||
- remove two high-volume grid sections and their View toggles;
|
||
- rename “Jump to lane item” or limit it to remaining lane/entity types;
|
||
- remove plot/character visibility keys from future presets/local state while accepting older JSON;
|
||
- simplify layout-height and SVG redraw observers;
|
||
- keep plot/character filters as abstractions over the scene sequence rather than confusing them with lane visibility;
|
||
- revisit `VisibilityJson`, because saved visibility is collected but not restored today;
|
||
- emphasize story chronology and temporal conflicts rather than narrative abstraction in Timeline copy/help.
|
||
|
||
## O. Gap analysis
|
||
|
||
### Already exists and reusable
|
||
|
||
- canonical plot line/thread/event hierarchy;
|
||
- many-to-many scene/plot membership through thread events;
|
||
- meaningful contribution-role vocabulary;
|
||
- plot line/thread importance and lifecycle metadata;
|
||
- branch/split/merge targets;
|
||
- canonical and scenario manuscript ordering;
|
||
- scene chronology and warning/dependency infrastructure;
|
||
- complete imported scene text;
|
||
- Story Intelligence candidate events, confidence, evidence, raw synthesis output, and provenance;
|
||
- Word scene markers and current-position bridge;
|
||
- plot/thread and character scene filtering/focus;
|
||
- scenario overlay, compare, validate, and apply flow.
|
||
|
||
### Exists but is not exposed
|
||
|
||
- imported event confidence and source/provenance in ordinary plot UI;
|
||
- candidate-event evidence and match reasoning after materialisation;
|
||
- full scene manuscript text in a plot contribution inspector;
|
||
- candidate plot significance/book status;
|
||
- cross-line branch/split/merge structure outside Timeline SVG;
|
||
- useful distinction between canonical and proposed-only attribution.
|
||
|
||
### Exists partially and needs extension
|
||
|
||
- contribution role: strong current vocabulary, but incomplete mapping to the proposed editorial terms;
|
||
- significance: available at line/thread/candidate levels, not contribution level;
|
||
- evidence: durable in review tables but not canonically attached/highlighted;
|
||
- shared event: shared scene and target edges exist, no common event identity;
|
||
- causality: scene dependencies exist, no plot-contribution edge;
|
||
- Word navigation: Word-to-web exists, web-to-specific-Word-scene does not;
|
||
- scenario plot view: storage/order/validation exist, filtered workspace interaction does not;
|
||
- scenario setup/payoff validation: intended but current lookup matching is ineffective/incomplete;
|
||
- saved Timeline visibility: persisted but not restored.
|
||
|
||
### Does not exist
|
||
|
||
- direct scene/plot-line membership row independent of an event (not currently required);
|
||
- canonical per-contribution significance/weight;
|
||
- canonical distinct evidence/explanation with exact manuscript offsets;
|
||
- independent story-world Event entity with its own chronology;
|
||
- direct PlotLine-to-character/relationship/asset/location associations;
|
||
- structured cross-plot causal edge at contribution level;
|
||
- persisted intentional reason for a scene having no plot line;
|
||
- dedicated compact single-line/multi-line Plot Lines workspace;
|
||
- reverse open/select-scene command for Word Companion.
|
||
|
||
### Legacy functionality that can be removed
|
||
|
||
- Timeline plot lane generation/rendering after its health/connector value is relocated;
|
||
- Timeline character lane generation/rendering;
|
||
- `ShowPlotLines` and `ShowCharacterAppearances` settings and View toggles;
|
||
- `IsVisibleOnTimeline` field/UI after compatibility/migration planning (not as part of the first presentation-only removal);
|
||
- plot/character lane visibility local-state members and preset members;
|
||
- lane-only jump options, SVG/layout code, CSS, tests, and help;
|
||
- stale help for the former Main Plot field/type behavior;
|
||
- potentially `VisibilityJson` as a saved-view feature if the remaining visibility system is intentionally retired, otherwise fix it for remaining sections.
|
||
|
||
## P. Recommended implementation phases
|
||
|
||
### Phase 0 — confirm data with a read-only audit
|
||
|
||
- Run a read-only development query on one completed imported book.
|
||
- Report canonical, proposed-only, and no-known-attribution scene counts.
|
||
- Sample candidate evidence, canonical event descriptions/confidence, and manuscript-source availability.
|
||
- Confirm archived rows and project/book scope rules.
|
||
- Do not alter review state or regenerate analysis.
|
||
|
||
### Phase 1 — define a contribution read model
|
||
|
||
- Build a query/service over `PlotLines → PlotThreads → ThreadEvents → Scenes → NarrativeSceneOrder`.
|
||
- Include all events for a scene/line, role, line/thread importance, confidence/provenance, chronology, other line memberships, and available candidate evidence.
|
||
- Keep derivations (for example inferred significance) explicitly labelled.
|
||
- Add no schema until real UI requirements demonstrate a missing durable fact.
|
||
|
||
### Phase 2 — deliver the dedicated read-only Plot Lines workspace
|
||
|
||
- Single-line mode: only contributing scenes, in manuscript order, with no empty cells.
|
||
- Weave mode: union selected lines, consolidate shared scenes, label memberships, and show adjacency/dormant spans.
|
||
- Inspector: summary, events/roles, chronology, other lines, characters/assets/location, stored manuscript text, evidence/confidence, and Open Scene.
|
||
- Reuse colours, filters, help, and existing canonical routes.
|
||
- Relocate branch/split/merge drawing and plot-health signals here or to Story Health.
|
||
|
||
### Phase 3 — Scenario integration
|
||
|
||
- Read the same contribution model against `ScenarioSceneOrder`.
|
||
- Keep the complete scenario order behind a selected-line projection.
|
||
- Reuse Scenario move, compare, validate, and apply operations.
|
||
- Correct/extend setup-payoff validation using actual event semantics.
|
||
- Make chronology/dependency warnings visible without creating a second scenario engine.
|
||
|
||
### Phase 4 — evidence and Word navigation
|
||
|
||
- Expose existing full scene text and candidate evidence first.
|
||
- Add web-to-Word scene selection using the companion connection and `PD-SCENE-{id}` controls.
|
||
- Only if exact highlighting is required, add a robust evidence-to-source alignment design; do not treat imported paragraph numbers as permanently stable Word anchors.
|
||
|
||
### Phase 5 — contribution semantics extension
|
||
|
||
- Validate the desired role vocabulary against current `ThreadEventType`/`PlotEventType` usage.
|
||
- Decide whether author-confirmed role/significance/evidence belongs on each `ThreadEvent` or on a distinct contribution record that groups multiple events for one scene/line.
|
||
- Preserve synthesis provenance and review decisions.
|
||
- If schema changes are approved, use a new forward-only, idempotent SQL migration and stored procedures; do not alter historical scripts.
|
||
|
||
### Phase 6 — remove Plot Line and Character lanes from Timeline
|
||
|
||
- First verify relocated plot health/structural views and character appearance discoverability.
|
||
- Remove lane rendering, view models/builders, lane-only SQL loads, JS/SVG/layout code, CSS, toggles, settings, and help.
|
||
- Retain scene filters/focus, character quick-add, scene cards/inspector, and canonical data.
|
||
- Accept old local/preset JSON during compatibility transition.
|
||
- Update Plot Line “Timeline visibility” UI/data in a separate compatibility-conscious step.
|
||
|
||
### Phase 7 — simplify and harden the lean Timeline
|
||
|
||
- Tune the remaining chapter/scene/chronology layout.
|
||
- Add regression/browser coverage for absence of removed lanes and continued operation of plot/character filters, scene inspection, quick-add, saved views, chronology, and warnings.
|
||
- Measure Timeline query/render cost to confirm lane data is no longer fetched unless a retained filter requires it.
|
||
|
||
This sequence delivers the highest-value presentation correction early, preserves the current canonical model, and postpones schema additions until the dedicated workspace proves exactly which semantics must be durable.
|