Skip to content

Phase 0: Setup

Establish a clean working environment: remove stale canary-refactor artifacts, clone dev-witness stories, set up VRT baselines, and verify ESLint boundary rules.

Corresponds to General Workflow steps 1-3.

This is the first phase — no prior phase artifacts are required.

Verify before starting:

  • Working directory is the ux-prototype repository root
  • npm install has been run (node_modules present)
  • The repository is on a clean branch (no uncommitted changes): git status

T0.1 — Clean Existing Canary-Refactor Artifacts

Section titled “T0.1 — Clean Existing Canary-Refactor Artifacts”

Per Planning Q1 decision: remove existing canary-refactor code and start fresh.

  • Delete ux-prototype/src/canary-refactor/reference/items/ (contains stale item-detail.stories.tsx)
  • Delete ux-prototype/src/canary-refactor/components/ (contains stale ItemDetailPage.tsx, ItemDetailsPanel.tsx, ItemsPage.tsx)
  • Verify: npm run lint and npm run test still pass after deletion

Per Planning Q2 decision: clone both stories.

  • Copy ux-prototype/src/dev-witness/reference/items/items-grid.stories.tsx to ux-prototype/src/canary-refactor/reference/items/items-grid.stories.tsx
  • Copy ux-prototype/src/dev-witness/reference/items/item-detail.stories.tsx to ux-prototype/src/canary-refactor/reference/items/item-detail.stories.tsx
  • Update Storybook title in each clone: Dev Witness/Reference/Items/... to Canary Refactor/Reference/Items/...
  • Keep all other configuration (args, parameters, play functions, MSW handlers) identical
  • Verify: npm run lint + npm run build:lib + npm run test pass
  • Add canary-refactor stories to the VRT spec (either extend tests/vrt/canary-parity.spec.ts or create a new spec file)
  • Each canary-refactor story should be compared against the corresponding dev-witness story
  • Run VRT: npm run test:vrt — baselines should be captured and tests should pass (stories are identical clones at this point)

Per Planning Q4 decision: canary must not import from extras.

  • Check ux-prototype/eslint.config.mjs for no-restricted-imports rules
  • Verify that canary code (src/components/canary/**) is blocked from importing extras (src/components/extras/**, src/types/extras/**)
  • If the rule doesn’t exist, add it following the existing stable-to-canary pattern
  • Verify: npm run lint passes
  • No files exist under canary-refactor/components/ or canary-refactor/reference/items/ from prior work
  • Two cloned stories exist under canary-refactor/reference/items/ with Canary Refactor/ title prefix
  • VRT baselines captured for both canary-refactor stories
  • VRT tests pass (stories are identical to dev-witness)
  • ESLint rule confirms canary cannot import from extras
  • npm run lint + npm run build:lib + npm run test pass