Skip to content

fix(postgres): require authenticated TLS for remote pg8000 - #342

Draft
seonghobae wants to merge 28 commits into
feat/commercial-postgres-driver-port-b84f0c9from
fix/pg8000-remote-tls-identity-20260911
Draft

seonghobae wants to merge 28 commits into
feat/commercial-postgres-driver-port-b84f0c9from
fix/pg8000-remote-tls-identity-20260911

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Security gap

Issue #123 is the canonical durable owner for package-created remote PostgreSQL transport encryption and authenticated server identity. Parent #323 selects pg8000 1.31.5 behind PostgresDriverPort. This Draft remains the dedicated source/acceptance owner for the remote TLS identity boundary.

Exact current topology — 2026-09-16

  • protected main: 5913c4bad79d6bc29d7cc1c624abb7db2ea6a77c at the latest verified repository sweep;
  • current parent feat(postgres): define driver-neutral migration port #323 exact head: 8da8b9de7b89754cb10091d5457c88e255bfc727;
  • parent exact-current CI 34999370347: SUCCESS;
  • parent exact-current Release Acceptance 34999370213: SUCCESS;
  • exact current fix(postgres): require authenticated TLS for remote pg8000 #342 head after ordinary/non-force reconciliation: 0c1056fcb2cc33bc6d6a69e4f8db33117809778f;
  • current merge base: exactly 8da8b9de7b89754cb10091d5457c88e255bfc727;
  • fresh compare from current feat(postgres): define driver-neutral migration port #323: 28 ahead / 0 behind;
  • effective TLS-owned surface remains exactly four files: pg_llm_batch/pg8000_driver_adapter.py, tests/test_pg8000_remote_tls_identity.py, tests/smoke_pg8000_candidate_postgres.py, and Proposed ADR 0023;
  • exact-head CI 35023766139: SUCCESS;
  • exact-head Release Acceptance 35023766945: SUCCESS.

The reconciliation is an ordinary two-parent commit with the former child d59df8ff14f8d82ac01f866cb38889407634cc46 as first parent and current #323 as the additional parent. The tree takes current #323 as authority for every path except the four TLS-owned paths. No force update or destructive rebase was used.

Before the reconcile, the two child-modified paths that also existed in the parent (pg8000_driver_adapter.py and the permanent pg8000/PostgreSQL smoke) were re-read on the old merge base 34858ef2... and current parent 8da8b9de...; both were unchanged across those six parent commits. The other two TLS paths are child-owned additions. Complete branch/open-PR census found no competing dedicated pg8000 remote-TLS writer. This is why a bounded tree-overlay merge-forward was safe rather than a blind conflict resolution.

The reconciled current head is repository-local GREEN. Fresh formal reviews remain COMMENT-only with no qualifying independent APPROVED review, and the current inline review-thread inventory is empty. #323 remains Draft and root #233 remains outside protected integration, so #342 remains Draft and is not merge-authorized.

Repaired TLS contract retained

The production adapter preserves PostgresDriverPort, selector grammar, finite connect timeout, transaction/thread-affinity/JSONB/SQLSTATE behavior, explicit service-file authority, exact pg8000 artifact admission, and caller-injected alternate-driver authority.

Every validated non-loopback TCP target requires authenticated TLS, strict X.509 plus hostname/IP verification, host/platform default CA trust, no ambient SSLKEYLOGFILE sink, no remote plaintext downgrade, and content-free failure diagnostics. Python/OpenSSL ssl.SSLError and only the exact admitted pg8000 InterfaceError("Server refuses SSL") are normalized to the fixed TLS-policy error; unrelated DB-API failures stay native. The public normalized error retains neither sensitive lower-layer __cause__ nor __context__.

Real PostgreSQL acceptance requires trusted CA + matching identity success, unrelated-CA rejection, mismatched identity rejection, and TLS-disabled remote no-downgrade on supported Python versions. ADR 0023 remains Proposed until normal protected integration and immutable-release evidence exist.

Finding-verification lineage retained

A prior review suspected _verified_remote_ssl_context() could leak an OpenSSL ssl.SSLError raised while _new_remote_ssl_context() constructs host trust. Test-first c2ccffdf23a34e213da0eed8f76af4bf01f06cb7 proved the predecessor production already normalized it because ssl.SSLError is an OSError subclass. Intermediate 582b3b36... made the redundant subtype explicit; ordinary child 2dd438ff... removed that non-causal source edit while retaining the regression. This remains recorded as a falsified finding, not invented RED→GREEN.

The broader TLS lineage also retains the actual repairs for ambient key-log authority, certificate/hostname diagnostics, the exact pg8000 server-refusal downgrade path, and lower-layer exception-context retention. Do not weaken those invariants during later parent reconciliation.

Predecessor evidence — historical only

Exact predecessor d59df8ff14f8d82ac01f866cb38889407634cc46 had terminal repository GREEN against predecessor #323: CI 34754512826 and Release Acceptance 34754512825 both succeeded. Earlier exact 2dd438ffe... also had terminal CI/Release Acceptance GREEN. Those receipts remain useful history for the unchanged TLS semantic slice but were not transferred to current acceptance; 0c1056fc... reacquired its own successful CI and Release Acceptance.

Integration boundary

Repository-owned GREEN does not by itself authorize merge. There is still no qualifying independent current-head APPROVED review. #323 remains Draft and root #233 remains outside protected main while central compatibility/review prerequisites remain unresolved. Branch-local GREEN is not protected-main or immutable-release authority.

Root #233 remains the protected integration prerequisite. Normal order remains central prerequisite repair → #233 normal merge → ordinary/non-force #323 reconciliation/integration with fresh exact evidence → #342 reconciliation onto the actual integrated/current parent if needed → fresh exact-head/current-base repository, TLS, security/model-backed, review/thread, package/SBOM/provenance/reproducibility evidence → normal #342 integration → root documentation convergence through #324 → protected-head immutable version/CHANGELOG/tag/package/license/vulnerability/SBOM/provenance/reproducibility/rollback release and post-publication identity verification.

No force push, destructive rebase, synthetic status, gate weakening, routine administrator bypass, predecessor-evidence transfer, source-neutral wake commit, blind rerun, protected-main direct write, or self-approval is used. Any further ancestry movement must reacquire current-head/current-base evidence.

