Skip to content

Commit 5faebfc

Browse files
learn: retrospective learnings (#1068)
Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com> Co-authored-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>
1 parent b8259e4 commit 5faebfc

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Learning journal 2026-11-18
2+
3+
### 2026-11-18: Backend contracts and configuration — Injected session_conf defaults must yield to case-insensitive user overrides
4+
**Context:** PR #1066 forwarded `max_download_threads` to the kernel by adding `cloudfetch_max_chunks_in_memory` to `session_conf`. It adds the key only when no key matching it case-insensitively is already in the user's `session_configuration`. It builds a new dict so the caller's mapping is not changed, and tests check both lowercase and uppercase overrides and that the original dict is untouched.
5+
**Rule:** When injecting a connector-derived default into user-supplied session configuration, skip it if the user already set the key under any letter case, copy the mapping instead of mutating it, and test both override casings plus non-mutation.
6+
7+
### 2026-11-18: Backend contracts and configuration — Reject bool when validating positive-integer options forwarded to the kernel
8+
**Context:** PR #1066 validated `max_download_threads` with `isinstance(v, bool) or not isinstance(v, int) or v <= 0` in the kernel client before anything is forwarded. The invalid-value tests cover `True`, `0`, `-1`, `None`, `"4"` and `1.5`, and very large values are clamped to 256 before forwarding.
9+
**Rule:** Validate integer options at the Python boundary by rejecting bool explicitly along with non-int and out-of-range values, test True alongside 0, negative, None, str and float, and clamp large values before forwarding them to native config.
10+

‎.claude/knowledge/lessons.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Lessons
22

3-
<!-- distilled-through: none -->
3+
<!-- distilled-through: 2026-11-18 -->
44

55
## Backend contracts and configuration
66
- L-0001 (1×, log:2026-08-13): When changing cursor.description type_code strings, update every downstream conversion branch that matches them.
@@ -24,7 +24,8 @@
2424
- L-0019 (1×, #951): TLS certfile may contain both certificate and key; reject keyfile without certfile. Validate each identity file separately for readable, non-empty contents before load_cert_chain.
2525
- L-0020 (1×, #974): Before replacing permissive wire parsing with typed parsing, verify real server representations and test case, quoting and numeric/bool variants.
2626
- L-0021 (1×, #985): SQL LIKE escape handling depends on preceding backslash-run parity; a one-character negative lookbehind cannot establish JDBC equivalence.
27-
- L-0022 (1×, #1026): Reject bool explicitly when validating integer options before native conversion, so True/False cannot silently become 1/0.
27+
- 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.
28+
- 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.
2829

2930
## Results and lifecycle
3031
- 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.

0 commit comments

Comments
 (0)