fix(산림 조각): 원자료 지문을 경로 · 크기로 바꿈 — 수정 시각 뺌 (PLAN 632-0 · 요구 542)

git 으로 옮겨도 지문이 같아 데스크탑에서 올린 색인 · 조각을 그대로 씀.
새 지문: forest_road 3f4fcf3e · eco_forest 1d125434 · forest_soil a9a02742
시험: 같은 내용 · 다른 시각 = 같은 지문 · 크기 바뀜 = 다른 지문.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015uTVHHoPiWty5oQce1oAXD
This commit is contained in:
2026-10-31 22:50:32 +09:00
co-authored by Claude Sonnet 5.5
parent 76b262706a
commit f67d868d85
2 changed files with 19 additions and 6 deletions
+5 -6
View File
@@ -149,18 +149,17 @@ def sources(name: str) -> list[Path]:
@functools.cache
def _stamp(name: str) -> str | None:
"""원자료 지문(SHP · DBF 크기 · 수정 시각) — 없으면 None.
ponytail: 프로세스마다 한 번 셈 · 원자료를 바꾸면 서버를 다시 켬."""
"""원자료 지문(SHP · DBF 상대 경로 · 크기) — 없으면 None.
ponytail: 수정 시각 뺌(git 으로 옮기면 시각이 달라짐) · 원자료가 바뀌면 크기도 바뀐다는 전제 —
같은 크기로 내용만 바뀐 것은 못 알아봄(그때는 `RULE_VERSION` 을 올림) ·
프로세스마다 한 번 셈 · 원자료를 바꾸면 서버를 다시 켬."""
files = sources(name)
if not files:
return None
parts = []
for shp in files:
for path in (shp, shp.with_suffix(".dbf")):
stat = path.stat()
parts.append(
f"{path.relative_to(DATA_ROOT).as_posix()}:{stat.st_size}:{stat.st_mtime_ns}"
)
parts.append(f"{path.relative_to(DATA_ROOT).as_posix()}:{path.stat().st_size}")
return hashlib.sha1("\n".join(parts).encode()).hexdigest()[:8]