[상류 구현] P50 SQLite reader pool startup-only opt-in override #216

Closed
opened 2026-10-29 23:01:38 +09:00 by dreampiler · 6 comments
Owner

원 요구·승인

소유자 직접 지시(운영 대화 2026-10-29, 원문): 「P50·P52b는 maintainer 답변만 기다리지 말고, 지금 권장한 안전한 범위로 상류 제출용 최소 패치를 구현·검증해줘. 답변이 꼭 필요한 부분만 분리해 남기고, 운영판 반영 전에는 변경 내용과 검증 결과를 알려줘.」 승인된 권장안(P50): 기본 reader 4와 실제 DB 오류의 즉시 보호를 유지하고, 선택적 startup-only reader override와 probe 정책을 분리한다. 이 task는 P50의 상류 제출용 구현 단위의 단일 source writer다. 원 준비 단위(queue KANDEV-UPSTREAM-P50-20261014-project, wrapper 43e729fa, 원 준비 118de34d — 현재 등록 DB에 없음, 준비 flow closed)는 다시 열지 않고 입력으로만 쓴다.

입력

  • 원 fork commit 6ebbeeb119(reader pool, 기본 12 + env)·476b1313bc(probe hysteresis 5s+3회). 방향 질문 #4120 comment 6180444753(답 없음). 상류 #4428(option-1 root cause, projector 게이트) 병합됨.
  • 2026-10-14 관측: upstream sqlite.go:33 defaultSQLiteReaderConns=4·override 없음, health.go:24 probeTimeout=2s·1회 실패 즉시 기록(health.go:99-106 → tracker.go:111-131). 93이 2026-10-29T12:53:18Z wrapper Plan 43e729fa에 current main 012fb3c04069 대조를 저장했다 — 그것을 먼저 읽고 현재 main으로 다시 확인한다.
  • 정본: projects/260926_Kandev/_Prj_Work/p330_jobsheets/KANDEV-UPSTREAM-P50-20261014-project.md, _UserHub/_task/kandev-ops/261020_codex-ops-diagnostics.md 21:55 결과.

할 일 (원자 변경 1개)

  1. 현재 유효한 upstream main에서 깨끗한 자기 Native 사본을 만든다(공용 checkout·운영 사본·남의 dirty source/branch 쓰기 0).
  2. 기본 reader 4는 그대로 두고, startup-only opt-in reader pool 설정을 구현한다. 기존 설정 관례(env parsing·range·error 정책)를 따르고, open/idle 설정을 일관되게 맞춘다. 원 fork의 기본 12는 가져오지 않는다. threshold·timeout 완화나 probe hysteresis는 이번 패치에서 분리한다. startup·missing store·closed pool·destructive·실제 storage fault의 즉시 fail-closed는 그대로 유지한다.
  3. 증명할 것: 기본 4, 정상 opt-in, 잘못된 값·범위 거부, 실제 open/idle 적용, 기존 fail-closed 보존. 기존 관련 test 파일과 좁은 build를 재사용한다. 일회성 확인은 자동 수집 밖 임시 위치에서 하고 끝나면 정리한다. 새 상시 test 파일·framework 0.
  4. 상류 pr-docs.cjs validateCoverage를 로컬로 돌려 필요한 최소 linked work order를 확인한다. normal hooks, 바뀐 delta만 gate workflow rv-run, 필수 지적만 고친다.
  5. 결과(branch·base/head·diffstat·commit, 검증 이름·결과, 미결 계약 — 선택하지 않은 probe 정책은 정확한 미결로 남김)를 8e/current 96e9d7f4-0840-479a-b7b6-3e18d45b4da4에 1회.

경계

운영판 반영·교체·재시작 0, 운영 DB write 0, 공개 PR/issue/comment/push 0(공개는 이후 93→5d 정책으로 별도 판단). 새 권한·역할·schema·비밀·설정 잠금 우회 0. 모델·동적 순서·한도 변경 0. 같은 통합 파일·Git ref에 다른 writer 0.

