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) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UfmeJ533rQDnPBkMtjerV6
This commit is contained in:
Jonathan M Hsieh
2026-09-14 20:28:18 +00:00
co-authored by Claude Opus 5
parent bcb822a291
commit 9661fcfb5f
+7 -3
View File
@@ -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 {