Repository navigation
Bind ordered UK Scenario modifiers to executable receipt plans - #756
Merged
Merged
Conversation
5 tasks
MaxGhenis
marked this pull request as ready for review
November 13, 2026 00:09
anth-volk
added a commit
that referenced
this pull request
Nov 13, 2026
Main moved to 6.19.0 (#752, #754, #756, #758). Only the two TRACE TROs conflicted; both were regenerated from the merged manifest with `bundle.py generate --include-tros --strict-tros`, so they now name bundle 6.19.0 and its manifest digest. `bundle.py check --published-spm --include-tros --strict-tros` and `uv lock --check` pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #755
Native Scenario sums can wrap several modifiers in an internal closure, which the phase-aware receipt binder from #752 refuses. Add
build_ordered_scenarioto construct a native Scenario from trusted module-level callables and bind its actual execution order. It applies the complete parameter map once before loading data, then preserves each phase's ordered modifiers and repeated occurrences.BoundOrderedScenarioexposes that Scenario, an immutable plan and a live identity. The plan records the adapter, complete parameters and each modifier's source, module source, typed defaults and repository revision. Live checks refuse changes to those inputs or the native timing.ordered_scenario_reform_identityvalidates and recomputes the plan's identity from data without importing carried module names.bind_ordered_scenario_planchecks a worker's actual trusted functions against the complete plan before execution; trusted pickle transport rebinds on load.Plans with modifiers use
policyengine-uk.phased_scenario_composition/v1. Parameter-only and empty plans retain their existing identities, as do valid legacy Scenario, phased Scenario and composition inputs. Legacy composition refuses phase flattening. Public models, schema, reproducible vectors, documentation and a standalone example accompany the API.Callers supply the resolved parameter map and retain conflict, structural-consistency, approval and data checks. The API accepts trusted module-level leaves; it does not sandbox Python or prove write sets.
Validation: 115 focused tests pass on both Python 3.13.13 and 3.14.7 (
--noconftest, 867 deselected): 57 ordered-API cases, 29 phased-Scenario cases and 29 legacy regressions, including real native construction and spawn transport. Schema/vector reproduction, full Ruff 0.17.5 lint and format checks, and all 14 repository CI checks pass, including the full Python 3.11–3.14 matrix. The full standalone example also passes against a wheel built from commit12300f3b; its synthetic state advances from 1 to 4 to 9 through the actual adapters.axiom: n/a: execution and provenance API; no policy-rule changes.