import { spawnTree } from '../lib/tree-spawn'; import { type DeployCommonOptions } from './deploy'; export interface JourneyDefinition { name: string; command: string; junit: string; timeout_s?: number; } export interface JourneysConfig { journeys: JourneyDefinition[]; } /** * Load `.project-ai/JOURNEYS.yaml`, fail-closed on every malformed field: a * config half-read is a suite half-run, and (GOVERNOR_POLICY precedent) a gate * input must never be guessed at. `absent` is distinct from `error` so the * caller can print setup guidance rather than a parse complaint. */ export declare function loadJourneysConfig(cwd: string, readFile?: (p: string) => string): { config: JourneysConfig; } | { error: string; } | { absent: true; }; export interface SuiteRunResult { name: string; /** `passed`/`failed` mean the suite ran and its artifact is trusted evidence. */ outcome: 'passed' | 'failed' | 'runner-error'; passed?: number; failed?: number; skipped?: number; durationS: number; /** sha256 hex of the artifact bytes — absent on runner-error. */ digest?: string; detail: string; } /** * Run one journey and judge its artifact. Every non-`runner-error` outcome is * backed by an artifact THIS spawn (re)wrote; every refusal states why, because * a silent skip would read as a pass. * * The exit-code/artifact reconciliation is deliberately asymmetric, and both * directions are fail-closed: an artifact reporting failures is trusted over a * happy exit code (failing evidence posts, the gate holds), but a happy * artifact is NOT trusted over a failing exit code — something failed that the * artifact did not capture, and certifying it would post passing evidence for * a run whose own runner disagreed. */ export declare function runJourney(def: JourneyDefinition, options: { cwd: string; timeoutS?: number; childEnv?: Record; /** Injectable for tests that exercise judgement without a real spawn. */ exec?: typeof spawnTree; }): Promise; /** * One digest for the posted evidence: the artifact's own sha256 for a single * suite; for several, the sha256 of their hex digests joined by newlines in * run order — deterministic, and any artifact byte change changes it. */ export declare function compositeDigest(digests: string[]): string; export interface JourneyRunOptions extends DeployCommonOptions { env?: string; suite?: string; timeout?: string; deployId?: string; noPost?: boolean; /** Injectable for tests. */ exec?: typeof spawnTree; readFile?: (p: string) => string; } export declare function journeyRunCommand(options?: JourneyRunOptions): Promise; export interface JourneyListOptions { json?: boolean; cwd?: string; readFile?: (p: string) => string; } export declare function journeyListCommand(options?: JourneyListOptions): boolean; //# sourceMappingURL=journey.d.ts.map