mirror of
https://github.com/morluto/rea.git
synced 2026-11-03 13:26:10 +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
@@ -0,0 +1,45 @@
|
||||
import type {
|
||||
FileState,
|
||||
FilesystemCheckpoint,
|
||||
} from "../domain/processCapture.js";
|
||||
|
||||
/** Classify path-stable filesystem effects between two bounded states. */
|
||||
export const classifyFilesystemEffects = (
|
||||
before: readonly FileState[],
|
||||
after: readonly FileState[],
|
||||
): FilesystemCheckpoint["effects"] => {
|
||||
const beforeByPath = new Map(before.map((file) => [file.path, file]));
|
||||
const afterByPath = new Map(after.map((file) => [file.path, file]));
|
||||
return [...new Set([...beforeByPath.keys(), ...afterByPath.keys()])]
|
||||
.sort()
|
||||
.map((path) => {
|
||||
const beforeFile = beforeByPath.get(path) ?? null;
|
||||
const afterFile = afterByPath.get(path) ?? null;
|
||||
if (beforeFile === null) {
|
||||
if (afterFile === null)
|
||||
throw new TypeError(`Filesystem effect ${path} has no file state`);
|
||||
return {
|
||||
path,
|
||||
status: "created",
|
||||
before: null,
|
||||
after: afterFile,
|
||||
} as const;
|
||||
}
|
||||
if (afterFile === null)
|
||||
return {
|
||||
path,
|
||||
status: "deleted",
|
||||
before: beforeFile,
|
||||
after: null,
|
||||
} as const;
|
||||
return {
|
||||
path,
|
||||
status:
|
||||
JSON.stringify(beforeFile) === JSON.stringify(afterFile)
|
||||
? "unchanged"
|
||||
: "modified",
|
||||
before: beforeFile,
|
||||
after: afterFile,
|
||||
} as const;
|
||||
});
|
||||
};
|
||||
Reference in new issue
Block a user