Skip to content

chore(atomic): enable Storybook Agentic Review (PoC) - #8185

Draft
y-lakhdar wants to merge 2 commits into
mainfrom
storybook-agentic-review-poc
Draft

chore(atomic): enable Storybook Agentic Review (PoC)#8185
y-lakhdar wants to merge 2 commits into
mainfrom
storybook-agentic-review-poc

Conversation

@y-lakhdar

@y-lakhdar y-lakhdar commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Jira

N/A — proof of concept.

Motivation

Evaluate Storybook Agentic Review for @coveo/atomic, which is a Web Components (Vite) Storybook. The feature requires Storybook ≥ 10.5 and @storybook/addon-mcp ≥ 0.7.0, and Storybook currently markets its MCP/AI capabilities as React-first — so this PoC verifies whether the review loop actually works on the Web Components renderer before any wider investment.

Changes

  • Upgrade the Atomic Storybook cohort to 10.5.6 and @storybook/addon-mcp to 0.7.0 (adds display-review / get-stories-by-component).
  • Enable features.changeDetection + features.experimentalReview, and register addon-mcp with endpoint: '/mcp' and toolsets { dev: true, test: true, docs: false } (the docs/manifest toolset is React-only).
  • Exempt storybook-addon-pseudo-states from minimumReleaseAge, consistent with the rest of the Storybook cohort.
  • Patch storybook@10.5.6 (patches/): add extensionAlias to the change-detection oxc-resolver so .js import specifiers resolve to .ts/.tsx sources (TS bundler/nodenext). Without it, story→component edges are dropped and get-changed-stories / get-stories-by-component cannot map Atomic components to their stories. Temporary workaround until fixed upstream (companion issue to be filed on storybookjs/storybook).

Validation

Verified locally by driving the MCP endpoint (http://localhost:4400/mcp) over JSON-RPC — the same protocol an MCP client uses:

  • Storybook 10.5.6 boots; story index at parity (465 stories); representative Search/Common stories render through Atomic's custom Vite plugins (Playwright).
  • display-review publishes a review (returns a reviewUrl) and rejects fabricated story IDs (live-index validation); the review page renders in the manager UI.
  • run-story-tests passes for the sampled story.
  • After the resolver patch, get-changed-stories / get-stories-by-component resolve Atomic components to their stories — story→component graph edges went from 7 → 1628 across the library.

Confirmed limitation — blank Agentic Review thumbnails

Atomic interface stories initialize the Headless engine and execute their mocked search in play; without that work, their bindingGuard-protected components render nothing. Storybook review cards are blank for these stories:

  • The cards request iframe.html?...&embed=true&freeze=finished; embed=true suppresses play.
  • A review-only decorator prototype completed initialization and the search inside the frozen iframe (DOM state and text were correct), but the card remained a white first-paint raster.
  • A manager-only prototype removed embed while retaining freeze; play ran and the card iframe DOM contained the expected Atomic components, but the card raster was still blank.

This is a Storybook review-thumbnail/freeze timing limitation, not an Atomic rendering or MSW issue. Review navigation/click-through, MCP test execution, ID validation, change detection, and publication work; the at-a-glance thumbnail grid is not usable for play/async-initialized Atomic stories. Existing Chromatic and CI gates remain authoritative visual evidence.

  • All existing tests pass without modification
  • No new features or bug fixes to @coveo/atomic shipped code
  • Public API surface is unchanged

Checklist

  • PR title follows Conventional Commits 1.0.0 format (chore(<scope>): <description>)
  • No changeset needed — changes are dev tooling only (.storybook, devDependencies, root patch); nothing in the published package (dist/, custom-elements.json, docs/, licenses/) changes.

Note

Draft / PoC. Agentic Review and MCP are experimental in Storybook; the storybook@10.5.6 patch is version-pinned and will intentionally fail to apply on the next Storybook upgrade (a signal to drop it once the upstream fix lands). Existing gates (Vitest, a11y reporter, Playwright, Chromatic) remain authoritative.

Prerequisites for Storybook Agentic Review:

- packages/atomic: storybook, web-components-vite, addon-a11y, addon-docs,
  addon-vitest, storybook-addon-pseudo-states -> 10.5.6; addon-mcp -> 0.7.0
  (0.7.0 adds display-review / get-stories-by-component).
- pnpm-workspace.yaml: exempt storybook-addon-pseudo-states from
  minimumReleaseAge, consistent with the rest of the Storybook cohort.
- Patch storybook@10.5.6: add extensionAlias to the change-detection
  oxc-resolver so '.js' specifiers resolve to '.ts'/'.tsx' sources
  (TS bundler/nodenext). Without it, story->component edges are dropped and
  get-changed-stories/get-stories-by-component cannot map Atomic components
  to their stories. Temporary workaround until fixed upstream.
Turn on Agentic Review in packages/atomic/.storybook/main.ts:

- features.changeDetection + features.experimentalReview (the latter gates
  the MCP display-review tool and the in-Storybook review UI).
- Register @storybook/addon-mcp with endpoint '/mcp' and toolsets
  { dev: true, test: true, docs: false }. The docs/manifest toolset is
  React-only, so it stays off for the Web Components renderer.

Dev-tooling only; the published @coveo/atomic package is unchanged.
@changeset-bot

changeset-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a458a45

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@svcsnykcoveo

svcsnykcoveo commented Aug 6, 2026

Copy link
Copy Markdown

Snyk checks have failed. 68 issues have been found so far.

Status Scan Engine Critical High Medium Low Total (68)
Open Source Security 3 65 0 0 68 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

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.

2 participants