14 KiB
Progressive Readiness and preparation design — specification only
No resolver, planner, preparation question catalogue or database migration is implemented by Phase3D.2A. The proposed runtime must consume the same capability/condition/dependency bundle as investigation and the Family Tree.
Three independent results
- Diagnostic relevance: the explanations and capabilities supported by the author's diagnostic answers.
- Capability readiness: current scoped data, permission, entitlement, source-generation and platform facts.
- Preparation journey: an optional or required sequence that can improve readiness while retaining the original recommendation.
Missing data never changes diagnostic support, opposition, redundancy, corroboration, challenge, conflicts or weights. A relevant tool can remain the recommended destination while preparation is needed. Do not convert “no locations recorded” into evidence that setting is the author's underlying problem.
Existing Phase3D.1 integration
PlotLine/Models/Investigations/Contracts.cs embeds five capability definitions in each immutable catalogue: stable ID, name/description, resolver, required context, availability, authority and flat answer prerequisites. The compiled DestinationRegistry supports Write, Characters, PlotThreads, Timeline and Relationships. InvestigationService.Current applies capability flags and InvestigationEngine.Evaluate computes weighted evidence and dynamically ranks questions. Question selection uses hypotheses, missing dimensions, challenge/corroboration gaps, clarification, eligibility and deterministic ties.
Current capability prerequisites are Rule.MinAnswers, AllAnswers and ExcludeAnswered—diagnostic answer conditions, not a dependency graph or book-readiness model. The catalogue has no complete feature inventory or typed data-fact selector interface.
The engine already separates numeric support from Eligible; however terminal Recommendations filters by eligible destinations. A later integration must retain the desired capability and supported diagnostic explanation before readiness filtering. Otherwise an unavailable/preparation-needed tool disappears from the recommendation, contrary to the new requirements. Use a separate diagnostic target set and actionable/readiness presentation, preserving legacy evaluation semantics for historical replay. Do not feed “missing preparatory data” into evidence contributions or blindly flatten it into the current available set.
Readiness belongs after relevance selection and before explaining/launching an action. Preparation questions belong to a separate authored selector operating on missing/unknown conditions. They must not be inserted into Investigation.Answers, counted toward diagnostic substantive-answer thresholds or used to satisfy diagnostic challenge/corroboration. A later diagnostic answer revision remains an explicit independent operation.
The exports include schema1 aliases for the existing five IDs and a crosswalk for the separate public Solver result catalogue. The public Solver has15 authored workspace capability aliases; these must remain compatible rather than be silently redirected into new question logic. Canonical capability IDs should be resolved through one shared registry, with legacy adapters at each existing boundary.
Fact contract and states
A future fact result should include: condition ID, typed scope/selected IDs, met/missing/unknown/unavailable, counts/associations, source generation or revision, permission/entitlement reason, evaluated/expiry times and selector provenance. Default fact reads should not contain prose. A small count is not sufficient when the required association or generation differs.
| State | Meaning | Author treatment |
|---|---|---|
| Ready | Required facts and useful baseline are satisfied; optional enhancements may remain absent | Open the appropriate scoped tool; show optional opportunities without a checklist demand |
| Preparation recommended | Technically usable, but relevant useful data is missing | Offer a short optional improvement or open now |
| Preparation required | Required data is confirmed absent and an allowed creation path exists | Explain the minimum necessary preparation while retaining the destination |
| Unavailable | Permission, entitlement, environment, platform or unimplemented feature is explicitly denied | Explain the actual restriction; offer an appropriate alternative without rescoring diagnosis |
| Unknown or not verifiable | Required selector/proof/generation/check is unresolved or stale | Ask for selection/refresh/clarification; never invent readiness or missing rows |
State precedence and reason aggregation must be explicit. A missing selected character ID does not prove there are no characters. First select among eligible existing records; create only if required relevant records truly do not exist. An archived root Project is valid input to recovery even though ordinary active-project readiness fails.
The74 reusable conditions in Readiness-Specification.json provide minimum quantities, AND/OR contracts, association scope, existing read candidates where verified, check feasibility, preparation sources, freshness and performance considerations. Existing Dapper call strings are cross-checked against live Development procedure names. They are read candidates, not a claim that loading each full editor graph is a suitable production readiness query. Bespoke compact aggregates remain proposed work.
Objective data versus private author preparation
| Observation | What can be established | What cannot be inferred | Appropriate preparation interaction |
|---|---|---|---|
| No character rows | No active project characters are recorded | Whether the author already knows their cast privately | Ask which relevant people to record or whether to use existing private notes |
| Character rows, no relationship links | The current graph has no recorded edges | Whether relationships are unclear in the author's mind | Offer to record selected connections, or open the map to create them inline |
| Locations absent, blank map available | No canonical settings recorded; provisional map still usable | Whether the setting lacks development | Offer a sketch first or optional location recording |
| Floor plan with no mapped occupancy rows | Viewer lacks saved occupant placements | Whether staging is confusing or the author has a private plan | Explain the verified partial authoring boundary; do not promise an unverified write workflow |
| No absolute scene dates | Calendar placement is not established | Whether narrative order or time is wrong | Ask whether absolute dates matter; relative/unknown time may be intentional |
| No paragraph snapshot | Reader lacks accepted text for that scope | Whether the author has written a manuscript | Offer supported connection/import/sync, preserving original tool relevance |
| No retained activity history | Coverage is absent/erased/disabled | Whether the author has been writing | Explain coverage; allow opt-in recording rather than infer working style |
Safe minimal preparation behaviour
- Pin original investigation/recommendation identity, desired capability, diagnostic snapshot/version and typed project/book context.
- Evaluate current access/context and scoped facts. Distinguish selection from missing data, and stale runtime proof from unsupported features.
- Resolve confirmed missing hard conditions recursively. Separate AND facts from OR producer alternatives, including inline creation. Keep a visited set of
(condition, scope, selected IDs, graph version)to prevent loops. - Prefer existing records, safe inline entry and the smallest authorised set of useful records. Do not require a populated project merely because a feature consumes more data when available.
- Treat optional/usefulness work as skippable. The author can open a technically available blank workspace, defer optional enrichment or choose another appropriate producer.
- Ask preparation questions only for unknown/private choices. Retain those answers separately and avoid repetition while scope/provenance remain valid.
- Persist explicit progress but re-evaluate facts after each return. Work completed elsewhere can satisfy a step. A step completion does not permanently prove that the underlying record still exists.
- Retain the original target during preparation, interruption, disagreement and permission failure. Recheck before opening the final scoped destination.
- Never automatically import, run AI, restore/delete records, move canonical scenes, save Word, start/end sessions or overwrite working focus as a hidden preparation action.
A proposed preparation step needs a kind such as context-selection, safe data-entry, author-confirmation, runtime connection or explicit validation—not merely a URL. Cost/risk/number-of-required-records and permitted alternatives should be transparent. Choosing between producer alternatives is not a hardcoded universal journey.
Data-access and performance requirements
Use Dapper and stored procedures. Authorise each requested project/book and selected entity, including graph associations; cache identity must include author/role and typed scope. Project-wide Characters/Locations/Maps/Floor Plans must not be relabelled as book-only data. Chapter/scene facts join through the actual selected book. Counts and associations should be batched per book/project, with indexes evaluated against representative data. Avoid N+1 editor loads, full manuscript JSON parsing, large candidate payloads or external lookups merely to draw badges.
Existing named read candidates and source anchors are in the JSON conditions, for example Project_GetForUser, Book_Get, Chapter_ListByBook, Scene_ListByChapter, Character_ListByProject, StoryMap_Get, FloorPlanBlock_ListByPlan, WriterWord_Status and current candidate-generation reads. Some need a new minimal aggregate projection rather than direct reuse. The snapshot verifies procedure existence, not full source/live procedure-body equivalence; selected implementations still require focused integration tests.
Do not equate HTTP GET with purity. ProjectExportService.ExportAsync records an activity; core scan-review fallback can change onboarding step, and core ScanCharacters can ensure candidates. Story Intelligence ResumeBook/prepare/retry and geography requests also coordinate deliberate work. Readiness must use pure fact reads and existing authoritative persisted summaries, not probe these workflow endpoints.
Freshness must use the actual domain contract: source/accepted revision for text-related facts, candidate generation and character gate for analysis, optimistic plan/map versions for edits, and current native/media lease evidence for Word/player state. A known installation is not a live document. The player command path uses a45-second freshness fence plus matching lease/grant; database metadata cannot replace it.
Permissions, persistence and migration implications
Current global SubscriptionEnforcementFilter allows GETs but blocks most POSTs without EditContent. Exports/account/admin and selected BookRecovery safety operations have exceptions; actual restore retains domain resource reservations. Private investigation persistence currently passes through the general POST filter. Before adding private preparation writes, review policy for read-only accounts explicitly rather than silently treating all advice as story editing or bypassing domain edit gates.
Migration273 stores immutable catalogue JSON, private investigation aggregate JSON and append-only events. It does not provide shared graph publication, fact snapshots, preparation steps/answers, multiple active plans or durable workflow-resolution handles. Proposed Phase3D.2B additions should be additive: separately versioned capability/condition/edge publication and separate private preparation state bound to existing investigation/recommendation IDs. Preserve old catalogue bytes and event replay. Do not rewrite migration273 or repoint old investigations to a new question catalogue.
A preparation record should retain: author/project/book, investigation ID, desired capability ID, original recommendation/evidence signature, catalogue and graph versions, relevant selected entity IDs, current fact snapshot/provenance, chosen producer alternatives, step state, separate preparation answers, deferrals, explicit completion/return timestamps and optimistic version. These are specification fields, not tables created by this audit. Review private retention/export/account/book deletion and restore compatibility before implementing them.
Detailed Story Intelligence batches are currently in a ConcurrentDictionary. Store stable book/module/generation references; obtain a current authorised workflow handle on explicit resume, not as an implicit readiness side effect. Browser layout preferences, pinned Context, saved objective, Reader selection, actual session and Word target remain distinct context roles.
Phase3D.2B recommendation
First approve IDs, granularity and unresolved boundaries. Then implement a versioned shared registry/import validator and pure minimal fact facade; add operation-specific permission/environment adapters and schema1 aliases. Qualify objective predicates and selection/OR cases before adding a planner. Add private resumable preparation state and questions separately, prove evidence invariance, and only then integrate recommendation presentation and the developer Family Tree. The simplified author tree should follow measured usability review. Production diagnostic question content and Phase4 remain separate approvals.