mirror of
https://github.com/morluto/rea
synced 2026-10-26 14:25:49 -04:00
fix(javascript): retain unresolved network targets with provenance
Resolve stable lexical and URL targets using shared effects, and preserve unresolved request expressions as partial facts. Carry their uncertainty through workers, artifact graphs, and the CLI. Scope partial endpoint identity to the source site. Refs: #3451, #3534 Co-authored-by: Hemang Varshney <218273197+hemv-857@users.noreply.github.com>
This commit is contained in:
@@ -103,3 +103,16 @@ it("accepts candidate endpoint interpretations from static analysis", () => {
|
||||
).success,
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("preserves partial request targets through the strict worker schema", () => {
|
||||
const facts = analyzeJavaScriptStaticSource("fetch(endpointUrl);");
|
||||
expect(facts.endpoints).toContainEqual(
|
||||
expect.objectContaining({
|
||||
kind: "network",
|
||||
value: "endpointUrl",
|
||||
resolution: "partial",
|
||||
}),
|
||||
);
|
||||
const serialized = JSON.parse(JSON.stringify(facts)) as unknown;
|
||||
expect(javaScriptWorkerStaticAnalysisSchema.parse(serialized)).toEqual(facts);
|
||||
});
|
||||
|
||||
@@ -329,6 +329,7 @@ export const javaScriptWorkerStaticAnalysisSchema = z
|
||||
value: z.string(),
|
||||
mechanism: z.string(),
|
||||
interpretation: z.literal("candidate").exactOptional(),
|
||||
resolution: z.literal("partial").exactOptional(),
|
||||
}),
|
||||
),
|
||||
storage: z.array(
|
||||
|
||||
Reference in New Issue
Block a user