Remove duplicate Character Overview analysis while preserving provenance

This commit is contained in:
Nick Beckley 2026-11-23 22:34:08 +00:00
parent f218291eb2
commit f3c3683bc2
8 changed files with 146 additions and 8 deletions

View File

@ -0,0 +1,35 @@
# Character Overview analysis cleanup — 23 November 2026
## Confirmed root cause and ownership
Biography and generated analysis are separate stored values: `Characters.DefaultDescription` and `CharacterEnrichmentEvidence.Value` with `FieldName=Summary`. `CharacterEnrichmentCharacterStatus_Get` reads retained evidence from the latest successful enrichment run; `CharacterWorkspace.Header` loads that status independently of the canonical character. The previous Overview rendered both narratives unconditionally and repeated generated birth date, age, height and eye colour underneath.
Development character 6060 has two exactly equal 599-character narratives. A read-only broader check found 33 exact duplicates among 41 active characters with successful retained summary evidence. This is not merely two bindings to one field: enrichment completion retains its summary as evidence and fills `DefaultDescription` only when biography is blank. Initial character creation during import can also initialise a biography from the candidate description; linking an existing character does not replace its description. Subsequent analysis may differ from an older seeded biography or from an author's edited biography. Those distinct values can represent useful additional information, so they are retained without text-similarity heuristics.
The live `CharacterEnrichmentRun_Complete` definition was verified to preserve every non-empty existing biography. The canonical Character Editor binds only `DefaultDescription` for the narrative and saves via `Character_Save`; it does not bind generated analysis or write enrichment evidence. Reanalysis uses the persisted enrichment queue/service and completion procedure. Structured Profile values remain canonical character fields; enrichment's structured evidence remains provenance and its existing conservative blank-field promotion policy is unchanged.
## Small presentation correction
`CharacterDetailViewModel.OverviewAnalysisSummary` returns the original recorded summary only when it is non-empty and differs from the biography after Unicode whitespace normalisation. Comparison retains case and punctuation differences. Stored source text is neither changed nor normalised for display. Overlapping but distinct analysis remains intact, with no sentence stripping or invented insights.
The Overview renders Story Intelligence Analysis only for that distinct summary and removes its four repeated structured attributes. Profile, Biography/edit route, At a glance, Known names, Recent recorded changes, navigation, tabs, gallery and ribbon actions remain intact. The existing two-column layout naturally closes around the omitted card; no CSS redesign or filler panel was added. Retained analysis evidence and the existing authorised status reader remain unchanged, including duplicate summaries; identical content remains visible in Biography. There is no separate new narrative store or migration.
## Verification
- Solution build succeeds with zero warnings/errors.
- Full executable regression harness: 816 PASS checks.
- Focused model tests: exact/Unicode whitespace equivalent values, distinct overlapping text, biography-only, analysis-only, neither, meaningful case differences and unchanged source values.
- `PlotLine.Tests/Sql/CharacterOverviewProvenance.sql` passes against Development: actual canonical biography save leaves analysis evidence unchanged; actual enrichment completion preserves author text before and after an edit; blank-biography seeding is confirmed. Synthetic records and completion payloads only, no AI requests, all writes rolled back.
- New compiled-Razor browser suite covers all narrative combinations, Barbara's actual read-only Development snapshot, structured Profile values once, retained panels/edit link, and widths 1450/900/390.
- New real authenticated browser suite covers the same combinations in disposable Development records, including a copy of Barbara's values, canonical biography editing with analysis unchanged, all five tabs and retained reanalysis action. It makes no AI request.
- Existing full Character workspace browser suite and enrichment completion/replay browser checks pass.
Barbara's actual page could not be authenticated using the disposable browser account, which has no access to her project. Her real stored values were therefore inspected read-only and rendered through the actual compiled Razor fixture; public authenticated acceptance uses authorised disposable records. No access to her project was added, and no real character was edited or reanalysed.
## Development operations and delivery
Database identity was verified as `PlotDirector_Development`; a unique copy-only/checksum backup was created and verified before fixture work. No schema migration is needed.
To provide deployment headroom, four archives/backups created by the immediately preceding tasks were checksum-copied from `/srv/apps/plotdirector-dev` to `/home/nick/.local/share/plotdirector-development-archives/`. Their original paths remain symlinks. These are the `shared-focus-ribbon-b10db72-20261123T214057Z` and `shared-focus-context-location-ea0199a-20261123T220253Z` release archives and their matching `current-before` directories. The live physical `current` directory was not moved. This reversible relocation freed approximately 2.1 GB on `/srv` while retaining the rollback copies.
Implementation push, release and post-deployment checks are recorded after installation. Production is untouched; unrelated local investigation files are preserved.

