Files
clean-architecture-backend-…/src/app-bootstrap/src/main/resources/application-local.yml
T
DongHyeonkaandClaude Opus 5.5 6d27356e2b refactor: 부가 기능을 capability 모듈로 포장하고 기본 조립을 web-only로 전환
설계: docs/superpowers/specs/2026-09-25-capability-module-packaging-design.md
계획/진행 기록: docs/superpowers/plans/2026-09-25-capability-module-packaging.md

- Wave 0: 규칙 고정(AGENTS.md capability 완료 기준·테스트 규칙) + 차단 결함 7건
  (compose overlay 검사, redis-sdk CI job, 적용된 V9/V13 원복 + V16, @EnableScheduling,
  messaging bridge 순서, prod 에러 상세 validator, sample loggers read-only)
- Wave 1: 데이터·보안 Critical 10건 (durable operation 25P02, operation 유스케이스 이동,
  outbox 재인코딩, Kafka TLS/SASL, 알림 트랜잭션, SNS 서명, tus checksum, GraphQL fragment,
  Redis lane, gRPC FAILED_TERMINAL)
- Wave 2: 리팩터링 잔재·실험용 자리 삭제, outbox v1 fencing(V17), 멱등성 V2 정본화
- Wave 3: 라이브러리형 코드 정리(동작하지 않는 설정·인터페이스·gate 제거, web-advanced 분리)
- Wave 4: capability 11개를 "있으면 켜짐" 모듈로 포장, 끄는 장치 제거, 기본 조립 web-only,
  qualificationBootJar 분리
- Wave 5: 빌드 로직 축소(17.2k -> 10.8k줄), sample 테스트 컨벤션 적용

삭제한 코드는 docs/capability-status.md "제거된 코드" 표에 복구 커밋(208077fd)과 함께 기록.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 12:49:07 +09:00

204 lines
9.5 KiB
YAML

