learning_ai_notes/scripts
saravanakumardb1 78433b0e45 feat(ci): one-way UI drift ratchet to prevent regressions
UI8 deferred deleting the legacy global classes (.surface-card,
.surface-muted, .input-shell, .badge) because 69+ call sites in UI6/UI7
territory (dashboard, search, workspaces, notes detail, chat, palace)
still depend on them. Removing the globals before those screens migrate
would visually break the app.

Instead, ship a one-way ratchet that solves the actually-important
problem: prevent NEW legacy usage from creeping in while existing
sites get migrated.

- scripts/ui-drift-ratchet.sh — reads scripts/ui-drift-baseline.json
  and FAILS if any of the four UI drift categories regress above the
  tracked baseline. Pure bash, no jq required, works with grep or
  ripgrep. Uses the same patterns as scripts/ui-drift-audit.sh.
- scripts/ui-drift-baseline.json — checked-in baseline captured today:
  raw controls 38, legacy classes 92, hardcoded colors 0, direct imports 0.
- package.json — adds pnpm run audit:ui:ratchet and
  audit:ui:ratchet:update scripts.
- .github/workflows/ci.yml release-guards job — runs the ratchet as a
  required step plus the existing audit in report mode.
- docs/UI_UX_PLATFORM_CORE_ROADMAP.md — marks the CI-guard checklist
  item complete, documents the path to fully strict mode (drive
  baseline to zero, then delete globals.css legacy classes, then flip
  audit:ui:strict from advisory to required).

Verified:
- Ratchet at baseline: exits 0
- Synthetic regression (added a file with surface-card + raw <input>):
  ratchet correctly exits 1, reporting +1 in each affected category
- pnpm run verify: backend 380/380, web 96/96, mobile 97/97 (no
  behavior change)
2026-05-23 00:13:50 -07:00
..
compose-smoke.sh ci(docker): add compose smoke script 2026-05-05 13:31:10 -07:00
dependency-health.sh ci(deps): add dependency health workflow 2026-05-05 13:36:04 -07:00
docker-prep-original.sh perf(docker): optimize docker-prep.sh with caching and shared cache 2026-05-10 00:10:28 +00:00
docker-prep.sh fix(workspace): canonicalize common-plat path to ../learning_ai_common_plat 2026-05-22 15:08:30 -07:00
local-smoke.sh fix(workspace): canonicalize common-plat path to ../learning_ai_common_plat 2026-05-22 15:08:30 -07:00
release-guard-audit.sh fix(workspace): canonicalize common-plat path to ../learning_ai_common_plat 2026-05-22 15:08:30 -07:00
secret-scan-repo.sh chore: add Husky pre-commit hooks + secret-scan scripts 2026-03-27 23:07:30 -07:00
secret-scan-staged.sh chore: add Husky pre-commit hooks + secret-scan scripts 2026-03-27 23:07:30 -07:00
ui-drift-audit.sh fix(scripts): make ui-drift-audit work without ripgrep 2026-05-22 23:51:47 -07:00
ui-drift-baseline.json feat(ci): one-way UI drift ratchet to prevent regressions 2026-05-23 00:13:50 -07:00
ui-drift-ratchet.sh feat(ci): one-way UI drift ratchet to prevent regressions 2026-05-23 00:13:50 -07:00