View File

@ -0,0 +1,32 @@
// Compiled Razor/CSS/JS with controlled recorded values; never queues AI or modifies a record.
const {chromium}=require('playwright'),assert=require('node:assert/strict'),fs=require('node:fs');
const base=process.env.PD_BROWSER_BASE||'http://127.0.0.1:5238';
(async()=>{const browser=await chromium.launch();let step='setup';try{
const c=await browser.newContext({viewport:{width:1450,height:1000}});let data={};const errors=[];let posts=0;
await c.route('**/signalr.min.js',r=>r.fulfill({contentType:'application/javascript',body:fs.readFileSync(require.resolve('@microsoft/signalr/dist/browser/signalr.min.js'),'utf8')}));
await c.route('**/native-companion/status',r=>r.fulfill({json:[]}));await c.route('**/native-companion/connection-state',r=>r.fulfill({json:{known:false}}));
await c.route('**/Characters/Workspace/Tab/*',async r=>{const query=new URLSearchParams({biography:data.biography||'',summary:data.summary||''});await r.fulfill({response:await r.fetch({url:base+'/character-overview-fixture?'+query})});});
c.on('request',r=>{if(r.method()==='POST'&&new URL(r.url()).pathname.startsWith('/Characters/'))posts++;});
const cases=[
{name:'identical',biography:'Recorded biography.',summary:'Recorded biography.',show:false},
{name:'whitespace',biography:'Recorded biography. More detail.',summary:'Recorded biography.\n\tMore\u00a0detail.',show:false},
{name:'distinct overlap',biography:'Recorded biography.',summary:'Recorded biography. Distinct recorded insight.',show:true},
{name:'biography only',biography:'Author narrative only.',show:false},
{name:'analysis only',summary:'Recorded analysis only.',show:true},
{name:'neither',show:false}
];
if(process.env.PD_CHARACTER_OVERVIEW_SNAPSHOT){const actual=JSON.parse(fs.readFileSync(process.env.PD_CHARACTER_OVERVIEW_SNAPSHOT));cases.unshift({name:'Barbara Development recorded values',...actual,show:false});}
const p=await c.newPage();p.on('pageerror',e=>errors.push(e.message));await p.addLocatorHandler(p.locator('[data-desktop-continue]'),n=>n.click());
for(const item of cases){step=item.name;data=item;await p.goto(base+'/character-workspace-fixture');await p.waitForSelector('[data-character-tab-content="overview"]');
assert.equal(await p.locator('[data-character-generated-analysis]').count(),item.show?1:0);
if(item.show){assert.equal(await p.locator('[data-character-analysis-summary]').innerText(),item.summary);assert.equal(await p.locator('[data-character-generated-analysis] p').count(),1);}
assert.equal(await p.locator('[data-character-analysis-dob],[data-character-analysis-age],[data-character-analysis-height],[data-character-analysis-eye]').count(),0);
for(const heading of ['Profile','Biography and description','At a glance','Known names','Recent recorded changes'])assert.equal(await p.getByRole('heading',{name:heading,exact:true}).count(),1);
assert.equal(await p.locator('[data-character-birth-date]').count(),1);assert.equal(await p.locator('[data-character-profile-age]').count(),1);
if(item.biography)assert.equal(await p.locator('.character-long-text').first().innerText(),item.biography);
assert.match(await p.getByRole('link',{name:'Edit profile and background'}).getAttribute('href'),/\/Characters\/Edit\/5/);
for(const width of [1450,900,390]){await p.setViewportSize({width,height:950});assert(await p.evaluate(()=>document.documentElement.scrollWidth<=innerWidth+2));}
}
assert.equal(posts,0,'Overview reads never save or queue analysis');assert.deepEqual(errors,[]);
console.log('PASS compiled Character Overview: exact/Unicode whitespace duplicate, overlapping distinct analysis, biography-only, analysis-only, neither, structured Profile once, no empty analysis card, other Overview panels/edit route preserved, responsive desktop/mobile'+(process.env.PD_CHARACTER_OVERVIEW_SNAPSHOT?', actual Barbara Development snapshot':'')+'.');
}catch(e){console.error('FAILED '+step+': '+e.stack);process.exitCode=1;}finally{await browser.close();}})();