## 원 요구·승인 소유자 직접 지시(운영 대화 2026-10-29, 원문): 「P50·P52b는 maintainer 답변만 기다리지 말고, 지금 권장한 안전한 범위로 상류 제출용 최소 패치를 구현·검증해줘. 답변이 꼭 필요한 부분만 분리해 남기고, 운영판 반영 전에는 변경 내용과 검증 결과를 알려줘.」 승인된 권장안(P50): 기본 reader 4와 실제 DB 오류의 즉시 보호를 유지하고, 선택적 startup-only reader override와 probe 정책을 분리한다. 이 task는 P50의 상류 제출용 구현 단위의 단일 source writer다. 원 준비 단위(queue KANDEV-UPSTREAM-P50-20261014-project, wrapper 43e729fa, 원 준비 118de34d — 현재 등록 DB에 없음, 준비 flow closed)는 다시 열지 않고 입력으로만 쓴다. ## 입력 - 원 fork commit 6ebbeeb119(reader pool, 기본 12 + env)·476b1313bc(probe hysteresis 5s+3회). 방향 질문 #4120 comment 6180444753(답 없음). 상류 #4428(option-1 root cause, projector 게이트) 병합됨. - 2026-10-14 관측: upstream sqlite.go:33 defaultSQLiteReaderConns=4·override 없음, health.go:24 probeTimeout=2s·1회 실패 즉시 기록(health.go:99-106 → tracker.go:111-131). 93이 2026-10-29T12:53:18Z wrapper Plan 43e729fa에 current main 012fb3c04069 대조를 저장했다 — 그것을 먼저 읽고 현재 main으로 다시 확인한다. - 정본: projects/260926_Kandev/_Prj_Work/p330_jobsheets/KANDEV-UPSTREAM-P50-20261014-project.md, _UserHub/_task/kandev-ops/261020_codex-ops-diagnostics.md 21:55 결과. ## 할 일 (원자 변경 1개) 1. 현재 유효한 upstream main에서 깨끗한 자기 Native 사본을 만든다(공용 checkout·운영 사본·남의 dirty source/branch 쓰기 0). 2. 기본 reader 4는 그대로 두고, startup-only opt-in reader pool 설정을 구현한다. 기존 설정 관례(env parsing·range·error 정책)를 따르고, open/idle 설정을 일관되게 맞춘다. 원 fork의 기본 12는 가져오지 않는다. threshold·timeout 완화나 probe hysteresis는 이번 패치에서 분리한다. startup·missing store·closed pool·destructive·실제 storage fault의 즉시 fail-closed는 그대로 유지한다. 3. 증명할 것: 기본 4, 정상 opt-in, 잘못된 값·범위 거부, 실제 open/idle 적용, 기존 fail-closed 보존. 기존 관련 test 파일과 좁은 build를 재사용한다. 일회성 확인은 자동 수집 밖 임시 위치에서 하고 끝나면 정리한다. 새 상시 test 파일·framework 0. 4. 상류 pr-docs.cjs validateCoverage를 로컬로 돌려 필요한 최소 linked work order를 확인한다. normal hooks, 바뀐 delta만 gate workflow rv-run, 필수 지적만 고친다. 5. 결과(branch·base/head·diffstat·commit, 검증 이름·결과, 미결 계약 — 선택하지 않은 probe 정책은 정확한 미결로 남김)를 8e/current 96e9d7f4-0840-479a-b7b6-3e18d45b4da4에 1회. ## 경계 운영판 반영·교체·재시작 0, 운영 DB write 0, 공개 PR/issue/comment/push 0(공개는 이후 93→5d 정책으로 별도 판단). 새 권한·역할·schema·비밀·설정 잠금 우회 0. 모델·동적 순서·한도 변경 0. 같은 통합 파일·Git ref에 다른 writer 0.
Author
Owner

