From 9661fcfb5f3483825f4236e96d42aae804e85a70 Mon Sep 17 00:00:00 2001 From: Jonathan M Hsieh Date: Mon, 14 Sep 2026 20:28:18 +0000 Subject: [PATCH] docs(secrets): name both halves of the binding forward-compatibility contract The `SecretBinding` doc said an unknown delivery mode decodes rather than failing the FunctionVersion, but named only the `Unrecognized` variant. That is half the mechanism: the variant gives the wire somewhere to land, and `#[non_exhaustive]` is what denies callers an exhaustive match, so a mode added later arrives as a case they were already required to handle rather than as a break. Both are load-bearing and neither works alone -- without the attribute a caller could match `Env` and `Unrecognized` and still be broken by a third variant -- so the doc now says so, the same pairing `PythonRuntimeSpec` uses for runtimes. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01UfmeJ533rQDnPBkMtjerV6 --- rust/lancedb/src/function.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rust/lancedb/src/function.rs b/rust/lancedb/src/function.rs index c1d0d46c3..0bb842500 100644 --- a/rust/lancedb/src/function.rs +++ b/rust/lancedb/src/function.rs @@ -535,9 +535,13 @@ impl SecretReference { /// here, and the rules that are per-Function -- how many Secrets a Function may /// bind, which ones it needs -- stay answerable from one place. /// -/// Unknown kinds decode rather than failing the whole FunctionVersion, as -/// [`PythonRuntimeSpec`] does for runtimes. The payload is intentionally not -/// retained: the client does not proxy catalog values. +/// A mode this client does not know decodes rather than failing the whole +/// FunctionVersion, the way [`PythonRuntimeSpec`] handles a runtime it does not +/// know. That takes both halves: [`SecretBinding::Unrecognized`] gives the wire +/// somewhere to land, and `#[non_exhaustive]` denies callers an exhaustive +/// match, so a mode added later arrives as a case they were already required to +/// handle rather than as a break. The payload is deliberately dropped: the +/// client does not proxy catalog values. #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] #[non_exhaustive] pub enum SecretBinding {