/** * step-context-manager.ts * * Persists and retrieves per-step execution state to/from disk so that the * healing and reporting systems always have accurate, up-to-date information * about what happened at each step of a test run. * * A StepContext is saved before every step (status: "pending") and updated * immediately after (status: "passed" / "failed" / "healed"). This means * even if the process is interrupted mid-run, the disk record reflects what * actually completed. * * Files are stored as individual JSON files: * /contexts/-step-.json * * Role in the overall flow: * Executor → StepContextManager.save() / .update() * FailureHandler → StepContextManager.update() * heal_test → StepContextManager.load() * ReportGenerator → StepContextManager.loadAll() */ import { StepContext } from '../types'; /** * Reads and writes per-step execution state files to disk. */ export declare class StepContextManager { private contextsDir; /** * @param artifactsDir - Root artifacts directory. Step contexts are stored * in a "contexts" sub-folder. */ constructor(artifactsDir: string); /** * Write a StepContext to disk, creating the contexts directory if needed. * Overwrites any existing file for the same test + step combination. * * @param ctx - The StepContext to save. */ save(ctx: StepContext): Promise; /** * Load the StepContext for a specific step of a test. * * @param testName - The human-readable test name. * @param stepIndex - Zero-based step index. * @returns The StepContext if it exists on disk, or null. */ load(testName: string, stepIndex: number): Promise; /** * Load all StepContexts for a given test, sorted by filename (which sorts * by step index). * * @param testName - The human-readable test name. * @returns An ordered array of StepContext objects for every step that was saved. */ loadAll(testName: string): Promise; /** * Merge a partial update into an existing saved StepContext. * If no saved context exists for the given step, the update is silently ignored. * * @param testName - The human-readable test name. * @param stepIndex - Zero-based step index of the context to update. * @param patch - Partial StepContext fields to merge in (e.g. { status: 'healed', healedLocator: '...' }). */ update(testName: string, stepIndex: number, patch: Partial): Promise; } //# sourceMappingURL=step-context-manager.d.ts.map