View File

@ -0,0 +1,19 @@
// Real auth, Razor, SQL and existing persisted enrichment snapshots. Disposable fixture only.
const {chromium}=require('playwright'),fs=require('node:fs'),assert=require('node:assert/strict');
const base=process.env.PD_SHARED_FOCUS_URL||'http://127.0.0.1:5258';
(async()=>{const who=JSON.parse(fs.readFileSync(process.env.PD_CONTEXT_IDENTITY)),scope=JSON.parse(fs.readFileSync('/tmp/shared-focus-browser-scope.json')),cases=JSON.parse(fs.readFileSync(process.env.PD_CHARACTER_OVERVIEW_CASES));assert.equal(who.Database,'PlotDirector_Development');assert.equal(who.UserID,scope.user);
const browser=await chromium.launch();let step='login';try{const c=await browser.newContext({viewport:{width:1450,height:1000}});const errors=[];c.on('page',p=>p.on('pageerror',e=>errors.push(e.message)));
await c.route('**/signalr.min.js',r=>r.fulfill({contentType:'application/javascript',body:fs.readFileSync(require.resolve('@microsoft/signalr/dist/browser/signalr.min.js'),'utf8')}));
const p=await c.newPage();await p.addLocatorHandler(p.locator('[data-desktop-continue]'),n=>n.click());await p.goto(base+'/Account/Login');await p.fill('[name=Email]',who.Email);await p.fill('[name=Password]',who.Password);await Promise.all([p.waitForURL(u=>u.pathname!='/Account/Login'),p.locator('button[type=submit]').click()]);
async function overview(id){await p.goto(`${base}/Characters/Details/${id}`);await p.waitForSelector('[data-character-tab-content="overview"]');}
for(const [name,id]of Object.entries(cases)){step=name;await overview(id);assert.equal(await p.locator('[data-character-generated-analysis]').count(),['distinctAnalysis','analysisOnly'].includes(name)?1:0);
assert.equal(await p.locator('[data-character-analysis-dob],[data-character-analysis-age],[data-character-analysis-height],[data-character-analysis-eye]').count(),0);
for(const title of ['Profile','Biography and description','Known names','At a glance','Recent recorded changes'])assert.equal(await p.getByRole('heading',{name:title,exact:true}).count(),1);
if(name==='duplicate'){assert((await p.locator('.character-long-text').first().innerText()).length>500,'actual recorded biography remains visible');}
for(const width of [1450,900,390]){await p.setViewportSize({width,height:1000});assert(await p.evaluate(()=>document.documentElement.scrollWidth<=innerWidth+2));}await p.setViewportSize({width:1450,height:1000});
}
step='canonical biography editor preserves retained distinct analysis';await overview(cases.distinctAnalysis);const before=await p.locator('[data-character-analysis-summary]').innerText();await p.getByRole('link',{name:'Edit profile and background'}).click();await p.waitForSelector('[name=DefaultDescription]');await p.fill('[name=DefaultDescription]','Author edited disposable biography.');await Promise.all([p.waitForURL(u=>u.pathname.includes('/Characters/Details/')),p.locator('form[action="/Characters/Save"] button[type=submit]').click()]);await p.waitForSelector('[data-character-tab-content="overview"]');assert.equal(await p.locator('.character-long-text').first().innerText(),'Author edited disposable biography.');assert.equal(await p.locator('[data-character-analysis-summary]').innerText(),before);
step='other tabs remain usable';for(const tab of ['relationships','evolution','appearances','knowledge','overview']){await p.click(`[data-character-tab="${tab}"]`);await p.waitForSelector(`[data-character-tab-content="${tab}"]`);}assert.equal(await p.locator('[data-character-reanalyse-form]').count(),1);
assert.deepEqual(errors,[]);console.log('PASS real Development Character Overview: duplicate actual-data copy, distinct/biography-only/analysis-only/neither, Profile fields once, responsive layout, canonical biography edit preserves analysis, all tabs and reanalysis action retained; no AI queued.');
}catch(e){console.error('FAILED '+step+': '+e.stack);process.exitCode=1;}finally{await browser.close();}})();

