Skip to content

test(registration): tighten warning assertion in test_unexpected_error_logged_as_warning (OMN-3574) - #607

Merged
jonahgabriel merged 1 commit into
mainfrom
jonah/omn-3574-tighten-warning-assertion
Mar 4, 2026
Merged

jonahgabriel merged 1 commit into
mainfrom
jonah/omn-3574-tighten-warning-assertion

Conversation

@jonahgabriel

@jonahgabriel jonahgabriel commented Mar 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Replace bare assert warning_msgs with keyword-specific assertions in test_unexpected_error_logged_as_warning — now verifies the WARNING log actually references "schema" or "initialize", rejecting spurious warnings from unrelated code paths
  • Apply the same tightening to test_advisory_lock_failure_logged_as_warning which had the identical under-constrained pattern

Mutation test verification

Deleting the else: logger.warning(...) branch in _initialize_schema now causes test_unexpected_error_logged_as_warning to FAIL (confirmed manually during development).

Test plan

  • All 14 tests in test_plugin_schema_init.py pass
  • Mutation test: removing the logger.warning() branch causes test_unexpected_error_logged_as_warning to fail
  • ruff check passes on changed file
  • No implementation changes — test-only

Closes OMN-3574

Summary by CodeRabbit

  • Tests
    • Enhanced validation for schema initialization warnings in test suite to ensure messages properly reference schema-related processes.

…r_logged_as_warning (OMN-3574)

Replace bare `assert warning_msgs` with keyword-specific assertions that
verify the WARNING log actually references schema initialization. Without
this, deleting the `else: logger.warning(...)` branch in _initialize_schema
would not cause the test to fail if any spurious WARNING fires.

Also tightens the same under-constrained pattern in
test_advisory_lock_failure_logged_as_warning.
@coderabbitai

coderabbitai Bot commented Mar 4, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cb426101-860f-4ed0-a296-9f76269a516b

📥 Commits

Reviewing files that changed from the base of the PR and between 74536e0 and aab06a8.

📒 Files selected for processing (1)
  • tests/unit/nodes/node_registration_orchestrator/test_plugin_schema_init.py

📝 Walkthrough

Walkthrough

Test validation tightening in plugin schema initialization tests. Warning assertions now require logged messages to explicitly contain "schema" or "initialize" rather than accepting any warning, ensuring validation specificity across two test cases.

Changes

Cohort / File(s) Summary
Test Warning Validation
tests/unit/nodes/node_registration_orchestrator/test_plugin_schema_init.py
Tightened warning message validation in two tests to require explicit references to schema initialization ("schema" or "initialize" keywords) instead of accepting generic warnings.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 The warnings now must speak their truth,
No generic logs allowed, forsooth!
"Schema" and "initialize" ring clear,
Validation tightened, crisp and dear. 🔍✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: tightening warning assertions in a specific test function related to registration schema initialization.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jonah/omn-3574-tighten-warning-assertion

Comment @coderabbitai help to get the list of available commands and usage tips.

@jonahgabriel
jonahgabriel added this pull request to the merge queue Mar 4, 2026
Merged via the queue into main with commit 0d93063 Mar 4, 2026
26 checks passed
@jonahgabriel
jonahgabriel deleted the jonah/omn-3574-tighten-warning-assertion branch March 4, 2026 15:07
jonahgabriel added a commit that referenced this pull request May 13, 2026
…list/exemption entries

- pyproject.toml: omnimarket source branch jonah/omn-10865-add-delegation-nodes -> main (PR #607 merged)
- arch-handler-contract-compliance-allowlist.yaml: remove 6 entries pointing at deleted
  delegation handler/config files (config_loader_bifrost_delegation.py,
  model_bifrost_delegation_config.py, handler_delegation_workflow.py,
  handler_compliance_loop.py, handler_quality_gate.py, handler_delegation_routing.py)
- tests/ci/test_handler_architecture_invariants.py: drop 3 deleted basenames from
  _RUNTIME_UTILITY_EXCLUSIONS and empty _INV4_WIRING_EXEMPTIONS (contracts deleted)

Fixes CI Tests Gate failures (test_all_exclusions_map_to_existing_files,
test_exemptions_reference_real_contracts_and_handlers) and Build Runtime Image
(ModuleNotFoundError: omnimarket.nodes.node_delegation_orchestrator) on PR #1569.
jonahgabriel added a commit that referenced this pull request May 14, 2026
…from omnimarket

Delegation pipeline (node_delegation_orchestrator, node_delegation_quality_gate_reducer,
node_delegation_routing_reducer), adapter_llm_caller_delegation, and bifrost delegation
config have moved to omnimarket (PR #607). This PR removes the infra copies and wires
service_kernel.py + plugin_llm.py to import PluginDelegation, LlmCallerDelegation, and
DelegationIntentBridge from omnimarket.

- Delete all delegation node source files and tests from omnibase_infra
- Update service_kernel.py PluginDelegation import to omnimarket
- Update plugin_llm.py LlmCallerDelegation + DelegationIntentBridge imports to omnimarket
- Update test_event_bus_subscriber_container_resolution.py PluginDelegation import
- Remove stale ProtocolLlmCaller entry from test_protocol_ownership.py
- Remove stale validation_exemptions.yaml entries for deleted delegation model files
- Pin omnimarket source to feature branch (update to main after PR #607 merges)
jonahgabriel added a commit that referenced this pull request May 14, 2026
…list/exemption entries

- pyproject.toml: omnimarket source branch jonah/omn-10865-add-delegation-nodes -> main (PR #607 merged)
- arch-handler-contract-compliance-allowlist.yaml: remove 6 entries pointing at deleted
  delegation handler/config files (config_loader_bifrost_delegation.py,
  model_bifrost_delegation_config.py, handler_delegation_workflow.py,
  handler_compliance_loop.py, handler_quality_gate.py, handler_delegation_routing.py)
- tests/ci/test_handler_architecture_invariants.py: drop 3 deleted basenames from
  _RUNTIME_UTILITY_EXCLUSIONS and empty _INV4_WIRING_EXEMPTIONS (contracts deleted)

Fixes CI Tests Gate failures (test_all_exclusions_map_to_existing_files,
test_exemptions_reference_real_contracts_and_handlers) and Build Runtime Image
(ModuleNotFoundError: omnimarket.nodes.node_delegation_orchestrator) on PR #1569.
jonahgabriel added a commit that referenced this pull request May 14, 2026
…from omnimarket (#1569)

* feat(OMN-10865): remove delegation nodes from omnibase_infra, import from omnimarket

Delegation pipeline (node_delegation_orchestrator, node_delegation_quality_gate_reducer,
node_delegation_routing_reducer), adapter_llm_caller_delegation, and bifrost delegation
config have moved to omnimarket (PR #607). This PR removes the infra copies and wires
service_kernel.py + plugin_llm.py to import PluginDelegation, LlmCallerDelegation, and
DelegationIntentBridge from omnimarket.

- Delete all delegation node source files and tests from omnibase_infra
- Update service_kernel.py PluginDelegation import to omnimarket
- Update plugin_llm.py LlmCallerDelegation + DelegationIntentBridge imports to omnimarket
- Update test_event_bus_subscriber_container_resolution.py PluginDelegation import
- Remove stale ProtocolLlmCaller entry from test_protocol_ownership.py
- Remove stale validation_exemptions.yaml entries for deleted delegation model files
- Pin omnimarket source to feature branch (update to main after PR #607 merges)

* fix(OMN-10865): repin omnimarket to main, drop stale delegation allowlist/exemption entries

- pyproject.toml: omnimarket source branch jonah/omn-10865-add-delegation-nodes -> main (PR #607 merged)
- arch-handler-contract-compliance-allowlist.yaml: remove 6 entries pointing at deleted
  delegation handler/config files (config_loader_bifrost_delegation.py,
  model_bifrost_delegation_config.py, handler_delegation_workflow.py,
  handler_compliance_loop.py, handler_quality_gate.py, handler_delegation_routing.py)
- tests/ci/test_handler_architecture_invariants.py: drop 3 deleted basenames from
  _RUNTIME_UTILITY_EXCLUSIONS and empty _INV4_WIRING_EXEMPTIONS (contracts deleted)

Fixes CI Tests Gate failures (test_all_exclusions_map_to_existing_files,
test_exemptions_reference_real_contracts_and_handlers) and Build Runtime Image
(ModuleNotFoundError: omnimarket.nodes.node_delegation_orchestrator) on PR #1569.

* fix(OMN-10865): lazy-import PluginDelegation in kernel registration block

Addresses CodeRabbit review on PR #1569: the top-level
`from omnimarket.nodes.node_delegation_orchestrator.plugin import PluginDelegation`
in service_kernel.py executes at module load — before the guarded try/except in
bootstrap() — so a missing/unavailable omnimarket dependency would crash kernel
startup instead of degrading gracefully. It also created a module-load circular
import (plugin_llm -> ... -> runtime/__init__ -> service_kernel -> omnimarket
plugin -> omnibase_infra.runtime.*). Moving the import inside the registration
try block fixes both.

* chore(OMN-10865): re-trigger CI after PR body update (Evidence-Source: OCC#965)

* chore(OMN-10865): re-trigger receipt/deploy gates with refreshed PR body

* docs(OMN-10865): two-strike diagnosis — delegation removal blocked by incomplete migration

* fix(runtime): align pattern b omnimarket test

* test(integration): skip unreachable external services

* ci(OMN-10865): extend uv timeout for sibling boundary jobs

* ci(OMN-10865): extend kafka boundary job timeout

* ci(OMN-10865): extend checkout budget for infra gates

* fix(OMN-10865): post-rebase cleanup of stray delegation files added on main

Rebase onto current main brought back files that were added post-branch
and reference now-deleted delegation modules:

- node_delegation_routing_reducer/dispatchers/ (OMN-10868 added it; depends
  on deleted node_delegation_orchestrator.models.model_delegation_request).
  Port to omnimarket is an explicit follow-up per #1569's PR body.
- protocol_delegation_intent_bridge.py: rewrite import to source
  ProtocolLlmCaller from omnimarket where the impl now lives.
- 7 delegation tests that import deleted infra modules (OMN-10941, OMN-10940,
  OMN-10949) — equivalent coverage lives in omnimarket.

Evidence-Ticket: OMN-10865
Evidence-Source: dc4aacef

* test(OMN-10865): remove obsolete TestDelegationContractDeclaresPluginManaged

The class asserted that src/omnibase_infra/nodes/node_delegation_orchestrator/contract.yaml
declares plugin_managed=true. That contract now lives in omnimarket, so the test asserts
against a path that no longer exists in infra. Equivalent coverage belongs in omnimarket.

Evidence-Ticket: OMN-10865
Evidence-Source: dc4aacef

* chore(OMN-10865): refresh PR body cache (add skip-test-removal-gate token + rebase note)

* test(OMN-10865): replacement integration test for delegation consolidation

The PR previously deleted tests/integration/test_delegation_event_chain.py
which counted as 1 unmatched deletion in the Integration Test Removal Gate.
The deleted test exercised the infra-side delegation chain which now lives
in omnimarket.

Adds tests/integration/test_delegation_consolidation.py with 4 assertions:
1. omnimarket.nodes.node_delegation_orchestrator.plugin.PluginDelegation
   resolves (consumed by service_kernel bootstrap).
2. omnimarket DelegationIntentBridge / LlmCallerDelegation / ProtocolLlmCaller
   resolve (consumed by plugin_llm DI registration).
3. infra-side protocol_delegation_intent_bridge.py sources ProtocolLlmCaller
   from omnimarket — not a stale infra import.
4. No delegation contract.yaml exists in infra (the duplicate-ingress crash
   the runtime hit before this PR).

This restores deletion/addition parity for the gate and exercises the
exact consolidated wiring that prevented runtime boot.

Evidence-Ticket: OMN-10865
Evidence-Source: dc4aacef

* chore: retrigger CI after runner recovery

* fix(OMN-10958): satisfy PR 1569 lint gate

* fix(OMN-10865): fix Split 2+4 CI failures — bump omnimarket pin and drop stale parity test

Split 4 failure: test_topic_constants_contract_parity.py asserts every
TOPIC_DELEGATION_* constant appears in node_delegation_orchestrator/contract.yaml,
which this PR removed. The test was staged for deletion but never committed.
Commit the deletion — parity now lives in omnimarket.

Split 2 failure: HandlerOutputSchemaRegistry (omnimarket) imported
ModelDelegationResult from omnibase_infra.nodes.node_delegation_orchestrator.models
at the pinned omnimarket commit (a73edb04). Bump the lock to 1cdba823 which
uses omnimarket.events.delegation instead — no omnibase_infra cross-module
import.

---------

Co-authored-by: jonahgabriel <jonahgabriel@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant