Skip to content

feat(design): add advisory conformance check and local Studio - #8313

Draft
BillLeoutsakosvl346 wants to merge 21 commits into
stagingfrom
codex/design-system-rollout
Draft

BillLeoutsakosvl346 wants to merge 21 commits into
stagingfrom
codex/design-system-rollout

Conversation

@BillLeoutsakosvl346

@BillLeoutsakosvl346 BillLeoutsakosvl346 commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

What this adds

  • A warning-only product design check in the existing Test and Build workflow, with immutable commit comparisons, file/line annotations, a summary, and a JSON artifact. Failed inspection is an error.
  • One source-derived contract implementation shared by the diff checker, full scanner and local Studio. All detected design signals use one findings list; unresolved inputs and inspection failures remain separate.
  • Committed contracts.generated.json, generated from public EMCN APIs, actual recipes, slots, forwarding, ownership metadata and global CSS. There is no manual component inheritance registry. Aliases, namespaces and compound exports are discovered; finite prop values follow the actual public type.
  • Validated @designAllow / @designProtect TSDoc beside components for intentional customization and special ownership. Generation never executes product modules, and historical analysis cannot read current workspace implementations.
  • A local-only Studio under tools/design-studio, with generated inventory, live fixtures, indicative samples and external captures. Every detected Extra is included without an approval gate. Missing fixtures and failed captures stay visible and make refresh incomplete. Nonvisual constants do not receive component cards; variant coverage requires props to reach the actual export.
  • Existing audit-runner freshness validation and agent guidance to regenerate and commit infrastructure with central design changes.

Product appearance is unchanged: EMCN implementation edits in this update are ownership comments. Reports, manifests and images are external. Landing, docs, Monaco presentation, provider brands and intentional block identity palettes remain excluded. The Studio is absent from the deployed Sim route tree. This remains a draft against staging and supersedes #7827 after rollout verification.

Files by purpose

  • scripts/design-conformance/: generated metadata, shared source analysis, diff reports, warning annotations and the rule contract. contracts.json now holds general policy.
  • scripts/generate-design-contracts.ts, root command scripts and the audit runner: generation and read-only freshness validation.
  • scripts/design-scan/ and scripts/design-studio/: full inventory/reporting and explicit local refresh/capture.
  • tools/design-studio/: the standalone local UI, source-backed fixtures and labeled indicative samples. No production Sim route.
  • EMCN component TSDoc, agent guidance and tests: ownership exceptions beside their source, regeneration/review workflow, and regression/CLI coverage.

Local workflow

# During UI work: includes staged, unstaged and nonignored new product files
bun run check:design --base origin/staging --working-tree

# When EMCN, global styles, recipes or ownership metadata change
bun run design:generate
bun run check:design-generated
# Commit the generated contracts alongside their source

# Inspect the committed change
bun run check:design --base origin/staging --head HEAD

# Explicit full scan and local Studio refresh
bun run design:scan --repo . --working-tree --output /tmp/sim-design-scan
bun run studio:refresh
bun run studio:dev

Prefer EMCN and global tokens where they fit, and explain intentional new treatments in normal PR review. Review records add context but never suppress raw findings or control Studio inclusion. Regeneration cannot hide the originating central change. CI validates freshness and runs the diff check; it does not capture browsers or commit generated files.

Verification

  • Script suite: 48 files, 718 passing tests, including real CLI tests in temporary Git repositories for component lifecycle, reexports, variants/defaults, metadata validation, stale/tampered output, immutable snapshots, working-tree changes, debt matching, exclusions, and unified Studio inclusion.
  • Regression tests caught and verified fixes for nested recipe lookup ownership, forwarding through barrels, separate class/style rest forwarding, nonvisual/compound export placement, per-export variant coverage, native control semantics, CSS paint assignments, channel tokens, and embedded source annotations. Adding central components does not require a registry edit.
  • All 26 repository type tasks and lint tasks passed. Design/Studio types passed again after the final changes. All 52 audits passed, including generated freshness.
  • Two unchanged generation runs produced byte-identical SHA-256 output. The artifact is 339,751 bytes, with 568 export records, 22 shared recipes, 292 tokens and 172 explicit diagnostics. The measured generator runs took 1.88s and 1.84s (about 0.8 GiB maximum RSS); type analysis uses one program per source revision and bounded caches.
  • Committed comparison against staging completed with fresh infrastructure and zero inspection failures: 28 warnings (22 central-system changes and six existing consumer overrides newly exposed by metadata). These are intentional policy/ownership changes; no product styling is migrated in this update.
  • Same-source reconciliation (source 19943bfd): the original 1,312 findings plus 331 review signals become 2,534 unified findings: 1,490 unchanged, 69 reclassified, 84 removed and 975 added. Additions include 859 automatically discovered chrome overrides and 37 previously missed imperative paint assignments. Removed legacy chrome exceeded actual ownership or duplicated another output; unresolved anchor semantics remain unchecked. Every occurrence was reconciled by rule and source location in external review evidence. The measured full scan was 234.5s / 3.6 GiB maximum RSS while another refresh ran; this is not an isolated speed benchmark.
  • Production Turbopack builds passed locally for both the draft and staging. The production manifest contains 934 routes and no Studio route; the earlier Turbopack failure did not reproduce. Light/dark and 16px/20px browser checks passed, including independent variant controls, live Button clicks, menu close/reopen and mobile keyboard search. Final Studio hash comparison and latest CI are being verified.