View File

@ -5,6 +5,15 @@ internal static class CharacterWorkspaceTests
public static async Task Run()
{
void Check(bool value,string message){if(!value)throw new Exception(message);Console.WriteLine("PASS main Character workspace: "+message);}
var profile=new CharacterDetailViewModel{Character=new(){DefaultDescription="Author biography. Additional detail."},CharacterAnalysis=new(){Summary="Author biography.\n\tAdditional\u00a0detail."}};
Check(profile.OverviewAnalysisSummary==null,"whitespace-equivalent analysis is omitted without changing stored sources");
Check(profile.CharacterAnalysis.Summary!.Contains('\n')&&profile.Character.DefaultDescription.Contains(" "),"display deduplication leaves source values intact");
profile.CharacterAnalysis=new(){Summary="Author biography. Additional detail. A distinct recorded insight."};
Check(profile.OverviewAnalysisSummary==profile.CharacterAnalysis.Summary,"overlapping but distinct analysis is retained in full");
profile.CharacterAnalysis=new(){Summary=null};Check(profile.OverviewAnalysisSummary==null,"biography-only has no empty analysis card");
profile.Character.DefaultDescription=null;profile.CharacterAnalysis=new(){Summary="Recorded analysis only."};Check(profile.OverviewAnalysisSummary=="Recorded analysis only.","analysis-only retains the recorded narrative");
profile.CharacterAnalysis=new(){Summary=" \t\n"};Check(profile.OverviewAnalysisSummary==null,"neither narrative produces no analysis card");
profile.Character.DefaultDescription="Author biography.";profile.CharacterAnalysis=new(){Summary="Author Biography."};Check(profile.OverviewAnalysisSummary!=null,"comparison preserves meaningful spelling/case/punctuation differences");
var role="Owner";int records=0,galleries=0,changes=0,aliases=0;bool protectedEvent=false;var version=new string('A',64);
var character=new Character{CharacterID=5,ProjectID=7,CharacterName="Canonical identity",CharacterImportance=6,AgeAtSeriesStart=25};
var definitions=new RelationshipMapData{Books=[new(){BookID=12,SortOrder=1}],Chapters=[new(){ChapterID=10,BookID=12,SortOrder=1}],Scenes=[new(){SceneID=90,ChapterID=10,SceneNumber=1},new(){SceneID=22,ChapterID=10,SceneNumber=2},new(){SceneID=2,ChapterID=10,SceneNumber=3}],Relationships=[new(){CharacterRelationshipID=9,ProjectID=7,CharacterAID=5,CharacterBID=6,RelationshipTypeName="Parent",RelationshipCategoryName="Family",IsInitialRelationship=true,InitialRelationshipStateName="Before"},new(){CharacterRelationshipID=11,ProjectID=7,CharacterAID=5,CharacterBID=7,RelationshipTypeName="Friend",RelationshipCategoryName="Friendship",StartSceneID=2}],RelationshipEvents=[new(){RelationshipEventID=1,CharacterRelationshipID=9,SceneID=22,RelationshipStateName="Now"},new(){RelationshipEventID=2,CharacterRelationshipID=9,SceneID=2,RelationshipStateName="Later",Description="Future notes"}]};

View File

@ -0,0 +1,31 @@
-- Development only. Synthetic records, no AI requests; every write rolls back.
SET XACT_ABORT ON;
IF DB_NAME()<>N'PlotDirector_Development' THROW 51000,'Development only',1;
DECLARE @user int=(SELECT TOP(1) UserID FROM dbo.AppUser WHERE Email LIKE N'pwa-browser-%' ORDER BY UserID);
IF @user IS NULL THROW 51000,'Disposable browser account required',1;
BEGIN TRY
BEGIN TRANSACTION;
INSERT dbo.Projects(ProjectName) VALUES(N'Disposable overview provenance rollback');DECLARE @project int=SCOPE_IDENTITY();
INSERT dbo.Books(ProjectID,BookTitle,BookNumber,SortOrder) VALUES(@project,N'Disposable provenance',999999,999999);DECLARE @book int=SCOPE_IDENTITY();
DECLARE @ids TABLE(ID int);INSERT @ids EXEC dbo.Character_Save @ProjectID=@project,@CharacterName=N'Provenance fixture',@DefaultDescription=N'Author maintained biography';DECLARE @character int=(SELECT ID FROM @ids);
INSERT dbo.CharacterEnrichmentRuns(ProjectID,BookID,UserID,CharacterID,CharacterResolutionVersion,Status,TotalCharacters) VALUES(@project,@book,@user,@character,N'Overview provenance fixture',N'Running',1);DECLARE @run int=SCOPE_IDENTITY();
DECLARE @json nvarchar(max)=(SELECT @character characterID,N'Distinct synthetic analysis' summary,0.95 confidence FOR JSON PATH);
EXEC dbo.CharacterEnrichmentRun_Complete @CharacterEnrichmentRunID=@run,@Model=N'Regression fixture; no AI',@ResultsJson=@json;
IF NOT EXISTS(SELECT 1 FROM dbo.Characters WHERE CharacterID=@character AND DefaultDescription=N'Author maintained biography') THROW 51000,'Reanalysis overwrote author biography',1;
IF NOT EXISTS(SELECT 1 FROM dbo.CharacterEnrichmentEvidence WHERE CharacterEnrichmentRunID=@run AND CharacterID=@character AND FieldName=N'Summary' AND Value=N'Distinct synthetic analysis') THROW 51000,'Distinct analysis evidence not retained',1;
DELETE FROM @ids;INSERT @ids EXEC dbo.Character_Save @CharacterID=@character,@ProjectID=@project,@CharacterName=N'Provenance fixture',@DefaultDescription=N'Edited author biography';
IF NOT EXISTS(SELECT 1 FROM dbo.Characters WHERE CharacterID=@character AND DefaultDescription=N'Edited author biography') THROW 51000,'Canonical biography edit failed',1;
IF NOT EXISTS(SELECT 1 FROM dbo.CharacterEnrichmentEvidence WHERE CharacterEnrichmentRunID=@run AND CharacterID=@character AND FieldName=N'Summary' AND Value=N'Distinct synthetic analysis') THROW 51000,'Biography edit changed stored analysis',1;
EXEC dbo.CharacterEnrichmentRun_Complete @CharacterEnrichmentRunID=@run,@Model=N'Regression fixture; no AI',@ResultsJson=@json;
IF NOT EXISTS(SELECT 1 FROM dbo.Characters WHERE CharacterID=@character AND DefaultDescription=N'Edited author biography') THROW 51000,'Later reanalysis overwrote edited biography',1;
-- Confirm the existing blank-biography seeding behaviour that causes duplicates.
DELETE FROM @ids;INSERT @ids EXEC dbo.Character_Save @CharacterID=@character,@ProjectID=@project,@CharacterName=N'Provenance fixture',@DefaultDescription=NULL;
EXEC dbo.CharacterEnrichmentRun_Complete @CharacterEnrichmentRunID=@run,@Model=N'Regression fixture; no AI',@ResultsJson=@json;
IF NOT EXISTS(SELECT 1 FROM dbo.Characters WHERE CharacterID=@character AND DefaultDescription=N'Distinct synthetic analysis') THROW 51000,'Blank-biography seed behaviour changed',1;
ROLLBACK TRANSACTION;
PRINT 'PASS canonical author edit preserves analysis; reanalysis preserves nonempty author biography; blank biography seeds from retained evidence; all fixture writes rolled back.';
END TRY
BEGIN CATCH
IF @@TRANCOUNT>0 ROLLBACK TRANSACTION;
THROW;
END CATCH;

View File

@ -415,6 +415,12 @@ internal static class ToolbarBrowserHost
return context.Response.WriteAsJsonAsync(new PlotLine.Services.Context.ContextFamilyTree(topology.Key(focus),graph,visible.Branches,topology.Warnings(visible.People)));
});
app.MapGet("/relationship-evolution-fixture",async context=>{int count=int.TryParse(context.Request.Query["count"],out var n)?n:1;var model=new RelationshipEvolutionViewModel{Project=new(){ProjectID=7,ProjectName="Evolution fixture"},Relationship=CharacterWorkspaceBrowserFixture.Relationship(),ReturnCharacterID=5,CanEdit=context.Request.Query["viewer"]!="true",Events=Enumerable.Range(1,count).Select(i=>new PlotLine.Models.RelationshipProgressionPoint{RelationshipEventID=i,CharacterRelationshipID=9,SceneID=i,SceneNumber=i,BookTitle="Recorded book",ChapterNumber=1,SceneTitle="Canonical scene "+i,GlobalSceneIndex=i*3,Intensity=i==2?null:Math.Min(10,i+2),RelationshipStateName="Recorded state "+i,Description="Canonical event description",TotalRecords=count}).ToArray()};await RenderFullAsync(context,"Dynamics","Relationship",model);});
app.MapGet("/character-overview-fixture",async context=>{
var page=CharacterWorkspaceBrowserFixture.Page(5,new(){Tab="overview"});
page.Profile.Character.DefaultDescription=context.Request.Query["biography"].FirstOrDefault();
page.Profile.CharacterAnalysis=new(){Status="Completed",Summary=context.Request.Query["summary"].FirstOrDefault()};
await WorkspacePartial(context,"_WorkspaceTab",page);
});
app.MapGet("/character-workspace-fixture",async context=>{
var id=int.TryParse(context.Request.Query["id"],out var cid)?cid:5;var profile=CharacterWorkspaceBrowserFixture.Header(id,context.Request.Query["viewer"]=="true");profile.WorkspaceTab=context.Request.Query["tab"].FirstOrDefault();if(profile.WorkspaceTab!=null)profile.WorkspacePage=CharacterWorkspaceBrowserFixture.Page(id,new(){Tab=profile.WorkspaceTab},context.Request.Query["viewer"]=="true");await RenderFullAsync(context,"Characters","Details",profile);
});

