{
  "$schema": "https://upstage.ai/schemas/washing-rules.v0.json",
  "version": "0.1.0",
  "createdAt": "2026-06-08",
  "source": "sprint-w1 클래스워싱_스펙 + 파트너/솔루션 워싱 2회 실측",
  "scope": "에이전트 생성 HTML → Webflow import(워싱) 전용. DESIGN.*.md(색·토큰)와 별개. CMP-1~3은 compile.mjs, WASH-2·3·5는 강제(compile/audit). WASH-1·4는 advisory(spec).",
  "stage": "enforced",
  "enforcedBy": "compile.mjs CMP-1~3+WASH-3(auto-fix) + audit.mjs WASH-2·5(detectPattern). 레지스트리 rules/canonical-classes.json. 실측 회귀: Solutions Wash Test 페이지 + components.solutions.css(2026-06-09).",
  "compilerRules": [
    {
      "id": "CMP-1",
      "name": "border-longhand-expand",
      "rule": "border 단축 속성을 longhand로 전개해 전달한다.",
      "reason": "whtml_builder import가 `border-top: 1px solid …` 같은 단축을 드롭함(`border:`는 적용). 구 sol-card-divider가 빈 줄로 렌더된 원인.",
      "transform": "border-top:1px solid X → border-top-width:1px; border-top-style:solid; border-top-color:X. directional(top/right/bottom/left)만 전개 — full `border:`는 whtml이 적용하므로 보존.",
      "enforced": "compile.mjs CMP-1 (auto-fix). 값은 괄호깊이 존중 분리 후 width/style/color 분류, 미분류·중복 시 단축 유지+경고.",
      "severity": "error"
    },
    {
      "id": "CMP-2",
      "name": "existing-slug-no-css",
      "rule": "이미 존재하는 canonical 슬러그에는 CSS를 전달하지 않는다(자동 바인딩 유도).",
      "reason": "존재 슬러그 + css → `-1` suffix 중복 생성.",
      "enforced": "compile.mjs CMP-2 (auto-fix strip). 레지스트리 rules/canonical-classes.json(458=internal 333+external 125, tier-matrix 출처)의 슬러그가 셀렉터 leading class면 규칙 strip. @media 내 중첩은 통째 skip. 선행 주석 보존.",
      "severity": "error"
    },
    {
      "id": "CMP-3",
      "name": "responsive-via-flex-or-bp",
      "rule": "반응형은 ①기존 유닛(Grid 4x1/3x1 등 bp 오버라이드 완비) ②신규는 Flex+wrap(main 1회로 전 bp reflow) 중 하나로. @media는 Webflow bp(991/767/479)로 매핑.",
      "reason": "whtml은 커스텀 @media 거부, Webflow 4개 bp만 허용. MCP는 bp 쓰기 불가.",
      "enforced": "compile.mjs CMP-3 (auto-fix). max-width px를 최근접 Webflow bp(479/767/991)로 매핑+`screen and` 정규화. min-width(데스크톱업)는 미지원→보존+보류(--check fail, Flex+wrap 권장).",
      "severity": "warning"
    }
  ],
  "structureRules": [
    {
      "id": "WASH-1",
      "name": "wrapper-chain-order",
      "rule": "섹션 래퍼 순서 불변: section(block) > padding-global(+padding-section-medium) > container-large > max-width-*(+align-center) > 콘텐츠.",
      "severity": "error"
    },
    {
      "id": "WASH-2",
      "name": "no-flex-section",
      "rule": "섹션 셸에 display:flex 금지(컴포넌트 내부 레이아웃만 flex 허용).",
      "reason": "width:100% 없는 padding-global을 수축시켜 좌측 쏠림.",
      "detectPattern": "\\.[\\w-]*section[\\w-]*\\s*\\{[^}]*display:\\s*(inline-)?flex",
      "detectNote": "섹션명 클래스(.*section*)가 블록 내 display:flex일 때만. 구 패턴 section[^>]*{…flex는 greedy로 인접 규칙 오탐(.sol-section-dark→.sol-card-dark) → 교체(2026-06-09).",
      "enforced": "audit.mjs (CSS, error). exit 1.",
      "severity": "error"
    },
    {
      "id": "WASH-3",
      "name": "grouping-wrapper-is-block",
      "rule": "kicker+heading(+sub)을 묶는 그루핑 래퍼는 display:block. flex+gap 금지.",
      "reason": "flex+gap이면 canonical 자체 마진(article-kicker margin-bottom:16px)과 합산돼 간격 2배. 간격은 토큰(canonical 마진)이 소유.",
      "enforced": "compile.mjs WASH-3 (auto-fix). 그루핑 래퍼 식별 = HTML DOM에서 직접 자식이 전부 kicker/heading/subtext(순수 클러스터) AND 자기 박스 없음(background/border/padding/min-*/box-shadow 무). 카드(sol-card·sol-card-dark)는 자기 박스가 있어 자동 제외 — flex 유지.",
      "severity": "error"
    },
    {
      "id": "WASH-4",
      "name": "prefer-existing-units",
      "rule": "레이아웃은 기존 유닛 우선(Grid 4x1/3x1·Features Grid V2). 커스텀 신규는 Flex+wrap 기본, 고정 구조만 Grid 신규.",
      "severity": "warning"
    },
    {
      "id": "WASH-5",
      "name": "divider-canonical-reuse",
      "rule": "디바이더는 canonical 재사용 — 섹션=Line Divider, 카드 내부=Line Divider Small(margin 0.25rem). 신규 divider 클래스 금지.",
      "detectPattern": "\\.((?!line-divider)[\\w-]*divider[\\w-]*)\\s*\\{",
      "detectNote": "page CSS에 divider류 클래스 정의 시 경고. line-divider/line-divider-small(sanctioned canonical)는 negative-lookahead로 면제. 구 sol-divider/sol-card-divider 적발용.",
      "enforced": "audit.mjs (CSS, warning).",
      "severity": "warning"
    }
  ],
  "opsNotes": [
    "update_style: 유일 이름 클래스는 정상 커밋. 미커밋 이슈=동명 중복 클래스 한정.",
    "canonical 클래스 속성 변경=사이트 전역. 페이지 한정이면 콤보 분리. 변경은 변수 바인딩 유지(하드코딩 금지).",
    "스타일 쓰기는 Designer 활성 bp(Desktop=main)에서만 반영.",
    "❌ MCP set_style로 washed 요소 클래스 변경 금지(HARD): 동명중복 사이트에선 이름 resolve가 모호해 phantom 클래스(Check List Item·Max Width Medium Large 등) 주입 + MCP 제거 불가 → 오염. 클래스 변경=요소 remove→fresh whtml 재import, 또는 Designer 수동. (교육페이지 오염 RCA 2026-06-10)",
    "❌ page-scope 하드코딩 금지(HARD): 색·보더·radius·정렬은 변수 든 canonical 클래스 바인딩. var()→raw 박은 커스텀 텍스트/색 클래스 양산 금지.",
    "✅ 정렬은 Designer 수동: 이 사이트는 <p>에 베이스 Check List Item(좌측 강제)이 붙고 MCP로 못 뗌. Text Align Center 등 정렬 클래스는 Designer에서 깨끗이 적용. set_style로 정렬 손대면 오염.",
    "✅ 검증은 게시(published) 페이지로: 캔버스≠게시(정렬·details). 스냅샷만으론 부족.",
    "✅ 첫 이상신호(빈 echo·안 넘긴 클래스 출현·예상밖 styleNames)에 STOP-진단. 패치 누적 금지."
  ],
  "enforcementRoadmap": [
    "v0.1: 규칙 정의 + 사람 리뷰 게이트(webflow-washing-addendum.md). ✓",
    "v0.2 (2026-06-08~09): compile.mjs로 CMP-1(border longhand)·WASH-3(그루핑 래퍼 block)·CMP-2(canonical strip)·CMP-3(@media 매핑) 코드 강제. ✓ 컴파일러 4종 완료.",
    "v0.3 (2026-06-09): audit.mjs가 washing-rules structureRules detectPattern 로드 → WASH-2(섹션 flex, error)·WASH-5(신규 divider, warn) 라이브 게이트. ✓ — WASH-1(래퍼 순서)·WASH-4(유닛 선호)는 구조/휴리스틱이라 detectPattern 없음 = advisory 유지(억지 regex 게이트화 안 함). WASH-3은 compile.mjs auto-fix가 소유(audit 중복 불요).",
    "다음(v0.4 후보): WASH-1 구조 검사(DOM 파싱), CMP-2 @media 내부 중첩 규칙 strip, compile.mjs를 .skill 번들에 동봉."
  ]
}
