mirror of
https://github.com/morluto/rea.git
synced 2026-11-09 16:26:36 +00:00
refactor!: simplify runtime tools and remove replay engines (#572)
* fix(hopper): report unavailable procedure body coverage * refactor!: simplify runtime tools and remove replay engines Keep direct inspection, capture, and comparison tools. Bind handlers to named contracts and let agents compose experiments with commands and local fixture servers. BREAKING CHANGE: Remove controlled replay, Node characterization, finite replay-machine, managed runtime planning, and redundant string-tracing tools. Retire process replay, shims, reactive scenarios, custom checkpoints, and active browser replay and origin-scope inputs.
This commit is contained in:
1 parent
c6d3bdf597
commit
e07b81649e
258 files changed
+1193
-22444
No files matched your search
@@ -7,11 +7,6 @@ import {
|
||||
traceApplicationFeatureEvidenceValidated,
|
||||
} from "./application/JavaScriptApplicationWorkflowService.js";
|
||||
import { traceJavaScriptSemanticsEvidenceValidated } from "./application/JavaScriptSemanticTraceService.js";
|
||||
import { runControlledReplay } from "./application/JavaScriptReplayService.js";
|
||||
import {
|
||||
executeNodeCharacterization,
|
||||
prepareNodeCharacterization,
|
||||
} from "./application/NodeRuntimeCharacterizationService.js";
|
||||
import {
|
||||
evaluateReconstructionCoverage,
|
||||
reconstructionCoverageEvaluationInputSchema,
|
||||
@@ -27,10 +22,6 @@ import {
|
||||
} from "./domain/errors.js";
|
||||
import { jsonValueSchema, type JsonValue } from "./domain/jsonValue.js";
|
||||
import type { Logger } from "./logger.js";
|
||||
import { parseConfig } from "./config.js";
|
||||
import { LinuxJavaScriptReplayRunner } from "./replay/LinuxJavaScriptReplayRunner.js";
|
||||
import { SystemJavaScriptReplayHost } from "./replay/SystemJavaScriptReplayHost.js";
|
||||
import type { AppConfig } from "./config.js";
|
||||
import { traceApplicationFeatureInputSchema } from "./domain/javascriptFeatureTraceSchemas.js";
|
||||
import { traceJavaScriptSemanticsInputSchema } from "./domain/javascriptSemanticTraceSchemas.js";
|
||||
import { compareApplicationVersionsInputSchema } from "./domain/javascriptApplicationVersionComparisonSchemas.js";
|
||||
@@ -45,7 +36,6 @@ type CliInstance = ReturnType<typeof Cli.create>;
|
||||
export const registerApplicationCommands = (
|
||||
cli: ReturnType<typeof Cli.create>,
|
||||
logger: Logger,
|
||||
environment: Readonly<Record<string, string | undefined>> = process.env,
|
||||
): void => {
|
||||
registerJsonCommand({
|
||||
cli,
|
||||
@@ -92,52 +82,6 @@ export const registerApplicationCommands = (
|
||||
inputSchema: compareJavaScriptExportShapesInputSchema,
|
||||
workflow: compareJavaScriptExportShapesEvidenceValidated,
|
||||
});
|
||||
cli.command(CLI_COMMANDS.runControlledReplay, {
|
||||
description:
|
||||
"Plan or execute an extracted-module replay in the isolated Linux sandbox",
|
||||
args: z.object({
|
||||
inputJson: z.string().describe("Inline replay JSON or JSON file path"),
|
||||
}),
|
||||
run: ({ args }) =>
|
||||
logCliCommand(logger, CLI_COMMANDS.runControlledReplay, async () => {
|
||||
const input = await parseCliJsonInput(
|
||||
args.inputJson,
|
||||
CLI_COMMANDS.runControlledReplay,
|
||||
);
|
||||
if (!input.ok) return input.error;
|
||||
const config = parseConfig(environment);
|
||||
if (!config.ok) return projectAnalysisError(config.error);
|
||||
const result = await runControlledReplay(
|
||||
{
|
||||
configuration: () => config.value.javascriptReplayConfiguration,
|
||||
host: new SystemJavaScriptReplayHost(),
|
||||
runner: new LinuxJavaScriptReplayRunner(),
|
||||
},
|
||||
input.value,
|
||||
);
|
||||
return result.ok ? result.value : projectAnalysisError(result.error);
|
||||
}),
|
||||
});
|
||||
registerConfiguredJsonCommand({
|
||||
cli,
|
||||
logger,
|
||||
environment,
|
||||
name: CLI_COMMANDS.prepareNodeCharacterization,
|
||||
description:
|
||||
"Prepare one exact Node/JavaScript characterization without execution",
|
||||
workflow: (config, input) =>
|
||||
prepareNodeCharacterization(replayDependencies(config), input),
|
||||
});
|
||||
registerConfiguredJsonCommand({
|
||||
cli,
|
||||
logger,
|
||||
environment,
|
||||
name: CLI_COMMANDS.executeNodeCharacterization,
|
||||
description:
|
||||
"Execute one exact Node/JavaScript characterization from its content-bound plan",
|
||||
workflow: (config, input) =>
|
||||
executeNodeCharacterization(replayDependencies(config), input),
|
||||
});
|
||||
registerObligationLedgerCommand(cli, logger);
|
||||
registerCoverageCommand(cli, logger);
|
||||
};
|
||||
@@ -162,47 +106,6 @@ const registerObligationLedgerCommand = (
|
||||
},
|
||||
});
|
||||
|
||||
interface ConfiguredJsonCommandOptions {
|
||||
readonly cli: CliInstance;
|
||||
readonly logger: Logger;
|
||||
/** Environment the configuration is read from; defaults to the process environment. */
|
||||
readonly environment?: Readonly<Record<string, string | undefined>>;
|
||||
readonly name: string;
|
||||
readonly description: string;
|
||||
readonly workflow: (
|
||||
config: AppConfig,
|
||||
input: unknown,
|
||||
) => Promise<
|
||||
| { readonly ok: true; readonly value: JsonValue }
|
||||
| { readonly ok: false; readonly error: AnalysisError }
|
||||
>;
|
||||
}
|
||||
|
||||
const registerConfiguredJsonCommand = ({
|
||||
cli,
|
||||
logger,
|
||||
environment = process.env,
|
||||
name,
|
||||
description,
|
||||
workflow,
|
||||
}: ConfiguredJsonCommandOptions): void => {
|
||||
cli.command(name, {
|
||||
description,
|
||||
args: z.object({
|
||||
inputJson: z.string().describe("Inline workflow JSON or JSON file path"),
|
||||
}),
|
||||
run: ({ args }) =>
|
||||
logCliCommand(logger, name, async () => {
|
||||
const input = await parseCliJsonInput(args.inputJson, name);
|
||||
if (!input.ok) return input.error;
|
||||
const configured = configuredConfig(environment);
|
||||
if (!configured.ok) return configured.error;
|
||||
const result = await workflow(configured.config, input.value);
|
||||
return result.ok ? result.value : projectAnalysisError(result.error);
|
||||
}),
|
||||
});
|
||||
};
|
||||
|
||||
const registerCoverageCommand = (cli: CliInstance, logger: Logger): void =>
|
||||
registerJsonCommand({
|
||||
cli,
|
||||
@@ -218,29 +121,6 @@ const registerCoverageCommand = (cli: CliInstance, logger: Logger): void =>
|
||||
},
|
||||
});
|
||||
|
||||
const configuredConfig = (
|
||||
environment: Readonly<Record<string, string | undefined>> = process.env,
|
||||
):
|
||||
| {
|
||||
readonly ok: true;
|
||||
readonly config: AppConfig;
|
||||
}
|
||||
| {
|
||||
readonly ok: false;
|
||||
readonly error: ReturnType<typeof projectAnalysisError>;
|
||||
} => {
|
||||
const configured = parseConfig(environment);
|
||||
return configured.ok
|
||||
? { ok: true, config: configured.value }
|
||||
: { ok: false, error: projectAnalysisError(configured.error) };
|
||||
};
|
||||
|
||||
const replayDependencies = (config: AppConfig) => ({
|
||||
configuration: () => config.javascriptReplayConfiguration,
|
||||
host: new SystemJavaScriptReplayHost(),
|
||||
runner: new LinuxJavaScriptReplayRunner(),
|
||||
});
|
||||
|
||||
interface JsonCommandOptions<Schema extends z.ZodType> {
|
||||
readonly cli: CliInstance;
|
||||
readonly logger: Logger;
|
||||
|
||||
Reference in new issue
Block a user