Skip to content

ontocast.onto.enum

Classes

FailureStage

Bases: StrEnum

Enumeration of possible failure stages in the workflow.

Source code in ontocast/onto/enum.py
class FailureStage(StrEnum):
    """Enumeration of possible failure stages in the workflow."""

    NO_CHUNKS_TO_PROCESS = "No chunks to process"
    UNSUPPORTED_DOCUMENT = "The document type is not supported"
    ONTOLOGY_CRITIQUE = "The produced ontology did not pass the critique stage."
    FACTS_CRITIQUE = "The produced graph of facts did not pass the critique stage."
    GENERATE_TTL_FOR_ONTOLOGY = (
        "Failed to generate semantic triples (turtle) for ontology"
    )
    GENERATE_GRAPH_UPDATE_FOR_ONTOLOGY = "Failed to generate graph update for ontology"
    GENERATE_TTL_FOR_FACTS = "Failed to generate semantic triples (turtle) for facts"
    GENERATE_GRAPH_UPDATE_FOR_FACTS = "Failed to generate graph update for facts"

Attributes

FACTS_CRITIQUE = 'The produced graph of facts did not pass the critique stage.' class-attribute instance-attribute
GENERATE_GRAPH_UPDATE_FOR_FACTS = 'Failed to generate graph update for facts' class-attribute instance-attribute
GENERATE_GRAPH_UPDATE_FOR_ONTOLOGY = 'Failed to generate graph update for ontology' class-attribute instance-attribute
GENERATE_TTL_FOR_FACTS = 'Failed to generate semantic triples (turtle) for facts' class-attribute instance-attribute
GENERATE_TTL_FOR_ONTOLOGY = 'Failed to generate semantic triples (turtle) for ontology' class-attribute instance-attribute
NO_CHUNKS_TO_PROCESS = 'No chunks to process' class-attribute instance-attribute
ONTOLOGY_CRITIQUE = 'The produced ontology did not pass the critique stage.' class-attribute instance-attribute
UNSUPPORTED_DOCUMENT = 'The document type is not supported' class-attribute instance-attribute

LLMGraphFormat

Bases: StrEnum

Format used by the LLM when emitting RDF graph payloads.

  • turtle (default): graph fields are Turtle strings. Fewer tokens per triple than JSON-LD, and an IRI object cannot be written as a string by accident: unit:NanoM is an IRI, "unit:NanoM" visibly a literal.
  • jsonld: graph fields are compact JSON-LD objects embedded directly in the structured LLM response, for providers whose structured output handles long strings worse than nested objects. Internally parsed back into RDFGraph.
Source code in ontocast/onto/enum.py
class LLMGraphFormat(StrEnum):
    """Format used by the LLM when emitting RDF graph payloads.

    - ``turtle`` (default): graph fields are Turtle strings. Fewer tokens per
      triple than JSON-LD, and an IRI object cannot be written as a string by
      accident: ``unit:NanoM`` is an IRI, ``"unit:NanoM"`` visibly a literal.
    - ``jsonld``: graph fields are compact JSON-LD objects embedded directly in
      the structured LLM response, for providers whose structured output
      handles long strings worse than nested objects. Internally parsed back
      into ``RDFGraph``.
    """

    TURTLE = "turtle"
    JSONLD = "jsonld"

Attributes

JSONLD = 'jsonld' class-attribute instance-attribute
TURTLE = 'turtle' class-attribute instance-attribute

LLMOutputLayout

Bases: StrEnum

Whitespace the LLM is asked to use in its structured responses.

  • compact (default): the JSON response is minified, and a Turtle graph string keeps each subject on one line without indentation. Indentation counts as output tokens and carries nothing the parser reads.
  • free: no layout instruction; the model chooses, and typically pretty-prints JSON with indentation.
Source code in ontocast/onto/enum.py
class LLMOutputLayout(StrEnum):
    """Whitespace the LLM is asked to use in its structured responses.

    - ``compact`` (default): the JSON response is minified, and a Turtle graph
      string keeps each subject on one line without indentation. Indentation
      counts as output tokens and carries nothing the parser reads.
    - ``free``: no layout instruction; the model chooses, and typically
      pretty-prints JSON with indentation.
    """

    FREE = "free"
    COMPACT = "compact"

Attributes

COMPACT = 'compact' class-attribute instance-attribute
FREE = 'free' class-attribute instance-attribute

LLMPhase

Bases: StrEnum

What an LLM call was for: the key of BudgetTracker.tokens_by_phase.

A phase covers every provider call its step makes, parse retries and re-renders included. UNLABELED collects calls made outside any labelled step; in a pipeline run it should stay empty.

Source code in ontocast/onto/enum.py
class LLMPhase(StrEnum):
    """What an LLM call was for: the key of ``BudgetTracker.tokens_by_phase``.

    A phase covers every provider call its step makes, parse retries and
    re-renders included. ``UNLABELED`` collects calls made outside any labelled
    step; in a pipeline run it should stay empty.
    """

    FACTS_RENDER = "facts_render"
    FACTS_CRITIC = "facts_critic"
    FACTS_COMPLETION = "facts_completion"
    FACTS_COREFERENCE = "facts_coreference"
    ONTOLOGY_IDENTITY = "ontology_identity"
    ONTOLOGY_PLAN = "ontology_plan"
    ONTOLOGY_RENDER = "ontology_render"
    ONTOLOGY_CRITIC = "ontology_critic"
    ONTOLOGY_CONSOLIDATION = "ontology_consolidation"
    ONTOLOGY_CURATION = "ontology_curation"
    ONTOLOGY_SELECTION = "ontology_selection"
    EVIDENCE_PLANNING = "evidence_planning"
    UNIT_SUMMARY = "unit_summary"
    SECTION_CLASSIFICATION = "section_classification"
    UNLABELED = "unlabeled"