Refs #123, #233, #242, #244, #289, #290, #316, #321, #322, #323, #324, #346.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 0d205aef-798d-4b56-91b2-711ed050967e

📥 Commits

Reviewing files that changed from the base of the PR and between 609ca90 and 2dd438f.

📒 Files selected for processing (1)
  • tests/test_pg8000_remote_tls_identity.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

원격 pg8000 연결에 엄격한 TLS 서버 신원 검증을 추가했습니다. 루프백 연결은 기존 예외를 유지합니다. TLS 검증 실패와 정확한 SSL 거부 오류는 내용 없는 정책 오류로 변환합니다. 단위 테스트와 실제 PostgreSQL 수락 테스트를 추가했습니다.

Changes

원격 TLS 정책

Layer / File(s) Summary
TLS 정책 생성 및 검증
pg_llm_batch/pg8000_driver_adapter.py, tests/test_pg8000_remote_tls_identity.py, docs/adr/0023-pg8000-remote-tls-server-identity.md
원격 연결에 시스템 CA 저장소, 호스트명 검증, 필수 인증서 검증을 사용하는 SSLContext를 적용합니다. SSLKEYLOGFILE 키 로깅을 차단하고 TLS 정책 오류를 검증합니다.
연결 경로 및 오류 정규화
pg_llm_batch/pg8000_driver_adapter.py, tests/test_pg8000_remote_tls_identity.py
비루프백 연결에 TLS 컨텍스트를 주입합니다. 명시적 루프백 연결은 기존 경로를 사용합니다. TLS 핸드셰이크 실패와 정확한 "Server refuses SSL" 오류만 Pg8000DriverTlsPolicyError로 변환합니다.
실제 PostgreSQL TLS 수락 검증
tests/smoke_pg8000_candidate_postgres.py
임시 CA와 IP-SAN 인증서를 생성하고 PostgreSQL TLS를 설정합니다. 인증된 연결, 비신뢰 CA, 서버 신원 불일치, TLS 비활성화 조건을 실제 컨테이너에서 검증합니다.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant SmokeTest
  participant Pg8000DriverAdapter
  participant pg8000
  participant PostgreSQL
  SmokeTest->>Pg8000DriverAdapter: 원격 주소와 CA 설정 전달
  Pg8000DriverAdapter->>pg8000: 검증된 ssl_context로 연결
  pg8000->>PostgreSQL: TLS 핸드셰이크 수행
  PostgreSQL-->>pg8000: 인증 결과 반환
  pg8000-->>Pg8000DriverAdapter: 연결 또는 TLS 오류 반환
  Pg8000DriverAdapter-->>SmokeTest: 세션 또는 Pg8000DriverTlsPolicyError 반환
Loading

Merge Risk: ⚪ Minimal · up to 2dd43

Remote connections enforce authenticated TLS while loopback retains its explicit development exception, with successful CI and release acceptance coverage.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 82.22% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 45 functions across 3 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 원격 pg8000 PostgreSQL 연결에 인증된 TLS를 요구하는 주요 변경 사항을 정확하고 간결하게 설명합니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pg8000-remote-tls-identity-20260911

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review the exact current head 7f6864cd4fb94ef9a0e76955b06babad990c8c00, especially the remote-vs-loopback TLS authority boundary, hostname/CA verification guarantees, fixed diagnostics, preservation of inherited pg8000 selector/timeout semantics, and whether the two-file relative delta introduces any downgrade or policy-bypass path.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

expected='7f6864cd4fb94ef9a0e76955b06babad990c8c00'
actual="$(git rev-parse HEAD)"
printf 'HEAD expected=%s actual=%s\n' "$expected" "$actual"
git status --short
printf '\n--- relative diff against parent ---\n'
git diff --find-renames --find-copies --stat HEAD^ HEAD
git diff --find-renames --find-copies --name-status HEAD^ HEAD
git diff --find-renames --find-copies --no-ext-diff --unified=80 HEAD^ HEAD

printf '\n--- candidate files ---\n'
fd -t f . | rg '(pg8000|postgres|Postgres|tls|TLS|requirements|pyproject|poetry\.lock|Pipfile|setup\.cfg|setup\.py)$' || true

printf '\n--- Python structure maps ---\n'
fd -e py -t f . | rg '(pg8000|postgres|Postgres|tls|TLS)' | while IFS= read -r file; do
  printf '\n### %s\n' "$file"
  ast-grep outline "$file" --items all || true
done

printf '\n--- Connection and SSL call contexts ---\n'
rg -n -C 8 --glob '*.py' \
  '(pg8000|PostgresDriverPort|ssl_context|SSLContext|create_default_context|check_hostname|CERT_REQUIRED|connect\s*\()' \
  . || true

printf '\n--- dependency declarations ---\n'
rg -n -C 3 '(pg8000|postgres)' \
  pyproject.toml poetry.lock requirements.txt requirements-*.txt setup.py setup.cfg Pipfile Pipfile.lock 2>/dev/null || true

Length of output: 201769


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- exact commit and two-file delta ---'
git rev-parse HEAD
git diff --name-status HEAD^ HEAD
git diff --no-ext-diff --unified=20 HEAD^ HEAD -- \
  pg_llm_batch/pg8000_driver_adapter.py \
  tests/test_pg8000_remote_tls_identity.py

printf '%s\n' '--- current production adapter ---'
cat -n pg_llm_batch/pg8000_driver_adapter.py

printf '%s\n' '--- parent production adapter ---'
git show HEAD^:pg_llm_batch/pg8000_driver_adapter.py | cat -n

printf '%s\n' '--- focused TLS test ---'
cat -n tests/test_pg8000_remote_tls_identity.py

printf '%s\n' '--- inherited adapter connect implementation ---'
ast-grep outline pg_llm_batch/pg8000_candidate_driver_port.py --items all
rg -n -A100 -B10 '^\s*def connect\(' pg_llm_batch/pg8000_candidate_driver_port.py

printf '%s\n' '--- production adapter construction and direct candidate constructions ---'
rg -n -C 5 --glob '*.py' \
  '(load_pg8000_driver\s*\(|Pg8000DriverAdapter\s*\(|Pg8000CandidateDriverAdapter\s*\()' \
  pg_llm_batch tests

