[codex] Add observer execution overrides#48
Merged
Conversation
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.
Summary
This is the second runtime-DI slice for Issue 45.0.
It extends
ExecutionOverridesfrom materializers to observers, adds the publicScopehelper for compiled step keys, and fixes concrete builtin materializers (for exampleint,list,tuple) so they are accepted as concrete callables instead of misclassified during factory detection.What changed
ObserverRegistrytoExecutionOverridesPIPELINE_SCOPEconstant for pipeline-level observer overridesScopehelper for sub-pipeline / compiled step keysDagsourcemetadata instead of mutating the DAGScopekeys for both materializers and observersis_factory()defensive so builtin concrete materializers likeintare treated as concrete callablesScopeexamplesWhy
The previous PR introduced runtime overrides for materializers. The next logical step in Issue 45.0 was observers, because they already have a clear compiled contract in the DAG:
dag.pipeline_observersfor pipeline lifecyclenode.observersfor effective step/materialization observers, withsourcemetadataAt the same time, the design document already called out that sub-pipeline override keys should not depend on handwritten magic strings. This PR implements that public helper as
Scope, while keeping executors ignorant of sub-pipelines.Contract boundary
This PR keeps the intended boundary explicit:
PIPELINE_SCOPEaffects both pipeline lifecycle events and the inherited pipeline portion of step/materialization observersScopeis resolved before execution; executors still only consume flat DAG step namesExamples
Impact
Tests can now silence production observers or replace them surgically at runtime without patching globals or rebuilding alternative pipeline definitions, including within included sub-pipelines.
This moves
ExecutionOverridescloser to the target design, while still keepingresourcesout of scope for this PR.Validation
uv run pytest