Phase 0: safety net & security — lockfile, CI, e2e + characterization tests#216
Merged
Conversation
- REFACTORING_PLAN.md: full audit + 7-phase migration plan to modern stack - CLAUDE.md: working contract for agent sessions (rules, verification, landmines) - docs/refactor/: PROGRESS.md (session handoff) + per-phase checklists - scripts/verify.sh: single verification gate
…, add CI - package-lock.json now committed (removed from .gitignore); npm ci reproducible - remove 9 unused packages: axios, date-fns, jsdom, localforage, match-sorter, sort-by, react-transition-group, @types/react-transition-group, @mui/joy - delete public/css/** (committed build artifacts, referenced nowhere) - add .nvmrc (Node 22) and GitHub Actions CI: tsc + eslint + unit tests - fix type error in Price.test.tsx (string passed to number prop) - fix pre-commit hook: drop 'exec >/dev/tty' (broke commits in non-tty environments: CI, GUI clients)
- new client in yes-code-project-0526: token, categories (17), products (110), anonymous cart all verified; home + catalog render in dev - promo code BAGS15-SP exists but expired 2026-03-15 — tracked as human follow-up (blocks promo e2e scenario) - add .claude/launch.json for dev-server preview
- 10 green tests: smoke (home, header), catalog (listing, pagination, subcategory), size filter + reset, cart (add/quantity/remove line item/clear all), auth (3-step registration wizard, logout, login, profile view + edit mode) - promo spec is test.fixme until BAGS15-SP validity is extended in Merchant Center (expired 2026-03-15) - pins current quirks on purpose: 'Sing up' typo, layout-invisible card anchors, unstable product sort, cart-version race guarded via networkidle - e2e excluded from ESLint 8 until phase 1 flat-config migration - verify.sh gate: install + tsc + lint + 42 unit + 10 e2e — all green
… credential validators - 27 new unit tests pinning current behavior before migration: getCartProducts (prices/discounts/promo + undefined-string quirks), getPriceValue, extractSizesWithVariantId (last-variant dedupe), getSku (pinned BUG: TypeError on unknown variant id), transformFetchedCategories, sigIn/signUp validators (had zero coverage; pinned always-empty errors object and single-char-password bug) - bugs marked TODO(refactor) for phases 3-4 - full gate: install + tsc + lint + 69 unit + 10 e2e — exit 0
- un-fixme promo.spec.ts; apply button is 'Ok' on the cart page - full e2e suite: 11/11 green
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.
Summary
Phase 0 of the refactoring plan (REFACTORING_PLAN.md): the project stops being
unreproducible and gets a full behavior-pinning safety net before any stack
migration starts. No app behavior changes.
progress, per-phase checklists), scripts/verify.sh (single verification gate)
API client; .env.example added; old 2023 client deactivated in Merchant Center
.nvmrc → Node 22
localforage, match-sorter, sort-by, react-transition-group + types, @mui/joy)
and 100+ committed build artifacts in public/css
catalog (listing/pagination/subcategories), size filter + reset, cart
(add/quantity/remove/clear), promo code, 3-step registration, login/logout,
profile. Known quirks pinned on purpose ("Sing up" typo, unstable product
sort, cart-version race) — fix candidates live in phases 3-5 of the plan
and credential validators (previously zero coverage), bugs marked
TODO(refactor)
non-tty environments (exec >/dev/tty), tsc error in Price.test.tsx
Verification
./scripts/verify.sh→ exit 0:E2E suite verified green twice in a row locally (flake check).