"""Stage B (2026-10-16): pier page section 2 in Prism (summary strip, app-check column, evidence link, 일치 묶음 일괄 확정), prism.css link, reason field on the section confirm form. The old 필요한 묶음 일괄 확정 form stays, folded away as legacy (stage D decides).""" from pathlib import Path T = Path(__file__).resolve().parents[2] / "web" / "templates" # ---- base.html p = T / "base.html" s = p.read_text(encoding="utf-8") assert "prism.css" not in s a = "{% block title %}T형 교각 모델링{% endblock %}\n" assert s.count(a) == 1 s = s.replace(a, a + '\n') p.write_text(s, encoding="utf-8") # ---- pier.html: replace everything between the stage-A marker and the gates heading p = T / "pier.html" s = p.read_text(encoding="utf-8") i = s.index("") j = s.index("

3. 게이트

") new = ''' {% from "_prism.html" import st_badge, human_badge %}

필요 {{ nreq }}개 중 앱 확인 일치 {{ cnt.g }} · 주의 {{ cnt.w }} · 불일치 {{ cnt.b }} · 근거 없음 {{ cnt.n }} · 해당 없음 {{ cnt.x }} · 사람 확정 {{ human }}

{% if nmatch %}일치 묶음 일괄 확정 ({{ nmatch }}개) {% else %}확정할 '일치' 묶음이 없습니다.{% endif %}

앱 확인은 도면 표·재료표 수량·고정 항목을 앱이 대조한 결과이며 앱은 확정하지 않습니다. '일치'는 "독립 근거와 값이 같다"는 뜻이지 "도면이 맞다"는 뜻이 아닙니다. 변수 등급 V1 값 · V2 목록 · V3 생성(화면 편집 차단) · F 고정(바꾸면 사유 필요).

{% if origin_same %} {% elif not has_origin %}

이 교각은 템플릿 복사 기록이 없어 '템플릿 원본 그대로' 여부를 표시하지 않습니다.

{% endif %}
{% for s in sections %} {% endfor %}
입력 묶음 {{ sections|length }}개 — 앱 확인이 나쁜 것부터
묶음변수 등급값 출처앱 확인사람 확정
{{ s.file }}.{{ s.key }}{% if not s.required %} (필수 아님){% endif %} {% if s.info %}참고{% else %}{{ s.meta.grade }} {{ grades[s.meta.grade] }}{% endif %} {% if s.meta.origin and s.required %}템플릿 원본 그대로{% elif s.meta.origin %}템플릿 원본 그대로{% else %}{{ s.meta.source|join(' · ') }}{% endif %} {{ st_badge(s.chk.st) }} {{ s.chk.summary }} 근거 보기 {{ human_badge(s) }}{% if s.by %} {{ s.by }} · {{ s.at }}{% endif %}
{% if need %}
앱 확인과 상관없이 필요한 묶음을 모두 확정 (이전 방식 · 권장하지 않음)
확정자 게이트 G1~G5에 필요한 묶음 중 미확정인 것을 앱 확인 없이 모두 확정합니다(도장). 위의 '일치 묶음 일괄 확정'을 쓰세요.
{% else %}

게이트에 필요한 묶음이 모두 확정되어 있습니다.

{% endif %} ''' s = s[:i] + new + s[j:] p.write_text(s, encoding="utf-8") # ---- section.html: link to the evidence page and the reason field of the confirm form p = T / "section.html" s = p.read_text(encoding="utf-8") a = ''' ''' assert s.count(a) == 1 b = ''' 사유 근거 보기''' s = s.replace(a, b) p.write_text(s, encoding="utf-8") print("patched templates")