mirror of
https://github.com/morluto/rea.git
synced 2026-10-26 17:35:11 +00:00
fix(ci): restore plist, verifier, and TOML capacity checks (#4930)
Correct stale plist and prerequisite fixtures, and replace the TOML serializer's repeated terminal-LF regex scans with a backward scan. Keep capacity, timeout, source-preservation, backup, and idempotence coverage intact. Fixes #4931
This commit is contained in:
1 parent
9df559b7e7
commit
1accac27c3
4 files changed
+21
-9
No files matched your search
@@ -931,6 +931,13 @@ const disabledServerListLines = (
|
||||
}
|
||||
};
|
||||
|
||||
/** Strip terminal LF without rescanning internal blank-line runs. */
|
||||
const withoutTrailingLineFeeds = (text: string): string => {
|
||||
let end = text.length;
|
||||
while (end > 0 && text.charCodeAt(end - 1) === 10) end -= 1;
|
||||
return text.slice(0, end);
|
||||
};
|
||||
|
||||
/**
|
||||
* Replace REA's TOML server tables and assignments. Comments that introduce a
|
||||
* following table stay. Codex also retains comments around REA's own table.
|
||||
@@ -1108,13 +1115,13 @@ const upsertTomlServerSection = (
|
||||
// The last kept CRLF line has no following LF from the join.
|
||||
if (body.endsWith("\r")) body += "\n";
|
||||
if (entry !== undefined && !inlineServerTable) {
|
||||
let fragment = stringifyToml({
|
||||
mcp_servers: { [serverKey]: entry },
|
||||
}).replace(/\n+$/u, "");
|
||||
let fragment = withoutTrailingLineFeeds(
|
||||
stringifyToml({ mcp_servers: { [serverKey]: entry } }),
|
||||
);
|
||||
if (crlf) fragment = fragment.replaceAll("\n", "\r\n");
|
||||
const nl = crlf ? "\r\n" : "\n";
|
||||
const endedWithNewline = body.endsWith("\n");
|
||||
const base = body.replace(/\n+$/u, "");
|
||||
const base = withoutTrailingLineFeeds(body);
|
||||
const trimmed =
|
||||
endedWithNewline && base.endsWith("\r") ? base.slice(0, -1) : base;
|
||||
body =
|
||||
|
||||
@@ -114,7 +114,9 @@ it("keeps XML numeric overflow and unreadable text explicitly unknown", () => {
|
||||
const parsed = parseXmlPropertyList(
|
||||
"<plist><array><real>1e999</real><real>-1e999</real><real> nan </real><real>-nan</real><real>infinite</real></array></plist>",
|
||||
);
|
||||
expect(parsed.value).toEqual(Array.from({ length: 5 }, () => new UnknownPlistReal()));
|
||||
expect(parsed.value).toEqual(
|
||||
Array.from({ length: 5 }, () => new UnknownPlistReal()),
|
||||
);
|
||||
expect(parsed.numberLiterals.incomplete).toBe(false);
|
||||
});
|
||||
|
||||
|
||||
@@ -318,7 +318,7 @@ it.skipIf(process.platform === "darwin" || process.platform === "win32")(
|
||||
},
|
||||
);
|
||||
|
||||
it("keeps an archive readable when a non-finite real is an explicit unknown", async () => {
|
||||
it("keeps an archive readable while preserving a known non-finite real", async () => {
|
||||
const root = await bundle();
|
||||
const bytes = Buffer.from(
|
||||
build({
|
||||
@@ -340,11 +340,13 @@ it("keeps an archive readable when a non-finite real is an explicit unknown", as
|
||||
expect(result.objects).toContainEqual(
|
||||
expect.objectContaining({
|
||||
id: 1,
|
||||
value: { $plist_type: "real", value: null },
|
||||
kind: "scalar",
|
||||
status: "observed",
|
||||
value: { $plist_type: "real", value: "nan" },
|
||||
}),
|
||||
);
|
||||
expect(result.limitations).toContain(
|
||||
'1 non-finite real value(s) are reported as { "$plist_type": "real", "value": null } because JSON evidence cannot preserve NaN vs infinity.',
|
||||
'1 non-finite real value(s) are reported as { "$plist_type": "real", "value": "<spelling>" } using canonical numeric labels nan, +infinity or -infinity because a JSON number cannot carry them.',
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -265,7 +265,8 @@ it("Ghidra verifier awaits native prerequisite rejection before creating target
|
||||
encoding: "utf8",
|
||||
timeout: 10_000,
|
||||
env: {
|
||||
PATH: root,
|
||||
// Keep native process inspectors available; the selected JDK and Ghidra are absent.
|
||||
PATH: process.env.PATH ?? "",
|
||||
HOME: root,
|
||||
USERPROFILE: root,
|
||||
GHIDRA_INSTALL_DIR: join(root, "absent-installation"),
|
||||
|
||||
Reference in new issue
Block a user