View File

@ -1983,6 +1983,16 @@ public sealed class CharacterEditViewModel
public sealed class CharacterDetailViewModel
{
// Presentation only: retain the recorded analysis and author text exactly as stored.
public string? OverviewAnalysisSummary
{
get
{
var summary=CharacterAnalysis.Summary;
static string Normalise(string? value)=>string.Join(" ",(value??"").Split((char[]?)null,StringSplitOptions.RemoveEmptyEntries));
return string.IsNullOrWhiteSpace(summary)||string.Equals(Normalise(summary),Normalise(Character.DefaultDescription),StringComparison.Ordinal)?null:summary;
}
}
public bool WorkspaceCanEdit {get;set;}
public string? WorkspaceTab {get;set;}
public CharacterWorkspaceCounts WorkspaceCounts {get;set;}=new();

View File

@ -1,5 +1,5 @@
@model CharacterDetailViewModel
@{var analysis=Model.CharacterAnalysis;var analysisStatus=string.IsNullOrWhiteSpace(analysis.Status)?"Not analysed":analysis.Status;var lastAnalysed=analysis.LastAnalysedUtc?.ToLocalTime().ToString("d MMMM yyyy, HH:mm");var storyImportance=CharacterWorkspace.Classification(Model.Character.CharacterImportance);var knownNames=Model.Aliases.Select(a=>a.Alias).Append(Model.Character.CharacterName).Where(n=>!string.IsNullOrWhiteSpace(n)).Distinct(StringComparer.OrdinalIgnoreCase).OrderBy(n=>n!=Model.Character.CharacterName).ThenBy(n=>n).ToArray();}
@{var analysis=Model.CharacterAnalysis;var distinctAnalysis=Model.OverviewAnalysisSummary;var analysisStatus=string.IsNullOrWhiteSpace(analysis.Status)?"Not analysed":analysis.Status;var lastAnalysed=analysis.LastAnalysedUtc?.ToLocalTime().ToString("d MMMM yyyy, HH:mm");var storyImportance=CharacterWorkspace.Classification(Model.Character.CharacterImportance);var knownNames=Model.Aliases.Select(a=>a.Alias).Append(Model.Character.CharacterName).Where(n=>!string.IsNullOrWhiteSpace(n)).Distinct(StringComparer.OrdinalIgnoreCase).OrderBy(n=>n!=Model.Character.CharacterName).ThenBy(n=>n).ToArray();}
<div class="character-dossier"><div><article class="plain-card">
<h2>Profile</h2>
<p><strong>Preferred name:</strong> @Model.Character.CharacterName</p>
@ -51,11 +51,7 @@
</div>
}
</div></details>
</article><p class="small">Showing up to 50 aliases. The full character editor retains every recorded name and alias.</p></div><aside><article class="plain-card"><h2>At a glance</h2><p>Recorded totals across the project. These are author records, not inferred viewpoint knowledge.</p><p><strong>Recorded family</strong><br/>@(Model.WorkspaceCounts.FamilyConnections??"No family connections recorded.")</p><p><strong>Recorded story relationships</strong><br/>@(Model.WorkspaceCounts.StoryConnections??"No story relationships recorded.")</p><p class="small">Up to three definitions per group; explore all connections in <a data-workspace-go="relationships" href="?tab=relationships">Relationships</a>.</p><div class="character-glance">@foreach(var item in new[]{("relationships","Relationships",Model.WorkspaceCounts.Relationships),("evolution","Attribute changes",Model.WorkspaceCounts.Attributes),("appearances","Scene appearances",Model.WorkspaceCounts.Appearances),("knowledge","Knowledge records",Model.WorkspaceCounts.Knowledge)}){<a data-workspace-go="@item.Item1" href="?tab=@item.Item1"><strong>@item.Item3</strong> @item.Item2</a>}</div></article><article class="plain-card" data-character-generated-analysis>
</article><p class="small">Showing up to 50 aliases. The full character editor retains every recorded name and alias.</p></div><aside><article class="plain-card"><h2>At a glance</h2><p>Recorded totals across the project. These are author records, not inferred viewpoint knowledge.</p><p><strong>Recorded family</strong><br/>@(Model.WorkspaceCounts.FamilyConnections??"No family connections recorded.")</p><p><strong>Recorded story relationships</strong><br/>@(Model.WorkspaceCounts.StoryConnections??"No story relationships recorded.")</p><p class="small">Up to three definitions per group; explore all connections in <a data-workspace-go="relationships" href="?tab=relationships">Relationships</a>.</p><div class="character-glance">@foreach(var item in new[]{("relationships","Relationships",Model.WorkspaceCounts.Relationships),("evolution","Attribute changes",Model.WorkspaceCounts.Attributes),("appearances","Scene appearances",Model.WorkspaceCounts.Appearances),("knowledge","Knowledge records",Model.WorkspaceCounts.Knowledge)}){<a data-workspace-go="@item.Item1" href="?tab=@item.Item1"><strong>@item.Item3</strong> @item.Item2</a>}</div></article>@if(distinctAnalysis!=null){<article class="plain-card" data-character-generated-analysis>
<h2>Story Intelligence Analysis</h2>
<p class="@(string.IsNullOrWhiteSpace(analysis.Summary) ? "muted" : string.Empty)" data-character-analysis-summary>@(analysis.Summary ?? "No generated character analysis yet.")</p>
<p><strong>Date of birth:</strong> <span data-character-analysis-dob>@(analysis.DateOfBirth ?? "Unknown")</span></p>
<p><strong>Age at start of series:</strong> <span data-character-analysis-age>@(analysis.AgeAtStartOfSeries ?? "Unknown")</span></p>
<p><strong>Height:</strong> <span data-character-analysis-height>@(analysis.Height ?? "Unknown")</span></p>
<p><strong>Eye colour:</strong> <span data-character-analysis-eye>@(analysis.EyeColour ?? "Unknown")</span></p>
</article></aside></div>
<p class="character-long-text" data-character-analysis-summary>@distinctAnalysis</p>
</article>}</aside></div>