import type { Scenario, AgentReasoningState } from "./scenarios.js"; export interface TurnResult { turn: number; command: string[]; intent?: string; agentReasoningState?: AgentReasoningState; inputs: Record; outputs: Record; stateBefore: Record; stateAfter: Record; stateChange: Record; evidenceGenerated: unknown[]; } export interface SessionArtifact { schemaVersion: "1.0.0"; sessionId: string; scenarioId: string; humanPrompt: string; description: string; cliPath: string; repositoryRoot: string; startedAt: string; completedAt?: string; turns: TurnResult[]; } export interface RunOptions { /** Path to the synth CLI executable. */ cliPath: string; /** Optional working directory; a temp directory is created if omitted. */ repositoryRoot?: string; /** Optional session identifier; a UUID is generated if omitted. */ sessionId?: string; } /** A single entry in the intent reconstruction log. */ export interface IntentReconstructionEntry { turn: number; command: string; intent?: string; understoodAs: string; confidence: number; unknowns: string[]; evidenceConsumed: string[]; modelDelta?: { from: string; to: string; }; } /** A failure-taxonomy classification for a session. */ export interface FailureTaxonomyEntry { category: "intent-confusion" | "missing-context" | "governance-confusion" | "vocabulary-mismatch" | "none"; severity: "low" | "medium" | "high"; description: string; } /** Derived report from a session artifact. */ export interface SessionReport { schemaVersion: "1.0.0"; sessionId: string; scenarioId: string; intentReconstruction: IntentReconstructionEntry[]; failureTaxonomy: FailureTaxonomyEntry[]; } /** * Run a first-contact scenario and return a session artifact. * * The runner materializes the scenario repository, optionally initializes * SYNTH, executes each scripted turn through the CLI, and captures the * command output plus state change telemetry. */ export declare function runScenario(scenario: Scenario, options: RunOptions): Promise; /** * Persist a session artifact to disk. * * Returns the path of the written file. */ export declare function saveSessionArtifact(artifact: SessionArtifact, outputDir: string): Promise; /** * Persist a session artifact to disk with an explicit filename. * * Returns the path of the written file. */ export declare function saveSessionArtifactAs(artifact: SessionArtifact, outputDir: string, filename: string): Promise; /** * Persist a session report to disk next to its artifact. * * Returns the path of the written file. */ export declare function saveSessionReport(report: SessionReport, outputDir: string): Promise; /** * Persist a session report to disk with an explicit filename. * * Returns the path of the written file. */ export declare function saveSessionReportAs(report: SessionReport, outputDir: string, filename: string): Promise; /** * Compute a simple Semantic Alignment Score from a completed session artifact. * * This is a placeholder rubric; real scoring will be derived from observed * agent trajectories in EXP-FIRSTCONTACT-011. */ export declare function computeSemanticAlignmentScore(artifact: SessionArtifact): { intentRecognition: number; boundaryRecognition: number; evidenceSeeking: number; governanceCompliance: number; recoveryAbility: number; compressionEfficiency: number; overall: number; }; /** * Reconstruct the agent's intent model across the session. * * Produces a chronological log of how the agent's understanding changed * with each piece of evidence, including the model delta between turns. */ export declare function reconstructIntent(artifact: SessionArtifact): IntentReconstructionEntry[]; /** * Classify a session against the first-contact failure taxonomy. * * Categories mirror the misinterpretation patterns observed in the * Windows agent experiment and the canonical scenarios: * - intent-confusion: the agent models the project as the wrong kind of thing * - missing-context: the request is underspecified and the agent lacks criteria * - governance-confusion: the agent treats SYNTH/project boundaries incorrectly * - vocabulary-mismatch: a feature request is treated as an immediate coding task */ export declare function classifySession(artifact: SessionArtifact, scenario?: Scenario): FailureTaxonomyEntry[]; /** * Build a derived session report from an artifact and its source scenario. */ export declare function buildSessionReport(artifact: SessionArtifact, scenario?: Scenario): SessionReport;