chore: merge main and regenerate combined catalog metadata
This commit is contained in:
@@ -658,3 +658,52 @@ describe("source-map original artifact language metadata", () => {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe("deep source-map original syntax", () => {
|
||||
it("retains valid source maps and native/CommonJS evidence after a parser-admitted deep property chain", async () => {
|
||||
const source = `const value = root${".next".repeat(12_000)};\nimport "./last.js";\nrequire("./common.js");\nfunction local(require) { require("./shadowed.js"); }`;
|
||||
const text = JSON.stringify({
|
||||
version: 3,
|
||||
names: [],
|
||||
sources: ["../src/main.js"],
|
||||
sourcesContent: [source],
|
||||
mappings: "AAAA",
|
||||
});
|
||||
const result = await fetchWebSourceMaps([request], input(), undefined, {
|
||||
fetch: async () => new Response(text),
|
||||
});
|
||||
expect(result).toMatchObject({
|
||||
status: "included",
|
||||
items: [
|
||||
{
|
||||
status: "included",
|
||||
limitation: null,
|
||||
artifact: { text },
|
||||
original_sources: [{ artifact: { text: source } }],
|
||||
original_module_edges: [
|
||||
{
|
||||
from_source: `${origin}/src/main.js`,
|
||||
kind: "static_import",
|
||||
specifier: "./last.js",
|
||||
resolved_source: `${origin}/src/last.js`,
|
||||
},
|
||||
{
|
||||
from_source: `${origin}/src/main.js`,
|
||||
kind: "require",
|
||||
specifier: "./common.js",
|
||||
resolved_source: `${origin}/src/common.js`,
|
||||
},
|
||||
],
|
||||
mappings: [
|
||||
{
|
||||
generated_line: 1,
|
||||
generated_column: 0,
|
||||
original_line: 1,
|
||||
original_column: 0,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -77,6 +77,17 @@ const statusCapability = (
|
||||
});
|
||||
|
||||
describe("server and catalog identity", () => {
|
||||
it("retains all catalog identity fields through transport serialization and detached clones", () => {
|
||||
const serialized = JSON.parse(JSON.stringify(CATALOG_IDENTITY));
|
||||
expect(structuredClone(CATALOG_IDENTITY)).toEqual(serialized);
|
||||
expect(serialized.digests).toEqual(CATALOG_IDENTITY.digests);
|
||||
expect(serialized.tools).toHaveLength(TOOL_CONTRACTS.length);
|
||||
const identity = createServerIdentity({
|
||||
startedAt: "2026-07-13T00:00:00.000Z",
|
||||
});
|
||||
expect(JSON.parse(JSON.stringify(identity)).catalog).toEqual(serialized);
|
||||
});
|
||||
|
||||
it("derives package and SDK versions from canonical package metadata", async () => {
|
||||
const packageJson = JSON.parse(await readFile("package.json", "utf8"));
|
||||
const packageLock = JSON.parse(await readFile("package-lock.json", "utf8"));
|
||||
|
||||
@@ -220,3 +220,24 @@ describe("Linux private display selection", () => {
|
||||
expect(processes).not.toContain(hangingHelperPath);
|
||||
});
|
||||
});
|
||||
|
||||
describe("private display probe output settlement", () => {
|
||||
it.skipIf(process.platform === "win32")(
|
||||
"retains inherited diagnostics written after the launcher exits",
|
||||
async () => {
|
||||
const result = await runLinuxPrivateDisplayProbe("direct", {
|
||||
helperPath: fileURLToPath(
|
||||
new URL("../../../fixtures/x11ProbeOutput.py", import.meta.url),
|
||||
),
|
||||
timeoutMs: 5_000,
|
||||
});
|
||||
expect(result).toEqual({
|
||||
outcome: "exited",
|
||||
exitCode: 0,
|
||||
stderr: "firstlast",
|
||||
stderrBytes: Buffer.byteLength("firstlast"),
|
||||
cleanupIncomplete: false,
|
||||
});
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
@@ -251,6 +251,152 @@ describe("managed member comparison uncertainty", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("managed member comparison of undecoded signatures", () => {
|
||||
it("pairs undecoded signatures by exact declared type, name, and raw bytes", () => {
|
||||
const undecoded = {
|
||||
methodSignature: Buffer.from([0x00, 0x00, 0x7f]),
|
||||
fieldSignature: Buffer.from([0x06, 0x15]),
|
||||
};
|
||||
const left = inspect(
|
||||
buildManagedPeFixture(undecoded),
|
||||
"/tmp/undecoded-left.dll",
|
||||
);
|
||||
const right = inspect(
|
||||
buildManagedPeFixture(undecoded),
|
||||
"/tmp/undecoded-right.dll",
|
||||
);
|
||||
expect(left.result.coverage.state).toBe("complete");
|
||||
expect(left.result.methods[0]?.signature.parse_status).toBe("unsupported");
|
||||
expect(left.result.fields[0]?.signature.parse_status).toBe("unsupported");
|
||||
const result = compareManagedMembers(left, right);
|
||||
expect(result.summary).toMatchObject({
|
||||
unchanged: 2,
|
||||
added: 0,
|
||||
removed: 0,
|
||||
unknown: 0,
|
||||
});
|
||||
for (const item of [...result.methods, ...result.fields])
|
||||
expect(item.match).toMatchObject({
|
||||
status: "matched",
|
||||
basis: "exact-signature",
|
||||
});
|
||||
});
|
||||
|
||||
it("keeps unmatched undecoded members unknown in complete inventories", () => {
|
||||
const left = inspect(
|
||||
buildManagedPeFixture({
|
||||
methodSignature: Buffer.from([0x00, 0x00, 0x7f]),
|
||||
fieldSignature: Buffer.from([0x06, 0x15]),
|
||||
}),
|
||||
"/tmp/undecoded-before.dll",
|
||||
);
|
||||
const right = inspect(
|
||||
buildManagedPeFixture({
|
||||
methodSignature: Buffer.from([0x00, 0x00, 0x7e]),
|
||||
fieldSignature: Buffer.from([0x06, 0x7e]),
|
||||
}),
|
||||
"/tmp/undecoded-after.dll",
|
||||
);
|
||||
expect(right.result.coverage.state).toBe("complete");
|
||||
const result = compareManagedMembers(left, right);
|
||||
expect(result.summary).toMatchObject({ added: 0, removed: 0, unknown: 4 });
|
||||
for (const item of [...result.methods, ...result.fields])
|
||||
expect(item).toMatchObject({
|
||||
status: "unknown",
|
||||
match: { status: "unmatched" },
|
||||
limitations: [expect.stringContaining("signature-not-decoded")],
|
||||
});
|
||||
});
|
||||
|
||||
it("keeps a decoded member unknown beside a same-named undecoded counterpart", () => {
|
||||
const left = inspect(buildManagedPeFixture(), "/tmp/decoded-before.dll");
|
||||
const right = inspect(
|
||||
buildManagedPeFixture({
|
||||
methodSignature: Buffer.from([0x00, 0x00, 0x7f]),
|
||||
fieldSignature: Buffer.from([0x06, 0x15]),
|
||||
}),
|
||||
"/tmp/undecoded-after.dll",
|
||||
);
|
||||
expect(left.result.methods[0]?.signature.parse_status).toBe("decoded");
|
||||
expect(left.result.fields[0]?.signature.parse_status).toBe("decoded");
|
||||
expect(right.result.coverage.state).toBe("complete");
|
||||
const result = compareManagedMembers(left, right);
|
||||
expect(result.summary).toMatchObject({ added: 0, removed: 0, unknown: 4 });
|
||||
for (const item of [...result.methods, ...result.fields])
|
||||
expect(item).toMatchObject({
|
||||
status: "unknown",
|
||||
match: { status: "unmatched" },
|
||||
limitations: [
|
||||
expect.stringMatching(
|
||||
item.left === null
|
||||
? /^signature-not-decoded:/
|
||||
: /^counterpart-signature-not-decoded: The right (method|field) inventory/,
|
||||
),
|
||||
],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("managed member comparison of ambiguous undecoded signatures", () => {
|
||||
it("keeps a decoded member unknown beside an ambiguous same-named undecoded group", () => {
|
||||
const undecoded = { methodSignature: Buffer.from([0x00, 0x00, 0x7f]) };
|
||||
const decoded = inspect(buildManagedPeFixture(), "/tmp/decoded.dll");
|
||||
const left = inspect(buildManagedPeFixture(undecoded), "/tmp/left.dll");
|
||||
const right = inspect(buildManagedPeFixture(undecoded), "/tmp/right.dll");
|
||||
const [undecodedMethod] = left.result.methods;
|
||||
const [decodedMethod] = decoded.result.methods;
|
||||
if (undecodedMethod === undefined || decodedMethod === undefined)
|
||||
throw new Error("Expected fixture methods");
|
||||
expect(decodedMethod.name).toBe(undecodedMethod.name);
|
||||
// One undecoded T.M on the left meets two identical undecoded T.M on the
|
||||
// right, so that group stays ambiguous; the left also has a decoded T.M.
|
||||
const result = compareManagedMembers(
|
||||
{
|
||||
...left,
|
||||
result: {
|
||||
...left.result,
|
||||
methods: [undecodedMethod, { ...decodedMethod, token: "0x06000002" }],
|
||||
},
|
||||
},
|
||||
{
|
||||
...right,
|
||||
result: {
|
||||
...right.result,
|
||||
methods: [
|
||||
undecodedMethod,
|
||||
{ ...undecodedMethod, token: "0x06000002" },
|
||||
],
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
expect(result.methods).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
status: "unknown",
|
||||
match: expect.objectContaining({
|
||||
status: "ambiguous",
|
||||
basis: "exact-signature",
|
||||
}),
|
||||
limitations: [
|
||||
"Multiple managed methods share the same declared type, name, and raw signature; REA did not guess a token remap.",
|
||||
],
|
||||
}),
|
||||
expect.objectContaining({
|
||||
status: "unknown",
|
||||
left: expect.objectContaining({ token: "0x06000002" }),
|
||||
limitations: [
|
||||
expect.stringMatching(
|
||||
/^counterpart-signature-not-decoded: The right method inventory has an unpaired member/u,
|
||||
),
|
||||
],
|
||||
}),
|
||||
]),
|
||||
);
|
||||
expect(result.summary).toMatchObject({ removed: 0, added: 0 });
|
||||
});
|
||||
});
|
||||
|
||||
const inspect = (bytes: Buffer, path: string) => {
|
||||
const target = managedPeFixtureTarget(bytes, path);
|
||||
const result = inspectManagedMembersBytes(bytes, target);
|
||||
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
sys.stderr.write("first")
|
||||
sys.stderr.flush()
|
||||
subprocess.Popen(
|
||||
[sys.executable, "-c", "import sys, time; time.sleep(0.05); sys.stderr.write('last'); sys.stderr.flush()"],
|
||||
stdout=subprocess.DEVNULL,
|
||||
)
|
||||
Reference in New Issue
Block a user