8e receiving acceptance (local upstream-submission candidate; no operations or publication): ACCEPT P50 startup-only SQLite reader pool override (task 7f8e02c5-316d-43d6-a6f6-5b80c4dbbd17, single writer). 8e read-only checks: worktree kandev-upstream-p50_vyod28a3 branch feature/kandev-upstream-p50-8f3 HEAD 505f09e700d4cc5b139f73c8e850a2619503066c, clean, base upstream/main da9ff633286318315da2cb7af24cf907ed737c5a, 3 commits (7718b524923 feature, a1392d43f85 scope to SQLite driver, 505f09e700d defer SQLite reader YAML parsing until driver selection), 12 files +422/-6: config catalog/config/source/validation, db/sqlite.go, persistence/provider.go, catalog_test.go (one audited-inventory line only), docs/plans/sqlite-reader-pool plan + task-01, requirement + system design, docs/public/configuration.md. Behaviour: database.sqliteReaderConns / KANDEV_SQLITE_READER_CONNS, default 4, range 1..64, startup-only, env over YAML; parsed only after the SQLite driver is selected, so PostgreSQL ignores nonnumeric/out-of-range/absent values and starts while SQLite rejects them; OpenSQLiteReaderWithConns sets MaxOpen and MaxIdle together; writer pool, required-store probe and immediate fail-closed unchanged; no fork default 12. Review: first RV CALL-20261030-6fff020fcc5e REQUEST_CHANGES (typed YAML unmarshal before driver selection could fail PostgreSQL startup) fixed; re-review FORMAL-261029_p50-reader-pool-review.md-1793288775106769300-33172-mid-1 (CALL-20261030-d7c21d988b87) completed APPROVE findings 0 (8e read). Verification per source: one-shot Go overlay outside the repo for PostgreSQL YAML many/65/absent x env many/65/empty success and SQLite many/65/0 rejection, deleted after; existing db and requiredstores tests, build, vet, lint, spec/docs lint and pr-docs validateCoverage covered pass; no new standing behaviour test. Open contract: P50b probe timeout/hysteresis/contention classification excluded, needs #4120 direction. No push/PR/comment, no operational change.

8e receiving acceptance (local upstream-submission candidate; no operations or publication): ACCEPT P50 startup-only SQLite reader pool override (task 7f8e02c5-316d-43d6-a6f6-5b80c4dbbd17, single writer). 8e read-only checks: worktree kandev-upstream-p50_vyod28a3 branch feature/kandev-upstream-p50-8f3 HEAD 505f09e700d4cc5b139f73c8e850a2619503066c, clean, base upstream/main da9ff633286318315da2cb7af24cf907ed737c5a, 3 commits (7718b524923 feature, a1392d43f85 scope to SQLite driver, 505f09e700d defer SQLite reader YAML parsing until driver selection), 12 files +422/-6: config catalog/config/source/validation, db/sqlite.go, persistence/provider.go, catalog_test.go (one audited-inventory line only), docs/plans/sqlite-reader-pool plan + task-01, requirement + system design, docs/public/configuration.md. Behaviour: database.sqliteReaderConns / KANDEV_SQLITE_READER_CONNS, default 4, range 1..64, startup-only, env over YAML; parsed only after the SQLite driver is selected, so PostgreSQL ignores nonnumeric/out-of-range/absent values and starts while SQLite rejects them; OpenSQLiteReaderWithConns sets MaxOpen and MaxIdle together; writer pool, required-store probe and immediate fail-closed unchanged; no fork default 12. Review: first RV CALL-20261030-6fff020fcc5e REQUEST_CHANGES (typed YAML unmarshal before driver selection could fail PostgreSQL startup) fixed; re-review FORMAL-261029_p50-reader-pool-review.md-1793288775106769300-33172-mid-1 (CALL-20261030-d7c21d988b87) completed APPROVE findings 0 (8e read). Verification per source: one-shot Go overlay outside the repo for PostgreSQL YAML many/65/absent x env many/65/empty success and SQLite many/65/0 rejection, deleted after; existing db and requiredstores tests, build, vet, lint, spec/docs lint and pr-docs validateCoverage covered pass; no new standing behaviour test. Open contract: P50b probe timeout/hysteresis/contention classification excluded, needs #4120 direction. No push/PR/comment, no operational change.
Author
Owner