See scripts/design-conformance/README.md for the rule contract, scope, exclusions and static-analysis limits. Unresolved runtime styling, ambiguous forwarding and token cycles remain diagnostics; they are never treated as proven conformance.

@vercel

vercel Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Sep 26, 2026 7:37am UTC

Request Review

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete.

@greptile-apps

greptile-apps Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[High risk] Adds design conformance checking and modifies build configuration.

No outstanding previous finding or actionable new issue identified here prevents merging.

Summary

The PR adds an advisory design-conformance check, generated EMCN contracts, full-scan tooling, and a local Studio. Since the previous review, it expands colour-longhand coverage and fixes classification of additional text-decoration thickness units.

Reviews (11) · Last reviewed commit: "fix(design): generalize CSS paint sinks ..."

Comment thread scripts/design-scan/inventory.ts Outdated
Comment thread scripts/design-scan/report.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 113 files

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread scripts/design-conformance/appearance.ts
Comment thread tools/design-studio/app/layout.tsx Outdated
Comment thread scripts/design-conformance/evaluate.ts Outdated
Comment thread scripts/design-conformance/control-associations.ts
Comment thread .agents/skills/emcn-design-review/SKILL.md Outdated
Comment thread scripts/design-conformance/control-simplifications.ts Outdated
Comment thread scripts/design-conformance/control-simplifications.ts Outdated
Comment thread scripts/design-conformance/catalogue.ts Outdated
Comment thread package.json Outdated
Comment thread tools/design-studio/_components/generated-gallery.tsx Outdated
@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 114 files

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread scripts/design-conformance/model.ts Outdated
Comment thread scripts/design-conformance/artwork.ts
Comment thread scripts/design-conformance/control-associations.ts Outdated
Comment thread scripts/design-conformance/control-review.ts Outdated
Comment thread scripts/design-conformance/cli.ts Outdated
Comment thread scripts/design-conformance/central-recipes.ts Outdated
Comment thread scripts/design-conformance/control-colour-assignments.ts
Comment thread scripts/design-conformance/normalize.ts
Comment thread scripts/design-conformance/control-typography.ts
Comment thread scripts/design-conformance/lint.ts Outdated
@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 114 files

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread scripts/design-conformance/control-review.ts Outdated
Comment thread scripts/design-conformance/control-colour-assignments.ts
Comment thread scripts/design-conformance/conformance.ts Outdated
Comment thread scripts/design-conformance/control-simplifications.ts Outdated
Comment thread scripts/design-conformance/control-simplifications.ts Outdated
Comment thread scripts/design-conformance/control-typography.ts Outdated
Comment thread scripts/design-conformance/control-imperative.ts Outdated
Comment thread scripts/design-conformance/control-imperative.ts Outdated
Comment thread scripts/design-conformance/control-imperative.ts Outdated
Comment thread scripts/design-conformance/model.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 114 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Re-trigger cubic

Comment thread scripts/design-conformance/control-colour-assignments.ts Outdated
@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 114 files

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Fix all with cubic | Re-trigger cubic

Comment thread scripts/design-conformance/control-simplifications.ts Outdated
Comment thread scripts/design-conformance/control-colour-assignments.ts Outdated
@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 114 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Re-trigger cubic

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 114 files

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Fix all with cubic | Re-trigger cubic

Comment thread scripts/design-conformance/control-colour-assignments.ts Outdated
Comment thread scripts/design-conformance/normalize.ts Outdated
@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 114 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Re-trigger cubic

This branch was successfully deployed

1 active deployment
Preview — 70c63adb Deployed Sep 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant