Skip to content

Phase 9b: NullNamespace sentinel for skipped namespace observe#556

Merged
Muizzkolapo merged 5 commits into
integration/batch-online-unificationfrom
unify/phase-9b-observe-skipped-ns
May 17, 2026
Merged

Phase 9b: NullNamespace sentinel for skipped namespace observe#556
Muizzkolapo merged 5 commits into
integration/batch-online-unificationfrom
unify/phase-9b-observe-skipped-ns

Conversation

@Muizzkolapo
Copy link
Copy Markdown
Owner

Summary

  • Introduces NullNamespace(reason="skipped") sentinel class replacing plain None for guard-skipped upstream namespaces
  • _resolve_missing_field() uses is_null_namespace() to handle both NullNamespace and legacy None
  • DependencyNamespaceBuilder.build() wraps null deps in NullNamespace instead of storing None
  • Guard evaluator ast_nodes.py recognizes NullNamespace via _is_null_or_empty_namespace() helper
  • Existing tests updated from is None to is_null_namespace() assertions

Verification

  • 13 new Phase 9b tests pass (observe, passthrough, drop, gating, combined directives on NullNamespace)
  • All 58 null-safety related tests pass (Phase 9a, null_safe_observe, guard_empty_namespace, filter_fanin)
  • Full suite: 6937 passed, 0 failed, 2 skipped
  • ruff format --check and ruff check clean

… (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.
@Muizzkolapo Muizzkolapo merged commit bdfdfe7 into integration/batch-online-unification May 17, 2026
1 check passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant