refactor(snapshot): one shared model for occluding system surfaces

Merged
SA
7h ago
+159-118

Summary

Replace the parallel Android and iOS occluding-surface fields on SnapshotState (systemSurfaceOnly and iosSystemSurfaceBundleId) with one discriminated union systemSurface?: SnapshotSystemSurface. Closes #2489.

  • Add SnapshotSystemSurface (android-system-overlay | IosSystemSurfaceProvenance) in packages/contracts/src/snapshot-model.ts and export it from the snapshot facade.
  • Replace @agent-device/contracts/android-system-surface-disclosure with @agent-device/contracts/system-surface-disclosure, routing both deferred capture disclosure and direct capture warnings through systemSurfaceDisclosure.
  • Keep Android wire metadata (AndroidSnapshotBackendMetadata.systemSurfaceOnly), disclosure copy, and surfaceBundleId comparison scoping unchanged.

Value

  • Parallel SnapshotState system-surface fields: 2 -> 1
  • Non-test lines reading platform-specific SnapshotState fields: 14 across 6 files -> 0
  • Disclosure modules imported by capture-disclosure.ts: 2 -> 1
  • Diff: 24 files, +159/-118, zero new eager module imports

Validation

  • Head 779c4cfb8: pnpm format, pnpm check:quick, layering, build, package, di-seams, fallow (0 issues), facade-surface (3/3), eager-closure-budgets + baseline tests (948/948), and 96 contracts/snapshot/daemon test files (933/933) passed.

Reviewed with sol-loop: 2 rounds with gpt-6.2-sol. Sol verdict: approved.
Created with Claude Opus 5.5 and Gemini 4 Neon in T3 Code.


Prove it works
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.