Files
reverse-engineering-anything/src/adb/AdbFileStaging.ts
T
morluto bd353e7e5c fix(errors)!: producers declare retry class, refusal recovery and real error codes (#15372)
* fix(errors)!: derive retryable from the producer's declared retry class

`retryable` means the unchanged request may succeed, but it was computed
downstream as an OR of a code table and five class rules. Every error
classification now declares a retry class (same_call, change_first, never,
unknown_outcome); `retryable` is `same_call` after one incomplete-cleanup
check, and the RETRYABLE_CODES table is deleted.

Producer corrections:
- update_unknown revision conflicts are change_first and report
  details.current_revision; duplicate record_unknown reports
  details.existing_unknown_id.
- close_gdb_session's explicit-disposition refusal is change_first.
- Per-call artifact reader limits are change_first (never when the limit
  cannot rise).
- An exited or unreachable Hopper bridge, and a Hopper start that another
  REA session owns, are change_first.
- File-descriptor exhaustion (EMFILE/ENFILE) outside process launch is
  occupied host capacity (same_call) for private workspaces, model and GPU
  readers and JavaScript application reads.
- apktool JVM native-thread exhaustion follows the shared capacity default.

BREAKING CHANGE: these refusals now report `retryable: false` (descriptor
pressure now reports `retryable: true` as `resource_constraint`). Callers
that repeated them unchanged should follow the remediation first: re-read
the unknown and retry with details.current_revision, dispose GDB inferiors,
raise the reported reader limit, or restart the Hopper provider.

* fix(errors): require producers to name recovery for conforming refusals

A refusal whose arguments match the input schema was presented as a schema
error whenever its producer left out remediation, and many producers did.
AnalysisInputError's options are now a union: a conforming refusal must
supply both its outcome (userMessage) and next step (remediationAction),
so the compiler lists every producer; only contract violations may fall
back to the schema guidance.

Producers fixed: unknown Frida session and script, decompile_all
output-directory state, the duplicate unknown build computer factory
(collapsed), stale Cutter sessions, Mach-O architecture selection, output
roots that already exist, selected files the host refuses, Ghidra lookups
the bridge could not resolve, YARA path refusals, unresolved native symbol
names, apt key files and withheld sign-in state. A missing selected APK is
now target_unavailable like every other selected-file reader.

The capability fallback "Choose another analysis or target" is deleted; a
capability refusal without its own recovery names details.reason and
binary_session.

Refs #15312

* fix(errors): classify caller selections and target bytes by their real failure

Several refusals reported a code that reads as corruption or a crash:
- a missing unknown_id and a missing Evidence reference now report
  invalid_request instead of execution_failure and
  evidence_integrity_mismatch;
- close_binary with snapshot_path in a resource-only session reports
  invalid_request instead of evidence_integrity_mismatch;
- ADB push onto an existing device path and pulls into an occupied output
  directory are conforming invalid_request refusals naming overwrite or
  output_directory, not unreadable_output;
- damaged APK ZIP, signing-block, signer and central-directory structures
  are malformed targets, not invalid input;
- NuGet and VSIX bytes without a ZIP signature are unrecognized, not
  malformed;
- a historical source graph file whose entries contradict its root
  commitment is an integrity failure, not invalid input;
- a CDP protocol failure states what happened instead of the unclassified
  fallback message.

Refs #15319

* feat(errors): expose the producer's retry class as retry_class

Every error projection now carries retry_class (same_call, change_first, never or unknown_outcome) beside retryable, which stays true exactly for same_call. The field is additive: the error schema accepts errors retained by earlier releases without it.

Refs #15323

* fix(errors): address review of the folded error-contract PRs

Keep a provider's own capability message as its remediation; the binary_session fallback applies only to a bare declared reason. Delete the unused conformingInputRefusal helper. Compose both retry fields for a refused publication whose cleanup is incomplete. Report descriptor exhaustion from a JavaScript directory opendir as occupied capacity. Let an exited Hopper startup attempt without a setup failure code retry unchanged. Declare retry for the Ghidra superseded checkpoint and unknown IDA readiness. Redact ambiguous selector candidates. Give a Ghidra document miss its own recovery. Drop an unchanged-files claim the journal repair cannot make. Name each withheld sign-in refusal's step. Hash the source graph commitment before the cancellation yield. Keep the browser protocol_error message neutral. Add tests for mutation-audit survivors C3, C5, P2, P4, P8, H1, H4 and H5.

* fix(errors): keep a missing Evidence reference an integrity failure and state only the observed commitment mismatch

* test(desktop): assert the unknown build computer refusal's remediation, not its message

The refusal now carries its next step in remediation.action instead of the message, so the closed-computer checks assert the exact code, message and remediation facts.

* fix(errors): keep producer retry choices apart from cleanup and fixed ceilings

A capture's retryable flag no longer folds in pending cleanup, so the projection applies the cleanup rule once and a transient capture with pending cleanup reports change_first instead of never. A release-fixed artifact allowance reports never, and a stale admitted session identity reports change_first (reopen, then retry); both have catalogue rows. The bare capability-unavailable remediation names binary_session only for a binary-analysis session, so standalone bridges such as Cutter are pointed at their own reason.

* test(vsix): expect a non-ZIP selection to be refused as unrecognized

This PR reports bytes without a ZIP signature as another format (unrecognized), not a damaged package; the exact-reason assertion added on main still expected malformed.

* test(delivery): expect the capacity refusal's retry class in delivered failure facts

The exact failure facts asserted on main predate the projection's retry_class; occupied capacity reports same_call.

* fix(errors): mark a sent Hopper cancellation unknown and missing Evidence recoverable

A cancellation Hopper already received may still apply, so its retry class is unknown_outcome instead of same_call; an unsent cancellation keeps same_call. A missing EvidenceReferenceError is change_first, since importing the referenced records lets the same request succeed; other reference failures stay never. Both have catalogue rows.

* fix(hopper): ask for changed launch arguments before retrying an unencodable launch

A launcher path or argument that cannot be encoded as an AppleScript literal meets the same pre-launch guard on every attempt, so the start refusal is change_first and its retry_action is unknown; a start failure without a declared reason stays same_call.

* fix(errors): keep a one-shot cleanup failure's retry class with its cleanup state

A one-shot reply that reports cleanup_incomplete spread the primary or cleanup projection and overrode only retryable, so a timed-out read whose close also failed carried retry_class same_call. The reply now reads its retry class from the typed composed failure, and never offers the same call before cleanup settles.

* test(evtx): expect an unreadable selected log to be refused with its own recovery

This PR treats a well-formed path the host refused as a regular file as conforming input with its own remediation; the evtx boundary test still expected a schema-recovery refusal.

* test(javascript): expect a broken source-graph commitment as an integrity failure

This PR reports a well-formed historical source graph whose entries disagree with its root_sha256 as evidence_integrity_mismatch, not an input issue; the exact refusal assertion added on main still expected invalid_request.
2026-12-01 05:32:33 +00:00

672 lines
20 KiB
TypeScript

import { systemCodeFromError } from "../kernel/reportedSystemCode.js";
import { constants as fsConstants } from "node:fs";
import {
access,
copyFile,
lstat,
mkdir,
open,
rm,
rmdir,
} from "node:fs/promises";
import { basename, extname } from "node:path";
import { ADB_PROVIDER_IDENTITY } from "./AdbProviderIdentity.js";
import { displayDevicePath } from "./AdbDeviceOutput.js";
import {
absoluteCallerPath,
appendCallerPath,
} from "../filesystem/callerPath.js";
import { hashStableFile } from "../filesystem/StableFileHash.js";
import {
regularFileCancellation,
RegularFileCancelled,
RegularFileCleanupFailure,
} from "../filesystem/OwnedRegularFile.js";
import { RegularFileOperationCancelled } from "../filesystem/RegularFile.js";
import { OwnedFileHandle } from "../filesystem/OwnedFileHandle.js";
import type { PrivateRuntimeRoot } from "../process/PrivateRuntimeRoot.js";
import type {
AdbAcquiredFilePartialObservation,
AdbPackagePullPartialObservation,
} from "../domain/adb/adbDeviceAnalysis.js";
import {
ArtifactResourceScope,
AnalysisCleanupLease,
} from "../resources/index.js";
import { AnalysisError } from "../domain/analysisErrorBase.js";
import {
AnalysisInputError,
AnalysisOutputError,
cancelledBy,
carriedReason,
} from "../domain/analysisErrorCore.js";
import { analysisErrorWithCleanupFailure } from "../domain/analysisErrorCleanup.js";
import { ProviderCleanupError } from "../domain/providerCleanupError.js";
import { err, ok, type Result } from "../domain/result.js";
import { errorMessage } from "../kernel/errorMessage.js";
export type AdbFileDigest = Awaited<ReturnType<typeof hashStableFile>>;
/**
* A pushed file's device-side digest together with its source, so a receipt
* cannot name `sha256sum` as the source of a digest that was never parsed.
*/
export type AdbDeviceDigest =
| {
readonly device_sha256: string;
readonly device_digest_source: "device_sha256sum";
}
| {
readonly device_sha256: null;
readonly device_digest_source: "unavailable";
readonly reason: string;
};
/** Carry the exact digest owner through caller-specific partial-result mapping. */
export class AdbDigestFailure extends Error {
constructor(
readonly fileFailure:
| RegularFileCleanupFailure<AdbFileDigest>
| RegularFileCancelled<AdbFileDigest>,
readonly bindCleanupError: (error: AnalysisError) => void,
) {
super(fileFailure.message, { cause: fileFailure });
}
}
export const hashAdbFile = async (
path: string,
operation: string,
signal: AbortSignal | undefined,
resources: ArtifactResourceScope,
) => {
let closeLease: AnalysisCleanupLease | undefined;
try {
return await hashStableFile(path, {
...(signal === undefined ? {} : { signal }),
retainFailedClose: (handle) => {
closeLease = new AnalysisCleanupLease(() => handle.close(), [path]);
resources.retain({
kind: "lease",
resource: `${path} (ADB digest handle)`,
lease: closeLease,
});
},
});
} catch (cause: unknown) {
if (
cause instanceof RegularFileCleanupFailure ||
cause instanceof RegularFileCancelled
)
throw new AdbDigestFailure(
cause as
| RegularFileCleanupFailure<AdbFileDigest>
| RegularFileCancelled<AdbFileDigest>,
(error) => {
closeLease?.bindCleanupError(error);
},
);
if (cause instanceof RegularFileOperationCancelled)
throw cancelledBy(operation, carriedReason(cause.reason));
throw cause;
}
};
/** Report a pulled file's digest that was cancelled or whose handle stayed open. */
export const adbDigestError = (
cause: AdbDigestFailure,
operation: string,
partialObservation:
| AdbAcquiredFilePartialObservation
| AdbPackagePullPartialObservation,
): AnalysisError => {
const digestFailure = cause.fileFailure;
const digestOutcome = digestFailure.outcome;
if (digestOutcome.kind === "completed")
partialObservation = partialObservationWithDigest(
partialObservation,
digestOutcome.value,
);
if (digestFailure instanceof RegularFileCancelled)
return cancelledBy(operation, carriedReason(digestFailure.reason), {
partialObservation,
});
const resource = `${digestFailure.path} (ADB digest handle)`;
const reason = errorMessage(digestFailure.cleanupCause);
const cleanup = new ProviderCleanupError(
ADB_PROVIDER_IDENTITY.id,
[resource],
{ reason },
{
operation,
cause: digestFailure,
partialObservation,
},
);
const primaryCause =
digestOutcome.kind === "failed" ? digestOutcome.cause : undefined;
const cancellation = regularFileCancellation(digestFailure);
if (cancellation !== undefined) {
const error = cancelledBy(operation, carriedReason(cancellation.reason), {
cleanup: { reason, resources: [resource] },
partialObservation,
});
cause.bindCleanupError(error);
return error;
}
const primary =
primaryCause instanceof AnalysisError
? primaryCause
: new AnalysisOutputError(
operation,
`The pulled file could not be fully digested or its handle could not be closed: ${digestFailure.path}`,
{
cause:
digestOutcome.kind === "failed" ? primaryCause : digestFailure,
partialObservation,
},
);
primary.retainPartialObservation(partialObservation);
const error = analysisErrorWithCleanupFailure(primary, cleanup, operation);
cause.bindCleanupError(error);
return error;
};
const partialObservationWithDigest = (
observation:
| AdbAcquiredFilePartialObservation
| AdbPackagePullPartialObservation,
digest: AdbFileDigest,
): AdbAcquiredFilePartialObservation | AdbPackagePullPartialObservation => {
if (observation.operation === "pull_adb_file") {
const { result } = observation;
if (!("digest_status" in result)) return observation;
return {
...observation,
result: {
client: result.client,
serial: result.serial,
local_path: result.local_path,
device_path: result.device_path,
bytes: digest.bytes,
sha256: digest.sha256,
},
};
}
if (observation.operation === "collect_adb_bugreport") {
const { result } = observation;
if (!("digest_status" in result)) return observation;
return {
...observation,
result: {
client: result.client,
serial: result.serial,
local_path: result.local_path,
adb_reported_path: result.adb_reported_path,
bytes: digest.bytes,
sha256: digest.sha256,
},
};
}
return observation;
};
export const syncStagedAdbFile = async (
path: string,
resources: ArtifactResourceScope,
operation: string,
): Promise<void> => {
let owner: OwnedFileHandle | undefined;
let primary: unknown;
try {
owner = new OwnedFileHandle(await open(path, "r+"));
await owner.handle.sync();
} catch (cause: unknown) {
primary = cause;
}
if (owner === undefined) {
if (primary !== undefined) throw primary;
return;
}
const resource = `${path} (ADB staged-output handle)`;
const stagedOwner = owner;
const closeLease = new AnalysisCleanupLease(
() => stagedOwner.close(),
[resource],
);
const released = await resources.release({
kind: "lease",
resource,
lease: closeLease,
});
if (released.kind === "failed") {
const cleanup = new ProviderCleanupError(
ADB_PROVIDER_IDENTITY.id,
[resource],
{
reason: errorMessage(released.cause),
},
{ operation, cause: released.cause },
);
let reported: AnalysisError;
if (primary !== undefined) {
const failure = new AnalysisOutputError(
operation,
`The staged ADB output could not be synchronized: ${path}`,
{ cause: primary },
);
reported = analysisErrorWithCleanupFailure(failure, cleanup, operation);
} else {
reported = cleanup;
}
closeLease.bindCleanupError(reported);
throw reported;
}
if (primary !== undefined) throw primary;
};
/** Materialize the caller's output directory, refusing existing files inside. */
export const prepareOutputDirectory = async (
operation: string,
directory: string,
): Promise<Result<string, AnalysisError>> => {
const root = absoluteCallerPath(directory);
try {
await mkdir(root, { recursive: true });
await access(root, fsConstants.W_OK);
} catch (cause) {
const code = systemCodeFromError(cause);
if (code === "EEXIST" || code === "ENOTDIR")
return err(
new AnalysisInputError(operation, { cause }, [
{
path: ["output_directory"],
reason: "invalid_value",
message: "The selected output path or a parent is not a directory.",
observed: { path: directory, code },
},
]),
);
return err(
new AnalysisOutputError(
operation,
`The output directory is not writable or could not be created: ${root}`,
{ cause },
),
);
}
return ok(root);
};
export const refuseExistingTarget = async (
operation: string,
path: string,
): Promise<AnalysisError | undefined> => {
if (
await lstat(path).then(
() => true,
() => false,
)
)
// The caller's output_directory selected an occupied name; nothing the
// device or adb returned is at fault.
return new AnalysisInputError(
operation,
{
userMessage: `The output file already exists: ${path}`,
remediationAction:
"Choose an output_directory that does not already contain this file, or remove the file if it is yours, then retry. REA does not overwrite local files.",
conformsToInputContract: true,
},
[
{
path: ["output_directory"],
reason: "invalid_value",
message: `The output file already exists: ${path}`,
},
],
);
return undefined;
};
export const hardLinksUnsupported = (cause: unknown): boolean =>
cause instanceof Error &&
"code" in cause &&
["EPERM", "EOPNOTSUPP", "ENOTSUP", "ENOSYS", "EXDEV"].includes(
String(cause.code),
);
export interface ScreenPublicationCloseFailure {
readonly cause: unknown;
readonly resource: string;
bindCleanupError(error: ProviderCleanupError): void;
}
/** Exclusive-create fallback for filesystems that cannot hard-link staged files. */
export const publishScreenExclusively = async (
outputPath: string,
bytes: Buffer,
resources: ArtifactResourceScope,
operation: string,
signal: AbortSignal | undefined,
): Promise<ScreenPublicationCloseFailure | undefined> => {
if (signal?.aborted === true) throw cancelledBy(operation, signal);
const output = await open(outputPath, "wx", 0o600);
// Successful exclusive creation is this fallback's cutoff. Finish and sync
// the visible file despite later cancellation so its receipt remains known.
const ownedOutput = new OwnedFileHandle(output);
const handleResource = `${outputPath} (ADB publication handle)`;
const closeOnly = new AnalysisCleanupLease(
() => ownedOutput.close(),
[handleResource],
);
const removeOutput = async (
expected: Awaited<ReturnType<typeof output.stat>>,
): Promise<void> => {
let current: Awaited<ReturnType<typeof lstat>>;
try {
current = await lstat(outputPath);
} catch (cause: unknown) {
if (cause instanceof Error && Reflect.get(cause, "code") === "ENOENT")
return;
throw cause;
}
if (
current.dev !== expected.dev ||
current.ino !== expected.ino ||
current.mode !== expected.mode
)
throw new Error(
`The screen output changed before cleanup: ${outputPath}`,
);
await rm(outputPath);
};
let rollbackIdentity: Awaited<ReturnType<typeof output.stat>> | undefined;
const inspectCloseAndRollback = new AnalysisCleanupLease(async () => {
rollbackIdentity ??= await output.stat();
await ownedOutput.close();
await removeOutput(rollbackIdentity);
});
let identity: Awaited<ReturnType<typeof output.stat>>;
try {
identity = await output.stat();
} catch (cause: unknown) {
resources.retain({
kind: "lease",
resource: `${outputPath} (screen output and descriptor)`,
lease: inspectCloseAndRollback,
});
const error = new ProviderCleanupError(
ADB_PROVIDER_IDENTITY.id,
[handleResource, outputPath],
{
reason:
"The newly created screen output identity could not be established; its descriptor remains owned for cleanup retry",
},
{ operation, cause },
);
inspectCloseAndRollback.bindCleanupError(error);
throw error;
}
let writeFailure: { readonly cause: unknown } | undefined;
try {
await output.writeFile(bytes);
await output.sync();
} catch (cause: unknown) {
writeFailure = { cause };
}
if (writeFailure === undefined) {
try {
await ownedOutput.close();
return undefined;
} catch (cause: unknown) {
resources.retain({
kind: "lease",
resource: handleResource,
lease: closeOnly,
});
return {
cause,
resource: handleResource,
bindCleanupError(error) {
closeOnly.bindCleanupError(error);
},
};
}
}
const rollback = new AnalysisCleanupLease(async () => {
await ownedOutput.close();
await removeOutput(identity);
});
try {
await ownedOutput.close();
} catch (closeCause: unknown) {
resources.retain({ kind: "lease", resource: outputPath, lease: rollback });
const error = new ProviderCleanupError(
ADB_PROVIDER_IDENTITY.id,
[outputPath],
{ reason: errorMessage(closeCause) },
{
operation,
cause: new AggregateError(
[writeFailure.cause, closeCause],
"Screen output write and descriptor cleanup failed",
{ cause: writeFailure.cause },
),
},
);
rollback.bindCleanupError(error);
throw error;
}
const removed = await resources.release({
kind: "lease",
resource: outputPath,
lease: rollback,
});
if (removed.kind === "failed") {
const error = new ProviderCleanupError(
ADB_PROVIDER_IDENTITY.id,
[outputPath],
{ reason: errorMessage(removed.cause) },
{
operation,
cause: new AggregateError(
[writeFailure.cause, removed.cause],
"Screen output write and rollback failed",
{ cause: writeFailure.cause },
),
},
);
rollback.bindCleanupError(error);
throw error;
}
throw writeFailure.cause;
};
/** Publish an ADB-produced archive without replacing an existing caller file. */
export const publishBugreport = async (
source: string,
directory: string,
): Promise<string> => {
const fileName = basename(source);
const extension = extname(fileName);
const stem =
extension === "" ? fileName : fileName.slice(0, -extension.length);
for (let suffix = 0; ; suffix += 1) {
const destination = appendCallerPath(
directory,
suffix === 0 ? fileName : `${stem} (${String(suffix)})${extension}`,
);
try {
await copyFile(source, destination, fsConstants.COPYFILE_EXCL);
return destination;
} catch (cause: unknown) {
if (cause instanceof Error && "code" in cause && cause.code === "EEXIST")
continue;
throw cause;
}
}
};
export type AdbRuntimeRoot = Pick<PrivateRuntimeRoot, "path" | "close">;
/** A root lease releases its children before removing their containing root. */
export const runtimeRootLease = (
root: AdbRuntimeRoot,
children: ArtifactResourceScope,
): AnalysisCleanupLease =>
new AnalysisCleanupLease(
async () => {
await children.close();
await root.close();
},
{
get cleanupResources() {
return [root.path, ...children.cleanupResources];
},
},
);
export interface PendingOutputDirectoryCleanup {
readonly operation: "pull_adb_package" | "collect_adb_bugreport";
readonly path: string;
readonly primary: AnalysisError;
readonly remove: () => Promise<void>;
readonly resources?: () => readonly string[];
readonly lease: AnalysisCleanupLease;
}
export interface OutputDirectoryIdentity {
readonly dev: number;
readonly ino: number;
readonly mode: number;
}
export const removeOwnedOutputDirectory = async (
path: string,
identity: OutputDirectoryIdentity | undefined,
): Promise<void> => {
if (identity === undefined)
throw new Error(
`Cannot verify the created output directory identity; refusing to remove ${path}`,
);
let current: Awaited<ReturnType<typeof lstat>>;
try {
current = await lstat(path);
} catch (cause: unknown) {
if (cause instanceof Error && Reflect.get(cause, "code") === "ENOENT")
return;
throw cause;
}
if (
!current.isDirectory() ||
current.isSymbolicLink() ||
current.dev !== identity.dev ||
current.ino !== identity.ino ||
current.mode !== identity.mode
)
throw new Error(
`The created output directory was replaced or changed; refusing to remove ${path}`,
);
await rm(path, { recursive: true, force: true });
};
export const reservePackageDestinations = async (
operation: string,
packageName: string,
packageDirectory: string,
entries: readonly {
readonly file_name: string;
readonly device_path: string;
}[],
capturedOutput: {
readonly stdout: string;
readonly stderr: string;
readonly truncated: boolean;
},
): Promise<AnalysisOutputError | undefined> => {
const reservations: {
readonly path: string;
readonly file_name: string;
readonly device_path: string;
readonly identity: OutputDirectoryIdentity;
}[] = [];
for (const entry of entries) {
const path = appendCallerPath(packageDirectory, entry.file_name);
try {
await mkdir(path);
const created = await lstat(path);
if (!created.isDirectory() || created.isSymbolicLink())
throw new Error(`Could not reserve local filename ${entry.file_name}`);
reservations.push({
path,
file_name: entry.file_name,
device_path: entry.device_path,
identity: {
dev: created.dev,
ino: created.ino,
mode: created.mode,
},
});
} catch (cause: unknown) {
const errorCode = systemCodeFromError(cause) ?? null;
return new AnalysisOutputError(
operation,
"local_destination_unavailable",
{
cause,
capturedOutput,
userMessage: `pm path for ${packageName} reported ${displayDevicePath(entry.device_path)}, whose file name ${displayDevicePath(entry.file_name)} cannot be written to a unique local destination (${errorCode ?? "unknown error"}). No APK was pulled.`,
remediationAction:
"Review details.diagnostics and details.captured_output for the refused destination. Correct the output filesystem conflict before retrying; REA does not rename APKs.",
diagnostics: {
package_name: packageName,
device_path: entry.device_path,
file_name: entry.file_name,
error_code: errorCode,
},
},
);
}
}
for (const reservation of reservations) {
try {
const current = await lstat(reservation.path);
if (
!current.isDirectory() ||
current.isSymbolicLink() ||
current.dev !== reservation.identity.dev ||
current.ino !== reservation.identity.ino ||
current.mode !== reservation.identity.mode
)
throw new Error(
`The local filename reservation changed before release: ${reservation.path}`,
);
await rmdir(reservation.path);
} catch (cause: unknown) {
const errorCode = systemCodeFromError(cause) ?? null;
return new AnalysisOutputError(
operation,
"local_destination_unavailable",
{
cause,
capturedOutput,
userMessage: `Could not release the local filename reservation for ${displayDevicePath(reservation.device_path)} (${errorCode ?? "unknown error"}); no APK was pulled.`,
remediationAction:
"Review details.diagnostics and details.captured_output for the refused destination. Correct the output filesystem conflict before retrying; REA does not rename APKs.",
diagnostics: {
package_name: packageName,
device_path: reservation.device_path,
file_name: reservation.file_name,
error_code: errorCode,
},
},
);
}
}
return undefined;
};