Attributes

EVIDENCE_PLANNING = 'evidence_planning' class-attribute instance-attribute
FACTS_COMPLETION = 'facts_completion' class-attribute instance-attribute
FACTS_COREFERENCE = 'facts_coreference' class-attribute instance-attribute
FACTS_CRITIC = 'facts_critic' class-attribute instance-attribute
FACTS_RENDER = 'facts_render' class-attribute instance-attribute
ONTOLOGY_CONSOLIDATION = 'ontology_consolidation' class-attribute instance-attribute
ONTOLOGY_CRITIC = 'ontology_critic' class-attribute instance-attribute
ONTOLOGY_CURATION = 'ontology_curation' class-attribute instance-attribute
ONTOLOGY_IDENTITY = 'ontology_identity' class-attribute instance-attribute
ONTOLOGY_PLAN = 'ontology_plan' class-attribute instance-attribute
ONTOLOGY_RENDER = 'ontology_render' class-attribute instance-attribute
ONTOLOGY_SELECTION = 'ontology_selection' class-attribute instance-attribute
SECTION_CLASSIFICATION = 'section_classification' class-attribute instance-attribute
UNIT_SUMMARY = 'unit_summary' class-attribute instance-attribute
UNLABELED = 'unlabeled' class-attribute instance-attribute

LabelStrength

Bases: StrEnum

Whether a section label may take part in a drop decision. Wire names.

Source code in ontocast/onto/enum.py
class LabelStrength(StrEnum):
    """Whether a section label may take part in a drop decision. Wire names."""

    STRONG = "strong"
    WEAK = "weak"

Attributes

STRONG = 'strong' class-attribute instance-attribute
WEAK = 'weak' class-attribute instance-attribute

OntologyAssemblyMode

Bases: StrEnum

How per-unit ontology context was assembled for prompts.

Source code in ontocast/onto/enum.py
class OntologyAssemblyMode(StrEnum):
    """How per-unit ontology context was assembled for prompts."""

    SELECTED_SINGLE_ONTOLOGY_LLM = "selected_single_ontology_llm"
    SELECTED_VECTOR_SEARCH_ENSEMBLE = "selected_vector_search_ensemble"
    FIXED_SINGLE_ONTOLOGY = "fixed_single_ontology"
    DOCUMENT_MERGED_REDUCED = "document_merged_reduced"

Attributes

DOCUMENT_MERGED_REDUCED = 'document_merged_reduced' class-attribute instance-attribute
FIXED_SINGLE_ONTOLOGY = 'fixed_single_ontology' class-attribute instance-attribute
SELECTED_SINGLE_ONTOLOGY_LLM = 'selected_single_ontology_llm' class-attribute instance-attribute
SELECTED_VECTOR_SEARCH_ENSEMBLE = 'selected_vector_search_ensemble' class-attribute instance-attribute

OntologyChapterFormat

Bases: StrEnum

Syntax of the # ONTOLOGY chapter in the facts prompts.

  • auto (default): term_sheet, the shortest chapter. Resolved once when the configuration is built, so nothing downstream -- profile lookup, cache key, run manifest -- ever sees this member.
  • inherit: the chapter follows :class:LLMGraphFormat, so the model reads the ontology in the syntax it is asked to write.
  • turtle: the chapter is Turtle whatever the wire format is. In a facts prompt the ontology is read-only context -- nothing the model emits has to match its syntax -- and Turtle spends fewer characters per triple than pretty-printed JSON-LD, so this trades the read/write symmetry for a shorter prompt. The graph payloads the model emits stay in the wire format.
  • term_sheet: the chapter is a line-per-term listing rather than a serialized graph -- name, surface forms, type, hierarchy, domain/range and usage contract, without the per-statement RDF scaffolding or the prose written for a human reader. Legal in every render mode: the ontology loop never reads this setting and keeps its own graph chapter, because it emits a patch against the statements it reads.
Source code in ontocast/onto/enum.py
class OntologyChapterFormat(StrEnum):
    """Syntax of the ``# ONTOLOGY`` chapter in the facts prompts.

    - ``auto`` (default): ``term_sheet``, the shortest chapter. Resolved once
      when the configuration is built, so nothing downstream -- profile lookup,
      cache key, run manifest -- ever sees this member.
    - ``inherit``: the chapter follows :class:`LLMGraphFormat`, so
      the model reads the ontology in the syntax it is asked to write.
    - ``turtle``: the chapter is Turtle whatever the wire format is. In a
      facts prompt the ontology is read-only context -- nothing the model
      emits has to match its syntax -- and Turtle spends fewer characters per
      triple than pretty-printed JSON-LD, so this trades the read/write
      symmetry for a shorter prompt. The graph payloads the model emits stay
      in the wire format.
    - ``term_sheet``: the chapter is a line-per-term listing rather than a
      serialized graph -- name, surface forms, type, hierarchy, domain/range
      and usage contract, without the per-statement RDF scaffolding or the
      prose written for a human reader. Legal in every render mode: the
      ontology loop never reads this setting and keeps its own graph chapter,
      because it emits a patch against the statements it reads.
    """

    AUTO = "auto"
    INHERIT = "inherit"
    TURTLE = "turtle"
    TERM_SHEET = "term_sheet"

Attributes

AUTO = 'auto' class-attribute instance-attribute
INHERIT = 'inherit' class-attribute instance-attribute
TERM_SHEET = 'term_sheet' class-attribute instance-attribute
TURTLE = 'turtle' class-attribute instance-attribute

