mirror of
https://github.com/morluto/rea
synced 2026-10-27 06:33:32 -04:00
fix(browser): preserve passive network inventory uncertainty
Preserve uncertainty in offline passive network comparisons when request identity, metadata, or per-kind inventory coverage is incomplete. Retain proven HTTP/WebSocket changes without using missing information to infer membership, duplicate counts, or equality. Compare redirect resource types only where both observations retain them. Keep metadata completeness with its owner, stream HTTP content digests, and require full coverage for multiplicity and WebSocket stream inventories. Preserve independently known metadata changes and full-inventory counts. Keep the original JavaScript configuration-escape, JSON, cancellation, SAZ and schema-documentation fixes compatible with current main. Split public CLI comparisons into isolated test cases without loosening timeouts. Validate actual Chromium/HTTP captures through CLI and real stdio SDK, with explicit limits and unchanged source bytes. Co-authored-by: To3akaRin <131595336+To3akaRin@users.noreply.github.com> Co-authored-by: N0zoM1z0 <161784452+N0zoM1z0@users.noreply.github.com> Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com> Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
This commit is contained in:
@@ -3,6 +3,32 @@ import { expect, it } from "vitest";
|
||||
import { analyzeJavaScriptStaticSource } from "../../domain/javascript/javascriptStaticAnalysis.js";
|
||||
import { javaScriptWorkerStaticAnalysisSchema } from "./JavaScriptAnalysisWorkerSchemas.js";
|
||||
|
||||
it("retains candidate endpoint interpretation across the worker boundary", () => {
|
||||
const facts = analyzeJavaScriptStaticSource(`
|
||||
client.get("settingKey");
|
||||
fetch("/api");
|
||||
`);
|
||||
expect(facts.endpoints).toEqual([
|
||||
expect.objectContaining({
|
||||
value: "settingKey",
|
||||
interpretation: "candidate",
|
||||
}),
|
||||
expect.objectContaining({ value: "/api" }),
|
||||
]);
|
||||
expect(facts.endpoints[1]).not.toHaveProperty("interpretation");
|
||||
const serialized = JSON.parse(JSON.stringify(facts)) as unknown;
|
||||
expect(javaScriptWorkerStaticAnalysisSchema.parse(serialized)).toEqual(facts);
|
||||
expect(
|
||||
javaScriptWorkerStaticAnalysisSchema.safeParse({
|
||||
...facts,
|
||||
endpoints: facts.endpoints.map((endpoint) => ({
|
||||
...endpoint,
|
||||
interpretation: "confirmed",
|
||||
})),
|
||||
}).success,
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("versions fingerprints through the worker schema and rejects v1", () => {
|
||||
const facts =
|
||||
analyzeJavaScriptStaticSource(`globalThis.webpackChunkApp.push([[1], {
|
||||
|
||||
Reference in New Issue
Block a user