fix(android): clean recording evidence after its pid is reassigned

Merged
TH
4d ago
+345-37

Summary

Fixes #4242. Android can reassign a recorder PID to an unrelated process. Cleanup now separates retired recorders from stoppable chunks, stops the latter first, then requires conclusive empty writer scans before deleting retired artifacts.

A rejected committed-chunk inspect now follows the uncertain chunk stop path, so a failed probe cannot leave a live sibling running. If termination remains unproven, cleanup retains the artifacts and marker with the transport error. Shared start-reconciliation observation semantics and pending-path scans are unchanged.

Size: 4 files, +345/-37 against origin/main. Scope expansion: none.

Validation

  • Head: 1fc9758d0257eaedbe4deb68ed62865ba7833368.
  • pnpm install --frozen-lockfile, pnpm build, and repository-wide pnpm format completed.
  • Regression command: pnpm exec vitest run --project unit-core packages/platform-android/src/recording/cleanup.test.ts. At base abd837f579, the added test fails because the live sibling is never stopped (1 failed, 7 passed). At head, 8 pass. Base proof used a disposable checkout, now removed.
  • pnpm check:affected --run --head 1fc9758d0257eaedbe4deb68ed62865ba7833368: passed, exactCommit: true (format, lint, typecheck, layering, Fallow, build, related tests, unit lane).
  • CI owns full coverage, native builds, and device lanes. No manual device verification was performed. Cold diff review completed; no independent reviewer was used for this small follow-up.