@riddledc/riddle-proof 0.8.24 → 0.8.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/dist/advanced/engine-harness.cjs +54 -1
- package/dist/advanced/engine-harness.js +2 -2
- package/dist/advanced/index.cjs +54 -1
- package/dist/advanced/index.d.cts +1 -1
- package/dist/advanced/index.d.ts +1 -1
- package/dist/advanced/index.js +4 -4
- package/dist/advanced/proof-run-core.cjs +54 -1
- package/dist/advanced/proof-run-core.js +1 -1
- package/dist/advanced/proof-run-engine.cjs +54 -1
- package/dist/advanced/proof-run-engine.d.cts +1 -1
- package/dist/advanced/proof-run-engine.d.ts +1 -1
- package/dist/advanced/proof-run-engine.js +2 -2
- package/dist/advanced/runner.js +2 -2
- package/dist/{chunk-P2RN2NYR.js → chunk-DZYH67J2.js} +1 -1
- package/dist/{chunk-KS3N5APP.js → chunk-EGOVHMBQ.js} +1 -1
- package/dist/{chunk-2DW2LBUD.js → chunk-EMVMXVJV.js} +1 -1
- package/dist/{chunk-FU73I4V3.js → chunk-RF72NWHM.js} +54 -1
- package/dist/{chunk-UTQJHWCQ.js → chunk-WULFU42E.js} +322 -2
- package/dist/cli/index.js +3 -3
- package/dist/cli.cjs +374 -1
- package/dist/cli.js +3 -3
- package/dist/engine-harness.cjs +54 -1
- package/dist/engine-harness.js +2 -2
- package/dist/index.cjs +54 -1
- package/dist/index.js +3 -3
- package/dist/proof-run-core.cjs +54 -1
- package/dist/proof-run-core.js +1 -1
- package/dist/{proof-run-engine-Vh9uESqh.d.ts → proof-run-engine-By7oLsF-.d.ts} +3 -3
- package/dist/{proof-run-engine-DI1qBmMf.d.cts → proof-run-engine-D80hVFMf.d.cts} +3 -3
- package/dist/proof-run-engine.cjs +54 -1
- package/dist/proof-run-engine.d.cts +1 -1
- package/dist/proof-run-engine.d.ts +1 -1
- package/dist/proof-run-engine.js +2 -2
- package/dist/runner.js +2 -2
- package/package.json +1 -1
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
createDisabledRiddleProofAgentAdapter,
|
|
23
23
|
readRiddleProofRunStatus,
|
|
24
24
|
runRiddleProofEngineHarness
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-EMVMXVJV.js";
|
|
26
26
|
import {
|
|
27
27
|
createCheckpointResponseTemplate
|
|
28
28
|
} from "./chunk-4FOHZ7JG.js";
|
|
@@ -32,7 +32,8 @@ import {
|
|
|
32
32
|
} from "./chunk-EEIYUZXE.js";
|
|
33
33
|
|
|
34
34
|
// src/cli.ts
|
|
35
|
-
import {
|
|
35
|
+
import { spawnSync } from "child_process";
|
|
36
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, realpathSync, statSync, writeFileSync } from "fs";
|
|
36
37
|
import path from "path";
|
|
37
38
|
var RIDDLE_PROFILE_BALANCE_PREFLIGHT_MIN_SECONDS_PER_JOB = 30;
|
|
38
39
|
var KNOWN_CLI_OPTIONS = /* @__PURE__ */ new Set([
|
|
@@ -73,6 +74,7 @@ var KNOWN_CLI_OPTIONS = /* @__PURE__ */ new Set([
|
|
|
73
74
|
"intervalMs",
|
|
74
75
|
"job",
|
|
75
76
|
"jobId",
|
|
77
|
+
"localCore",
|
|
76
78
|
"maxIterations",
|
|
77
79
|
"navigationTimeout",
|
|
78
80
|
"output",
|
|
@@ -82,6 +84,8 @@ var KNOWN_CLI_OPTIONS = /* @__PURE__ */ new Set([
|
|
|
82
84
|
"pollAttempts",
|
|
83
85
|
"pollIntervalMs",
|
|
84
86
|
"port",
|
|
87
|
+
"pack",
|
|
88
|
+
"packFile",
|
|
85
89
|
"profile",
|
|
86
90
|
"progressEveryMs",
|
|
87
91
|
"quiet",
|
|
@@ -132,6 +136,7 @@ function usage() {
|
|
|
132
136
|
" riddle-proof-loop run-profile --profile <file|json|-> --url <base-url> [--base-url <base-url>] [--runner riddle] [--viewport-name <name[,name...]>] [--strict true|false; default false] [--split-viewports true|false; default false] [--balance-preflight true|false; default true] [--poll-attempts n] [--output <dir>|--output-dir <dir>] [--result-format json|compact-json|summary|none; default json] [--quiet]",
|
|
133
137
|
" riddle-proof-loop run-profile aggregate --profile <file|json|-> --url <base-url> [--base-url <base-url>] --input-dir <dir>|--inputs <path[,path...]> [--output <dir>|--output-dir <dir>] [--result-format json|compact-json|summary|none; default json]",
|
|
134
138
|
" riddle-proof-loop run-profile recover --profile <file|json|-> --url <base-url> [--base-url <base-url>] --job <job-id> [--viewport-name <name[,name...]>] [--output <dir>|--output-dir <dir>] [--result-format json|compact-json|summary|none; default json]",
|
|
139
|
+
" riddle-proof-loop regression-pack run [--pack oc-flow-regression|--pack-file <file>] [--local-core true|false; default true] [--format json|markdown|compact-json; default json] [--output <dir>|--output-dir <dir>]",
|
|
135
140
|
" riddle-proof-loop profile-body-assertions --artifact <file|url|-> --candidates-json <file|json|-> [--required-json <file|json|->] [--format json|body-contains]",
|
|
136
141
|
" riddle-proof-loop profile-http-status-preflight --profile <file|json|-> --url <base-url> [--format json|summary]",
|
|
137
142
|
" riddle-proof-loop riddle-preview-deploy <build-dir> <label> [--framework spa|static]",
|
|
@@ -210,6 +215,27 @@ function runProfileViewportNamesOption(options) {
|
|
|
210
215
|
}
|
|
211
216
|
var DEFAULT_PROFILE_UNSUBMITTED_RETRY_TIMEOUT_MS = 9e4;
|
|
212
217
|
var DEFAULT_PROFILE_UNSUBMITTED_RETRIES = 2;
|
|
218
|
+
function cliPackageRoot() {
|
|
219
|
+
const entryPath = process.argv[1] ? (() => {
|
|
220
|
+
try {
|
|
221
|
+
return realpathSync(process.argv[1]);
|
|
222
|
+
} catch {
|
|
223
|
+
return process.argv[1];
|
|
224
|
+
}
|
|
225
|
+
})() : "";
|
|
226
|
+
const candidates = [
|
|
227
|
+
entryPath ? path.resolve(path.dirname(entryPath), "..") : "",
|
|
228
|
+
path.resolve(process.cwd(), "packages", "riddle-proof"),
|
|
229
|
+
process.cwd()
|
|
230
|
+
].filter(Boolean);
|
|
231
|
+
for (const candidate of candidates) {
|
|
232
|
+
if (existsSync(path.join(candidate, "runtime", "tests", "trust_boundary_regression.py")) && existsSync(path.join(candidate, "examples", "regression-packs"))) {
|
|
233
|
+
return candidate;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return candidates[0] || process.cwd();
|
|
237
|
+
}
|
|
238
|
+
var CLI_PACKAGE_ROOT = cliPackageRoot();
|
|
213
239
|
function optionNumber(options, ...keys) {
|
|
214
240
|
for (const key of keys) {
|
|
215
241
|
const value = optionString(options, key);
|
|
@@ -290,6 +316,292 @@ function writeRunProfileResult(result, options) {
|
|
|
290
316
|
process.stdout.write(`${JSON.stringify(result, null, 2)}
|
|
291
317
|
`);
|
|
292
318
|
}
|
|
319
|
+
function regressionPackResultFormatOption(options) {
|
|
320
|
+
const format = optionString(options, "format") ?? optionString(options, "resultFormat") ?? "json";
|
|
321
|
+
if (format === "md" || format === "summary") return "markdown";
|
|
322
|
+
if (format === "json" || format === "compact-json" || format === "markdown") return format;
|
|
323
|
+
throw new Error("--format must be json, compact-json, or markdown.");
|
|
324
|
+
}
|
|
325
|
+
function regressionPackPathForCli(options) {
|
|
326
|
+
const packFile = optionString(options, "packFile");
|
|
327
|
+
if (packFile) return path.resolve(packFile);
|
|
328
|
+
const pack = optionString(options, "pack") || "oc-flow-regression";
|
|
329
|
+
if (existsSync(pack)) return path.resolve(pack);
|
|
330
|
+
const normalized = pack.endsWith(".json") ? pack : `${pack}.json`;
|
|
331
|
+
return path.join(CLI_PACKAGE_ROOT, "examples", "regression-packs", normalized);
|
|
332
|
+
}
|
|
333
|
+
function readRegressionPackForCli(options) {
|
|
334
|
+
const filePath = regressionPackPathForCli(options);
|
|
335
|
+
if (!existsSync(filePath)) throw new Error(`Regression pack not found: ${filePath}`);
|
|
336
|
+
const parsed = JSON.parse(readFileSync(filePath, "utf-8"));
|
|
337
|
+
if (parsed.version !== "riddle-proof.regression-pack.v1") {
|
|
338
|
+
throw new Error(`${filePath} is not a riddle-proof.regression-pack.v1 manifest.`);
|
|
339
|
+
}
|
|
340
|
+
return { filePath, pack: parsed };
|
|
341
|
+
}
|
|
342
|
+
function regressionPackStringArray(value) {
|
|
343
|
+
return Array.isArray(value) ? value.filter((item) => typeof item === "string" && item.trim().length > 0) : [];
|
|
344
|
+
}
|
|
345
|
+
function regressionPackRecord(value) {
|
|
346
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
347
|
+
}
|
|
348
|
+
function regressionPackCommandForLocalCore(pack) {
|
|
349
|
+
const suite = regressionPackRecord(pack.local_core_suite);
|
|
350
|
+
return cliString(suite.command) || "python3 packages/riddle-proof/runtime/tests/trust_boundary_regression.py";
|
|
351
|
+
}
|
|
352
|
+
function regressionPackLocalCoreScriptPath() {
|
|
353
|
+
return path.join(CLI_PACKAGE_ROOT, "runtime", "tests", "trust_boundary_regression.py");
|
|
354
|
+
}
|
|
355
|
+
function tailLines(text, limit = 40) {
|
|
356
|
+
const lines = text.split(/\r?\n/).filter((line) => line.trim().length > 0);
|
|
357
|
+
return lines.slice(-limit);
|
|
358
|
+
}
|
|
359
|
+
function parseRegressionPackLocalCoreStdout(stdout) {
|
|
360
|
+
try {
|
|
361
|
+
return JSON.parse(stdout);
|
|
362
|
+
} catch {
|
|
363
|
+
const start = stdout.indexOf("{");
|
|
364
|
+
const end = stdout.lastIndexOf("}");
|
|
365
|
+
if (start >= 0 && end > start) {
|
|
366
|
+
return JSON.parse(stdout.slice(start, end + 1));
|
|
367
|
+
}
|
|
368
|
+
throw new Error("Local core suite did not emit parseable JSON.");
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
function regressionPackCaseNames(result) {
|
|
372
|
+
const results = Array.isArray(result.results) ? result.results : [];
|
|
373
|
+
return results.map((item) => cliString(regressionPackRecord(item).name)).filter((item) => Boolean(item));
|
|
374
|
+
}
|
|
375
|
+
function regressionPackFailedCaseNames(result) {
|
|
376
|
+
const failed = Array.isArray(result.failed) ? result.failed : [];
|
|
377
|
+
const namedFailed = failed.map((item) => cliString(regressionPackRecord(item).name)).filter((item) => Boolean(item));
|
|
378
|
+
if (namedFailed.length) return namedFailed;
|
|
379
|
+
const results = Array.isArray(result.results) ? result.results : [];
|
|
380
|
+
return results.map(regressionPackRecord).filter((item) => item.ok === false).map((item) => cliString(item.name)).filter((item) => Boolean(item));
|
|
381
|
+
}
|
|
382
|
+
function regressionPackMarkersSeen(result, markers) {
|
|
383
|
+
const encoded = JSON.stringify(result);
|
|
384
|
+
return markers.filter((marker) => encoded.includes(marker));
|
|
385
|
+
}
|
|
386
|
+
function runRegressionPackLocalCore(pack) {
|
|
387
|
+
const script = regressionPackLocalCoreScriptPath();
|
|
388
|
+
const suite = regressionPackRecord(pack.local_core_suite);
|
|
389
|
+
const requiredCases = regressionPackStringArray(suite.required_cases);
|
|
390
|
+
const forbiddenMarkers = regressionPackStringArray(pack.forbidden_terminal_markers);
|
|
391
|
+
const command = regressionPackCommandForLocalCore(pack);
|
|
392
|
+
const startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
393
|
+
if (!existsSync(script)) {
|
|
394
|
+
return {
|
|
395
|
+
requested: true,
|
|
396
|
+
ok: false,
|
|
397
|
+
command,
|
|
398
|
+
started_at: startedAt,
|
|
399
|
+
finished_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
400
|
+
error: `Local core suite script not found: ${script}`,
|
|
401
|
+
required_cases: requiredCases,
|
|
402
|
+
missing_required_cases: requiredCases,
|
|
403
|
+
forbidden_terminal_markers_seen: []
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
const child = spawnSync("python3", [script], {
|
|
407
|
+
cwd: CLI_PACKAGE_ROOT,
|
|
408
|
+
encoding: "utf-8",
|
|
409
|
+
timeout: 12e4
|
|
410
|
+
});
|
|
411
|
+
const finishedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
412
|
+
let parsed = null;
|
|
413
|
+
let parseError;
|
|
414
|
+
try {
|
|
415
|
+
parsed = parseRegressionPackLocalCoreStdout(child.stdout || "");
|
|
416
|
+
} catch (error) {
|
|
417
|
+
parseError = error instanceof Error ? error.message : String(error);
|
|
418
|
+
}
|
|
419
|
+
const caseNames = parsed ? regressionPackCaseNames(parsed) : [];
|
|
420
|
+
const missingRequiredCases = requiredCases.filter((caseId) => !caseNames.includes(caseId));
|
|
421
|
+
const failedCases = parsed ? regressionPackFailedCaseNames(parsed) : [];
|
|
422
|
+
const markersSeen = parsed ? regressionPackMarkersSeen(parsed, forbiddenMarkers) : [];
|
|
423
|
+
const ok = child.status === 0 && parsed?.ok === true && !missingRequiredCases.length && !failedCases.length && !markersSeen.length;
|
|
424
|
+
return {
|
|
425
|
+
requested: true,
|
|
426
|
+
ok,
|
|
427
|
+
command,
|
|
428
|
+
executed: {
|
|
429
|
+
binary: "python3",
|
|
430
|
+
args: [path.relative(CLI_PACKAGE_ROOT, script)],
|
|
431
|
+
cwd: CLI_PACKAGE_ROOT
|
|
432
|
+
},
|
|
433
|
+
exit_code: child.status,
|
|
434
|
+
signal: child.signal,
|
|
435
|
+
started_at: startedAt,
|
|
436
|
+
finished_at: finishedAt,
|
|
437
|
+
suite: cliString(parsed?.suite) || null,
|
|
438
|
+
case_count: typeof parsed?.case_count === "number" ? parsed.case_count : caseNames.length,
|
|
439
|
+
passed_case_count: caseNames.length - failedCases.length,
|
|
440
|
+
required_cases: requiredCases,
|
|
441
|
+
observed_cases: caseNames,
|
|
442
|
+
missing_required_cases: missingRequiredCases,
|
|
443
|
+
failed_cases: failedCases,
|
|
444
|
+
forbidden_terminal_markers_seen: markersSeen,
|
|
445
|
+
parse_error: parseError,
|
|
446
|
+
stderr_tail: tailLines(child.stderr || ""),
|
|
447
|
+
stdout_tail: ok ? void 0 : tailLines(child.stdout || "")
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
function openClawHandoffPromptForRegressionPack(pack, input) {
|
|
451
|
+
const minimumVersions = regressionPackRecord(pack.minimum_versions);
|
|
452
|
+
const runtimeGate = regressionPackRecord(pack.runtime_gate);
|
|
453
|
+
const liveSuite = regressionPackRecord(pack.openclaw_live_suite);
|
|
454
|
+
const target = regressionPackRecord(liveSuite.target);
|
|
455
|
+
const cases = Array.isArray(liveSuite.cases) ? liveSuite.cases.map(regressionPackRecord) : [];
|
|
456
|
+
const fields = regressionPackStringArray(liveSuite.result_log_fields);
|
|
457
|
+
const forbiddenMarkers = regressionPackStringArray(pack.forbidden_terminal_markers);
|
|
458
|
+
const lines = [
|
|
459
|
+
"Run the Riddle Proof OC flow regression pack in small serial chunks.",
|
|
460
|
+
"",
|
|
461
|
+
`First call ${cliString(runtimeGate.tool) || "riddle_proof_status"} and count only fresh loaded-runtime runs. Required loaded versions are at least:`,
|
|
462
|
+
...Object.entries(minimumVersions).map(([name, version]) => `- ${name}: ${version}`),
|
|
463
|
+
"",
|
|
464
|
+
"Target/default flags:",
|
|
465
|
+
...Object.entries(target).map(([key, value]) => `- ${key}: ${JSON.stringify(value)}`),
|
|
466
|
+
"",
|
|
467
|
+
"Rules:",
|
|
468
|
+
"- Run cases serially, not as one broad parallel batch.",
|
|
469
|
+
"- If loaded metadata is stale, stop and restart/reload the gateway before counting results.",
|
|
470
|
+
"- If any generic lifecycle marker appears, report the exact marker and artifact, then stop the counted batch.",
|
|
471
|
+
`- Forbidden terminal markers: ${forbiddenMarkers.join(", ") || "none"}.`,
|
|
472
|
+
fields.length ? `- Log fields for every counted run: ${fields.join(", ")}.` : "",
|
|
473
|
+
"",
|
|
474
|
+
"Cases:",
|
|
475
|
+
...cases.map((testCase, index) => {
|
|
476
|
+
const expect = regressionPackRecord(testCase.expect);
|
|
477
|
+
return [
|
|
478
|
+
`${index + 1}. ${cliString(testCase.id) || "unnamed-case"}: ${cliString(testCase.intent) || "no intent"}`,
|
|
479
|
+
` Expect: ${JSON.stringify(expect)}`
|
|
480
|
+
].join("\n");
|
|
481
|
+
}),
|
|
482
|
+
"",
|
|
483
|
+
input.localCoreOk ? "Local generic core suite is green, so OC should only be validating wrapper/runtime behavior." : "Local generic core suite is not green or was not run; do not count OC failures as wrapper-only until local core is green."
|
|
484
|
+
].filter((line) => line !== "");
|
|
485
|
+
return lines.join("\n");
|
|
486
|
+
}
|
|
487
|
+
function compactRegressionPackRunResult(result) {
|
|
488
|
+
const localCore = regressionPackRecord(result.local_core);
|
|
489
|
+
const openClaw = regressionPackRecord(result.openclaw_live_suite);
|
|
490
|
+
return {
|
|
491
|
+
version: result.version,
|
|
492
|
+
pack_id: result.pack_id,
|
|
493
|
+
ok: result.ok,
|
|
494
|
+
local_core: {
|
|
495
|
+
requested: localCore.requested,
|
|
496
|
+
ok: localCore.ok,
|
|
497
|
+
command: localCore.command,
|
|
498
|
+
case_count: localCore.case_count,
|
|
499
|
+
missing_required_cases: localCore.missing_required_cases,
|
|
500
|
+
failed_cases: localCore.failed_cases,
|
|
501
|
+
forbidden_terminal_markers_seen: localCore.forbidden_terminal_markers_seen
|
|
502
|
+
},
|
|
503
|
+
openclaw_live_case_count: openClaw.case_count,
|
|
504
|
+
output_dir: result.output_dir
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
function regressionPackRunMarkdown(result) {
|
|
508
|
+
const localCore = regressionPackRecord(result.local_core);
|
|
509
|
+
const runtimeGate = regressionPackRecord(result.runtime_gate);
|
|
510
|
+
const minimumVersions = regressionPackRecord(result.minimum_versions);
|
|
511
|
+
const openClaw = regressionPackRecord(result.openclaw_live_suite);
|
|
512
|
+
const lines = [
|
|
513
|
+
`# ${cliString(result.public_name) || cliString(result.pack_id) || "Riddle Proof Regression Pack"}`,
|
|
514
|
+
"",
|
|
515
|
+
`Status: ${result.ok ? "passed" : "failed"}`,
|
|
516
|
+
`Pack: ${cliString(result.pack_id) || "unknown"}`,
|
|
517
|
+
"",
|
|
518
|
+
"## Local Core",
|
|
519
|
+
"",
|
|
520
|
+
`- requested: ${localCore.requested === true}`,
|
|
521
|
+
`- ok: ${localCore.ok === true}`,
|
|
522
|
+
`- command: ${cliString(localCore.command) || "n/a"}`,
|
|
523
|
+
`- cases: ${localCore.case_count ?? "n/a"}`,
|
|
524
|
+
`- missing required: ${regressionPackStringArray(localCore.missing_required_cases).join(", ") || "none"}`,
|
|
525
|
+
`- failed cases: ${regressionPackStringArray(localCore.failed_cases).join(", ") || "none"}`,
|
|
526
|
+
`- forbidden markers seen: ${regressionPackStringArray(localCore.forbidden_terminal_markers_seen).join(", ") || "none"}`,
|
|
527
|
+
"",
|
|
528
|
+
"## Runtime Gate",
|
|
529
|
+
"",
|
|
530
|
+
`- tool: ${cliString(runtimeGate.tool) || "n/a"}`,
|
|
531
|
+
...Object.entries(minimumVersions).map(([name, version]) => `- ${name}: ${version}`),
|
|
532
|
+
"",
|
|
533
|
+
"## OpenClaw Live Suite",
|
|
534
|
+
"",
|
|
535
|
+
`- case count: ${openClaw.case_count ?? "n/a"}`,
|
|
536
|
+
`- result log fields: ${regressionPackStringArray(openClaw.result_log_fields).join(", ") || "n/a"}`,
|
|
537
|
+
"",
|
|
538
|
+
"## OC Handoff Prompt",
|
|
539
|
+
"",
|
|
540
|
+
"```text",
|
|
541
|
+
cliString(result.openclaw_handoff_prompt) || "",
|
|
542
|
+
"```",
|
|
543
|
+
""
|
|
544
|
+
];
|
|
545
|
+
return `${lines.join("\n")}
|
|
546
|
+
`;
|
|
547
|
+
}
|
|
548
|
+
function writeRegressionPackOutput(outputDir, result) {
|
|
549
|
+
if (!outputDir) return;
|
|
550
|
+
mkdirSync(outputDir, { recursive: true });
|
|
551
|
+
writeFileSync(path.join(outputDir, "regression-pack-result.json"), `${JSON.stringify(result, null, 2)}
|
|
552
|
+
`);
|
|
553
|
+
writeFileSync(path.join(outputDir, "summary.md"), regressionPackRunMarkdown(result));
|
|
554
|
+
writeFileSync(path.join(outputDir, "oc-handoff.md"), `${cliString(result.openclaw_handoff_prompt) || ""}
|
|
555
|
+
`);
|
|
556
|
+
}
|
|
557
|
+
function runRegressionPackForCli(options) {
|
|
558
|
+
const { filePath, pack } = readRegressionPackForCli(options);
|
|
559
|
+
const localCoreRequested = optionBoolean(options, "localCore") ?? true;
|
|
560
|
+
const localCore = localCoreRequested ? runRegressionPackLocalCore(pack) : { requested: false, ok: true, command: regressionPackCommandForLocalCore(pack) };
|
|
561
|
+
const liveSuite = regressionPackRecord(pack.openclaw_live_suite);
|
|
562
|
+
const liveCases = Array.isArray(liveSuite.cases) ? liveSuite.cases : [];
|
|
563
|
+
const localCoreRecord = regressionPackRecord(localCore);
|
|
564
|
+
const localCoreValidated = localCoreRecord.requested === true && localCoreRecord.ok === true;
|
|
565
|
+
const ok = localCoreRequested ? localCoreValidated : true;
|
|
566
|
+
const result = {
|
|
567
|
+
version: "riddle-proof.regression-pack-run-result.v1",
|
|
568
|
+
ok,
|
|
569
|
+
local_core_validated: localCoreValidated,
|
|
570
|
+
generated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
571
|
+
pack_path: filePath,
|
|
572
|
+
pack_id: cliString(pack.pack_id) || null,
|
|
573
|
+
public_name: cliString(pack.public_name) || null,
|
|
574
|
+
description: cliString(pack.description) || null,
|
|
575
|
+
minimum_versions: regressionPackRecord(pack.minimum_versions),
|
|
576
|
+
runtime_gate: regressionPackRecord(pack.runtime_gate),
|
|
577
|
+
forbidden_terminal_markers: regressionPackStringArray(pack.forbidden_terminal_markers),
|
|
578
|
+
local_core: localCore,
|
|
579
|
+
openclaw_live_suite: {
|
|
580
|
+
target: regressionPackRecord(liveSuite.target),
|
|
581
|
+
result_log_fields: regressionPackStringArray(liveSuite.result_log_fields),
|
|
582
|
+
case_count: liveCases.length,
|
|
583
|
+
case_ids: liveCases.map((item) => cliString(regressionPackRecord(item).id)).filter(Boolean)
|
|
584
|
+
},
|
|
585
|
+
openclaw_handoff_prompt: openClawHandoffPromptForRegressionPack(pack, { localCoreOk: localCoreValidated }),
|
|
586
|
+
output_dir: profileOutputDirOption(options) || null
|
|
587
|
+
};
|
|
588
|
+
writeRegressionPackOutput(profileOutputDirOption(options), result);
|
|
589
|
+
return result;
|
|
590
|
+
}
|
|
591
|
+
function writeRegressionPackRunResult(result, options) {
|
|
592
|
+
const format = regressionPackResultFormatOption(options);
|
|
593
|
+
if (format === "markdown") {
|
|
594
|
+
process.stdout.write(regressionPackRunMarkdown(result));
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
if (format === "compact-json") {
|
|
598
|
+
process.stdout.write(`${JSON.stringify(compactRegressionPackRunResult(result), null, 2)}
|
|
599
|
+
`);
|
|
600
|
+
return;
|
|
601
|
+
}
|
|
602
|
+
process.stdout.write(`${JSON.stringify(result, null, 2)}
|
|
603
|
+
`);
|
|
604
|
+
}
|
|
293
605
|
function previewFrameworkOption(options) {
|
|
294
606
|
const framework = optionString(options, "framework") ?? "static";
|
|
295
607
|
if (framework === "spa" || framework === "static") return framework;
|
|
@@ -3954,6 +4266,14 @@ async function main() {
|
|
|
3954
4266
|
process.exitCode = profileStatusExitCode(profile, result.status);
|
|
3955
4267
|
return;
|
|
3956
4268
|
}
|
|
4269
|
+
if (command === "regression-pack") {
|
|
4270
|
+
const action = positional[1] || "run";
|
|
4271
|
+
if (action !== "run") throw new Error("Only `regression-pack run` is supported.");
|
|
4272
|
+
const result = runRegressionPackForCli(options);
|
|
4273
|
+
writeRegressionPackRunResult(result, options);
|
|
4274
|
+
process.exitCode = result.ok ? 0 : 1;
|
|
4275
|
+
return;
|
|
4276
|
+
}
|
|
3957
4277
|
if (command === "profile-http-status-preflight") {
|
|
3958
4278
|
const profile = normalizeProfileForCli(options);
|
|
3959
4279
|
const result = await preflightRiddleProofProfileHttpStatusChecks(profile);
|
package/dist/cli/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "../chunk-
|
|
1
|
+
import "../chunk-WULFU42E.js";
|
|
2
2
|
import "../chunk-PEWAIEER.js";
|
|
3
3
|
import "../chunk-TWTEUS7R.js";
|
|
4
|
-
import "../chunk-
|
|
4
|
+
import "../chunk-EMVMXVJV.js";
|
|
5
5
|
import "../chunk-YZUVEJ5B.js";
|
|
6
6
|
import "../chunk-FMOYUYH2.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-RF72NWHM.js";
|
|
8
8
|
import "../chunk-4FOHZ7JG.js";
|
|
9
9
|
import "../chunk-JFQXAJH2.js";
|
|
10
10
|
import "../chunk-EEIYUZXE.js";
|