OntologyContextMode

Bases: StrEnum

How per-unit ontology context is sourced before ontology/facts rendering.

Source code in ontocast/onto/enum.py
class OntologyContextMode(StrEnum):
    """How per-unit ontology context is sourced before ontology/facts rendering."""

    SELECTED_SINGLE_ONTOLOGY = "selected_single_ontology"
    SELECTED_VECTOR_SEARCH_ONTOLOGY = "selected_vector_search_ontology"
    FIXED_SINGLE_ONTOLOGY = "fixed_single_ontology"

Attributes

FIXED_SINGLE_ONTOLOGY = 'fixed_single_ontology' class-attribute instance-attribute
SELECTED_SINGLE_ONTOLOGY = 'selected_single_ontology' class-attribute instance-attribute
SELECTED_VECTOR_SEARCH_ONTOLOGY = 'selected_vector_search_ontology' class-attribute instance-attribute

OntologyContextScope

Bases: StrEnum

Whether the ontology chapter is resolved per unit or once per document.

  • unit (default): each content unit retrieves its own context. The smallest chapter per unit, and a different chapter for every one of them, so a provider's prefix cache can serve none of them.
  • document: every unit's context is resolved once and unioned, and the union is shown to all of them. Larger per call and recall-safe by construction -- the union contains everything each unit's own retrieval selected -- but identical across the fan-out, which is what makes the chapter cacheable after the first call.
Source code in ontocast/onto/enum.py
class OntologyContextScope(StrEnum):
    """Whether the ontology chapter is resolved per unit or once per document.

    - ``unit`` (default): each content unit retrieves its own context. The
      smallest chapter per unit, and a different chapter for every one of them,
      so a provider's prefix cache can serve none of them.
    - ``document``: every unit's context is resolved once and unioned, and the
      union is shown to all of them. Larger per call and recall-safe by
      construction -- the union contains everything each unit's own retrieval
      selected -- but identical across the fan-out, which is what makes the
      chapter cacheable after the first call.
    """

    UNIT = "unit"
    DOCUMENT = "document"

Attributes

DOCUMENT = 'document' class-attribute instance-attribute
UNIT = 'unit' class-attribute instance-attribute

RenderMode

Bases: StrEnum

Enumeration of supported rendering modes.

Source code in ontocast/onto/enum.py
class RenderMode(StrEnum):
    """Enumeration of supported rendering modes."""

    ONTOLOGY = "ontology"
    FACTS = "facts"
    ONTOLOGY_AND_FACTS = "ontology_and_facts"

Attributes

FACTS = 'facts' class-attribute instance-attribute
ONTOLOGY = 'ontology' class-attribute instance-attribute
ONTOLOGY_AND_FACTS = 'ontology_and_facts' class-attribute instance-attribute

RetrievalMetric

Bases: StrEnum

Top-level keys of AgentState.retrieval_metrics.

These are wire names. The dict is serialized verbatim into ProcessResultMetadata.retrieval_metrics on /process and /process_unit and into the batch run manifest, so a member's value may never change without a breaking release; the member name is free to. Collecting them here replaces bare string literals scattered over three modules, where a typo produced a silently missing metric and nothing enumerated what a run should emit.

Only the flat top level is enumerated. The per-retrieval telemetry that lands nested under :attr:PATCH_RETRIEVAL is the patch retriever's own namespace with its own lifecycle, and flattening it here would assert a structure that does not exist.