# =============================================================================
# local profile — in-memory H2, no external infrastructure, no environment.
#
# This file is a complete standalone configuration, not a patch. application.yml resolves ~70
# values from ${APP_*} placeholders that carry no inline default, so a launcher that does not
# inject src/.env dies during property binding — and because logback-spring.xml reads the same
# unresolved ca-skeleton.logging.* values, the logging system fails first and swallows the console
# output that would have said so. The observable symptom is a process that exits 1 having printed
# nothing.
#
# Only `./gradlew :app-bootstrap:bootRun` injects src/.env (see app-bootstrap/build.gradle). An IDE
# Run/Debug on CaSkeletonApplication, `java -jar`, and a bare container do not. Restating the
# required values here is what makes "local needs nothing" true for every launcher rather than for
# one Gradle task.
#
# The placeholders stay in application.yml untouched: dev and prod must keep failing loudly when an
# operator forgets a value. Local is the profile allowed to have answers of its own.
# ProfileSeparationContractTest#localProfileAnswersEveryRequiredPlaceholder fails the build when
# application.yml grows a required placeholder this file does not cover.
#
# What local verifies: wiring, request/response behaviour, application logic.
# What it does not: migrations and vendor behaviour — the schema here comes from the JPA entities,
# and the dev/prod path is the one Flyway proves.
# =============================================================================
spring:
application:
name: ca-skeleton
web:
error:
include-stacktrace: never
include-message: never
datasource:
# MODE=PostgreSQL keeps H2's dialect and semantics as close to the deployed vendor as H2 gets;
# DATABASE_TO_LOWER matches PostgreSQL's unquoted-identifier folding so the native SQL in the
# vendor adapters resolves the same table and column names in both.
#
# DB_CLOSE_DELAY=-1 is load-bearing, not decoration: an in-memory database is dropped when its
# last connection closes, and HikariCP closes idle connections. Without it the schema
# disappears mid-run the first time the pool goes idle.
#
# Placeholders, not literals. Pinned literally, these outranked every environment a caller
# supplied: a smoke lane could start PostgreSQL, wire the application to it, watch the pool open
# and the health check pass — against the in-memory database this file chose instead. Nothing in
# the report distinguished the two, which is what made it a false green rather than a failure.
#
# The defaults now point at the Compose PostgreSQL this repository ships (JPA-INT-003), so
# `local` with JPA on has the same vendor, migration mode and schema owner as `dev` and differs
# only in address and credential. H2 was the default here, which meant "it works locally" was a
# statement about a different database than the one every other environment runs: migrations
# never applied, ddl-auto wrote the schema from the entities, and a mapping that disagreed with
# the migration tree could not be discovered until a real PostgreSQL saw it. It was, twice this
# wave — fs_cleanup_item and request_hash.
#
# H2 is still available and now has to be asked for: `./gradlew :app-bootstrap:bootRunH2`.
url: ${APP_DATASOURCE_URL:jdbc:postgresql://localhost:5433/ca_skeleton}
username: ${APP_DATASOURCE_USERNAME:ca_skeleton}
password: ${APP_DATASOURCE_PASSWORD:ca_skeleton}
driver-class-name: ${APP_DATASOURCE_DRIVER:org.postgresql.Driver}
hikari:
maximum-pool-size: 10
minimum-idle: 2
# Milliseconds. Must stay above the 3000 ms validation-timeout pinned in application.yml
# (HIKARI-CFG-C6), which HikariPoolConstraintValidator enforces at startup.
connection-timeout: 30000
idle-timeout: 600000
max-lifetime: 1800000
flyway:
# On, because the default vendor is now the same PostgreSQL dev and prod run. Flyway owns the
# schema from local onward; that is what makes a migration that disagrees with a mapping a local
# failure instead of a production one.
#
# The H2 developer task turns it off, and must: the migration tree is PostgreSQL DDL — DO $$
# blocks and all — with nothing for Flyway to apply against H2, and with Flyway on and no vendor
# location override it falls back to classpath:db/migration and walks the PostgreSQL tree.
enabled: ${APP_FLYWAY_ENABLED:true}
jpa:
hibernate:
# validate, like dev and prod: Flyway owns the schema and Hibernate checks that the mapping
# agrees with it. create-drop was the H2 default and is what hid two mapping/migration
# disagreements this wave — a vendor that generates the schema from the entities cannot report
# a mismatch with them. The H2 developer task restores create-drop, which is only safe there
# because that database dies with the process.
ddl-auto: ${APP_DATASOURCE_DDL_AUTO:validate}
show-sql: false
open-in-view: false
properties:
hibernate:
format_sql: false
security:
oauth2:
resourceserver:
jwt:
# The local Keycloak realm. Startup does not contact it — Spring defers JWKS resolution to
# first use — so an unauthenticated call such as GET /api/healthcheck works with no IdP
# running at all. Authenticated calls need it up.
#
# A placeholder, not a literal. localhost:8081 is right for a developer running the jar on
# the host with Keycloak published there, and wrong for every containerized local
# deployment: inside the app container localhost is the app, so it fetched JWKS from
# itself and every authenticated request answered AUTH_JWKS_UNAVAILABLE. A literal here
# outranks the environment, so the Compose lane supplied the correct issuer and was
# ignored — the same shape as the datasource a profile used to pin.
issuer-uri: ${APP_SECURITY_JWT_ISSUER:http://localhost:8081/realms/ca-skeleton}
audiences: ${APP_SECURITY_JWT_AUDIENCE:ca-skeleton-api}
main:
banner-mode: console
lazy-initialization: false
log-startup-info: true
threads:
virtual:
enabled: true
jackson:
deserialization:
fail-on-unknown-properties: true
fail-on-null-for-primitives: true
fail-on-ignored-properties: true
datatype:
enum:
read-unknown-enum-values-as-null: false
datetime:
write-dates-as-timestamps: false
lifecycle:
timeout-per-shutdown-phase: 30s
server:
port: 8080
shutdown: graceful
# No proxy in front of a local run, so trusting X-Forwarded-* would let a caller forge its own
# client IP. dev/prod sit behind a load balancer and set this to framework via env.
forward-headers-strategy: none
tomcat:
threads:
max: 200
min-spare: 10
accept-count: 100
max-connections: 8192
connection-timeout: 20s
compression:
enabled: true
min-response-size: 1024
logging:
level:
root: INFO
dev.caskeleton: DEBUG
org.springframework: INFO
org.springframework.web: INFO
org.hibernate.SQL: WARN
ca-skeleton:
persistence:
# PostgreSQL, like dev and prod. The claim SQL, SQLState rows and timeout guards differ per
# vendor even though the ports do not, so a local run on H2 exercised different code from the one
# that ships. The H2 developer task selects H2PersistenceConfig explicitly.
vendor: ${APP_PERSISTENCE_VENDOR:postgresql}
bootstrap:
app-name: ca-skeleton
presentation:
# Pinned even though application.yml has an inline default, because the default is /v1 and
# src/.env says /api. Everything that names a URL in this repository — SECURITY_PUBLIC_PATHS,
# the compose healthchecks, bootstrapSmoke, the README curl — assumes /api, so a launcher that
# missed src/.env served /v1/healthcheck and answered 401 on the address the docs give.
api-base-path: /api
privacy:
# A blank salt makes PrivacySettings warn and fall back to a dev sentinel. Naming the dev value
# keeps the local pseudonymization stable across runs and keeps the warning for deployments
# that really did forget to supply one.
pseudonymization-salt: __LOCAL_DEV_pseudonymization_salt
security:
# Placeholders for the reason above: the two blocks must agree, and a literal in either one is
# a value a deployment cannot correct.
issuer-uri: ${APP_SECURITY_JWT_ISSUER:http://localhost:8081/realms/ca-skeleton}
audience: ${APP_SECURITY_JWT_AUDIENCE:ca-skeleton-api}
public-paths: /api/healthcheck
cors:
enabled: true
allowed-origins: http://localhost:3000
# Empty = the default method set (GET, POST, PATCH, PUT, DELETE, OPTIONS).
allowed-methods: ""
allowed-headers: "*"
allow-credentials: true
max-age-seconds: 3600
logging:
file:
# Console only. A local run should not quietly grow a logs/ directory in the working
# directory, which differs between a Gradle run and an IDE run.
enabled: false
path: logs/ca-skeleton.json
max-size: 100MB
max-history: 14
total-size-cap: 3GB
async:
enabled: true
queue-size: 512
discarding-threshold: 20
json:
timezone: UTC
timestamp-pattern: "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"
include-caller-data: false
logger-name-length: 0
# Keep every log line locally; prod samples <=INFO down to 10%.
sampling-rate: 1.0