printf '%s\n' '--- focused test outcomes from repository CI metadata ---'
gh pr view 342 --repo ContextualWisdomLab/pg-llm-batch --json headRefOid,statusCheckRollup,isDraft,reviewDecision \
  --jq '{headRefOid,isDraft,reviewDecision,statusCheckRollup:[.statusCheckRollup[]|{name,conclusion,status}]}'

Length of output: 76062


🏁 Script executed:

#!/bin/bash
set -euo pipefail

base='b68a975becc93841dbfea818beccb8119f2f6944'
head='7f6864cd4fb94ef9a0e76955b06babad990c8c00'

printf '%s\n' '--- ancestry and relative delta from the stated source parent ---'
git merge-base --is-ancestor "$base" "$head" && echo 'source parent is an ancestor'
git log --oneline --decorate "$base..$head"
git diff --stat "$base" "$head"
git diff --name-status "$base" "$head"
git diff --no-ext-diff --unified=30 "$base" "$head" -- \
  pg_llm_batch/pg8000_driver_adapter.py \
  tests/test_pg8000_remote_tls_identity.py

printf '%s\n' '--- validated host and service-resolution boundaries ---'
sed -n '110,175p' pg_llm_batch/pg8000_candidate_driver_port.py
sed -n '270,405p' pg_llm_batch/pg8000_candidate_driver_port.py
ast-grep outline pg_llm_batch/pg8000_candidate_service_file.py --items all
rg -n -A120 -B10 'def __call__|def resolve|class Pg8000CandidateServiceFileResolver' \
  pg_llm_batch/pg8000_candidate_service_file.py

printf '%s\n' '--- failed check details ---'
gh pr checks 342 --repo ContextualWisdomLab/pg-llm-batch || true
gh pr view 342 --repo ContextualWisdomLab/pg-llm-batch --json statusCheckRollup \
  --jq '.statusCheckRollup[] | select(.name == "Coverage, docstrings, lint, and package") | {detailsUrl,workflowName,name,conclusion,status}'

Length of output: 31116


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- failed hosted gate log ---'
gh run view 34561425189 \
  --repo ContextualWisdomLab/pg-llm-batch \
  --job 103144768662 \
  --log-failed || true

printf '%s\n' '--- local static check for TLS policy mutations and exception paths ---'
rg -n -C 4 --glob '*.py' \
  '(Pg8000DriverTlsPolicyError|_verified_remote_ssl_context|_is_explicit_loopback_host|ssl_context|create_default_context)' \
  pg_llm_batch tests

Length of output: 8887


🤖 web_search executed:

In the pg8000 1.31.5 source, when dbapi.connect receives ssl_context, does it wrap the socket with server_hostname set to the host? Provide the relevant source or official documentation.

Length of output: 10116


🏁 Script executed:

#!/bin/bash
set -euo pipefail

workdir="$(mktemp -d)"
trap 'rm -rf "$workdir"' EXIT

curl --fail --silent --show-error --location \
  'https://files.pythonhosted.org/packages/source/p/pg8000/pg8000-1.31.5.tar.gz' \
  --output "$workdir/pg8000-1.31.5.tar.gz"

printf '%s\n' '--- published source archive digest ---'
sha256sum "$workdir/pg8000-1.31.5.tar.gz"

tar --extract --gzip --file "$workdir/pg8000-1.31.5.tar.gz" \
  --to-stdout '*/src/pg8000/core.py' > "$workdir/core.py"

printf '%s\n' '--- exact TLS socket wrapping context ---'
rg -n -C 12 'wrap_socket|ssl_context|server_hostname' "$workdir/core.py"

Length of output: 5014


@seonghobae Review complete for exact head 7f6864cd4fb94ef9a0e76955b06babad990c8c00.

I found no blocking source-level issue in the two-file delta from b68a975becc93841dbfea818beccb8119f2f6944.

  • Pg8000DriverAdapter classifies only explicit localhost and IP literals for which ip_address(host).is_loopback is true as local-development targets. The inherited selector boundary validates one host before this classification. Service-file values also pass the same final validation.
  • Every other accepted TCP host receives a new SSLContext. The adapter rejects the context unless check_hostname is True and verify_mode == CERT_REQUIRED.
  • pg8000 1.31.5 uses the supplied context with wrap_socket(sock, server_hostname=host). This preserves both CA validation and hostname validation for remote hosts.
  • A remote server that refuses TLS cannot cause plaintext fallback when a context is supplied. pg8000 raises instead.
  • TLS context construction and weakened-context failures produce the fixed diagnostic PostgreSQL TLS policy is unavailable. The tests verify that raw pg8000 connection access does not occur in these cases.
  • The wrapper changes only ssl_context. The inherited adapter continues to parse selectors, preserve the resolved host, convert the validated port, forward timeout, and retain its connection and transaction behavior.
  • No new ambient configuration, service-file discovery, driver-routing path, or production Pg8000CandidateDriverAdapter construction path appears in the delta.

The hosted gates are not terminal. The coverage/lint/package check currently reports failure, but GitHub does not yet expose its log because the workflow remains in progress. I cannot treat that check as verified until it completes.

⚠️ Action not completed

Head commit changed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact current head 5588dc9aed0ce028cf056691e7333c65565e72e7. ADR-0023 is now part of the three-file bounded delta. Verify the remote-vs-loopback policy, no-plaintext-downgrade intent, CA/hostname guarantees, content-free failure boundary, compatibility with inherited pg8000 selector/timeout/service-file semantics, and consistency between source/tests/ADR.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base='b68a975becc93841dbfea818beccb8119f2f6944'
head='5588dc9aed0ce028cf056691e7333c65565e72e7'

printf '%s\n' '--- exact head and ancestry ---'
printf 'HEAD=%s\n' "$(git rev-parse HEAD)"
git merge-base --is-ancestor "$base" "$head" && echo 'base_is_ancestor=true'
git log --oneline "$base..$head"

printf '%s\n' '--- bounded relative delta ---'
git diff --stat "$base" "$head"
git diff --name-status "$base" "$head"
git diff --no-ext-diff --unified=60 "$base" "$head" -- \
  pg_llm_batch/pg8000_driver_adapter.py \
  tests/test_pg8000_remote_tls_identity.py \
  docs/adr/0023-pg8000-remote-tls-server-identity.md

