feat(db): Detection Model Registry 스키마 (V034, Phase 1-1) #87
No reviewers
레이블
레이블 없음
마일스톤 없음
담당자 없음
참여자 2명
알림
마감일
마감일이 설정되지 않았습니다.
의존성
No dependencies set.
Reference: gc/kcg-ai-monitoring#87
불러오는 중...
Reference in New Issue
Block a user
No description provided.
Delete Branch "feature/phase1-1-detection-models-schema"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
변경 사항
Detection Model Registry DB 스키마 (Phase 1-1)
.claude/plans/vast-tinkering-knuth.mdPhase 1-1 의 DB 레이어. prediction 의 17 탐지 알고리즘을 "명시적 모델 단위" 로 분리하고, 프론트엔드에서 파라미터·버전·가중치를 서로 다른 설정으로 동시 실행하며 비교 할 수 있는 기반.기존
V014 correlation_param_models패턴의 일반화 — JSONB params + is_active 를model_id × version × role×status차원으로 확장.설계 원리
dark_suspicion,gear_violation_g01_g06)version문자열 자유도, SemVer 권장)PRIMARY(운영 반영, 최대 1개) /SHADOW·CHALLENGER(관측용, N개)DRAFT→TESTING→ACTIVE→ARCHIVEDmodel_id간 선행·후행 의존성 — 후행 모델은 PRIMARY 결과만 소비 (오염 차단)테이블 4종 + 뷰 1개
detection_modelsdetection_model_dependenciesdetection_model_versions(model_id) WHERE status=ACTIVE AND role=PRIMARYdetection_model_run_outputsdetection_model_metricsv_detection_model_comparison(cycle, model, input_ref)로 PRIMARY × SHADOW JOIN핵심 불변식
UNIQUE INDEX uk_detection_model_primary ON detection_model_versions(model_id) WHERE status='ACTIVE' AND role='PRIMARY'— DB 레벨 보호CHECK (status <> 'ACTIVE' OR role IS NOT NULL)ctx.shared[model_id]에는 PRIMARY 결과만 기록 — SHADOW 는 저장소에만 남고 후행 모델 입력에 절대 주입하지 않음권한
auth_perm_tree('ai-operations:detection-models', parent=admin, nav_sort=250, url='/detection-models')promote-primary는 ADMIN 만)테스트
Successfully applied 1 migration to schema "kcg", now at version v034확인SELECT * FROM kcg.detection_models→ 빈 결과 확인 (Phase 1-2/2 에서 seed)\dt kcg.detection_model_run_outputs*→ 파티션 2개(2026-04, 2026-05) 확인후속 (별도 MR)
models_core/— base/registry/executor/params_loader/feature_flag +_stage()wrappingdetection_model_run_outputs월별 자동 생성·만료 로직 추가 (기본 7일 retention)DetectionModelController— CRUD + activate/promote-primary/archive + Compare API관련
.claude/plans/vast-tinkering-knuth.mdPhase 1-1docs/prediction-analysis.md§7 P1/P2 구조적 개선 제안correlation_param_models의 일반화 (해당 테이블은 2~3 릴리즈 후 deprecate 예정)주의
Phase 1-1 V034 스키마 승인 — release 동일 묶음 반영