PlotDirector/Docs/Writer/Context-Family-Tree-Redesign-20261122.md

14 KiB
Raw Blame History

Context Family tree redesign — 22 November 2026

Requested base: deployed d955971; repository evidence-only HEAD was 4678617. Scope is the Context Family lens. The Story lens, main Relationships editor, canonical relationship types and manuscript records are preserved. Production is outside scope.

Family identification and scene index

The index starts from explicit physical participants under existing canonical presence rules, plus the POV independently of presence. Mentioned Only overrides a contradictory presence label. Names/surnames, scene co-occurrence, residence, friendship, hostility and professional partnerships never establish membership.

New ContextFamilyTopology builds connected components over supported canonical parent/child, biological/adoptive/step parentage, recorded marriages/family partnerships, siblings/half-siblings and explicit aunt/uncle/niece/nephew/cousin links. Parent direction must be unambiguous. Iterative strong-component analysis excludes ancestry-cycle edges; descendants of a cycle are not automatically branded as cycles. Reciprocal parent/child, self-links, unknown type semantics and guardianship alone do not establish genealogy. Known unverified primary evidence for a relationship's establishing scene is excluded by the reader. Other canonical author-established relationships retain their existing authority; no verification field or knowledge engine is invented.

One entry represents each eligible connected family structure. Its key is the smallest canonical character ID in the component, and its label uses up to two recognisable scene characters, with POV first. Other entries sort predictably by label and ID. Explicit marriage can connect ancestral branches into a broader navigable family; actual parentage remains separately recorded and drawn. An individual with no qualifying relatives gets their own entry. Three compact buttons plus More are used where needed; panes narrower than 560px use a labelled selector.

Initial/new-scene selection prefers the POV family. Same-scene manual exploration survives notifications. Each pane is independent. A scene change resets the default family choice without recalculating an unchanged layout; if the same POV remains focused, pan/zoom need not reset. No new pinning system.

Genealogical layout

The existing small deterministic SVG layout is extended, without a new graph library. Explicit directional ancestry establishes vertical generations; partners and recorded siblings align only where ancestry permits. Reliable birth dates order known siblings. Separate parental rails retain biological, adoptive and step semantics. Children attach beneath their actual recorded parent, or beneath an explicit recorded partnership when compatible parentage exists for both partners. Co-parentage alone creates no partner or union marker.

Multiple partnerships have separate rails and children keep their exact recorded parent links; half-siblings do not acquire each other's second parent. Single parents remain single. Ended/former partnerships remain visible with dashed status. Deceased and archived relatives remain visible; archival does not imply death. Global life status retains its existing author-reference label.

Orthogonal generation-gap buses and outer corridors for skipped generations avoid unrelated cards. A connector halo distinguishes crossings, and junction dots identify explicit parental unions. Unknown relatives/ancestry are never fabricated. Explicit kinship without enough parentage to place generations is shown with an explanatory warning. Structural signatures exclude notes/state-only changes; unchanged structures keep their cached deterministic layout. The graph retains readable 180×66 cards, pan/zoom and fixed text sizes.

Compact branches and retained state

Initial visibility includes the focus, recorded adjacent relatives, siblings supported by common recorded parentage and nearby recorded partners. It does not load all generations into the browser. A node's + appears only when additional recorded adjacent relatives exist. Its accessible title gives an exact count of hidden adjacent relatives, not a speculative total descendant count. Expanding adds recorded neighbours; − removes that expansion. No expansion creates people or relationships, and it cannot open an editing modal.

Each tree request reauthorises book, scene, project and focus. Expansion IDs must belong to the selected component. If a membership edit makes previously saved expansion IDs obsolete, the refreshed index/tree reconciles the component and retries a compact tree. Concurrently changed returned records are rechecked so disconnected physical participants cannot remain in the selected tree. Branch changes preserve the selected person's screen position where practical.

