refactor(native): remove unreachable command routing branches

This commit is contained in:
morluto committed 2026-10-24 11:41:34 +08:00
1 parent f2eb27206f
commit f508a1a47e
2 files changed
+11 -40

No files matched your search

+10 -12
View File
@@ -223,18 +223,16 @@ export class XcrunCommandRunner implements NativeCommandRunner {
this.launcher,
);
if (!captured.ok) return err(this.#retainCleanupOwner(captured.error));
return captured.ok
? ok({
...captured.value,
tool,
executable: resolved.value.path,
executableSha256: resolved.value.sha256,
toolVersion: null,
versionReason:
"Tool exposes no uniform stable version flag; executable SHA-256 is a prelaunch file sample and does not prove atomic OS image binding.",
arguments: [...arguments_],
})
: captured;
return ok({
...captured.value,
tool,
executable: resolved.value.path,
executableSha256: resolved.value.sha256,
toolVersion: null,
versionReason:
"Tool exposes no uniform stable version flag; executable SHA-256 is a prelaunch file sample and does not prove atomic OS image binding.",
arguments: [...arguments_],
});
}
async #retryCleanup(): Promise<readonly NativeCommandCleanupFailure[]> {
+1 -28
View File
@@ -352,7 +352,7 @@ class NativeMacOSClient implements AnalysisClient {
return this.#observeNativeUi(operation, parameters, options?.signal);
}
const pending = Promise.resolve().then(() =>
this.#dispatch(operation, parameters, options?.signal),
this.#dispatchCommand(operation, parameters, options?.signal),
);
this.#pendingCommandOperations.add(pending);
try {
@@ -572,33 +572,6 @@ class NativeMacOSClient implements AnalysisClient {
return new NativeUiCleanupError(failures, operation, partialObservation);
}
#dispatch(
operation: NativeToolName,
parameters: Readonly<Record<string, JsonValue>>,
signal?: AbortSignal,
): Promise<Result<NativeObservation, AnalysisError>> {
switch (operation) {
case "observe_native_ui":
case "capture_native_ui_scenario":
case "observe_native_calls":
return Promise.resolve(
err(
new AnalysisCapabilityUnavailableError(
IDENTITY.id,
operation,
"UI observation uses its explicit authority boundary",
),
),
);
case "inspect_macho":
case "inspect_signature":
case "inspect_plist":
case "list_architectures":
case "demangle_swift":
return this.#dispatchCommand(operation, parameters, signal);
}
}
#dispatchCommand(
operation:
| "inspect_macho"