mirror of
https://github.com/morluto/rea
synced 2026-10-27 06:33:32 -04:00
fix(javascript): isolate source analysis and retain bounded partial evidence (#1651)
* refactor(javascript): validate transferable file projections * test(javascript): consume decoded module and static facts * fix(javascript): isolate source analysis and retain bounded partial evidence * test(javascript): verify cleanup retention and repeated source paths
This commit is contained in:
@@ -8,7 +8,10 @@ import { canonicalJson } from "../comparisonSemantics.js";
|
||||
import { digestCanonicalValue } from "../canonicalDigest.js";
|
||||
import { uniqueSorted } from "../canonicalOrdering.js";
|
||||
import { compareUnicodeCodePoints } from "../unicodeCodePointOrder.js";
|
||||
import { freezeOwnedJsonSnapshotSteps } from "../immutableJson.js";
|
||||
import {
|
||||
freezeJsonSnapshot,
|
||||
freezeOwnedJsonSnapshotSteps,
|
||||
} from "../immutableJson.js";
|
||||
|
||||
import type {
|
||||
ApplicationGraphEvidence,
|
||||
@@ -449,6 +452,10 @@ export const createJavaScriptApplicationNode = (
|
||||
input: unknown,
|
||||
): ApplicationNode => {
|
||||
const parsed = applicationNodeInputSchema.parse(input);
|
||||
// These properties are newly parsed and exclusively owned. Authenticate
|
||||
// them before the observation/node schemas and final graph validate again.
|
||||
for (const observation of parsed.observations)
|
||||
freezeJsonSnapshot(observation.properties);
|
||||
const identity = normalizeIdentity(parsed.identity);
|
||||
const identifier = nodeId({ kind: parsed.kind, identity });
|
||||
const observations = parsed.observations
|
||||
@@ -479,6 +486,7 @@ export const createJavaScriptApplicationEdge = (
|
||||
input: unknown,
|
||||
): ApplicationEdge => {
|
||||
const parsed = applicationEdgeInputSchema.parse(input);
|
||||
freezeJsonSnapshot(parsed.properties);
|
||||
const semantic = {
|
||||
...parsed,
|
||||
evidence: normalizeEvidence(parsed.evidence),
|
||||
|
||||
Reference in New Issue
Block a user