Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .claude/knowledge/journal/2026-12-03.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Learning journal 2026-12-03

### 2026-12-03: Backend contracts and configuration — Document env-var proxy parsing separately from explicit config validation
**Context:** PR #1082 documented kernel SOCKS proxies read from HTTPS_PROXY/ALL_PROXY. A blocking review found the draft said bare `socks://` was rejected. The environment-variable parser actually ignores unsupported schemes and falls back to ALL_PROXY or a direct connection; only explicit ProxyConfig.url validation rejects them. A second finding said 'any other scheme is ignored' wrongly covered ordinary http(s) proxies too.
**Rule:** When documenting proxy or other settings read from environment variables, check what the env-var parsing path does with unsupported values (ignore and fall back vs. reject), since it can differ from validation of the same setting passed as explicit config; name the exact affected values, and limit fail-closed claims to the case that really fails closed.
9 changes: 7 additions & 2 deletions .claude/knowledge/lessons.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Lessons

<!-- distilled-through: 2026-11-18 -->
<!-- distilled-through: 2026-12-03 -->

## Backend contracts and configuration
- L-0001 (1×, log:2026-08-13): When changing cursor.description type_code strings, update every downstream conversion branch that matches them.
Expand All @@ -16,7 +16,7 @@
- L-0011 (6×, #932 #925 #940): Gate optional Session kwargs through _kernel_session_accepts_kwarg and fail closed on introspection failure. Default-off options must preserve older wheels; explicit requirements need a released dependency floor and accurate support docs.
- L-0012 (2×, #930): Verify flags against materialized values and cursor.description on each backend. Shared client-side conversion toggles differ from options handled only by a backend.
- L-0013 (2×, #925 #933 #940): Test PyO3 kwarg filtering with fixed-signature fakes or real wheels; permissive MagicMock kwargs hide incompatible argument forwarding.
- L-0014 (1×, #925): Paths mirroring a routing decision must reuse its predicate exactly; truthiness and identity checks can disagree for non-bool inputs.
- L-0014 (2×, #1071 #925): Guards or paths mirroring a downstream routing decision must reuse its exact predicate and precedence so they never pre-empt the real error; test each precedence branch on guarded and skipped sides.
- L-0015 (1×, #948): Preserve Thrift's implicit OAuth default on kernel routing only when no explicit credential shape already determines the auth flow.
- L-0016 (1×, #948): After retries or fallback mutate kwargs, attribute failures and cleanup to the backend object that actually failed.
- L-0017 (1×, #948): Scope recovery-marker error translation to the RPC the recovery layer handles; unrelated calls must retain meaningful errors.
Expand All @@ -26,6 +26,10 @@
- L-0021 (1×, #985): SQL LIKE escape handling depends on preceding backslash-run parity; a one-character negative lookbehind cannot establish JDBC equivalence.
- L-0022 (2×, #1066 #1026): Validate integer options at the Python boundary: reject bool explicitly plus non-int and out-of-range values, test True alongside 0, negative, None, str and float, and clamp large values before native conversion.
- L-0048 (1×, #1066): Inject connector-derived session_conf defaults only when the user has not set the key under any letter case; copy rather than mutate the mapping, and test both override casings plus non-mutation.
- L-0059 (1×, #1071): Never echo user-supplied URIs in errors: show scheme+host[:port] (scheme only if it has @/%40), wrap urlsplit/.port and raise outside except or from None; test the secret is absent from message, __cause__, __context__.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Low — Lessons L-0059, L-0060, L-0061, L-0063 and the L-0014 update cite #1071, but the journal directory only has 2026-11-18.md and 2026-12-03.md. No 2026-12-01 journal exists, so these lessons have no source in the repo. Restore the 2026-12-01 journal, or drop the #1071-derived lessons and keep the distilled-through marker at 2026-11-18 until it lands.

🔀 Found by Claude Opus 5.5 · confirmed by the judge

- L-0060 (1×, #1071): Run validation for a new optional override only after the override-unset early return, so non-users behave as on main; add pass-through tests for odd inputs on the unset path.
- L-0061 (1×, #1071): When an option can redirect the target host, check per backend which host receives raw credentials in every flow (PAT, OAuth, federation token exchange) before calling a credential safe cross-origin.
- L-0062 (1×, #1082): Document env-var settings (e.g. proxies) from the env parsing path, which may ignore and fall back where explicit config rejects; name exact affected values and claim fail-closed only where true.

## Results and lifecycle
- L-0023 (2×, #1019): Verify server metadata and forwarded configuration behavior with live tests and an opposite-setting positive control; fabricated metadata or forwarding-only unit tests cannot establish server behavior.
Expand Down Expand Up @@ -57,3 +61,4 @@
- L-0045 (1×, #1004): Recheck capability claims after tool upgrades; replacing version numbers inside old support statements does not validate them.
- L-0046 (1×, #1013): Confirm targeted regression tests fail when their guarded check is removed; inject inputs where earlier sanitization cannot neutralize the case.
- L-0047 (1×, #1045): Secret-bearing CI steps must run Python isolated or from a neutral directory, preventing checkout modules from shadowing trusted imports.
- L-0063 (1×, #1071): When a session resolves or rewrites connection args, assert final values on the mocked backend constructor's call_args.kwargs via databricks.sql.connect, not only in the resolver helper.
Loading