From c1df656312e36949223313e8849d6369fd6685f1 Mon Sep 17 00:00:00 2001 From: kyeongmin Date: Sat, 23 May 2026 01:18:20 +0900 Subject: [PATCH] feat(#65): IMP-36 fit/rotation generalization (u1~u8) Generalize Phase Z frame partial responsive fit / rotation to four canonical F13/F14/F20/F8 family partials. Surface = 13 canonical partials; 19 builder-only contracts remain explicitly out of scope. u1 test_imp17_comment_anchor: re-pin L570->L578 (restructure+IMP-17), L571->L579 (IMP-29 -> IMP-47B supersession). Stage 1 red baseline gate. u2 frame_contracts.yaml: add rotation_eligible (P1) + body_fit_pattern2 (P2) bool axes on 13 partial-backed contracts. P1 True: F13/F14/F20/F8 (4). P2 True: F23 + P1_set (5). F29 columns[1].body_parser column_plain -> column_with_transform (P3 parity). u3 test_imp36_fit_rotation_generalization (NEW, 166 lines): static parametrized assertions for P1 metadata + CQ presence, P1 opt-out absence, P2 --max-body-lines + clamp + cqh, P2 opt-out absence, 19 builder-only exclusion. u4 three_parallel_requirements (F13): introduce f13b-root container-name + container-type:size + @container (aspect-ratio<1.5) rotation; add inline --max-body-lines + body line-height clamp/cqh/calc. u5 three_persona_benefits (F14): f14b-root P1 + P2 cqh/jinja body fit. Persona colors (#285b4a/#445a2f/#743002) and circle SVG aspect 1/1 preserved. u6 dx_sw_necessity_three_perspectives (F20): f20b-root P1 + P2 cqh/jinja body fit under IMP-49 partial-fidelity lock. u7 info_management_what_how_when (F8): f8b-root P1 + P2 cqh/jinja body fit. u8 test_imp36_overflow_chain_self_fire (NEW, 299 lines): Selenium self-fire harness for F13/F14/F20/F8 at aspect 1.78 vs 1.0. Asserts line-height changes, font-size invariance across all 4 frames (no per-frame exempt), grid columns rotate 3 -> 1, OVERFLOW_CASCADE_ORDER remains 4-tuple. Stage 4 verification (HEAD 6f1c736 pre-commit baseline): u1 2/2 PASS, u3 33/33 PASS, u8 9/9 PASS (live Chrome). Regression sweep tests/phase_z2 + tests/orchestrator_unit 335/335 PASS. font-size mutations introduced: 0. Pre-existing red (test_imp47b_step12_ai_wiring x3, ai_fallback_master_flag default_off x1) verified unchanged via stash swap -> not introduced. Guardrails honored: - cqh / clamp / container query only (no shared margin/padding/gap shrink). - font-size invariant under aspect change (P2 mutates line-height + --max-body-lines only). - No cross-frame .fNb__ class borrowing (IMP-49 partial-fidelity lock). - F14 circle SVG aspect 1/1 untouched; persona colors preserved. - AI isolation: no HTML structure generation; AI calls remain zone-content. - 1 turn = 1 step; commit excludes .claude/settings.json and all out-of-scope untracked worktree per Stage 4 binding contract. source_comment_ids: Stage 1 #13/#14; Stage 2 #21/#22; Stage 3 #4 + Codex #4 YES; Stage 4 Claude #1 + Codex #3 PASS. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../phase_z2/catalog/frame_contracts.yaml | 54 +++- .../dx_sw_necessity_three_perspectives.html | 32 +- .../info_management_what_how_when.html | 30 +- .../families/three_parallel_requirements.html | 24 +- .../families/three_persona_benefits.html | 25 +- .../test_imp17_comment_anchor.py | 34 +- .../test_imp36_fit_rotation_generalization.py | 166 ++++++++++ .../test_imp36_overflow_chain_self_fire.py | 299 ++++++++++++++++++ 8 files changed, 644 insertions(+), 20 deletions(-) create mode 100644 tests/phase_z2/test_imp36_fit_rotation_generalization.py create mode 100644 tests/phase_z2/test_imp36_overflow_chain_self_fire.py diff --git a/templates/phase_z2/catalog/frame_contracts.yaml b/templates/phase_z2/catalog/frame_contracts.yaml index 1c101d4..47fe471 100644 --- a/templates/phase_z2/catalog/frame_contracts.yaml +++ b/templates/phase_z2/catalog/frame_contracts.yaml @@ -23,6 +23,10 @@ three_parallel_requirements: frame_id: 1171281190 family: three_parallel + # IMP-36 (Gitea #65 u2) partial-backed contract axis bools. + rotation_eligible: true # P1: aspect-ratio container-query rotation + body_fit_pattern2: true # P2: cqh/clamp/--max-body-lines body fit + source_shape: top_bullets cardinality: strict: 3 @@ -79,6 +83,10 @@ process_product_two_way: frame_id: 1171281210 family: two_column_h3 + # IMP-36 (Gitea #65 u2) partial-backed contract axis bools. + rotation_eligible: false # P1: 2-col compare table — rotation 부적합 opt-out + body_fit_pattern2: false # P2: 미적용 (Stage 2 selection) + source_shape: h3_subsections cardinality: strict: 2 # F29 frame = 2 visual columns. ≠2 → fallback. @@ -122,7 +130,7 @@ process_product_two_way: body_parser: column_with_transform # 첫 top-bullet AS-IS/TO-BE 표 인식 - title_to: banner_right body_to: product - body_parser: column_plain # 모든 section = 일반 text_lines + body_parser: column_with_transform # IMP-36 (Gitea #65 u2) P3 parity — process column 과 동일 transform 인식 (좌/우 대칭) bim_issues_quadrant_four: @@ -130,6 +138,10 @@ bim_issues_quadrant_four: frame_id: 1171281193 family: bim_issues_quadrant + # IMP-36 (Gitea #65 u2) partial-backed contract axis bools. + rotation_eligible: false # P1: 4-quadrant 고정 grid — rotation 부적합 + body_fit_pattern2: false # P2: 미적용 (Stage 2 selection) + source_shape: top_bullets # F16 정책 = pad_to=4 + truncate>4 (legacy 와 동일). cardinality strict 화는 본 transition 범위 외. # 향후 normal path 안정 후 strict 적용 + 위반 시 fallback path (FitError) 검토. @@ -193,6 +205,10 @@ three_persona_benefits: frame_id: 1171281191 family: cards + # IMP-36 (Gitea #65 u2) partial-backed contract axis bools. + rotation_eligible: true # P1: aspect-ratio container-query rotation + body_fit_pattern2: true # P2: cqh/clamp/--max-body-lines body fit + source_shape: top_bullets cardinality: strict: 3 # 3 persona = strict. @@ -258,6 +274,10 @@ construction_goals_three_circle_intersection: frame_id: 1171281189 family: diagram + # IMP-36 (Gitea #65 u2) partial-backed contract axis bools. + rotation_eligible: false # P1: 3-circle SVG diagram — rotation 부적합 (좌표 의존) + body_fit_pattern2: false # P2: 미적용 (Stage 2 selection) + source_shape: top_bullets cardinality: strict: 3 # 3 메인 원 — strict. @@ -328,6 +348,10 @@ construction_bim_three_usage: frame_id: 1171281182 family: cards + # IMP-36 (Gitea #65 u2) partial-backed contract axis bools. + rotation_eligible: false # P1: 3 stacked rows — rotation 부적합 (수평 row 구조) + body_fit_pattern2: false # P2: 미적용 (Stage 2 selection) + source_shape: top_bullets cardinality: strict: 3 @@ -397,6 +421,10 @@ bim_dx_comparison_table: frame_id: 1171281195 family: table + # IMP-36 (Gitea #65 u2) partial-backed contract axis bools. + rotation_eligible: false # P1: 2-col compare table — rotation 부적합 opt-out (issue body 명시) + body_fit_pattern2: false # P2: 미적용 (Stage 2 selection) + source_shape: top_bullets # NOTE (Codex round 43 §F1-c) : top-level `cardinality.strict: 2` = *column 수* # (col_a / col_b). data row 수 는 별 — `sub_zones.rows.cardinality` 의 `{min:1, max:12}`. @@ -462,6 +490,10 @@ dx_sw_necessity_three_perspectives: frame_id: 1171281198 family: cards + # IMP-36 (Gitea #65 u2) partial-backed contract axis bools. + rotation_eligible: true # P1: aspect-ratio container-query rotation + body_fit_pattern2: true # P2: cqh/clamp/--max-body-lines body fit + source_shape: top_bullets cardinality: strict: 3 # 3 perspective columns @@ -528,6 +560,10 @@ info_management_what_how_when: frame_id: 1171281179 family: cards + # IMP-36 (Gitea #65 u2) partial-backed contract axis bools. + rotation_eligible: true # P1: aspect-ratio container-query rotation + body_fit_pattern2: true # P2: cqh/clamp/--max-body-lines body fit + source_shape: top_bullets cardinality: strict: 3 # 3 sections (What / How / When) @@ -587,6 +623,10 @@ sw_reality_three_emphasis: frame_id: 1171281209 family: cards + # IMP-36 (Gitea #65 u2) partial-backed contract axis bools. + rotation_eligible: false # P1: 미적용 (Stage 2 selection — future eligibility TBD) + body_fit_pattern2: false # P2: 미적용 (Stage 2 selection) + source_shape: top_bullets cardinality: strict: 3 @@ -644,6 +684,10 @@ bim_current_problems_paired: frame_id: 1171281194 family: cards + # IMP-36 (Gitea #65 u2) partial-backed contract axis bools. + rotation_eligible: false # P1: 4x2 paired rows — rotation 부적합 (2-axis row×side 구조) + body_fit_pattern2: false # P2: 미적용 (Stage 2 selection) + source_shape: top_bullets # mapper split_source allow-list 정합 (Codex round 60) layout_variant: paired_rows_4x2_alternating_pills # runtime projection model cardinality: @@ -735,6 +779,10 @@ app_sw_package_vs_solution: frame_id: 1171281203 family: table + # IMP-36 (Gitea #65 u2) partial-backed contract axis bools. + rotation_eligible: false # P1: 2-col compare table — rotation 부적합 opt-out + body_fit_pattern2: true # P2: cqh/clamp/--max-body-lines body fit (Stage 1 canonical source) + source_shape: h3_subsections # F29 와 동일 — 2 h3 subsection = 2 column. cardinality: strict: 2 # 2 column (Package / Solution) — NOT row count. @@ -783,6 +831,10 @@ pre_construction_model_info_stacked: frame_id: 1171281180 family: list + # IMP-36 (Gitea #65 u2) partial-backed contract axis bools. + rotation_eligible: false # P1: 5-color cycle pill list — rotation 부적합 + body_fit_pattern2: false # P2: 미적용 (Stage 2 selection) + source_shape: top_bullets cardinality: min: 4 # analysis.md min 4 / Figma 5-color cycle design floor. diff --git a/templates/phase_z2/families/dx_sw_necessity_three_perspectives.html b/templates/phase_z2/families/dx_sw_necessity_three_perspectives.html index 11539ee..dbb1a58 100644 --- a/templates/phase_z2/families/dx_sw_necessity_three_perspectives.html +++ b/templates/phase_z2/families/dx_sw_necessity_three_perspectives.html @@ -65,6 +65,12 @@ slots : gap: 6px; font-family: 'Noto Sans KR', 'Pretendard', sans-serif; word-break: keep-all; + /* IMP-36 (Gitea #65 u6) P1 root — enable container queries on .f20b. + container-type: size unlocks cqh/cqi/cqw + aspect-ratio matching against + this element. container-name: f20b-root namespaces the @container rule + below (partial-fidelity lock per IMP-49 #78 — no cross-frame borrowing). */ + container-type: size; + container-name: f20b-root; } .f20b__title { font-size: var(--font-zone-title); @@ -131,6 +137,25 @@ slots : color: #1d4d3e; /* PROMOTED — verbatim from upstream :208 (.card-title-1 -webkit-text-stroke) */ font-weight: 700; } + + /* IMP-36 (Gitea #65 u6) P2 body fit — line-height clamp scales with the + per-column bullet count via the inline `--max-body-lines` Jinja style on + each `.f20b__body`. 60cqh ≈ 3-col card body share of `.f20b` root height + (zone-title ~15cqh + card header ~10cqh + remaining ~75cqh, split 60cqh + for text lines + reserve for padding/gap). font-size unchanged + (guardrail #6 — Stage 2 spec). Fallback 3 = file-header default + "body 3-5 bullets per column". */ + .f20b__body .text-line { + line-height: clamp(1.15em, calc(60cqh / var(--max-body-lines, 3)), 1.6em); + } + + /* IMP-36 (Gitea #65 u6) P1 rotation rule — when the surrounding zone is + narrow (aspect-ratio < 1.5), collapse the 3-column grid to a single + column. The threshold matches the IMP-36 Stage 2 canonical (vertical-2 / + 세로형). Card header / body / bullet styles remain unchanged. */ + @container f20b-root (aspect-ratio < 1.5) { + .f20b__cols { grid-template-columns: 1fr; } + }