Source code in ontocast/onto/enum.py
class RetrievalMetric(StrEnum):
    """Top-level keys of ``AgentState.retrieval_metrics``.

    These are wire names. The dict is serialized verbatim into
    ``ProcessResultMetadata.retrieval_metrics`` on ``/process`` and
    ``/process_unit`` and into the batch run manifest, so a member's *value*
    may never change without a breaking release; the member name is free to.
    Collecting them here replaces bare string literals scattered over three
    modules, where a typo produced a silently missing metric and nothing
    enumerated what a run should emit.

    Only the flat top level is enumerated. The per-retrieval telemetry that
    lands nested under :attr:`PATCH_RETRIEVAL` is the patch retriever's own
    namespace with its own lifecycle, and flattening it here would assert a
    structure that does not exist.
    """

    # Ontology context assembly (written per unit, merged onto the document).
    ONTOLOGY_CONTEXT_MODE = "ontology_context_mode"
    PATCH_RETRIEVAL = "patch_retrieval"
    #: Why a unit's ontology snapshot came back empty. Written per unit and
    #: merged last-writer-wins, so on a multi-unit document only the final
    #: unit's reason survives.
    EMPTY_SNAPSHOT_REASON = "empty_snapshot_reason"
    ONTOLOGY_WRITABLE_COUNT = "ontology_writable_count"
    ONTOLOGY_PRIMARY_UNITS = "ontology_primary_units"
    #: Triples in the resolved ontology snapshot, written by every context mode.
    #: Before this existed only the vector resolver recorded a size, nested under
    #: :attr:`PATCH_RETRIEVAL`, so the two modes that bound nothing were also the
    #: two that reported nothing.
    ONTOLOGY_SNAPSHOT_TRIPLES = "ontology_snapshot_triples"

    # Ontology fan-out: the per-unit critic ledger and the deterministic
    # findings residual, mirrors of the facts block below, so the ontology
    # gate's accept rate can be read from a run's artifacts.
    ONTOLOGY_FINDINGS_RESIDUAL = "ontology_findings_residual"
    ONTOLOGY_MANDATORY_RESIDUAL = "ontology_mandatory_residual"
    ONTOLOGY_CRITIC_CALLS = "ontology_critic_calls"
    ONTOLOGY_CRITIC_ACCEPTED = "ontology_critic_accepted"

    # Facts fan-out.
    FACTS_ANCHOR_COUNT = "facts_anchor_count"
    FACTS_ANCHOR_UNITS = "facts_anchor_units"
    FACTS_LLM_REPAIR_RENDERS_TOTAL = "facts_llm_repair_renders_total"
    FACTS_LLM_REPAIR_RENDERS_FAILED = "facts_llm_repair_renders_failed"
    FACTS_REPAIR_DELETE_ONLY = "facts_repair_delete_only"
    FACTS_FINDINGS_RESIDUAL = "facts_findings_residual"
    FACTS_MANDATORY_RESIDUAL = "facts_mandatory_residual"
    FACTS_MANDATORY_RESIDUAL_BY_KIND = "facts_mandatory_residual_by_kind"
    #: Statements and values linked to nothing in the units' renders, and
    #: those left after the gap pass (``statement_without_subject``).
    FACTS_STATEMENTS_WITHOUT_SUBJECT_RENDERED = (
        "facts_statements_without_subject_rendered"
    )
    FACTS_STATEMENTS_WITHOUT_SUBJECT = "facts_statements_without_subject"
    FACTS_CRITIC_CALLS = "facts_critic_calls"
    FACTS_CRITIC_FIXES_APPLIED = "facts_critic_fixes_applied"
    FACTS_CRITIC_FIXES_RESIDUAL = "facts_critic_fixes_residual"
    FACTS_CRITIC_FIXES_NOOP = "facts_critic_fixes_noop"
    FACTS_CRITIC_PATCHES_ROLLED_BACK = "facts_critic_patches_rolled_back"
    ONTOLOGY_CRITIC_FIXES_APPLIED = "ontology_critic_fixes_applied"
    ONTOLOGY_CRITIC_FIXES_RESIDUAL = "ontology_critic_fixes_residual"
    ONTOLOGY_CRITIC_FIXES_NOOP = "ontology_critic_fixes_noop"
    ONTOLOGY_CRITIC_PATCHES_ROLLED_BACK = "ontology_critic_patches_rolled_back"
    #: Units the ontology loop did not send to the critic: at one pass, a unit
    #: with no mandatory deterministic finding.
    ONTOLOGY_CRITIC_UNITS_SKIPPED = "ontology_critic_units_skipped"
    FACTS_CRITIC_ACCEPTED = "facts_critic_accepted"
    #: Units whose critic call failed (timeout, unparseable response) and
    #: left the loop unreviewed, and units the loop did not send to the
    #: critic at all (empty render, citation metadata).
    FACTS_CRITIC_UNITS_UNREVIEWED = "facts_critic_units_unreviewed"
    FACTS_CRITIC_UNITS_SKIPPED = "facts_critic_units_skipped"
    #: Per-fix outcomes of the compiled critique: fixes undone for leaving
    #: the unit worse, inserts refused for minting a placeholder or an
    #: annotation-only node, and payloads naming a prefix nothing declared.
    FACTS_CRITIC_FIXES_ROLLED_BACK = "facts_critic_fixes_rolled_back"
    FACTS_CRITIC_FIXES_JUNK_REFUSED = "facts_critic_fixes_junk_refused"
    FACTS_CRITIC_FIXES_UNRESOLVED_PREFIX = "facts_critic_fixes_unresolved_prefix"
    #: The insert-only completion pass: calls made, triples that stayed
    #: in, and missed measurements the inventory no longer lists afterwards.
    FACTS_COMPLETION_CALLS = "facts_completion_calls"
    FACTS_COMPLETION_TRIPLES_INSERTED = "facts_completion_triples_inserted"
    FACTS_COMPLETION_MEASUREMENTS_RECOVERED = "facts_completion_measurements_recovered"
    #: Instances linked to nothing that the gap pass linked.
    FACTS_COMPLETION_DETACHED_LINKED = "facts_completion_detached_linked"
    #: Domain-repair calls, statements they gave a fitting property, and
    #: statements still violating a declared domain that were dropped.
    FACTS_DOMAIN_REPAIR_CALLS = "facts_domain_repair_calls"
    FACTS_DOMAIN_REPAIR_FIXED = "facts_domain_repair_fixed"
    FACTS_DOMAIN_VIOLATIONS_DROPPED = "facts_domain_violations_dropped"

    # Aggregation and the un-merge repair.
    FACTS_REJECTED_MERGES = "facts_rejected_merges"
    #: The refused merges by reason (same_unit, sibling, literal_conflict,
    #: functional_iri_conflict, initials_conflict, role, type, lexical,
    #: cluster_veto), a pair counting under each reason that refused it.
    FACTS_MERGE_REJECTIONS_BY_REASON = "facts_merge_rejections_by_reason"
    FACTS_MERGE_REPAIR_PASSES = "facts_merge_repair_passes"
    FACTS_MERGE_VETOES = "facts_merge_vetoes"
    FACTS_MERGE_REPAIRS_REJECTED = "facts_merge_repairs_rejected"
    #: Coreference resolution: pairs put to the model, and its verdicts.
    FACTS_COREFERENCE_PAIRS = "facts_coreference_pairs"
    FACTS_COREFERENCE_SAME = "facts_coreference_same"
    FACTS_COREFERENCE_DIFFERENT = "facts_coreference_different"

    # Validation gate. Written identically by both entry paths.
    VALIDATED_WITHOUT_ONTOLOGY_CONTEXT = "validated_without_ontology_context"
    FACTS_VALIDATION_FINDINGS = "facts_validation_findings"
    FACTS_VALIDATION_ERRORS = "facts_validation_errors"
    FACTS_SHACL_VIOLATIONS_BEFORE = "facts_shacl_violations_before"
    FACTS_SHACL_VIOLATIONS_AFTER = "facts_shacl_violations_after"
    FACTS_SHACL_REPAIRS = "facts_shacl_repairs"
    FACTS_SHACL_AUTOFIX_PASSES = "facts_shacl_autofix_passes"
    FACTS_SHACL_AUTOFIX_REVERTED = "facts_shacl_autofix_reverted"
    #: Fact-namespace instances dropped for carrying no concrete type after
    #: aggregation; the IRIs are on ``AgentState.facts_untyped_dropped``.
    FACTS_UNTYPED_DROPPED = "facts_untyped_dropped"
    #: Instances untyped after aggregation that the gate typed from the
    #: domains and ranges of their links (against the whole ontology context,
    #: which a unit's context may have lacked), instead of dropping them.
    FACTS_UNTYPED_INFERRED = "facts_untyped_inferred"
    #: Instances dropped for stating nothing: linked to no other instance nor
    #: the document, and holding no value, only a type and names.
    FACTS_UNLINKED_DROPPED = "facts_unlinked_dropped"
    #: Statements linking a node to itself through a property not declared
    #: reflexive, dropped at the gate (``self_loop_dropped`` repairs).
    FACTS_SELF_LOOPS_DROPPED = "facts_self_loops_dropped"
    #: Nodes standing for a date that held only a label, given the typed
    #: ISO 8601 value the label names (``date_value_added`` repairs).
    FACTS_DATE_VALUES_ADDED = "facts_date_values_added"
    #: Links between instances the gate's repairs removed (SHACL prune and
    #: the untyped drop), counted after any un-merge pass.
    FACTS_LINKS_REMOVED = "facts_links_removed"
    #: Connected groups of instances in the served facts, the document node
    #: joining what it links, and instances linked to nothing (those left hold
    #: a value of their own). Both describe the served graph.
    FACTS_COMPONENTS = "facts_components"
    FACTS_ISOLATED = "facts_isolated"
    #: Labels two or more served instances share: the duplicates aggregation
    #: left, or distinct things with one name.
    FACTS_TWIN_LABELS = "facts_twin_labels"

    # Post-aggregation checks.
    STRUCTURAL_ONTOLOGY_COMPONENTS_MAX = "structural_ontology_components_max"
    CONSISTENCY_CONFLICTS = "consistency_conflicts"

Attributes

CONSISTENCY_CONFLICTS = 'consistency_conflicts' class-attribute instance-attribute
EMPTY_SNAPSHOT_REASON = 'empty_snapshot_reason' class-attribute instance-attribute
FACTS_ANCHOR_COUNT = 'facts_anchor_count' class-attribute instance-attribute
FACTS_ANCHOR_UNITS = 'facts_anchor_units' class-attribute instance-attribute
FACTS_COMPLETION_CALLS = 'facts_completion_calls' class-attribute instance-attribute
FACTS_COMPLETION_DETACHED_LINKED = 'facts_completion_detached_linked' class-attribute instance-attribute
FACTS_COMPLETION_MEASUREMENTS_RECOVERED = 'facts_completion_measurements_recovered' class-attribute instance-attribute
FACTS_COMPLETION_TRIPLES_INSERTED = 'facts_completion_triples_inserted' class-attribute instance-attribute
FACTS_COMPONENTS = 'facts_components' class-attribute instance-attribute
FACTS_COREFERENCE_DIFFERENT = 'facts_coreference_different' class-attribute instance-attribute
FACTS_COREFERENCE_PAIRS = 'facts_coreference_pairs' class-attribute instance-attribute
FACTS_COREFERENCE_SAME = 'facts_coreference_same' class-attribute instance-attribute
FACTS_CRITIC_ACCEPTED = 'facts_critic_accepted' class-attribute instance-attribute
FACTS_CRITIC_CALLS = 'facts_critic_calls' class-attribute instance-attribute
FACTS_CRITIC_FIXES_APPLIED = 'facts_critic_fixes_applied' class-attribute instance-attribute
FACTS_CRITIC_FIXES_JUNK_REFUSED = 'facts_critic_fixes_junk_refused' class-attribute instance-attribute
FACTS_CRITIC_FIXES_NOOP = 'facts_critic_fixes_noop' class-attribute instance-attribute
FACTS_CRITIC_FIXES_RESIDUAL = 'facts_critic_fixes_residual' class-attribute instance-attribute
FACTS_CRITIC_FIXES_ROLLED_BACK = 'facts_critic_fixes_rolled_back' class-attribute instance-attribute
FACTS_CRITIC_FIXES_UNRESOLVED_PREFIX = 'facts_critic_fixes_unresolved_prefix' class-attribute instance-attribute
FACTS_CRITIC_PATCHES_ROLLED_BACK = 'facts_critic_patches_rolled_back' class-attribute instance-attribute
FACTS_CRITIC_UNITS_SKIPPED = 'facts_critic_units_skipped' class-attribute instance-attribute
FACTS_CRITIC_UNITS_UNREVIEWED = 'facts_critic_units_unreviewed' class-attribute instance-attribute
FACTS_DATE_VALUES_ADDED = 'facts_date_values_added' class-attribute instance-attribute
FACTS_DOMAIN_REPAIR_CALLS = 'facts_domain_repair_calls' class-attribute instance-attribute
FACTS_DOMAIN_REPAIR_FIXED = 'facts_domain_repair_fixed' class-attribute instance-attribute
FACTS_DOMAIN_VIOLATIONS_DROPPED = 'facts_domain_violations_dropped' class-attribute instance-attribute
FACTS_FINDINGS_RESIDUAL = 'facts_findings_residual' class-attribute instance-attribute
FACTS_ISOLATED = 'facts_isolated' class-attribute instance-attribute
FACTS_LLM_REPAIR_RENDERS_FAILED = 'facts_llm_repair_renders_failed' class-attribute instance-attribute
FACTS_LLM_REPAIR_RENDERS_TOTAL = 'facts_llm_repair_renders_total' class-attribute instance-attribute
FACTS_MANDATORY_RESIDUAL = 'facts_mandatory_residual' class-attribute instance-attribute
FACTS_MANDATORY_RESIDUAL_BY_KIND = 'facts_mandatory_residual_by_kind' class-attribute instance-attribute
FACTS_MERGE_REJECTIONS_BY_REASON = 'facts_merge_rejections_by_reason' class-attribute instance-attribute
FACTS_MERGE_REPAIRS_REJECTED = 'facts_merge_repairs_rejected' class-attribute instance-attribute
FACTS_MERGE_REPAIR_PASSES = 'facts_merge_repair_passes' class-attribute instance-attribute
FACTS_MERGE_VETOES = 'facts_merge_vetoes' class-attribute instance-attribute
FACTS_REJECTED_MERGES = 'facts_rejected_merges' class-attribute instance-attribute
FACTS_REPAIR_DELETE_ONLY = 'facts_repair_delete_only' class-attribute instance-attribute
FACTS_SELF_LOOPS_DROPPED = 'facts_self_loops_dropped' class-attribute instance-attribute
FACTS_SHACL_AUTOFIX_PASSES = 'facts_shacl_autofix_passes' class-attribute instance-attribute
FACTS_SHACL_AUTOFIX_REVERTED = 'facts_shacl_autofix_reverted' class-attribute instance-attribute
FACTS_SHACL_REPAIRS = 'facts_shacl_repairs' class-attribute instance-attribute
FACTS_SHACL_VIOLATIONS_AFTER = 'facts_shacl_violations_after' class-attribute instance-attribute
FACTS_SHACL_VIOLATIONS_BEFORE = 'facts_shacl_violations_before' class-attribute instance-attribute
FACTS_STATEMENTS_WITHOUT_SUBJECT = 'facts_statements_without_subject' class-attribute instance-attribute
FACTS_STATEMENTS_WITHOUT_SUBJECT_RENDERED = 'facts_statements_without_subject_rendered' class-attribute instance-attribute
FACTS_TWIN_LABELS = 'facts_twin_labels' class-attribute instance-attribute
FACTS_UNLINKED_DROPPED = 'facts_unlinked_dropped' class-attribute instance-attribute
FACTS_UNTYPED_DROPPED = 'facts_untyped_dropped' class-attribute instance-attribute
FACTS_UNTYPED_INFERRED = 'facts_untyped_inferred' class-attribute instance-attribute
FACTS_VALIDATION_ERRORS = 'facts_validation_errors' class-attribute instance-attribute
FACTS_VALIDATION_FINDINGS = 'facts_validation_findings' class-attribute instance-attribute
ONTOLOGY_CONTEXT_MODE = 'ontology_context_mode' class-attribute instance-attribute
ONTOLOGY_CRITIC_ACCEPTED = 'ontology_critic_accepted' class-attribute instance-attribute
ONTOLOGY_CRITIC_CALLS = 'ontology_critic_calls' class-attribute instance-attribute
ONTOLOGY_CRITIC_FIXES_APPLIED = 'ontology_critic_fixes_applied' class-attribute instance-attribute
ONTOLOGY_CRITIC_FIXES_NOOP = 'ontology_critic_fixes_noop' class-attribute instance-attribute
ONTOLOGY_CRITIC_FIXES_RESIDUAL = 'ontology_critic_fixes_residual' class-attribute instance-attribute
ONTOLOGY_CRITIC_PATCHES_ROLLED_BACK = 'ontology_critic_patches_rolled_back' class-attribute instance-attribute
ONTOLOGY_CRITIC_UNITS_SKIPPED = 'ontology_critic_units_skipped' class-attribute instance-attribute
ONTOLOGY_FINDINGS_RESIDUAL = 'ontology_findings_residual' class-attribute instance-attribute
ONTOLOGY_MANDATORY_RESIDUAL = 'ontology_mandatory_residual' class-attribute instance-attribute
ONTOLOGY_PRIMARY_UNITS = 'ontology_primary_units' class-attribute instance-attribute
ONTOLOGY_SNAPSHOT_TRIPLES = 'ontology_snapshot_triples' class-attribute instance-attribute
ONTOLOGY_WRITABLE_COUNT = 'ontology_writable_count' class-attribute instance-attribute
PATCH_RETRIEVAL = 'patch_retrieval' class-attribute instance-attribute
STRUCTURAL_ONTOLOGY_COMPONENTS_MAX = 'structural_ontology_components_max' class-attribute instance-attribute
VALIDATED_WITHOUT_ONTOLOGY_CONTEXT = 'validated_without_ontology_context' class-attribute instance-attribute

