diff --git a/.claude/knowledge/journal/2026-12-03.md b/.claude/knowledge/journal/2026-12-03.md new file mode 100644 index 00000000..50f3e3fc --- /dev/null +++ b/.claude/knowledge/journal/2026-12-03.md @@ -0,0 +1,21 @@ +# Learning journal 2026-12-03 + +### 2026-12-03: Configuration and authentication — Kernel's single proxy plus bypass list cannot express Go's per-destination NO_PROXY routing +**Context:** In PR #607, the warehouse's proxy decision was applied to every kernel destination (CloudFetch storage, OAuth), so NO_PROXY entries for those hosts were lost. Translating NO_PROXY into the kernel's bypass list was lossy: it has no ports, and a leading dot also bypasses the apex. The remaining gap is tracked in #611. +**Rule:** When forwarding proxy env to a backend that takes one proxy URL and a host-only bypass list, give the warehouse Go's exact http.ProxyFromEnvironment decision, route storage/OAuth hosts with HTTPS_PROXY, pass built-in loopback entries through the same warehouse-conflict filter, document each approximation, and assert per-destination proxy/direct decisions in tests. + +### 2026-12-03: Configuration and authentication — Reject an unsupported proxy only when a destination actually selects it +**Context:** In PR #607, an env socks4:// HTTPS_PROXY failed the connection even when NO_PROXY bypassed the warehouse. A PAT query with inline results needs no proxy in that case, so the reviewer asked for the eager rejection to be removed. +**Rule:** Validate an unsupported proxy scheme lazily, only when a destination's routing decision selects that proxy, and add a bypassed-warehouse test row that expects success. + +### 2026-12-03: Configuration and authentication — Read proxy env from the same once-per-process snapshot as http.ProxyFromEnvironment +**Context:** In PR #607, the warehouse decision came from http.ProxyFromEnvironment, which caches the env once per process. The fallback proxy and bypass list came from live os.Getenv reads, so the two could disagree if the env changed later. +**Rule:** Whenever driver code reads HTTP(S)_PROXY/NO_PROXY next to http.ProxyFromEnvironment, read them once with a sync.Once right after the stdlib snapshot, and document that later env changes don't apply. + +### 2026-12-03: Verification and dependencies — Setter-only cgo tests don't prove native feature support +**Context:** In PR #607, new kernel_test.go rows called a C setter that stores the SOCKS URL without validating it. Those rows passed against the old kernel that rejects SOCKS, so they proved nothing. The feature also needed KERNEL_REV moved to a merged kernel commit, with published bindings to follow in a release. +**Rule:** Don't add tests that only marshal arguments through a storing C setter as evidence of native support; prove the feature through a pinned KERNEL_REV source build or wire tests, and treat moving the published bindings pin as a separate release prerequisite. + +### 2026-12-03: Verification and dependencies — Test the go.mod minimum Go version with GOTOOLCHAIN=local and go-version-file +**Context:** PR #609 lowered go.mod to 1.26.11. It replaced hardcoded setup-go versions in CI and bot prompts with go-version-file: go.mod, and added min/latest matrix lanes with GOTOOLCHAIN=local. The Go cache key now comes from steps.setup-go.outputs.go-version. +**Rule:** Point setup-go at go-version-file: go.mod instead of a hardcoded version, set GOTOOLCHAIN=local in the minimum-version lane so Go can't auto-switch to a newer toolchain, and build cache keys from the resolved setup-go output version. diff --git a/.claude/knowledge/lessons.md b/.claude/knowledge/lessons.md index db104f10..91bd046a 100644 --- a/.claude/knowledge/lessons.md +++ b/.claude/knowledge/lessons.md @@ -1,6 +1,6 @@ # Lessons - + ## Configuration and authentication - L-0001 (1×, #446): Verify kernel session parameters and proxies separately from Thrift: kernel allowlists configuration keys and supports HTTP(S) proxies, while Thrift may accept additional keys/schemes. @@ -25,6 +25,11 @@ - L-0020 (1×, #556): Check integer duration values against MinInt64/unit and MaxInt64/unit before multiplication; report overflow with the parameter name. - L-0060 [phase=review] (1×, #566): Kernel applies case variants of client-only session-conf keys in sorted byte order, so the canonical lowercase key wins; check pinned session.rs before flagging map-order nondeterminism. - L-0061 (1×, #566): Forwarding a formerly inert option to a backend is a behavior change: label it so in CHANGELOG, explain the effect of existing tuned values, and test set values, not only unset. +- L-0090 (1×, #581): Build connect, proxy and OAuth endpoints from one normalize-host-then-join-port helper: trim trailing slashes, don't double embedded ports, re-bracket bare IPv6 (net.ParseIP; url.Hostname drops brackets). Test each consumer and ParseDSN. +- L-0091 (1×, #581): In host errors, redact everything before the last '@' and omit url.Parse error text; test passwords containing '/', '?', '#' and percent-escapes. +- L-0092 (1×, #607): Forwarding proxy env to kernel's single proxy plus host-only bypass list is lossy: give the warehouse Go's exact ProxyFromEnvironment decision, route storage/OAuth via HTTPS_PROXY, document approximations, test per-destination. +- L-0093 (1×, #607): Reject an unsupported proxy scheme lazily, only when a destination selects it; test a NO_PROXY-bypassed warehouse that succeeds. +- L-0094 (1×, #607): Read HTTP(S)_PROXY/NO_PROXY once via sync.Once alongside http.ProxyFromEnvironment's per-process snapshot so decisions agree; document that later env changes are ignored. ## Native boundaries and lifecycle - L-0021 (1×, #450): Never place fabricated Go pointers or cgo.Handle values into C pointer slots. Use NULL with a global sink or a real C allocation. @@ -50,14 +55,15 @@ - L-0039 (1×, log:2026-11-12): Duplicate-name support can differ between Arrow schemas, struct/cdata imports and IPC. Test both kernel and Thrift boundaries against the current Arrow version. - L-0040 (1×, #550 #535): New Arrow code uses github.com/apache/arrow-go/v18 RecordBatch APIs; avoid copying legacy arrow/go/v12 imports. - L-0041 (1×, #563 #567): Derive logical result types from field metadata with ColumnTypeInfoForField, including empty SEA string-backed schemas; test zero-row, NULL-only and populated results on both backends. +- L-0095 (1×, #605): Render DATE and TIMESTAMP_NTZ (incl. nested) from the unshifted Arrow value with a zone-free layout; apply session location only to zoned TIMESTAMP. Pin output for negative and 5-digit years. ## Verification and dependencies -- L-0042 (3×, #458 #510 #567): Compile/vet relevant tagged tests explicitly, including databricks_kernel,e2e where needed, and register E2E names in nightly filters. Default unit tests omit tagged coverage. +- L-0042 (4×, #608 #605 #567): Compile/vet relevant tagged tests explicitly, including databricks_kernel,e2e where needed. Name Thrift live tests TestE2E* (nightly runs -run '^TestE2E'); exclude via -skip with a reason, not an allowlist. - L-0043 (1×, #458): Test seams must call real production methods; parallel copies of native calls prove signatures without proving production wiring. - L-0044 (1×, #457): Telemetry duration units follow receiver schema: bare names are seconds, and _ms/_millis names are milliseconds. - L-0045 (2×, #440): Publish real dependency versions: replace directives do not apply downstream, and module graph resolution requires every go.mod dependency regardless of build tags. - L-0046 (1×, #440): Verification, checksum and lint gates must propagate failures; do not hide them with unconditional success. -- L-0047 (2×, #463 #440 #469): Confirm which archive the build links. Default kernel builds use published bindings; local source builds need explicit go.work/replace routing, and KERNEL_REV alone does not ship native behavior. +- L-0047 (3×, #607 #463 #440): Confirm which archive the build links. Default builds use published bindings; source builds need go.work/replace, and KERNEL_REV alone ships nothing. Tests via a storing C setter don't prove native support. - L-0048 (1×, #516): Linter fixes must preserve production pointer/value error types; use interface-typed test variables or narrowly justified suppressions. - L-0049 (1×, #516): Fork CI without registry credentials must install tools from prebuilt releases rather than go install; keep fork-behavior comments accurate. - L-0050 (1×, #525): Allocation/performance changes need AllocsPerRun assertions or benchmarks; output parity alone cannot detect a performance regression. @@ -66,6 +72,7 @@ - L-0053 (1×, #536): Prove no-storage-egress behavior through a workspace-only CONNECT proxy, asserting complete results and zero blocked attempts. - L-0054 (2×, #559 #558 #555): Join test goroutines with bounded cleanup and context cancellation. Synchronize with channels and report callback failures without FailNow/Fatal from foreign goroutines. - L-0055 (1×, #561): Root Go files must remain package dbsql/dbsql_test even behind tags; declare developer tools with the go.mod tool directive. +- L-0096 (1×, #609): Use setup-go go-version-file: go.mod, not hardcoded versions; set GOTOOLCHAIN=local in the minimum-version lane, and key caches on the resolved setup-go version output. ## Bot workflow - L-0056 (1×, #442): Use concrete serving-endpoints/model/invocations MODEL_ENDPOINT URLs; anthropic/invocations produces an invalid translated CLI route.