From 78a84df52f311bd421c3202dc765996d6f16bd3f Mon Sep 17 00:00:00 2001 From: Nick Beckley Date: Tue, 17 Nov 2026 14:47:06 +0000 Subject: [PATCH] Build deterministic Guided Investigation foundation and continuous Review reading --- Docs/Writer/Investigations/Architecture.md | 33 + .../Investigations/Author-Experience.md | 17 + .../Writer/Investigations/Catalogue-Schema.md | 26 + .../Writer/Investigations/Evidence-Scoring.md | 15 + .../Investigations/Question-Selection.md | 13 + .../Investigations/Simulation-Report.md | 11 + .../Investigations/synthetic-catalogue.json | 1710 +++++++++ .../Writer3/Evidence/Phase3D1/simulation.json | 3183 +++++++++++++++++ Docs/Writer/Writer3/Help-Coverage.md | 4 + Docs/Writer/Writer3/Implementation-Tracker.md | 4 + Docs/Writer/Writer3/Master-Specification.md | 8 + .../Browser/writer3-investigations.cjs | 15 + .../Browser/writer3-layout-explore.cjs | 2 +- .../Browser/writer3-review-continuous.cjs | 4 + PlotLine.Tests/Browser/writer3-workspace.cjs | 6 +- .../InvestigationMemoryRepository.cs | 17 + PlotLine.Tests/InvestigationTests.cs | 61 + PlotLine.Tests/Program.cs | 2 + .../Sql/WriterInvestigationsRegression.sql | 44 + PlotLine.Tests/ToolbarBrowserHost.cs | 6 +- .../WriterInvestigationsController.cs | 53 + PlotLine/Data/InvestigationRepository.cs | 18 + .../Workspace/Writer3-investigations.md | 30 + .../Articles/Workspace/Writer3-reviewing.md | 2 + PlotLine/Models/Investigations/Contracts.cs | 78 + PlotLine/Program.cs | 3 + .../Investigations/CatalogueValidator.cs | 28 + .../Investigations/DestinationRegistry.cs | 13 + .../Investigations/InvestigationEngine.cs | 52 + .../Investigations/InvestigationService.cs | 31 + PlotLine/Services/ProjectAccessFilter.cs | 1 + PlotLine/Sql/273_WriterInvestigations.sql | 48 + PlotLine/Views/Writer/_WriterExplore.cshtml | 4 +- .../Views/WriterInvestigations/Admin.cshtml | 8 + .../Views/WriterInvestigations/Failure.cshtml | 4 + .../Views/WriterInvestigations/Index.cshtml | 55 + .../WriterInvestigations/Simulator.cshtml | 13 + PlotLine/wwwroot/css/writer3.css | 10 + PlotLine/wwwroot/js/manuscript-reader.js | 2 +- PlotLine/wwwroot/js/writer-investigations.js | 11 + PlotLine/wwwroot/js/writer3-workspace.js | 2 +- 41 files changed, 5639 insertions(+), 8 deletions(-) create mode 100644 Docs/Writer/Investigations/Architecture.md create mode 100644 Docs/Writer/Investigations/Author-Experience.md create mode 100644 Docs/Writer/Investigations/Catalogue-Schema.md create mode 100644 Docs/Writer/Investigations/Evidence-Scoring.md create mode 100644 Docs/Writer/Investigations/Question-Selection.md create mode 100644 Docs/Writer/Investigations/Simulation-Report.md create mode 100644 Docs/Writer/Investigations/synthetic-catalogue.json create mode 100644 Docs/Writer/Writer3/Evidence/Phase3D1/simulation.json create mode 100644 PlotLine.Tests/Browser/writer3-investigations.cjs create mode 100644 PlotLine.Tests/Browser/writer3-review-continuous.cjs create mode 100644 PlotLine.Tests/InvestigationMemoryRepository.cs create mode 100644 PlotLine.Tests/InvestigationTests.cs create mode 100644 PlotLine.Tests/Sql/WriterInvestigationsRegression.sql create mode 100644 PlotLine/Controllers/WriterInvestigationsController.cs create mode 100644 PlotLine/Data/InvestigationRepository.cs create mode 100644 PlotLine/Help/Articles/Workspace/Writer3-investigations.md create mode 100644 PlotLine/Models/Investigations/Contracts.cs create mode 100644 PlotLine/Services/Investigations/CatalogueValidator.cs create mode 100644 PlotLine/Services/Investigations/DestinationRegistry.cs create mode 100644 PlotLine/Services/Investigations/InvestigationEngine.cs create mode 100644 PlotLine/Services/Investigations/InvestigationService.cs create mode 100644 PlotLine/Sql/273_WriterInvestigations.sql create mode 100644 PlotLine/Views/WriterInvestigations/Admin.cshtml create mode 100644 PlotLine/Views/WriterInvestigations/Failure.cshtml create mode 100644 PlotLine/Views/WriterInvestigations/Index.cshtml create mode 100644 PlotLine/Views/WriterInvestigations/Simulator.cshtml create mode 100644 PlotLine/wwwroot/js/writer-investigations.js diff --git a/Docs/Writer/Investigations/Architecture.md b/Docs/Writer/Investigations/Architecture.md new file mode 100644 index 00000000..f7891b2f --- /dev/null +++ b/Docs/Writer/Investigations/Architecture.md @@ -0,0 +1,33 @@ +# Guided Investigation foundation — Phase3D.1 + +Implemented in authenticated Writer → Explore. The public Writing Problem Solver remains independent: no changes to its controllers, graph, pages, solution content, case data, SEO or URLs. Inspection covered SolverGraph, WritingSolverEngine/Traversal, WritingSolverRepository/Validator/Admin, authenticated workspace adapters and existing CuratedV2 case witnesses. Reused concepts are stable IDs, immutable structured publication, strict import validation, scoped workspace navigation and deterministic replay. The new engine does not reuse next-node traversal, cumulative uncapped affinity or public solution URLs. + +## Boundaries + +- `Models/Investigations/Contracts.cs`: catalogue, hypotheses, evidence, conditions, capabilities, author state and evaluation. +- `InvestigationEngine`: pure function over an immutable catalogue, concern, current answers, available capability IDs and optional continuation bound. No I/O, random, clock, manuscript, COM, AI or external inference dependencies. +- `CatalogueValidator`: version/schema/reference/weight/prerequisite/reachability validation before publication and on load. +- `DestinationRegistry`: trusted authenticated route adapters. Questions and answers contain no URLs. Application access is rechecked before opening a scoped destination. +- `InvestigationService`: book authority, private read, revision/invalidation, deterministic state evaluation, explicit persistence. +- `IInvestigationRepository`/Dapper implementation: only stored-procedure application access; isolated browser tests implement the same boundary in memory. +- `WriterInvestigationsController`: Development gate, author forms, no-store/noindex, CSRF, optimistic version, internal admin policy and diagnostic views. + +The author UI uses existing layout/ribbon/theme and Markdown Help. Recommendations are authored strings plus actual supporting question/answer evidence. They never claim manuscript analysis. Opening a recommended tool uses a separate tab; the original investigation remains available. No objective, session, scene status, Word target or manuscript is changed by this engine. + +## Persistence + +Migration273 adds immutable `WriterInvestigationCatalogues`, author/book-scoped `WriterInvestigations` and append-only `WriterInvestigationEvents`. Every explicit action atomically stores the new aggregate and reproducible evaluation/history snapshot. Answers are current by question ID; earlier versions survive only in events. Revision prunes currently ineligible dependent answers from live evidence, retaining events. Questions presented are recorded on the transition, alongside next-question diagnostics. Multiple investigations have different UUIDs; no automatic overwrite or read-time creation. + +SQL verifies active project/book membership plus author ownership for every investigation read/update/event replay. Catalogue version and scope cannot change on update; integer expected-version fencing prevents lost updates. Published catalogues cannot be replaced. Account/book cascades delete private investigations and their event history; catalogues remain as shared content. New rows are not added to shared project JSON exports. Normal database backup covers all three stores. List UI shows100 most recently updated investigations per book; direct private URLs can resume older records. Per-investigation persistence is bounded to1000 transitions and40 configured substantive answers. + +Synthetic imports and author/admin endpoints are available only when the host is Development and `WriterInvestigations:Enabled` is not false. Production cannot enable this preview by setting that flag true. Catalogue validation currently requires Synthetic=true. Release/configuration work to enable real catalogues must be a separately qualified phase. No new native binary is needed. + +## Later Feature Dependency Graph and Progressive Readiness + +The user's additional requirements were recorded during implementation without restarting or refactoring this phase. Diagnostic evidence is independent of destination readiness: changing available capability IDs does not change support, opposition, conflicts, corroboration, scores or diagnostic coverage. Availability affects eligible actions and completion messaging only. This separation is explicitly tested. + +Already useful: stable capability IDs, a separate resolver boundary, declared context/authority, availability, explicit prerequisites, hypothesis mappings, immutable catalogue versions and reproducible state. Capability prerequisites currently use answered-question conditions; this is intentionally small and is **not** a complete application dependency graph or book-readiness model. Five adapters are a synthetic test registry, not an inventory of implemented features. Optional chapter/scene/character contexts are not resolved in this phase; only authorised project/book adapters are implemented. + +Future constraints to address: capability definitions currently live inside each immutable catalogue, the trusted resolver set is compiled, and prerequisite rules are flat all-answer/exclusion conditions. Do not grow those into an ad hoc feature graph. Introduce a separately versioned shared capability/dependency registry with typed context, requirement and readiness contracts; catalogues should refer to its stable IDs. Preserve old resolver aliases and pinned catalogue references. Readiness must produce missing-preparation facts and journeys, never evidence weights or diagnosis changes. Multi-step preparation should have a separate lifecycle from investigation answer revisions and recommendation history. + +Safe sequence: (1) inventory existing implemented features and their actual permission/context/data requirements; (2) define and validate typed dependency edges, cycle policy and resolver aliases; (3) implement pure book-specific readiness with provenance and read-only queries; (4) introduce resumable preparation journeys and missing-prerequisite questions; (5) integrate readiness reasons with investigations without rescoring; (6) build the Feature Family Tree from the same model. Additive migrations can introduce the shared registry and journey state; retain existing catalogue JSON/events unchanged and use an adapter for schema1 imports/replay. Do not rewrite migration273 or repoint historical investigation versions. This later scope, production questions and Phase4 are not implemented here. diff --git a/Docs/Writer/Investigations/Author-Experience.md b/Docs/Writer/Investigations/Author-Experience.md new file mode 100644 index 00000000..7a76b9f7 --- /dev/null +++ b/Docs/Writer/Investigations/Author-Experience.md @@ -0,0 +1,17 @@ +# Author experience and preservation + +Development Writer → Explore offers “Explore a concern”. The initial invitation asks “What's troubling you about your story?” and reassures that the author need not know the answer. This preview is visibly labelled synthetic Development content and states that it uses questionnaire answers without AI/manuscript analysis. Existing direct authenticated Explore tools remain available. + +Each page has one primary question, radio choices, optional plain-text explanation, Back/earlier-answer links, Continue and Save for later. A subtle answer count avoids a guaranteed completion promise. Forms have labels, fieldsets/legends and keyboard radio behaviour; controls use the existing theme. Narrow layouts use normal document flow. JavaScript only guards unsaved departure/duplicate submission; server forms, CSRF and validation are authoritative. Draft explanations can be saved without contributing evidence. + +Answer revision recomputes current evidence and prerequisite eligibility. Append-only history retains superseded revisions; the author sees current answers only. Multi-window stale saves return409 with submitted explanation retained for copying; no optimistic overwrite. A service outage returns503 without implying a save succeeded. Author-private lists are scoped to the current book; starting again creates another investigation. Latest100 appear in the sidebar; older private URLs remain resumable. + +Results use authored, tentative explanations, up to3 actual contributing question/answer examples per recommendation, uncertainty and eligible tool actions. Two supported explanations can coexist. Insufficient evidence or unavailable tools are acknowledged. Agree saves acceptance; disagree/further continues when eligible questions and the bound permit. Tools open in a new tab after scope/eligibility validation and explicit persisted selection. The investigation remains open to return to; reload after a tool launch before another versioned action. + +## Separate continuous Review correction + +Normal integrated Review now uses document/page scrolling. The main manuscript pane has no fixed/max height or overflow scroll; comfortable existing Reader typography/width/paragraph formatting remain. Desktop companion is independently sticky with a viewport-bounded utility scroll; narrow companion uses a fixed accessible overlay. This does not constrain manuscript height. Resizing/collapse controls remain. + +The existing Reader's accepted update/selection/pause rules remain. Its anchor restoration uses window scrolling for ordinary integrated Review, and the existing Reader scrollport only in Focused Reading. Chapter navigation, observation references/decisions and verified acknowledged Word handoff are unchanged. No canonical Reader storage/service or manuscript mutation architecture was rewritten. Browser qualification covers long prose, page scroll, focused reading, selection and retained companion interactions. + +Physical screen-reader, installed PWA, real Word/media and multiple-monitor acceptance remain manual; portable browser tests simulate standalone display mode and native acknowledgements where specified. diff --git a/Docs/Writer/Investigations/Catalogue-Schema.md b/Docs/Writer/Investigations/Catalogue-Schema.md new file mode 100644 index 00000000..6939530b --- /dev/null +++ b/Docs/Writer/Investigations/Catalogue-Schema.md @@ -0,0 +1,26 @@ +# Catalogue schema1 and editorial workflow + +The validated example is [synthetic-catalogue.json](synthetic-catalogue.json). It has4 concerns,5 hypotheses,28 questions,6 dimensions and5 authenticated capability adapters. This is Development/test content, not a production matrix. JSON uses case-insensitive property reads, rejects unknown members, and exports the complete structured definition. IDs are ordinal/case-sensitive stable strings,1–80 ASCII letters/digits/dot/underscore/hyphen; use kebab-case consistently. Published versions are immutable. + +| Object | Fields and meaning | +|---|---| +| Catalogue | SchemaVersion=1; unique Version; Synthetic=true; MinAnswers/MaxAnswers (2–40 valid bounds); Dimensions; Concerns; Hypotheses; Questions; Capabilities | +| Concern | Id, Text, Priors mapping valid hypothesis IDs to0–2 | +| Hypothesis | Id, Description, Summary/Reason/Uncertainty authored explanation templates; allowed Dimensions; Capabilities; MinDimensions≥2; MinGroups≥2; Threshold; Eligibility | +| Question | Id, Text, Help, Purpose, Group, InformationValue0–20, Hypotheses, Dimensions, Clarifies, AllowExplanation, Eligibility, Retired, optional ReplacedBy, Options | +| Purpose | Discovery, Discrimination, Corroboration, Challenge, Clarification, ActionPreference | +| Option | Id (unique within question), Text, Uncertain, optional Interpretation, Contributions | +| Contribution | Hypothesis, Dimension, Aspect, Weight−3…+3; references must appear in question/hypothesis mappings; duplicate triples prohibited | +| Interpretation | Empty ordinarily; Clarification may use different-aspects, revised-understanding, confirm-conflict, uncertain. Only explicit different-aspects clears the material same-aspect conflict; revisions recalculate evidence | +| Rule | MinAnswers; AllAnswers object mapping question IDs to allowed option-ID arrays; ExcludeAnswered list. All conditions conjunctive | +| Capability | Id, Name, Description, Resolver, ActionText, Available, RequiresBook, RequiresProject, Context, Authority, Prerequisites | + +Schema1 capability Context is project or book; Authority must be ProjectAccess. Trusted resolvers: Write, Characters, PlotThreads, Timeline, Relationships. No external/public URL field exists. Chapter/scene/character-specific availability and graph requirements are extension points, not invented schema1 behaviour. Capabilities may be disabled at runtime with `WriterInvestigations:Capabilities::Enabled=false`, independently of pinned catalogue content and diagnostic evidence. + +AdminOnly users in Development can inspect `/admin/writer-investigations`, validate JSON without saving, publish a new version or export current/specified version. Invalid input writes nothing. Use a new version for every publication; existing investigations keep their previous version. Preserve stable semantic IDs; retired questions may specify an existing active replacement but are not silently substituted into historical investigations. Export/import should be code reviewed and validated before future production activation. + +Validation checks IDs, required wording/templates, all references/options/dimensions/weights, purposes, bounds, replacement status, rule self-reference/exclusion, prerequisite reachability/cycles, independent supporting dimensions/groups and challenge coverage for each hypothesis, and capability mappings/resolvers. Simulation adds reachable recommendation witnesses and adversarial paths. Structural prerequisite reachability is not an exhaustive proof of every semantic combination; use the automated simulator and authored acceptance cases when developing a richer matrix. + +CLI: `dotnet run --project PlotLine.Tests/PlotLine.Tests.csproj -- --writer-investigation-sim /absolute/output/coverage.json`. This validates the repository example, focused engine cases and representative deterministic simulations. It never publishes or calls external services. Database publication uses the existing stored-procedure repository after validation; do not bypass the admin validator for editorial imports. The initial Development seed was explicitly applied after backup/migration. + +A later shared Feature Dependency Graph should have its own typed/versioned schema and registry; schema1 Rule is not a substitute. Keep an adapter for historical JSON and immutable events rather than rewriting old versions. diff --git a/Docs/Writer/Investigations/Evidence-Scoring.md b/Docs/Writer/Investigations/Evidence-Scoring.md new file mode 100644 index 00000000..1a4150db --- /dev/null +++ b/Docs/Writer/Investigations/Evidence-Scoring.md @@ -0,0 +1,15 @@ +# Deterministic evidence scoring + +Weights are bounded authored evidence strengths from−3 through+3, not probabilities. Starting-concern priors are0–2, influence question ordering/ranking only, and cannot satisfy the net-evidence threshold or coverage gates. + +1. Last answer for a stable question ID wins. Superseded contributions are not added. Optional free text is stored, escaped and never interpreted by an inference service. +2. Each option may contribute to multiple hypotheses and dimensions with positive/negative/zero values. Uncertain options provide no substantive evidence. +3. For each hypothesis × dimension × corroboration group, retain the strongest positive and strongest negative contribution separately. Repeated versions of the same signal cannot add unlimited support. +4. For each dimension, cap summed support at+3 and opposition at−3 across groups. Support and opposition remain inspectable rather than cancelling invisibly. Net evidence is support+opposition; ranking score adds the starting prior. +5. Distinct supporting dimensions and independent supporting groups are counted separately. Positive scores alone cannot finish an investigation. Required gates: configured minimum answers (8 in syntheticv1), hypothesis threshold, at least2 dimensions and2 groups, a substantive relevant Challenge answer, evidence examining at least1 other hypothesis, no material same-aspect conflict, and an eligible capability. These are configurable catalogue requirements, not statistical confidence. +6. Opposing magnitudes≥2 in the same hypothesis/dimension/aspect create a material conflict. Different aspect keys do not conflict automatically. Relevant clarification questions receive priority. An explicit different-aspects answer acknowledges that the apparent conflict concerns distinct moments; scores retain both signals. A changed-understanding answer leaves the conflict pending until an earlier answer is actually revised. Confirm-conflict/uncertain answers leave it unresolved. Uncertain answers are distinct from contradictory substantive evidence. +7. Availability/prerequisite failures never modify diagnostic evidence or scores. The same evidence can support an explanation while the destination is unavailable. Eligibility and preparation are separate from support. + +Investigations stop only after the gates, a configured upper bound (12 in syntheticv1), or exhaustion of eligible questions. Outcomes include supported recommendation, two plausible explanations, more information needed and no suitable destination. Two supported results within2 ranking points may be offered; exhausted ambiguous states can report ambiguity without offering unqualified tools. All-uncertain paths return insufficient evidence rather than pretending the starting prior is corroboration. + +Diagnostics expose raw contributions, repeated dimension/group count, support, opposition, priors, coverage, conflicts and missing gates. This aggregation is intentionally conservative, deterministic and explainable; independent editorial calibration and a production catalogue are future work. diff --git a/Docs/Writer/Investigations/Question-Selection.md b/Docs/Writer/Investigations/Question-Selection.md new file mode 100644 index 00000000..245e2b59 --- /dev/null +++ b/Docs/Writer/Investigations/Question-Selection.md @@ -0,0 +1,13 @@ +# Dynamic question selection + +There is no next-question pointer. Remove retired/already-answered/ineligible questions. Eligibility supports minimum answer count, all specified question/options and exclusions. Question revision recomputes eligibility and invalidates dependent live answers as necessary. + +Rank each eligible question deterministically: + +`information value + 3×leading hypothesis overlap + 2×unexamined hypothesis/dimension pairs + 30×relevant unresolved conflicts + 15×leading challenge gaps + 8×leading corroboration gaps + 8 if discrimination covers both leaders`. + +Leaders are the first two positive ranking hypotheses. Initial concern priors affect those leaders but do not constrain branches. Information value and content mappings come from the catalogue. Ties use stable question ID with ordinal comparison. No randomness, wall clock or unordered database traversal affects selection. + +The chosen candidate and all alternative ranks/reasons are recorded with each explicit state transition. Developer diagnostics name overlapping leaders, unseen dimensions, conflicts, challenge/corroboration gaps and authored value. Those details do not appear in ordinary author screens. Already answered questions are not automatically repeated; earlier-answer links are explicit revisions. If revision invalidates a dependent answer, a later newly eligible presentation may ask it again with its obsolete answer excluded. + +The initial synthetic experience is bounded8–12 substantive answers. Further/disagree requests raise the continuation minimum by2, capped at the configured maximum, without discarding answers. At the cap authors can revisit saved answers or begin a separate investigation; the system does not loop or promise certainty. An unanswered explanation can be saved as a draft without becoming diagnostic evidence. diff --git a/Docs/Writer/Investigations/Simulation-Report.md b/Docs/Writer/Investigations/Simulation-Report.md new file mode 100644 index 00000000..9c687d43 --- /dev/null +++ b/Docs/Writer/Investigations/Simulation-Report.md @@ -0,0 +1,11 @@ +# Phase3D.1 synthetic simulation qualification + +Catalogue `synthetic-3d1-v1`:4 concerns,5 hypotheses,28 questions,6 dimensions,5 destinations. The machine-readable report accompanies Phase3D1 evidence. It records228 representative paths and2560 answer transitions: every starting concern × five target-hypothesis witnesses, uncertain and alternating adversarial paths, plus50 reproducible seeded random paths per concern. All5 hypotheses and5 destinations are reachable. Repeated questions, loops, premature recommendations, invalid destinations and non-deterministic replays:0. + +The general story concern can reach character motivation and the Characters capability; the concern does not lock a branch. Tests also construct competing supported explanations, conflicting same-aspect answers, explicit different-aspects clarification, answer revision changing recommendations, redundant same-group evidence, unmet prerequisites, upper-bound uncertainty, unavailable destinations and further-investigation continuation. Availability changes leave diagnostic evidence and scores identical. Production cannot enable synthetic content through the feature flag. + +SQL qualification exercises atomic state/events, private author ownership even against another active project member, cross-book denial, optimistic stale rollback and immutable catalogue publication. All SQL test mutations roll back. Authenticated Development acceptance and guarded cleanup are reported in Phase3D1-Report.md. + +Browser/simulated-PWA tests use actual Razor/controllers and a clearly isolated in-memory repository for transport qualification: scoped Explore, concern-to-unexpected-destination witness, optional draft/resume, answer revision,409 retained text, CSRF400, cross-book/cross-user404, AdminOnly diagnostics/replay/import/export/version pinning, responsive radio keyboard behaviour and Help. No iframe or AI/inference requests occur. Separate tests verify long continuous Review document scrolling and focused reading/observations. Existing integrated Review, Word/session preservation and Writer layout regressions remain covered. + +These are representative and targeted adversarial paths, not exhaustive enumeration of all3–4^28 combinations, statistical calibration, production editorial validation or physical accessibility/Windows acceptance. Before production, author literal acceptance witnesses for the real matrix, inspect ambiguity/dead-end distributions, validate typed capability readiness separately, and expand bounded simulation/state-space checks as the catalogue grows. Do not generate a production matrix from this synthetic sample. diff --git a/Docs/Writer/Investigations/synthetic-catalogue.json b/Docs/Writer/Investigations/synthetic-catalogue.json new file mode 100644 index 00000000..fe01121b --- /dev/null +++ b/Docs/Writer/Investigations/synthetic-catalogue.json @@ -0,0 +1,1710 @@ +{ + "SchemaVersion": 1, + "Version": "synthetic-3d1-v1", + "Synthetic": true, + "MinAnswers": 8, + "MaxAnswers": 12, + "Dimensions": [ + "motivation", + "change", + "causality", + "organisation", + "options", + "constraints" + ], + "Concerns": [ + { + "Id": "story", + "Text": "Something about my story doesn’t feel right.", + "Priors": { + "change": 1, + "connections": 1 + } + }, + { + "Id": "character", + "Text": "I’m struggling with a character.", + "Priors": { + "motivation": 2 + } + }, + { + "Id": "next", + "Text": "I’m not sure what should happen next.", + "Priors": { + "next-event": 2 + } + }, + { + "Id": "track", + "Text": "I’m losing track of my story.", + "Priors": { + "organisation": 2 + } + } + ], + "Hypotheses": [ + { + "Id": "motivation", + "Description": "Character motivation is unclear", + "Summary": "One possibility: character motivation is unclear", + "Reason": "In this test catalogue, your answers suggest this may be a useful place to look. Clarify what a character wants and why it matters.", + "Uncertainty": "This is a tentative interpretation of your answers. The story itself has not been analysed, and another explanation may fit better.", + "Dimensions": [ + "motivation", + "change", + "causality", + "organisation", + "options", + "constraints" + ], + "Capabilities": [ + "characters" + ], + "MinDimensions": 2, + "MinGroups": 2, + "Threshold": 4 + }, + { + "Id": "change", + "Description": "Scenes lack meaningful change", + "Summary": "One possibility: scenes lack meaningful change", + "Reason": "In this test catalogue, your answers suggest this may be a useful place to look. Compare intentions and outcomes in your saved chapter and scene workspace.", + "Uncertainty": "This is a tentative interpretation of your answers. The story itself has not been analysed, and another explanation may fit better.", + "Dimensions": [ + "motivation", + "change", + "causality", + "organisation", + "options", + "constraints" + ], + "Capabilities": [ + "write" + ], + "MinDimensions": 2, + "MinGroups": 2, + "Threshold": 4 + }, + { + "Id": "connections", + "Description": "Plot events are insufficiently connected", + "Summary": "One possibility: plot events are insufficiently connected", + "Reason": "In this test catalogue, your answers suggest this may be a useful place to look. Lay out how recorded developments connect.", + "Uncertainty": "This is a tentative interpretation of your answers. The story itself has not been analysed, and another explanation may fit better.", + "Dimensions": [ + "motivation", + "change", + "causality", + "organisation", + "options", + "constraints" + ], + "Capabilities": [ + "threads" + ], + "MinDimensions": 2, + "MinGroups": 2, + "Threshold": 4 + }, + { + "Id": "organisation", + "Description": "Existing story information is difficult to organise", + "Summary": "One possibility: existing story information is difficult to organise", + "Reason": "In this test catalogue, your answers suggest this may be a useful place to look. Review the order and shape of your saved chapters and scenes.", + "Uncertainty": "This is a tentative interpretation of your answers. The story itself has not been analysed, and another explanation may fit better.", + "Dimensions": [ + "motivation", + "change", + "causality", + "organisation", + "options", + "constraints" + ], + "Capabilities": [ + "timeline" + ], + "MinDimensions": 2, + "MinGroups": 2, + "Threshold": 4 + }, + { + "Id": "next-event", + "Description": "The next story event needs development", + "Summary": "One possibility: the next story event needs development", + "Reason": "In this test catalogue, your answers suggest this may be a useful place to look. Consider recorded relationships that could create a next event.", + "Uncertainty": "This is a tentative interpretation of your answers. The story itself has not been analysed, and another explanation may fit better.", + "Dimensions": [ + "motivation", + "change", + "causality", + "organisation", + "options", + "constraints" + ], + "Capabilities": [ + "relationships" + ], + "MinDimensions": 2, + "MinGroups": 2, + "Threshold": 4 + } + ], + "Questions": [ + { + "Id": "motivation-1", + "Text": "Is it hard to say what the central character wants in the moment that concerns you?", + "Help": "Think about the particular part of your story that brought you here.", + "Purpose": "Discovery", + "Group": "motivation-same-signal", + "InformationValue": 2, + "Hypotheses": [ + "motivation" + ], + "Dimensions": [ + "motivation" + ], + "Options": [ + { + "Id": "yes", + "Text": "Yes, that describes it.", + "Contributions": [ + { + "Hypothesis": "motivation", + "Dimension": "motivation", + "Aspect": "current-concern", + "Weight": 3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "no", + "Text": "No, that does not describe it.", + "Contributions": [ + { + "Hypothesis": "motivation", + "Dimension": "motivation", + "Aspect": "current-concern", + "Weight": -3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "unsure", + "Text": "I’m not sure.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "" + } + ] + }, + { + "Id": "motivation-2", + "Text": "When you imagine that moment again, does the character’s reason for acting still feel unclear?", + "Help": "Think about the particular part of your story that brought you here.", + "Purpose": "Corroboration", + "Group": "motivation-same-signal", + "InformationValue": 1, + "Hypotheses": [ + "motivation" + ], + "Dimensions": [ + "motivation" + ], + "Options": [ + { + "Id": "yes", + "Text": "Yes, that describes it.", + "Contributions": [ + { + "Hypothesis": "motivation", + "Dimension": "motivation", + "Aspect": "current-concern", + "Weight": 3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "no", + "Text": "No, that does not describe it.", + "Contributions": [ + { + "Hypothesis": "motivation", + "Dimension": "motivation", + "Aspect": "current-concern", + "Weight": -3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "unsure", + "Text": "I’m not sure.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "" + } + ] + }, + { + "Id": "motivation-3", + "Text": "Could several different actions fit equally well because you are unsure what matters to this character?", + "Help": "Think about the particular part of your story that brought you here.", + "Purpose": "Discrimination", + "Group": "motivation-independent-2", + "InformationValue": 1, + "Hypotheses": [ + "motivation" + ], + "Dimensions": [ + "constraints" + ], + "Options": [ + { + "Id": "yes", + "Text": "Yes, that describes it.", + "Contributions": [ + { + "Hypothesis": "motivation", + "Dimension": "constraints", + "Aspect": "current-concern", + "Weight": 3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "no", + "Text": "No, that does not describe it.", + "Contributions": [ + { + "Hypothesis": "motivation", + "Dimension": "constraints", + "Aspect": "current-concern", + "Weight": -3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "unsure", + "Text": "I’m not sure.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "" + } + ] + }, + { + "Id": "motivation-4", + "Text": "Can you point to a clear desire and an understandable reason behind the character’s action?", + "Help": "Think about the particular part of your story that brought you here.", + "Purpose": "Challenge", + "Group": "motivation-independent-3", + "InformationValue": 1, + "Hypotheses": [ + "motivation" + ], + "Dimensions": [ + "motivation" + ], + "Options": [ + { + "Id": "yes", + "Text": "Yes, that describes it.", + "Contributions": [ + { + "Hypothesis": "motivation", + "Dimension": "motivation", + "Aspect": "current-concern", + "Weight": -3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "no", + "Text": "No, that does not describe it.", + "Contributions": [ + { + "Hypothesis": "motivation", + "Dimension": "motivation", + "Aspect": "current-concern", + "Weight": 1 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "unsure", + "Text": "I’m not sure.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "" + } + ] + }, + { + "Id": "motivation-clarify", + "Text": "Your answers about this concern point in different directions. How should we understand that?", + "Help": "Character motivation is unclear. It is fine if you were considering different moments, or if your understanding has changed.", + "Purpose": "Clarification", + "Group": "motivation-clarification", + "InformationValue": 0, + "Hypotheses": [ + "motivation" + ], + "Dimensions": [ + "motivation" + ], + "Clarifies": [ + "motivation" + ], + "Eligibility": { + "AllAnswers": { + "motivation-1": [ + "yes", + "no", + "unsure" + ], + "motivation-2": [ + "yes", + "no", + "unsure" + ] + } + }, + "Options": [ + { + "Id": "aspects", + "Text": "I was thinking about different aspects or moments.", + "Contributions": [], + "Uncertain": false, + "Interpretation": "different-aspects" + }, + { + "Id": "changed", + "Text": "My understanding has changed; I would like to revisit an answer.", + "Contributions": [], + "Uncertain": false, + "Interpretation": "revised-understanding" + }, + { + "Id": "conflict", + "Text": "Both answers still seem true for the same moment.", + "Contributions": [], + "Uncertain": false, + "Interpretation": "confirm-conflict" + }, + { + "Id": "uncertain", + "Text": "I’m not sure how to explain it yet.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "uncertain" + } + ] + }, + { + "Id": "change-1", + "Text": "Does the scene that concerns you leave the situation much as it was?", + "Help": "Think about the particular part of your story that brought you here.", + "Purpose": "Discovery", + "Group": "change-same-signal", + "InformationValue": 2, + "Hypotheses": [ + "change" + ], + "Dimensions": [ + "change" + ], + "Options": [ + { + "Id": "yes", + "Text": "Yes, that describes it.", + "Contributions": [ + { + "Hypothesis": "change", + "Dimension": "change", + "Aspect": "current-concern", + "Weight": 3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "no", + "Text": "No, that does not describe it.", + "Contributions": [ + { + "Hypothesis": "change", + "Dimension": "change", + "Aspect": "current-concern", + "Weight": -3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "unsure", + "Text": "I’m not sure.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "" + } + ] + }, + { + "Id": "change-2", + "Text": "Thinking of its ending, is the important situation still essentially unchanged?", + "Help": "Think about the particular part of your story that brought you here.", + "Purpose": "Corroboration", + "Group": "change-same-signal", + "InformationValue": 1, + "Hypotheses": [ + "change" + ], + "Dimensions": [ + "change" + ], + "Options": [ + { + "Id": "yes", + "Text": "Yes, that describes it.", + "Contributions": [ + { + "Hypothesis": "change", + "Dimension": "change", + "Aspect": "current-concern", + "Weight": 3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "no", + "Text": "No, that does not describe it.", + "Contributions": [ + { + "Hypothesis": "change", + "Dimension": "change", + "Aspect": "current-concern", + "Weight": -3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "unsure", + "Text": "I’m not sure.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "" + } + ] + }, + { + "Id": "change-3", + "Text": "If you removed this scene, would later choices remain much the same?", + "Help": "Think about the particular part of your story that brought you here.", + "Purpose": "Discrimination", + "Group": "change-independent-2", + "InformationValue": 1, + "Hypotheses": [ + "change" + ], + "Dimensions": [ + "constraints" + ], + "Options": [ + { + "Id": "yes", + "Text": "Yes, that describes it.", + "Contributions": [ + { + "Hypothesis": "change", + "Dimension": "constraints", + "Aspect": "current-concern", + "Weight": 3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "no", + "Text": "No, that does not describe it.", + "Contributions": [ + { + "Hypothesis": "change", + "Dimension": "constraints", + "Aspect": "current-concern", + "Weight": -3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "unsure", + "Text": "I’m not sure.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "" + } + ] + }, + { + "Id": "change-4", + "Text": "Can you name an important change caused by that scene?", + "Help": "Think about the particular part of your story that brought you here.", + "Purpose": "Challenge", + "Group": "change-independent-3", + "InformationValue": 1, + "Hypotheses": [ + "change" + ], + "Dimensions": [ + "change" + ], + "Options": [ + { + "Id": "yes", + "Text": "Yes, that describes it.", + "Contributions": [ + { + "Hypothesis": "change", + "Dimension": "change", + "Aspect": "current-concern", + "Weight": -3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "no", + "Text": "No, that does not describe it.", + "Contributions": [ + { + "Hypothesis": "change", + "Dimension": "change", + "Aspect": "current-concern", + "Weight": 1 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "unsure", + "Text": "I’m not sure.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "" + } + ] + }, + { + "Id": "change-clarify", + "Text": "Your answers about this concern point in different directions. How should we understand that?", + "Help": "Scenes lack meaningful change. It is fine if you were considering different moments, or if your understanding has changed.", + "Purpose": "Clarification", + "Group": "change-clarification", + "InformationValue": 0, + "Hypotheses": [ + "change" + ], + "Dimensions": [ + "change" + ], + "Clarifies": [ + "change" + ], + "Eligibility": { + "AllAnswers": { + "change-1": [ + "yes", + "no", + "unsure" + ], + "change-2": [ + "yes", + "no", + "unsure" + ] + } + }, + "Options": [ + { + "Id": "aspects", + "Text": "I was thinking about different aspects or moments.", + "Contributions": [], + "Uncertain": false, + "Interpretation": "different-aspects" + }, + { + "Id": "changed", + "Text": "My understanding has changed; I would like to revisit an answer.", + "Contributions": [], + "Uncertain": false, + "Interpretation": "revised-understanding" + }, + { + "Id": "conflict", + "Text": "Both answers still seem true for the same moment.", + "Contributions": [], + "Uncertain": false, + "Interpretation": "confirm-conflict" + }, + { + "Id": "uncertain", + "Text": "I’m not sure how to explain it yet.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "uncertain" + } + ] + }, + { + "Id": "connections-1", + "Text": "Do important events seem to happen without depending on earlier choices?", + "Help": "Think about the particular part of your story that brought you here.", + "Purpose": "Discovery", + "Group": "connections-same-signal", + "InformationValue": 2, + "Hypotheses": [ + "connections" + ], + "Dimensions": [ + "causality" + ], + "Options": [ + { + "Id": "yes", + "Text": "Yes, that describes it.", + "Contributions": [ + { + "Hypothesis": "connections", + "Dimension": "causality", + "Aspect": "current-concern", + "Weight": 3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "no", + "Text": "No, that does not describe it.", + "Contributions": [ + { + "Hypothesis": "connections", + "Dimension": "causality", + "Aspect": "current-concern", + "Weight": -3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "unsure", + "Text": "I’m not sure.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "" + } + ] + }, + { + "Id": "connections-2", + "Text": "Looking again at the troublesome event, is its link to what came before hard to identify?", + "Help": "Think about the particular part of your story that brought you here.", + "Purpose": "Corroboration", + "Group": "connections-same-signal", + "InformationValue": 1, + "Hypotheses": [ + "connections" + ], + "Dimensions": [ + "causality" + ], + "Options": [ + { + "Id": "yes", + "Text": "Yes, that describes it.", + "Contributions": [ + { + "Hypothesis": "connections", + "Dimension": "causality", + "Aspect": "current-concern", + "Weight": 3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "no", + "Text": "No, that does not describe it.", + "Contributions": [ + { + "Hypothesis": "connections", + "Dimension": "causality", + "Aspect": "current-concern", + "Weight": -3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "unsure", + "Text": "I’m not sure.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "" + } + ] + }, + { + "Id": "connections-3", + "Text": "Could you rearrange these events without affecting what follows?", + "Help": "Think about the particular part of your story that brought you here.", + "Purpose": "Discrimination", + "Group": "connections-independent-2", + "InformationValue": 1, + "Hypotheses": [ + "connections" + ], + "Dimensions": [ + "constraints" + ], + "Options": [ + { + "Id": "yes", + "Text": "Yes, that describes it.", + "Contributions": [ + { + "Hypothesis": "connections", + "Dimension": "constraints", + "Aspect": "current-concern", + "Weight": 3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "no", + "Text": "No, that does not describe it.", + "Contributions": [ + { + "Hypothesis": "connections", + "Dimension": "constraints", + "Aspect": "current-concern", + "Weight": -3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "unsure", + "Text": "I’m not sure.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "" + } + ] + }, + { + "Id": "connections-4", + "Text": "Can you describe a clear chain from a choice to its consequence?", + "Help": "Think about the particular part of your story that brought you here.", + "Purpose": "Challenge", + "Group": "connections-independent-3", + "InformationValue": 1, + "Hypotheses": [ + "connections" + ], + "Dimensions": [ + "causality" + ], + "Options": [ + { + "Id": "yes", + "Text": "Yes, that describes it.", + "Contributions": [ + { + "Hypothesis": "connections", + "Dimension": "causality", + "Aspect": "current-concern", + "Weight": -3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "no", + "Text": "No, that does not describe it.", + "Contributions": [ + { + "Hypothesis": "connections", + "Dimension": "causality", + "Aspect": "current-concern", + "Weight": 1 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "unsure", + "Text": "I’m not sure.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "" + } + ] + }, + { + "Id": "connections-clarify", + "Text": "Your answers about this concern point in different directions. How should we understand that?", + "Help": "Plot events are insufficiently connected. It is fine if you were considering different moments, or if your understanding has changed.", + "Purpose": "Clarification", + "Group": "connections-clarification", + "InformationValue": 0, + "Hypotheses": [ + "connections" + ], + "Dimensions": [ + "causality" + ], + "Clarifies": [ + "causality" + ], + "Eligibility": { + "AllAnswers": { + "connections-1": [ + "yes", + "no", + "unsure" + ], + "connections-2": [ + "yes", + "no", + "unsure" + ] + } + }, + "Options": [ + { + "Id": "aspects", + "Text": "I was thinking about different aspects or moments.", + "Contributions": [], + "Uncertain": false, + "Interpretation": "different-aspects" + }, + { + "Id": "changed", + "Text": "My understanding has changed; I would like to revisit an answer.", + "Contributions": [], + "Uncertain": false, + "Interpretation": "revised-understanding" + }, + { + "Id": "conflict", + "Text": "Both answers still seem true for the same moment.", + "Contributions": [], + "Uncertain": false, + "Interpretation": "confirm-conflict" + }, + { + "Id": "uncertain", + "Text": "I’m not sure how to explain it yet.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "uncertain" + } + ] + }, + { + "Id": "organisation-1", + "Text": "Do you lose track of information you have already decided?", + "Help": "Think about the particular part of your story that brought you here.", + "Purpose": "Discovery", + "Group": "organisation-same-signal", + "InformationValue": 2, + "Hypotheses": [ + "organisation" + ], + "Dimensions": [ + "organisation" + ], + "Options": [ + { + "Id": "yes", + "Text": "Yes, that describes it.", + "Contributions": [ + { + "Hypothesis": "organisation", + "Dimension": "organisation", + "Aspect": "current-concern", + "Weight": 3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "no", + "Text": "No, that does not describe it.", + "Contributions": [ + { + "Hypothesis": "organisation", + "Dimension": "organisation", + "Aspect": "current-concern", + "Weight": -3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "unsure", + "Text": "I’m not sure.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "" + } + ] + }, + { + "Id": "organisation-2", + "Text": "When returning to the story, is finding those existing decisions still difficult?", + "Help": "Think about the particular part of your story that brought you here.", + "Purpose": "Corroboration", + "Group": "organisation-same-signal", + "InformationValue": 1, + "Hypotheses": [ + "organisation" + ], + "Dimensions": [ + "organisation" + ], + "Options": [ + { + "Id": "yes", + "Text": "Yes, that describes it.", + "Contributions": [ + { + "Hypothesis": "organisation", + "Dimension": "organisation", + "Aspect": "current-concern", + "Weight": 3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "no", + "Text": "No, that does not describe it.", + "Contributions": [ + { + "Hypothesis": "organisation", + "Dimension": "organisation", + "Aspect": "current-concern", + "Weight": -3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "unsure", + "Text": "I’m not sure.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "" + } + ] + }, + { + "Id": "organisation-3", + "Text": "Would seeing the order of your existing scenes help more than inventing something new?", + "Help": "Think about the particular part of your story that brought you here.", + "Purpose": "Discrimination", + "Group": "organisation-independent-2", + "InformationValue": 1, + "Hypotheses": [ + "organisation" + ], + "Dimensions": [ + "constraints" + ], + "Options": [ + { + "Id": "yes", + "Text": "Yes, that describes it.", + "Contributions": [ + { + "Hypothesis": "organisation", + "Dimension": "constraints", + "Aspect": "current-concern", + "Weight": 3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "no", + "Text": "No, that does not describe it.", + "Contributions": [ + { + "Hypothesis": "organisation", + "Dimension": "constraints", + "Aspect": "current-concern", + "Weight": -3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "unsure", + "Text": "I’m not sure.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "" + } + ] + }, + { + "Id": "organisation-4", + "Text": "Can you easily find the existing facts and event order that you need?", + "Help": "Think about the particular part of your story that brought you here.", + "Purpose": "Challenge", + "Group": "organisation-independent-3", + "InformationValue": 1, + "Hypotheses": [ + "organisation" + ], + "Dimensions": [ + "organisation" + ], + "Options": [ + { + "Id": "yes", + "Text": "Yes, that describes it.", + "Contributions": [ + { + "Hypothesis": "organisation", + "Dimension": "organisation", + "Aspect": "current-concern", + "Weight": -3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "no", + "Text": "No, that does not describe it.", + "Contributions": [ + { + "Hypothesis": "organisation", + "Dimension": "organisation", + "Aspect": "current-concern", + "Weight": 1 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "unsure", + "Text": "I’m not sure.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "" + } + ] + }, + { + "Id": "organisation-clarify", + "Text": "Your answers about this concern point in different directions. How should we understand that?", + "Help": "Existing story information is difficult to organise. It is fine if you were considering different moments, or if your understanding has changed.", + "Purpose": "Clarification", + "Group": "organisation-clarification", + "InformationValue": 0, + "Hypotheses": [ + "organisation" + ], + "Dimensions": [ + "organisation" + ], + "Clarifies": [ + "organisation" + ], + "Eligibility": { + "AllAnswers": { + "organisation-1": [ + "yes", + "no", + "unsure" + ], + "organisation-2": [ + "yes", + "no", + "unsure" + ] + } + }, + "Options": [ + { + "Id": "aspects", + "Text": "I was thinking about different aspects or moments.", + "Contributions": [], + "Uncertain": false, + "Interpretation": "different-aspects" + }, + { + "Id": "changed", + "Text": "My understanding has changed; I would like to revisit an answer.", + "Contributions": [], + "Uncertain": false, + "Interpretation": "revised-understanding" + }, + { + "Id": "conflict", + "Text": "Both answers still seem true for the same moment.", + "Contributions": [], + "Uncertain": false, + "Interpretation": "confirm-conflict" + }, + { + "Id": "uncertain", + "Text": "I’m not sure how to explain it yet.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "uncertain" + } + ] + }, + { + "Id": "next-event-1", + "Text": "Do you have several possible next events without a clear way to choose?", + "Help": "Think about the particular part of your story that brought you here.", + "Purpose": "Discovery", + "Group": "next-event-same-signal", + "InformationValue": 2, + "Hypotheses": [ + "next-event" + ], + "Dimensions": [ + "options" + ], + "Options": [ + { + "Id": "yes", + "Text": "Yes, that describes it.", + "Contributions": [ + { + "Hypothesis": "next-event", + "Dimension": "options", + "Aspect": "current-concern", + "Weight": 3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "no", + "Text": "No, that does not describe it.", + "Contributions": [ + { + "Hypothesis": "next-event", + "Dimension": "options", + "Aspect": "current-concern", + "Weight": -3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "unsure", + "Text": "I’m not sure.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "" + } + ] + }, + { + "Id": "next-event-2", + "Text": "Are you still uncertain which possible event to develop next?", + "Help": "Think about the particular part of your story that brought you here.", + "Purpose": "Corroboration", + "Group": "next-event-same-signal", + "InformationValue": 1, + "Hypotheses": [ + "next-event" + ], + "Dimensions": [ + "options" + ], + "Options": [ + { + "Id": "yes", + "Text": "Yes, that describes it.", + "Contributions": [ + { + "Hypothesis": "next-event", + "Dimension": "options", + "Aspect": "current-concern", + "Weight": 3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "no", + "Text": "No, that does not describe it.", + "Contributions": [ + { + "Hypothesis": "next-event", + "Dimension": "options", + "Aspect": "current-concern", + "Weight": -3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "unsure", + "Text": "I’m not sure.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "" + } + ] + }, + { + "Id": "next-event-3", + "Text": "Might a change in an existing relationship give you a useful next possibility?", + "Help": "Think about the particular part of your story that brought you here.", + "Purpose": "Discrimination", + "Group": "next-event-independent-2", + "InformationValue": 1, + "Hypotheses": [ + "next-event" + ], + "Dimensions": [ + "constraints" + ], + "Options": [ + { + "Id": "yes", + "Text": "Yes, that describes it.", + "Contributions": [ + { + "Hypothesis": "next-event", + "Dimension": "constraints", + "Aspect": "current-concern", + "Weight": 3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "no", + "Text": "No, that does not describe it.", + "Contributions": [ + { + "Hypothesis": "next-event", + "Dimension": "constraints", + "Aspect": "current-concern", + "Weight": -3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "unsure", + "Text": "I’m not sure.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "" + } + ] + }, + { + "Id": "next-event-4", + "Text": "Can you already identify a next event that follows naturally from an existing choice?", + "Help": "Think about the particular part of your story that brought you here.", + "Purpose": "Challenge", + "Group": "next-event-independent-3", + "InformationValue": 1, + "Hypotheses": [ + "next-event" + ], + "Dimensions": [ + "options" + ], + "Options": [ + { + "Id": "yes", + "Text": "Yes, that describes it.", + "Contributions": [ + { + "Hypothesis": "next-event", + "Dimension": "options", + "Aspect": "current-concern", + "Weight": -3 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "no", + "Text": "No, that does not describe it.", + "Contributions": [ + { + "Hypothesis": "next-event", + "Dimension": "options", + "Aspect": "current-concern", + "Weight": 1 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "unsure", + "Text": "I’m not sure.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "" + } + ] + }, + { + "Id": "next-event-clarify", + "Text": "Your answers about this concern point in different directions. How should we understand that?", + "Help": "The next story event needs development. It is fine if you were considering different moments, or if your understanding has changed.", + "Purpose": "Clarification", + "Group": "next-event-clarification", + "InformationValue": 0, + "Hypotheses": [ + "next-event" + ], + "Dimensions": [ + "options" + ], + "Clarifies": [ + "options" + ], + "Eligibility": { + "AllAnswers": { + "next-event-1": [ + "yes", + "no", + "unsure" + ], + "next-event-2": [ + "yes", + "no", + "unsure" + ] + } + }, + "Options": [ + { + "Id": "aspects", + "Text": "I was thinking about different aspects or moments.", + "Contributions": [], + "Uncertain": false, + "Interpretation": "different-aspects" + }, + { + "Id": "changed", + "Text": "My understanding has changed; I would like to revisit an answer.", + "Contributions": [], + "Uncertain": false, + "Interpretation": "revised-understanding" + }, + { + "Id": "conflict", + "Text": "Both answers still seem true for the same moment.", + "Contributions": [], + "Uncertain": false, + "Interpretation": "confirm-conflict" + }, + { + "Id": "uncertain", + "Text": "I’m not sure how to explain it yet.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "uncertain" + } + ] + }, + { + "Id": "distinguish-action", + "Text": "Which feels closer to what is troubling you?", + "Purpose": "Discrimination", + "Group": "distinguish-action", + "InformationValue": 3, + "Hypotheses": [ + "motivation", + "change" + ], + "Dimensions": [ + "motivation", + "change" + ], + "Options": [ + { + "Id": "first", + "Text": "Understanding the reason behind a choice.", + "Contributions": [ + { + "Hypothesis": "motivation", + "Dimension": "motivation", + "Aspect": "current-concern", + "Weight": 2 + }, + { + "Hypothesis": "change", + "Dimension": "change", + "Aspect": "current-concern", + "Weight": -1 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "second", + "Text": "Seeing what the scene changes.", + "Contributions": [ + { + "Hypothesis": "motivation", + "Dimension": "motivation", + "Aspect": "current-concern", + "Weight": -1 + }, + { + "Hypothesis": "change", + "Dimension": "change", + "Aspect": "current-concern", + "Weight": 2 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "unsure", + "Text": "Both, or I’m not sure yet.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "" + } + ] + }, + { + "Id": "distinguish-shape", + "Text": "Which would help you most right now?", + "Purpose": "Discrimination", + "Group": "distinguish-shape", + "InformationValue": 3, + "Hypotheses": [ + "organisation", + "connections" + ], + "Dimensions": [ + "organisation", + "causality" + ], + "Options": [ + { + "Id": "first", + "Text": "Finding the information I have already decided.", + "Contributions": [ + { + "Hypothesis": "organisation", + "Dimension": "organisation", + "Aspect": "current-concern", + "Weight": 2 + }, + { + "Hypothesis": "connections", + "Dimension": "causality", + "Aspect": "current-concern", + "Weight": -1 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "second", + "Text": "Connecting one event to another.", + "Contributions": [ + { + "Hypothesis": "organisation", + "Dimension": "organisation", + "Aspect": "current-concern", + "Weight": -1 + }, + { + "Hypothesis": "connections", + "Dimension": "causality", + "Aspect": "current-concern", + "Weight": 2 + } + ], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "unsure", + "Text": "Both, or I’m not sure yet.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "" + } + ] + }, + { + "Id": "action-preference", + "Text": "How would you prefer to work on the concern?", + "Purpose": "ActionPreference", + "Group": "preference", + "InformationValue": 0, + "Hypotheses": [ + "motivation", + "change", + "connections", + "organisation", + "next-event" + ], + "Dimensions": [ + "options" + ], + "Options": [ + { + "Id": "existing", + "Text": "Look through what I have already recorded.", + "Contributions": [], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "develop", + "Text": "Develop a new possibility.", + "Contributions": [], + "Uncertain": false, + "Interpretation": "" + }, + { + "Id": "unsure", + "Text": "I’m not sure yet.", + "Contributions": [], + "Uncertain": true, + "Interpretation": "" + } + ] + } + ], + "Capabilities": [ + { + "Id": "characters", + "Name": "Characters", + "Description": "Clarify what a character wants and why it matters.", + "Resolver": "Characters", + "ActionText": "Explore your characters", + "Context": "project", + "RequiresProject": true, + "RequiresBook": true, + "Authority": "ProjectAccess", + "Available": true + }, + { + "Id": "write", + "Name": "Chapter and scene intentions", + "Description": "Compare intentions and outcomes in your saved chapter and scene workspace.", + "Resolver": "Write", + "ActionText": "Develop a chapter or scene", + "Context": "book", + "RequiresProject": true, + "RequiresBook": true, + "Authority": "ProjectAccess", + "Available": true + }, + { + "Id": "threads", + "Name": "Plot lines and threads", + "Description": "Lay out how recorded developments connect.", + "Resolver": "PlotThreads", + "ActionText": "Explore your plot threads", + "Context": "book", + "RequiresProject": true, + "RequiresBook": true, + "Authority": "ProjectAccess", + "Available": true + }, + { + "Id": "timeline", + "Name": "Story timeline", + "Description": "Review the order and shape of your saved chapters and scenes.", + "Resolver": "Timeline", + "ActionText": "Inspect your story timeline", + "Context": "book", + "RequiresProject": true, + "RequiresBook": true, + "Authority": "ProjectAccess", + "Available": true + }, + { + "Id": "relationships", + "Name": "Character relationships", + "Description": "Consider recorded relationships that could create a next event.", + "Resolver": "Relationships", + "ActionText": "Explore relationships", + "Context": "book", + "RequiresProject": true, + "RequiresBook": true, + "Authority": "ProjectAccess", + "Available": true + } + ] +} diff --git a/Docs/Writer/Writer3/Evidence/Phase3D1/simulation.json b/Docs/Writer/Writer3/Evidence/Phase3D1/simulation.json new file mode 100644 index 00000000..d532ad58 --- /dev/null +++ b/Docs/Writer/Writer3/Evidence/Phase3D1/simulation.json @@ -0,0 +1,3183 @@ +{ + "SchemaVersion": 1, + "Paths": 228, + "Steps": 2560, + "Hypotheses": [ + "change", + "connections", + "motivation", + "next-event", + "organisation" + ], + "Destinations": [ + "characters", + "relationships", + "threads", + "timeline", + "write" + ], + "UnreachableHypotheses": [], + "UnreachableDestinations": [], + "RepeatedQuestions": 0, + "Loops": 0, + "PrematureRecommendations": 0, + "InvalidDestinations": 0, + "NonDeterministic": 0, + "RepresentativePaths": [ + { + "concern": "story", + "target": "motivation", + "answers": [ + "change-4=unsure", + "connections-4=unsure", + "action-preference=develop", + "change-2=no", + "connections-2=no", + "distinguish-action=first", + "motivation-4=no", + "distinguish-shape=unsure", + "motivation-3=yes" + ], + "outcome": "Supported recommendation", + "recommendations": [ + "motivation" + ], + "eligibility": [ + { + "Id": "motivation", + "Prior": 0, + "Support": 6, + "Opposition": 0, + "Score": 6, + "Dimensions": 2, + "Groups": 3, + "Challenged": true, + "Eligible": true, + "Supported": true, + "Conflicts": [], + "Missing": [] + }, + { + "Id": "next-event", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "organisation", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "change", + "Prior": 1, + "Support": 0, + "Opposition": -3, + "Score": -2, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "connections", + "Prior": 1, + "Support": 0, + "Opposition": -3, + "Score": -2, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + } + ] + }, + { + "concern": "story", + "target": "change", + "answers": [ + "change-4=no", + "connections-4=unsure", + "action-preference=develop", + "connections-2=no", + "change-2=yes", + "distinguish-action=second", + "distinguish-shape=unsure", + "change-3=yes" + ], + "outcome": "Supported recommendation", + "recommendations": [ + "change" + ], + "eligibility": [ + { + "Id": "change", + "Prior": 1, + "Support": 6, + "Opposition": 0, + "Score": 7, + "Dimensions": 2, + "Groups": 4, + "Challenged": true, + "Eligible": true, + "Supported": true, + "Conflicts": [], + "Missing": [] + }, + { + "Id": "next-event", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "organisation", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "motivation", + "Prior": 0, + "Support": 0, + "Opposition": -1, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "connections", + "Prior": 1, + "Support": 0, + "Opposition": -3, + "Score": -2, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + } + ] + }, + { + "concern": "story", + "target": "connections", + "answers": [ + "change-4=unsure", + "connections-4=no", + "action-preference=develop", + "change-2=no", + "connections-2=yes", + "distinguish-shape=second", + "distinguish-action=unsure", + "connections-3=yes" + ], + "outcome": "Supported recommendation", + "recommendations": [ + "connections" + ], + "eligibility": [ + { + "Id": "connections", + "Prior": 1, + "Support": 6, + "Opposition": 0, + "Score": 7, + "Dimensions": 2, + "Groups": 4, + "Challenged": true, + "Eligible": true, + "Supported": true, + "Conflicts": [], + "Missing": [] + }, + { + "Id": "motivation", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "next-event", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "organisation", + "Prior": 0, + "Support": 0, + "Opposition": -1, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "change", + "Prior": 1, + "Support": 0, + "Opposition": -3, + "Score": -2, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + } + ] + }, + { + "concern": "story", + "target": "organisation", + "answers": [ + "change-4=unsure", + "connections-4=unsure", + "action-preference=develop", + "change-2=no", + "connections-2=no", + "distinguish-action=unsure", + "distinguish-shape=first", + "organisation-4=no", + "organisation-3=yes" + ], + "outcome": "Supported recommendation", + "recommendations": [ + "organisation" + ], + "eligibility": [ + { + "Id": "organisation", + "Prior": 0, + "Support": 6, + "Opposition": 0, + "Score": 6, + "Dimensions": 2, + "Groups": 3, + "Challenged": true, + "Eligible": true, + "Supported": true, + "Conflicts": [], + "Missing": [] + }, + { + "Id": "motivation", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "next-event", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "change", + "Prior": 1, + "Support": 0, + "Opposition": -3, + "Score": -2, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "connections", + "Prior": 1, + "Support": 0, + "Opposition": -3, + "Score": -2, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + } + ] + }, + { + "concern": "story", + "target": "next-event", + "answers": [ + "change-4=unsure", + "connections-4=unsure", + "action-preference=develop", + "change-2=no", + "connections-2=no", + "distinguish-action=unsure", + "distinguish-shape=unsure", + "motivation-1=no", + "next-event-1=yes", + "next-event-4=no", + "next-event-3=yes" + ], + "outcome": "Supported recommendation", + "recommendations": [ + "next-event" + ], + "eligibility": [ + { + "Id": "next-event", + "Prior": 0, + "Support": 6, + "Opposition": 0, + "Score": 6, + "Dimensions": 2, + "Groups": 3, + "Challenged": true, + "Eligible": true, + "Supported": true, + "Conflicts": [], + "Missing": [] + }, + { + "Id": "organisation", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "change", + "Prior": 1, + "Support": 0, + "Opposition": -3, + "Score": -2, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "connections", + "Prior": 1, + "Support": 0, + "Opposition": -3, + "Score": -2, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "motivation", + "Prior": 0, + "Support": 0, + "Opposition": -3, + "Score": -3, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + } + ] + }, + { + "concern": "story", + "target": "uncertain", + "answers": [ + "change-4=unsure", + "connections-4=unsure", + "action-preference=unsure", + "change-2=unsure", + "connections-2=unsure", + "distinguish-action=unsure", + "distinguish-shape=unsure", + "change-1=unsure", + "connections-1=unsure", + "change-3=unsure", + "connections-3=unsure", + "change-clarify=uncertain" + ], + "outcome": "More information needed", + "recommendations": [], + "eligibility": [ + { + "Id": "change", + "Prior": 1, + "Support": 0, + "Opposition": 0, + "Score": 1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "competing explanation examined", + "net evidence" + ] + }, + { + "Id": "connections", + "Prior": 1, + "Support": 0, + "Opposition": 0, + "Score": 1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "competing explanation examined", + "net evidence" + ] + }, + { + "Id": "motivation", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "competing explanation examined", + "net evidence" + ] + }, + { + "Id": "next-event", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "competing explanation examined", + "net evidence" + ] + }, + { + "Id": "organisation", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "competing explanation examined", + "net evidence" + ] + } + ] + }, + { + "concern": "story", + "target": "alternating", + "answers": [ + "change-4=yes", + "connections-4=no", + "action-preference=unsure", + "connections-2=yes", + "distinguish-shape=second", + "distinguish-action=unsure", + "connections-3=yes", + "connections-1=no", + "connections-clarify=aspects", + "motivation-1=yes", + "motivation-4=no", + "motivation-3=unsure" + ], + "outcome": "Two plausible explanations", + "recommendations": [], + "eligibility": [ + { + "Id": "connections", + "Prior": 1, + "Support": 6, + "Opposition": -3, + "Score": 4, + "Dimensions": 2, + "Groups": 4, + "Challenged": true, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "net evidence" + ] + }, + { + "Id": "motivation", + "Prior": 0, + "Support": 3, + "Opposition": 0, + "Score": 3, + "Dimensions": 1, + "Groups": 2, + "Challenged": true, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "net evidence" + ] + }, + { + "Id": "next-event", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "organisation", + "Prior": 0, + "Support": 0, + "Opposition": -1, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "change", + "Prior": 1, + "Support": 0, + "Opposition": -3, + "Score": -2, + "Dimensions": 0, + "Groups": 0, + "Challenged": true, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "net evidence" + ] + } + ] + }, + { + "concern": "character", + "target": "motivation", + "answers": [ + "motivation-4=no", + "action-preference=develop", + "distinguish-action=first", + "distinguish-shape=unsure", + "motivation-3=yes", + "motivation-1=yes", + "connections-1=no", + "motivation-2=yes" + ], + "outcome": "Supported recommendation", + "recommendations": [ + "motivation" + ], + "eligibility": [ + { + "Id": "motivation", + "Prior": 2, + "Support": 6, + "Opposition": 0, + "Score": 8, + "Dimensions": 2, + "Groups": 4, + "Challenged": true, + "Eligible": true, + "Supported": true, + "Conflicts": [], + "Missing": [] + }, + { + "Id": "next-event", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "organisation", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "change", + "Prior": 0, + "Support": 0, + "Opposition": -1, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "connections", + "Prior": 0, + "Support": 0, + "Opposition": -3, + "Score": -3, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + } + ] + }, + { + "concern": "character", + "target": "change", + "answers": [ + "motivation-4=unsure", + "distinguish-action=second", + "change-4=no", + "action-preference=develop", + "motivation-2=no", + "distinguish-shape=unsure", + "change-3=yes", + "change-1=yes" + ], + "outcome": "Supported recommendation", + "recommendations": [ + "change" + ], + "eligibility": [ + { + "Id": "change", + "Prior": 0, + "Support": 6, + "Opposition": 0, + "Score": 6, + "Dimensions": 2, + "Groups": 4, + "Challenged": true, + "Eligible": true, + "Supported": true, + "Conflicts": [], + "Missing": [] + }, + { + "Id": "connections", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "next-event", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "organisation", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "motivation", + "Prior": 2, + "Support": 0, + "Opposition": -3, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + } + ] + }, + { + "concern": "character", + "target": "connections", + "answers": [ + "motivation-4=unsure", + "distinguish-action=unsure", + "motivation-2=no", + "distinguish-shape=second", + "connections-4=no", + "action-preference=develop", + "connections-3=yes", + "connections-1=yes" + ], + "outcome": "Supported recommendation", + "recommendations": [ + "connections" + ], + "eligibility": [ + { + "Id": "connections", + "Prior": 0, + "Support": 6, + "Opposition": 0, + "Score": 6, + "Dimensions": 2, + "Groups": 4, + "Challenged": true, + "Eligible": true, + "Supported": true, + "Conflicts": [], + "Missing": [] + }, + { + "Id": "change", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "next-event", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "motivation", + "Prior": 2, + "Support": 0, + "Opposition": -3, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "organisation", + "Prior": 0, + "Support": 0, + "Opposition": -1, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + } + ] + }, + { + "concern": "character", + "target": "organisation", + "answers": [ + "motivation-4=unsure", + "distinguish-action=unsure", + "motivation-2=no", + "distinguish-shape=first", + "organisation-4=no", + "action-preference=develop", + "organisation-3=yes", + "organisation-1=yes" + ], + "outcome": "Supported recommendation", + "recommendations": [ + "organisation" + ], + "eligibility": [ + { + "Id": "organisation", + "Prior": 0, + "Support": 6, + "Opposition": 0, + "Score": 6, + "Dimensions": 2, + "Groups": 4, + "Challenged": true, + "Eligible": true, + "Supported": true, + "Conflicts": [], + "Missing": [] + }, + { + "Id": "change", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "next-event", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "connections", + "Prior": 0, + "Support": 0, + "Opposition": -1, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "motivation", + "Prior": 2, + "Support": 0, + "Opposition": -3, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + } + ] + }, + { + "concern": "character", + "target": "next-event", + "answers": [ + "motivation-4=unsure", + "distinguish-action=unsure", + "motivation-2=no", + "distinguish-shape=unsure", + "action-preference=develop", + "change-1=no", + "connections-1=no", + "next-event-1=yes", + "next-event-4=no", + "next-event-3=yes" + ], + "outcome": "Supported recommendation", + "recommendations": [ + "next-event" + ], + "eligibility": [ + { + "Id": "next-event", + "Prior": 0, + "Support": 6, + "Opposition": 0, + "Score": 6, + "Dimensions": 2, + "Groups": 3, + "Challenged": true, + "Eligible": true, + "Supported": true, + "Conflicts": [], + "Missing": [] + }, + { + "Id": "organisation", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "motivation", + "Prior": 2, + "Support": 0, + "Opposition": -3, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "change", + "Prior": 0, + "Support": 0, + "Opposition": -3, + "Score": -3, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "connections", + "Prior": 0, + "Support": 0, + "Opposition": -3, + "Score": -3, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + } + ] + }, + { + "concern": "character", + "target": "uncertain", + "answers": [ + "motivation-4=unsure", + "distinguish-action=unsure", + "motivation-2=unsure", + "action-preference=unsure", + "distinguish-shape=unsure", + "motivation-1=unsure", + "motivation-3=unsure", + "motivation-clarify=uncertain", + "change-1=unsure", + "connections-1=unsure", + "next-event-1=unsure", + "organisation-1=unsure" + ], + "outcome": "More information needed", + "recommendations": [], + "eligibility": [ + { + "Id": "motivation", + "Prior": 2, + "Support": 0, + "Opposition": 0, + "Score": 2, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "competing explanation examined", + "net evidence" + ] + }, + { + "Id": "change", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "competing explanation examined", + "net evidence" + ] + }, + { + "Id": "connections", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "competing explanation examined", + "net evidence" + ] + }, + { + "Id": "next-event", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "competing explanation examined", + "net evidence" + ] + }, + { + "Id": "organisation", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "competing explanation examined", + "net evidence" + ] + } + ] + }, + { + "concern": "character", + "target": "alternating", + "answers": [ + "motivation-4=yes", + "distinguish-shape=second", + "connections-4=unsure", + "action-preference=existing", + "connections-2=no", + "distinguish-action=unsure", + "change-1=yes", + "change-4=no", + "change-3=unsure", + "change-2=yes", + "next-event-1=no", + "change-clarify=uncertain" + ], + "outcome": "Two plausible explanations", + "recommendations": [], + "eligibility": [ + { + "Id": "change", + "Prior": 0, + "Support": 3, + "Opposition": 0, + "Score": 3, + "Dimensions": 1, + "Groups": 2, + "Challenged": true, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "net evidence" + ] + }, + { + "Id": "connections", + "Prior": 0, + "Support": 2, + "Opposition": -3, + "Score": -1, + "Dimensions": 1, + "Groups": 1, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [ + "connections/causality/current-concern" + ], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "material conflict clarified", + "net evidence" + ] + }, + { + "Id": "motivation", + "Prior": 2, + "Support": 0, + "Opposition": -3, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": true, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "net evidence" + ] + }, + { + "Id": "organisation", + "Prior": 0, + "Support": 0, + "Opposition": -1, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "next-event", + "Prior": 0, + "Support": 0, + "Opposition": -3, + "Score": -3, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + } + ] + }, + { + "concern": "next", + "target": "motivation", + "answers": [ + "next-event-4=unsure", + "next-event-2=no", + "distinguish-action=first", + "motivation-4=no", + "action-preference=develop", + "distinguish-shape=unsure", + "motivation-3=yes", + "motivation-1=yes" + ], + "outcome": "Supported recommendation", + "recommendations": [ + "motivation" + ], + "eligibility": [ + { + "Id": "motivation", + "Prior": 0, + "Support": 6, + "Opposition": 0, + "Score": 6, + "Dimensions": 2, + "Groups": 4, + "Challenged": true, + "Eligible": true, + "Supported": true, + "Conflicts": [], + "Missing": [] + }, + { + "Id": "connections", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "organisation", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "change", + "Prior": 0, + "Support": 0, + "Opposition": -1, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "next-event", + "Prior": 2, + "Support": 0, + "Opposition": -3, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + } + ] + }, + { + "concern": "next", + "target": "change", + "answers": [ + "next-event-4=unsure", + "next-event-2=no", + "distinguish-action=second", + "change-4=no", + "action-preference=develop", + "distinguish-shape=unsure", + "change-3=yes", + "change-1=yes" + ], + "outcome": "Supported recommendation", + "recommendations": [ + "change" + ], + "eligibility": [ + { + "Id": "change", + "Prior": 0, + "Support": 6, + "Opposition": 0, + "Score": 6, + "Dimensions": 2, + "Groups": 4, + "Challenged": true, + "Eligible": true, + "Supported": true, + "Conflicts": [], + "Missing": [] + }, + { + "Id": "connections", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "organisation", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "motivation", + "Prior": 0, + "Support": 0, + "Opposition": -1, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "next-event", + "Prior": 2, + "Support": 0, + "Opposition": -3, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + } + ] + }, + { + "concern": "next", + "target": "connections", + "answers": [ + "next-event-4=unsure", + "next-event-2=no", + "distinguish-action=unsure", + "distinguish-shape=second", + "connections-4=no", + "action-preference=develop", + "connections-3=yes", + "connections-1=yes" + ], + "outcome": "Supported recommendation", + "recommendations": [ + "connections" + ], + "eligibility": [ + { + "Id": "connections", + "Prior": 0, + "Support": 6, + "Opposition": 0, + "Score": 6, + "Dimensions": 2, + "Groups": 4, + "Challenged": true, + "Eligible": true, + "Supported": true, + "Conflicts": [], + "Missing": [] + }, + { + "Id": "change", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "motivation", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "next-event", + "Prior": 2, + "Support": 0, + "Opposition": -3, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "organisation", + "Prior": 0, + "Support": 0, + "Opposition": -1, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + } + ] + }, + { + "concern": "next", + "target": "organisation", + "answers": [ + "next-event-4=unsure", + "next-event-2=no", + "distinguish-action=unsure", + "distinguish-shape=first", + "organisation-4=no", + "action-preference=develop", + "organisation-3=yes", + "organisation-1=yes" + ], + "outcome": "Supported recommendation", + "recommendations": [ + "organisation" + ], + "eligibility": [ + { + "Id": "organisation", + "Prior": 0, + "Support": 6, + "Opposition": 0, + "Score": 6, + "Dimensions": 2, + "Groups": 4, + "Challenged": true, + "Eligible": true, + "Supported": true, + "Conflicts": [], + "Missing": [] + }, + { + "Id": "change", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "motivation", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "connections", + "Prior": 0, + "Support": 0, + "Opposition": -1, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "next-event", + "Prior": 2, + "Support": 0, + "Opposition": -3, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + } + ] + }, + { + "concern": "next", + "target": "next-event", + "answers": [ + "next-event-4=no", + "next-event-2=yes", + "action-preference=develop", + "distinguish-action=unsure", + "distinguish-shape=unsure", + "next-event-3=yes", + "next-event-1=yes", + "change-1=no" + ], + "outcome": "Supported recommendation", + "recommendations": [ + "next-event" + ], + "eligibility": [ + { + "Id": "next-event", + "Prior": 2, + "Support": 6, + "Opposition": 0, + "Score": 8, + "Dimensions": 2, + "Groups": 3, + "Challenged": true, + "Eligible": true, + "Supported": true, + "Conflicts": [], + "Missing": [] + }, + { + "Id": "connections", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "motivation", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "organisation", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "change", + "Prior": 0, + "Support": 0, + "Opposition": -3, + "Score": -3, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + } + ] + }, + { + "concern": "next", + "target": "uncertain", + "answers": [ + "next-event-4=unsure", + "next-event-2=unsure", + "action-preference=unsure", + "distinguish-action=unsure", + "distinguish-shape=unsure", + "next-event-1=unsure", + "next-event-3=unsure", + "next-event-clarify=uncertain", + "change-1=unsure", + "connections-1=unsure", + "motivation-1=unsure", + "organisation-1=unsure" + ], + "outcome": "More information needed", + "recommendations": [], + "eligibility": [ + { + "Id": "next-event", + "Prior": 2, + "Support": 0, + "Opposition": 0, + "Score": 2, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "competing explanation examined", + "net evidence" + ] + }, + { + "Id": "change", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "competing explanation examined", + "net evidence" + ] + }, + { + "Id": "connections", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "competing explanation examined", + "net evidence" + ] + }, + { + "Id": "motivation", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "competing explanation examined", + "net evidence" + ] + }, + { + "Id": "organisation", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "competing explanation examined", + "net evidence" + ] + } + ] + }, + { + "concern": "next", + "target": "alternating", + "answers": [ + "next-event-4=yes", + "distinguish-action=second", + "change-4=unsure", + "change-2=yes", + "action-preference=develop", + "distinguish-shape=unsure", + "change-3=yes", + "change-1=no", + "change-clarify=aspects", + "connections-1=yes", + "connections-4=no", + "connections-3=unsure" + ], + "outcome": "Two plausible explanations", + "recommendations": [], + "eligibility": [ + { + "Id": "change", + "Prior": 0, + "Support": 6, + "Opposition": -3, + "Score": 3, + "Dimensions": 2, + "Groups": 3, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "connections", + "Prior": 0, + "Support": 3, + "Opposition": 0, + "Score": 3, + "Dimensions": 1, + "Groups": 2, + "Challenged": true, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "net evidence" + ] + }, + { + "Id": "organisation", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "motivation", + "Prior": 0, + "Support": 0, + "Opposition": -1, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "next-event", + "Prior": 2, + "Support": 0, + "Opposition": -3, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": true, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "net evidence" + ] + } + ] + }, + { + "concern": "track", + "target": "motivation", + "answers": [ + "organisation-4=unsure", + "distinguish-shape=unsure", + "organisation-2=no", + "distinguish-action=first", + "motivation-4=no", + "action-preference=develop", + "motivation-3=yes", + "motivation-1=yes" + ], + "outcome": "Supported recommendation", + "recommendations": [ + "motivation" + ], + "eligibility": [ + { + "Id": "motivation", + "Prior": 0, + "Support": 6, + "Opposition": 0, + "Score": 6, + "Dimensions": 2, + "Groups": 4, + "Challenged": true, + "Eligible": true, + "Supported": true, + "Conflicts": [], + "Missing": [] + }, + { + "Id": "connections", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "next-event", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "change", + "Prior": 0, + "Support": 0, + "Opposition": -1, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "organisation", + "Prior": 2, + "Support": 0, + "Opposition": -3, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + } + ] + }, + { + "concern": "track", + "target": "change", + "answers": [ + "organisation-4=unsure", + "distinguish-shape=unsure", + "organisation-2=no", + "distinguish-action=second", + "change-4=no", + "action-preference=develop", + "change-3=yes", + "change-1=yes" + ], + "outcome": "Supported recommendation", + "recommendations": [ + "change" + ], + "eligibility": [ + { + "Id": "change", + "Prior": 0, + "Support": 6, + "Opposition": 0, + "Score": 6, + "Dimensions": 2, + "Groups": 4, + "Challenged": true, + "Eligible": true, + "Supported": true, + "Conflicts": [], + "Missing": [] + }, + { + "Id": "connections", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "next-event", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "motivation", + "Prior": 0, + "Support": 0, + "Opposition": -1, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "organisation", + "Prior": 2, + "Support": 0, + "Opposition": -3, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + } + ] + }, + { + "concern": "track", + "target": "connections", + "answers": [ + "organisation-4=unsure", + "distinguish-shape=second", + "connections-4=no", + "action-preference=develop", + "organisation-2=no", + "distinguish-action=unsure", + "connections-3=yes", + "connections-1=yes" + ], + "outcome": "Supported recommendation", + "recommendations": [ + "connections" + ], + "eligibility": [ + { + "Id": "connections", + "Prior": 0, + "Support": 6, + "Opposition": 0, + "Score": 6, + "Dimensions": 2, + "Groups": 4, + "Challenged": true, + "Eligible": true, + "Supported": true, + "Conflicts": [], + "Missing": [] + }, + { + "Id": "change", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "motivation", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "next-event", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "organisation", + "Prior": 2, + "Support": 0, + "Opposition": -3, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + } + ] + }, + { + "concern": "track", + "target": "organisation", + "answers": [ + "organisation-4=no", + "action-preference=develop", + "distinguish-shape=first", + "distinguish-action=unsure", + "organisation-3=yes", + "organisation-1=yes", + "change-1=no", + "motivation-1=no" + ], + "outcome": "Supported recommendation", + "recommendations": [ + "organisation" + ], + "eligibility": [ + { + "Id": "organisation", + "Prior": 2, + "Support": 6, + "Opposition": 0, + "Score": 8, + "Dimensions": 2, + "Groups": 4, + "Challenged": true, + "Eligible": true, + "Supported": true, + "Conflicts": [], + "Missing": [] + }, + { + "Id": "next-event", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "connections", + "Prior": 0, + "Support": 0, + "Opposition": -1, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "change", + "Prior": 0, + "Support": 0, + "Opposition": -3, + "Score": -3, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "motivation", + "Prior": 0, + "Support": 0, + "Opposition": -3, + "Score": -3, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + } + ] + }, + { + "concern": "track", + "target": "next-event", + "answers": [ + "organisation-4=unsure", + "distinguish-shape=unsure", + "organisation-2=no", + "distinguish-action=unsure", + "action-preference=develop", + "change-1=no", + "connections-1=no", + "motivation-1=no", + "next-event-1=yes", + "next-event-4=no", + "next-event-3=yes" + ], + "outcome": "Supported recommendation", + "recommendations": [ + "next-event" + ], + "eligibility": [ + { + "Id": "next-event", + "Prior": 0, + "Support": 6, + "Opposition": 0, + "Score": 6, + "Dimensions": 2, + "Groups": 3, + "Challenged": true, + "Eligible": true, + "Supported": true, + "Conflicts": [], + "Missing": [] + }, + { + "Id": "organisation", + "Prior": 2, + "Support": 0, + "Opposition": -3, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "change", + "Prior": 0, + "Support": 0, + "Opposition": -3, + "Score": -3, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "connections", + "Prior": 0, + "Support": 0, + "Opposition": -3, + "Score": -3, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "motivation", + "Prior": 0, + "Support": 0, + "Opposition": -3, + "Score": -3, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + } + ] + }, + { + "concern": "track", + "target": "uncertain", + "answers": [ + "organisation-4=unsure", + "distinguish-shape=unsure", + "organisation-2=unsure", + "action-preference=unsure", + "distinguish-action=unsure", + "organisation-1=unsure", + "organisation-3=unsure", + "organisation-clarify=uncertain", + "change-1=unsure", + "connections-1=unsure", + "motivation-1=unsure", + "next-event-1=unsure" + ], + "outcome": "More information needed", + "recommendations": [], + "eligibility": [ + { + "Id": "organisation", + "Prior": 2, + "Support": 0, + "Opposition": 0, + "Score": 2, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "competing explanation examined", + "net evidence" + ] + }, + { + "Id": "change", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "competing explanation examined", + "net evidence" + ] + }, + { + "Id": "connections", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "competing explanation examined", + "net evidence" + ] + }, + { + "Id": "motivation", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "competing explanation examined", + "net evidence" + ] + }, + { + "Id": "next-event", + "Prior": 0, + "Support": 0, + "Opposition": 0, + "Score": 0, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "competing explanation examined", + "net evidence" + ] + } + ] + }, + { + "concern": "track", + "target": "alternating", + "answers": [ + "organisation-4=yes", + "distinguish-action=second", + "change-4=unsure", + "action-preference=existing", + "change-2=no", + "distinguish-shape=unsure", + "connections-1=yes", + "connections-4=no", + "connections-3=unsure", + "connections-2=yes", + "next-event-1=no", + "change-3=unsure" + ], + "outcome": "Two plausible explanations", + "recommendations": [], + "eligibility": [ + { + "Id": "connections", + "Prior": 0, + "Support": 3, + "Opposition": 0, + "Score": 3, + "Dimensions": 1, + "Groups": 2, + "Challenged": true, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "net evidence" + ] + }, + { + "Id": "change", + "Prior": 0, + "Support": 2, + "Opposition": -3, + "Score": -1, + "Dimensions": 1, + "Groups": 1, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [ + "change/change/current-concern" + ], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "material conflict clarified", + "net evidence" + ] + }, + { + "Id": "motivation", + "Prior": 0, + "Support": 0, + "Opposition": -1, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + }, + { + "Id": "organisation", + "Prior": 2, + "Support": 0, + "Opposition": -3, + "Score": -1, + "Dimensions": 0, + "Groups": 0, + "Challenged": true, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "net evidence" + ] + }, + { + "Id": "next-event", + "Prior": 0, + "Support": 0, + "Opposition": -3, + "Score": -3, + "Dimensions": 0, + "Groups": 0, + "Challenged": false, + "Eligible": true, + "Supported": false, + "Conflicts": [], + "Missing": [ + "distinct dimensions", + "independent corroboration", + "challenge opportunity", + "net evidence" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/Docs/Writer/Writer3/Help-Coverage.md b/Docs/Writer/Writer3/Help-Coverage.md index 2a625d26..800cc42e 100644 --- a/Docs/Writer/Writer3/Help-Coverage.md +++ b/Docs/Writer/Writer3/Help-Coverage.md @@ -114,3 +114,7 @@ Phase3B qualified: quick popup, More drawer and full writer3.word article verifi ## Phase3C Development qualification complete Application `78865cf` deployed in release `78865cf-20261116T230802Z`. Build,600 application checks,292 native preservation checks, browser suites and authenticated Development Review acceptance passed. Read-only data hashes matched; disposable account and observations were removed. Native1.0.0.40 is unchanged; physical Windows/media/installed-PWA/multiple-monitor acceptance remains manual. Review Help popup, More drawer and full article passed. See [Phase3C report](Phase3C-Report.md) for evidence and limitations. Phase4 has not started. + +## Phase3D.1 Guided Investigation and continuous Review + +`writer3.investigations` covers concern choice, optional explanation/draft, one-question flow, explicit saves, answer revision, independent private/book state, uncertain outcomes, authenticated tools and Development-only synthetic/no-AI boundaries. Existing Markdown micro/quick/More/full infrastructure is reused. `writer3.reviewing` now explains normal document scrolling and the accessible companion while preserving Focused Reading and accepted update rules. Browser/PWA Help qualification and live deployment evidence are in Phase3D1-Report.md. diff --git a/Docs/Writer/Writer3/Implementation-Tracker.md b/Docs/Writer/Writer3/Implementation-Tracker.md index 81cb0c4a..9c912f13 100644 --- a/Docs/Writer/Writer3/Implementation-Tracker.md +++ b/Docs/Writer/Writer3/Implementation-Tracker.md @@ -364,3 +364,7 @@ Batches3C.1–3C.6 integrate the canonical Reader, pure chapter/scene intentions ## Phase3C Development qualification complete Application `78865cf` deployed in release `78865cf-20261116T230802Z`. Build,600 application checks,292 native preservation checks, browser suites and authenticated Development Review acceptance passed. Read-only data hashes matched; disposable account and observations were removed. Native1.0.0.40 is unchanged; physical Windows/media/installed-PWA/multiple-monitor acceptance remains manual. Review Help popup, More drawer and full article passed. See [Phase3C report](Phase3C-Report.md) for evidence and limitations. Phase4 has not started. + +## Phase3D.1 — Guided Investigation technical foundation + +Explicitly authorised after Phase3C. Batches A–F implement the generic engine/contracts, evidence/selection, immutable catalogues/private history, synthetic28-question catalogue and simulator, authenticated Development Explore, and continuous Review page scrolling. Batch G qualifies build/harness, SQL, browser/PWA, Help and Development deployment. Public Solver and native Windows1.0.0.40 remain unchanged. Evidence/results and remaining manual limits are recorded in Phase3D1-Report.md. Production questions and Phase4 are not started. Later dependency/readiness scope is recorded without a mid-phase redesign; availability never changes diagnostic evidence. diff --git a/Docs/Writer/Writer3/Master-Specification.md b/Docs/Writer/Writer3/Master-Specification.md index 93f514ff..f262927d 100644 --- a/Docs/Writer/Writer3/Master-Specification.md +++ b/Docs/Writer/Writer3/Master-Specification.md @@ -363,3 +363,11 @@ Before substantial implementation, produce screen layouts and interaction states Do not undertake an unbounded application-wide rewrite. The successful outcome is not a new-looking Writer. It is a Writer that allows a novice author to begin immediately, supports sophisticated planning when desired, and preserves the powerful specialist and multi-screen facilities already built into PlotDirector. + +## Authorised Phase3D.1 foundation amendment — 17 November2026 + +Guided Investigation is a separate deterministic, data-driven engine inside authenticated Explore. It uses weighted competing hypotheses, independent evidence dimensions/groups, challenges, clarification, dynamically selected questions, immutable catalogue versions and private resumable answer/recommendation history. It uses no external AI service and preserves the public Problem Solver. This phase implements only28 synthetic Development questions and a small destination registry; it does not generate the production matrix or begin Phase4. + +Normal integrated Review is an explicit exception to viewport-contained work panels: long manuscript reading uses document/page scrolling, with the contextual companion remaining accessible. Focused Reading and canonical Reader semantics remain authoritative. + +Subsequent Feature Dependency Graph and Progressive Readiness requirements are recorded in [investigation architecture](../Investigations/Architecture.md). Missing prerequisites must never alter diagnostic evidence. Complete capability inventory, typed dependency graph, book readiness, preparation journeys/questions and Feature Family Tree share a future dependency model; they are not added mid-phase. Preserve schema1 catalogue/event history through additive adapters/migrations. diff --git a/PlotLine.Tests/Browser/writer3-investigations.cjs b/PlotLine.Tests/Browser/writer3-investigations.cjs new file mode 100644 index 00000000..3ee4539b --- /dev/null +++ b/PlotLine.Tests/Browser/writer3-investigations.cjs @@ -0,0 +1,15 @@ +const {chromium}=require('playwright'),assert=require('node:assert/strict'),fs=require('fs'); +const base=process.env.PD_INV_BASE||'http://127.0.0.1:5238',identity=process.env.PD_INV_IDENTITY?JSON.parse(fs.readFileSync(process.env.PD_INV_IDENTITY)):null,w=identity||{UserID:4,book:12,other:13,project:7}; +const report=JSON.parse(fs.readFileSync(process.env.PD_INV_COVERAGE||'Docs/Writer/Writer3/Evidence/Phase3D1/simulation.json'));const path=report.RepresentativePaths.find(p=>p.concern==='story'&&p.target==='motivation'&&p.recommendations.includes('motivation'));assert(path,'unexpected destination witness'); +(async()=>{const browser=await chromium.launch();try{for(const pwa of[false,true]){const c=await browser.newContext({viewport:{width:1440,height:1000}});await c.addInitScript(({user,pwa})=>{localStorage.setItem('plotdirector.desktop.v1.'+user,JSON.stringify({dismissedAt:Date.now()}));if(pwa)Object.defineProperty(navigator,'standalone',{value:true});},{user:w.UserID,pwa});const p=await c.newPage(),errors=[],external=[];p.on('pageerror',e=>errors.push(e.message));p.on('request',r=>{if(/openai|anthropic|generativelanguage|inference/i.test(r.url()))external.push(r.url());});if(identity){await p.goto(base+'/Account/Login');await p.locator('[name=Email]').fill(w.Email);await p.locator('[name=Password]').fill(w.Password);await Promise.all([p.waitForURL('**/Projects'),p.locator('button[type=submit]').click()]);} +await p.goto(`${base}/Writer/Explore?projectId=${w.project}&bookId=${w.book}`);await p.getByRole('link',{name:'Explore a concern',exact:true}).click();assert((await p.locator('#investigation-question').textContent()).includes("What's troubling"));assert.equal(await p.locator('iframe').count(),0);if(process.env.PD_INV_SCREENSHOTS&&!pwa){fs.mkdirSync(process.env.PD_INV_SCREENSHOTS,{recursive:true});await p.screenshot({path:process.env.PD_INV_SCREENSHOTS+'/Explore-investigation-start.png'});} +await p.locator('[name=concern][value=story]').check();await p.getByRole('button',{name:'Begin',exact:true}).click();await p.locator('[data-investigation-answer]').waitFor();const id=new URL(p.url()).searchParams.get('id'),url=p.url();const explanation=p.locator('#investigation-explanation');await explanation.fill('Unfinished explanation retained for later');await p.getByRole('button',{name:'Save for later',exact:true}).click();assert.equal(await p.locator('#investigation-explanation').inputValue(),'Unfinished explanation retained for later'); +let firstQuestion;for(const entry of path.answers){const form=p.locator('[data-investigation-answer]');if(!await form.count())break;const current=await form.locator('[name=question]').inputValue();firstQuestion??=current;const expected=path.answers.find(x=>x.startsWith(current+'='));assert(expected,'dynamic current question is in deterministic witness');await form.locator(`[name=option][value="${expected.split('=')[1]}"]`).check();await form.locator('[name=explanation]').fill('Synthetic browser answer ');await form.locator('button[value=answer]').click();} +assert.equal(await p.locator('[data-investigation-answer]').count(),0);assert((await p.locator('#investigation-question').textContent()).includes('possible next step'));assert((await p.locator('body').textContent()).includes('Character'));assert.equal(external.length,0);const open=p.locator('form[action$="/Open"]').first();const formData=await open.evaluate(f=>Object.fromEntries(new FormData(f)));formData.capability=await open.locator('[name=capability]').getAttribute('value');const destination=await p.request.post(base+'/Writer/Explore/Investigate/Open',{form:formData,maxRedirects:0});assert.equal(destination.status(),302);assert(!destination.headers().location.toLowerCase().includes('solver'));assert(destination.headers().location.includes('projectId='+w.project));assert(destination.headers().location.includes('bookId='+w.book));await p.reload(); +if(process.env.PD_INV_SCREENSHOTS&&!pwa)await p.screenshot({path:process.env.PD_INV_SCREENSHOTS+'/Explore-investigation-result.png'}); +assert.equal((await p.request.get(`${base}/Writer/Explore/Investigate?bookId=${w.other}&id=${id}`)).status(),404);assert.equal((await p.request.post(base+'/Writer/Explore/Investigate/Start',{form:{bookId:String(w.book),concern:'story'},maxRedirects:0})).status(),400); +firstQuestion='motivation-4';await p.goto(url+'&question='+firstQuestion);const stale=await p.locator('[data-investigation-answer]').evaluate(f=>Object.fromEntries(new FormData(f)));stale.operation='answer';stale.option='unsure';stale.explanation='Keep this stale browser text';const q=await c.newPage();await q.goto(url+'&question='+firstQuestion);await q.locator('[name=option][value=yes]').check();await q.locator('button[value=answer]').click();await q.close();const conflict=await p.request.post(base+'/Writer/Explore/Investigate/Answer',{form:stale,maxRedirects:0});assert.equal(conflict.status(),409);assert((await conflict.text()).includes('Keep this stale browser text'));await p.goto(url);assert((await p.locator('body').textContent()).includes('questions answered')); +await p.setViewportSize({width:390,height:844});assert(await p.evaluate(()=>document.documentElement.scrollWidth<=innerWidth+2));await p.locator('[name=option]').first().focus();await p.keyboard.press('Space');assert(await p.locator('[name=option]').first().isChecked());if(process.env.PD_INV_SCREENSHOTS&&!pwa)await p.screenshot({path:process.env.PD_INV_SCREENSHOTS+'/Explore-investigation-narrow.png'});await p.locator('[data-help-key="writer3.investigations"] button').click();await p.locator('.plotline-help-popover').waitFor();await p.locator('.plotline-help-more').click();await p.locator('[data-help-content] .help-drawer-article').waitFor();await p.locator('[data-help-close]').click(); +if(!identity){assert.equal((await p.request.get(base+'/admin/writer-investigations')).status(),403);const other=await browser.newContext();await other.addCookies([{name:'fixture-user',value:'5',url:base}]);assert.equal((await other.request.get(url)).status(),404);await other.close();await c.addCookies([{name:'solver-reviewer',value:'true',url:base}]);assert.equal((await p.request.get(base+'/admin/writer-investigations')).status(),200);const diag=await(await p.request.get(`${base}/admin/writer-investigations/diagnostics?bookId=${w.book}&id=${id}`)).json();assert(diag.events.length>8);assert(diag.evaluation.candidates.length>0);const sim=await p.request.get(`${base}/admin/writer-investigations/simulator?bookId=${w.book}&id=${id}`);assert.equal(sim.status(),200);assert(!(await sim.text()).includes('matches: False'));const exp=await(await p.request.get(base+'/admin/writer-investigations/export')).json();assert(exp.Synthetic);assert.equal(diag.investigation.catalogueVersion,exp.Version);if(!pwa){const admin=await p.request.get(base+'/admin/writer-investigations');const token=(await admin.text()).match(/name="__RequestVerificationToken"[^>]*value="([^"]+)"/)[1];const bad=structuredClone(exp);bad.Questions[0].Options[0].Contributions[0].Weight=99;assert.equal((await p.request.post(base+'/admin/writer-investigations',{form:{json:JSON.stringify(bad),operation:'publish',__RequestVerificationToken:token}})).status(),400);assert.equal((await(await p.request.get(base+'/admin/writer-investigations/export')).json()).Version,exp.Version);exp.Version='synthetic-browser-next';assert.equal((await p.request.post(base+'/admin/writer-investigations',{form:{json:JSON.stringify(exp),operation:'publish',__RequestVerificationToken:token}})).status(),200);assert.equal((await(await p.request.get(base+'/admin/writer-investigations/export')).json()).Version,exp.Version);assert.notEqual((await(await p.request.get(`${base}/admin/writer-investigations/diagnostics?bookId=${w.book}&id=${id}`)).json()).investigation.catalogueVersion,exp.Version);} +} +assert.deepEqual(errors,[]);await c.close();}console.log('PASS Guided Investigation browser/simulated PWA: authenticated Explore, dynamic deterministic witness from general concern to character destination, saved unfinished explanation, resume, authored evidence summary, safe scoped destination, CSRF400, cross-book404, stale409 retained text, revision, narrow keyboard/radio/overflow, Markdown Help, no iframe or AI calls; isolated admin diagnostics/replay and cross-user controls where enabled.');}finally{await browser.close()}})().catch(e=>{console.error(e.stack);process.exitCode=1}); diff --git a/PlotLine.Tests/Browser/writer3-layout-explore.cjs b/PlotLine.Tests/Browser/writer3-layout-explore.cjs index 6a81aeb2..a7477a21 100644 --- a/PlotLine.Tests/Browser/writer3-layout-explore.cjs +++ b/PlotLine.Tests/Browser/writer3-layout-explore.cjs @@ -1,3 +1,3 @@ const{chromium}=require('playwright'),assert=require('node:assert/strict'); -(async()=>{const b=await chromium.launch();try{const p=await b.newPage({viewport:{width:1440,height:1000}});for(const destination of['Write','Explore','Plan','Review','Reflect']){const r=await p.goto(`http://127.0.0.1:5238/Writer/${destination}?projectId=7&bookId=12`);assert.equal(r.status(),200);await p.waitForFunction(()=>document.querySelector('.writer3')?.classList.contains('writer3-viewport'));await p.evaluate(async()=>{await document.fonts.ready;await new Promise(r=>setTimeout(r,50))});const normal=await p.evaluate(()=>({header:document.querySelector('.writer3-header').getBoundingClientRect().height,bottom:document.querySelector('.writer3-workspace').getBoundingClientRect().bottom,height:innerHeight}));assert(normal.header<85,'compact shared header');assert(normal.height-normal.bottom<12,'uses available viewport');await p.evaluate(()=>{document.documentElement.style.overflow='auto';document.documentElement.style.height='auto';document.body.style.overflow='visible';document.body.style.height='auto';document.body.style.minHeight='1800px';document.body.style.paddingTop='180px';window.scrollTo({top:150,behavior:'instant'});window.dispatchEvent(new Event('resize'));});await p.waitForFunction(()=>{const w=document.querySelector('.writer3-workspace');return Math.abs(innerHeight-w.getBoundingClientRect().bottom)<12});assert(await p.evaluate(()=>window.scrollY>100),'scrolled shell fixture');} +(async()=>{const b=await chromium.launch();try{const p=await b.newPage({viewport:{width:1440,height:1000}});for(const destination of['Write','Explore','Plan','Review','Reflect']){const r=await p.goto(`http://127.0.0.1:5238/Writer/${destination}?projectId=7&bookId=12`);assert.equal(r.status(),200);await p.waitForFunction(()=>document.querySelector('.writer3')?.classList.contains('writer3-viewport'));await p.evaluate(async()=>{await document.fonts.ready;await new Promise(r=>setTimeout(r,50))});const normal=await p.evaluate(()=>({header:document.querySelector('.writer3-header').getBoundingClientRect().height,bottom:document.querySelector('.writer3-workspace').getBoundingClientRect().bottom,height:innerHeight}));assert(normal.header<85,'compact shared header');if(destination!=='Review')assert(normal.height-normal.bottom<12,'uses available viewport');await p.evaluate(()=>{document.documentElement.style.overflow='auto';document.documentElement.style.height='auto';document.body.style.overflow='visible';document.body.style.height='auto';document.body.style.minHeight='1800px';document.body.style.paddingTop='180px';window.scrollTo({top:150,behavior:'instant'});window.dispatchEvent(new Event('resize'));});if(destination!=='Review')await p.waitForFunction(()=>{const w=document.querySelector('.writer3-workspace');return Math.abs(innerHeight-w.getBoundingClientRect().bottom)<12});else assert(await p.evaluate(()=>getComputedStyle(document.querySelector('.writer3-main')).overflowY==='visible'),'Review flows in document');assert(await p.evaluate(()=>window.scrollY>100),'scrolled shell fixture');} await p.goto('http://127.0.0.1:5238/Writer/Explore?projectId=7&bookId=12');const links=await p.locator('.writer3-explore-paths>a').evaluateAll(ns=>ns.map(n=>n.href));assert.equal(links.length,3);for(const href of links){const u=new URL(href);assert(!u.pathname.includes('problem-solver'));assert.equal(u.searchParams.get('projectId'),'7');assert.equal(u.searchParams.get('bookId'),'12');}assert.equal(new Set(links.map(x=>new URL(x).pathname)).size,3);assert.equal(await p.locator('iframe').count(),0);console.log('PASS five destinations compact viewport use and controlled scrolled-shell geometry; Explore has three distinct authenticated scoped tool routes and no public solver/iframe.');}finally{await b.close()}})().catch(e=>{console.error(e.stack);process.exitCode=1}); diff --git a/PlotLine.Tests/Browser/writer3-review-continuous.cjs b/PlotLine.Tests/Browser/writer3-review-continuous.cjs new file mode 100644 index 00000000..986da7b5 --- /dev/null +++ b/PlotLine.Tests/Browser/writer3-review-continuous.cjs @@ -0,0 +1,4 @@ +const{chromium}=require('playwright'),assert=require('node:assert/strict'),fs=require('fs'); +(async()=>{const b=await chromium.launch();try{for(const pwa of[false,true]){const p=await b.newPage({viewport:{width:1440,height:900}});if(pwa)await p.addInitScript(()=>Object.defineProperty(navigator,'standalone',{value:true}));for(const width of[1440,1024,390]){await p.setViewportSize({width,height:900});await p.goto('http://127.0.0.1:5238/Writer/Review?projectId=7&bookId=12&reader-long=true');await p.waitForFunction(()=>document.querySelector('.writer3')?.classList.contains('writer3-flow'));const dimensions=await p.evaluate(()=>{const main=document.querySelector('.writer3-main');return{overflow:getComputedStyle(main).overflowY,doc:document.documentElement.scrollHeight,main:main.clientHeight,mainScroll:main.scrollHeight,viewport:innerHeight}});assert.equal(dimensions.overflow,'visible');assert(dimensions.doc>dimensions.viewport+1500,'long manuscript extends document');assert(dimensions.main>=dimensions.mainScroll-3,'no manuscript nested scroll');await p.evaluate(()=>window.scrollTo({top:1400,behavior:'instant'}));assert(await p.evaluate(()=>scrollY>1000));assert.equal(await p.locator('.writer3-main').evaluate(n=>n.scrollTop),0);if(width>=1440){const top=await p.locator('.writer3-reference').evaluate(n=>n.getBoundingClientRect().top);assert(top>=0&&top<100,'companion remains accessible while manuscript scrolls');} +const anchor=await p.evaluate(()=>{const root=document.querySelector('.manuscript-reader'),restore=root.readerPreserveView();const visible=[...document.querySelectorAll('#reader-content [data-paragraph-id]')].find(n=>n.getBoundingClientRect().bottom>0),top=visible.getBoundingClientRect().top;document.querySelector('#reader-content').style.paddingTop='180px';restore();return{before:top,after:visible.getBoundingClientRect().top}});assert(Math.abs(anchor.before-anchor.after)<3,'Reader restores document anchor'); +await p.locator('#reader-focus').click();assert.equal(await p.locator('.manuscript-reader').getAttribute('data-focus'),'true');assert.equal(await p.locator('.manuscript-reader').evaluate(n=>getComputedStyle(n).overflowY),'auto');await p.locator('#reader-focus').click();assert.equal(await p.locator('.writer3-main').evaluate(n=>getComputedStyle(n).overflowY),'visible');await p.locator('#reader-content [data-paragraph-id]').nth(4).click();await p.locator('[data-review-record]').click();assert(await p.locator('[data-review-form]').isVisible());await p.locator('[data-review-cancel]').click();if(width===390)await p.keyboard.press('Escape');assert(await p.evaluate(()=>document.documentElement.scrollWidth<=innerWidth+2));}await p.close();}console.log('PASS continuous Review: long canonical Reader flows through document at1440/1024/390 in browser/simulated PWA; no nested manuscript scroll, document anchor restoration, Focused Reading and passage observation overlay retained.');}finally{await b.close()}})().catch(e=>{console.error(e.stack);process.exitCode=1}); diff --git a/PlotLine.Tests/Browser/writer3-workspace.cjs b/PlotLine.Tests/Browser/writer3-workspace.cjs index a40c9287..a766387f 100644 --- a/PlotLine.Tests/Browser/writer3-workspace.cjs +++ b/PlotLine.Tests/Browser/writer3-workspace.cjs @@ -72,10 +72,10 @@ const width=p=>p.locator('.writer3-reference').evaluate(n=>n.getBoundingClientRe for(const theme of ['modern-dark','modern-light','warm-dark','plotdirector'])for(const size of [{width:390,height:844},{width:1024,height:768},{width:1440,height:900},{width:1920,height:1080},{width:2560,height:1440}])for(const d of ['Write','Explore','Plan','Review','Reflect']){ await page.setViewportSize(size);const response=await page.goto(url(d));assert.equal(response.status(),200,`workspace ${d} HTTP status at ${page.url()}`);assert.equal(await page.locator('[data-ribbon-shell]').count(),1,`application shell missing at ${page.url()}`);await page.waitForFunction(()=>typeof window.PlotDirectorApplyApplicationTheme==='function').catch(e=>{throw new Error(`Theme helper unavailable: ${d}/${theme}/${size.width} at ${page.url()}; page errors: ${errors.join('; ')}; ${e.message}`)});await page.waitForFunction(()=>document.querySelector('.writer3').classList.contains('writer3-viewport'));await page.evaluate(t=>window.PlotDirectorApplyApplicationTheme(t),theme);await settle(page); const geometry=await page.evaluate(()=>({x:document.documentElement.scrollWidth-innerWidth,y:document.documentElement.scrollHeight-innerHeight,bottom:document.querySelector('.writer3-workspace').getBoundingClientRect().bottom,root:document.querySelector('.writer3').className,height:document.querySelector('.writer3').style.cssText})); - assert(geometry.x<=2,`${d}/${theme}/${size.width} horizontal overflow ${JSON.stringify(geometry)}`);assert(geometry.y<=3,`${d}/${theme}/${size.width} unnecessary page scroll ${JSON.stringify(geometry)}`); - assert(geometry.bottom<=size.height+2);combinations++; + assert(geometry.x<=2,`${d}/${theme}/${size.width} horizontal overflow ${JSON.stringify(geometry)}`);if(d!=='Review')assert(geometry.y<=3,`${d}/${theme}/${size.width} unnecessary page scroll ${JSON.stringify(geometry)}`);else assert.equal(await page.locator('.writer3-main').evaluate(n=>getComputedStyle(n).overflowY),'visible'); + if(d!=='Review')assert(geometry.bottom<=size.height+2);combinations++; } - await page.setViewportSize({width:1440,height:1000});await page.goto(url('Review'));await settle(page); + await page.setViewportSize({width:1440,height:1000});await page.goto(url('Write'));await settle(page); if(await page.locator('[data-ribbon-shell]').getAttribute('data-collapsed')==='true'){await page.locator('[data-ribbon-collapse]').click();await page.waitForFunction(()=>!document.querySelector('[data-ribbon-collapse]').disabled);await settle(page);} const before=await page.locator('.writer3-split').evaluate(n=>n.clientHeight); // Drive real shell collapse; isolate fixture appearance persistence from unrelated endpoint absence. diff --git a/PlotLine.Tests/InvestigationMemoryRepository.cs b/PlotLine.Tests/InvestigationMemoryRepository.cs new file mode 100644 index 00000000..03ffd89a --- /dev/null +++ b/PlotLine.Tests/InvestigationMemoryRepository.cs @@ -0,0 +1,17 @@ +using System.Text.Json; +using PlotLine.Data; +using PlotLine.Models.Investigations; +using PlotLine.Services.Investigations; +// Isolated transport fixture. SQL isolation/concurrency/cascades are also qualified against Development separately. +internal sealed class InvestigationMemoryRepository:IInvestigationRepository +{ + readonly Dictionary catalogues=[];readonly Dictionary rows=[];readonly Dictionary> events=[];readonly object sync=new();string current=""; + public InvestigationMemoryRepository(){var json=File.ReadAllText("Docs/Writer/Investigations/synthetic-catalogue.json");var c=CatalogueValidator.Parse(json);catalogues[c.Version]=json;current=c.Version;} + public Task Catalogue(string? version=null){lock(sync)return Task.FromResult(catalogues.TryGetValue(version??current,out var json)?CatalogueValidator.Parse(json):null);} + public Task Publish(string json,string actor){lock(sync){var c=CatalogueValidator.Parse(json);if(catalogues.ContainsKey(c.Version))throw new ArgumentException("Version already exists.");catalogues[c.Version]=json;current=c.Version;}return Task.CompletedTask;} + public Task> List(int user,int book){lock(sync)return Task.FromResult>(rows.Values.Select(Parse).Where(i=>i.UserID==user&&i.BookID==book).OrderByDescending(i=>i.UpdatedUtc).ToArray());} + public Task Read(int user,int book,Guid id){lock(sync){var i=rows.TryGetValue(id,out var json)?Parse(json):null;return Task.FromResult(i?.UserID==user&&i.BookID==book?i:null);}} + public Task Save(Investigation i,int expected,string operation,Evaluation result){lock(sync){if(rows.TryGetValue(i.ID,out var old)){var prior=Parse(old);if(prior.Version!=expected||prior.UserID!=i.UserID||prior.BookID!=i.BookID)throw new ArgumentException("Stale or unavailable investigation");}else if(expected!=0)throw new ArgumentException("Missing investigation");i.Version=expected+1;rows[i.ID]=JsonSerializer.Serialize(i,CatalogueValidator.Json);if(!events.ContainsKey(i.ID))events[i.ID]=[];events[i.ID].Add(JsonSerializer.Serialize(new{operation,state=i,evaluation=result},CatalogueValidator.Json));}return Task.CompletedTask;} + public Task Replay(int user,int book,Guid id){lock(sync){if(!rows.TryGetValue(id,out var json)||Parse(json).UserID!=user||Parse(json).BookID!=book)throw new UnauthorizedAccessException();return Task.FromResult(events[id].ToArray());}} + static Investigation Parse(string json)=>JsonSerializer.Deserialize(json,CatalogueValidator.Json)!; +} diff --git a/PlotLine.Tests/InvestigationTests.cs b/PlotLine.Tests/InvestigationTests.cs new file mode 100644 index 00000000..f2d5b1e3 --- /dev/null +++ b/PlotLine.Tests/InvestigationTests.cs @@ -0,0 +1,61 @@ +using System.Text.Json; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.FileProviders; +using PlotLine.Models.Investigations; +using PlotLine.Services.Investigations; +internal static class InvestigationTests +{ + static string Root {get{var p=new DirectoryInfo(Directory.GetCurrentDirectory());while(p!=null&&!File.Exists(Path.Combine(p.FullName,"PlotLine.slnx")))p=p.Parent;return p?.FullName??throw new Exception("Repository not found");}} + static Catalogue Load()=>CatalogueValidator.Parse(File.ReadAllText(Path.Combine(Root,"Docs/Writer/Investigations/synthetic-catalogue.json"))); + static void Check(bool b,string s){if(!b)throw new Exception(s);} + static void Reject(Action a){try{a();}catch(ArgumentException){return;}throw new Exception("Invalid catalogue accepted");} + static HashSet All(Catalogue c)=>c.Capabilities.Select(d=>d.Id).ToHashSet(); + static Evaluation E(Catalogue c,IEnumerable a,string concern="story",ISet? caps=null)=>InvestigationEngine.Evaluate(c,concern,a,caps??All(c)); + public static void Run() + { + var c=Load();var start=E(c,[]);Check(start.AnswerCount==0&&start.NextQuestion!=null&&start.Recommendations.Count==0,"starting state");Check(E(c,[],"character").Hypotheses[0].Id=="motivation","concern activates prior"); + var positive=E(c,[new("motivation-1","yes")]);Check(positive.Hypotheses.Single(h=>h.Id=="motivation").Support==3,"weighted positive");var negative=E(c,[new("motivation-1","no")]);Check(negative.Hypotheses.Single(h=>h.Id=="motivation").Opposition==-3,"negative evidence"); + var duplicate=E(c,[new("motivation-1","yes"),new("motivation-2","yes")]);Check(duplicate.Hypotheses.Single(h=>h.Id=="motivation").Support==3&&duplicate.RedundantContributions==1,"redundancy capped");Check(!duplicate.Hypotheses.Single(h=>h.Id=="motivation").Supported,"same dimension not confident"); + var corroboration=E(c,[new("motivation-1","yes"),new("motivation-3","yes")]);Check(corroboration.Hypotheses.Single(h=>h.Id=="motivation").Groups==2&&!corroboration.Hypotheses.Single(h=>h.Id=="motivation").Supported,"challenge and competitor required"); + var a=new List{new("motivation-1","yes"),new("motivation-2","no"),new("motivation-3","yes"),new("motivation-4","no"),new("change-1","no")};var conflict=E(c,a);Check(conflict.Hypotheses.Single(h=>h.Id=="motivation").Conflicts.Length==1,"genuine same-aspect conflict");Check(conflict.NextQuestion=="motivation-clarify","clarification selected"); + a.Add(new("motivation-clarify","aspects"));Check(E(c,a).Hypotheses.Single(h=>h.Id=="motivation").Conflicts.Length==0,"explicit distinct aspects"); + var revised=E(c,[new("motivation-1","yes"),new("motivation-1","no")]);Check(revised.Hypotheses.Single(h=>h.Id=="motivation").Support==0&&revised.Hypotheses.Single(h=>h.Id=="motivation").Opposition==-3,"superseded evidence removed"); + Check(JsonSerializer.Serialize(E(c,a))==JsonSerializer.Serialize(E(c,a)),"deterministic replay");Check(E(c,[]).Candidates.All(q=>!q.Id.EndsWith("clarify")),"prerequisites exclude clarification"); + var uncertain=c.Questions.Where(q=>q.Purpose!="Clarification").Take(12).Select(q=>new Answer(q.Id,"unsure")).ToArray();Check(E(c,uncertain).Recommendations.Count==0&&E(c,uncertain).NextQuestion==null,"bounded insufficient evidence"); + Check(E(c,[new("motivation-1","yes")]).Recommendations.Count==0,"not early threshold");Check(DestinationRegistry.Resolve(c.Capabilities[0],1,2,false,new Dictionary())==null,"unauthorised destination denied");Check(DestinationRegistry.Resolve(c.Capabilities[0],1,0,true,new Dictionary())==null,"missing book denied");var dest=DestinationRegistry.Resolve(c.Capabilities[0],1,2,true,new Dictionary());Check(dest?.Controller=="Characters","authenticated resolver"); + var invalid=Load();invalid.Questions[0].Id=invalid.Questions[1].Id;Reject(()=>CatalogueValidator.Validate(invalid));invalid=Load();invalid.Questions[0].Options[0].Contributions[0].Weight=4;Reject(()=>CatalogueValidator.Validate(invalid));invalid=Load();invalid.Capabilities[0].Resolver="https://public.example";Reject(()=>CatalogueValidator.Validate(invalid));invalid=Load();invalid.Questions[0].Eligibility.AllAnswers[invalid.Questions[0].Id]=["yes"];Reject(()=>CatalogueValidator.Validate(invalid));invalid=Load();invalid.Hypotheses[0].Capabilities=["missing"];Reject(()=>CatalogueValidator.Validate(invalid));invalid=Load();invalid.SchemaVersion=2;Reject(()=>CatalogueValidator.Validate(invalid));Reject(()=>CatalogueValidator.Parse("{\"Questions\":null}")); + var i=new Investigation{Concern="story",Presented=["motivation-1"],Answers=[new("motivation-1","yes")]};InvestigationService.Answer(i,c,"motivation-1","no","Changed my understanding");Check(i.Answers.Count==1&&i.Answers[0].Option=="no","in-place answer revision");Reject(()=>InvestigationService.Answer(i,c,"change-1","yes",null));var round=JsonSerializer.Deserialize(JsonSerializer.Serialize(i,CatalogueValidator.Json),CatalogueValidator.Json)!;Check(round.Answers.SequenceEqual(i.Answers),"persistence round trip"); + var supportedAnswers=new List{new("motivation-1","yes"),new("motivation-2","yes"),new("motivation-3","yes"),new("motivation-4","no"),new("change-1","no"),new("change-2","no"),new("connections-1","no"),new("organisation-1","no")}; + Check(E(c,supportedAnswers).Recommendations.Contains("motivation"),"independent corroboration + challenge permits recommendation");Check(E(c,supportedAnswers,caps:new HashSet()).Outcome=="No suitable destination currently available","destination becoming unavailable is explicit"); + var withTool=E(c,supportedAnswers);var withoutTool=E(c,supportedAnswers,caps:new HashSet());Check(withTool.Hypotheses.Select(h=>(h.Id,h.Support,h.Opposition,h.Score,h.Dimensions,h.Groups,h.Challenged,h.Supported)).SequenceEqual(withoutTool.Hypotheses.Select(h=>(h.Id,h.Support,h.Opposition,h.Score,h.Dimensions,h.Groups,h.Challenged,h.Supported))),"missing prerequisites do not change diagnostic evidence"); + var continued=InvestigationEngine.Evaluate(c,"story",supportedAnswers,All(c),10);Check(continued.NextQuestion!=null&&continued.Recommendations.Count==0,"author requests further investigation"); + supportedAnswers.RemoveAll(a=>a.Question.StartsWith("motivation-"));supportedAnswers.AddRange(new Answer[]{new("motivation-1","no"),new("motivation-2","no"),new("motivation-3","no"),new("motivation-4","yes")});Check(!E(c,supportedAnswers).Recommendations.Contains("motivation"),"revision changes recommendation"); + var ambiguous=new List{new("motivation-1","yes"),new("motivation-3","yes"),new("motivation-4","no"),new("change-1","yes"),new("change-3","yes"),new("change-4","no"),new("connections-1","no"),new("organisation-1","no")};Check(E(c,ambiguous,"next").Recommendations.Count==2,"two supported plausible explanations"); + invalid=Load();invalid.Questions[0].Eligibility.AllAnswers[invalid.Questions[1].Id]=["yes"];invalid.Questions[1].Eligibility.AllAnswers[invalid.Questions[0].Id]=["yes"];Reject(()=>CatalogueValidator.Validate(invalid)); + var env=new TestEnvironment{EnvironmentName="Production"};Check(!new InvestigationAccess(env,new ConfigurationBuilder().AddInMemoryCollection(new Dictionary{{"WriterInvestigations:Enabled","true"}}).Build()).Enabled,"Production cannot enable synthetic experience");env.EnvironmentName="Development";Check(new InvestigationAccess(env,new ConfigurationBuilder().Build()).Enabled,"Development preview enabled"); + var report=Simulate();Check(report.UnreachableHypotheses.Length==0&&report.UnreachableDestinations.Length==0,"all hypotheses/destinations reachable"); + } + sealed class TestEnvironment:Microsoft.AspNetCore.Hosting.IWebHostEnvironment {public string EnvironmentName{get;set;}="";public string ApplicationName{get;set;}="";public string WebRootPath{get;set;}="";public IFileProvider WebRootFileProvider{get;set;}=new NullFileProvider();public string ContentRootPath{get;set;}="";public IFileProvider ContentRootFileProvider{get;set;}=new NullFileProvider();} + public sealed record Coverage(int SchemaVersion,int Paths,int Steps,string[] Hypotheses,string[] Destinations,string[] UnreachableHypotheses,string[] UnreachableDestinations,int RepeatedQuestions,int Loops,int PrematureRecommendations,int InvalidDestinations,int NonDeterministic,List RepresentativePaths); + public static Coverage Simulate(string? output=null) + { + var c=Load();var hypotheses=new HashSet();var destinations=new HashSet();var paths=new List();int total=0,steps=0,repeats=0,loops=0,premature=0,invalid=0,nondeterministic=0;var random=new Random(31701); + // Every concern × target plus seeded adversarial/random/uncertain paths. No network/database/AI. + foreach(var concern in c.Concerns)foreach(var target in c.Hypotheses.Select(h=>h.Id).Concat(["uncertain","alternating","random"]))for(int seed=0;seed<(target=="random"?50:1);seed++) + { + total++;var answers=new List();var seen=new HashSet();Evaluation state=E(c,answers,concern.Id);var trace=new List(); + for(int n=0;n<=c.MaxAnswers;n++){ + if(JsonSerializer.Serialize(state)!=JsonSerializer.Serialize(E(c,answers,concern.Id)))nondeterministic++; + if(state.NextQuestion==null)break;if(n==c.MaxAnswers){loops++;break;}if(!seen.Add(state.NextQuestion)){repeats++;break;} + var q=c.Questions.Single(q=>q.Id==state.NextQuestion);AnswerOption option; + if(target=="uncertain")option=q.Options.First(o=>o.Uncertain);else if(target=="alternating")option=q.Options[n%q.Options.Count];else if(target=="random")option=q.Options[random.Next(q.Options.Count)];else option=q.Options.OrderByDescending(o=>o.Contributions.Sum(e=>e.Hypothesis==target?e.Weight*20:-Math.Max(0,e.Weight))+(o.Interpretation=="different-aspects"?1:0)).ThenBy(o=>o.Id,StringComparer.Ordinal).First(); + answers.Add(new(q.Id,option.Id));trace.Add(q.Id+"="+option.Id);steps++;state=E(c,answers,concern.Id); + if(state.Recommendations.Count>0&&answers.Countx.Id==h).Capabilities){var d=c.Capabilities.Single(x=>x.Id==cap);if(DestinationRegistry.Resolve(d,1,2,true,answers.ToDictionary(a=>a.Question))==null)invalid++;else destinations.Add(cap);}} + if(target!="random")paths.Add(new{concern=concern.Id,target,answers=trace,outcome=state.Outcome,recommendations=state.Recommendations,eligibility=state.Hypotheses}); + } + var report=new Coverage(1,total,steps,hypotheses.Order().ToArray(),destinations.Order().ToArray(),c.Hypotheses.Select(h=>h.Id).Except(hypotheses).ToArray(),c.Capabilities.Select(d=>d.Id).Except(destinations).ToArray(),repeats,loops,premature,invalid,nondeterministic,paths); + if(output!=null)File.WriteAllText(output,JsonSerializer.Serialize(report,CatalogueValidator.Json));Check(repeats+loops+premature+invalid+nondeterministic==0,"simulation safety invariant");return report; + } +} diff --git a/PlotLine.Tests/Program.cs b/PlotLine.Tests/Program.cs index 82ff407a..39df49ba 100644 --- a/PlotLine.Tests/Program.cs +++ b/PlotLine.Tests/Program.cs @@ -15,6 +15,7 @@ using PlotLine.Models; using PlotLine.Services; using PlotLine.ViewModels; +if(args.Contains("--writer-investigation-sim")){InvestigationTests.Run();var output=args.SkipWhile(x=>x!="--writer-investigation-sim").Skip(1).FirstOrDefault();var report=InvestigationTests.Simulate(output);Console.WriteLine($"PASS investigation simulation: {report.Paths} paths, {report.Steps} answers; all hypotheses and destinations reachable; no loops/repeats/premature/invalid/non-deterministic outcomes.");return;} if(args.Contains("--map-topology-database")){await MapGeographicHierarchyDatabaseTests.Run(args.Last(),true);return;} if(args.Contains("--map-topology")){MapTopologyTests.Run();return;} if(args.Contains("--map-geography-hierarchy-database")){await MapGeographicHierarchyDatabaseTests.Run(args.Last());return;} @@ -170,6 +171,7 @@ var tests = new (string Name, Action Test)[] ("Release triage and browser-only onboarding preserve author decisions", ReleaseSprintTests.Run), ("Approved native import source and confirmation remain safe", () => NativeImportTests.Run().GetAwaiter().GetResult()), ("Native installation renewal and revocation remain account/security scoped", () => NativeInstallationTests.Run().GetAwaiter().GetResult()), + ("Guided investigation evidence, validation, revision and deterministic simulation",()=>InvestigationTests.Run()), ("Review accepted anchors, immutable provenance and author decisions",()=>WriterReviewTests.Run()), ("Writer Word verified navigation and acknowledgement",()=>WriterWordTests.Run().GetAwaiter().GetResult()), ("Writer inline authoring validation",()=>WriterAuthoringTests.Run()), diff --git a/PlotLine.Tests/Sql/WriterInvestigationsRegression.sql b/PlotLine.Tests/Sql/WriterInvestigationsRegression.sql new file mode 100644 index 00000000..38318d7d --- /dev/null +++ b/PlotLine.Tests/Sql/WriterInvestigationsRegression.sql @@ -0,0 +1,44 @@ +-- Development only; migration273 and synthetic catalogue required. All test writes roll back. +IF DB_NAME()<>N'PlotDirector_Development' THROW 51000,'Wrong database',1; +DECLARE @u int=TRY_CONVERT(int,SESSION_CONTEXT(N'InvestigationTestUserID')),@b int=TRY_CONVERT(int,SESSION_CONTEXT(N'InvestigationTestBookID')),@p int=TRY_CONVERT(int,SESSION_CONTEXT(N'InvestigationTestProjectID')),@otherbook int=TRY_CONVERT(int,SESSION_CONTEXT(N'InvestigationTestOtherBookID')); +IF @u IS NULL OR @b IS NULL OR @p IS NULL OR @otherbook IS NULL THROW 51000,'Configure disposable fixture session context first',1; +IF NOT EXISTS(SELECT 1 FROM dbo.Projects p JOIN dbo.ProjectUserAccess a ON a.ProjectID=p.ProjectID WHERE p.ProjectID=@p AND p.ProjectName=N'Disposable Writer Audit 20261116' AND a.UserID=@u AND a.AccessRole=N'Owner') THROW 51000,'Disposable fixture guard failed',1; +DECLARE @id uniqueidentifier=NEWID(),@json nvarchar(max),@event nvarchar(max)=N'{"test":true}'; +SET @json=(SELECT @id ID,@u UserID,@b BookID,@p ProjectID,'synthetic-3d1-v1' CatalogueVersion,1 Version,'story' Concern FOR JSON PATH,WITHOUT_ARRAY_WRAPPER); +BEGIN TRANSACTION; +EXEC dbo.WriterInvestigation @Action='save',@UserID=@u,@BookID=@b,@ProjectID=@p,@ID=@id,@CatalogueVersion='synthetic-3d1-v1',@ExpectedVersion=0,@Json=@json,@Event=@event; +SET @json=JSON_MODIFY(@json,'$.Version',2); +EXEC dbo.WriterInvestigation @Action='save',@UserID=@u,@BookID=@b,@ProjectID=@p,@ID=@id,@CatalogueVersion='synthetic-3d1-v1',@ExpectedVersion=1,@Json=@json,@Event=@event; +IF (SELECT COUNT(*) FROM dbo.WriterInvestigationEvents WHERE InvestigationID=@id)<>2 THROW 51001,'Event history missing',1; +IF NOT EXISTS(SELECT 1 FROM dbo.WriterInvestigations WHERE ID=@id AND Version=2 AND CatalogueVersion='synthetic-3d1-v1') THROW 51001,'Resume/version state lost',1; +EXEC dbo.WriterInvestigation @Action='read',@UserID=@u,@BookID=@b,@ID=@id; +ROLLBACK; +SELECT 'PASS persisted update/resume, immutable catalogue binding, atomic event history; rollback clean' Result; +BEGIN TRY + BEGIN TRANSACTION; + SET @json=JSON_MODIFY(@json,'$.Version',1); + EXEC dbo.WriterInvestigation @Action='save',@UserID=@u,@BookID=@b,@ProjectID=@p,@ID=@id,@CatalogueVersion='synthetic-3d1-v1',@ExpectedVersion=0,@Json=@json,@Event=@event; + SET @json=JSON_MODIFY(@json,'$.Version',3); + EXEC dbo.WriterInvestigation @Action='save',@UserID=@u,@BookID=@b,@ProjectID=@p,@ID=@id,@CatalogueVersion='synthetic-3d1-v1',@ExpectedVersion=2,@Json=@json,@Event=@event; + THROW 51001,'Stale save accepted',1; +END TRY BEGIN CATCH IF XACT_STATE()<>0 ROLLBACK;IF ERROR_NUMBER()<>51002 THROW; END CATCH; +IF EXISTS(SELECT 1 FROM dbo.WriterInvestigations WHERE ID=@id) THROW 51001,'Stale rollback leaked',1; +SELECT 'PASS stale optimistic save rejected without leaked history' Result; +BEGIN TRY EXEC dbo.WriterInvestigation @Action='read',@UserID=@u,@BookID=@otherbook,@ID=@id;THROW 51001,'Cross-book read accepted',1;END TRY BEGIN CATCH IF ERROR_NUMBER()<>51000 THROW;END CATCH; +SELECT 'PASS cross-book identity denied' Result; +BEGIN TRY + BEGIN TRANSACTION; + EXEC dbo.User_Create @Email=N'investigation-other-disposable@example.invalid',@DisplayName=N'Disposable investigation SQL actor',@PasswordHash=N'not-a-login-hash',@EmailConfirmed=1; + DECLARE @otheruser int=(SELECT UserID FROM dbo.AppUser WHERE Email=N'investigation-other-disposable@example.invalid'); + INSERT dbo.ProjectUserAccess(ProjectID,UserID,AccessRole,IsActive) VALUES(@p,@otheruser,N'Collaborator',1); + SET @json=JSON_MODIFY(@json,'$.Version',1); + EXEC dbo.WriterInvestigation @Action='save',@UserID=@u,@BookID=@b,@ProjectID=@p,@ID=@id,@CatalogueVersion='synthetic-3d1-v1',@ExpectedVersion=0,@Json=@json,@Event=@event; + EXEC dbo.WriterInvestigation @Action='read',@UserID=@otheruser,@BookID=@b,@ID=@id; + THROW 51001,'Other project member read private investigation',1; +END TRY BEGIN CATCH IF XACT_STATE()<>0 ROLLBACK;IF ERROR_NUMBER()<>51000 THROW; END CATCH; +SELECT 'PASS private investigation denied to another active project member; rollback clean' Result; +BEGIN TRY + DECLARE @catalogue nvarchar(max)=(SELECT Json FROM dbo.WriterInvestigationCatalogues WHERE Version='synthetic-3d1-v1'); + EXEC dbo.WriterInvestigationCatalogue @Action='publish',@Version='synthetic-3d1-v1',@Json=@catalogue,@Actor=N'test';THROW 51001,'Published version overwritten',1; +END TRY BEGIN CATCH IF ERROR_NUMBER()<>51002 THROW;END CATCH; +SELECT 'PASS catalogue version overwrite rejected' Result; diff --git a/PlotLine.Tests/ToolbarBrowserHost.cs b/PlotLine.Tests/ToolbarBrowserHost.cs index 1c289fc0..6effb445 100644 --- a/PlotLine.Tests/ToolbarBrowserHost.cs +++ b/PlotLine.Tests/ToolbarBrowserHost.cs @@ -124,9 +124,13 @@ internal static class ToolbarBrowserHost public static async Task RunAsync() { - var builder = WebApplication.CreateBuilder(new WebApplicationOptions { ApplicationName = typeof(ToolbarController).Assembly.FullName, ContentRootPath = Path.GetFullPath("PlotLine") }); + var builder = WebApplication.CreateBuilder(new WebApplicationOptions { EnvironmentName = "Development", ApplicationName = typeof(ToolbarController).Assembly.FullName, ContentRootPath = Path.GetFullPath("PlotLine") }); builder.Services.AddControllersWithViews().AddApplicationPart(typeof(ToolbarController).Assembly); builder.Services.AddSignalR(); + builder.Services.AddScoped(); + builder.Services.AddSingleton(); + builder.Services.AddScoped(); + builder.Services.AddSingleton(TimeProvider.System); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(FixtureProxy((name, args) => throw new NotSupportedException(name))); diff --git a/PlotLine/Controllers/WriterInvestigationsController.cs b/PlotLine/Controllers/WriterInvestigationsController.cs new file mode 100644 index 00000000..e990b23a --- /dev/null +++ b/PlotLine/Controllers/WriterInvestigationsController.cs @@ -0,0 +1,53 @@ +using System.Security.Claims; +using System.Text.Json; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using PlotLine.Data; +using PlotLine.Models.Investigations; +using PlotLine.Services.Investigations; +namespace PlotLine.Controllers; +[Authorize] +[ResponseCache(NoStore=true,Location=ResponseCacheLocation.None)] +public sealed class WriterInvestigationsController(InvestigationAccess gate,IInvestigationRepository repository,InvestigationService service):Controller +{ + int Author=>int.Parse(User.FindFirstValue(ClaimTypes.NameIdentifier)!); + async Task Guard(Func> run){if(!gate.Enabled)return NotFound();Response.Headers["X-Robots-Tag"]="noindex, nofollow, noarchive";try{return await run();}catch(Exception e)when(e is UnauthorizedAccessException or KeyNotFoundException){return NotFound();}catch(Microsoft.Data.SqlClient.SqlException e)when(e.Number==51000){return NotFound();}catch(Microsoft.Data.SqlClient.SqlException e)when(e.Number==51002){Response.StatusCode=409;ViewData["Failure"]=e.Message;return View("Failure");}catch(ArgumentException e){Response.StatusCode=400;ViewData["Failure"]=e.Message;return View("Failure");}catch(Exception e)when(e is Microsoft.Data.SqlClient.SqlException or TimeoutException){Response.StatusCode=503;ViewData["Failure"]="Investigations are temporarily unavailable. No unconfirmed save should be assumed successful. Return to Explore to resume.";return View("Failure");}} + [HttpGet("/Writer/Explore/Investigate")] + public Task Index(int bookId,Guid? id,string? question=null)=>Guard(async()=>{ + var project=await service.Project(bookId);Catalogue c;Investigation? row=null;Evaluation? state=null; + if(id.HasValue){(row,c)=await service.Read(Author,bookId,id.Value);state=service.Current(c,row);if(question!=null&&!row.Presented.Contains(question))return BadRequest();ViewData["Question"]=question??state.NextQuestion;} + else c=await repository.Catalogue()??throw new ArgumentException("The test catalogue is not available yet."); + return View(new InvestigationPage(row,c,state,await repository.List(Author,bookId),project,bookId)); + }); + [HttpPost("/Writer/Explore/Investigate/Start"),ValidateAntiForgeryToken] + public Task Start(int bookId,string concern)=>Guard(async()=>{var row=await service.Start(Author,bookId,concern);return RedirectToAction(nameof(Index),new{bookId,id=row.ID});}); + [HttpPost("/Writer/Explore/Investigate/Answer"),ValidateAntiForgeryToken] + public Task Answer(int bookId,Guid id,int version,string? question,string? option,string? explanation,string operation="answer")=>Guard(async()=>{ + ViewData["Explanation"]=explanation;ViewData["Option"]=option;var(i,c)=await service.Read(Author,bookId,id);if(version!=i.Version){Response.StatusCode=409;ViewData["Failure"]="Another window changed this investigation. Your answer is retained below. Resume the latest version before submitting again.";ViewData["Explanation"]=explanation;ViewData["Option"]=option;return View("Failure");} + if((operation is "answer" or "save")&&option!=null){InvestigationService.Answer(i,c,question??"",option??"",explanation);} + else if(operation is "further" or "disagree"){i.Accepted=false;i.ContinueUntil=Math.Min(c.MaxAnswers,i.Answers.Count+2);} + else if(operation=="accept")i.Accepted=true; + else if(operation=="save"){if((explanation?.Length??0)>2000)throw new ArgumentException("Please keep your explanation within2,000 characters.");i.DraftQuestion=question;i.DraftExplanation=explanation;} + else throw new ArgumentException("Choose an answer before continuing."); + await service.Persist(i,c,version,operation); + return RedirectToAction(nameof(Index),new{bookId,id,question=operation=="disagree"&&i.CurrentQuestion==null?i.Answers.LastOrDefault()?.Question:null,saved=operation=="save"?true:(bool?)null}); + }); + [HttpPost("/Writer/Explore/Investigate/Open"),ValidateAntiForgeryToken] + public Task Open(int bookId,Guid id,int version,string capability)=>Guard(async()=>{ + var(i,c)=await service.Read(Author,bookId,id);if(version!=i.Version)throw new ArgumentException("Resume the latest version before opening a tool.");var result=service.Current(c,i);var d=c.Capabilities.SingleOrDefault(d=>d.Id==capability); + if(d==null||!result.Recommendations.Any(h=>c.Hypotheses.Single(x=>x.Id==h).Capabilities.Contains(capability)))throw new ArgumentException("This destination is not currently recommended."); + var target=DestinationRegistry.Resolve(d,i.ProjectID,i.BookID,true,i.Answers.ToDictionary(a=>a.Question));if(target==null)throw new ArgumentException("This tool is unavailable. Your investigation is retained."); + i.SelectedDestination=capability;await service.Persist(i,c,version,"open-destination");TempData["InvestigationReturn"] = Url.Action(nameof(Index),new{bookId,id}); + return RedirectToAction(target.Value.Action,target.Value.Controller,target.Value.Values); + }); + [Authorize(Policy="AdminOnly"),HttpGet("/admin/writer-investigations")] + public Task Admin()=>Guard(async()=>View("Admin",await repository.Catalogue())); + [Authorize(Policy="AdminOnly"),HttpPost("/admin/writer-investigations"),ValidateAntiForgeryToken,RequestSizeLimit(1_200_000)] + public Task Import(string json,string operation)=>Guard(async()=>{var c=CatalogueValidator.Parse(json);if(operation=="publish")await repository.Publish(JsonSerializer.Serialize(c,CatalogueValidator.Json),User.Identity?.Name??"administrator");ViewData["Message"]=operation=="publish"?"New immutable catalogue version published.":"Validation passed; nothing written.";return View("Admin",c);}); + [Authorize(Policy="AdminOnly"),HttpGet("/admin/writer-investigations/export")] + public Task Export(string? version)=>Guard(async()=>Content(JsonSerializer.Serialize(await repository.Catalogue(version),CatalogueValidator.Json),"application/json")); + [Authorize(Policy="AdminOnly"),HttpGet("/admin/writer-investigations/simulator")] + public Task Simulator(int bookId,Guid id)=>Guard(async()=>{var(i,c)=await service.Read(Author,bookId,id);ViewData["Events"]=await repository.Replay(Author,bookId,id);return View("Simulator",new InvestigationPage(i,c,service.Current(c,i),[],i.ProjectID,i.BookID));}); + [Authorize(Policy="AdminOnly"),HttpGet("/admin/writer-investigations/diagnostics")] + public Task Diagnostics(int bookId,Guid id)=>Guard(async()=>{var(i,c)=await service.Read(Author,bookId,id);return Json(new{investigation=i,evaluation=service.Current(c,i),destinations=c.Capabilities,events=await repository.Replay(Author,bookId,id)});}); +} diff --git a/PlotLine/Data/InvestigationRepository.cs b/PlotLine/Data/InvestigationRepository.cs new file mode 100644 index 00000000..fc63d162 --- /dev/null +++ b/PlotLine/Data/InvestigationRepository.cs @@ -0,0 +1,18 @@ +using System.Data; +using System.Text.Json; +using Dapper; +using PlotLine.Models.Investigations; +using PlotLine.Services.Investigations; +namespace PlotLine.Data; +public interface IInvestigationRepository +{Task Catalogue(string? version=null);Task Publish(string json,string actor);Task> List(int user,int book);Task Read(int user,int book,Guid id);Task Save(Investigation row,int expected,string operation,Evaluation result);Task Replay(int user,int book,Guid id);} +public sealed class InvestigationRepository(ISqlConnectionFactory factory):IInvestigationRepository +{ + public async Task Catalogue(string? version=null){using var db=factory.CreateConnection();var json=await db.QuerySingleOrDefaultAsync("dbo.WriterInvestigationCatalogue",new{Action="read",Version=version},commandType:CommandType.StoredProcedure);return json==null?null:CatalogueValidator.Parse(json);} + public async Task Publish(string json,string actor){var c=CatalogueValidator.Parse(json);using var db=factory.CreateConnection();await db.ExecuteAsync("dbo.WriterInvestigationCatalogue",new{Action="publish",c.Version,Json=json,Actor=actor},commandType:CommandType.StoredProcedure);} + public async Task> List(int user,int book){using var db=factory.CreateConnection();return (await db.QueryAsync("dbo.WriterInvestigation",new{Action="list",UserID=user,BookID=book},commandType:CommandType.StoredProcedure)).Select(Parse).ToArray();} + public async Task Read(int user,int book,Guid id){using var db=factory.CreateConnection();var json=await db.QuerySingleOrDefaultAsync("dbo.WriterInvestigation",new{Action="read",UserID=user,BookID=book,ID=id},commandType:CommandType.StoredProcedure);return json==null?null:Parse(json);} + public async Task Save(Investigation row,int expected,string operation,Evaluation result){using var db=factory.CreateConnection();row.Version=expected+1;await db.ExecuteAsync("dbo.WriterInvestigation",new{Action="save",row.UserID,row.ProjectID,row.BookID,row.ID,row.CatalogueVersion,ExpectedVersion=expected,Json=JsonSerializer.Serialize(row,CatalogueValidator.Json),Event=JsonSerializer.Serialize(new{operation,state=row,evaluation=result},CatalogueValidator.Json)},commandType:CommandType.StoredProcedure);} + public async Task Replay(int user,int book,Guid id){using var db=factory.CreateConnection();return(await db.QueryAsync("dbo.WriterInvestigation",new{Action="events",UserID=user,BookID=book,ID=id},commandType:CommandType.StoredProcedure)).ToArray();} + static Investigation Parse(string json)=>JsonSerializer.Deserialize(json,CatalogueValidator.Json)!; +} diff --git a/PlotLine/Help/Articles/Workspace/Writer3-investigations.md b/PlotLine/Help/Articles/Workspace/Writer3-investigations.md new file mode 100644 index 00000000..87fcdf9f --- /dev/null +++ b/PlotLine/Help/Articles/Workspace/Writer3-investigations.md @@ -0,0 +1,30 @@ +--- +title: Work Through a Story Concern +category: Workspace +tags: explore, investigation, questions, story +contextKey: writer3.investigations +micro: Work through a concern one question at a time; your answers stay with this book. +quickTitle: Guided Investigation development preview +quickSummary: Choose a concern, answer in your own time and revisit any earlier answer. Save for later preserves your investigation. This development preview uses a small synthetic catalogue, without AI or manuscript analysis. +screenshot: +--- + +# Begin with what is troubling you + +In Writer → Explore choose Explore a concern, then the starting concern that feels closest. You do not need to know what the problem is. Later answers can lead in a different direction. + +# One question at a time + +Choose an answer, optionally explain it in your own words, then Continue. Your answers are saved with your account and selected book. Save for later also preserves an unfinished explanation. Use the earlier-answer links to change your understanding; the investigation recalculates from your current answers. If a dependent question no longer applies, its old answer remains in history but no longer contributes. + +You can keep multiple investigations. Starting another does not overwrite the previous one. Investigations use the question catalogue version with which they began. + +# Consider the next step + +Suggestions explain which questionnaire answers informed them and what remains uncertain. They do not claim to analyse the manuscript. You can agree, disagree or investigate further when questions remain. Sometimes there is not enough evidence or an appropriate tool is unavailable; the preview will say so. + +Opening a recommended tool uses your authorised project and book in another tab. Your investigation remains open, ready to return to. It does not change your working objective, Word position, manuscript, scene status or session. After opening a tool, reload this investigation before another action if its version has changed. + +# Development content only + +This synthetic catalogue exercises the mechanism, not production-quality writing advice. It is available only in Development. Production question wording, taxonomy and recommendations will be authored and qualified separately. No AI or external inference service is used. diff --git a/PlotLine/Help/Articles/Workspace/Writer3-reviewing.md b/PlotLine/Help/Articles/Workspace/Writer3-reviewing.md index 93b82045..3ee13713 100644 --- a/PlotLine/Help/Articles/Workspace/Writer3-reviewing.md +++ b/PlotLine/Help/Articles/Workspace/Writer3-reviewing.md @@ -13,6 +13,8 @@ screenshot: Review embeds the same canonical Manuscript Reader. Choose a chapter, use Previous/Next or enter Focused Reading. These retain Review mode and do not change your saved working focus, actual session target or Word position. Reader contains accepted text, not every unsaved Word keystroke. Accepted manuscript details show available synchronisation times. If there is no accepted text, connect and synchronise the correct manuscript through Word Companion; you can still inspect recorded intentions. +The manuscript flows down the page using normal document scrolling and a comfortable reading width. The companion remains available alongside it, or as an overlay on narrow screens. Focused Reading retains its own full-screen reading view. + Reader uses its existing update policy. Selected text and paused updates defer content replacement. Surviving paragraph anchors preserve reading position where possible. While an observation editor is open, automatic content updates pause; Save or Cancel restores your previous pause preference. An update never resolves an observation automatically. # Inspect intentions diff --git a/PlotLine/Models/Investigations/Contracts.cs b/PlotLine/Models/Investigations/Contracts.cs new file mode 100644 index 00000000..c2d79670 --- /dev/null +++ b/PlotLine/Models/Investigations/Contracts.cs @@ -0,0 +1,78 @@ +namespace PlotLine.Models.Investigations; + +public sealed class Catalogue +{ + public int SchemaVersion {get;set;}=1; + public string Version {get;set;}=""; + public bool Synthetic {get;set;}=true; + public int MinAnswers {get;set;}=8; + public int MaxAnswers {get;set;}=12; + public List Dimensions {get;set;}=[]; + public List Concerns {get;set;}=[]; + public List Hypotheses {get;set;}=[]; + public List Questions {get;set;}=[]; + public List Capabilities {get;set;}=[]; +} +public sealed class Concern {public string Id {get;set;}="";public string Text {get;set;}="";public Dictionary Priors {get;set;}=[];} +public sealed class Rule +{ + public int MinAnswers {get;set;} + public Dictionary AllAnswers {get;set;}=[]; + public List ExcludeAnswered {get;set;}=[]; +} +public sealed class Hypothesis +{ + public string Id {get;set;}="";public string Description {get;set;}=""; + public string Summary {get;set;}="";public string Reason {get;set;}="";public string Uncertainty {get;set;}=""; + public List Dimensions {get;set;}=[];public List Capabilities {get;set;}=[]; + public int MinDimensions {get;set;}=2;public int MinGroups {get;set;}=2;public decimal Threshold {get;set;}=4; + public Rule Eligibility {get;set;}=new(); +} +public sealed class Question +{ + public string Id {get;set;}="";public string Text {get;set;}="";public string Help {get;set;}=""; + public string Purpose {get;set;}="Discovery";public string Group {get;set;}=""; + public decimal InformationValue {get;set;}=1;public List Hypotheses {get;set;}=[]; + public List Dimensions {get;set;}=[];public List Clarifies {get;set;}=[]; + public bool AllowExplanation {get;set;}=true;public bool Retired {get;set;} + public string? ReplacedBy {get;set;}public Rule Eligibility {get;set;}=new();public List Options {get;set;}=[]; +} +public sealed class AnswerOption +{ + public string Id {get;set;}="";public string Text {get;set;}="";public bool Uncertain {get;set;} + public string Interpretation {get;set;}="";public List Contributions {get;set;}=[]; +} +public sealed class Contribution +{ + public string Hypothesis {get;set;}="";public string Dimension {get;set;}="";public string Aspect {get;set;}="general";public decimal Weight {get;set;} +} +public sealed class Capability +{ + public string Id {get;set;}="";public string Name {get;set;}="";public string Description {get;set;}=""; + public string Resolver {get;set;}="";public string ActionText {get;set;}="";public bool Available {get;set;}=true; + public bool RequiresBook {get;set;}=true;public bool RequiresProject {get;set;}=true; + public string Context {get;set;}="book";public string Authority {get;set;}="ProjectAccess"; + public Rule Prerequisites {get;set;}=new(); +} +public sealed record Answer(string Question,string Option,string Explanation=""); +public sealed record Evidence(string Question,string Option,string Hypothesis,string Dimension,string Group,string Aspect,decimal Raw,bool Uncertain); +public sealed record HypothesisEvidence(string Id,decimal Prior,decimal Support,decimal Opposition,decimal Score,int Dimensions,int Groups,bool Challenged,bool Eligible,bool Supported,string[] Conflicts,string[] Missing); +public sealed record CandidateQuestion(string Id,decimal Rank,string Reason); +public sealed class Evaluation +{ + public List AvailableCapabilities {get;set;}=[];public List Evidence {get;set;}=[];public List Hypotheses {get;set;}=[]; + public List Candidates {get;set;}=[];public string? NextQuestion {get;set;} + public string Outcome {get;set;}="Investigating";public List Recommendations {get;set;}=[]; + public int AnswerCount {get;set;}public int RedundantContributions {get;set;} +} +public sealed class Investigation +{ + public Guid ID {get;set;}public int UserID {get;set;}public int ProjectID {get;set;}public int BookID {get;set;} + public string CatalogueVersion {get;set;}="";public string Concern {get;set;}=""; + public List Answers {get;set;}=[];public List Presented {get;set;}=[]; + public string? DraftQuestion {get;set;}public string? DraftExplanation {get;set;}public string? CurrentQuestion {get;set;}public int ContinueUntil {get;set;}public bool Accepted {get;set;} + public string? SelectedDestination {get;set;}public List Recommendations {get;set;}=[]; + public int Version {get;set;}public DateTime CreatedUtc {get;set;}public DateTime UpdatedUtc {get;set;} +} +public sealed record RecommendationRecord(int AnswerCount,string Outcome,List Hypotheses,DateTime Utc); +public sealed record InvestigationPage(Investigation? Investigation,Catalogue Catalogue,Evaluation? Evaluation,IReadOnlyList Saved,int ProjectID,int BookID,string? Error=null); diff --git a/PlotLine/Program.cs b/PlotLine/Program.cs index eb72aaa8..523a613d 100644 --- a/PlotLine/Program.cs +++ b/PlotLine/Program.cs @@ -141,6 +141,9 @@ public class Program builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); + builder.Services.AddScoped(); + builder.Services.AddScoped(); + builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddSingleton(); builder.Services.AddScoped(); diff --git a/PlotLine/Services/Investigations/CatalogueValidator.cs b/PlotLine/Services/Investigations/CatalogueValidator.cs new file mode 100644 index 00000000..f4c8a495 --- /dev/null +++ b/PlotLine/Services/Investigations/CatalogueValidator.cs @@ -0,0 +1,28 @@ +using System.Text.Json; +using System.Text.RegularExpressions; +using PlotLine.Models.Investigations; +namespace PlotLine.Services.Investigations; +public static class CatalogueValidator +{ + public static readonly JsonSerializerOptions Json=new(){PropertyNameCaseInsensitive=true,WriteIndented=true,UnmappedMemberHandling=System.Text.Json.Serialization.JsonUnmappedMemberHandling.Disallow}; + public static Catalogue Parse(string json){if(json.Length>1_000_000)throw new ArgumentException("Catalogue is too large.");try{var c=JsonSerializer.Deserialize(json,Json)??throw new ArgumentException("Missing catalogue.");Validate(c);return c;}catch(Exception e)when(e is JsonException or NullReferenceException){throw new ArgumentException("Malformed catalogue; lists and objects cannot be null.",e);}} + public static void Validate(Catalogue c) + { + void Require(bool ok,string message){if(!ok)throw new ArgumentException(message);} + void Ids(IEnumerable ids,string label){var a=ids.ToArray();Require(a.Length>0&&a.Length<=2000&&a.All(x=>x!=null&&Regex.IsMatch(x,"^[a-zA-Z0-9][a-zA-Z0-9._-]{0,79}$"))&&a.Distinct(StringComparer.Ordinal).Count()==a.Length,"Invalid/duplicate "+label+" identifiers.");} + Require(c.SchemaVersion==1&&c.Synthetic,"Only schema1 synthetic catalogues are supported in this phase.");Ids([c.Version],"version");Ids(c.Dimensions,"dimension");Ids(c.Concerns.Select(x=>x.Id),"concern");Ids(c.Hypotheses.Select(x=>x.Id),"hypothesis");Ids(c.Questions.Select(x=>x.Id),"question");Ids(c.Capabilities.Select(x=>x.Id),"capability"); + Require(c.MinAnswers>=2&&c.MaxAnswers>=c.MinAnswers&&c.MaxAnswers<=40,"Invalid question bounds."); + var qs=c.Questions.ToDictionary(q=>q.Id);var hs=c.Hypotheses.Select(h=>h.Id).ToHashSet();var ds=c.Dimensions.ToHashSet();var caps=c.Capabilities.Select(d=>d.Id).ToHashSet(); + void Text(string s,string label)=>Require(!string.IsNullOrWhiteSpace(s)&&s.Length<=4000,"Missing/oversize "+label); + void RuleCheck(Rule r){Require(r.MinAnswers>=0&&r.MinAnswers<=c.MaxAnswers,"Invalid prerequisite answer bound.");foreach(var pair in r.AllAnswers)Require(qs.TryGetValue(pair.Key,out var q)&&pair.Value.Length>0&&pair.Value.All(id=>q.Options.Any(o=>o.Id==id)),"Invalid prerequisite option.");Require(r.ExcludeAnswered.All(qs.ContainsKey),"Invalid exclusion.");Require(!r.AllAnswers.Keys.Intersect(r.ExcludeAnswered).Any(),"Unsatisfiable prerequisite/exclusion.");} + foreach(var s in c.Concerns){Text(s.Text,"concern");Require(s.Priors.Count>0&&s.Priors.All(p=>hs.Contains(p.Key)&&p.Value>=0&&p.Value<=2),"Invalid initial evidence.");} + foreach(var h in c.Hypotheses){Text(h.Description,"hypothesis");Text(h.Summary,"summary template");Text(h.Reason,"reason template");Text(h.Uncertainty,"uncertainty template");Require(h.Dimensions.Count>0&&h.Dimensions.All(ds.Contains)&&h.Capabilities.Count>0&&h.Capabilities.All(caps.Contains),"Invalid hypothesis mapping.");Require(h.MinDimensions>=2&&h.MinDimensions<=h.Dimensions.Distinct().Count()&&h.MinGroups>=2&&h.MinGroups<=c.MaxAnswers&&h.Threshold>0&&h.Threshold<=3*h.Dimensions.Count,"Invalid coverage requirement.");RuleCheck(h.Eligibility);} + foreach(var q in c.Questions){Text(q.Text,"question");Text(q.Group,"corroboration group");Require(new[]{"Discovery","Discrimination","Corroboration","Challenge","Clarification","ActionPreference"}.Contains(q.Purpose),"Invalid question purpose.");Require(q.InformationValue>=0&&q.InformationValue<=20&&q.Hypotheses.Count>0&&q.Hypotheses.All(hs.Contains)&&q.Dimensions.Count>0&&q.Dimensions.All(ds.Contains)&&q.Clarifies.All(ds.Contains),"Invalid question mapping/priority.");Require(q.ReplacedBy==null||q.Retired&&q.ReplacedBy!=q.Id&&qs.ContainsKey(q.ReplacedBy)&&!qs[q.ReplacedBy].Retired,"Invalid replacement.");RuleCheck(q.Eligibility);Require(!q.Eligibility.AllAnswers.ContainsKey(q.Id)&&!q.Eligibility.ExcludeAnswered.Contains(q.Id),"Self prerequisite/exclusion.");Ids(q.Options.Select(o=>o.Id),"answer");Require(q.Options.Count is >=3 and <=5,"Questions need3–5 answer choices.");foreach(var o in q.Options){Text(o.Text,"answer");Require(new[]{"","different-aspects","revised-understanding","confirm-conflict","uncertain"}.Contains(o.Interpretation),"Invalid clarification interpretation.");Require(o.Interpretation==""||q.Purpose=="Clarification","Interpretation requires clarification question.");foreach(var e in o.Contributions){Require(q.Hypotheses.Contains(e.Hypothesis)&&q.Dimensions.Contains(e.Dimension)&&c.Hypotheses.Single(h=>h.Id==e.Hypothesis).Dimensions.Contains(e.Dimension)&&e.Weight>=-3&&e.Weight<=3,"Invalid evidence reference/weight.");Text(e.Aspect,"evidence aspect");}Require(o.Contributions.Select(e=>(e.Hypothesis,e.Dimension,e.Aspect)).Distinct().Count()==o.Contributions.Count,"Duplicate option evidence.");}} + foreach(var d in c.Capabilities){Text(d.Name,"destination");Text(d.Description,"destination description");Text(d.ActionText,"action wording");Require(DestinationRegistry.Resolvers.Contains(d.Resolver)&&d.Authority=="ProjectAccess"&&d.Context is "book" or "project"&&d.RequiresProject,"Invalid destination resolver/context/authority.");RuleCheck(d.Prerequisites);} + // Monotone prerequisite reachability, then check structural support/challenge paths per hypothesis. + var reachable=new HashSet();bool changed;do{changed=false;foreach(var q in c.Questions.Where(q=>!q.Retired))if(q.Eligibility.AllAnswers.Keys.All(reachable.Contains)&&q.Eligibility.MinAnswers<=reachable.Count&&reachable.Add(q.Id))changed=true;}while(changed); + Require(c.Questions.Where(q=>!q.Retired).All(q=>reachable.Contains(q.Id)),"Unreachable question prerequisite cycle."); + foreach(var h in c.Hypotheses){var rows=c.Questions.Where(q=>reachable.Contains(q.Id)).ToArray();Require(rows.Any(q=>q.Purpose=="Challenge"&&q.Hypotheses.Contains(h.Id)),"Hypothesis lacks challenge.");Require(rows.SelectMany(q=>q.Options.SelectMany(o=>o.Contributions)).Where(e=>e.Hypothesis==h.Id&&e.Weight>0).Select(e=>e.Dimension).Distinct().Count()>=h.MinDimensions,"Hypothesis lacks distinct support dimensions.");Require(rows.Where(q=>q.Options.Any(o=>o.Contributions.Any(e=>e.Hypothesis==h.Id&&e.Weight>0))).Select(q=>q.Group).Distinct().Count()>=h.MinGroups,"Hypothesis lacks corroboration groups.");} + Require(c.Capabilities.All(d=>c.Hypotheses.Any(h=>h.Capabilities.Contains(d.Id))),"Unmapped destination."); + } +} diff --git a/PlotLine/Services/Investigations/DestinationRegistry.cs b/PlotLine/Services/Investigations/DestinationRegistry.cs new file mode 100644 index 00000000..f71b5264 --- /dev/null +++ b/PlotLine/Services/Investigations/DestinationRegistry.cs @@ -0,0 +1,13 @@ +using PlotLine.Models.Investigations; +namespace PlotLine.Services.Investigations; +// Trusted authenticated adapters only. Catalogue data never supplies a URL or a controller name. +public static class DestinationRegistry +{ + public static readonly HashSet Resolvers=["Write","Characters","PlotThreads","Timeline","Relationships"]; + public static (string Controller,string Action,object Values)? Resolve(Capability d,int project,int book,bool authorised,IReadOnlyDictionary answers) + { + if(!authorised||!d.Available||project<=0||d.RequiresBook&&book<=0||!InvestigationEngine.Allows(d.Prerequisites,answers))return null; + var controller=d.Resolver switch{"Write"=>"Writer","Characters"=>"Characters","PlotThreads"=>"PlotLineWorkspace","Timeline"=>"Timeline","Relationships"=>"RelationshipMap",_=>null}; + return controller==null?null:(controller,controller=="Writer"?"Write":"Index",new{projectId=project,bookId=book}); + } +} diff --git a/PlotLine/Services/Investigations/InvestigationEngine.cs b/PlotLine/Services/Investigations/InvestigationEngine.cs new file mode 100644 index 00000000..29759068 --- /dev/null +++ b/PlotLine/Services/Investigations/InvestigationEngine.cs @@ -0,0 +1,52 @@ +using PlotLine.Models.Investigations; +namespace PlotLine.Services.Investigations; + +// Pure deterministic function: no repository, HTTP, manuscript, clock, random source or AI dependency. +public static class InvestigationEngine +{ + public static bool Allows(Rule r,IReadOnlyDictionary a)=>a.Count>=r.MinAnswers&&r.AllAnswers.All(x=>a.TryGetValue(x.Key,out var answer)&&x.Value.Contains(answer.Option))&&!r.ExcludeAnswered.Any(a.ContainsKey); + public static Evaluation Evaluate(Catalogue c,string concern,IEnumerable history,ISet available,int continueUntil=0) + { + var seed=c.Concerns.SingleOrDefault(x=>x.Id==concern)??throw new ArgumentException("Choose a starting concern."); + // Last answer wins. Callers keep revision events separately, never obsolete scoring contributions. + var answers=history.GroupBy(x=>x.Question).ToDictionary(x=>x.Key,x=>x.Last()); + var result=new Evaluation{AnswerCount=answers.Count,AvailableCapabilities=available.Order(StringComparer.Ordinal).ToList()}; + foreach(var a in answers.Values){var q=c.Questions.Single(x=>x.Id==a.Question);var option=q.Options.Single(x=>x.Id==a.Option);result.Evidence.AddRange(option.Contributions.Select(e=>new Evidence(q.Id,option.Id,e.Hypothesis,e.Dimension,q.Group,e.Aspect,e.Weight,option.Uncertain)));} + foreach(var h in c.Hypotheses) + { + var rows=result.Evidence.Where(e=>e.Hypothesis==h.Id&&!e.Uncertain).ToArray(); + // A dimension/group contributes its strongest support and strongest opposition once. + var independent=rows.GroupBy(e=>(e.Dimension,e.Group)).Select(g=>new{g.Key.Dimension,Positive=g.Max(e=>Math.Max(0,e.Raw)),Negative=g.Min(e=>Math.Min(0,e.Raw))}).ToArray(); + var support=independent.GroupBy(x=>x.Dimension).Sum(g=>Math.Min(3,g.Sum(x=>x.Positive))); + var opposition=independent.GroupBy(x=>x.Dimension).Sum(g=>Math.Max(-3,g.Sum(x=>x.Negative))); + result.RedundantContributions+=Math.Max(0,rows.Count(e=>e.Raw!=0)-independent.Length); + var conflicts=rows.GroupBy(e=>(e.Dimension,e.Aspect)).Where(g=>g.Any(e=>e.Raw>=2)&&g.Any(e=>e.Raw<=-2)).Where(g=>!answers.Values.Any(a=>{var q=c.Questions.Single(x=>x.Id==a.Question);var o=q.Options.Single(x=>x.Id==a.Option);return q.Clarifies.Contains(g.Key.Dimension)&&q.Hypotheses.Contains(h.Id)&&o.Interpretation == "different-aspects";})).Select(g=>$"{h.Id}/{g.Key.Dimension}/{g.Key.Aspect}").ToArray(); + var dimensions=independent.Where(x=>x.Positive>0).Select(x=>x.Dimension).Distinct().Count(); + var groups=rows.Where(e=>e.Raw>0).Select(e=>e.Group).Distinct().Count(); + var challenged=answers.Values.Any(a=>{var q=c.Questions.Single(x=>x.Id==a.Question);return q.Purpose=="Challenge"&&q.Hypotheses.Contains(h.Id)&&!q.Options.Single(o=>o.Id==a.Option).Uncertain;}); + var competitors=result.Evidence.Where(e=>e.Hypothesis!=h.Id&&!e.Uncertain&&e.Raw!=0).Select(e=>e.Hypothesis).Distinct().Count(); + var eligible=Allows(h.Eligibility,answers)&&h.Capabilities.Any(id=>available.Contains(id)&&c.Capabilities.Any(d=>d.Id==id&&d.Available&&Allows(d.Prerequisites,answers))); + var missing=new List();if(dimensions0)missing.Add("material conflict clarified");if(support+oppositionh.Score).ThenBy(h=>h.Id,StringComparer.Ordinal).ToList(); + var plausible=result.Hypotheses.Where(h=>h.Score>0).Take(2).Select(h=>h.Id).ToHashSet(); + var covered=result.Evidence.Select(e=>(e.Hypothesis,e.Dimension)).ToHashSet(); + foreach(var q in c.Questions.Where(q=>!q.Retired&&!answers.ContainsKey(q.Id)&&Allows(q.Eligibility,answers))) + { + var overlap=q.Hypotheses.Count(plausible.Contains);var gaps=q.Hypotheses.Sum(h=>q.Dimensions.Count(d=>!covered.Contains((h,d)))); + var conflicts=result.Hypotheses.Count(h=>q.Hypotheses.Contains(h.Id)&&h.Conflicts.Any(f=>q.Clarifies.Any(d=>f.Contains('/'+d+'/')))); + var challenge=q.Purpose=="Challenge"?result.Hypotheses.Count(h=>plausible.Contains(h.Id)&&q.Hypotheses.Contains(h.Id)&&!h.Challenged):0; + var corroboration=q.Purpose=="Corroboration"?result.Hypotheses.Count(h=>plausible.Contains(h.Id)&&q.Hypotheses.Contains(h.Id)&&h.Groupsx.Id==h.Id).MinGroups):0; + var rank=q.InformationValue+overlap*3+gaps*2+conflicts*30+challenge*15+corroboration*8+(q.Purpose=="Discrimination"&&overlap>1?8:0); + result.Candidates.Add(new(q.Id,rank,$"Relevant leading explanations: {string.Join(", ",q.Hypotheses.Where(plausible.Contains))}; unexamined dimensions: {gaps}; unresolved conflicts: {conflicts}; challenge gaps: {challenge}; corroboration gaps: {corroboration}; authored information value: {q.InformationValue}.")); + } + result.Candidates=result.Candidates.OrderByDescending(x=>x.Rank).ThenBy(x=>x.Id,StringComparer.Ordinal).ToList(); + var qualified=result.Hypotheses.Where(h=>h.Supported).ToArray();var ready=answers.Count>=Math.Max(c.MinAnswers,continueUntil); + if(ready&&qualified.Length>0){var usable=qualified.Where(h=>h.Eligible).ToArray();if(usable.Length==0)result.Outcome="No suitable destination currently available";else{result.Recommendations=usable.Where(h=>h.Score>=usable[0].Score-2).Take(2).Select(h=>h.Id).ToList();result.Outcome=result.Recommendations.Count==2?"Two plausible explanations":"Supported recommendation";}} + if(result.Outcome=="Investigating"&&(answers.Count>=c.MaxAnswers||result.Candidates.Count==0))result.Outcome=result.Hypotheses.Count(h=>h.Support>0)>=2?"Two plausible explanations":"More information needed"; + // Ambiguous terminal outcomes do not invent qualified recommendations. + if(result.Outcome=="Investigating")result.NextQuestion=result.Candidates.FirstOrDefault()?.Id; + return result; + } +} diff --git a/PlotLine/Services/Investigations/InvestigationService.cs b/PlotLine/Services/Investigations/InvestigationService.cs new file mode 100644 index 00000000..36c2a68a --- /dev/null +++ b/PlotLine/Services/Investigations/InvestigationService.cs @@ -0,0 +1,31 @@ +using PlotLine.Data; +using PlotLine.Models.Investigations; +namespace PlotLine.Services.Investigations; +public sealed class InvestigationAccess(IWebHostEnvironment environment,IConfiguration configuration) +{ + public bool Enabled=>environment.IsDevelopment()&&configuration.GetValue("WriterInvestigations:Enabled",true); +} +public sealed class InvestigationService(IInvestigationRepository repository,IBookRepository books,IProjectAccessService access,TimeProvider clock,IConfiguration configuration) +{ + public async Task Project(int book){if(!await access.CanAccessEntityAsync("Book",book))throw new UnauthorizedAccessException();var b=await books.GetAsync(book);if(b==null||b.IsArchived)throw new UnauthorizedAccessException();return b.ProjectID;} + public static HashSet Available(Catalogue c,Investigation i)=>c.Capabilities.Where(d=>DestinationRegistry.Resolve(d,i.ProjectID,i.BookID,true,i.Answers.ToDictionary(a=>a.Question))!=null).Select(d=>d.Id).ToHashSet(); + public static Evaluation Evaluate(Catalogue c,Investigation i)=>InvestigationEngine.Evaluate(c,i.Concern,i.Answers,Available(c,i),i.ContinueUntil); + public Evaluation Current(Catalogue c,Investigation i)=>InvestigationEngine.Evaluate(c,i.Concern,i.Answers,Available(c,i).Where(id=>configuration.GetValue($"WriterInvestigations:Capabilities:{id}:Enabled",true)).ToHashSet(),i.ContinueUntil); + public async Task<(Investigation,Catalogue)> Read(int user,int book,Guid id){var project=await Project(book);var row=await repository.Read(user,book,id)??throw new KeyNotFoundException();if(row.UserID!=user||row.BookID!=book||row.ProjectID!=project)throw new UnauthorizedAccessException();return(row,await repository.Catalogue(row.CatalogueVersion)??throw new KeyNotFoundException());} + public async Task Start(int user,int book,string concern){var project=await Project(book);var c=await repository.Catalogue()??throw new ArgumentException("The test catalogue is not yet available.");var i=new Investigation{ID=Guid.NewGuid(),UserID=user,ProjectID=project,BookID=book,CatalogueVersion=c.Version,Concern=concern,CreatedUtc=clock.GetUtcNow().UtcDateTime};await Persist(i,c,0,"start");return i;} + public async Task Persist(Investigation i,Catalogue c,int expected,string operation) + { + var state=Current(c,i);i.CurrentQuestion=state.NextQuestion; + if(state.NextQuestion!=null&&!i.Presented.Contains(state.NextQuestion))i.Presented.Add(state.NextQuestion); + if(state.Outcome!="Investigating"&&(i.Recommendations.LastOrDefault() is not {} last||last.AnswerCount!=i.Answers.Count||last.Outcome!=state.Outcome||!last.Hypotheses.SequenceEqual(state.Recommendations)))i.Recommendations.Add(new(i.Answers.Count,state.Outcome,state.Recommendations.ToList(),clock.GetUtcNow().UtcDateTime)); + i.UpdatedUtc=clock.GetUtcNow().UtcDateTime;await repository.Save(i,expected,operation,state); + } + public static void Answer(Investigation i,Catalogue c,string question,string option,string? explanation) + { + if(!i.Presented.Contains(question))throw new ArgumentException("This question has not been presented.");var q=c.Questions.SingleOrDefault(q=>q.Id==question)??throw new ArgumentException("Unknown question.");if(!q.Options.Any(o=>o.Id==option))throw new ArgumentException("Choose an answer.");if((explanation?.Length??0)>2000)throw new ArgumentException("Please keep your explanation within2,000 characters."); + var existing=i.Answers.FindIndex(a=>a.Question==question);var next=new Answer(question,option,q.AllowExplanation?explanation??"":"");if(existing>=0)i.Answers[existing]=next;else i.Answers.Add(next); + // Revision may invalidate later prerequisite-dependent answers. Keep them in event history, not live evidence. + bool removed;do{removed=false;foreach(var a in i.Answers.ToArray()){var others=i.Answers.Where(x=>x.Question!=a.Question).ToDictionary(x=>x.Question);if(!InvestigationEngine.Allows(c.Questions.Single(q=>q.Id==a.Question).Eligibility,others)){i.Answers.Remove(a);removed=true;}}}while(removed); + i.DraftQuestion=null;i.DraftExplanation=null;i.Accepted=false;i.SelectedDestination=null; + } +} diff --git a/PlotLine/Services/ProjectAccessFilter.cs b/PlotLine/Services/ProjectAccessFilter.cs index 0c344748..79195139 100644 --- a/PlotLine/Services/ProjectAccessFilter.cs +++ b/PlotLine/Services/ProjectAccessFilter.cs @@ -85,6 +85,7 @@ public sealed class ProjectAccessFilter(IProjectAccessService access, ICurrentUs ["Scenarios"] = new(StringComparer.OrdinalIgnoreCase) { ["id"] = "Scenario", ["scenarioId"] = "Scenario", ["projectId"] = "Project", ["bookId"] = "Book", ["sceneId"] = "Scene", ["anchorSceneId"] = "Scene", ["targetChapterId"] = "Chapter" }, ["StoryAssets"] = new(StringComparer.OrdinalIgnoreCase) { ["id"] = "StoryAsset", ["returnAssetId"] = "StoryAsset", ["projectId"] = "Project" }, ["Timeline"] = new(StringComparer.OrdinalIgnoreCase) { ["id"] = "TimelineViewPreset", ["projectId"] = "Project", ["bookId"] = "Book" }, + ["WriterInvestigations"] = new(StringComparer.OrdinalIgnoreCase) { ["bookId"]="Book" }, ["WriterReview"] = new(StringComparer.OrdinalIgnoreCase) { ["bookId"]="Book",["chapterId"]="Chapter" }, ["WriterWord"] = new(StringComparer.OrdinalIgnoreCase) { ["bookId"] = "Book", ["chapterId"] = "Chapter", ["sceneId"] = "Scene" }, ["WriterAuthoring"] = new(StringComparer.OrdinalIgnoreCase) { ["bookId"] = "Book", ["chapterId"] = "Chapter", ["sceneId"] = "Scene" }, diff --git a/PlotLine/Sql/273_WriterInvestigations.sql b/PlotLine/Sql/273_WriterInvestigations.sql new file mode 100644 index 00000000..08c2392e --- /dev/null +++ b/PlotLine/Sql/273_WriterInvestigations.sql @@ -0,0 +1,48 @@ +-- Phase3D.1: private deterministic investigations; immutable catalogues and append-only state events. +SET ANSI_NULLS ON; +SET QUOTED_IDENTIFIER ON; +GO +IF OBJECT_ID('dbo.WriterInvestigationCatalogues') IS NULL + CREATE TABLE dbo.WriterInvestigationCatalogues(Version varchar(80) NOT NULL PRIMARY KEY,Json nvarchar(max) NOT NULL CHECK(ISJSON(Json)=1),PublishedUtc datetime2 NOT NULL DEFAULT SYSUTCDATETIME(),Actor nvarchar(256) NOT NULL); +IF OBJECT_ID('dbo.WriterInvestigations') IS NULL + CREATE TABLE dbo.WriterInvestigations(ID uniqueidentifier NOT NULL PRIMARY KEY,UserID int NOT NULL REFERENCES dbo.AppUser(UserID) ON DELETE CASCADE,ProjectID int NOT NULL,BookID int NOT NULL REFERENCES dbo.Books(BookID) ON DELETE CASCADE,CatalogueVersion varchar(80) NOT NULL REFERENCES dbo.WriterInvestigationCatalogues(Version),Version int NOT NULL,Json nvarchar(max) NOT NULL CHECK(ISJSON(Json)=1),CreatedUtc datetime2 NOT NULL DEFAULT SYSUTCDATETIME(),UpdatedUtc datetime2 NOT NULL DEFAULT SYSUTCDATETIME()); +IF OBJECT_ID('dbo.WriterInvestigationEvents') IS NULL + CREATE TABLE dbo.WriterInvestigationEvents(InvestigationID uniqueidentifier NOT NULL REFERENCES dbo.WriterInvestigations(ID) ON DELETE CASCADE,Version int NOT NULL,Event nvarchar(max) NOT NULL CHECK(ISJSON(Event)=1),CreatedUtc datetime2 NOT NULL DEFAULT SYSUTCDATETIME(),PRIMARY KEY(InvestigationID,Version)); +IF NOT EXISTS(SELECT 1 FROM sys.indexes WHERE object_id=OBJECT_ID('dbo.WriterInvestigations') AND name='IX_WriterInvestigations_AuthorBook') CREATE INDEX IX_WriterInvestigations_AuthorBook ON dbo.WriterInvestigations(UserID,BookID,UpdatedUtc DESC); +GO +CREATE OR ALTER PROCEDURE dbo.WriterInvestigationCatalogue @Action varchar(12),@Version varchar(80)=NULL,@Json nvarchar(max)=NULL,@Actor nvarchar(256)=NULL AS +BEGIN + SET NOCOUNT ON;SET XACT_ABORT ON; + IF @Action='read' BEGIN SELECT TOP(1) Json FROM dbo.WriterInvestigationCatalogues WHERE @Version IS NULL OR Version=@Version ORDER BY PublishedUtc DESC,Version DESC;RETURN;END; + IF @Action<>'publish' OR @Version IS NULL OR ISJSON(@Json)<>1 OR ISNULL(JSON_VALUE(@Json,'$.Version'),'')<>@Version OR ISNULL(JSON_VALUE(@Json,'$.Synthetic'),'')<>'true' THROW 51000,'Invalid catalogue',1; + IF EXISTS(SELECT 1 FROM dbo.WriterInvestigationCatalogues WHERE Version=@Version) THROW 51002,'Catalogue version is immutable; publish a new version',1; + INSERT dbo.WriterInvestigationCatalogues(Version,Json,Actor) VALUES(@Version,@Json,@Actor); +END; +GO +CREATE OR ALTER PROCEDURE dbo.WriterInvestigation @Action varchar(12),@UserID int,@BookID int,@ProjectID int=NULL,@ID uniqueidentifier=NULL,@CatalogueVersion varchar(80)=NULL,@ExpectedVersion int=NULL,@Json nvarchar(max)=NULL,@Event nvarchar(max)=NULL AS +BEGIN + SET NOCOUNT ON;SET XACT_ABORT ON; + DECLARE @ActualProject int; + SELECT @ActualProject=b.ProjectID FROM dbo.Books b JOIN dbo.Projects p ON p.ProjectID=b.ProjectID AND p.IsArchived=0 JOIN dbo.ProjectUserAccess a ON a.ProjectID=b.ProjectID AND a.UserID=@UserID AND a.IsActive=1 WHERE b.BookID=@BookID AND b.IsArchived=0; + IF @ActualProject IS NULL OR (@ProjectID IS NOT NULL AND @ProjectID<>@ActualProject) THROW 51000,'Investigation scope unavailable',1; + IF @Action='list' BEGIN SELECT TOP(100) Json FROM dbo.WriterInvestigations WHERE UserID=@UserID AND BookID=@BookID ORDER BY UpdatedUtc DESC,ID;RETURN;END; + IF @Action IN('read','events') BEGIN + IF NOT EXISTS(SELECT 1 FROM dbo.WriterInvestigations WHERE ID=@ID AND UserID=@UserID AND BookID=@BookID) THROW 51000,'Investigation unavailable',1; + IF @Action='read' SELECT Json FROM dbo.WriterInvestigations WHERE ID=@ID AND UserID=@UserID AND BookID=@BookID; + ELSE SELECT e.Event FROM dbo.WriterInvestigationEvents e JOIN dbo.WriterInvestigations i ON i.ID=e.InvestigationID WHERE i.ID=@ID AND i.UserID=@UserID AND i.BookID=@BookID ORDER BY e.Version; + RETURN; + END; + IF @Action<>'save' OR @ID IS NULL OR @ExpectedVersion<0 OR @ExpectedVersion>1000 OR ISJSON(@Json)<>1 OR ISJSON(@Event)<>1 OR DATALENGTH(@Json)>1000000 OR DATALENGTH(@Event)>2000000 THROW 51000,'Invalid investigation save',1; + IF ISNULL(TRY_CONVERT(int,JSON_VALUE(@Json,'$.UserID')),-1)<>@UserID OR ISNULL(TRY_CONVERT(int,JSON_VALUE(@Json,'$.BookID')),-1)<>@BookID OR ISNULL(TRY_CONVERT(int,JSON_VALUE(@Json,'$.ProjectID')),-1)<>@ActualProject OR ISNULL(TRY_CONVERT(uniqueidentifier,JSON_VALUE(@Json,'$.ID')),'00000000-0000-0000-0000-000000000000')<>@ID OR ISNULL(JSON_VALUE(@Json,'$.CatalogueVersion'),'')<>@CatalogueVersion OR ISNULL(TRY_CONVERT(int,JSON_VALUE(@Json,'$.Version')),-1)<>@ExpectedVersion+1 THROW 51000,'Investigation identity mismatch',1; + BEGIN TRANSACTION; + IF @ExpectedVersion=0 BEGIN + IF EXISTS(SELECT 1 FROM dbo.WriterInvestigations WITH(UPDLOCK,HOLDLOCK) WHERE ID=@ID) THROW 51002,'Investigation already exists; resume it',1; + INSERT dbo.WriterInvestigations(ID,UserID,ProjectID,BookID,CatalogueVersion,Version,Json) VALUES(@ID,@UserID,@ActualProject,@BookID,@CatalogueVersion,1,@Json); + END ELSE BEGIN + UPDATE dbo.WriterInvestigations SET Json=@Json,Version=Version+1,UpdatedUtc=SYSUTCDATETIME() WHERE ID=@ID AND UserID=@UserID AND BookID=@BookID AND CatalogueVersion=@CatalogueVersion AND Version=@ExpectedVersion; + IF @@ROWCOUNT<>1 THROW 51002,'Another window changed this investigation. Your submitted answer has not replaced it.',1; + END; + INSERT dbo.WriterInvestigationEvents(InvestigationID,Version,Event) VALUES(@ID,@ExpectedVersion+1,@Event); + COMMIT; +END; +GO diff --git a/PlotLine/Views/Writer/_WriterExplore.cshtml b/PlotLine/Views/Writer/_WriterExplore.cshtml index 24d88a54..1ff34ca9 100644 --- a/PlotLine/Views/Writer/_WriterExplore.cshtml +++ b/PlotLine/Views/Writer/_WriterExplore.cshtml @@ -1,13 +1,15 @@ +@inject PlotLine.Services.Investigations.InvestigationAccess InvestigationAccess @model WriterDashboardViewModel
+ @if(InvestigationAccess.Enabled && Model.BookID.HasValue){

What's troubling you about your story?

You don't need to know the answer yet. Work through a concern one question at a time.

Explore a concern

Development preview · Small synthetic test catalogue; questionnaire answers only, without AI or manuscript analysis.

}

Start with your question

What would you like to explore?

You do not need a finished outline or a linked manuscript. Choose a starting point.

-

These open your authenticated writing and story tools. Guided exploration is planned for a later update; no manuscript analysis runs here.

+

These open your authenticated writing and story tools. No manuscript analysis runs here.