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:
Pionxzh
2026-10-10 23:02:15 +08:00
committed by GitHub
co-authored by morluto
parent 0363e5a8e1
commit ded59689ce
16 changed files with 272 additions and 66 deletions
+12 -7
View File
@@ -10,20 +10,20 @@ import { readRecoveryFile, recoveryFailureMessage } from "./RecoveryFiles.js";
import { RECOVERY_LIMITS } from "./WakaruRelease.js";
import type { runWakaruCommand } from "./WakaruCommand.js";
const warningSchema = z.strictObject({
const warningSchema = z.looseObject({
filename: z.string(),
kind: z.string(),
is_error: z.boolean(),
message: z.string(),
});
const reportSchema = z.strictObject({
const reportSchema = z.looseObject({
detected_formats: z.array(z.string()),
safety: z.string(),
modules: z.array(
z.strictObject({
z.looseObject({
filename: z.string().min(1),
kind: z.literal("javascript"),
status: z.literal("decompiled"),
status: z.string().min(1),
}),
),
warnings: z.array(warningSchema),
@@ -35,12 +35,12 @@ const rangeSchema = z.tuple([
z.number().int().nonnegative(),
z.number().int().nonnegative(),
]);
const provenanceSchema = z.strictObject({
const provenanceSchema = z.looseObject({
format: z.string(),
strategy: z.string(),
modules: z.record(
z.string(),
z.strictObject({
z.looseObject({
input: z.string(),
ranges: z.array(rangeSchema),
extraction: z.string(),
@@ -59,7 +59,12 @@ type ReportContext = {
files: readonly { relativePath: string }[];
};
/** Parse exact pinned producer JSON before projecting provider-neutral artifacts. */
/**
* Parse producer JSON before projecting provider-neutral artifacts. Wakaru adds
* fields and category values within a major version, so unknown keys are kept
* and `status` stays the reported string; identity, path, range and file-set
* checks below remain exact.
*/
export const parseWakaruReports = async (context: ReportContext) => {
const { execution, provenancePath } = context;