16 KiB
Character Types, Names and discretionary AI — Development delivery
Target: Development only. Production was not accessed or deployed. The implementation follows the requested phase order, retaining canonical characters, full biographies, variable card dimensions and the full-width Characters workspace.
Implementation
- Character Type and species — canonical codes
person,animal,supernatural,artificial,other,unclassified. Existing rows receive Unclassified, without inference or AI. Optional, unrestricted species text remains recorded when Type changes. Editor/Details and the existing shared definitions, filtering/counts, icons, both drag directions, bulk assignment, context menu, version-guarded heterogeneous Undo and live invalidations share the canonical assignment mechanism. Attribute standard. - Names workspace — page-scoped full width with compact results and sticky selected details; original catalogue metadata, filters, ordering and pagination remain. Ordinary usage is an exact normalised recorded primary-name/alias association across the series, including all character types and multiple associations. Textual occurrences load only on request. Details include portraits/initials, Type/species/importance, canonical View/Edit and Copy. State survives navigation. Workspace implementation.
- Context Names — existing Names tab reuses the main components/services. Each pane/window retains its own state, including split layouts and narrow Back to Results. Focus movement does not reset the reference tool. Existing notifications refresh associations without another SignalR connection or Held-position changes.
- Central discretionary AI — separate server-side entitlement and allowance checks; durable atomic monthly reservations, idempotent delivery, execution leases, retry/request/token/duration bounds, expiry and failed-result refunds. The provider ledger preserves available actual token/cache telemetry; unavailable monetary costs remain unknown. Admin AI controls operation/tier policies, expiring account overrides and usage inspection through existing audit/authentication. Account subscription shows remaining credits; deliberate execution uses shared cost confirmation. Biography regeneration and the reachable intention-assessment endpoint use the same gate. Architecture, operation inventory and policies.
- Explicit name verification — local whole-word/phrase candidate search over saved series content, bounded excerpts/batches, deduplication with original navigation references, signed cost/scope confirmation, qualified likely/ordinary/ambiguous assessments, completeness/date/scope, durable results and conservative revision invalidation. Zero matches require entitlement but make no provider request or credit reservation. Cached results remain readable after downgrade. Interrupted results retain useful findings and offer an explicit bounded, freshly confirmed retry. Verification never changes characters, aliases or manuscript text. Limits, caching and evidence.
Existing AI inventory
| Class | Operations | Treatment |
|---|---|---|
| Initial import | Text import, scene/chapter/profile analysis, import sex hints, initial enrichment/synthesis and failed-import recovery | Existing import entitlement and queue remain; no discretionary credits |
| Essential automatic / ambiguous | Structural Word reconciliation | Preserved as existing essential automation; product classification remains an explicit future decision |
| Discretionary author initiated | Biography regeneration; reachable explicit intention assessment; selected-name verification | Central entitlement, reservation and execution budgets |
| Administration | Existing diagnostics and shared illustration-library image processing | Existing AdminOnly access; not an author AI entitlement |
No retired Intent workspace was restored. Manual editing, ordinary Names search, Context and stored generated data remain available according to existing non-AI permissions.
Migrations and data safety
Ten forward-only migrations, 324–333, cover Character Type/species, recorded-name lookup, central policies/ledger, biography and intent enforcement, saved manuscript candidates, verification results, account-deletion integration Development-only test defaults and catalogue plan stability. Previously live migrations are unchanged. Dapper/stored procedures are used; no Entity Framework or competing character/notification stores.
Two fresh restores of a verified Development backup are qualified through the source-bound manifest database worker. Each upgrade must preserve all original business-column fingerprints and pass integrity checks before activation. Final results and the activation receipt are in the evidence directory. Existing manuscript characters and commercial subscription records are not test fixtures.
Verification and performance
The clean source solution build and executable regression harness passed, with 883 PASS lines (these are harness assertions/messages, not a conventional test-runner case count). Focused real-database tests exercise authorisation/isolation, field preservation, concurrency, bulk/Undo, no-ops, 20 concurrent reservations against five credits, duplicate delivery, expiry, refunds, renewal, overrides, cache/revision handling and account cleanup. Provider tests use mocked HTTP with the real provider client and ledger; no external AI spending is needed.
Normal Chromium and actual installed Chromium PWA acceptance cover 10/100/500-character casts, both drag directions, Type/bulk/Undo, context menus, sticky/collapsed sidebar, complete biographies, wide/narrow layouts, shared Names search/details, independent Context panes, Hold/focus stability, confirmation/denial, cache and interrupted recovery. All seven themes are rendered. Width checks include 1280, 1920, 2560 and 3840 pixels plus laptop/tablet/touch widths. Representative screenshots are linked below; compiled fixtures use synthetic data and mocked verification findings.
Latest warm median isolated-fixture measurements after migration 333 (500 characters, 1,000 scene associations, 5,009 saved paragraphs):
| Operation | Previous ms | New ms |
|---|---|---|
| Initial catalogue results | 2,301.71 | 286.33 |
| Prefix catalogue search | 180.30 | 91.78 |
| Selected metadata | — | 0.92 |
| Character associations | — | 0.73 |
| Local candidate search | — | 805.60 |
| Saved verification retrieval | — | 5.56 |
These are qualification measurements, not production latency promises. The catalogue avoids per-result occurrence retrieval and per-character queries; AI accounting does not run on ordinary searches. Actual-model semantic quality is not established by mocked-provider acceptance.
Source commits
| Phase | Commit |
|---|---|
| Character Type/species | 0c8a0cfb |
| Names workspace | 065e70c2 |
| Context reuse | 742b99c2 |
| Central AI infrastructure | 56c24950 |
| Bounded verification | 7ddfe907 |
| Initial integration/defaults | 096b2c78a5687ffaba3dfe825b89c6fc6c251e7b |
| Forward-only search plan correction | 481b3fcd |
| Same-series Context reference state | f04d7eea |
| Editor concurrency precision | d91dd0dd |
| Active Draft Desk precision fixture; final application source | ee417f4680a89719756dbbbfcb75c37c1429f64f |
Branch: codex/word-companion-native-phase1-20261104, established origin. The application source push was verified against git ls-remote. Final delivery evidence is committed separately. A browser test now waits for the native dialog's asynchronous close event before asserting removal; application behaviour is unchanged.
Configurable commercial decisions
Development-only provisional settings enable the three defined operations and allocate 100 monthly credits to Writing Room, Story Forge and Author Studio. Draft Desk is denied. Biography costs 10 credits; Names verification and intention assessment cost 1 each. Migration 332 seeds only fresh, unused Development/qualification policies and preserves configured/admin-modified installations. Existing subscription prices and import rules are unchanged.
The product owner still needs to determine: eligible higher tiers; monthly credits per tier; operation costs; maximum scope/requests/tokens/output/duration; enablement; and any future change to the explicit UTC calendar-month renewal convention. These settings are administered without deployment. No credit purchases, rollover or final commercial pricing were introduced.
Final smoke correction
Authenticated Development acceptance caught an intermittent Names catalogue timeout after the initial activation. Migration 333 keeps the final statement's plan specific to the current prefix/default/locale/usage parameters. No historical migration was edited. New real-database regression alternates those filters with a two-character cast, alongside the existing 500-character test. The focused run passed all seven variants within the ten-second guard; its warm medians were 286 ms initial results and 92 ms prefix search, compared with 2,302 ms and 180 ms for historical SQL. Final fresh-restores qualify this additive correction separately from the original nine-migration upgrade.
Context Names state is keyed by series and pane, preserving the reference search when switching books within a series. Normal Chromium and installed-PWA tests explicitly remount the pane under another book and verify the retained search/selection.
Authenticated manual-edit acceptance also exposed a Dapper parameter rounding issue in the newly added editor version guard. The repository now sends the version explicitly as DbType.DateTime2, preserving the column's seven fractional digits. The dedicated real-repository fixture runs with an active Draft Desk entitlement and verifies successful ordinary editing, rejection of stale versions and preservation of a newer concurrent biography. The normal solution build/full harness passed again. This final correction changes no SQL; the signed code-only release reuses the qualified schema and immutable ledger.
Final Development activation and authenticated acceptance
Final application commit: ee417f4680a89719756dbbbfcb75c37c1429f64f. Release: development-character-names-ai-ee417f4680a8-20261126T170230. Activation receipt: 20261126T170421Z-3c4780c77369. The final code-only activation executed zero migrations after verifying the complete immutable ledger and schema c1c781dc2c6983eab826038bf1068ffd4894a02cf8a6edc6e6560d5523957fdb.
The fixed Development helper verified a fresh backup, checked idle processing, activated atomically and passed application/database health checks. Running DLL and public Names/Context/AI static-asset hashes match the signed manifest. The health endpoint identifies the final commit, Development and PlotDirector_Development. The established remote branch was pushed and independently checked with git ls-remote.
Authenticated normal Chromium and actual installed Chromium PWA checks passed against disposable author/project/book/character fixtures. They verify both Type drag directions, bulk/heterogeneous Undo, right-click menus, widths 1280/1920/2560/3840, collapse/space recovery, full biographies, animal primary/alias associations, Copy, zero-match/no-credit verification, main/Context wide/narrow presentation, allowance display and server-side denial after a fixture-only downgrade. Previously saved verification remained readable after downgrade.
Final browser and installed-PWA checks additionally passed canonical View/Edit navigation, a successful manual editor save on Draft Desk, retained species and full biography, Names state restoration after character navigation, and actual cross-window association refresh after another window changed/restored species. The existing presence connection was Connected; no new Names-specific connection was created.
All disposable authors, projects, books, characters and verification results were removed through the normal account workflow, with scoped removal of only fixture override/audit/onboarding rows omitted by the legacy deletion procedure. Independent counts confirm zero remaining fixture records. Test provider requests and credit reservations were both zero. Private credential/clone-connection files and all task qualification clones were removed; verified backups and sanitised evidence are retained. Unrelated investigation documents were preserved.
The original nine-migration upgrade passed two fresh restores (203 original tables, 261,691 original rows); migration 333 passed two further fresh restores (209 tables, 261,698 rows). Every run preserved original business-column fingerprints and passed integrity checks with zero violations. The final timestamp correction changes application parameter typing only and reuses that SQL qualification.
Representative screenshots and evidence
| Capture | Evidence |
|---|---|
| Character Type, installed-PWA context menu; original variable cards/biographies | PWA Type menu |
| Full-width Names with George/Cat primary and Hamish/Dog alias, 2560 px | Wide PWA Names |
| Names after a real cross-window update, final application | Live Names |
| Theme example | Modern dark |
| Context Names, wide and narrow | Wide, narrow |
| Lowest-tier restriction | AI restriction |
| Higher-tier allowance before fixture downgrade | Allowance |
| Real zero-match verification, no AI/credits | Zero-match result |
| Completed contextual findings, compiled Razor with explicitly mocked provider results | Synthetic completed verification |
| Administration, compiled synthetic fixture | AI administration |
| Character Details after final successful editor save | Recorded Type/species |
Structured test/performance summary, Final activation receipt, running identity/checksums, original upgrade qualification, query correction qualification, authenticated PWA editor/live-update checks, fixture cleanup.
Limits and remaining decisions
- Routine provider tests are mocked; actual-model semantic quality requires author assessment. No chargeable provider request was made for acceptance.
- Verification covers saved snapshot/scene-source content, with conservative freshness checks and explicit incomplete/lower-bound reporting for missing sources or configured limits. It never claims unbounded comprehensive verification.
- Structural Word reconciliation remains classified provisionally as essential automatic processing, outside discretionary credits; its entitlement classification remains a product decision. Existing import rules are unchanged.
- Existing legacy account-deletion omissions for subscription overrides/audit/onboarding are outside this change; only isolated fixture rows were cleaned operationally. New AI records participate in canonical deletion.
- Installed-PWA acceptance used actual Chromium on Linux, with desktop/laptop/tablet-width checks. Empty-book Context captures may show the existing unavailable/shared-focus notice; the Names reference tool and live association updates remain usable independently.
- The commercial configuration decisions listed above remain open. Development test allowances/costs are not final commercial pricing.
Production was not accessed or deployed.