fix(javascript): accept the Wakaru 1.x release line and verify 1.14.0 (#1540)
* fix(javascript): accept the Wakaru 1.x release line and verify 1.14.0 Exact --version equality rejected every Wakaru build except 1.13.0, and strict report schemas rejected any added field, so each upstream release broke recovery until REA re-pinned. Wakaru now documents that --version, --json and provenance.json change only by addition within a major version. Admit ^1.13.0 with the verified/compatible split used for Binwalk and Unblob, report the observed version instead of the pinned constant, and add a limitation for unverified releases. Parse reports with loose objects and keep the reported module status as a string; path, identity, range and file-set checks stay exact. Move the audited pin, submodule, CI binary and verifier to 1.14.0, and document where to get the binary from the refusal message. * fix(javascript): project known Wakaru warning fields --------- Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
This commit is contained in:
+33
-3
@@ -4,7 +4,13 @@ import { dirname, join } from "node:path";
|
||||
const args = process.argv.slice(2);
|
||||
const mode = process.env.REA_RECOVERY_FIXTURE_MODE ?? "normal";
|
||||
if (args.includes("--version")) {
|
||||
console.log(mode === "wrong-version" ? "wakaru 0.0.0" : "wakaru 1.13.0");
|
||||
console.log(
|
||||
mode === "wrong-version"
|
||||
? "wakaru 0.0.0"
|
||||
: mode === "additive"
|
||||
? "wakaru 1.99.0"
|
||||
: "wakaru 1.14.0",
|
||||
);
|
||||
} else {
|
||||
const input = args[0];
|
||||
const output = args[args.indexOf("-o") + 1];
|
||||
@@ -25,7 +31,16 @@ if (args.includes("--version")) {
|
||||
if (mode === "source-change")
|
||||
await writeFile(process.env.REA_RECOVERY_ORIGINAL_PATH, "changed original");
|
||||
const filename = mode === "escaping" ? "../escaped.js" : "module.js";
|
||||
const modules = [{ filename, kind: "javascript", status: "decompiled" }];
|
||||
const modules = [
|
||||
mode === "additive"
|
||||
? {
|
||||
filename,
|
||||
kind: "javascript",
|
||||
status: "future_status",
|
||||
future_module_field: true,
|
||||
}
|
||||
: { filename, kind: "javascript", status: "decompiled" },
|
||||
];
|
||||
if (mode === "duplicate") modules.push(modules[0]);
|
||||
if (mode !== "missing-file" && mode !== "escaping") {
|
||||
if (mode === "symlink") await symlink(input, join(output, filename));
|
||||
@@ -65,6 +80,10 @@ if (args.includes("--version")) {
|
||||
},
|
||||
},
|
||||
};
|
||||
if (mode === "additive") {
|
||||
provenance.future_top_field = "added";
|
||||
provenance.modules[filename].future_entry_field = [1];
|
||||
}
|
||||
if (mode === "extra-provenance")
|
||||
provenance.modules["extra.js"] = provenance.modules[filename];
|
||||
if (mode !== "missing-provenance")
|
||||
@@ -86,7 +105,18 @@ if (args.includes("--version")) {
|
||||
message: "fixture transform failed; retained source",
|
||||
},
|
||||
]
|
||||
: [],
|
||||
: mode === "additive"
|
||||
? [
|
||||
{
|
||||
filename,
|
||||
kind: "notice",
|
||||
is_error: false,
|
||||
message: "future warning",
|
||||
code: "W001",
|
||||
},
|
||||
]
|
||||
: [],
|
||||
...(mode === "additive" ? { future_report_field: { nested: true } } : {}),
|
||||
total: modules.length,
|
||||
failed: mode === "partial" ? 1 : 0,
|
||||
elapsed_ms: 1,
|
||||
|
||||
Reference in New Issue
Block a user