Break to strict authorization and declared-target contract for Python 0.1.0 - #13
Merged
Merged
Conversation
Contributor
Merging this PR will improve performance by 52.76%
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
terjekv
marked this pull request as ready for review
September 6, 2026 12:31
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.
Python 0.1.0 adopts one strict REST 0.1.0 contract and the declared label-target configuration. Early releases prioritize correctness over compatibility. Remove the single-result check wrappers, legacy health methods, misspelled decision alias, tagged decisions, scalar policy responses, and omitted-field defaults.
Authorization now requires canonical decision strings, consistent permit IDs/arrays, complete policy versions, ordered batch indices, accurate counts, and matching versions. All four synchronous/asynchronous authorization methods require exactly one response with the matching ID for every submitted request. Empty batches and batches with failed items never satisfy
all_allowed(). A separateSchemaVersionrepresents schema revisions without manufacturing policy generation fields.Policy versions are immutable and interned in a bounded typed cache keyed by all four required fields. Invalid values cannot enter the cache, boolean generations cannot alias integers, and subclasses remain uncached. Current status metadata and permit Cedar IDs are required. The dated changelog and
MIGRATION.mddocument every breaking API, the exact target syntax, format 2 manifests, and archive rebuilding/re-signing.CI runs the full live suite against the published REST 0.1.0 container, pinned by immutable digest; the old server matrix is removed. Compose uses a pinned HTTP fixture image, checks both served configuration files before starting REST, and requires loaded policy/label metadata before tests run. Startup failures fail the suite and cleanup remains bounded. CodSpeed retains the existing benchmark suite and performance checks. Package version/lockfile are 0.1.0, and the wheel/source package are inspected to exclude test, editor, and agent artifacts.
Validation: 94 unit/model cases, 33 benchmark cases, and 29 live server integration cases pass. Pyright and BasedPyright report zero errors or warnings. Wheel and source distribution build successfully. CodSpeed reports no regressions on final head 71b7880: one improved, 31 untouched, and one new benchmark replacing the removed check wrapper. CodSpeed marks the retired wrapper benchmark as skipped. Earlier comparisons warned about different runtime environments, so the reported improvement is not treated as a controlled measurement. The final Compose suite also passes locally; this host requires invoking the configured fixture health check manually because its rootless Podman scheduler does not run it.