Skip to content

Interface: GeneratedScenario

@kortexya/reasoninglayer


@kortexya/reasoninglayer / 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.

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 camelCase curriculumStages or discoveredTools is 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.

optional axioms?: Record<string, unknown>[]

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

OWL-style axioms over sorts and features (staged builder).


optional beliefs?: 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).


optional competency_questions?: Record<string, unknown>[]

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

Competency questions, recorded as proposed (staged builder).


optional computed_features?: Record<string, unknown>[]

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

Computed features, declared as feature equations (staged builder).


optional constraints?: Record<string, unknown>[]

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

Generic constraints.


optional curriculum_stages?: Record<string, unknown>[]

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

Curriculum stages.


optional discovered_tools?: Record<string, unknown>[]

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

Tool registrations.


optional fluents?: 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).


optional goal?: 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.


optional groundings?: Record<string, unknown>[]

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

Concept groundings.


optional guardConstraints?: Record<string, unknown>[]

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

Guard (comparison) constraints.


optional pipelineStages?: Record<string, unknown>[]

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

Engine pipeline stages.


optional rules?: ScenarioRule[]

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

Inference rules to register. Omit it for a scenario with none.

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.


optional scope?: 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.


optional sensorPoints?: Record<string, unknown>[]

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

LLM sensor points.


optional sorts?: 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.


optional temporalConstraints?: Record<string, unknown>[]

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

Allen temporal constraints.


optional use_cases?: Record<string, unknown>[]

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

Use cases the model serves (staged builder).


optional webhookActions?: Record<string, unknown>[]

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

Webhook actions.