refactor(kernel): eliminate remaining record predicate copies and compose cleanup dependencies through shared owner (#11799)

* refactor(kernel): eliminate remaining record predicate copies and compose cleanup dependencies through shared owner

* fix(firmware,tests): remove unused cleanup import and align CI shard and CLI registration tests
This commit is contained in:
morluto authored and GitHub committed 2026-11-16 23:09:17 -05:00
1 parent 4a6bee6cdb
commit af062e7a2d
21 files changed
+65 -122

No files matched your search

+2 -16
View File
@@ -247,22 +247,8 @@ check(
);
// "Non-null object other than an array" has one owner: src/kernel/isRecord.ts.
// A local predicate with that body, under any name, is a copy. The listed files
// still hold one and may only be removed from the list; a listed file that no
// longer matches fails so the list shrinks with the code.
const RECORD_PREDICATE_COPIES = [
// Exported under a module-specific name; importers still use that name.
"src/browser/history/CaptureRedaction.ts",
"src/contracts/compactJsonSchema.ts",
"src/domain/analysisView/environmentStateRules.ts",
// Owned by the advertised-schema workstream.
"src/contracts/inputSchemaPresentation.ts",
// Narrows a protocol-specific parameter type, not unknown.
"src/browser/execution/CdpRuntimeInitiator.ts",
// Named `object`, which also spells the typeof result in these files.
"src/pcap/PcapDnsWire.ts",
"src/pcap/PcapOutput.ts",
];
// A local predicate with that body, under any name, is a copy.
const RECORD_PREDICATE_COPIES = [];
const mismatchedRecordCopies = files.filter(({ path, content }) => {
if (path === "src/kernel/isRecord.ts") return false;
const { named, bodies } = recordPredicateCounts(content);
@@ -4,7 +4,6 @@
"src/application/JsonFiles.ts": 1,
"src/application/SetupCleanupOwner.ts": 2,
"src/application/binary/AnalysisProviderRegistry.ts": 2,
"src/application/binary/BinarySession.ts": 1,
"src/application/binary/CompositeProvider.ts": 1,
"src/application/closeOwnedWebResources.ts": 1,
"src/application/desktop/DesktopApplicationExport.ts": 2,
@@ -14,21 +13,17 @@
"src/browser/CdpElectronProvider.ts": 1,
"src/browser/CdpTargetSessionOwner.ts": 2,
"src/browser/PlaywrightBrowserScenarioProvider.ts": 2,
"src/browser/PlaywrightElectronActiveActions.ts": 1,
"src/browser/PlaywrightElectronActiveProvider.ts": 1,
"src/browser/WebSourceMapFetcher.ts": 2,
"src/browser/history/HistoricalCaptureDecoder.ts": 1,
"src/cli/desktopCaptureCommands.ts": 1,
"src/cutter/CutterBridgeClient.ts": 1,
"src/desktop/ScreenJudgeProcess.ts": 1,
"src/domain/explicitSensitiveFailure.ts": 1,
"src/evm/EvmoleInterfaceProvider.ts": 6,
"src/firmware/FirmwareFailures.ts": 1,
"src/evm/EvmoleInterfaceProvider.ts": 3,
"src/firmware/FirmwareProvider.ts": 1,
"src/flutter/FlutterBuildProvider.ts": 1,
"src/frida/FridaInstrumentationManager.ts": 1,
"src/gdb/GdbSessionManager.ts": 2,
"src/ghidra/GhidraFileArtifacts.ts": 1,
"src/hopper/BridgeLauncher.ts": 3,
"src/hopper/HopperAnalysisProfile.ts": 1,
"src/hopper/HopperClient.ts": 1,
@@ -38,19 +33,18 @@
"src/inspector/V8InspectorProvider.ts": 1,
"src/javascript/sourceMaps/SourceMapCommand.ts": 4,
"src/jeb/JebMcpConnectionOwner.ts": 1,
"src/jeb/JebProvider.ts": 2,
"src/jeb/JebProvider.ts": 1,
"src/kuna/KunaProjectCache.ts": 1,
"src/kuna/KunaSessionClient.ts": 1,
"src/kuna/KunaTargetCommands.ts": 1,
"src/native/LldbCallTracer.ts": 3,
"src/native/NativeCommandAnalysisError.ts": 1,
"src/native/NativeMacOSProvider.ts": 2,
"src/pcap/PcapProvider.ts": 7,
"src/pcap/PcapProvider.ts": 6,
"src/pcap/PcapSnapshot.ts": 1,
"src/process/ArtifactAnalysisResources.ts": 3,
"src/process/ArtifactAnalysisResources.ts": 1,
"src/process/OwnedDebuggerSessionRegistry.ts": 1,
"src/process/capture/ProcessCaptureError.ts": 3,
"src/providers/AnalysisClientFailure.ts": 1,
"src/sqlite/SqliteDatabaseProvider.ts": 8,
"src/sqlite/SqliteDatabaseWorkerExecution.ts": 2
"src/sqlite/SqliteDatabaseProvider.ts": 8
}
+2 -4
View File
@@ -81,12 +81,10 @@ import {
} from "./BinarySessionExecution.js";
import { closeAnalysisClient } from "../../providers/AnalysisClientCleanup.js";
import {
analysisErrorWithCleanupFailure,
analysisErrorWithCleanupDependencies,
analysisErrorWithCloseRejection,
analysisErrorWithCloseRejections,
} from "../../domain/analysisErrorCleanup.js";
import { ConfigurationError } from "../../domain/configurationErrors.js";
import type { AnalysisCleanupRetry } from "../../domain/analysisErrorRecovery.js";
import { analysisErrorWithCancellation } from "../../domain/analysisErrorCancellation.js";
import { ProviderAdapterError } from "../../domain/providerAdapterError.js";
@@ -617,11 +615,11 @@ export class BinarySession
this.#clearRuntimeAvailability();
if (isAborted(options.signal))
return err(
analysisErrorWithCleanupFailure(
analysisErrorWithCleanupDependencies(
cancelledBy("open_binary", options.signal),
closed.error,
"open_binary",
).bindCleanupDependencies([closed.error]),
),
);
return closed;
}
@@ -13,7 +13,7 @@ import {
AnalysisCancelledError,
cancelledBy,
} from "../domain/analysisErrorCore.js";
import { analysisErrorWithCleanupFailure } from "../domain/analysisErrorCleanup.js";
import { analysisErrorWithCleanupDependencies } from "../domain/analysisErrorCleanup.js";
import { BrowserObservationError } from "../domain/browserObservationError.js";
import { describeValidationFailure } from "../domain/validationFailure.js";
import {
@@ -249,11 +249,7 @@ const releaseActionWindow = async (
const cancellation = cancelledBy(OPERATION, signal);
return actionStatus === "failed"
? error.retainSecondaryFailure(cancellation)
: analysisErrorWithCleanupFailure(
cancellation,
error,
OPERATION,
).bindCleanupDependencies([cancellation, error]);
: analysisErrorWithCleanupDependencies(cancellation, error, OPERATION);
};
type RunActionContext = {
@@ -11,7 +11,7 @@ import {
} from "../resources/index.js";
import { ProviderCleanupError } from "../domain/providerCleanupError.js";
import { ElectronCaptureCleanup } from "./ElectronCaptureCleanup.js";
import { analysisErrorWithCleanupFailure } from "../domain/analysisErrorCleanup.js";
import { analysisErrorWithCleanupDependencies } from "../domain/analysisErrorCleanup.js";
import { analysisErrorWithCancellation } from "../domain/analysisErrorCancellation.js";
import { electronFuseFailure } from "../electron/ElectronFuseFailures.js";
import { randomUUID } from "node:crypto";
@@ -351,11 +351,11 @@ export class PlaywrightElectronActiveProvider implements ElectronActiveObservati
);
owner.bind(failure);
if (outcome.ok) return err(failure);
const composed = analysisErrorWithCleanupFailure(
const composed = analysisErrorWithCleanupDependencies(
outcome.error,
failure,
OPERATION,
).bindCleanupDependencies([outcome.error, failure]);
);
if (failure.partialObservation !== undefined)
composed.partialObservation = failure.partialObservation;
return err(composed);
+2 -1
View File
@@ -1,10 +1,11 @@
import type { WebExecution } from "../../domain/webExecution.js";
import { sanitizeBrowserUrl } from "../../domain/browserObservation.js";
import { isRecord } from "../../kernel/isRecord.js";
import type { CdpRuntimeSources } from "./CdpRuntimeSources.js";
type Initiator = WebExecution["requests"][number]["reported_initiator"];
const isObject = (value: Initiator[string] | undefined): value is Initiator =>
typeof value === "object" && value !== null && !Array.isArray(value);
isRecord(value);
/** Sanitize known transport fields while retaining declarations and every unknown producer field. */
export const sanitizeRuntimeInitiator = (
+3 -4
View File
@@ -138,12 +138,11 @@ export class CaptureRedaction {
}
}
import { isRecord } from "../../kernel/isRecord.js";
/** Escape a producer property for an RFC 6901 location. */
export const capturePointer = (parent: string, key: string): string =>
`${parent}/${escapeJsonPointerToken(key)}`;
/** Structural record guard does not duck-type number/byte sidecar markers. */
export const captureObject = (
value: unknown,
): value is Record<string, unknown> =>
typeof value === "object" && value !== null && !Array.isArray(value);
export const captureObject = isRecord;
+13 -2
View File
@@ -34,7 +34,9 @@ const CHILD_PROGRAM = `
if (process.platform === 'win32') await writeFile(join(bin, runner + '.cmd'), '@"' + process.execPath + '" "' + witness + '"\\r\\n');
else await writeFile(join(bin, runner), '#!' + process.execPath + '\\nrequire(' + JSON.stringify(witness) + ');\\n', { mode: 0o700 });
}
const { createCli, closeCliResources } = await import(${JSON.stringify(new URL("./cli.ts", import.meta.url).href)});
const { createCliShell } = await import(${JSON.stringify(new URL("./cli/cliShell.ts", import.meta.url).href)});
const { closeCliResources } = await import(${JSON.stringify(new URL("./cli/cliResources.ts", import.meta.url).href)});
await import(${JSON.stringify(new URL("./cli/mcpRegistration.ts", import.meta.url).href)});
const { resolveMcpRegistrationClients } = await import(${JSON.stringify(new URL("./application/McpRegistrationCatalog.ts", import.meta.url).href)});
const { ArtifactResourceScope } = await import(${JSON.stringify(new URL("./resources/ArtifactResourceScope.ts", import.meta.url).href)});
const preflightResources = new ArtifactResourceScope();
@@ -46,9 +48,18 @@ const CHILD_PROGRAM = `
for (const key of ['HOME','USERPROFILE','XDG_CONFIG_HOME','XDG_DATA_HOME','XDG_CACHE_HOME','XDG_STATE_HOME','APPDATA','LOCALAPPDATA']) inside(home, environment[key]);
return environment;
};
const clis = new WeakMap();
const cliFor = (environment) => {
let cli = clis.get(environment);
if (!cli) {
cli = createCliShell({ selectedEnvironment: environment, registrations: [] });
clis.set(environment, cli);
}
return cli;
};
const serve = async (environment, arguments_) => {
let output = '', exitCode = 0;
await createCli(environment).serve(arguments_, { stdout(text) { output += text; }, exit(code) { exitCode = code; } });
await cliFor(environment).serve(arguments_, { stdout(text) { output += text; }, exit(code) { exitCode = code; } });
const document = JSON.parse(output);
if (Array.isArray(document.clients)) for (const client of document.clients) { inside(environment.HOME, client.config_path); if (client.backup_path) inside(environment.HOME, client.backup_path); }
return { exitCode, document };
+2 -4
View File
@@ -1,3 +1,4 @@
import { isRecord } from "../kernel/isRecord.js";
import {
JsonSchemaReferences,
type JsonSchemaScope,
@@ -41,10 +42,7 @@ const enumValueTypes = (values: readonly unknown[]): readonly string[] => [
),
];
export const isSchemaObject = (
value: unknown,
): value is Record<string, unknown> =>
typeof value === "object" && value !== null && !Array.isArray(value);
export const isSchemaObject = isRecord;
export const serializedBytes = (value: unknown): number =>
Buffer.byteLength(JSON.stringify(value), "utf8");
+1 -3
View File
@@ -5,6 +5,7 @@ import {
import { isDeepStrictEqual } from "node:util";
import type { SchemaAnnotations } from "../domain/schemaAnnotations.js";
import { isRecord as isObject } from "../kernel/isRecord.js";
import {
schemaArrays,
schemaChildren,
@@ -12,9 +13,6 @@ import {
schemaPointerSteps,
} from "./jsonSchemaKeywords.js";
const isObject = (value: unknown): value is Readonly<Record<string, unknown>> =>
typeof value === "object" && value !== null && !Array.isArray(value);
const referencedDescription = (
references: JsonSchemaReferences,
schema: Readonly<Record<string, unknown>>,
@@ -1,3 +1,4 @@
import { isRecord } from "../../kernel/isRecord.js";
import { escapeJsonPointerToken, jsonPointerTokens } from "../jsonPointer.js";
import {
iterateUrlQueryParameters,
@@ -319,7 +320,7 @@ export const segmentsOf = (path: string): string[] => {
export const isParam = (segment: string): boolean =>
segment.startsWith("{") && segment.endsWith("}");
export const isObject = (value: JsonValue | undefined): value is JsonObject =>
typeof value === "object" && value !== null && !Array.isArray(value);
isRecord(value);
export const scalarText = (value: JsonValue | undefined): string | undefined =>
typeof value === "string"
? value
+6 -10
View File
@@ -34,7 +34,7 @@ import {
AnalysisCleanupLease,
AnalysisCleanupLeaseGroup,
} from "../resources/index.js";
import { analysisErrorWithCleanupFailure } from "../domain/analysisErrorCleanup.js";
import { analysisErrorWithCleanupDependencies } from "../domain/analysisErrorCleanup.js";
import {
OwnedCommandFailure,
ownedCommandResources,
@@ -401,11 +401,7 @@ const evmReplyCompletionFailure = (
bindArtifactFileCleanup(cause, cleanup);
return cancellation === undefined
? cleanup
: analysisErrorWithCleanupFailure(
cancellation,
cleanup,
OPERATION,
).bindCleanupDependencies([cancellation, cleanup]);
: analysisErrorWithCleanupDependencies(cancellation, cleanup, OPERATION);
};
/** Run unchanged EVMole/WASM in an owned worker; no target, chain or network execution. */
@@ -909,11 +905,11 @@ export class EvmoleInterfaceProvider implements EvmInterfacePort {
);
if (markerCleanupFailure !== undefined) {
const cleanup = retainedCleanupFailure(markerCleanupFailure);
failure = analysisErrorWithCleanupFailure(
failure = analysisErrorWithCleanupDependencies(
failure,
cleanup,
OPERATION,
).bindCleanupDependencies([failure, cleanup]);
);
}
result = err(failure);
}
@@ -926,11 +922,11 @@ export class EvmoleInterfaceProvider implements EvmInterfacePort {
} else {
result = err(
replyFinalization.cleanupIncomplete
? analysisErrorWithCleanupFailure(
? analysisErrorWithCleanupDependencies(
result.error,
replyFinalization,
OPERATION,
).bindCleanupDependencies([result.error, replyFinalization])
)
: result.error.retainSecondaryFailure(replyFinalization, {
reply_finalization_error:
projectAnalysisErrorWithoutCapturedOutput(replyFinalization),
+2 -12
View File
@@ -1,7 +1,6 @@
import { MAX_NODE_TIMER_DELAY_MS } from "../domain/analysisResourceLimits.js";
import {
type AnalysisCleanupLease,
ArtifactFileCleanupFailure,
bindArtifactFileCleanup,
} from "../resources/index.js";
import type {
@@ -17,7 +16,7 @@ import {
isAborted,
type AbortedSignal,
} from "../domain/analysisErrorCore.js";
import { analysisErrorWithCleanupFailure } from "../domain/analysisErrorCleanup.js";
import { analysisErrorWithCleanupDependencies } from "../domain/analysisErrorCleanup.js";
import { ProviderAdapterError } from "../domain/providerAdapterError.js";
import { ProviderCleanupError } from "../domain/providerCleanupError.js";
import type { ProviderFailureDialect } from "../providers/classifyProviderFailure.js";
@@ -214,16 +213,7 @@ export const firmwareFailureDialect = (
if (read.cleanupLeases === undefined)
treeCleanupLease?.bindCleanupError(cleanup);
if (primary === undefined) return cleanup;
// A file operation's own outcome shares its cleanup; a cancelled read's does not.
return analysisErrorWithCleanupFailure(
primary,
cleanup,
operation,
).bindCleanupDependencies(
read instanceof ArtifactFileCleanupFailure
? [primary, cleanup]
: [cleanup],
);
return analysisErrorWithCleanupDependencies(primary, cleanup, operation);
},
unclassified: (cause, details) =>
new ProviderAdapterError(engine, operation, {
+2 -9
View File
@@ -23,7 +23,7 @@ import {
import { RegularFileChangedError } from "../filesystem/RegularFile.js";
import { ProviderAdapterError } from "../domain/providerAdapterError.js";
import { ProviderCleanupError } from "../domain/providerCleanupError.js";
import { analysisErrorWithCleanupFailure } from "../domain/analysisErrorCleanup.js";
import { analysisErrorWithCleanupDependencies } from "../domain/analysisErrorCleanup.js";
import type { JsonValue } from "../domain/jsonValue.js";
import type { ProviderFailureDialect } from "../providers/classifyProviderFailure.js";
import { errorMessage } from "../kernel/errorMessage.js";
@@ -130,14 +130,7 @@ export const ghidraFileDialect = (
{ cause: mapped },
);
bindArtifactFileCleanup(mapped, failure);
return analysisErrorWithCleanupFailure(
primary,
failure,
operation,
).bindCleanupDependencies([
...(primary.cleanupIncomplete ? [primary] : []),
failure,
]);
return analysisErrorWithCleanupDependencies(primary, failure, operation);
},
unclassified: (cause, details) => {
const { cause: primary } = artifactFilePrimaryFacts(cause);
+3 -5
View File
@@ -5,7 +5,7 @@ import {
} from "./JebMcpConnectionOwner.js";
import { createAnalysisExecutionEvidence } from "../domain/analysisObservation.js";
import { jsonValueSchema, type JsonValue } from "../domain/jsonValue.js";
import { analysisErrorWithCleanupFailure } from "../domain/analysisErrorCleanup.js";
import { analysisErrorWithCleanupDependencies } from "../domain/analysisErrorCleanup.js";
import { z } from "zod";
import type {
JebAnalysisPort,
@@ -630,7 +630,7 @@ export class JebProvider implements JebAnalysisPort {
*/
#attributed(operation: JebOperation, failure: AnalysisError): AnalysisError {
if (failure instanceof JebMcpCleanupFailure)
return analysisErrorWithCleanupFailure(
return analysisErrorWithCleanupDependencies(
this.#attributed(
operation,
classifyProviderFailure(
@@ -640,9 +640,7 @@ export class JebProvider implements JebAnalysisPort {
),
failure.cleanupFailure,
operation,
)
.bindCleanupDependencies([failure.cleanupFailure])
.bindCleanupResourceOwner(failure.cleanupFailure);
).bindCleanupResourceOwner(failure.cleanupFailure);
if (
failure instanceof AnalysisCancelledError ||
failure instanceof AnalysisTimeoutError
+1 -2
View File
@@ -1,6 +1,7 @@
import { isIPv4, isIPv6 } from "node:net";
import { err, ok, type Result } from "../domain/result.js";
import { byteToHex } from "../kernel/byteToHex.js";
import { isRecord as object } from "../kernel/isRecord.js";
interface DnsWireFailure {
readonly kind: "invalid_dns_wire";
@@ -21,8 +22,6 @@ export interface DnsMessageFacts {
readonly incomplete: boolean;
readonly incomplete_reasons?: readonly string[];
}
const object = (value: unknown): value is Record<string, unknown> =>
typeof value === "object" && value !== null && !Array.isArray(value);
/** Read named producer fields, retaining occurrence order within one PDU. */
const fields = (source: unknown): Map<string, unknown[]> => {
+1 -3
View File
@@ -14,6 +14,7 @@ import { parsePcapHttpUri } from "./PcapHttpUri.js";
import { fixedAllowanceOptions } from "../domain/fixedAllowanceRemediation.js";
import { parseDnsMessageRaw } from "./PcapDnsWire.js";
import { compareUnicodeCodePoints } from "../domain/unicodeCodePointOrder.js";
import { isRecord as object } from "../kernel/isRecord.js";
const OPERATION = "inspect_pcap_capture";
/** Bounds JSON decoding plus its expanded object graph before JSON.parse. */
@@ -166,9 +167,6 @@ export interface TsharkFields {
readonly partial: boolean;
}
const object = (value: unknown): value is Record<string, unknown> =>
typeof value === "object" && value !== null && !Array.isArray(value);
/** Map a refused tshark document to the pcap operation's typed failure. */
const decodeTsharkPackets = async (
stdout: string,
+5 -6
View File
@@ -32,7 +32,10 @@ import {
type AnalysisCleanupReleaseClaim,
} from "../domain/analysisErrorBase.js";
import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
import { analysisErrorWithCleanupFailure } from "../domain/analysisErrorCleanup.js";
import {
analysisErrorWithCleanupDependencies,
analysisErrorWithCleanupFailure,
} from "../domain/analysisErrorCleanup.js";
import { err, ok, type Result } from "../domain/result.js";
import type { ProviderProcessSupervisor } from "../process/ProviderProcess.js";
import {
@@ -457,11 +460,7 @@ export class PcapProvider {
cause,
this.#failureDialect(operation),
);
throw analysisErrorWithCleanupFailure(
primary,
pending,
operation,
).bindCleanupDependencies([primary, pending]);
throw analysisErrorWithCleanupDependencies(primary, pending, operation);
}
throw cause;
}
+4 -8
View File
@@ -19,7 +19,7 @@ import {
cancelledBy,
carriedReason,
} from "../domain/analysisErrorCore.js";
import { analysisErrorWithCleanupFailure } from "../domain/analysisErrorCleanup.js";
import { analysisErrorWithCleanupDependencies } from "../domain/analysisErrorCleanup.js";
import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
import {
fixedAllowanceOptions,
@@ -433,11 +433,7 @@ export class ArtifactAnalysisResources {
(primary ?? failure).retainPartialObservation(cause.partialObservation);
return primary === undefined
? failure
: analysisErrorWithCleanupFailure(
primary,
failure,
operation,
).bindCleanupDependencies([primary, failure]);
: analysisErrorWithCleanupDependencies(primary, failure, operation);
}
commandFailure(
@@ -532,11 +528,11 @@ export class ArtifactAnalysisResources {
await this.release();
} catch (cause: unknown) {
if (descriptorFailure !== undefined && cause instanceof AnalysisError)
throw analysisErrorWithCleanupFailure(
throw analysisErrorWithCleanupDependencies(
descriptorFailure,
cause,
this.#artifacts.operation,
).bindCleanupDependencies([descriptorFailure, cause]);
);
throw cause;
}
if (descriptorFailure !== undefined) throw descriptorFailure;
+3 -11
View File
@@ -17,7 +17,7 @@ import type {
AnalysisCapturedOutput,
AnalysisError,
} from "../domain/analysisErrorBase.js";
import { analysisErrorWithCleanupFailure } from "../domain/analysisErrorCleanup.js";
import { analysisErrorWithCleanupDependencies } from "../domain/analysisErrorCleanup.js";
import { ProviderCleanupError } from "../domain/providerCleanupError.js";
import {
AnalysisInputError,
@@ -335,11 +335,7 @@ const sqliteReplyCompletionFailure = (
carriedReason(artifactFileCancellationCause(cause)),
{ capturedOutput },
);
return analysisErrorWithCleanupFailure(
cancellation,
cleanup,
operation,
).bindCleanupDependencies([cancellation, cleanup]);
return analysisErrorWithCleanupDependencies(cancellation, cleanup, operation);
};
/** A malformed reply or producer refusal stays primary over its later close. */
@@ -350,9 +346,5 @@ export const sqliteReplyFinalizationFailure = (
finalization === undefined
? primary
: finalization.cleanupIncomplete
? analysisErrorWithCleanupFailure(
primary,
finalization,
operation,
).bindCleanupDependencies([primary, finalization])
? analysisErrorWithCleanupDependencies(primary, finalization, operation)
: primary.retainSecondaryFailure(finalization);
@@ -524,7 +524,7 @@ it("selects the tests a pull request affects and runs everything when it cannot
reason: "401 affected test files exceed the 400-file selection cap",
},
});
const capped = await change(directory, many.slice(0, 81), "// edited\n");
const capped = await change(directory, many.slice(0, 101), "// edited\n");
expect(await classify(directory, wide, capped)).toMatchObject({
testSelection: { mode: "selected" },
testShards: ["1/3", "2/3", "3/3"],