mirror of
https://github.com/morluto/rea
synced 2026-10-26 22:28:27 -04:00
e07b81649e
* 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.
49 lines
1.6 KiB
TypeScript
49 lines
1.6 KiB
TypeScript
import type { JsonValue } from "../domain/jsonValue.js";
|
|
import { createEvidence } from "../domain/evidence.js";
|
|
import { jsonValueSchema } from "../domain/jsonValue.js";
|
|
import type {
|
|
ProcessCapture,
|
|
ProcessScenario,
|
|
} from "../domain/processCapture.js";
|
|
|
|
/** Provider identity for controlled process capture evidence. */
|
|
export const PROCESS_PROVIDER = {
|
|
id: "rea-process",
|
|
name: "REA process capture",
|
|
version: "3",
|
|
} as const;
|
|
|
|
/** Project one process scenario into secret-free Evidence parameters. */
|
|
const processEvidenceParameters = (
|
|
scenario: ProcessScenario,
|
|
): Readonly<Record<string, JsonValue>> => ({
|
|
executable_name: scenario.executable.split("/").at(-1) ?? scenario.executable,
|
|
argument_count: scenario.arguments.length,
|
|
event_count: scenario.events.length,
|
|
filesystem_observation_path_count:
|
|
scenario.filesystem_observation_paths.length,
|
|
normalization: scenario.normalization,
|
|
});
|
|
|
|
/** Create one canonical observed process capture Evidence record. */
|
|
export const createProcessCaptureEvidence = (
|
|
scenario: ProcessScenario,
|
|
capture: ProcessCapture,
|
|
) => {
|
|
return createEvidence(undefined, PROCESS_PROVIDER, {
|
|
predicateType: "rea.process-capture",
|
|
operation: "capture_process_scenario",
|
|
parameters: processEvidenceParameters(scenario),
|
|
result: jsonValueSchema.parse(capture),
|
|
confidence: "observed",
|
|
authority: "controlled-replay",
|
|
environment: {
|
|
id: `${process.platform}-${process.arch}`,
|
|
platform: process.platform,
|
|
architecture: process.arch,
|
|
isolation: "process",
|
|
},
|
|
limitations: capture.limitations,
|
|
});
|
|
};
|