printf '%s\n' '--- current source, tests, and ADR ---'
cat -n pg_llm_batch/pg8000_driver_adapter.py
cat -n tests/test_pg8000_remote_tls_identity.py
cat -n docs/adr/0023-pg8000-remote-tls-server-identity.md

printf '%s\n' '--- inherited pg8000 connection and service-file boundaries ---'
ast-grep outline pg_llm_batch/pg8000_candidate_driver_port.py --items all
rg -n -A160 -B15 '^\s*def connect\(' pg_llm_batch/pg8000_candidate_driver_port.py
ast-grep outline pg_llm_batch/pg8000_candidate_service_file.py --items all
rg -n -A160 -B15 '^\s*(def __call__|def resolve|class Pg8000CandidateServiceFileResolver)' \
  pg_llm_batch/pg8000_candidate_service_file.py

printf '%s\n' '--- TLS and adapter construction paths ---'
rg -n -C 6 --glob '*.py' \
  '(ssl_context|create_default_context|CERT_REQUIRED|check_hostname|Pg8000DriverAdapter\s*\(|load_pg8000_driver\s*\(|Pg8000CandidateDriverAdapter\s*\()' \
  pg_llm_batch tests

printf '%s\n' '--- dependency version declarations ---'
rg -n -C 3 '(pg8000)' \
  pyproject.toml poetry.lock requirements.txt requirements-*.txt setup.py setup.cfg Pipfile Pipfile.lock 2>/dev/null || true

printf '%s\n' '--- pull request state and checks ---'
gh pr view 342 --repo ContextualWisdomLab/pg-llm-batch \
  --json headRefOid,isDraft,reviewDecision,statusCheckRollup \
  --jq '{headRefOid,isDraft,reviewDecision,statusCheckRollup:[.statusCheckRollup[]|{name,status,conclusion,detailsUrl}]}'

Length of output: 114966


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- host validation implementation ---'
sed -n '105,140p' pg_llm_batch/pg8000_candidate_driver_port.py

printf '%s\n' '--- terminal CI failure summaries ---'
for job in 103145589067 103145589140 103145589057 103145589050 103145589230 103145588842; do
  printf '\n### job=%s\n' "$job"
  gh run view 34561698843 \
    --repo ContextualWisdomLab/pg-llm-batch \
    --job "$job" --log-failed || true
done

printf '%s\n' '--- pg8000 1.31.5 TLS implementation ---'
workdir="$(mktemp -d)"
trap 'rm -rf "$workdir"' EXIT
curl --fail --silent --show-error --location \
  'https://files.pythonhosted.org/packages/source/p/pg8000/pg8000-1.31.5.tar.gz' \
  --output "$workdir/pg8000-1.31.5.tar.gz"
tar --extract --gzip --file "$workdir/pg8000-1.31.5.tar.gz" \
  --to-stdout '*/src/pg8000/core.py' > "$workdir/core.py"
rg -n -C 14 '(ssl_context|wrap_socket|server_hostname)' "$workdir/core.py"

printf '%s\n' '--- current PR check state ---'
gh pr view 342 --repo ContextualWisdomLab/pg-llm-batch \
  --json statusCheckRollup \
  --jq '.statusCheckRollup[] | {name,status,conclusion,detailsUrl}'

Length of output: 69627


@seonghobae Review complete for exact head 5588dc9aed0ce028cf056691e7333c65565e72e7.

I found one blocking issue.

  • ADR heading breaks all unit-test jobs. docs/adr/0023-pg8000-remote-tls-server-identity.md Line 1 starts with # ADR-0023:. tests/test_adr_numeric_identity.py requires # ADR NNNN: . Change the heading to # ADR 0023: Authenticate remote PostgreSQL server identity in the pg8000 production adapter. The Python 3.10–3.14 unit-test jobs all fail on this assertion. The documentation coverage gate also fails at 99.8%.

I found no additional source-level downgrade or policy-bypass path.

  • The inherited adapter validates and normalizes one host before Pg8000DriverAdapter classifies it.
  • localhost, IPv4 loopback, and IPv6 loopback keep the explicit local-development exception.
  • Each other admitted host receives a fresh context from create_default_context().
  • The adapter requires check_hostname and CERT_REQUIRED before raw driver access.
  • pg8000 1.31.5 wraps the supplied context with server_hostname=host. It rejects a server SSL refusal when ssl_context is supplied. Therefore, the remote path does not fall back to plaintext.
  • The fixed PostgreSQL TLS policy is unavailable diagnostic applies when context construction fails or either verification invariant is weakened. The new tests also verify that the raw connection factory is not called.
  • The wrapper only adds ssl_context. The existing selector parsing, explicit service-file resolution, finite timeout forwarding, and candidate connection behavior remain unchanged.
  • ADR-0023 matches the source and tests on the non-loopback TLS rule, loopback exception, caller-injected driver seam, and the need for separate real TLS acceptance.

The container build and PostgreSQL runtime-smoke job succeeded. The PR remains Draft and has no passing full unit-test or coverage result at this head.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact current head 2f81c255931b95cc246b1d85276d0725bcb47e96. CI 34561827011 and Release Acceptance 34561826891 are exact-head GREEN. Focus on the non-loopback verified-TLS boundary, explicit loopback exception, CA/hostname guarantees, fixed diagnostics, preservation of inherited pg8000 selector/timeout/service-file behavior, ADR-0023 consistency, and any downgrade or policy-bypass path. The existing real PostgreSQL smoke is loopback/candidate parity only, so do not treat it as remote-TLS acceptance.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base='b68a975becc93841dbfea818beccb8119f2f6944'
head='2f81c255931b95cc246b1d85276d0725bcb47e96'
repo='ContextualWisdomLab/pg-llm-batch'

printf '%s\n' '--- exact head and ancestry ---'
printf 'checked_out=%s expected=%s\n' "$(git rev-parse HEAD)" "$head"
git merge-base --is-ancestor "$base" "$head" && printf 'base_is_ancestor=true\n'
git log --oneline "$base..$head"

printf '%s\n' '--- parent-relative surface and diff ---'
git diff --stat "$base" "$head"
git diff --name-status "$base" "$head"
git diff --no-ext-diff --unified=50 "$base" "$head" -- \
  pg_llm_batch/pg8000_driver_adapter.py \
  tests/test_pg8000_remote_tls_identity.py \
  docs/adr/0023-pg8000-remote-tls-server-identity.md

printf '%s\n' '--- current changed files ---'
for file in \
  pg_llm_batch/pg8000_driver_adapter.py \
  tests/test_pg8000_remote_tls_identity.py \
  docs/adr/0023-pg8000-remote-tls-server-identity.md
do
  printf '\n### %s\n' "$file"
  cat -n "$file"
done

printf '%s\n' '--- inherited host, connection, and service-file boundaries ---'
ast-grep outline pg_llm_batch/pg8000_candidate_driver_port.py --items all
sed -n '100,150p' pg_llm_batch/pg8000_candidate_driver_port.py
rg -n -A150 -B15 '^\s*def connect\(' pg_llm_batch/pg8000_candidate_driver_port.py
ast-grep outline pg_llm_batch/pg8000_candidate_service_file.py --items all
rg -n -A150 -B15 '^\s*(def __call__|def resolve|class Pg8000CandidateServiceFileResolver)' \
  pg_llm_batch/pg8000_candidate_service_file.py

printf '%s\n' '--- all production TLS/raw-connect and construction paths ---'
rg -n -C 6 --glob '*.py' \
  '(ssl_context|create_default_context|CERT_REQUIRED|check_hostname|raw_connect|Pg8000DriverAdapter\s*\(|load_pg8000_driver\s*\(|Pg8000CandidateDriverAdapter\s*\()' \
  pg_llm_batch tests

printf '%s\n' '--- pg8000 dependency declaration ---'
rg -n -C 3 'pg8000' pyproject.toml poetry.lock 2>/dev/null || true

printf '%s\n' '--- PR and stated workflow evidence ---'
gh pr view 342 --repo "$repo" \
  --json headRefOid,isDraft,reviewDecision,statusCheckRollup \
  --jq '{headRefOid,isDraft,reviewDecision,statusCheckRollup:[.statusCheckRollup[]|{name,status,conclusion,detailsUrl}]}'
for run in 34561827011 34561826891; do
  printf '\n### workflow_run=%s\n' "$run"
  gh run view "$run" --repo "$repo" \
    --json headSha,status,conclusion,name,event,workflowName,jobs \
    --jq '{headSha,status,conclusion,name,workflowName,jobs:[.jobs[]|{name,status,conclusion}]}'
done

Length of output: 124410


@seonghobae Review complete for exact head 2f81c255931b95cc246b1d85276d0725bcb47e96.

I found no blocking issue in the three-file delta from b68a975becc93841dbfea818beccb8119f2f6944.

  • Pg8000DriverAdapter receives an already validated single host from the inherited selector boundary.
  • localhost, all IPv4 loopback addresses, and IPv6 ::1 retain the explicit local-development exception.
  • Every other accepted host receives a fresh ssl.create_default_context() result.
  • The adapter rejects a context unless check_hostname is True and verify_mode == CERT_REQUIRED.
  • The adapter passes the verified context to pg8000 before raw connection access. This prevents pg8000 from taking its ssl_context=None plaintext-fallback path for non-loopback hosts.
  • pg8000 1.31.5 uses the supplied context with the connection host as server_hostname. The remote path therefore retains both CA validation and hostname validation.
  • If trust-context construction fails, or either verification invariant is weakened, the adapter raises only PostgreSQL TLS policy is unavailable. The failure-path tests confirm that raw pg8000 access does not occur.
  • The wrapper modifies only ssl_context. The inherited selector parsing, explicit service-file resolution, port conversion, finite timeout forwarding, transaction behavior, thread affinity, JSONB handling, and SQLSTATE classification remain unchanged.
  • The delta adds no ambient DSN, PG*, .env, or trust-material authority. The injected PostgresDriverPort seam remains the separate caller-owned policy path.
  • ADR 0023 matches the source and tests. It also correctly states that loopback is a bounded exception and that real TLS-enabled PostgreSQL acceptance is still required for issue #123.

I verified the stated exact-head workflows:

  • CI 34561827011: completed successfully on 2f81c255931b95cc246b1d85276d0725bcb47e96.
  • Release Acceptance 34561826891: completed successfully on 2f81c255931b95cc246b1d85276d0725bcb47e96.

The existing runtime smoke is loopback candidate-adapter coverage. It is not evidence of successful or failing remote TLS negotiation, CA trust, hostname mismatch handling, or plaintext-downgrade refusal against a real PostgreSQL server.

You are interacting with an AI system.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exact-head source review on 2f81c255931b95cc246b1d85276d0725bcb47e96: the three-file delta closes the source-level pg8000 remote downgrade gap without widening the loopback exception. For every validated non-loopback TCP host, the production adapter injects an SSLContext that must retain hostname checking and CERT_REQUIRED before raw-driver access; exact localhost / IPv4 127/8 / IPv6 ::1 remain the deliberate local-development exception. This matches pg8000 1.31.5's documented distinction between ssl_context=None (SSL attempt with plaintext fallback if the server refuses), True (minimum-check SSL), and a caller-supplied SSLContext.

