Phase 0 of expert feedback (#1~#11): infrastructure + design + 1차 fixes

Implementations (즉시 동작):
- #1 crash logging: harness/crash_logger.py (sys.excepthook + threading +
  faulthandler, 회전 파일 logs/scanvas.log). main 진입점 통합.
- #2 smooth curves (1차): gate_3d_builder ogee profile를 arc-length parametric
  CubicSpline로 4× densify (8pt→32pt, 36→132 cells, 60 FPS 안전).
- #3 TIN colormap: matplotlib "terrain"의 파란색 범위 제거 → 짙은갈색→황토→
  모래→능선 LinearSegmentedColormap. 9 사이트 교체. 회귀 테스트 추가.
- #5 uv: pyproject.toml + UV_GUIDE.md. base/[py313]/[dev]/[build] extras + hatchling.
- #6,#7,#8 dev cycle infra: .pre-commit-config.yaml (ruff+secrets+위생),
  .gitea/workflows/ci.yml (Py3.11+3.13 matrix), tests/test_regressions.py
  (18 회귀 테스트, iter=1~7 fix 박제), CONTRIBUTING.md (Red→Green 알고리즘).

Design docs (다음 세션 마이그레이션 청사진):
- #4 UI/UX 전면 수정: UI_REDESIGN_PLAN.md (12 popup→1 inspector, vtkTkRenderWidget
  embedding 게이트, 4 phase × 7 sessions).
- #10 Core/Plugin: ARCHITECTURE_PLAN.md (Core 14 / Plugin 7 구조물 + 2 렌더 + 1 QA,
  STRUCTURE_REGISTRY 확장, manifest 기반 디스커버리).
- #11 perf hotspots: PERFORMANCE_BASELINE.md (19 핫스팟, P1: 타일 직렬DL 5~30s,
  캡처 직렬 4.5~15s, numpy 벡터화 가능 Python loops, 텍스처 4회 반복read).

Behavior preservation: ruff 0 errors, pytest 17 passed/1 skipped(bpy),
import 33/33 OK on Py3.13.13.

Item #2 P2/P3 곡선, #4 UI 마이그레이션, #10 Phase 1 추출, #11 P1 최적화는 차기 세션.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-08 11:45:30 +09:00
parent b9342f6726
commit e9cc6bfcf4
15 changed files with 2617 additions and 15 deletions

55
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,55 @@
# Pre-commit hooks — local Red→Green 게이트 (피드백 #6/#7/#8).
# 사용법:
# uv pip install pre-commit # 또는 pip install pre-commit
# pre-commit install # .git/hooks/pre-commit 등록
# pre-commit run --all-files # 수동 전체 실행
#
# 이후 모든 `git commit`이 자동으로 ruff + 기본 위생 검사 통과해야 commit됨.
# 피드백 #6 "Red → Green 완료 시에만 Git 자동 업로드" 의 첫 단계.
repos:
# Ruff — 린트 + 자동 수정 (project ruff.toml 적용)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.12
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
# ruff format은 black 호환 — 기존 스타일 보존을 위해 비활성으로 시작.
# 활성화 원하면 stages=[manual] 제거 + 한 번 전체 적용.
stages: [manual]
# 기본 위생
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: ^(_unused/|.*\.bak.*)
- id: end-of-file-fixer
exclude: ^(_unused/|.*\.bak.*|.*\.png|.*\.dxf|.*\.pdf|.*\.mp4|.*\.gif)
- id: check-yaml
- id: check-toml
- id: check-added-large-files
args: [--maxkb=20480] # 20MB 한도 — Design/SAMPLE_CAD 큰 파일은 이미 git에 있음
- id: check-merge-conflict
- id: detect-private-key
# 비밀 누출 방지 (gcp-key.json 같은 파일 차단)
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
exclude: ^(_unused/|tests/|.*\.bak.*|venv.*/|\.git/)
# 로컬 hook — pytest 빠른 회귀만 (느린 통합 테스트 제외)
# pytest는 pre-commit-hooks가 아닌 local stage로 등록 — pre-commit pull 안 함.
# 사용자가 더 엄격한 게이트 원하면 stages: [pre-push] 활성.
default_install_hook_types: [pre-commit]
default_stages: [pre-commit]
# pytest를 pre-push 스테이지에 두면 commit 빨라지고 push 직전에만 테스트.
# `pre-commit install --hook-type pre-push` 추가로 활성.
ci:
autofix_commit_msg: 'chore(pre-commit): autofix'
autoupdate_commit_msg: 'chore(pre-commit): autoupdate hook revs'