RouteReason

Bases: StrEnum

Why a unit took its route. Values are wire names (run manifest, logs).

Source code in ontocast/onto/enum.py
class RouteReason(StrEnum):
    """Why a unit took its route. Values are wire names (run manifest, logs)."""

    CONTENT = "content"
    #: A label that could have dropped the unit was weak.
    WEAK_LABEL = "weak_label"
    #: A strong citations or boilerplate label the content disagrees with.
    LABEL_CONTRADICTED = "label_contradicted"
    #: A boilerplate label under a schema nobody chose: no default exclusions.
    FALLBACK_SCHEMA = "fallback_schema"
    #: A boilerplate label the request's exclude_sections did not name.
    EXCLUSION_OVERRIDDEN = "exclusion_overridden"
    #: The content alone is a reference list.
    CITATION_LIST = "citation_list"
    #: A strong citations-class label and content that agrees.
    CITATION_LABEL = "citation_label"
    #: A strong boilerplate-class label on text that states no measurement.
    BOILERPLATE = "boilerplate"
    #: Front/back matter recognised from the content.
    NON_CONTENT = "non_content"
    #: The content alone is a table of contents or a list of figures or tables.
    CONTENTS_LIST = "contents_list"
    EXCLUDED_BY_REQUEST = "excluded_by_request"
    UNDERSIZED = "undersized"