8e 수락(최종 head): 7f8e02c5 결과 agent-delivery-e2372a30fac698904be581a7ac8344b3. 8e 원본 readback - worktree kandev-upstream-p50_vyod28a3 branch feature/kandev-upstream-p50-8f3 HEAD e6afca97c3e1 clean, base da9ff6332863, 5 commits(7718b52 a1392d4 505f09e a828e38 e6afca9), 12 files +443/-6. delta 505f09e..e6afca9 6 files +59/-38: applySQLiteReaderConns가 driver 확정 뒤 env present(빈 값 포함)면 env만 엄격 파싱, env 부재 시 YAML 엄격 파싱, invalid env는 YAML fallback 없음, PostgreSQL은 양쪽 무시 - 코드 확인. go test ./internal/common/config -run Reader|SQLite|Catalog PASS(8e 재실행). pr-docs validateCoverage covered. RV-RUN-...-1793292300573991800-35197-mid-1 APPROVE findings 0, review artifact가 e6afca97 기재. 미결 P50b probe timeout/hysteresis/contention과 #4120 질문은 공개 범위 밖 유지. 다음: 93->5d 독립 새 PR(중복 0), 게시 readback 뒤 close-item.

8e 수락(최종 head): 7f8e02c5 결과 agent-delivery-e2372a30fac698904be581a7ac8344b3. 8e 원본 readback - worktree kandev-upstream-p50_vyod28a3 branch feature/kandev-upstream-p50-8f3 HEAD e6afca97c3e1 clean, base da9ff6332863, 5 commits(7718b52 a1392d4 505f09e a828e38 e6afca9), 12 files +443/-6. delta 505f09e..e6afca9 6 files +59/-38: applySQLiteReaderConns가 driver 확정 뒤 env present(빈 값 포함)면 env만 엄격 파싱, env 부재 시 YAML 엄격 파싱, invalid env는 YAML fallback 없음, PostgreSQL은 양쪽 무시 - 코드 확인. go test ./internal/common/config -run Reader|SQLite|Catalog PASS(8e 재실행). pr-docs validateCoverage covered. RV-RUN-...-1793292300573991800-35197-mid-1 APPROVE findings 0, review artifact가 e6afca97 기재. 미결 P50b probe timeout/hysteresis/contention과 #4120 질문은 공개 범위 밖 유지. 다음: 93->5d 독립 새 PR(중복 0), 게시 readback 뒤 close-item.
Author
Owner

P50 reader pool 상류 후보 구현·검증·RV·인계 완료.

  • branch feature/kandev-upstream-p50-8f3 (보존), base da9ff633286318315da2cb7af24cf907ed737c5a, head e6afca97c3e1654065223602acfa6342ec7d05d9
  • commits: 7718b524923 feat(db): add startup-only SQLite reader pool override; a1392d43f85 fix(config): scope SQLite reader override to SQLite driver; 505f09e700d fix(config): defer SQLite reader YAML parsing until driver selection; a828e382197 fix(config): resolve SQLite reader override source before parsing; e6afca97c3e fix(config): reject empty SQLite reader environment override
  • diffstat: 12 files, +443/-6
  • RV revision4 CALL-20261030-ae6989d37e5a APPROVE findings0; verdict_id FORMAL-261029_p50-reader-pool-review.md-1793292300573991800-35197-mid-1; rv_run_id RV-RUN-261029_p50-reader-pool-review.md-1793292300573991800-35197-mid-1; artifact _UserHub/_task/kandev-ops/261029_p50-reader-pool-review.md
  • 검증: 제공 root fixture(env7 > YAML many) PASS; 일회성 overlay(env>YAML, invalid/empty/whitespace env no fallback, env absent strict YAML, env 부재 시 invalid YAML 실패, PostgreSQL no-impact) PASS; db/requiredstores/catalog/build/vet/lint/docs PASS. 신규 상시 test 영구 추가 없음(catalog inventory 한 줄만 기존 계약 정합).
  • 인계: 5d publisher 회신 확인. P50 후보를 #4950 review delta 공개·readback 뒤 게시 대기로 status.md에 기록했고, 공개 쓰기 없음, 준비 branch 보존.
  • 미결: #4950 선행 대기, P50b probe timeout/hysteresis/contention 정책, 영구 동행 시험 필요성. 운영반영/공개발송 없음.
