fix(adb): evaluate the full activity start report

Evaluate stdout and stderr together, giving hard errors and non-ok wait statuses precedence over an attempted Starting line. Retain raw streams and typed partial launch facts when Activity Manager refuses or times out; retain successful raw output too.

Validation: parser/provider tests and public MCP app/activity starts through a fake executable at the real process boundary. Real Android device behavior was not verified; device-reported timeout remains distinct from a host deadline.

Fixes #2225
This commit is contained in:
morluto
2026-10-13 04:12:20 +08:00
parent 5ab0cbb48e
commit c89972c877
7 changed files with 390 additions and 30 deletions
+17
View File
@@ -679,6 +679,8 @@ export const adbResultSchemas = {
package_name: packageNameSchema,
component: z.string().min(1),
started_activity: z.string().nullable(),
reported_activity: z.string().nullable().optional(),
reported_status: z.string().nullable().optional(),
}),
start_adb_activity: z.strictObject({
client,
@@ -694,6 +696,8 @@ export const adbResultSchemas = {
}),
),
started_activity: z.string().nullable(),
reported_activity: z.string().nullable().optional(),
reported_status: z.string().nullable().optional(),
}),
stop_adb_app: z.strictObject({
client,
@@ -702,6 +706,19 @@ export const adbResultSchemas = {
}),
} as const;
/** Launch-attempt facts retained when Activity Manager does not report success. */
export type AdbActivityStartPartialObservation =
| {
readonly provider_id: "adb";
readonly operation: "start_adb_app";
readonly result: z.infer<typeof adbResultSchemas.start_adb_app>;
}
| {
readonly provider_id: "adb";
readonly operation: "start_adb_activity";
readonly result: z.infer<typeof adbResultSchemas.start_adb_activity>;
};
/** Acquired package facts retained when cancellation leaves caller-owned output. */
export type AdbPackagePullPartialObservation = {
readonly provider_id: "adb";
+2
View File
@@ -114,6 +114,7 @@ import type { Evidence } from "./evidence.js";
import type { AndroidPartialObservation } from "./android/androidPartialObservation.js";
import type { FirmwarePartialObservation } from "./firmware/firmwareAnalysis.js";
import type {
AdbActivityStartPartialObservation,
AdbAcquiredFilePartialObservation,
AdbPackagePullPartialObservation,
} from "./adb/adbDeviceAnalysis.js";
@@ -143,5 +144,6 @@ export type AnalysisPartialObservation =
| AndroidPartialObservation
| FirmwarePartialObservation
| NativeUiObservationResult
| AdbActivityStartPartialObservation
| AdbAcquiredFilePartialObservation
| AdbPackagePullPartialObservation;