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,35 +1,18 @@
|
||||
import { expect, it } from "vitest";
|
||||
|
||||
import type { ProcessCaptureEventJournalEntry } from "../domain/processCapture.js";
|
||||
import { createProcessCaptureJournal } from "./ProcessCaptureJournal.js";
|
||||
|
||||
it("publishes journal entries in capture order and supports nested recording", () => {
|
||||
it("records capture events in monotonic observation order", () => {
|
||||
const journal = createProcessCaptureJournal();
|
||||
const observed: ProcessCaptureEventJournalEntry[] = [];
|
||||
const unsubscribe = journal.subscribe((entry) => observed.push(entry));
|
||||
journal.recordEvent("filesystem_checkpoints", 0);
|
||||
journal.recordEvent("lifecycle", 0);
|
||||
const settlementEntry = journal.record("lifecycle", 1);
|
||||
unsubscribe();
|
||||
journal.recordEvent("frames", 0);
|
||||
journal.recordEvent("filesystem_checkpoints", 1);
|
||||
|
||||
expect(journal.entries).toEqual([
|
||||
{ capture_order: 0, collection: "lifecycle", index: 0 },
|
||||
{ capture_order: 1, collection: "lifecycle", index: 1 },
|
||||
{ capture_order: 0, collection: "filesystem_checkpoints", index: 0 },
|
||||
{ capture_order: 1, collection: "lifecycle", index: 0 },
|
||||
{ capture_order: 2, collection: "frames", index: 0 },
|
||||
{ capture_order: 3, collection: "filesystem_checkpoints", index: 1 },
|
||||
]);
|
||||
expect(observed).toEqual(journal.entries.slice(0, 2));
|
||||
expect(settlementEntry).toEqual(journal.entries[1]);
|
||||
|
||||
const nestedJournal = createProcessCaptureJournal();
|
||||
const notifications: string[] = [];
|
||||
nestedJournal.subscribe((entry) => {
|
||||
notifications.push(`a:${String(entry.capture_order)}`);
|
||||
if (entry.capture_order === 0) nestedJournal.record("frames", 1);
|
||||
});
|
||||
nestedJournal.subscribe((entry) =>
|
||||
notifications.push(`b:${String(entry.capture_order)}`),
|
||||
);
|
||||
nestedJournal.record("frames", 0);
|
||||
|
||||
expect(notifications).toEqual(["a:0", "b:0", "a:1", "b:1"]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user