ConsistencyCheck.h header

#include <ew/app/ConsistencyCheck.h>

Namespace ew::app

Functions

AiRequest ew::app::buildConsistencyPrompt(const ew::core::Project &project, const QString &documentTitle, const QString &documentText)

Builds an AI request asking the model to check documentText (titled documentTitle) against the project's established canon facts and report inconsistencies or contradictions. This is a pure transformation (it only assembles the prompt), so it is unit-testable without a model; the caller fills in the model from settings and sends it via an AiProvider.

QString ew::app::gatherCanonFacts(const ew::core::Project &project)

Gathers a plain-text digest of the project's canon facts: per entity, a header line (name, category, and summary/description where present) followed by an indented "Label: value" line for each of its structured field values – the concrete truths (eye colour, status, birth year, ...) the continuity audit checks prose against. Reference fields resolve to the target entity's name; entities opted out of AI (aiExcluded) are omitted. Used as the reference context for an AI consistency check, and exposed for testing and reuse. Empty when the project has no entities.