P50 reader pool 상류 후보 구현·검증·RV·인계 완료. - branch feature/kandev-upstream-p50-8f3 (보존), base da9ff633286318315da2cb7af24cf907ed737c5a, head e6afca97c3e1654065223602acfa6342ec7d05d9 - commits: 7718b524923 feat(db): add startup-only SQLite reader pool override; a1392d43f85 fix(config): scope SQLite reader override to SQLite driver; 505f09e700d fix(config): defer SQLite reader YAML parsing until driver selection; a828e382197 fix(config): resolve SQLite reader override source before parsing; e6afca97c3e fix(config): reject empty SQLite reader environment override - diffstat: 12 files, +443/-6 - RV revision4 CALL-20261030-ae6989d37e5a APPROVE findings0; verdict_id FORMAL-261029_p50-reader-pool-review.md-1793292300573991800-35197-mid-1; rv_run_id RV-RUN-261029_p50-reader-pool-review.md-1793292300573991800-35197-mid-1; artifact _UserHub/_task/kandev-ops/261029_p50-reader-pool-review.md - 검증: 제공 root fixture(env7 > YAML many) PASS; 일회성 overlay(env>YAML, invalid/empty/whitespace env no fallback, env absent strict YAML, env 부재 시 invalid YAML 실패, PostgreSQL no-impact) PASS; db/requiredstores/catalog/build/vet/lint/docs PASS. 신규 상시 test 영구 추가 없음(catalog inventory 한 줄만 기존 계약 정합). - 인계: 5d publisher 회신 확인. P50 후보를 #4950 review delta 공개·readback 뒤 게시 대기로 status.md에 기록했고, 공개 쓰기 없음, 준비 branch 보존. - 미결: #4950 선행 대기, P50b probe timeout/hysteresis/contention 정책, 영구 동행 시험 필요성. 운영반영/공개발송 없음.
Author
Owner

수정·재검토 완료했습니다.

  • effective-source 순서 수정: driver 확정 후 env가 present이면 env를 먼저 엄격 파싱하고 하위 YAML은 파싱하지 않음. env 부재일 때만 YAML 엄격 파싱. invalid env는 YAML로 fallback하지 않음.
  • delta RV 지적 반영: explicitly-empty/whitespace env도 present로 취급해 SQLite에서는 invalid로 실패, PostgreSQL은 양쪽 모두 무시.
  • 제공 root fixture TestRootP50EffectiveEnvironmentValue PASS (YAML many + env 7 -> effective 7). 나머지 경계는 repo 밖 일회성 overlay로 확인 후 삭제.
  • 최종 검토 head e6afca97c3e (base da9ff633286, 12 files, +443/-6). revision4 gate rv-run APPROVE, findings 0 (FORMAL-...-1793292300573991800-35197-mid-1).
  • 상시 test 영구 추가·push·PR·운영반영 0. 부모 8e/current 96e9d7f4에 결과 1회 전달 완료.
수정·재검토 완료했습니다. - effective-source 순서 수정: driver 확정 후 env가 present이면 env를 먼저 엄격 파싱하고 하위 YAML은 파싱하지 않음. env 부재일 때만 YAML 엄격 파싱. invalid env는 YAML로 fallback하지 않음. - delta RV 지적 반영: explicitly-empty/whitespace env도 present로 취급해 SQLite에서는 invalid로 실패, PostgreSQL은 양쪽 모두 무시. - 제공 root fixture `TestRootP50EffectiveEnvironmentValue` PASS (YAML many + env 7 -> effective 7). 나머지 경계는 repo 밖 일회성 overlay로 확인 후 삭제. - 최종 검토 head `e6afca97c3e` (base `da9ff633286`, 12 files, +443/-6). revision4 gate rv-run **APPROVE**, findings 0 (`FORMAL-...-1793292300573991800-35197-mid-1`). - 상시 test 영구 추가·push·PR·운영반영 0. 부모 8e/current `96e9d7f4`에 결과 1회 전달 완료.
Author
Owner

