Share native membership and operand ownership across full and projected facts. Preserve exact phi bindings and definition frontiers when the full graph is unavailable, keep CFG/use coverage explicit, and expose selected reads through the same CLI/SDK/MCP contracts. Verify real SQLite/zlib fidelity, encoded fallback, bounded metadata, and cache reuse; pin the next real-model question and oracle. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
32 lines
739 B
JavaScript
32 lines
739 B
JavaScript
// One native operand/operation schema shared by complete and projected facts.
|
|
import { z } from "zod";
|
|
import {
|
|
hex,
|
|
ordinal,
|
|
valueId,
|
|
operationId,
|
|
edgeId,
|
|
rowParser,
|
|
} from "./native-contract.mjs";
|
|
export const operation = z.strictObject({
|
|
id: operationId,
|
|
address: hex,
|
|
block: ordinal,
|
|
opcode: z.string(),
|
|
statement: z.string(),
|
|
is_dead: z.boolean(),
|
|
inputs: z.array(
|
|
z.strictObject({
|
|
input_index: ordinal,
|
|
value_id: valueId.nullable(),
|
|
phi_predecessor: ordinal.nullable(),
|
|
phi_predecessor_edge: edgeId.nullable(),
|
|
}),
|
|
),
|
|
output: valueId.nullable(),
|
|
});
|
|
|
|
export const parseOperation = rowParser(operation, {
|
|
inputs: (row) => operation.shape.inputs.element.parse(row),
|
|
});
|