Skip to content

Type Alias: ScenarioSortProvenance

@kortexya/reasoninglayer


@kortexya/reasoninglayer / ScenarioSortProvenance

ScenarioSortProvenance = { kind: "model"; model?: string; } | { kind: "imported"; ontology: string; original_id: string; }

Defined in: src/types/scenarios.ts:324

Where a scenario sort (or fluent) came from — its provenance key, recorded as the materialized sort’s origin.

{ kind: "model"; model?: string; }

kind: "model"

Discriminator: a language model proposed the sort.

optional model?: string

The model that proposed it, when known.


{ kind: "imported"; ontology: string; original_id: string; }

kind: "imported"

Discriminator: an ontology import brought the sort in.

ontology: string

The source ontology (IRI or file name).

original_id: string

The element’s id in that ontology.

Sent byte for byte inside GeneratedScenario, so the keys are the engine’s own snake_case (original_id), discriminated by kind:

  • {kind: "model", model?} — proposed by a language model (ontology generation, a builder stage); recorded as LlmExtracted. The engine stamps this on every sort and fluent of a scenario it generated, overwriting whatever the model wrote.
  • {kind: "imported", ontology, original_id} — brought in by an ontology import (ontology is the source IRI or file name, original_id the element’s id there); recorded as Imported.

Without provenance the sort is Manual, credited to the caller. System cannot be claimed. A fluent’s provenance is recorded on both the fluent sort and the event sort it creates.

const provenance: ScenarioSortProvenance = {
kind: 'imported',
ontology: 'https://example.org/pizza.owl',
original_id: 'Margherita',
};
const scenario: GeneratedScenario = {
sorts: [{ name: 'margherita', parents: ['pizza'], provenance }],
};