Skip to content

refactor(daemon): carry snapshot capture annotations as one bundle #774

@thymikee

Description

@thymikee

What to build

Stop hand-copying snapshot side-channel fields through the daemon capture chain. Threading the snapshot quality verdict (refactor/ios-snapshot-capture-plan) required edits at six copy sites — SnapshotData, four CaptureSnapshotResult return sites, the BackendSnapshotResult adapter, serializeSnapshotResult, and the client response mapper — and three of them were missed on the first pass, each a silent runtime drop invisible to the type checker. The same chain previously dropped warnings (found during #758 validation).

First slice, deliberately small: introduce one SnapshotCaptureAnnotations type (warnings, quality, analysis, androidSnapshot, freshness) that is created once where the interactor result enters the daemon and spread as a unit (...annotations) at every hop, so adding a future field is a one-type change. The full single-capture-object spine (one object created at the dispatch edge, layers annotate instead of re-shape) is a larger follow-up that touches public client API types — evaluate it separately after this slice proves the shape.

Acceptance criteria

  • A single annotations type owns the side-channel fields; no hop copies them field-by-field.
  • serializeSnapshotResult and the client response mapper consume the bundle (or a serializer owned next to the type) instead of their own field lists.
  • A regression test proves a newly added annotation field survives interactor → daemon → CLI JSON without further edits (e.g. via a test-only field or by asserting the bundle is passed by reference).
  • No behavior change: existing snapshot output (text and --json) is byte-identical for healthy and degraded captures.

Blocked by

Landing of refactor/ios-snapshot-capture-plan (stacked on #758).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions