Skip to content

docs(adr): ADR-0025 Latency Budget 표준 + 12번 학습 노트#1

Merged
1989v merged 18 commits into
mainfrom
feat/adr-0025-latency-budget
Apr 26, 2026
Merged

docs(adr): ADR-0025 Latency Budget 표준 + 12번 학습 노트#1
1989v merged 18 commits into
mainfrom
feat/adr-0025-latency-budget

Conversation

@1989v

@1989v 1989v commented Apr 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • ADR-0025 Latency Budget 표준 도입: 자릿수 기반 (ns/µs/ms) 그룹핑 + msa 호출 경로별 라벨 + Tier 1/2/3 P99 budget + 신규 호출 경로 검토 체크리스트
  • CLAUDE.md Key Conventions 표에 ADR-0025 행 추가, doc-index.lock.json 갱신
  • 학습 노트 study/docs/12-latency-numbers/ 14개 파일 (5 Phase × 12 deep file + plan/preview) — ADR의 근거 자료

핵심 결정 (ADR-0025)

1. 자릿수 그룹 (ns / µs / ms)

모든 호출/컴포넌트 latency를 3그룹으로 분류

2. Tier 별 P99 Budget

  • Tier 1 사용자 직접 응답: 50-300ms (강제 SLA)
  • Tier 2 비동기 처리: throughput 기준
  • Tier 3 백오피스: best-effort

3. 신규/변경 호출 경로 PR 체크리스트

속한 Tier / 예상 자릿수 / fan-out / 외부 호출 / 캐시 / 측정 방법 명시

4. 측정 표준

Spring Boot Actuator + Micrometer histogram + Prometheus + Grafana RED/Heatmap

학습 노트 구성

Phase 파일 핵심
1 01 자릿수 사다리 + 외울 비율 5개
2 02-05 CPU 캐시 / 메모리·SSD·HDD / 네트워크 물리 / tail+fan-out
3 06-09 redis-cli/curl/ping → wrk/k6 → Prom+Grafana → msa 호출 경로 budget
4 10-11 함정 9가지 + 면접 Q&A 트리 6×꼬리2단계
5 12 ADR-0025 초안 (본 PR의 ADR과 일치)

Test plan

  • ADR-0025 본문 검토: Tier 1/2/3 budget 값, 호출 경로 자릿수 라벨이 현재 인프라 기준 합리적인지
  • 신규 호출 경로 검토 체크리스트가 PR 템플릿으로 도입 가능한지
  • CLAUDE.md Key Conventions 행 위치 / 문구 검토
  • doc-index.lock.json drift 없음 확인 (python3 ai/plugins/hns/scripts/doc_map.py --check)

Open Questions (ADR Open Questions 섹션 참고)

  • Tier 1 budget 값은 production 측정 후 갱신 필요 (초기값 = 학습 단계 추정)
  • 멀티 리전 도입 시 cross-region 경로 budget 별도 정의
  • APM (분산 트레이싱) 도입 시 호출 경로별 자동 측정 가이드 추가

🤖 Generated with Claude Code

1989v and others added 18 commits April 25, 2026 03:05
- seven-split 서비스 신규 추가 (Kotlin/Spring Boot, :domain/:app 중첩 서브모듈)
- Phase 1 백테스트 엔진을 위한 Gradle 모듈·빌드·패키지 뼈대
- ADR-0024 (Proposed): 세븐스플릿 7원칙 기반 암호화폐 규칙매매, ExecutionMode 추상화, Phase 기반 출시
- spec/requirements/test-quality/tasks/open-questions 문서 세트 생성
- libs.versions.toml: turbine, kotest-property, testcontainers-{junit,mysql,clickhouse,kafka} 카탈로그 편입

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Value Objects: Price/Quantity/Percent/TenantId + *Id(UUID 래핑)
- Aggregates: SplitStrategy, StrategyRun, RoundSlot, Order, ExchangeCredential
- Sealed 계층: SpotOrderType(Market/Limit) — 레버리지 컴파일 차단
- DomainEvent sealed 계층 15종 (Strategy/Slot/Order/Risk/Exchange)
- 상태머신 캡슐화 (ADR-0022): RoundSlotState EMPTY→PENDING_BUY→FILLED→PENDING_SELL→CLOSED→EMPTY
- INV-01 (손절 금지) precondition: RoundSlot.fillSell — StopLossAttemptException
- 도메인 예외 5종 (common BusinessException 상속)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
INV-01~07 + 원칙 2 (레버리지 금지) 커버리지:
- SplitStrategyConfigPropertySpec — INV-07 (roundCount/entryGap/takeProfit 범위)
- NoStopLossInvariantSpec — INV-01 (fillSell precondition + DomainEvent 리플렉션)
- RoundSlotIndependentSellSpec — INV-02 (슬롯별 독립 익절)
- EqualOrderAmountSpec — INV-03 (회차 명목 균등)
- IdempotentOrderSpec — INV-06 (orderId 고유성)
- LeverageForbiddenSpec — Principle 2 (SpotOrderType sealed 제약)
- TenantIsolationSpec — INV-05 (aggregate tenantId 강제)
- StrategyLifecycleSpec, RoundSlotStateTransitionSpec — 상태머신 가드
- SplitFixtures — Arb 기반 테스트 팩토리