I found no additional source-level defect in the current three-file delta. This review is deliberately COMMENT, not approval: the current hosted PostgreSQL smoke uses the candidate adapter over loopback/plain PostgreSQL, so it does not exercise this production remote-TLS seam. Keep #123 and this Draft open until realistic TLS-enabled PostgreSQL acceptance proves trusted CA + matching identity success, untrusted/wrong CA failure, hostname mismatch failure, no remote plaintext downgrade, bounded diagnostics, and preservation of deliberate injected-driver authority. Branch-local CI/Release Acceptance does not substitute for that evidence or for independent approval/protected integration.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현재 real TLS matrix 자체는 유효하지만 trust-policy authority에 한 가지 누락이 있습니다. Python 3.14의 ssl.create_default_context()SSLKEYLOGFILE이 설정되어 있으면 key logging을 활성화하고, OpenSSL 기본 CA 경로는 SSL_CERT_FILE/SSL_CERT_DIR 환경 키를 가질 수 있습니다. 그런데 ADR 0023은 ambient TLS environment authority를 도입하지 않는다고 명시하면서, 현재 smoke는 오히려 SSL_CERT_FILE로 production create_default_context()의 trust anchor를 바꿉니다. 즉 구현/acceptance와 명시 계약이 불일치하고, 특히 SSLKEYLOGFILE은 package-created remote TLS 세션 키를 ambient process setting으로 기록할 수 있습니다. 이 lane 안에서 최소 repair가 필요합니다: 적어도 key-log authority는 connection 전에 fail closed하고, CA environment authority는 허용/금지 중 하나를 명시적으로 결정해 ADR·acceptance와 일치시켜야 합니다. Peer verification이나 strict X.509를 낮추는 수정은 허용하지 않습니다.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c61a91a...에서 지적한 TLS trust/key-export authority finding은 현재 head에서 source·test·ADR로 수리됐습니다. SSLKEYLOGFILE은 더 이상 package-created PostgreSQL SSLContext의 key-log sink가 되지 않고, hostname verification/CERT_REQUIRED/strict X.509는 유지됩니다. 반면 load_default_certs()가 사용하는 host/platform/OpenSSL CA store는 deployment trust authority로 명시적으로 문서화했습니다. 현재 real PostgreSQL TLS matrix도 새 context factory로 Python 3.10/3.12/3.14에서 성공했습니다. 이 COMMENT는 finding repair 확인이지 approval이 아닙니다. Draft ancestry, independent current-head approval, protected-stack integration 및 immutable release evidence는 별도 gate로 남습니다.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact current head 11355fc8a3bf6fecadcdf34c2acc21ada9cbb2f1, with emphasis on the explicit SSLContext(PROTOCOL_TLS_CLIENT) policy, host/default-CA authority versus SSLKEYLOGFILE isolation, real PostgreSQL TLS matrix, remote no-downgrade behavior, and preservation of inherited pg8000 selector/timeout semantics. Treat this as review only; do not weaken strict X.509 or the deliberate loopback boundary.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo='ContextualWisdomLab/pg-llm-batch'
base='b68a975becc93841dbfea818beccb8119f2f6944'
head='11355fc8a3bf6fecadcdf34c2acc21ada9cbb2f1'

printf '%s\n' '--- exact commit and topology ---'
printf 'checked_out=%s expected=%s\n' "$(git rev-parse HEAD)" "$head"
git merge-base --is-ancestor "$base" "$head" && echo 'base_is_ancestor=true'
git diff --stat "$base" "$head"
git diff --name-status "$base" "$head"
git log --oneline "$base..$head"

printf '%s\n' '--- bounded delta ---'
git diff --no-ext-diff --unified=50 "$base" "$head" -- \
  pg_llm_batch/pg8000_driver_adapter.py \
  tests/test_pg8000_remote_tls_identity.py \
  tests/smoke_pg8000_candidate_postgres.py \
  docs/adr/0023-pg8000-remote-tls-server-identity.md

printf '%s\n' '--- changed source, tests, and ADR ---'
for file in \
  pg_llm_batch/pg8000_driver_adapter.py \
  tests/test_pg8000_remote_tls_identity.py \
  tests/smoke_pg8000_candidate_postgres.py \
  docs/adr/0023-pg8000-remote-tls-server-identity.md
do
  printf '\n### %s\n' "$file"
  cat -n "$file"
done

printf '%s\n' '--- inherited connection, selector, and service-file behavior ---'
ast-grep outline pg_llm_batch/pg8000_candidate_driver_port.py --items all
sed -n '100,150p' pg_llm_batch/pg8000_candidate_driver_port.py
rg -n -A160 -B15 '^\s*def connect\(' pg_llm_batch/pg8000_candidate_driver_port.py
ast-grep outline pg_llm_batch/pg8000_candidate_service_file.py --items all
rg -n -A160 -B15 '^\s*(def __call__|def resolve|class Pg8000CandidateServiceFileResolver)' \
  pg_llm_batch/pg8000_candidate_service_file.py

printf '%s\n' '--- context creation, direct connection, and construction paths ---'
rg -n -C 6 --glob '*.py' \
  '(SSLContext|PROTOCOL_TLS_CLIENT|VERIFY_X509|load_default_certs|SSLKEYLOGFILE|keylog_filename|ssl_context|raw_connect|Pg8000DriverAdapter\s*\(|load_pg8000_driver\s*\(|Pg8000CandidateDriverAdapter\s*\()' \
  pg_llm_batch tests

printf '%s\n' '--- pg8000 version declarations ---'
rg -n -C 3 'pg8000' pyproject.toml poetry.lock 2>/dev/null || true

printf '%s\n' '--- pull request and exact workflow evidence ---'
gh pr view 342 --repo "$repo" \
  --json headRefOid,isDraft,reviewDecision,statusCheckRollup \
  --jq '{headRefOid,isDraft,reviewDecision,statusCheckRollup:[.statusCheckRollup[]|{name,status,conclusion,detailsUrl}]}'
for run in 34566379642 34566379668; do
  printf '\n### workflow_run=%s\n' "$run"
  gh run view "$run" --repo "$repo" \
    --json headSha,status,conclusion,name,workflowName,jobs \
    --jq '{headSha,status,conclusion,name,workflowName,jobs:[.jobs[]|{name,status,conclusion}]}'
done

Length of output: 200661


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo='ContextualWisdomLab/pg-llm-batch'
run='34566379642'

printf '%s\n' '--- repository workflow definitions that invoke the pg8000 smoke ---'
fd -t f -e yml -e yaml .github . 2>/dev/null | while IFS= read -r file; do
  if rg -n -C 10 'smoke_pg8000_candidate_postgres|PG8000_CANDIDATE_CONTAINER|PG8000_CANDIDATE_PASSWORD_FILE' "$file"; then
    printf '\n### %s\n' "$file"
  fi
done

printf '%s\n' '--- successful runtime-smoke job steps and log lines ---'
gh run view "$run" --repo "$repo" --job 103159287394 --json name,steps \
  --jq '{name,steps:[.steps[]|{name,status,conclusion,number}]}'
