refactor(domain): encode comparison and lifecycle states exactly (#473)

* refactor(domain): encode comparison states exactly

* refactor(domain): make evidence lifecycles explicit

* refactor(browser): parse capture states once

* test: prefer behavior over implementation seams

* chore: refresh schema-derived metadata

* test(process): preserve lifecycle cleanup coverage

* test(hopper): bind rename cache coverage to dispatch
This commit is contained in:
morluto
2026-08-11 18:04:36 +08:00
committed by GitHub
parent e91c8c39c2
commit d65730c4c2
43 changed files with 1732 additions and 780 deletions
+18 -3
View File
@@ -93,6 +93,16 @@ describe("call path reconstruction", () => {
expect(callPathResultSchema.parse(result)).toEqual(result);
expect(result.status).toBe("found");
expect(result.shortest_hops).toBe(2);
expect(
callPathResultSchema.safeParse({ ...result, shortest_hops: null })
.success,
).toBe(false);
expect(
callPathResultSchema.safeParse({
...result,
paths: { ...result.paths, total: null },
}).success,
).toBe(false);
expect(
result.paths.items.map((path) =>
path.nodes.map(({ address }) => address),
@@ -118,9 +128,14 @@ describe("call path reconstruction", () => {
});
it("only reports not_found for exhaustive closure", () => {
expect(run([observe("0x1000", []), observe("0x4000", [])]).status).toBe(
"not_found",
);
const notFound = run([observe("0x1000", []), observe("0x4000", [])]);
expect(notFound.status).toBe("not_found");
expect(
callPathResultSchema.safeParse({
...notFound,
search_scope: { ...notFound.search_scope, exhaustive: false },
}).success,
).toBe(false);
const unknown = run([observe("0x1000", ["0x2000"])]);
expect(unknown.status).toBe("unknown");
expect(unknown.limitations).toContain(