kotest-property testImplementation 배선 추가. 35 tests green, 0.22s.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- domain port: Clock, EventPublisher (도메인이 직접 호출)
- application port:
  - exchange/ExchangeAdapter (suspend, 백테스트/페이퍼/실매매 공통)
  - marketdata/MarketDataSubscriber + HistoricalMarketDataSource (Flow)
  - credential/CredentialVault + DecryptedCredential(masked toString)
  - notification/NotificationSender
  - persistence/{Strategy,StrategyRun,RoundSlot,Order,ExchangeCredential,Outbox,BacktestRun}RepositoryPort
- 전 Repository port 시그니처에 tenantId 강제 (INV-05)
- port 메서드는 suspend/Flow (ADR-0002 — 구현체가 Dispatchers.IO 격리)
- app/build.gradle.kts: kotlin-coroutines-core 명시 추가 (transitive 없음)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
결정론 백테스트 엔진 구현:
- StrategyExecutor — 엔진 orchestrator, Flow<Bar> 소비
- StrategyEngineLoop — Bar별 (1)매도 (2)매수 (3)AWAITING_EXHAUSTED 전이 평가
- BacktestExchangeAdapter — 가상 잔고·즉시 체결·멱등 저장 (UUID key)
- CsvHistoricalMarketDataSource — CSV fixture 기반 Flow<Bar>
- DeterministicIdGenerator — seed 기반 UUID, 비결정 제거
- MutableClock — Bar timestamp 반영 Clock
- InMemoryEventPublisher — 테스트 유틸
- BacktestResult — events·executions·realizedPnl + inputHash

테스트 (모두 green):
- BacktestEngineSpec — 결정론 (2회 실행 byte-level 동일)
- AwaitingExhaustedScenarioSpec — FR-ENG-06 (전 회차 소진 후 신규 매수 없음)
- SlotRebuyScenarioSpec — FR-ENG-05 (매도 후 재하락 시 슬롯 재사용)

CSV fixtures 3종 (tight/volatile/exhausted). 사용되지 않던 flat 파일 정리.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- DDL V001~V004: seven_split DB + market_tick_bithumb (ReplacingMergeTree) +
  backtest_run + execution_result (Phase 1 placeholder)
- ClickHouseConfig (@ConfigurationProperties)
- SchemaBootstrapper — classpath DDL 순차 실행 유틸
- CsvToClickHouseBulkLoader — TG-07 배치 insert 공통 유틸
- ClickHouseSchemaSmokeSpec — Testcontainers 스키마 검증 (Docker 미연결 시 graceful skip)
- analytics DB 직접 참조 없음 (별도 seven_split DB)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- BithumbRestClient (WebClient + Coroutine, suspend fetchCandles)
- BithumbCandleResponse — 배열 DTO 파싱
- BithumbHistoryIngestService — checkpoint 기반 증분, CandleWriter 추상화 (테스트 분리)
- ClickHouseCandleWriter — 프로덕션 구현체 (ClickHouse insert, 1000 row 배치)
- FileIngestCheckpointStore / IngestCheckpointStore — checkpoint 파일
- IngestDlqRecorder — 실패 슬라이스 DLQ 파일 기록
- BithumbIngestCommand — ApplicationRunner (profile=ingest-bithumb)

테스트: MockWebServer stub, 임시 디렉토리 checkpoint/DLQ, InMemoryCandleWriter
  - BithumbRestClientSpec, BithumbHistoryIngestServiceSpec
  - FileIngestCheckpointStoreSpec, IngestDlqRecorderSpec
실 API 통합은 nightly (범위 밖)

