fix(capture): publish cropped screenshots atomically after scaling

Merged
TH
8h ago
+712-52

Summary

Preserve screenshot destinations through capture, selector cropping, scaling and atomic publication. The artifact adapter owns staging, cancellation and cleanup; results report the published destination. Preserve regular-file modes and symlink targets, and clearly refuse dangling destinations before capture. Direct completed screenshots retain their late-cancellation behavior.

Touches 11 files, including the shared artifact contract and opt-in atomic-publisher mode preservation. Closes #4423.

Example: agent-device screenshot out.png --crop-on 'label="Apps"' --scale 0.5.

Validation

Head 0acaee79940b8a47180f212086e9035a2561005d; base 0054479ff59e3bec030775b7999793035f16d822.

Pinned pnpm 11.17.0 install/build and exact affected gate passed: eight runnable checks, 402 related tests and 19,516 unit tests passed; three unit tests skipped. Receipt: exactCommit=true, checkoutChanged=false, failOpen=false. Independent follow-up review found no concrete regressions.

Identical unit tests passed 50 at head, failed 3/passed 47 on predecessor 2a74916, and passed 50 after restoration. Disabling atomic temp cleanup caused three assertions to detect retained dotted files. Disposable removed; primary unchanged.

Earlier scale-order proof remains attributed to its original head. Earlier failed control causes remain unproven.

GitHub Coverage and ready-state device/smoke checks must validate this head. Manual replay lanes remain parked. Prior green CI applies to the older head.