Attributes

BOILERPLATE = 'boilerplate' class-attribute instance-attribute
CITATION_LABEL = 'citation_label' class-attribute instance-attribute
CITATION_LIST = 'citation_list' class-attribute instance-attribute
CONTENT = 'content' class-attribute instance-attribute
CONTENTS_LIST = 'contents_list' class-attribute instance-attribute
EXCLUDED_BY_REQUEST = 'excluded_by_request' class-attribute instance-attribute
EXCLUSION_OVERRIDDEN = 'exclusion_overridden' class-attribute instance-attribute
FALLBACK_SCHEMA = 'fallback_schema' class-attribute instance-attribute
LABEL_CONTRADICTED = 'label_contradicted' class-attribute instance-attribute
NON_CONTENT = 'non_content' class-attribute instance-attribute
UNDERSIZED = 'undersized' class-attribute instance-attribute
WEAK_LABEL = 'weak_label' class-attribute instance-attribute

SectionLabelSource

Bases: StrEnum

Which tier gave a piece of section-label evidence. Values are wire names.

:attr:OUTLINE_UNRESOLVED marks a section the outline saw a heading for but could not name: no tier spreads a neighbour's label into it.

Source code in ontocast/onto/enum.py
class SectionLabelSource(StrEnum):
    """Which tier gave a piece of section-label evidence. Values are wire names.

    :attr:`OUTLINE_UNRESOLVED` marks a section the outline saw a heading for
    but could not name: no tier spreads a neighbour's label into it.
    """

    HEADING_PATTERN = "heading_pattern"
    HEADING_KEYWORD = "heading_keyword"
    HEADING_INHERITED = "heading_inherited"
    #: A heading no pattern or keyword named, nearest a label by embedding.
    HEADING_EMBEDDING = "heading_embedding"
    FRONT_MATTER = "front_matter"
    CONTENT_DENSITY = "content_density"
    #: A citation run cut out of a unit by the block classifier.
    CONTENT_BLOCK = "content_block"
    LLM = "llm"
    OUTLINE_UNRESOLVED = "outline_unresolved"

Attributes

CONTENT_BLOCK = 'content_block' class-attribute instance-attribute
CONTENT_DENSITY = 'content_density' class-attribute instance-attribute
FRONT_MATTER = 'front_matter' class-attribute instance-attribute
HEADING_EMBEDDING = 'heading_embedding' class-attribute instance-attribute
HEADING_INHERITED = 'heading_inherited' class-attribute instance-attribute
HEADING_KEYWORD = 'heading_keyword' class-attribute instance-attribute
HEADING_PATTERN = 'heading_pattern' class-attribute instance-attribute
LLM = 'llm' class-attribute instance-attribute
OUTLINE_UNRESOLVED = 'outline_unresolved' class-attribute instance-attribute

Status

Bases: StrEnum

Enumeration of possible workflow status values.

Source code in ontocast/onto/enum.py
class Status(StrEnum):
    """Enumeration of possible workflow status values."""

    NOT_VISITED = "not visited"
    SUCCESS = "success"
    FAILED = "failed"
    COUNTS_EXCEEDED = "counts exceeded"

Attributes

COUNTS_EXCEEDED = 'counts exceeded' class-attribute instance-attribute
FAILED = 'failed' class-attribute instance-attribute
NOT_VISITED = 'not visited' class-attribute instance-attribute
SUCCESS = 'success' class-attribute instance-attribute

UnitRoute

Bases: StrEnum

What happens to a unit before extraction. Values are wire names.

Source code in ontocast/onto/enum.py
class UnitRoute(StrEnum):
    """What happens to a unit before extraction. Values are wire names."""

    EXTRACT = "extract"
    #: Kept; the facts renderer extracts bibliographic metadata only.
    CITATIONS = "citations"
    #: Kept and flagged ``is_non_content``; checks that presume domain prose stand down.
    NON_CONTENT = "non_content"
    SKIP = "skip"

Attributes

CITATIONS = 'citations' class-attribute instance-attribute
EXTRACT = 'extract' class-attribute instance-attribute
NON_CONTENT = 'non_content' class-attribute instance-attribute
SKIP = 'skip' class-attribute instance-attribute

VectorDistance

Bases: StrEnum

Vector distance metric used when creating a vector collection.

Values match qdrant_client.http.models.Distance exactly, so existing QDRANT_DISTANCE environment values keep working. Declaring it here rather than importing Qdrant's enum keeps the Qdrant SDK off the import path of :mod:ontocast.config, which every entry point loads.