8e 수락(#4952 리뷰 후속): 7f8e02c5 결과 agent-delivery-96fe5c18570f0d731c4e7f2d46957066. 8e 원본 readback - 사본 kandev-upstream-p50_vyod28a3 HEAD 32bb09e49085 clean, public e6afca97에서 FF, 새 commit 2개(b49925e fix(config), 32bb09e test(db)), delta 7 files +211/-38, test는 기존 파일(source_test.go, sqlite_test.go, provider_legacy_test.go)에만. 8e 재실행: go test common/config·db(-run Reader|SQLite|Source) PASS, persistence TestProvideAppliesSQLiteReaderPoolSize PASS. 같은 package의 TestProvideRejectsInvalidDefaultLegacyBeforeCreatingCurrent·TestProvideFailsClosedWhenEmptyCurrentConflictsWithLegacyHistory·TestProvide_TakesSnapshotOnUpgrade(snapshot mode 0666 want 0600) FAIL은 delta 밖(persistence 생산코드 변경 0) 기존 Windows 플랫폼 실패로 분류, 전체 suite PASS로 쓰지 않음. validateCoverage covered(15 files). RV-RUN-261029_p50-reader-pool-review.md-1793300308565620500-41887-mid-1 APPROVE findings 0(artifact가 32bb09e4 기재; 1차 41041 partial REQUEST_CHANGES idle 지적 해소). commit hook: source 보고상 잠금 해제 뒤 normal hooks 통과(SKIP 미사용). 다음: 93->5d 같은 #4952 non-force FF + thread 4건 답글·resolve.

8e 수락(#4952 리뷰 후속): 7f8e02c5 결과 agent-delivery-96fe5c18570f0d731c4e7f2d46957066. 8e 원본 readback - 사본 kandev-upstream-p50_vyod28a3 HEAD 32bb09e49085 clean, public e6afca97에서 FF, 새 commit 2개(b49925e fix(config), 32bb09e test(db)), delta 7 files +211/-38, test는 기존 파일(source_test.go, sqlite_test.go, provider_legacy_test.go)에만. 8e 재실행: go test common/config·db(-run Reader|SQLite|Source) PASS, persistence TestProvideAppliesSQLiteReaderPoolSize PASS. 같은 package의 TestProvideRejectsInvalidDefaultLegacyBeforeCreatingCurrent·TestProvideFailsClosedWhenEmptyCurrentConflictsWithLegacyHistory·TestProvide_TakesSnapshotOnUpgrade(snapshot mode 0666 want 0600) FAIL은 delta 밖(persistence 생산코드 변경 0) 기존 Windows 플랫폼 실패로 분류, 전체 suite PASS로 쓰지 않음. validateCoverage covered(15 files). RV-RUN-261029_p50-reader-pool-review.md-1793300308565620500-41887-mid-1 APPROVE findings 0(artifact가 32bb09e4 기재; 1차 41041 partial REQUEST_CHANGES idle 지적 해소). commit hook: source 보고상 잠금 해제 뒤 normal hooks 통과(SKIP 미사용). 다음: 93->5d 같은 #4952 non-force FF + thread 4건 답글·resolve.
Author
Owner

8e 게시 readback(#4952 리뷰 후속): 5d가 비강제 FF e6afca97c3e -> 32bb09e49085 반영. 8e gh readback - #4952 OPEN, head 32bb09e49085b2cb2111debeb445a1a8da0c98b0, thread 4건(PRRT_kwDOQ2-eWs6xqp20, xqp6V, xqr6f, xq47M) 모두 resolved(답글 4416808511, 4416810071, 4416811226, 4416812311). 5d가 본문 Validation 정정(기존 test 파일 permanent tests, Windows persistence baseline 실패 3건·PG DB·전체 suite·E2E 미실행 명시). 5d 보고 기준 체크 실패 0·진행 2, docs coverage SUCCESS만(전체 CI green 아님). 병합은 maintainer 리뷰 몫. P50b probe 정책(#4120) 범위 밖.

8e 게시 readback(#4952 리뷰 후속): 5d가 비강제 FF e6afca97c3e -> 32bb09e49085 반영. 8e gh readback - #4952 OPEN, head 32bb09e49085b2cb2111debeb445a1a8da0c98b0, thread 4건(PRRT_kwDOQ2-eWs6xqp20, xqp6V, xqr6f, xq47M) 모두 resolved(답글 4416808511, 4416810071, 4416811226, 4416812311). 5d가 본문 Validation 정정(기존 test 파일 permanent tests, Windows persistence baseline 실패 3건·PG DB·전체 suite·E2E 미실행 명시). 5d 보고 기준 체크 실패 0·진행 2, docs coverage SUCCESS만(전체 CI green 아님). 병합은 maintainer 리뷰 몫. P50b probe 정책(#4120) 범위 밖.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dreampiler/kandev#216