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
+15 -4
View File
@@ -26,12 +26,23 @@ const matchedEventSchema = z.strictObject({
location: locationSchema,
});
const sideResultSchema = z.strictObject({
status: z.enum(["pass", "fail", "unknown"]),
matched_variant: identifierSchema.nullable(),
const sideResultShape = {
satisfied_constraints: z.array(z.string()),
raw_trace: z.array(matchedEventSchema),
});
};
const sideResultSchema = z.union([
z.strictObject({
...sideResultShape,
status: z.literal("pass"),
matched_variant: identifierSchema.nullable(),
}),
z.strictObject({
...sideResultShape,
status: z.enum(["fail", "unknown"]),
matched_variant: z.null(),
}),
]);
const diagnosticSchema = z.strictObject({
kind: z.enum([