Phase 9b: NullNamespace sentinel for skipped namespace observe#556
Merged
Muizzkolapo merged 5 commits intoMay 17, 2026
Merged
Conversation
… (red) Tests assert that NullNamespace(reason='skipped') in field_context resolves observe/passthrough fields to None instead of crashing. Currently fails because _resolve_missing_field only recognizes None, not NullNamespace instances.
Introduce NullNamespace(reason="skipped") sentinel that replaces plain None when DependencyNamespaceBuilder encounters a null/absent upstream namespace. This lets downstream code introspect WHY a namespace is null (skipped vs filtered — Phase 9c will add the filtered reason). Changes: - _resolve_missing_field() uses is_null_namespace() to handle both NullNamespace instances and legacy None - DependencyNamespaceBuilder.build() wraps None deps in NullNamespace - Guard evaluator ast_nodes.py recognizes NullNamespace via helper - Existing tests updated to use is_null_namespace() assertions
Replace bare "skipped" string with REASON_SKIPPED constant and use pre-built SKIPPED_NAMESPACE singleton to avoid repeated allocation.
prompt/service.py:442 used `v is None` to identify null namespaces for Jinja error enrichment. With NullNamespace sentinel, this check missed skipped namespaces, producing unhelpful error messages.
bdfdfe7
into
integration/batch-online-unification
1 check passed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
NullNamespace(reason="skipped")sentinel class replacing plainNonefor guard-skipped upstream namespaces_resolve_missing_field()usesis_null_namespace()to handle bothNullNamespaceand legacyNoneDependencyNamespaceBuilder.build()wraps null deps inNullNamespaceinstead of storingNoneast_nodes.pyrecognizesNullNamespacevia_is_null_or_empty_namespace()helperis Nonetois_null_namespace()assertionsVerification
NullNamespace)ruff format --checkandruff checkclean