Skip to content

Feat: flag divergent user-facing copy for the same data across surfaces - #215

Merged
ivory-code merged 1 commit into
mainfrom
feat/divergent-surface-copy
Aug 22, 2026
Merged

Feat: flag divergent user-facing copy for the same data across surfaces#215
ivory-code merged 1 commit into
mainfrom
feat/divergent-surface-copy

Conversation

@ivory-code

Copy link
Copy Markdown
Contributor

Summary

The same data or policy rendered with different labels on different surfaces — "Ships after payment clears" on a summary card, "Ships when the order completes" on the confirmation screen — reads to users as contradictory policy. Each string looks fine in isolation, so per-file review misses the divergence. QAMap now compares label-like copy a diff adds or edits against the existing copy elsewhere in the project, reports the pair with both locations, and plans a side-by-side comparison.

Behavioral Contract

When a diff adds a user-facing string inside a label-like component (Badge, Tag, Chip, Pill, Label, Status, Caption, Hint, Tooltip, Toast, Button, Cta, Banner, Notice, Alert, Callout, with or without a namespace prefix) or in a user-facing prop (label, title, placeholder, aria-label, alt) of a product UI file, QAMap reads the project's existing copy of the same component family from other product UI files at the head revision. If an existing string is not identical but starts with the same token or shares at least 60% of its tokens, QAMap emits diff risk evidence (divergent-copy:<Component>) anchored to the added line, naming both strings and the existing file and line, and adds the QA scenario "Divergent copy for the same data across surfaces".

Identical strings, strings in the same file, strings from different component families, prose outside label-like components, single-word labels, and paragraphs over eight tokens are not flagged. The corpus is only read when the diff actually adds label-like copy, is capped at 400 files and 200 KB per file, and excludes test, story, fixture, and build paths. Findings are capped at five per changed file and only the best-matching existing string is reported per added string.

Evidence

Closes #213.

  • Minimized fixture: test/benchmarks/web-divergent-surface-copy — an order confirmation page adds <Badge>Ships when the order completes</Badge> while the summary page already renders <Badge>Ships after payment clears</Badge>; contract pins the intent, reached file, and the new scenario title.
  • Focused regression: the new badge is flagged against the existing surface with both strings and the existing file:line in the evidence, anchored to the added line.
  • Second unrelated positive: a purchase-history toolbar adds <Button>Search purchases</Button> beside an existing <Button>Search orders</Button> in another feature.
  • Negative controls: identical copy on a second surface (shared wording), unrelated badge copy, near-duplicate prose inside a <p>, and two similar badges inside one file — none flagged, scenario absent.

Checks

  • Focused regression test
  • pnpm test
  • pnpm bench:ci for inference, routing, trace, or output
  • pnpm bench:execution for E2E compiler or execution fixtures
  • pnpm scan for scanner, security, or repository policy
  • pnpm plugin:check and pnpm plugin:smoke for plugin changes
  • Documentation links and commands verified

Public OSS Check

  • No private repository, source, path, customer data, credential, or internal smoke output is included.
  • Shared inference has unrelated positive and negative coverage, or this is not applicable.
  • User-facing commands and claims match actual behavior.

Review Notes

pnpm scan (0 findings), pnpm bench:context (10/10), pnpm plugin:check, and pnpm plugin:smoke also pass locally; marked N/A above because this change touches none of those surfaces. The detector is deliberately narrow: single-line JSX only, same component family only, other files only. Multi-line JSX children, copy assembled from template literals or i18n keys, and strings that share meaning without sharing a leading token remain review work. The existing surface is read from the head revision, so a surface that the same diff rewrote is excluded from the corpus to avoid matching stale text.

@ivory-code ivory-code added type: feat Feature work that adds product or CLI capability area: qa-planning PR-aware QA planning, coverage, evidence, and fixture readiness labels Aug 22, 2026
@ivory-code ivory-code self-assigned this Aug 22, 2026
@ivory-code ivory-code added the area: scanner Static scanning rules and repository policy checks label Aug 22, 2026
@ivory-code
ivory-code merged commit 224f977 into main Aug 22, 2026
2 checks passed
@ivory-code
ivory-code deleted the feat/divergent-surface-copy branch August 22, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: qa-planning PR-aware QA planning, coverage, evidence, and fixture readiness area: scanner Static scanning rules and repository policy checks type: feat Feature work that adds product or CLI capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat: flag divergent user-facing copy for the same data across surfaces

1 participant