Each pane retains at most 12 recently used family view states: focus, selection, up to 64 expanded nodes, pan, zoom and layout. Only the current Family data response and existing Story response are cached. A book change discards the previous book's family state. State is in-window lifecycle state, not unlimited persisted diagrams or a new cross-window messaging system.

Family gestures permit drag/pinch from cards or connectors after a movement threshold, preserving taps for selection and protecting branch controls. This addresses mobile touch target adjustment near cards. Story gesture semantics remain unchanged. Branch controls support touch, Enter and Space; SVG keyboard pan/zoom and the shared correction modals remain available.

Services, queries and safety

ContextRelationshipLenses.Scope, canonical characters, existing narrative ordering, RelationshipMapService.BuildAtScene projection, verified evidence projection, existing focused relationship editing, shared PlotDirector.toast, Context invalidation and My Windows remain authoritative. No additional SignalR connection, name inference, new relationship category, inline application SQL or bulk canonical migration.

Forward migration 305_ContextFamilyExploration.sql adds two read-only stored procedures. Structure returns only eligible seed names and at most 8,193 relationship metadata rows (the 8,193rd is a rejection sentinel). The server identifies components; it never sends the project membership graph to the browser. Tree returns at most 128 requested identities and 256 requested canonical links, with existing minimal narrative ordering metadata (20,000-item limit) and at most three verified developments per visible link through the existing event reader. Additional character details are fetched when a branch is expanded. No complete manuscript or relationship history is fetched for the tree. Very large metadata requests fail explicitly and retain a full-editor route rather than silently declaring incomplete families unrelated.

Development-only backup context-family-20261122T194552Z.bak succeeded with CHECKSUM and VERIFYONLY. Effective database was verified as PlotDirector_Development; only migration305 was applied. No canonical rows were changed by the migration. Backup verification is not claimed as a restore test. Original untracked investigation documents were preserved.

Verification evidence

Isolated canonical fixtures cover separate families in one scene; actual siblings sharing an entry; biological versus adoptive parentage; single parents; exact half-sibling parentage; multiple marriages; step relations; isolated individuals; cyclic/ambiguous records; membership merge/split after editing; independent POV inclusion and mentioned-only exclusion. Service tests cover Viewer access, project/book isolation, selected-component-only snapshots and foreign branch rejection.

Browser interaction acceptance covers one family at a time, POV bias, More and compact selectors, branch +/−, keyboard activation, preserved family zoom/selection through notifications, obsolete expansion recovery after a split, regrouping after a merge, independent panes, new scene POV defaults, and eviction after 12 retained families. Responsive cases include full-width, half-width columns, stacked panes, 390px mobile and two simultaneous Relationships tools. Existing Family/Story browser regression retains exact Story scene-state, direction, focus and editing checks.

Layout assertions cover four generations, biological/adoptive/step styles, multiple partners, exact parentage, known birth order, no invented union for co-parents, no overlapping cards and orthogonal paths avoiding unrelated cards. Large/deep metadata fixtures exercise the bounded server selection and iterative ancestry traversal. Touch-emulated Chromium covers branch taps without editing, card selection, real CDP drag and pinch, zoom, lens switching and no document horizontal overflow. Physical-device/PWA installation is not claimed.

Additional real-manuscript acceptance used existing authorised Development data read-only: one eligible scene identity and scene-family entry, plus two additional recorded family components. Three deidentified snapshots contained ten visible identities and eight recorded connections, with no overlapping cards or invented identities. Canonical relationship checksums were unchanged before/after. No real manuscript relationship was edited. This is structural data acceptance, not author editorial approval of every family.

Final qualification: solution build succeeded with zero warnings/errors; full executable regression harness completed with 770 PASS lines and exit0. This includes 21 new Family domain/access/performance assertions, existing Family/Story and focused-editing regressions, and the wider application harness. Broad/deep 4,096-edge metadata fixtures completed in 72ms on this host (an observed fixture result, not a database latency guarantee). Actual SVG connector hit selection, membership merge/split recovery and the 12-family state bound passed in the Family browser. Existing shared modal acceptance passed all nine character/name variants plus relationship forms; My Windows real-SignalR isolation/reconnect passed; shared notification and touch/gesture checks passed. No forced browser clicks or modal/authorisation bypasses.

