mirror of
https://github.com/morluto/rea
synced 2026-10-27 06:33:32 -04:00
fix(analysis): preserve producer identity and partial evidence
Reconcile Mach-O UUID observations without hiding malformed or conflicting sources. Require source-map identity digests to be supported by consistent observations. Keep truncated Android manifests as partial raw evidence, validate WABT section framing, and reject missing JEB inventories or error-marked success replies. Consolidate native UUID parsing and simplify capacity and malformed-input fixtures. Focused source and public workflow checks pass, including native arm64e inspection and real WABT framing probes; a successful real JEB GUI project opening remains unverified.
This commit is contained in:
@@ -513,7 +513,84 @@ describe("JavaScript Application Graph: source maps and observations", () => {
|
||||
),
|
||||
).toThrow(/Source-map observation/u);
|
||||
});
|
||||
});
|
||||
|
||||
describe("JavaScript Application Graph: source-map digest consistency", () => {
|
||||
it("rejects source-map observations that contradict a known original digest", () => {
|
||||
const sourceMapNode = (
|
||||
identityDigest: string | null,
|
||||
observedDigest: unknown,
|
||||
contentAvailable?: boolean,
|
||||
) =>
|
||||
createJavaScriptApplicationNode({
|
||||
kind: "source-module",
|
||||
identity: {
|
||||
strategy: "source-map-original",
|
||||
source_root: null,
|
||||
stability: "source-map-exact",
|
||||
source_map_sha256: APPLICATION_GRAPH_DIGESTS.asar,
|
||||
original_source: "src/editor.ts",
|
||||
source_sha256: identityDigest,
|
||||
},
|
||||
observations: [
|
||||
{
|
||||
label: null,
|
||||
source_map_reference: resolveJavaScriptSourceMapReference(
|
||||
"src/editor.ts",
|
||||
null,
|
||||
"dist/app.js.map",
|
||||
),
|
||||
properties: {
|
||||
...(contentAvailable === undefined
|
||||
? {}
|
||||
: { content_available: contentAvailable }),
|
||||
...(observedDigest === undefined
|
||||
? {}
|
||||
: { content_sha256: observedDigest }),
|
||||
},
|
||||
evidence: artifactEvidence(
|
||||
APPLICATION_GRAPH_DIGESTS.asar,
|
||||
"dist/app.js.map",
|
||||
"ast-static-analysis",
|
||||
),
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
expect(() =>
|
||||
graphForNode(sourceMapNode("2".repeat(64), "3".repeat(64))),
|
||||
).toThrow(/Source-map observation/u);
|
||||
expect(() => graphForNode(sourceMapNode(null, "3".repeat(64)))).toThrow(
|
||||
/Source-map observation/u,
|
||||
);
|
||||
expect(() => graphForNode(sourceMapNode(null, 7))).toThrow(
|
||||
/Source-map observation/u,
|
||||
);
|
||||
expect(() =>
|
||||
graphForNode(sourceMapNode("3".repeat(64), "3".repeat(64))),
|
||||
).not.toThrow();
|
||||
expect(() =>
|
||||
graphForNode(sourceMapNode("3".repeat(64), "3".repeat(64), false)),
|
||||
).toThrow(/Source-map observation/u);
|
||||
expect(() =>
|
||||
graphForNode(sourceMapNode("3".repeat(64), null, false)),
|
||||
).toThrow(/Source-map observation/u);
|
||||
expect(() =>
|
||||
graphForNode(sourceMapNode("3".repeat(64), null, true)),
|
||||
).toThrow(/Source-map observation/u);
|
||||
expect(() =>
|
||||
graphForNode(sourceMapNode("3".repeat(64), undefined)),
|
||||
).toThrow(/Source-map observation/u);
|
||||
expect(() => graphForNode(sourceMapNode(null, null, true))).toThrow(
|
||||
/Source-map observation/u,
|
||||
);
|
||||
expect(() =>
|
||||
graphForNode(sourceMapNode("3".repeat(64), "3".repeat(64), undefined)),
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe("JavaScript Application Graph: commitments and schemas", () => {
|
||||
it("rejects unknown fields and stale commitments", () => {
|
||||
const graph = buildSyntheticJavaScriptApplicationGraph();
|
||||
expect(() =>
|
||||
|
||||
Reference in New Issue
Block a user