import type { WorkOrder } from "./prompts.js"; import type { AcceptanceTestRun, ClientPlatform, DriverDryRun, Scenario, ScenarioSlice, TestRun, VerticalSlice } from "./types.js"; /** * Outer loop — the acceptance test, authored once per slice. Each * model-performing method receives its instructions as order.prompt; * methods without an order are executors or plumbing. */ export interface AcceptanceTestAuthor { receiveRunInstructions(instructions: readonly string[]): Promise; addDslMethods(order: WorkOrder, slice: ScenarioSlice): Promise; writeAcceptanceTest(order: WorkOrder, slice: ScenarioSlice, template: VerticalSlice): Promise; /** May throw PreconditionNotReachableThroughUi instead of seeding behind the UI. */ implementProtocolDriverSteps(order: WorkOrder, slice: ScenarioSlice): Promise; ensureSelectorsAreShared(order: WorkOrder): Promise; /** * Deterministic, no model: strip every "@wip" work-in-progress marker * from the acceptance spec files. The spec is authored @wip-titled (so * it can land on the trunk before its implementation exists — the CI * acceptance jobs exclude @wip) and the FINAL slice commit is exactly * the moment it goes green, so the orchestrator calls this immediately * before it. Idempotent; only one slice is ever in flight, so every * marker in the tree belongs to the current slice. */ removeWipMarkers(): Promise; /** Execute the slice's acceptance test locally (locally-tested clients only). */ runAcceptanceTest(slice: ScenarioSlice, platform: ClientPlatform): Promise; /** Judge a remotely executed run's output: red for the right reason? */ judgeFailureReason(order: WorkOrder, run: TestRun): Promise; /** * The acceptance test PASSED before this run implemented anything. Judge * whether the behavior is ALREADY implemented (true — a prior run or a * hand-built slice did it, so the test is a legitimate regression test and * the slice is already satisfied) or the test is VACUOUS (false — it would * pass with the behavior missing). Independent of the authoring session. */ judgeAcceptancePrematurePass(order: WorkOrder, slice: ScenarioSlice, platform: ClientPlatform): Promise; /** * Deterministic: does an acceptance test titled with this scenario exist for * this client? (Read from the files — no model, no stack.) When false, the * scenario is a gap by construction: nothing to run, no judgment needed — * this is the "fresh feature, zero tests" case. */ hasAcceptanceTest(scenario: Scenario, platform: ClientPlatform): boolean; /** * Coverage-assessment for a scenario whose acceptance test EXISTS: RUN it * (filtered to this scenario) and report "pass" or "fail". The trustworthy * signal — the real test, not a judgment — used when re-running a feature * whose tests are already present. */ runScenarioAcceptance(scenario: Scenario, platform: ClientPlatform): Promise<"pass" | "fail">; /** Fix the typo/setup bug so the next run can fail for the right reason. */ fixWrongReasonFailure(order: WorkOrder, run: AcceptanceTestRun): Promise; /** Execute the acceptance test locally as a driver dry-run (basic mode, slice end). */ dryRunAcceptanceTest(slice: ScenarioSlice, platform: ClientPlatform): Promise; /** Judge a remote run's output as a dry-run: did the driver execute? */ judgeDriverExecution(order: WorkOrder, run: TestRun): Promise; /** Fix the selector or driver step the dry-run crashed on. */ fixDriverDefect(order: WorkOrder, dryRun: DriverDryRun): Promise; }