Repository navigation
Bring the extension libraries up to cel-go v0.33 - #14
Merged
5 commits merged intoOct 30, 2026
Merged
5 commits merged into
5 commits merged into
Conversation
The core scripts enable "every overload, type and macro registered so far" in standard. On a fresh install that is the core alone, because the extension scripts run afterwards. But the installer is also the upgrade, and run over an installed schema the same sweep picks up every extension's items and every consumer registration: upgrading 0.0.2 in place put 139 extension overloads, 16 macros and 3 types into standard, plus the consumer's own overload. The suite stayed green, because a wider env breaks no corpus case -- which is exactly the failure CLAUDE.md warns about. The sweep now takes only rows no env claims yet whose implementation lives in the cel schema, and the installer drops from standard what a shipped extension env also lists, repairing schemas already reinstalled. A consumer row swept in earlier cannot be told from one put in standard on purpose, so it stays. The upgrade check asserts standard comes out of an upgrade as narrow as it went in. The origin column of rds-distribution decision 7 is the general fix; this guard is what the installer needs until it lands.
cel-go v0.33 added hasOnly, hasAny, hasAll and hasExactly as lists
library version 5. They are the sets library's contains / intersects /
equivalent spelled as list methods, which is the form an authorization
condition reaches for ("the token's scopes include all of these"),
so they are worth having rather than leaving the lists env a version
behind the reference.
base64.encodeUrl / decodeUrl arrived with encoders version 2. Tokens and identifiers that reach a policy are usually base64url, and re-alphabetising them in CEL by hand is error-prone. The rest of version 2 (json and yaml) is deliberately left out; see docs/CONFORMANCE.md.
first(), last(), optional.unwrap and unwrapOpt (version 2) had never been registered -- the oracle enabled them, but no corpus case calls them, so nothing noticed. optional.hasValue(v) is version 3. optMap / optFlatMap already expanded the way version 4 does, binding a non-identifier target once, so only the comment changes.
The corpus exercises a fraction of each extension library, and that is how the optionals list helpers went missing unseen: the oracle declared them, no case called them. TestLibraryOverloads now compares each env's registry rows with the overload ids cel-go declares and fails on any gap not named in a printed known-missing list; TestLibraryCases runs the functions the corpus never reaches through both implementations with cel-go's outcome as the expectation. With that in place the oracle drops the version pins on lists and optionals. encoders stays held at version 2: json.encode / json.parse and the yaml functions are not implemented, and the reasons are in docs/CONFORMANCE.md.
1db81b6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #13. Merge #13 first. Until it lands, this diff also includes #13's commit.
Implements the library surface added in cel-go v0.33.1 in PL/pgSQL. With this, the oracle runs every library at its latest version except
encoders.Implemented
hasOnly,hasAny,hasAll,hasExactly(list_*_list)base64.encodeUrl,base64.decodeUrloptional.hasValue(v)(optional_hasValue_value)first(),last(),optional.unwrap,unwrapOptThe optionals v2 list helpers were already declared by the oracle in earlier releases but had never been registered here. No corpus case calls them, so nothing noticed until now.
optMap/optFlatMapalready expanded the way version 4 does, binding a non-identifier target exactly once, so only their comment changes.Not implemented (encoders stays pinned at version 2)
json.encode(v1),json.parse(both overloads),yaml.encode,yaml.parse(both overloads). docs/CONFORMANCE.md gains a "Library coverage beyond the corpus" section that explains why:json.parse(s, T)converts through cel-go's type provider.json.encodedepends on Go-specific output details: float formatting, HTML-safe escaping, quoting integers above 2^53, and protojson for timestamps and durations.A port that matched those only partly would return subtly different strings, which is worse than a function that clearly doesn't exist.
New tests
TestLibraryOverloadscompares, for every env, the overload ids cel-go declares with the registry'senv_itemrows. It fails on:Known-missing now holds
__not_strictly_false__(a deprecated alias),cel_block_list(cel-go-internal) and the six json/yaml ids. This is the test that would have caught the missing optionals helpers.TestLibraryCaseshas 68 expressions the corpus never reaches. Each runs through cel-go, and cel-go's outcome becomes the expectation for cel4postgres. Every case also states which outcome it expects (value, evaluation error, or check error), so it can't pass just because both sides rejected an undeclared function. A mutation check confirmed it catches a wrong implementation: withhasAnyswapped forhasAll, 4 cases fail.internal/oracle/options.go: theListsVersion(4)andOptionalTypesVersion(2)pins are gone; encoders is held atEncodersVersion(2).Results
go test ./...: passes on a fresh install, and on 0.0.2 → this build upgraded through both plain and pg_tle (scripts/upgrade-check.shfrom Test upgrades from the previous release #12).