✨ Normalize grouped build context#315
Merged
Merged
Conversation
Render grouped visual-review and complete legacy comparison responses through one factual adapter. Preserve explicit server aggregates, keep unknown facts absent, and leave raw JSON untouched.
Robdel12
marked this pull request as ready for review
July 22, 2026 02:46
Explain response precedence, completeness requirements, server authority, and the raw JSON boundary where the compatibility logic is defined.
Robdel12
enabled auto-merge (squash)
July 22, 2026 02:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Build context can arrive as either legacy flat comparisons or the API's grouped visual-review response. The human CLI currently understands only the flat shape, so grouped builds can hide review aggregates, variants, and failed captures even though the API returned those facts.
Approach
Use one normalization boundary for human build output. Explicit API aggregates remain authoritative—including
falseand0—and missing values stay unknown unless the response contains the complete underlying data needed for an exact derivation.The normalized records retain current, baseline, and diff asset identity; render dimensions and metadata; canonical review state; failed-capture errors; and compact Honeydiff evidence. Human output now presents screenshot groups in API order and reports failed captures with the evidence that is actually available.
Ordinary JSON and full agent JSON still return the raw API response. Compact agent JSON, auth, pagination, ordering policy, and dynamic-content behavior are intentionally unchanged.
Evidence
Coverage exercises complete legacy comparisons, partial grouped responses, aggregate-only groups, explicit false/zero values, missing aggregate facts, and failed captures. It verifies both the pure response contract and the terminal output users see. The full test suite and release-facing build, lint, type, and package checks pass.