gh run view "$run" --repo "$repo" --job 103159287394 --log \
  | rg -n -C 4 '(smoke_pg8000_candidate_postgres|Python [0-9]+\.[0-9]+|pg8000|remote TLS|TLS)' || true

printf '%s\n' '--- pg8000 1.31.5 TLS socket wrapping ---'
workdir="$(mktemp -d)"
trap 'rm -rf "$workdir"' EXIT
curl --fail --silent --show-error --location \
  'https://files.pythonhosted.org/packages/source/p/pg8000/pg8000-1.31.5.tar.gz' \
  --output "$workdir/pg8000-1.31.5.tar.gz"
tar --extract --gzip --file "$workdir/pg8000-1.31.5.tar.gz" \
  --to-stdout '*/src/pg8000/core.py' > "$workdir/core.py"
rg -n -C 16 '(ssl_context|wrap_socket|server_hostname)' "$workdir/core.py"

Length of output: 1942


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo='ContextualWisdomLab/pg-llm-batch'
run='34566379642'
job='103159287394'

printf '%s\n' '--- workflow definitions ---'
fd --hidden --no-ignore -t f -e yml -e yaml . | while IFS= read -r file; do
  if rg -q 'smoke_pg8000_candidate_postgres|PG8000_CANDIDATE_CONTAINER|PG8000_CANDIDATE_PASSWORD_FILE' "$file"; then
    printf '\n### %s\n' "$file"
    rg -n -C 12 'smoke_pg8000_candidate_postgres|PG8000_CANDIDATE_CONTAINER|PG8000_CANDIDATE_PASSWORD_FILE|matrix:|python-version' "$file"
  fi
done

printf '%s\n' '--- successful runtime-smoke job metadata and steps ---'
gh api "repos/$repo/actions/jobs/$job" \
  --jq '{name,conclusion,started_at,completed_at,steps:[.steps[]|{number,name,status,conclusion}]}'

printf '%s\n' '--- successful runtime-smoke log evidence ---'
gh run view "$run" --repo "$repo" --job "$job" --log \
  | rg -n -C 5 '(smoke_pg8000_candidate_postgres|python-version|Python [0-9]+\.[0-9]+|pg8000|remote TLS|TLS)' || true

printf '%s\n' '--- pg8000 1.31.5 TLS socket wrapping ---'
workdir="$(mktemp -d)"
trap 'rm -rf "$workdir"' EXIT
curl --fail --silent --show-error --location \
  'https://files.pythonhosted.org/packages/source/p/pg8000/pg8000-1.31.5.tar.gz' \
  --output "$workdir/pg8000-1.31.5.tar.gz"
tar --extract --gzip --file "$workdir/pg8000-1.31.5.tar.gz" \
  --to-stdout '*/src/pg8000/core.py' > "$workdir/core.py"
rg -n -C 16 '(ssl_context|wrap_socket|server_hostname)' "$workdir/core.py"

Length of output: 138735


@seonghobae Review complete for exact head 11355fc8a3bf6fecadcdf34c2acc21ada9cbb2f1.

I found no blocking issue in the four-file delta from b68a975becc93841dbfea818beccb8119f2f6944.

  • Pg8000DriverAdapter creates a fresh SSLContext(PROTOCOL_TLS_CLIENT) for every non-loopback host.
  • The context enables VERIFY_X509_PARTIAL_CHAIN | VERIFY_X509_STRICT.
  • The context loads the host default CA store through load_default_certs().
  • The adapter rejects the context unless check_hostname is True, verify_mode == CERT_REQUIRED, and keylog_filename is None.
  • The construction failure boundary raises the fixed diagnostic PostgreSQL TLS policy is unavailable before pg8000 receives connection authority.

The authority split is correct.

  • load_default_certs() retains host and platform CA-store authority. This includes SSL_CERT_FILE or SSL_CERT_DIR where the platform supports them.
  • Direct SSLContext(PROTOCOL_TLS_CLIENT) construction does not inherit SSLKEYLOGFILE.
  • The regression test confirms that the constructed remote context has no key-log filename.
  • The adapter also rejects a context that has a key-log sink, disabled hostname checks, or a non-required verification mode.

The remote TLS boundary is fail-closed.

  • Only localhost, IPv4 loopback addresses, and IPv6 loopback addresses use the deliberate local-development exception.
  • Private addresses, service DNS names, and other non-loopback hosts receive the verified context.
  • pg8000 1.31.5 passes the supplied connection host to wrap_socket(..., server_hostname=host).
  • Therefore, the context performs both CA-chain verification and DNS/IP peer-identity verification.
  • If the remote PostgreSQL server refuses TLS, pg8000 raises when ssl_context is supplied. It does not take its ssl_context=None plaintext-fallback path.

The real PostgreSQL smoke provides the required remote acceptance.

  • It uses the container bridge IP and rejects loopback or unspecified addresses.
  • It proves a trusted CA plus matching IP SAN succeeds and reports TLS through pg_catalog.pg_stat_ssl.
  • It proves an unrelated CA fails.
  • It proves a CA-trusted certificate with a mismatched IP SAN fails.
  • It proves a TLS-disabled remote server fails without plaintext downgrade.
  • It uses RFC 5280-conforming ephemeral CA and leaf extensions. It does not weaken strict X.509 validation.
  • CI ran this smoke successfully on Python 3.10, 3.12, and 3.14.

The inherited behavior remains intact.

  • The candidate adapter still validates one final host after explicit service resolution.
  • The wrapper changes only the ssl_context argument at the raw pg8000 connection seam.
  • The validated port conversion, finite timeout forwarding, selector grammar, service-file authority, transaction behavior, thread affinity, JSONB handling, and SQLSTATE classification remain unchanged.
  • ADR 0023 matches the source and test behavior.

I verified the exact-head acceptance evidence.

  • CI 34566379642 succeeded for 11355fc8a3bf6fecadcdf34c2acc21ada9cbb2f1.
  • Release Acceptance 34566379668 succeeded for the same commit.
  • The PR remains Draft.