gradle/libs.versions.toml: okhttp 4.12.0 + mockwebserver
build.gradle.kts: spring-webflux, coroutines-reactor, kotlin-logging

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Flyway V001: 9 테이블 (split_strategy, strategy_run, round_slot, order,
  exchange_credential, notification_target, outbox, processed_event, audit_log)
  모든 테이블 tenant_id + 인덱스
- JPA Entity 5종 (Phase 1 MVP: Strategy/Run/Slot/Order/Outbox), 나머지 4종은 Phase 2/3 placeholder
- Mapper object 4종 — 도메인 reconstruct 팩토리 사용
- JpaRepositoryAdapter 5종 — Port 구현, Dispatchers.IO 격리
- OutboxEventPublisher : EventPublisher — 도메인 이벤트 outbox append
- OutboxRelay — @scheduled, Phase 1은 log only (Kafka 발행 Phase 2)
- PersistenceIntegrationSpec — Testcontainers MySQL (기본 exclude, -PincludeIntegration 로 opt-in)

Spring Boot 4.0.4: EntityScan 패키지 이동 (boot.autoconfigure.domain → boot.persistence.autoconfigure)
@transactional 클래스 레벨 0건 (ADR-0020 준수)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Phase 1 UseCase 구현:
- CreateStrategyUseCase — 전략 생성 (도메인 팩토리가 INV-07 검증)
- GetStrategyDetailQuery / ListStrategiesQuery — 전략 조회
- RunBacktestUseCase — 백테스트 핵심 파이프라인 (전략 조회 → Run/Slot 저장 → outbox append
  → 엔진 실행 → finalize → ClickHouse best-effort)
- ListBacktestRunsQuery / GetBacktestRunDetailQuery — 결과 조회
- LeaderboardQuery — realizedPnl 절대값 정렬 (OQ-010 해소 전 기본 산식)
- ExecuteLiquidationUseCase — Phase 3 stub (NotImplementedInPhase1Exception)

Supporting:
- StrategyRunPersistenceService — run/slot 초기화·종료 분리 (ADR-0020 준수)
- View DTO 9종 (StrategyDetail/Summary, BacktestRun*, Leaderboard, Slot/Order)
- Exception 3종 (StrategyNotFound, BacktestRunNotFound, NotImplementedInPhase1)

테스트 (7 tests, all green):
- CreateStrategyUseCaseSpec / GetStrategyDetailQuerySpec / RunBacktestUseCaseSpec
- LeaderboardQuerySpec (MockK 기반 UseCase 단위 테스트)

@transactional 클래스 레벨 0건 (ADR-0020)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- StrategyController: POST/GET /api/v1/strategies, GET /{id}, PATCH /{id} (501 stub)
- BacktestController: POST /api/v1/backtests, GET /api/v1/strategies/{id}/runs
- DashboardController: /overview, /executions (백테스트 결과 기반)
- LeaderboardController: GET /leaderboard?limit=N (POST /compare는 501)
- TenantIdHeaderArgumentResolver — X-User-Id → TenantId (@TenantHeader)
- SevenSplitExceptionHandler (@RestControllerAdvice, HIGHEST_PRECEDENCE)
  - ConfigInvalid → 400, StrategyTransition → 409, StopLoss/Leverage → 500
  - NotImplementedInPhase1 → 501, StrategyNotFound → 404, MissingHeader → 400
- WebMvcConfig — resolver 등록
- Request/Response DTO 4종

ApiResponse<T> 래퍼 일관 사용. suspend 컨트롤러 메서드. 실매매 엔드포인트 노출 없음.
컨트롤러 테스트는 TG-15 통합 E2E에서 포괄 (MockMvc + suspend 조합 차후 보강).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- SevenSplitMetrics — 5종 메트릭 노출:
  seven_split_backtest_run_total{status}, _duration_seconds, _strategy_evaluation_latency_seconds,
  _ingest_bithumb_rows_total{symbol}, _outbox_pending_rows (gauge)
- RunBacktestUseCase / BithumbHistoryIngestService — 메트릭 훅 주입 (optional default)
- OutboxJpaRepository.countByPublishedAtIsNull() — Outbox gauge 백킹
- seven-split/CLAUDE.md — 서비스 문서 (Phase 로드맵, Key Rules, OQ blockers)
- seven-split/docs/README.md — 문서 인덱스
- SensitiveDataMaskingSpec — ExchangeCredential / DecryptedCredential toString 마스킹 검증
- 루트 CLAUDE.md Navigation: seven-split 행 추가 (신규, Phase 1 진행 중)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- k8s/base/seven-split/: ServiceAccount + Deployment + Service + kustomization
  - port 8094, probes(readiness/liveness), terminationGrace 60s
  - preStop: sleep 10 (outbox flush)
- k8s/base/kustomization.yaml: seven-split 등록
- k3s-lite overlay는 base 참조로 자동 포함, 기존 글로벌 패치(resources-reduce, startup-probe, ddl-auto-update) 자동 적용

kubectl kustomize 빌드 검증 완료.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Stack:
- React 18 + TypeScript + Vite 6
- Tailwind CSS (mobile-first 5단계 타입 스케일, OKLCH 색상)
- React Router v6 (8 routes + NotFound)
- TanStack Query v5 (서버 상태)
- react-hook-form + zod (폼)
- lightweight-charts (트레이딩 차트, 매수/매도 마커)
- vite-plugin-pwa (manifest + Workbox SW, /api/* NetworkFirst 5분 TTL)
- Pretendard (단일 폰트, AI slop 폰트 회피)

Pages (mobile shell + bottom tab nav 4개):
- HomePage (대시보드 overview)
- StrategyList/Create/DetailPage
- BacktestSubmit/Runs/RunDetailPage (회차별 체결 타임라인 + PnL 분포)
- LeaderboardPage, SettingsPage, NotFoundPage

API client: axios + X-User-Id 자동 주입, ApiResponse<T> unwrap
백엔드 8094 ↔ FE 5173 (dev) / gateway 라우트 (prod)

frontend-design.md 가드레일 준수:
- AI Slop 패턴 금지 (보라 그래디언트, glass, side-stripe, Cardocalypse)
- body 16px 최소, tabular-nums 숫자, 44px hit-target, prefers-reduced-motion
- PnL: 빨강(↑)/파랑(↓) 한국 관습

Build: 541KB JS / 14KB CSS (gzip 170KB / 3.86KB)
PWA precache 9 entries.

spec.md §12: 모바일 웹앱 우선 결정 반영.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- context/exchange-terms.md (Preflight P.0 / OQ-011) — 약관 검토 프레임워크
  자동 fetch 차단 → 사용자 수동 검토 체크리스트 (status: pending-user)
- context/data-ingestion.md (Preflight P.1 / OQ-008) — closed 처리
  TG-07 BithumbHistoryIngestService + ClickHouse 스키마로 종결
- seven-split/docs/phase1-readiness.md — 출고 체크리스트 + 미체크 4건
- docs/specs/.../planning/phase1-release-notes.md — FR/NFR 매핑 + 명시적 미포함 + Phase 2 Preflight 후보
- open-questions.yml — OQ-008 closed, OQ-011 pending-user

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
12개 deep file로 5 Phase 학습 완료:
- Phase 1: 자릿수 사다리 (ns/µs/ms 그룹 + 비율 5개)
- Phase 2: CPU 캐시 / 메모리·SSD·HDD / 네트워크 물리 / tail+fan-out
- Phase 3: redis-cli/curl/ping baseline → wrk/k6 부하 → Prom+Grafana → msa 호출 경로 budget
- Phase 4: 함정 9가지 + 면접 Q&A 트리 6×꼬리2단계 + 실측 스토리 카드
- Phase 5: ADR-0025 초안

연계 학습 순서 결정: 12 → 7 → 9 → 10 → 8 (자릿수 어휘를 다른 주제 토론 베이스라인으로)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
자릿수 기반 (ns/µs/ms) latency budget 표준 채택. msa 호출 경로별 자릿수 라벨 + Tier 1/2/3 P99 budget + 신규 호출 경로 검토 체크리스트 + 위반 시 행동 가이드 + 측정 표준 정의.

- CLAUDE.md Key Conventions 표에 ADR-0025 행 추가
- doc-index.lock.json 갱신 (ADR-0023 정책)

학습 노트 study/docs/12-latency-numbers/ 가 본 ADR의 근거 자료.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ADR-0026 신설 — ADR vs Conventions vs Standards 분류 기준 명문화:
- ADR: 되돌리기 어려운 구조 결정 (서비스/통신/데이터/배포/보안)
- conventions: 코드/설계 작성 규칙 (코드 리뷰 베이스라인)
- standards: 도구/프로세스/검증 정책 (자동화 규칙)
- ops: 운영 SLA / 측정 데이터 기반 living 문서
- 혼합 결정 분해 원칙 + redirect 표준 + 신규 ADR 체크리스트

ADR-0025 분해 (ADR-0026 의 첫 적용 사례):
- ADR-0025: 원칙/정책만 유지 (latency 를 설계 입력으로 강제 + Tier 1 P99 SLA + 측정 표준 채택)
- docs/conventions/latency-budget.md 신설: 자릿수 어휘 / 호출 경로 라벨 / Tier 부록 (living) /
  PR 체크리스트 / 위반 행동 가이드 / 측정 표준 구체 설정 / 함정 9가지

기존 6개 ADR (0014/0016/0020/0021/0022/0023) 은 별도 PR 들로 단계적 정리.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@1989v 1989v merged commit 353b1a9 into main Apr 26, 2026
2 of 4 checks passed
@1989v 1989v deleted the feat/adr-0025-latency-budget branch April 26, 2026 09:51
1989v added a commit that referenced this pull request Apr 28, 2026
Phase 2 신규 산출물:
- docs/specs/2026-04-26-seven-split-phase2-paper-trading/
  - planning/initialization.md (Phase 1 컨텍스트 + 결정사항 + 범위)
  - planning/requirements.md (US-P2-01~11, FR-P2-{WS,HUB,SIM,USE,NOTIF,RES,SEC,FE,OBS}, NFR-P2)
  - planning/test-quality.md (Phase 2 테스트 영역 + INV-P2-* + nightly SLO)
  - planning/spec.md (~460 lines, 20 sections)
  - planning/tasks.md (16 TG + Preflight 2, 157 체크박스)
  - context/open-questions.yml (OQ-P2-001~008)

ADR 신규/수정:
- ADR-0024 Errata: 빗썸 API 2.0 인증 = JWT(HS256) 정정 (HMAC-SHA512 오기 정정)
- ADR-0025: MarketDataHub (SharedFlow primary + optional Kafka fan-out)
- ADR-0026: audit_log 불변성 (ClickHouse seven_split_audit DB + RBAC + prev_hash chain + Kafka mirror)
- ADR-0027: OCI Vault KEK envelope encryption (Port 추상화 + LocalFile dev + stale-on-error)

핵심 결정:
- 시세 이벤트 버스: Coroutine SharedFlow primary + 비동기 Kafka fan-out collector
- KEK 보관: OCI Vault Service (Free Tier) + LocalFileKmsAdapter (dev) + Port 추상화
- audit: 별도 ClickHouse DB + RBAC + prev_hash + Kafka mirror best-effort
- SSE: gateway 확장 + first-message JWT 인증
- replicas=1 강제 (strategy.type=Recreate, Phase 2 단일 인스턴스 가정 보호)

Review-1 후속 정정 적용 (R-CRIT-1~4 + Should-Fix #1/#3/#4)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1989v added a commit that referenced this pull request May 3, 2026
docs(adr): ADR-0025 Latency Budget 표준 + 12번 학습 노트
1989v added a commit that referenced this pull request May 3, 2026
Phase 2 신규 산출물:
- docs/specs/2026-04-26-quant-phase2-paper-trading/
  - planning/initialization.md (Phase 1 컨텍스트 + 결정사항 + 범위)
  - planning/requirements.md (US-P2-01~11, FR-P2-{WS,HUB,SIM,USE,NOTIF,RES,SEC,FE,OBS}, NFR-P2)
  - planning/test-quality.md (Phase 2 테스트 영역 + INV-P2-* + nightly SLO)
  - planning/spec.md (~460 lines, 20 sections)
  - planning/tasks.md (16 TG + Preflight 2, 157 체크박스)
  - context/open-questions.yml (OQ-P2-001~008)

ADR 신규/수정:
- ADR-0024 Errata: 빗썸 API 2.0 인증 = JWT(HS256) 정정 (HMAC-SHA512 오기 정정)
- ADR-0025: MarketDataHub (SharedFlow primary + optional Kafka fan-out)
- ADR-0026: audit_log 불변성 (ClickHouse quant_audit DB + RBAC + prev_hash chain + Kafka mirror)
- ADR-0027: OCI Vault KEK envelope encryption (Port 추상화 + LocalFile dev + stale-on-error)

핵심 결정:
- 시세 이벤트 버스: Coroutine SharedFlow primary + 비동기 Kafka fan-out collector
- KEK 보관: OCI Vault Service (Free Tier) + LocalFileKmsAdapter (dev) + Port 추상화
- audit: 별도 ClickHouse DB + RBAC + prev_hash + Kafka mirror best-effort
- SSE: gateway 확장 + first-message JWT 인증
- replicas=1 강제 (strategy.type=Recreate, Phase 2 단일 인스턴스 가정 보호)

Review-1 후속 정정 적용 (R-CRIT-1~4 + Should-Fix #1/#3/#4)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1989v added a commit that referenced this pull request May 3, 2026
docs(adr): ADR-0025 Latency Budget 표준 + 12번 학습 노트
1989v added a commit that referenced this pull request May 3, 2026
Phase 2 신규 산출물:
- docs/specs/2026-04-26-quant-phase2-paper-trading/
  - planning/initialization.md (Phase 1 컨텍스트 + 결정사항 + 범위)
  - planning/requirements.md (US-P2-01~11, FR-P2-{WS,HUB,SIM,USE,NOTIF,RES,SEC,FE,OBS}, NFR-P2)
  - planning/test-quality.md (Phase 2 테스트 영역 + INV-P2-* + nightly SLO)
  - planning/spec.md (~460 lines, 20 sections)
  - planning/tasks.md (16 TG + Preflight 2, 157 체크박스)
  - context/open-questions.yml (OQ-P2-001~008)

ADR 신규/수정:
- ADR-0024 Errata: 빗썸 API 2.0 인증 = JWT(HS256) 정정 (HMAC-SHA512 오기 정정)
- ADR-0025: MarketDataHub (SharedFlow primary + optional Kafka fan-out)
- ADR-0026: audit_log 불변성 (ClickHouse quant_audit DB + RBAC + prev_hash chain + Kafka mirror)
- ADR-0027: OCI Vault KEK envelope encryption (Port 추상화 + LocalFile dev + stale-on-error)

핵심 결정:
- 시세 이벤트 버스: Coroutine SharedFlow primary + 비동기 Kafka fan-out collector
- KEK 보관: OCI Vault Service (Free Tier) + LocalFileKmsAdapter (dev) + Port 추상화
- audit: 별도 ClickHouse DB + RBAC + prev_hash + Kafka mirror best-effort
- SSE: gateway 확장 + first-message JWT 인증
- replicas=1 강제 (strategy.type=Recreate, Phase 2 단일 인스턴스 가정 보호)

Review-1 후속 정정 적용 (R-CRIT-1~4 + Should-Fix #1/#3/#4)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1989v added a commit that referenced this pull request May 4, 2026
19-search-engine 의 99-catalog 패턴을 다른 18개 학습 주제로 확장.
각 catalog 는 공식 reference (Apache/JDK/IETF/RFC/cloud docs) 기준:
- §1 기존 deep file 매트릭스 + 갭 진단
- §2 카테고리별 개념 트리 (✅ 커버 / 🟡 부분 / ★ 신규 / skip)
- §3 우선 심화 후보 Top-N
- §4 표준 deep-dive 템플릿 (19/99 §4 재사용)
- §5 참고 자료

특징:
- #1 AWS — VPC/PrivateLink/TGW/Route53/Network Firewall/Global Accelerator/IPAM
- #2 JVM — JDK 21+ Generational ZGC/CRaC/Leyden/Lilliput/JEP 트래커
- #3 동시성 — Loom Structured Concurrency/Scoped Values/VarHandle/Flow operators
- #4 DB — Window/CTE/Generated columns/Partitioning/PG MVCC/Replication
- #5 Spring TX — REQUIRES_NEW connection 점유/AbstractRoutingDataSource/Reactive TX
- #6 Kafka — KRaft/Tiered Storage/Streams DSL/Schema Registry/Connect SMT
- #7 분산 — Quorum/Gossip/Service Mesh/Saga/CRDT cross/Chaos Engineering
- #8 시스템 설계 — 30+ 표준 시나리오 + 14개 핵심 의사결정 카드
- #9 Redis — Stream Consumer Group/Functions/RESP3/Client Caching/Modules
- #10 Observability — OTel Collector/Continuous Profiling/eBPF/SLO Burn Rate
- #11 K8s — Gateway API/KEDA/Karpenter/Cilium/ValidatingAdmissionPolicy
- #12 Latency — Tail at Scale/Little's Law/HdrHistogram/CRaC/io_uring
- #13 Crypto — OAuth 2.1/DPoP/PASETO/AEAD nonce/Post-Quantum (Kyber/Dilithium)
- #14 CRDT — δ-CRDT/Tree CRDT (Move op)/Loro/Local-first
- #15 Pool — PgBouncer/RDS Proxy/R2DBC pool/Lettuce ClusterClientOptions
- #16 Async — io_uring/Reactor Context/Netty ByteBuf/Loom vs Reactive
- #17 Spring Web — VirtualThread executor/ProblemDetail/HTTP Interface clients
- #18 gRPC — Buf workflow/xDS/ConnectRPC/Health protocol/Service config

19-INDEX / temp.md 의 19 주제 카드에 99-catalog 표기 동기화.

Phase B: 18개 catalog 합 4,180 줄 (#19 catalog 581 줄 별도)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1989v added a commit that referenced this pull request May 4, 2026
…og 67 ✅ 변환

신규 deep file 27건 (~22,000줄), 12 토픽 분야:

#1 AWS Network (+2):
- 20-ipv6-ipam-byoip.md (692줄) — IPv6 dual-stack / Egress-only IGW / IPAM / BYOIP / public IPv4 비용 회피
- 21-dns-dhcp-sg-deep.md (810줄) — DHCP options / DNS resolution 함정 / SG ↔ SG references / VPC Lattice

#3 Concurrency (+1):
- 25-virtual-thread-coroutine-deep.md (745줄) — Java 21 Virtual Thread (Loom) vs Kotlin Coroutine 심화 비교 / Pinning / structured concurrency

#4 DB (+2):
- 20-online-ddl-deep.md (754줄) — MySQL INSTANT/INPLACE/COPY / gh-ost / pt-online-schema-change / Postgres CONCURRENTLY
- 21-deadlock-anti-patterns.md (800줄) — wait-for graph / SHOW ENGINE INNODB STATUS / SKIP LOCKED / 회피 패턴

#6 Kafka (+4):
- 14-kraft-tiered-storage.md (699줄) — KRaft 4.0 / Tiered Storage S3 / Cruise Control
- 15-rebalance-protocols.md (832줄) — Cooperative (KIP-429) / Static (KIP-345) / Consumer Group Protocol (KIP-848)
- 16-log-compaction-tombstone.md (881줄) — Compaction / Tombstone / Mixed / KTable backing
- 17-streams-api-kstream-ktable.md (762줄) — KStream/KTable/GlobalKTable / EOS V2 / DSL operators / State store

#7 Distributed Systems (+2):
- 21-consensus-raft-paxos.md (664줄) — FLP / Paxos / Raft / Multi-Raft / PBFT
- 22-saga-compensation-deep.md (757줄) — Choreography vs Orchestration / TCC / Temporal / Outbox+Inbox

#8 System Design (+4 시나리오 카드):
- 14-realtime-search-autocomplete.md (450줄) — 한국어 자동완성 시스템
- 15-distributed-counter-impressions.md (473줄) — 광고 노출/클릭 카운팅
- 16-payment-idempotency.md (550줄) — 결제 멱등성 (Idempotency-Key + Outbox + Saga)
- 17-iot-telemetry-pipeline.md (595줄) — IoT 텔레메트리 (MQTT + Kafka + ClickHouse + S3 cold tier)

#10 Observability (+2):
- 15-prometheus-internals.md (974줄) — TSDB / WAL / XOR compression / Federation / Mimir/Cortex/Thanos
- 16-opentelemetry-deep.md (1,229줄) — OTel SDK / Collector / W3C Trace Context / OTLP / Sampling / Exemplar

#11 K8s (+3):
- 18-operator-pattern-crd.md (1,001줄) — Operator + CRD / Reconcile loop / Finalizer / msa Operator 6종 grounding
- 19-gitops-argocd-flux.md (1,058줄) — Argo CD / Flux / ApplicationSet / SealedSecrets / SOPS / ESO
- 20-canary-bluegreen-argo-rollouts.md (1,020줄) — Argo Rollouts / AnalysisTemplate / msa Tier 매트릭스

#12 Latency (+1):
- 13-modern-hardware-latency.md (877줄) — NVMe / DDR5 / Cloud / Lambda cold start / DB / 벡터 / GPU 자릿수

#13 Crypto/JWT/SSO (+4):
- 21-aead-nonce-key-derivation.md (753줄) — AEAD nonce 함정 / AES-GCM-SIV / HKDF / CSPRNG / Crypto-agility
- 22-jwt-pitfalls-zero-trust.md (932줄) — alg=none CVE / 0-RTT replay / DPoP / mTLS-bound / token rotation
- 23-mtls-mesh-cert-rotation.md (878줄) — mTLS mesh (Istio/Linkerd) / SPIFFE/SPIRE / OCSP / CT log
- 24-post-quantum-crypto.md (771줄) — Kyber/Dilithium/SPHINCS+/Falcon / Hybrid TLS / 마이그레이션 전략

#14 CRDT (+1):
- 20-crdt-types-deep.md (703줄) — G/PN-Counter / G/2P/OR-Set / LWW/MV-Register / RGA/Logoot/Treedoc / Y.js/Automerge

#16 Async I/O (+1):
- 20-reactor-netty-pipeline-deep.md (898줄) — Mono/Flux / Backpressure / Schedulers / Netty pipeline / WebFlux 내부

99-catalog 갱신 (12 토픽):
- §1 매트릭스에 27 신규 deep file 행 추가
- ★ 신규 / 🟡 부분 → ✅ 커버 변환 67 행 (#13:19 / #6:22 / #1:9 / #11:10 / #10:21 / #4:1 / #7:5 / #14:2 / #3:5 / #16:6 / #8:2)

ADR 후보 24건 추가 (00-ADR-CANDIDATES.md §12):
- 즉시 8: A2 / K2 / O2 / C1 / C2 / D1 / D2 / CO1
- 분기 11: A1 / K1 / K3 / O1 / K5 / K6 / K7 / C3 / DS2 / IO1 / LN1
- 반기 3: K4 / CC1 / C4
- cross-cutting 결합 후보 3 (mTLS+Zero-Trust / Outbox+Saga / 3-pillar Observability)

master 인덱스 동기화:
- 00-INDEX: 12 토픽 카운트 갱신 + 합계 421 → 448 file / 123,720 → 145,358 line
- 00-INTERVIEW-INDEX: 신규 ~150 카드 예상 (840 → 990)
- temp.md: 전체 통계 동기화 (456 .md / 145,358 line)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1989v added a commit that referenced this pull request May 17, 2026
리뷰어 지적 10건 중 9건 반영 (docs-health 는 별도 도메인이라 제외).

[HIGH] #1 submodule pointer bump 감지 누락
  case 'auth/*' 만 매칭하면 'auth' (bare name, submodule pointer diff path) 가
  스킵됨 → submodule-bump 가 push 한 commit 으로 이미지 재빌드 안됨.
  fix: 'auth|auth/*)' 'gifticon|gifticon/app/*|gifticon/domain/*)' 로 확장.

[HIGH] #5 tag push 의 commit-back 위험
  refs/tags/v* push 는 detached HEAD → git push to main 실패.
  fix: commit-back step 에 if: github.ref == 'refs/heads/main' 추가.

[MEDIUM] #7 조기 종료가 실제 step 만 종료, job 안 끝남
  변경 없음 step 의 exit 0 다음에도 OCIR login / yq install 등 실행됨.
  fix: 후속 step 들에 if: steps.changes.outputs.kustomize_services != '' 추가.

[MEDIUM] #2 PR 검증 약함 — compile gate 복귀
  ci.yml 에 compile-gate job 추가 — ./gradlew compileKotlin compileJava.
  test 는 부담 커서 제외 (images.yml 에서 jib 가 빌드 검증함).
  kustomize-validate 와 병렬 실행.

[MEDIUM] #6 hang 방지
  모든 job 에 timeout-minutes 추가:
  - images publish: 60m
  - submodule-bump: 10m
  - ci compile-gate: 20m
  - ci kustomize-validate: 5m

[LOW] #10 워크플로 README 갱신
  옛 build/jib-build 설명 → 현재 구현 (compile-gate + incremental images + OCIR).

[LOW] #3 GitHub App token scope 재활성
  v3 의 repositories: 옵션으로 msa/msa-auth/msa-gifticon 만 토큰 발급.
  최소권한 원칙 + App 이 위 3개에 정확히 설치돼있어야 동작 (현재 OK).

[LOW] #4 create-github-app-token v1 → v3
  현재 maintenance. 사용 인자 (app-id/private-key) 동일이라 무중단 migration.

(별도) #8 Argo placeholder 흐름은 이미 application.yaml + install.sh 로 처리됨.
(스킵) #9 docs-health 권한은 별도 도메인 — 이번 commit 범위 외.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1989v added a commit that referenced this pull request Jun 30, 2026
- 게이트웨이: /api/v1/game/** → commerce:8085 (게스트 공개, app-level 닉네임 게이트)
- 정적 서빙: game:web 번들(game.js + index.html)을 commerce:app static/game/ 으로 패키징 → /game/ 서빙
- 라이브 E2E(game:feature): testcontainers Redis + 임베디드 Tomcat + JDK HttpClient
  · 세션 시작→결정적 플레이→제출→Tier A→Redis ZSET 리더보드→in-JVM Tier B 리플레이→CONFIRMED #1
  · 같은 리플레이 점수 위조 → Tier B REJECTED  (tests=2 green)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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