Skip to content

Type Alias: DraftRulesResponse

@kortexya/reasoninglayer


@kortexya/reasoninglayer / Inference / DraftRulesResponse

Type Alias: DraftRulesResponse

DraftRulesResponse = { questions: RuleDraftClarificationQuestionDto[]; sessionId: string; status: "needs_clarification"; understood: object; } | { explanation?: string | null; generationTimeMs: number; rules: RuleDraftDto[]; status: "complete"; warnings: string[]; }

Defined in: src/types/inference.ts:1029

Response for a rules draft.

Type Declaration

{ questions: RuleDraftClarificationQuestionDto[]; sessionId: string; status: "needs_clarification"; understood: object; }

questions

questions: RuleDraftClarificationQuestionDto[]

Clarification questions the user must answer.

sessionId

sessionId: string

Session ID to echo back on the follow-up request.

status

status: "needs_clarification"

Discriminator: clarification is needed.

understood

understood: object

What the model already understood from the description.

{ explanation?: string | null; generationTimeMs: number; rules: RuleDraftDto[]; status: "complete"; warnings: string[]; }

explanation?

optional explanation: string | null

Plain-language summary of what the drafted rules mean.

generationTimeMs

generationTimeMs: number

Time taken to generate the drafts, in milliseconds.

rules

rules: RuleDraftDto[]

The drafted rules, validated but NOT written to the knowledge base.

status

status: "complete"

Discriminator: drafting is complete.

warnings

warnings: string[]

Non-fatal issues (e.g. sorts that do not exist in this tenant yet).

Remarks

Discriminated union by the status field:

  • "needs_clarification" — the model needs more information before drafting.
  • "complete" — validated drafts are ready for human review.

Serialization format: Untagged (FeatureValueDto) — see RuleTermDraftDto.

Drafting never writes to the knowledge base. Nothing is persisted until the caller submits an approved draft through addRule / bulkAddRules.