Predeployment evidence: /tmp/context-family-final-build2.log, /tmp/context-family-final-regression.log, /tmp/context-family-final-browser.log, /tmp/context-family-final-story-browser.log, /tmp/context-family-final-shared-browser.log, /tmp/context-family-final-windows-browser.log, /tmp/context-family-final-touch.log, /tmp/context-family-notifications.log, /tmp/context-family-readonly-final.log. Deployment and live endpoint/editing evidence are recorded below after installation.

Limits / future manual acceptance

  • Explicit cousin/aunt/uncle and similar kinship without parentage cannot reliably establish missing ancestors or precise generations. The interface labels this limitation rather than inventing them.
  • Ambiguous or unsupported records require correction in the existing Relationships Editor; excluded records are not used to merge index entries.
  • Membership metadata is bounded at 8,192 project family records, a visible tree at 128 people/256 links and retained state at 12 families/64 expansions. Larger structures require recentering or the full editor; metadata beyond the hard limit needs future incremental membership infrastructure.
  • Author-reference truth is independent of POV knowledge. No new viewpoint-knowledge, biological inference or first-meeting logic is provided.
  • Physical phones/tablets, installed PWA windowing and screen-reader review remain manual acceptance. Editorial review of representative author-owned complex families is recommended; those records were not modified for testing.

Final exploration-state acceptance also verified re-centring on a visible relative and searching back into a previously visited family: zoom and expanded branches are retained, with at most one bounded restoration retry after the server resolves the canonical component. Evidence: /tmp/context-family-state-browser.log, /tmp/context-family-state-story.log, /tmp/context-family-state-touch.log. The Story regression uses normal keyboard pan to reach an offscreen branch at the restored zoom. No .NET domain changes followed the 770-PASS run.

Development delivery

Deployed source commit 6ba409220aa3d8071d447c722e5ecdb7fc342427 (implementation f357cbd, exploration-state follow-up 6ba4092). Release: /srv/apps/plotdirector-dev/releases/context-family-final-6ba4092-20261122T201055Z. The active import/Story Intelligence/synthesis/enrichment guard passed immediately before restart. Service active; local/public HTTP200 with normal TLS verification; deployed assembly informational commit and all 12 published/live assembly/assets SHA-256 hashes matched. Deployment manifest: /tmp/context-family-final-deployment.json.

Actual authenticated API acceptance initially returned a useful empty index on the old qualification scene, which correctly had no POV and no explicitly physical participants. Only that disposable fixture was then prepared through the existing SceneCharactersEditor/SaveSceneCharacters form: its two known synthetic participants were marked Present, any Mentioned Only role was changed to an available ordinary role, and its first synthetic character became POV. Other submitted participation fields were preserved. No real manuscript participation or POV was modified.

Live focused Family acceptance then established a canonical family connection between those synthetic characters: two index entries became one. A further focused correction persisted, refreshed the selected connection in a second authenticated window and produced no receiving success toast. Each Context retained one SignalR connection and sent no Word navigation. The general live character/name/life-status/relationship edit regression passed as well; its Names step now waits for the already-queued originating-panel refresh before repeating an identity lookup. Actual main-window navigation passed Scene, Characters, Names and Relationships without an extra window or changed Context/Word position. The original main editors remain functional.

Postdeployment evidence: /tmp/context-family-live-prepared.log, /tmp/context-family-presence-confirmed.log, /tmp/context-family-live-editing-final.log, /tmp/context-family-live-navigation.log. Development journal had no error categories and only the pre-existing HTTPS-redirection warning. Production was not accessed or changed; the original two untracked investigation files were preserved. Existing Context windows should reload once to acquire the updated scripts. Physical-device/PWA and screen-reader/editorial acceptance remain the manual items listed above.