Skip to content

Consolidate FigmaTransformer result finalization #1078

Description

@chubes4

Parent: #1076

Problem

transformScenegraph(), transformResponsivePage(), and transformNormalizedScenegraphPage() separately attach mismatch reports, merge diagnostics, build parity data, construct source reports, calculate overlapping metrics, and create FigmaTransformResult envelopes. This makes output-contract changes easy to apply inconsistently.

Scope

  • Introduce one result-finalization path for normalized artifacts.
  • Keep normalization and page-selection differences in their existing branch-specific code.
  • Centralize mismatch report attachment, diagnostics, parity, source-report construction, and common metrics.

Acceptance criteria

  • composer test passes.
  • Public result schemas and status behavior remain unchanged.
  • Single-page, responsive, and pre-normalized page paths retain their current metrics and source-report fields.
  • Layout and render-style mismatch evidence remains attached identically.
  • No backward-compatibility wrapper or duplicate finalizer remains.

AI assistance

OpenAI gpt-5.6-sol via OpenCode identified the duplicated finalization paths and drafted this issue. Chris Huber is responsible for the scope and final changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions