Interface: GeneratedScenario
@kortexya/reasoninglayer / GeneratedScenario
Interface: GeneratedScenario
Section titled “Interface: GeneratedScenario”Defined in: src/types/scenarios.ts:380
A GeneratedScenario: the scenario payload of ontology.generate(), or a
schema-only scenario built from an imported vocabulary.
Remarks
Section titled “Remarks”Sent byte for byte, so every key must be the engine’s own spelling — and the spellings are mixed:
- camelCase only:
webhookActions,temporalConstraints,guardConstraints,pipelineStages,sensorPoints. Since engine #474 their snake_case forms (webhook_actions, …) are IGNORED, without an error; - snake_case only:
curriculum_stages,discovered_tools,use_cases,competency_questions,computed_features. A camelCasecurriculumStagesordiscoveredToolsis IGNORED, without an error; - one word:
sorts,beliefs,rules,goal,groundings,constraints,fluents,axioms,scope.
No key is required: every collection defaults to empty, so a vocabulary
import sends sorts alone. goal is optional: a scenario without one
materializes no agent goal
(MaterializeScenarioResponse.goalCreated is false). Keys not
listed here are ignored.
The same rule holds inside the collections. A curriculum stage is
{stage_number, name, concepts, prerequisites?, mastery_threshold?}, a
grounding {concept, external_id, label, score, source, synonyms?}, a
discovered tool {name, description, protocol?, endpoint?, capabilities?, input_schema?}, a temporal constraint {relation, interval_a, interval_b}. A webhook action’s webhookUrl, requiredInputs,
channelDetail and callbackOutputs, a pipeline stage’s sensorPoint and
a sensor point’s maxTokens and allowedIntents are camelCase (their
snake_case forms are accepted too). A sort’s provenance and a fluent’s
are ScenarioSortProvenance. The features of a belief, rule term, goal or
constraint, and a webhook action’s inputs and callbackOutputs, are
user data: their keys and nested values are stored as written.
ontology.generate() returns its scenario in exactly these spellings, so
passing it through unchanged is always correct.
Properties
Section titled “Properties”axioms?
Section titled “axioms?”
optionalaxioms?:Record<string,unknown>[]
Defined in: src/types/scenarios.ts:429
OWL-style axioms over sorts and features (staged builder).
beliefs?
Section titled “beliefs?”
optionalbeliefs?:Record<string,unknown>[]
Defined in: src/types/scenarios.ts:392
Belief instances (typed facts) to assert. Omit it for a schema-only scenario: the engine builds sorts alone (a scenario needs at least one sort, belief or rule, and a goal’s own sort does not count).
competency_questions?
Section titled “competency_questions?”
optionalcompetency_questions?:Record<string,unknown>[]
Defined in: src/types/scenarios.ts:435
Competency questions, recorded as proposed (staged builder).
computed_features?
Section titled “computed_features?”
optionalcomputed_features?:Record<string,unknown>[]
Defined in: src/types/scenarios.ts:443
Computed features, declared as feature equations (staged builder).
constraints?
Section titled “constraints?”
optionalconstraints?:Record<string,unknown>[]
Defined in: src/types/scenarios.ts:411
Generic constraints.
curriculum_stages?
Section titled “curriculum_stages?”
optionalcurriculum_stages?:Record<string,unknown>[]
Defined in: src/types/scenarios.ts:413
Curriculum stages.
discovered_tools?
Section titled “discovered_tools?”
optionaldiscovered_tools?:Record<string,unknown>[]
Defined in: src/types/scenarios.ts:415
Tool registrations.
fluents?
Section titled “fluents?”
optionalfluents?:Record<string,unknown>[]
Defined in: src/types/scenarios.ts:441
Fluents: values of an entity that change over its life, each materialized
as a fluent sort and its event sort. A fluent may carry provenance
(ScenarioSortProvenance).
optionalgoal?:Record<string,unknown>
Defined in: src/types/scenarios.ts:409
The agent’s goal: {sort, features?, priority?}. Omit it for a scenario with no agent.
groundings?
Section titled “groundings?”
optionalgroundings?:Record<string,unknown>[]
Defined in: src/types/scenarios.ts:417
Concept groundings.
guardConstraints?
Section titled “guardConstraints?”
optionalguardConstraints?:Record<string,unknown>[]
Defined in: src/types/scenarios.ts:419
Guard (comparison) constraints.
pipelineStages?
Section titled “pipelineStages?”
optionalpipelineStages?:Record<string,unknown>[]
Defined in: src/types/scenarios.ts:421
Engine pipeline stages.
rules?
Section titled “rules?”
optionalrules?:ScenarioRule[]
Defined in: src/types/scenarios.ts:407
Inference rules to register. Omit it for a scenario with none.
Remarks
Section titled “Remarks”Rule features (and the goal and standalone constraints) use the REST rule
encoding: "?X", {"name":"?X"} and {"_var":"?X"} are variables, and a
literal string that starts with ? must be written as the typed envelope
{"type":"String","value":"?x"}. Each rule runs the same checks
POST /api/v1/inference/rules runs: a refused rule is not written and is
named in the response’s warnings. A sort a rule names that sorts does
not declare is created under thing before the rules are authored, so it
is not refused here (only UpdateScenarioRequest.addRules refuses
one). Each rule is a ScenarioRule.
scope?
Section titled “scope?”
optionalscope?:Record<string,unknown>
Defined in: src/types/scenarios.ts:431
The model’s declared scope. Accepted and not written by materialization: ontology.putScope stores a scope.
sensorPoints?
Section titled “sensorPoints?”
optionalsensorPoints?:Record<string,unknown>[]
Defined in: src/types/scenarios.ts:423
LLM sensor points.
sorts?
Section titled “sorts?”
optionalsorts?:Record<string,unknown>[]
Defined in: src/types/scenarios.ts:386
Sorts to create or reuse. A sort may carry provenance
(ScenarioSortProvenance); without it the sort is credited to the
caller. Defaults to empty.
temporalConstraints?
Section titled “temporalConstraints?”
optionaltemporalConstraints?:Record<string,unknown>[]
Defined in: src/types/scenarios.ts:425
Allen temporal constraints.
use_cases?
Section titled “use_cases?”
optionaluse_cases?:Record<string,unknown>[]
Defined in: src/types/scenarios.ts:433
Use cases the model serves (staged builder).
webhookActions?
Section titled “webhookActions?”
optionalwebhookActions?:Record<string,unknown>[]
Defined in: src/types/scenarios.ts:427
Webhook actions.