Type Alias: DraftRulesResponse
@kortexya/reasoninglayer / DraftRulesResponse
Type Alias: DraftRulesResponse
Section titled “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:2025
Response for a rules draft.
Union Members
Section titled “Union Members”Type Literal
Section titled “Type Literal”{ questions: RuleDraftClarificationQuestionDto[]; sessionId: string; status: "needs_clarification"; understood: object; }
questions
Section titled “questions”questions:
RuleDraftClarificationQuestionDto[]
Clarification questions the user must answer.
sessionId
Section titled “sessionId”sessionId:
string
Session ID to echo back on the follow-up request.
status
Section titled “status”status:
"needs_clarification"
Discriminator: clarification is needed.
understood
Section titled “understood”understood:
object
What the model already understood from the description.
Type Literal
Section titled “Type Literal”{ explanation?: string | null; generationTimeMs: number; rules: RuleDraftDto[]; status: "complete"; warnings: string[]; }
explanation?
Section titled “explanation?”
optionalexplanation?:string|null
Plain-language summary of what the drafted rules mean.
generationTimeMs
Section titled “generationTimeMs”generationTimeMs:
number
Time taken to generate the drafts, in milliseconds.
rules:
RuleDraftDto[]
The drafted rules, validated but NOT written to the knowledge base.
status
Section titled “status”status:
"complete"
Discriminator: drafting is complete.
warnings
Section titled “warnings”warnings:
string[]
Non-fatal issues (e.g. sorts that do not exist in this tenant yet).
Remarks
Section titled “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 (RuleDraftFeatureValue) — see RuleTermDraftDto.
Drafting never writes to the knowledge base. Nothing is persisted until the caller
submits an approved draft through addRule / bulkAddRules.