Source code in ontocast/onto/enum.py
class VectorDistance(StrEnum):
    """Vector distance metric used when creating a vector collection.

    Values match ``qdrant_client.http.models.Distance`` exactly, so existing
    ``QDRANT_DISTANCE`` environment values keep working. Declaring it here
    rather than importing Qdrant's enum keeps the Qdrant SDK off the import
    path of :mod:`ontocast.config`, which every entry point loads.
    """

    COSINE = "Cosine"
    DOT = "Dot"
    EUCLID = "Euclid"
    MANHATTAN = "Manhattan"

Attributes

COSINE = 'Cosine' class-attribute instance-attribute
DOT = 'Dot' class-attribute instance-attribute
EUCLID = 'Euclid' class-attribute instance-attribute
MANHATTAN = 'Manhattan' class-attribute instance-attribute

VectorStoreBackend

Bases: StrEnum

Which vector store implementation backs ontology patch retrieval.

Two backends are supported: QDRANT (server) and LANCEDB (embedded), each shipped as its own optional extra.

AUTO infers the backend from whichever connection setting is populated -- Qdrant if QDRANT_URI is set, LanceDB if it is enabled, otherwise NONE. NONE is the default for an unconfigured install: ontology context then comes from a single working ontology, which is the default :class:OntologyContextMode. Naming a backend explicitly makes the choice fail loudly when its configuration is missing.

Source code in ontocast/onto/enum.py
class VectorStoreBackend(StrEnum):
    """Which vector store implementation backs ontology patch retrieval.

    Two backends are supported: ``QDRANT`` (server) and ``LANCEDB`` (embedded),
    each shipped as its own optional extra.

    ``AUTO`` infers the backend from whichever connection setting is populated
    -- Qdrant if ``QDRANT_URI`` is set, LanceDB if it is enabled, otherwise
    ``NONE``. ``NONE`` is the default for an unconfigured install: ontology
    context then comes from a single working ontology, which is the default
    :class:`OntologyContextMode`. Naming a backend explicitly makes the choice
    fail loudly when its configuration is missing.
    """

    AUTO = "auto"
    QDRANT = "qdrant"
    LANCEDB = "lancedb"
    NONE = "none"

Attributes

AUTO = 'auto' class-attribute instance-attribute
LANCEDB = 'lancedb' class-attribute instance-attribute
NONE = 'none' class-attribute instance-attribute
QDRANT = 'qdrant' class-attribute instance-attribute

WorkflowNode

Bases: StrEnum

Enumeration of workflow nodes in the processing pipeline.

Source code in ontocast/onto/enum.py
class WorkflowNode(StrEnum):
    """Enumeration of workflow nodes in the processing pipeline."""

    CONVERT_TO_TEXT = "Convert to Text"
    CHUNK = "Chunk Text"
    RESOLVE_HOME_ONTOLOGY = "Resolve Home Ontology"
    ONTOLOGY_PLAN = "Plan Ontology"
    TEXT_TO_ONTOLOGY = "Text to Ontology"
    TEXT_TO_FACTS = "Text to Facts"
    CRITICISE_ONTOLOGY = "Criticise Ontology"
    CRITICISE_FACTS = "Criticise Facts"
    SERIALIZE = "Serialize"
    RENDER_ONTOLOGY_UPDATE = "Update Ontology"
    RENDER_FACTS = "Render Facts"
    NORMALIZE_ONTOLOGY_UPDATES = "Normalize Ontology Updates"
    MERGE_FACTS = "Merge Facts"
    RESOLVE_COREFERENCE = "Resolve Coreference"
    VALIDATE_FACTS = "Validate Facts"
    PLAN_EXTERNAL_EVIDENCE = "Plan External Evidence"
    FETCH_EXTERNAL_EVIDENCE = "Fetch External Evidence"
    STRUCTURAL_CHECK = "Structural Check"
    CONSISTENCY_CRITIC = "Consistency Critic"

Attributes

CHUNK = 'Chunk Text' class-attribute instance-attribute
CONSISTENCY_CRITIC = 'Consistency Critic' class-attribute instance-attribute
CONVERT_TO_TEXT = 'Convert to Text' class-attribute instance-attribute
CRITICISE_FACTS = 'Criticise Facts' class-attribute instance-attribute
CRITICISE_ONTOLOGY = 'Criticise Ontology' class-attribute instance-attribute
FETCH_EXTERNAL_EVIDENCE = 'Fetch External Evidence' class-attribute instance-attribute
MERGE_FACTS = 'Merge Facts' class-attribute instance-attribute
NORMALIZE_ONTOLOGY_UPDATES = 'Normalize Ontology Updates' class-attribute instance-attribute
ONTOLOGY_PLAN = 'Plan Ontology' class-attribute instance-attribute
PLAN_EXTERNAL_EVIDENCE = 'Plan External Evidence' class-attribute instance-attribute
RENDER_FACTS = 'Render Facts' class-attribute instance-attribute
RENDER_ONTOLOGY_UPDATE = 'Update Ontology' class-attribute instance-attribute
RESOLVE_COREFERENCE = 'Resolve Coreference' class-attribute instance-attribute
RESOLVE_HOME_ONTOLOGY = 'Resolve Home Ontology' class-attribute instance-attribute
SERIALIZE = 'Serialize' class-attribute instance-attribute
STRUCTURAL_CHECK = 'Structural Check' class-attribute instance-attribute
TEXT_TO_FACTS = 'Text to Facts' class-attribute instance-attribute
TEXT_TO_ONTOLOGY = 'Text to Ontology' class-attribute instance-attribute
VALIDATE_FACTS = 'Validate Facts' class-attribute instance-attribute