fix: harden structured configuration comparisons (#467)

* refactor(process): split ownership observation helpers

* fix: compare structured configuration canonically

* test(conformance): tolerate Markdown line wrapping

* refactor: name caught values explicitly
This commit is contained in:
morluto
2026-08-09 11:58:01 +08:00
committed by GitHub
parent 8f229ede70
commit 6901edc05d
15 changed files with 319 additions and 199 deletions
@@ -218,7 +218,7 @@ const executeStep = async (input: {
const remaining = scenario.limits.max_duration_ms - elapsed;
if (remaining <= 0) throw new Error("Scenario duration limit reached");
await session.perform(action, remaining, signal);
} catch (cause) {
} catch (cause: unknown) {
status = requestCancelled() ? "cancelled" : "failed";
error = session.redactError(cause);
}
@@ -376,7 +376,7 @@ export class PlaywrightBrowserScenarioProvider
): Promise<Result<BrowserScenarioCapture, AnalysisError>> {
try {
return ok(await runScenario(this.factory, scenario, options));
} catch (cause) {
} catch (cause: unknown) {
if (cause instanceof AnalysisError) return err(cause);
return err(
new ProviderAdapterError(
+4 -4
View File
@@ -138,9 +138,9 @@ export const openPlaywrightScenarioBrowser = async (
);
await configureAttachedEnvironment(target.context, target.page, scenario);
return { ...target, browser, profilePath: undefined };
} catch (error) {
} catch (cause: unknown) {
await browser.close();
throw error;
throw cause;
}
}
@@ -174,9 +174,9 @@ export const openPlaywrightScenarioBrowser = async (
}
const page = context.pages()[0] ?? (await context.newPage());
return { context, page, browser, profilePath };
} catch (error) {
} catch (cause: unknown) {
await rm(profilePath, { recursive: true, force: true, maxRetries: 3 });
throw error;
throw cause;
}
};
+4 -4
View File
@@ -297,11 +297,11 @@ export class PlaywrightScenarioSession implements BrowserScenarioSessionPort {
remaining(),
options.signal,
);
} catch (error) {
} catch (cause: unknown) {
void opening
.then((lateOpened) => closePlaywrightScenarioBrowser(lateOpened))
.catch(() => undefined);
throw error;
throw cause;
}
try {
await withPlaywrightExecutionBoundary(
@@ -336,9 +336,9 @@ export class PlaywrightScenarioSession implements BrowserScenarioSessionPort {
options.signal,
);
return session;
} catch (error) {
} catch (cause: unknown) {
await closePlaywrightScenarioBrowser(opened);
throw error;
throw cause;
}
}