You are interacting with an AI system.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current-head review on be121f6300d939e4fe47a0d9950cd73821a95642: fresh review found that the prior remote-TLS diagnostic boundary normalized Python/OpenSSL ssl.SSLError but did not cover pg8000 1.31.5's DB-API InterfaceError path when a server refuses SSL. The previous real PostgreSQL negative-TLS helper also accepted any exception, so no-downgrade could pass without proving the package's fixed diagnostic boundary. Test-first 09a8e315... pinned the admitted server-refusal shape and unrelated-interface preservation; source child ec3676b4... added only the exact pg8000 refusal normalization; real-smoke child f93ac63e... now requires Pg8000DriverTlsPolicyError("PostgreSQL TLS policy is unavailable") with no cause for every negative TLS case. Exact 06e7723... then produced a real repository RED at CI 34587773445 because the new classifier's missing-InterfaceError-authority path broke the 100% production line-coverage gate; test-only be121f63... covered that branch without weakening the gate. Exact-current CI 34587906305 and Release Acceptance 34587906307 are both terminal success. This is deliberately COMMENT, not approval: #342/#323 remain Draft descendants, root #233 is not protected-integrated, the central compatibility prerequisite is unresolved, and no qualifying independent current-head APPROVED review exists.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current-head security review: the preceding content-free TLS diagnostic still retained sensitive lower-layer exceptions in Python's implicit __context__ because the replacement error was raised inside the active handler. Test-first a1d7baacd6a17d5d517cdfbae8a1e2cf037cf0fb required __cause__ is None and __context__ is None for trust-context construction, certificate-verification, and admitted pg8000 SSL-refusal failures; CI 34597113568 produced a real RED in Python 3.14 unit tests and the 100% coverage lane. Exact head 609ca9062ef16e14ce0b3d9ff25a5ce14efbd800 moves the fixed TLS-policy raise outside each sensitive handler while preserving unrelated DB-API failures. CI 34597262650 and Release Acceptance 34597262656 are terminal success, including the real PostgreSQL smoke. This is a COMMENT, not self-approval; Draft/integration/release gates remain.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current-head verification on 2dd438ffe9110072078190b512bc90fa011a538e: I tested a suspected trust-context confidentiality gap instead of accepting it by inspection. Test-first c2ccffdf23a34e213da0eed8f76af4bf01f06cb7 injects ssl.SSLError("secret default CA loader detail") from _new_remote_ssl_context() and requires the existing fixed TLS-policy error with no cause/context and no raw-driver call. The predecessor production code already passed because Python ssl.SSLError is an OSError subclass, so this is a falsified finding rather than RED evidence. Intermediate 582b3b36... made that subtype redundant in the catch tuple; ordinary child 2dd438ff... removes the non-causal source edit and restores the production adapter blob exactly to predecessor 609ca906..., retaining only the focused regression as net delta. Release Acceptance 34608256698 is terminal success; CI 34608256734 is still running, with completed quality and Python 3.11–3.14 unit jobs GREEN at this review. This is deliberately COMMENT, not self-approval; current-head terminal CI, independent approval, parent/protected integration and immutable release remain separate gates.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Terminal follow-up on exact 2dd438ffe9110072078190b512bc90fa011a538e: CI 34608256734 and Release Acceptance 34608256698 are both completed/success. The exact-current quality lane passed compile, Ruff, 100% production docstrings, 100% production line coverage, lock/package build, and supported Python unit lanes; the existing component/PostgreSQL acceptance also completed successfully. This confirms the retained SSL-construction regression without introducing a production-code delta relative to predecessor 609ca906.... The review finding remains classified as falsified rather than repaired: ssl.SSLError was already covered through OSError. This remains COMMENT, not self-approval; independent approval, #323/#233 protected ancestry, central compatibility, and immutable release are still separate gates.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor Author

Fresh independent tool review has now completed on exact current head 2dd438ffe9110072078190b512bc90fa011a538e. CodeRabbit run 0d205aef-798d-4b56-91b2-711ed050967e reviewed the only net delta from 609ca9062ef16e14ce0b3d9ff25a5ce14efbd800 (tests/test_pg8000_remote_tls_identity.py) and reported no actionable comments, with merge risk minimal up to exact 2dd438....

This closes the current-head review request only; it is not a qualifying GitHub APPROVED review. Formal review inventory remains COMMENTED-only, so Draft/protected-integration/release gates remain unchanged. No source churn is warranted from this review.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fresh exact-head governance follow-up on 2dd438ffe9110072078190b512bc90fa011a538e: CodeRabbit run 0d205aef-798d-4b56-91b2-711ed050967e reviewed the only net delta from 609ca906... through this exact head and reported no actionable comments with minimal merge risk. Repository CI 34608256734 and Release Acceptance 34608256698 remain terminal GREEN, and the inline-thread inventory is empty. This is evidence only, not self-approval: formal reviews remain COMMENT-only and no qualifying independent APPROVED exists.

The central prerequisite description is also narrower than older comments: .github#2040 has completed ordinary/non-force reconciliation to protected .github/main@cb0872c9a20d5584703dffacca65c096fc034c6c at 3b2de64c2c4c95c56d2f5099a480a0825304d038; its exact-head CodeQL run 34629071379 remains failed on the central producer/consumer settlement path. The pg TLS source lane must stay unchanged while that owner repair and the immutable contextual-orchestrator release boundary (contextual-orchestrator#1083) settle. Draft remains correct; no no-op commit, synthetic status, provider/model/timeout override, force update, bypass, or predecessor-evidence transfer is justified.

@seonghobae seonghobae added bug Something isn't working priority: high labels Sep 12, 2026 — with ChatGPT Codex Connector

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current-head verification on d59df8ff14f8d82ac01f866cb38889407634cc46: this is an ordinary two-parent, non-force restack of the prior TLS-security head 2dd438ffe9110072078190b512bc90fa011a538e onto current parent #323 34858ef2f96307273853901bef932ec2958e4931. The merge base is exactly current #323, and the effective relative surface remains the same four owned paths; #323's intervening root-document authority cleanup is preserved rather than copied back into this branch. Fresh exact-head CI 34754512826 and Release Acceptance 34754512825 are both terminal SUCCESS, and the inline-thread inventory is empty. This COMMENT verifies the structural repair and exact-head repository evidence; it is deliberately not self-approval. #342 remains Draft because parent #323/root #233 and central required-workflow/review prerequisites are not protected-integrated, and branch-local GREEN is not immutable-release authority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant