refactor(views): derive layout summary fields from source contract

This commit is contained in:
morluto committed 2026-10-22 10:33:29 +08:00
1 parent dbcec4cf56
commit 527ade245a
1 file changed
+8 -9
+8 -9
View File
@@ -100,7 +100,10 @@ import { evidenceSchema, type Evidence } from "../evidence.js";
import { jsonObjectSchema, jsonValueSchema } from "../jsonValue.js";
import { err, ok, type Result } from "../result.js";
import type { AnalysisError } from "../analysisErrorBase.js";
import { safeParseOwnedBinaryLayout } from "../native/binaryLayout.js";
import {
binaryLayoutSchema,
safeParseOwnedBinaryLayout,
} from "../native/binaryLayout.js";
import { bundleResourceRootSchema } from "../apple/bundleResourceRoot.js";
import { functionDossierSchema } from "../hopperValues.js";
import {
@@ -380,14 +383,10 @@ const artifactSchema = z.strictObject({
});
const layoutSummarySchema = z.strictObject({
bytes: z.number().int().nonnegative(),
format: z.literal("elf"),
architecture: z.strictObject({
machine: z.literal("EM_X86_64"),
bits: z.literal(64),
byte_order: z.literal("little"),
}),
image_type: z.enum(["ET_EXEC", "ET_DYN", "ET_REL"]),
bytes: binaryLayoutSchema.shape.artifact.shape.bytes,
format: binaryLayoutSchema.shape.format,
architecture: binaryLayoutSchema.shape.architecture,
image_type: binaryLayoutSchema.shape.image_type,
entry: z.strictObject({
reported_value: z.string().min(1),
meaning: z.enum(["linked-virtual-address", "not-applicable", "absent"]),