oxe-cc 1.22.0 → 1.22.2
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/.cursor/commands/oxe-discuss.md +45 -45
- package/.cursor/commands/oxe-execute.md +52 -52
- package/.cursor/commands/oxe-help.md +44 -44
- package/.cursor/commands/oxe-next.md +44 -44
- package/.cursor/commands/oxe-plan.md +49 -49
- package/.cursor/commands/oxe-quick.md +49 -49
- package/.cursor/commands/oxe-review-pr.md +47 -47
- package/.cursor/commands/oxe-scan.md +47 -47
- package/.cursor/commands/oxe-ship.md +47 -47
- package/.cursor/commands/oxe-spec.md +49 -49
- package/.cursor/commands/oxe-verify.md +50 -50
- package/.cursor/commands/oxe.md +51 -51
- package/.github/prompts/oxe-alm.prompt.md +47 -47
- package/.github/prompts/oxe-ask.prompt.md +47 -47
- package/.github/prompts/oxe-capabilities.prompt.md +47 -47
- package/.github/prompts/oxe-checkpoint.prompt.md +47 -47
- package/.github/prompts/oxe-compact.prompt.md +46 -46
- package/.github/prompts/oxe-dashboard.prompt.md +47 -47
- package/.github/prompts/oxe-debug.prompt.md +47 -47
- package/.github/prompts/oxe-discuss.prompt.md +47 -47
- package/.github/prompts/oxe-execute.prompt.md +52 -52
- package/.github/prompts/oxe-forensics.prompt.md +47 -47
- package/.github/prompts/oxe-help.prompt.md +46 -46
- package/.github/prompts/oxe-loop.prompt.md +47 -47
- package/.github/prompts/oxe-milestone.prompt.md +47 -47
- package/.github/prompts/oxe-next.prompt.md +46 -46
- package/.github/prompts/oxe-obs.prompt.md +47 -47
- package/.github/prompts/oxe-plan-agent.prompt.md +46 -46
- package/.github/prompts/oxe-plan.prompt.md +49 -49
- package/.github/prompts/oxe-project.prompt.md +47 -47
- package/.github/prompts/oxe-quick.prompt.md +49 -49
- package/.github/prompts/oxe-research.prompt.md +47 -47
- package/.github/prompts/oxe-retro.prompt.md +47 -47
- package/.github/prompts/oxe-review-pr.prompt.md +47 -47
- package/.github/prompts/oxe-route.prompt.md +47 -47
- package/.github/prompts/oxe-scan.prompt.md +47 -47
- package/.github/prompts/oxe-security.prompt.md +47 -47
- package/.github/prompts/oxe-session.prompt.md +47 -47
- package/.github/prompts/oxe-ship.prompt.md +47 -47
- package/.github/prompts/oxe-skill.prompt.md +47 -47
- package/.github/prompts/oxe-spec.prompt.md +49 -49
- package/.github/prompts/oxe-ui-review.prompt.md +47 -47
- package/.github/prompts/oxe-ui-spec.prompt.md +47 -47
- package/.github/prompts/oxe-update.prompt.md +46 -46
- package/.github/prompts/oxe-validate-gaps.prompt.md +47 -47
- package/.github/prompts/oxe-verify.prompt.md +50 -50
- package/.github/prompts/oxe-workstream.prompt.md +47 -47
- package/.github/prompts/oxe.prompt.md +51 -51
- package/.github/workflows/release.yml +31 -0
- package/CHANGELOG.md +88 -0
- package/README.md +1 -1
- package/bin/lib/commands/ops-commands.cjs +751 -0
- package/bin/lib/commands/spec-program-commands.cjs +337 -0
- package/bin/lib/operational/alm-refine-runtime.cjs +791 -0
- package/bin/lib/operational/child-env.cjs +52 -0
- package/bin/lib/operational/promote-runtime.cjs +1187 -0
- package/bin/lib/oxe-agent-coord.cjs +246 -0
- package/bin/lib/oxe-alm-refine.cjs +97 -1
- package/bin/lib/oxe-ci-adapter.cjs +304 -0
- package/bin/lib/oxe-complexity.cjs +1 -1
- package/bin/lib/oxe-decisions.cjs +9 -3
- package/bin/lib/oxe-dir-info.cjs +20 -1
- package/bin/lib/oxe-env-sanitize.cjs +6 -1
- package/bin/lib/oxe-git-root.cjs +97 -0
- package/bin/lib/oxe-grill.cjs +90 -1
- package/bin/lib/oxe-onboard.cjs +640 -0
- package/bin/lib/oxe-operational.cjs +14481 -15949
- package/bin/lib/oxe-origin.cjs +4 -1
- package/bin/lib/oxe-phase-gates.cjs +139 -2
- package/bin/lib/oxe-plan-build.cjs +62 -2
- package/bin/lib/oxe-plan-mutate.cjs +108 -2
- package/bin/lib/oxe-preflight.cjs +9 -3
- package/bin/lib/oxe-presets.cjs +216 -0
- package/bin/lib/oxe-project-env.cjs +79 -0
- package/bin/lib/oxe-project-health.cjs +2 -0
- package/bin/lib/oxe-reevaluate.cjs +198 -0
- package/bin/lib/oxe-release-ops.cjs +51 -15
- package/bin/lib/oxe-scorecard.cjs +394 -1
- package/bin/lib/oxe-ship-pr.cjs +72 -4
- package/bin/lib/oxe-spec-check.cjs +32 -0
- package/bin/lib/oxe-suite-impact.cjs +1160 -1145
- package/bin/lib/oxe-sync.cjs +99 -2
- package/bin/lib/oxe-verify-cache.cjs +132 -0
- package/bin/lib/oxe-vitest-batch.cjs +10 -3
- package/bin/lib/oxe-worktree-gc.cjs +655 -170
- package/bin/oxe-cc.js +10042 -10669
- package/commands/oxe/alm.md +54 -54
- package/commands/oxe/ask.md +55 -55
- package/commands/oxe/capabilities.md +50 -50
- package/commands/oxe/checkpoint.md +53 -53
- package/commands/oxe/compact.md +47 -47
- package/commands/oxe/dashboard.md +51 -51
- package/commands/oxe/debug.md +58 -58
- package/commands/oxe/discuss.md +58 -58
- package/commands/oxe/execute.md +63 -63
- package/commands/oxe/forensics.md +53 -53
- package/commands/oxe/help.md +48 -48
- package/commands/oxe/loop.md +54 -54
- package/commands/oxe/milestone.md +53 -53
- package/commands/oxe/next.md +49 -49
- package/commands/oxe/obs.md +53 -53
- package/commands/oxe/oxe.md +55 -55
- package/commands/oxe/plan-agent.md +57 -57
- package/commands/oxe/plan.md +59 -59
- package/commands/oxe/project.md +53 -53
- package/commands/oxe/quick.md +53 -53
- package/commands/oxe/research.md +53 -53
- package/commands/oxe/retro.md +53 -53
- package/commands/oxe/review-pr.md +53 -53
- package/commands/oxe/route.md +48 -48
- package/commands/oxe/scan.md +58 -58
- package/commands/oxe/security.md +53 -53
- package/commands/oxe/session.md +53 -53
- package/commands/oxe/ship.md +53 -53
- package/commands/oxe/skill.md +53 -53
- package/commands/oxe/spec.md +59 -59
- package/commands/oxe/ui-review.md +53 -53
- package/commands/oxe/ui-spec.md +53 -53
- package/commands/oxe/update.md +53 -53
- package/commands/oxe/validate-gaps.md +53 -53
- package/commands/oxe/verify-audit.md +50 -50
- package/commands/oxe/verify.md +60 -60
- package/commands/oxe/workflow-authoring.md +50 -50
- package/commands/oxe/workstream.md +53 -53
- package/docs/RELEASE-READINESS.md +7 -1
- package/docs/adr/D-1-isolamento-read-only-e-sanitizacao-centralizada-de-env-vars.md +29 -29
- package/docs/adr/D-2-junction-segura-de-node-modules-condicionada-a-sha-256-de-pa.md +29 -29
- package/docs/adr/D-3-preflight-local-5s-impacto-estatico-e2e-e-leitura-explicita.md +29 -29
- package/docs/adr/D-4-governanca-de-release-unificada-retomada-idempotente-pos-rei.md +29 -29
- package/docs/adr/D-5-core-agnostico-vs-presets-declarativos-de-dominio.md +29 -0
- package/docs/adr/D-6-decomposicao-strangler-fig-de-oxe-cc-e-oxe-operational.md +29 -0
- package/docs/adr/D-7-paridade-pre-push-com-phase-gates-path-aware-json-compacto-e.md +28 -0
- package/docs/adr/D-F1F4-1-paridade-pre-push-compactacao-json-sync-version-pins-e-quali.md +44 -0
- package/docs/adr/README.md +18 -14
- package/lib/runtime/verification/verification-compiler.d.ts +12 -1
- package/lib/runtime/verification/verification-compiler.js +235 -65
- package/oxe/templates/CONFIG.md +14 -1
- package/oxe/workflows/help.md +3 -0
- package/oxe/workflows/lean/execute.md +2 -1
- package/oxe/workflows/ship.md +4 -2
- package/package.json +4 -4
- package/packages/runtime/package.json +1 -1
- package/packages/runtime/src/verification/verification-compiler.ts +193 -25
- package/packages/runtime/tsconfig.json +1 -0
- package/vscode-extension/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import crypto from 'crypto';
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
import path from 'path';
|
|
4
|
-
import { spawnSync } from 'child_process';
|
|
4
|
+
import { spawn, spawnSync } from 'child_process';
|
|
5
5
|
import { parseTestReport, extractTestFileArgs, missingProofs, extractTestResults } from './test-report-parsers';
|
|
6
6
|
import { shellInvocation, childProcessEnv, decodeConsoleOutput } from '../executor/shell-argv';
|
|
7
7
|
import { checkExpectedExports } from './contract-exports';
|
|
@@ -103,6 +103,8 @@ export interface CheckResult {
|
|
|
103
103
|
evidence_refs?: string[];
|
|
104
104
|
/** Bench B55: the command already ran in this suite (same cwd/timeout); this check was judged on that output. */
|
|
105
105
|
reused_run?: boolean;
|
|
106
|
+
/** OXB-222-15: reused a verified passing result from the incremental fingerprint cache without re-running. */
|
|
107
|
+
cached?: boolean;
|
|
106
108
|
/** Why a check was skipped (`needs_structured_check` = criterion has no executable verification). */
|
|
107
109
|
skip_reason?: string | null;
|
|
108
110
|
/** OXB-072: killed by the check timeout (status `error`, never `fail`). */
|
|
@@ -346,12 +348,13 @@ export function compile(
|
|
|
346
348
|
export async function runCheck(
|
|
347
349
|
check: AcceptanceCheck,
|
|
348
350
|
cwd: string,
|
|
349
|
-
timeoutMs = 60_000
|
|
351
|
+
timeoutMs = 60_000,
|
|
352
|
+
opts: { allowOxeRefs?: boolean; useAsync?: boolean } = {}
|
|
350
353
|
): Promise<CheckResult> {
|
|
351
|
-
const first = await runCheckOnce(check, cwd, timeoutMs);
|
|
354
|
+
const first = await runCheckOnce(check, cwd, timeoutMs, opts);
|
|
352
355
|
if (first.status !== 'fail' || !isRunnerTimeoutOnly(`${first.stdout}\n${first.stderr}`)) return first;
|
|
353
356
|
// the rerun is a real second run, never the memoized output of the first
|
|
354
|
-
const second = await runCheckOnce(check, cwd, timeoutMs, { fresh: true });
|
|
357
|
+
const second = await runCheckOnce(check, cwd, timeoutMs, { ...opts, fresh: true });
|
|
355
358
|
const stillTimeoutOnly = second.status === 'fail' && isRunnerTimeoutOnly(`${second.stdout}\n${second.stderr}`);
|
|
356
359
|
return {
|
|
357
360
|
...second,
|
|
@@ -373,18 +376,91 @@ export async function runCheck(
|
|
|
373
376
|
*/
|
|
374
377
|
type CommandRun = { status: number | null; stdout: Buffer; stderr: Buffer; error?: Error; start: number; duration_ms: number };
|
|
375
378
|
let commandMemo: Map<string, CommandRun> | null = null;
|
|
379
|
+
let inFlightMemo: Map<string, Promise<CommandRun>> | null = null;
|
|
376
380
|
|
|
377
381
|
function withCommandMemo<T>(fn: () => Promise<T>): Promise<T> {
|
|
378
382
|
if (commandMemo || process.env.OXE_VERIFY_NO_REUSE === '1') return fn();
|
|
379
383
|
commandMemo = new Map();
|
|
380
|
-
|
|
384
|
+
inFlightMemo = new Map();
|
|
385
|
+
return fn().finally(() => {
|
|
386
|
+
commandMemo = null;
|
|
387
|
+
inFlightMemo = null;
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
function spawnAsyncCommand(
|
|
392
|
+
file: string,
|
|
393
|
+
args: string[],
|
|
394
|
+
options: { cwd: string; env: NodeJS.ProcessEnv; timeout: number; maxBuffer: number; windowsVerbatimArguments?: boolean }
|
|
395
|
+
): Promise<CommandRun> {
|
|
396
|
+
return new Promise((resolve) => {
|
|
397
|
+
const start = Date.now();
|
|
398
|
+
const child = spawn(file, args, {
|
|
399
|
+
cwd: options.cwd,
|
|
400
|
+
env: options.env,
|
|
401
|
+
windowsHide: true,
|
|
402
|
+
windowsVerbatimArguments: options.windowsVerbatimArguments,
|
|
403
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
404
|
+
});
|
|
405
|
+
const outChunks: Buffer[] = [];
|
|
406
|
+
const errChunks: Buffer[] = [];
|
|
407
|
+
let outLen = 0;
|
|
408
|
+
let errLen = 0;
|
|
409
|
+
let settled = false;
|
|
410
|
+
let timedOut = false;
|
|
411
|
+
|
|
412
|
+
const finish = (status: number | null, error?: Error) => {
|
|
413
|
+
if (settled) return;
|
|
414
|
+
settled = true;
|
|
415
|
+
if (timer) clearTimeout(timer);
|
|
416
|
+
resolve({
|
|
417
|
+
status,
|
|
418
|
+
stdout: Buffer.concat(outChunks),
|
|
419
|
+
stderr: Buffer.concat(errChunks),
|
|
420
|
+
error,
|
|
421
|
+
start,
|
|
422
|
+
duration_ms: Date.now() - start,
|
|
423
|
+
});
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
const timer = options.timeout > 0
|
|
427
|
+
? setTimeout(() => {
|
|
428
|
+
timedOut = true;
|
|
429
|
+
try { child.kill('SIGTERM'); } catch { /* ignore */ }
|
|
430
|
+
setTimeout(() => {
|
|
431
|
+
try { child.kill('SIGKILL'); } catch { /* ignore */ }
|
|
432
|
+
}, 1500).unref();
|
|
433
|
+
const err = Object.assign(new Error(`ETIMEDOUT after ${options.timeout}ms`), { code: 'ETIMEDOUT' });
|
|
434
|
+
finish(null, err);
|
|
435
|
+
}, options.timeout)
|
|
436
|
+
: null;
|
|
437
|
+
|
|
438
|
+
child.stdout?.on('data', (chunk: Buffer) => {
|
|
439
|
+
if (outLen < options.maxBuffer) {
|
|
440
|
+
outChunks.push(chunk);
|
|
441
|
+
outLen += chunk.length;
|
|
442
|
+
}
|
|
443
|
+
});
|
|
444
|
+
child.stderr?.on('data', (chunk: Buffer) => {
|
|
445
|
+
if (errLen < options.maxBuffer) {
|
|
446
|
+
errChunks.push(chunk);
|
|
447
|
+
errLen += chunk.length;
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
child.on('error', (err) => {
|
|
451
|
+
if (!timedOut) finish(null, err);
|
|
452
|
+
});
|
|
453
|
+
child.on('close', (code) => {
|
|
454
|
+
if (!timedOut) finish(code);
|
|
455
|
+
});
|
|
456
|
+
});
|
|
381
457
|
}
|
|
382
458
|
|
|
383
459
|
async function runCheckOnce(
|
|
384
460
|
check: AcceptanceCheck,
|
|
385
461
|
cwd: string,
|
|
386
462
|
timeoutMs = 60_000,
|
|
387
|
-
opts: { fresh?: boolean } = {}
|
|
463
|
+
opts: { fresh?: boolean; allowOxeRefs?: boolean; useAsync?: boolean } = {}
|
|
388
464
|
): Promise<CheckResult> {
|
|
389
465
|
if (typeof check.timeout_ms === 'number' && check.timeout_ms > 0) timeoutMs = check.timeout_ms;
|
|
390
466
|
const frozen = check.frozen_files ?? [];
|
|
@@ -417,7 +493,7 @@ async function runCheckOnce(
|
|
|
417
493
|
const exportsExpected = check.exports_expected ?? [];
|
|
418
494
|
if (contracted.length > 0 || exportsExpected.length > 0) {
|
|
419
495
|
const absent = contracted.filter((file) => !fs.existsSync(path.resolve(cwd, file)));
|
|
420
|
-
const leaks = absent.length > 0 ? [] : contracted.filter((file) => referencesOxeInternals(path.resolve(cwd, file)));
|
|
496
|
+
const leaks = (absent.length > 0 || opts.allowOxeRefs) ? [] : contracted.filter((file) => referencesOxeInternals(path.resolve(cwd, file)));
|
|
421
497
|
const exportOutcome = absent.length > 0 || leaks.length > 0
|
|
422
498
|
? { missing: [] as ExpectedExport[], unsupported: [] as string[] }
|
|
423
499
|
: checkExpectedExports(cwd, exportsExpected);
|
|
@@ -490,19 +566,38 @@ async function runCheckOnce(
|
|
|
490
566
|
if (cached) {
|
|
491
567
|
result = cached;
|
|
492
568
|
start = cached.start;
|
|
569
|
+
} else if (opts.useAsync && inFlightMemo && !opts.fresh && inFlightMemo.has(memoKey)) {
|
|
570
|
+
result = await inFlightMemo.get(memoKey)!;
|
|
571
|
+
start = result.start;
|
|
493
572
|
} else {
|
|
494
573
|
// Use a shell so the full command string is interpreted (handles quotes, &&, node -e "...").
|
|
495
574
|
// The child never inherits node:test context: it would emit a serialized protocol, not TAP.
|
|
496
575
|
const shell = shellInvocation(check.command);
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
576
|
+
if (opts.useAsync) {
|
|
577
|
+
const promise = spawnAsyncCommand(shell.file, shell.args, {
|
|
578
|
+
cwd,
|
|
579
|
+
env: childProcessEnv(),
|
|
580
|
+
timeout: timeoutMs,
|
|
581
|
+
maxBuffer: 32 * 1024 * 1024,
|
|
582
|
+
windowsVerbatimArguments: shell.windowsVerbatimArguments,
|
|
583
|
+
});
|
|
584
|
+
if (inFlightMemo && !opts.fresh) inFlightMemo.set(memoKey, promise);
|
|
585
|
+
try {
|
|
586
|
+
result = await promise;
|
|
587
|
+
} finally {
|
|
588
|
+
if (inFlightMemo) inFlightMemo.delete(memoKey);
|
|
589
|
+
}
|
|
590
|
+
} else {
|
|
591
|
+
const spawned = spawnSync(shell.file, shell.args, {
|
|
592
|
+
cwd,
|
|
593
|
+
env: childProcessEnv(),
|
|
594
|
+
timeout: timeoutMs,
|
|
595
|
+
// a Gradle/Android build prints a lot before and around the test lines: 2 MB cut it (ENOBUFS)
|
|
596
|
+
maxBuffer: 32 * 1024 * 1024,
|
|
597
|
+
windowsVerbatimArguments: shell.windowsVerbatimArguments,
|
|
598
|
+
});
|
|
599
|
+
result = { status: spawned.status, stdout: spawned.stdout as unknown as Buffer, stderr: spawned.stderr as unknown as Buffer, error: spawned.error, start, duration_ms: Date.now() - start };
|
|
600
|
+
}
|
|
506
601
|
if (commandMemo) commandMemo.set(memoKey, result);
|
|
507
602
|
}
|
|
508
603
|
|
|
@@ -598,6 +693,17 @@ export async function runSuite(
|
|
|
598
693
|
});
|
|
599
694
|
}
|
|
600
695
|
|
|
696
|
+
function frozenFilesIntact(check: AcceptanceCheck, cwd: string): boolean {
|
|
697
|
+
const frozen = check.frozen_files ?? [];
|
|
698
|
+
if (frozen.length === 0) return true;
|
|
699
|
+
for (const f of frozen) {
|
|
700
|
+
if (f.sha256 === null) return false;
|
|
701
|
+
const abs = path.resolve(cwd, f.path);
|
|
702
|
+
if (!fs.existsSync(abs) || !frozenFileMatches(abs, f.sha256)) return false;
|
|
703
|
+
}
|
|
704
|
+
return true;
|
|
705
|
+
}
|
|
706
|
+
|
|
601
707
|
export async function executeSuite(
|
|
602
708
|
suite: AcceptanceCheckSuite,
|
|
603
709
|
cwd: string,
|
|
@@ -608,21 +714,55 @@ export async function executeSuite(
|
|
|
608
714
|
attemptNumber?: number;
|
|
609
715
|
evidenceStore?: EvidenceStore;
|
|
610
716
|
pluginRegistry?: PluginRegistry;
|
|
717
|
+
concurrency?: number;
|
|
718
|
+
allowOxeRefs?: boolean;
|
|
719
|
+
regressionCache?: Map<string, CheckResult>;
|
|
611
720
|
}
|
|
612
721
|
): Promise<ExecutedVerificationSuite> {
|
|
613
|
-
const
|
|
614
|
-
const
|
|
722
|
+
const checks = suite.checks ?? [];
|
|
723
|
+
const results: CheckResult[] = new Array(checks.length);
|
|
724
|
+
const verificationResults: VerificationResult[] = new Array(checks.length);
|
|
615
725
|
const evidenceRefs = new Map<string, string[]>();
|
|
616
726
|
const timeoutMs = options.timeoutMs ?? 60_000;
|
|
617
727
|
const attemptNumber = options.attemptNumber ?? 1;
|
|
728
|
+
const rawConcurrency = Number(options.concurrency ?? 1);
|
|
729
|
+
const concurrency = Number.isFinite(rawConcurrency) && rawConcurrency > 1
|
|
730
|
+
? Math.min(16, Math.floor(rawConcurrency))
|
|
731
|
+
: 1;
|
|
618
732
|
|
|
619
|
-
|
|
620
|
-
|
|
733
|
+
const runOne = async (idx: number): Promise<void> => {
|
|
734
|
+
const check = checks[idx];
|
|
621
735
|
const provider = options.pluginRegistry?.verifierProviderFor(check.type);
|
|
622
736
|
let result: CheckResult;
|
|
623
737
|
let verificationResult: VerificationResult;
|
|
624
738
|
|
|
625
|
-
|
|
739
|
+
const cachedHit = !provider && options.regressionCache?.get(check.id);
|
|
740
|
+
if (cachedHit && cachedHit.status === 'pass' && frozenFilesIntact(check, cwd)) {
|
|
741
|
+
result = {
|
|
742
|
+
...cachedHit,
|
|
743
|
+
check_id: check.id,
|
|
744
|
+
acceptance_ref: check.acceptance_ref,
|
|
745
|
+
duration_ms: 0,
|
|
746
|
+
cached: true,
|
|
747
|
+
};
|
|
748
|
+
const collected = options.evidenceStore
|
|
749
|
+
? await collectCheckEvidence(options.evidenceStore, check, result, {
|
|
750
|
+
run_id: options.runId,
|
|
751
|
+
work_item_id: options.workItemId,
|
|
752
|
+
attempt_number: attemptNumber,
|
|
753
|
+
})
|
|
754
|
+
: { refs: [], summaryRef: null };
|
|
755
|
+
result.evidence_refs = collected.refs;
|
|
756
|
+
result.summary_evidence_ref = collected.summaryRef;
|
|
757
|
+
verificationResult = {
|
|
758
|
+
verification_id: `vr-${crypto.randomBytes(4).toString('hex')}`,
|
|
759
|
+
work_item_id: options.workItemId,
|
|
760
|
+
check_id: check.id,
|
|
761
|
+
status: result.status,
|
|
762
|
+
evidence_refs: collected.refs,
|
|
763
|
+
summary: result.stdout || 'cached pass',
|
|
764
|
+
};
|
|
765
|
+
} else if (provider) {
|
|
626
766
|
const providerResult = await provider.execute({
|
|
627
767
|
check_id: check.id,
|
|
628
768
|
check_type: check.type,
|
|
@@ -644,7 +784,10 @@ export async function executeSuite(
|
|
|
644
784
|
};
|
|
645
785
|
verificationResult = providerResult;
|
|
646
786
|
} else {
|
|
647
|
-
result = await runCheck(check, cwd, timeoutMs
|
|
787
|
+
result = await runCheck(check, cwd, timeoutMs, {
|
|
788
|
+
allowOxeRefs: options.allowOxeRefs,
|
|
789
|
+
useAsync: concurrency > 1,
|
|
790
|
+
});
|
|
648
791
|
const collected = options.evidenceStore
|
|
649
792
|
? await collectCheckEvidence(options.evidenceStore, check, result, {
|
|
650
793
|
run_id: options.runId,
|
|
@@ -667,9 +810,28 @@ export async function executeSuite(
|
|
|
667
810
|
if (result.evidence_refs && result.evidence_refs.length > 0) {
|
|
668
811
|
evidenceRefs.set(check.id, result.evidence_refs);
|
|
669
812
|
}
|
|
670
|
-
results
|
|
671
|
-
verificationResults
|
|
672
|
-
}
|
|
813
|
+
results[idx] = result;
|
|
814
|
+
verificationResults[idx] = verificationResult;
|
|
815
|
+
};
|
|
816
|
+
|
|
817
|
+
await withCommandMemo(async () => {
|
|
818
|
+
if (concurrency <= 1 || checks.length <= 1) {
|
|
819
|
+
for (let i = 0; i < checks.length; i += 1) {
|
|
820
|
+
await runOne(i);
|
|
821
|
+
}
|
|
822
|
+
} else {
|
|
823
|
+
let nextIdx = 0;
|
|
824
|
+
const workerCount = Math.min(concurrency, checks.length);
|
|
825
|
+
const worker = async () => {
|
|
826
|
+
while (true) {
|
|
827
|
+
const idx = nextIdx;
|
|
828
|
+
nextIdx += 1;
|
|
829
|
+
if (idx >= checks.length) return;
|
|
830
|
+
await runOne(idx);
|
|
831
|
+
}
|
|
832
|
+
};
|
|
833
|
+
await Promise.all(Array.from({ length: workerCount }, () => worker()));
|
|
834
|
+
}
|
|
673
835
|
});
|
|
674
836
|
|
|
675
837
|
const manifest = buildManifest(options.runId, results, {
|
|
@@ -718,6 +880,9 @@ export async function verifyRun(input: {
|
|
|
718
880
|
evidenceStore?: EvidenceStore;
|
|
719
881
|
attemptNumber?: number;
|
|
720
882
|
timeoutMs?: number;
|
|
883
|
+
concurrency?: number;
|
|
884
|
+
allowOxeRefs?: boolean;
|
|
885
|
+
regressionCache?: Map<string, CheckResult>;
|
|
721
886
|
}): Promise<VerifyRunResult> {
|
|
722
887
|
const gaps: string[] = [];
|
|
723
888
|
if (!input.suite || !Array.isArray(input.suite.checks) || input.suite.checks.length === 0) {
|
|
@@ -742,6 +907,9 @@ export async function verifyRun(input: {
|
|
|
742
907
|
attemptNumber: input.attemptNumber,
|
|
743
908
|
evidenceStore: input.evidenceStore,
|
|
744
909
|
pluginRegistry: input.pluginRegistry,
|
|
910
|
+
concurrency: input.concurrency,
|
|
911
|
+
allowOxeRefs: input.allowOxeRefs,
|
|
912
|
+
regressionCache: input.regressionCache,
|
|
745
913
|
});
|
|
746
914
|
saveManifest(input.projectRoot, input.runId, executed.manifest);
|
|
747
915
|
saveRiskLedger(input.projectRoot, input.runId, executed.risk_ledger);
|