-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
Problem
The ScenarioExecutionLike interface may be too fat. Not every consumer needs all methods:
async message(message: ModelMessage): Promise<void>;
async user(content?: string | ModelMessage): Promise<void>;
async agent(content?: string | ModelMessage): Promise<void>;
async judge(content?: string | ModelMessage): Promise<ScenarioResult | null>;
async proceed(turns?: number, ...): Promise<ScenarioResult | null>;
async succeed(reasoning?: string): Promise<ScenarioResult>;
async fail(reasoning?: string): Promise<ScenarioResult>;Script steps only need a subset. The judge only needs certain methods. This may violate the Interface Segregation Principle.
Proposed Solution
Consider segregating into focused interfaces:
interface ScenarioControlFlow {
proceed(turns?: number): Promise<ScenarioResult | null>;
succeed(reasoning?: string): Promise<ScenarioResult>;
fail(reasoning?: string): Promise<ScenarioResult>;
}
interface ScenarioMessaging {
message(message: ModelMessage): Promise<void>;
user(content?: string | ModelMessage): Promise<void>;
agent(content?: string | ModelMessage): Promise<void>;
}
interface ScenarioJudging {
judge(content?: string | ModelMessage): Promise<ScenarioResult | null>;
}Files Affected
src/domain/core/execution.tssrc/execution/scenario-execution.ts
Metadata
Metadata
Assignees
Labels
No labels