feat(v2): 알고리즘 분류 N:M 정션 — problems.algorithm → problem_algorithms (계약 v3.0) - #166
Merged
Conversation
…s (계약 v3.0) 백엔드 알고리즘 필터링이 합성 기법(composition)까지 가져가려면 다중값이 필요. 스칼라 컬럼(코어 1개)은 P2 합성 문제의 합성 기법을 누락 → N:M 정션으로 교체. - schema: problem_algorithms(problem_id, algorithm, role) 추가, problems.algorithm 제거 - persistence: 적재 시 코어(role=core)+합성(role=composition) 행 생성 (중복 PK 회피) - difficulty: _row_to_package 가 internal_meta.hidden_algorithm 읽도록 (제거 컬럼 의존 해소) - migration 0004: 정션 생성 + internal_meta(jsonb) 백필 + algorithm 컬럼 drop - 계약 v3.0: contract/db-access/deploy 3 문서 동기화 + §7 변경이력 게이트 762 passed / mypy 91 strict / ruff green. composition 은 TargetAlgorithm enum 타입이라 정션 어휘 일관(코어=합성 동일 19종).
LsMin124
pushed a commit
that referenced
this pull request
Jun 22, 2026
- meta: main/dev 238f917, tests 724→727 (v1 500 + v2 227 worktree 실측), contract v3.1, version '전달/연동 국면' - 신규 delivery[] 7종(API·공유DB·P1/P2·난이도·알고리즘 N:M정션·공개번호·계약) + bank{} prod 스냅샷(25문제 1000~1024·algo 25+44·Silver9/Gold16) - index/dashboard: 전달·연동 섹션 신설 + 문제은행 스냅샷, recentPrs #149~168 trim, backlog 현행화 - requirements: 인수기준 v2 227 + 범위항목(API/DB/난이도 구현완료) 현행화 - 하드코딩 테스트수 4파일 727 동기화, NFR-6/stack.pytest 227
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요약
백엔드 알고리즘 분류 필터링이 합성 기법(composition)까지 가져가려면 문제당 다중 알고리즘이 필요. 기존
problems.algorithm스칼라는 코어(reduction_core) 1개만 담아, P2 합성 문제의 합성 기법이internal_metaJSONB 안에만 갇혀 필터 불가였음. → N:M 정션 테이블로 교체 (계약 v3.0, breaking).동기
problems.algorithm= 코어 1개 → "segtree 들어간 문제" 필터 시 segtree가 합성인 P2 문제 누락.composition은tuple[TargetAlgorithm, ...](blueprint.py) — 코어와 동일 19종 enum → 정션 어휘 일관.변경
schema.pyproblem_algorithms(problem_id, algorithm, role)추가(복합 PK +algorithm인덱스),problems.algorithm제거persistence.pyrole='core')+합성(role='composition') 행 생성, 코어=합성 중복 PK 회피difficulty.py_row_to_package가internal_meta.hidden_algorithm읽도록(제거 컬럼 의존 해소)migration 0004internal_meta(jsonb)에서 코어/합성 백필 +problems.algorithmdrop백엔드 필터 쿼리 예시
검증
meta.hidden_algorithm/composition) 불변 — DB 적재 형상만 변경비고
SSAFY-TEAM-LYL/Problem-Generator) 동기화 예정.