Skip to content

feat: 시설 재적재 월간 리마인더 + 동결 행 주소 변경 감지 (0033 §8) - #198

Merged
seizeh merged 3 commits into
mainfrom
ops/facility-resync-reminder-and-frozen-watch
Sep 7, 2026
Merged

seizeh merged 3 commits into
mainfrom
ops/facility-resync-reminder-and-frozen-watch

Conversation

@seizeh

@seizeh seizeh commented Sep 7, 2026

Copy link
Copy Markdown
Owner

0033 §8 "남은 것" 중 사람 의존 두 가지를 장치로 바꿉니다.

① 월간 재적재 리마인더 (cron facility-resync-reminder)

  • 매월 1일 09:00 KST → app.ops_alarm_fire('facility_resync_due', …) → 관리자 전원 알림(→ 푸시).
  • 본문에 0033 §7 철칙 요약(CSV 4종·Excel 금지·최종수정시점·dry-run·필터본 금지) 포함.

② 동결 행 주소 변경 감지 (trigger trg_facilities_frozen_addr_alert)

검증

  • 운영 적용 완료(함수·트리거·크론 잡 13). 롤백 트랜잭션으로 실증:
    fired=1 notif=1 detail=[옛 주소 1→새 주소 1] cooldown=1 total=1 (동결 행 발화·관리자 알림·detail 전후 주소·쿨다운 접힘·일반 행/주소 외 변경 무발화, 전부 롤백돼 잔존 0)
  • pgTAP t26_facility_frozen_addr_test.sql 추가(6단언, 예외 삼킴 검증 포함).

⚠️ 머지 전 필요 (이 세션 IP 가 DB allow_list 에 없어 직접 못 함)

  • ./scripts/run_db_tests.sh 로 t26 포함 스위트 통과 확인
  • ./scripts/dump_schema.sh 로 schema.sql·outofband.txt·baseline 갱신 후 커밋 (트리거·크론이 스냅샷에 반영돼야 replay CI 가 통과)

🤖 Generated with Claude Code

seizeh and others added 3 commits September 7, 2026 10:49
0033 §8 의 사람 의존 두 가지를 장치로 바꾼다.

① cron 'facility-resync-reminder' — 매월 1일 09:00 KST 에 ops_alarm_fire
   → 관리자 전원 알림. 이번 사고의 본질이 "잊혀서 6주 동결" 인데 재적재는
   여전히 수동이라, 잊지 않게 하는 장치까지가 파이프라인이다.

② trg_facilities_frozen_addr_alert — owner_updated_at(이름 동결) 행의
   주소가 재적재로 덮이는 순간 알림. 임시 개명 행이 "새 가게 이름 +
   옮겨간 주소" 로 어긋나는 걸 재적재 때마다 사람이 기억해 확인하는 대신
   그 UPDATE 에서 즉시 잡는다. 행 id 하드코딩 없이 동결 행 전체를 본다.
   trg_reports_alert 와 같은 예외 삼킴 — 알람 실패가 적재를 막지 않는다.

운영 적용 완료. 롤백 트랜잭션 실증(t26 과 같은 시나리오):
  fired=1 notif=1 detail=[옛 주소 1→새 주소 1] cooldown=1 total=1

⚠️ 이 세션의 IP 가 DB allow_list 에 없어 스냅샷 갱신을 못 했다 — 머지 전에
   ./scripts/dump_schema.sh 와 ./scripts/run_db_tests.sh 실행 필요.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
전체 pgTAP 스위트(t26 포함 26파일) 운영 DB 통과 확인 후 갱신.
baseline 은 무변화 — 새 객체가 마이그레이션 산출물로 올바르게 분류됐다.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@seizeh
seizeh merged commit ccc07d0 into main Sep 7, 2026
3 checks passed
seizeh added a commit that referenced this pull request Sep 12, 2026
#198 이 리마인더 cron 과 동결 행 주소 감지 트리거를 넣었는데 §8 은 여전히
"cron 없음" 이었다. 두 장치의 존재와, 그 마이그레이션(20260907090000)을 비롯한
운영 이력 미기록분을 2026-09-12 에 repair 한 사실을 적는다.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JHcBZ6JqQT5mP76zZyiqAg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant