PlotDirector/Docs/Writer/Investigations/Catalogue-Schema.md

4.3 KiB
Raw Blame History

Catalogue schema1 and editorial workflow

The validated example is 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:<id>: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.