Skip to content

fix(OMN-10409): skip Bifrost render for projection API - #1780

Merged
jonahgabriel merged 5 commits into
devfrom
jonah/omn-10409-projection-bifrost-skip
May 29, 2026
Merged

jonahgabriel merged 5 commits into
devfrom
jonah/omn-10409-projection-bifrost-skip

Conversation

@jonahgabriel

@jonahgabriel jonahgabriel commented May 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • clear BIFROST_CONTRACT_PATH for the projection API service
  • treat an empty BIFROST_CONTRACT_PATH as an explicit renderer disable path before Path(...) conversion or endpoint validation
  • keeps projection startup from rendering delegation contracts when it has no runtime data volume

Verification

  • uv run pytest tests/unit/runtime/test_render_bifrost_delegation_contract.py -q
  • uv run ruff check src/omnibase_infra/runtime/render_bifrost_delegation_contract.py tests/unit/runtime/test_render_bifrost_delegation_contract.py
  • uv run pre-commit run --files docker/docker-compose.infra.yml src/omnibase_infra/runtime/render_bifrost_delegation_contract.py tests/unit/runtime/test_render_bifrost_delegation_contract.py
  • docker compose -f docker/docker-compose.infra.yml -f docker/docker-compose.stability-test.yml --profile runtime config --quiet
  • docker compose ... config | uv run python -c '... assert projection-api BIFROST_CONTRACT_PATH == "" ...'
  • .201 stability runtime rebuilt from merged heads and projection health recovered with the same override: main=healthy, effects=healthy, projection=ok ok

Evidence-Ticket: OMN-10409
Evidence-Source: c06b8855d3d0280f1d8f5db06a00db94034ee052

Additional CI alignment after final CI sweep:

  • Refreshed onex-change-control lock from c3d38e71 to 2741a409 to consume the current entry-point manifest without deleted dependency-node stubs.
  • Aligned post-Consul registry discovery integration assertions with the current response contract.
  • Updated the SPI runtime protocol floor sentinel to 0.22.0.

Additional verification:

  • uv run pytest tests/unit/services/registry_api/test_registry_discovery_semantics.py tests/integration/test_auto_wiring_real_manifest.py::test_real_manifest_discovery_has_no_errors tests/integration/test_omnibase_spi_runtime_protocol_floor.py::test_omnibase_spi_runtime_protocols_match_0220_floor -q
  • uv run ruff check tests/integration/projectors/test_registry_api_projection_tail_integration.py tests/integration/test_omnibase_spi_runtime_protocol_floor.py
  • uv run pre-commit run --files uv.lock tests/integration/projectors/test_registry_api_projection_tail_integration.py tests/integration/test_omnibase_spi_runtime_protocol_floor.py

Local note: the container-backed projection-tail integration setup is blocked locally by Docker/testcontainers failing to create the Ryuk container; GitHub CI owns that container-backed confirmation.

Summary by CodeRabbit

  • New Features

    • Added configuration to disable Bifrost delegation contract rendering at runtime.
  • Tests

    • Added unit test for the disable behavior, updated integration tests for service discovery without Consul, and bumped omnibase-spi protocol floor to 0.22.0.
    • Added CI schema test and extended workflow resilience checks.
  • Chores

    • Disabled UV cache in relevant CI/workflow configurations and documented runtime service as having no rendered contract.

Review Change Stack

Additional CI resilience update on 2026-05-29:

  • Disabled uv/GitHub cache save for runtime boot smoke and sibling compat checks after repeated post-job cache/upload stalls blocked merge despite successful smoke assertions.
  • Local verification: uv run pytest tests/ci/test_reusable_runtime_boot_schema.py tests/ci/test_ci_workflow_resilience.py -q (30 passed); uv run ruff check touched CI tests (pass); uv run pre-commit run --files touched workflow/test files (pass).

Additional CI resilience update on 2026-05-29:

  • Changed Topic Drift Check to use the shared setup-python-uv retrying install path instead of a one-shot uv sync --no-cache after repeated transient GitHub fetch failures.
  • Local verification: uv run pytest tests/ci/test_ci_workflow_resilience.py -q (7 passed); uv run pytest tests/ci/test_reusable_runtime_boot_schema.py tests/ci/test_ci_workflow_resilience.py -q (31 passed); uv run pre-commit run --files .github/workflows/ci.yml tests/ci/test_ci_workflow_resilience.py (pass).

Additional CI resilience update on 2026-05-29:

  • Changed Kafka Schema Handshake to use the shared setup-python-uv retrying install path instead of a one-shot uv sync --no-cache after repeated transient omnibase_spi GitHub fetch failures.
  • Local verification: uv run pytest tests/ci/test_ci_workflow_resilience.py -q (7 passed); uv run pre-commit run --files .github/workflows/ci.yml tests/ci/test_ci_workflow_resilience.py (pass).

@coderabbitai

coderabbitai Bot commented May 29, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Rendering now supports disabling when BIFROST_CONTRACT_PATH is empty: the renderer returns None and the entrypoint logs "disabled" and exits 0. Docker Compose sets BIFROST_CONTRACT_PATH: "" for projection-api. Tests updated: unit test for disabled rendering, integration test adjusts Consul omission assertions, and omnibase_spi floor bumped to 0.22.0.

Changes

Runtime rendering and wiring

Layer / File(s) Summary
Resolve target path and short-circuit rendering
src/omnibase_infra/runtime/render_bifrost_delegation_contract.py, docker/docker-compose.infra.yml
Adds _resolve_target_path to return None when BIFROST_CONTRACT_PATH is empty; render_bifrost_delegation_contract may return `Path
Tests and protocol floor
tests/unit/runtime/test_render_bifrost_delegation_contract.py, tests/integration/projectors/test_registry_api_projection_tail_integration.py, tests/integration/test_omnibase_spi_runtime_protocol_floor.py
Adds unit test ensuring empty BIFROST_CONTRACT_PATH disables rendering and skips endpoint probe; updates projection integration test to assert Consul-related fields are omitted; bumps omnibase_spi protocol floor to 0.22.0.

CI UV cache configuration and validation

Layer / File(s) Summary
Workflow inputs: disable UV cache
.github/workflows/check-sibling-compat.yml, .github/workflows/reusable-runtime-boot.yml
Set cache-enabled: "false" in sibling-compat workflow and enable-cache: false in reusable runtime boot workflow.
CI tests asserting cache disabled
tests/ci/test_ci_workflow_resilience.py, tests/ci/test_reusable_runtime_boot_schema.py
Load workflows and assert the UV setup steps have caching disabled (cache-enabled: "false" in sibling-compat and with.enable-cache: False in boot job).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I checked the path and found it bare—
an empty string, a gentle pause.
No contract written where none should be,
the service hums without a cause.
Small change, soft sigh: all quiet, paws.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: skipping Bifrost delegation contract rendering for the projection API service.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jonah/omn-10409-projection-bifrost-skip

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docker/docker-compose.infra.yml`:
- Around line 777-779: The code that constructs the target path in
render_bifrost_delegation_contract.py currently uses
Path(env.get("BIFROST_CONTRACT_PATH", ...)) which treats an empty string as
Path("") (cwd) and causes unwanted validation; change the logic to explicitly
treat empty or whitespace-only BIFROST_CONTRACT_PATH as "disabled" (e.g., set
target to None or a sentinel) and short-circuit the render/verification path
accordingly, and/or respect BIFROST_VERIFY_ENDPOINTS by skipping endpoint
verification when the contract path is intentionally empty so no
ProtocolConfigurationError is raised; locate the target construction and the
verification gate in render_bifrost_delegation_contract.py and add the
empty-string check before any Path(...) conversion or endpoint validation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 37781b05-9f78-4cc9-a4f3-4758962bef04

📥 Commits

Reviewing files that changed from the base of the PR and between 2c1d672 and 843650d.

📒 Files selected for processing (1)
  • docker/docker-compose.infra.yml

Comment thread docker/docker-compose.infra.yml
@jonahgabriel
jonahgabriel force-pushed the jonah/omn-10409-projection-bifrost-skip branch from 843650d to f1c9fd5 Compare May 29, 2026 09:40
@jonahgabriel
jonahgabriel enabled auto-merge May 29, 2026 09:53

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
tests/unit/runtime/test_render_bifrost_delegation_contract.py (1)

360-371: ⚡ Quick win

Assert the probe is never invoked in the disabled path.

This test currently proves None return, but not the "no endpoint probe call" contract. Use a mock probe and assert it was not called.

Suggested patch
 `@pytest.mark.unit`
 def test_empty_bifrost_contract_path_disables_render(tmp_path: Path) -> None:
     source = _source_contract(tmp_path / "source.yaml", required=True)
+    probe = mock.Mock(return_value="should not run")
     rendered = render_bifrost_delegation_contract(
         source_path=source,
         environ={
             "BIFROST_CONTRACT_PATH": "",
             "BIFROST_VERIFY_ENDPOINTS": "1",
         },
-        endpoint_probe=lambda _url, _model, _timeout: "should not run",
+        endpoint_probe=probe,
     )
 
     assert rendered is None
+    probe.assert_not_called()
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/runtime/test_render_bifrost_delegation_contract.py` around lines
360 - 371, Update the test_empty_bifrost_contract_path_disables_render test to
also verify the probe is never invoked: replace the lambda probe with a mock
(e.g., a MagicMock or Mock) and pass it as the endpoint_probe to
render_bifrost_delegation_contract, then after calling
render_bifrost_delegation_contract assert the mock probe.was_not_called (or
assert probe.assert_not_called()) in addition to asserting rendered is None;
reference the test function name and the render_bifrost_delegation_contract call
to locate where to inject and assert the mock.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tests/unit/runtime/test_render_bifrost_delegation_contract.py`:
- Around line 360-371: Update the
test_empty_bifrost_contract_path_disables_render test to also verify the probe
is never invoked: replace the lambda probe with a mock (e.g., a MagicMock or
Mock) and pass it as the endpoint_probe to render_bifrost_delegation_contract,
then after calling render_bifrost_delegation_contract assert the mock
probe.was_not_called (or assert probe.assert_not_called()) in addition to
asserting rendered is None; reference the test function name and the
render_bifrost_delegation_contract call to locate where to inject and assert the
mock.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 60366d0e-8fcb-4f3c-88cb-a9ab0440246e

📥 Commits

Reviewing files that changed from the base of the PR and between 843650d and ed9009f.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • docker/docker-compose.infra.yml
  • src/omnibase_infra/runtime/render_bifrost_delegation_contract.py
  • tests/integration/projectors/test_registry_api_projection_tail_integration.py
  • tests/integration/test_omnibase_spi_runtime_protocol_floor.py
  • tests/unit/runtime/test_render_bifrost_delegation_contract.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • docker/docker-compose.infra.yml

@jonahgabriel
jonahgabriel added this pull request to the merge queue May 29, 2026
@jonahgabriel
jonahgabriel removed this pull request from the merge queue due to a manual request May 29, 2026
@jonahgabriel
jonahgabriel added this pull request to the merge queue May 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 29, 2026
@jonahgabriel
jonahgabriel added this pull request to the merge queue May 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 29, 2026
@jonahgabriel
jonahgabriel added this pull request to the merge queue May 29, 2026
Merged via the queue into dev with commit 3fcb11f May 29, 2026
74 of 77 checks passed
@jonahgabriel
jonahgabriel deleted the jonah/omn-10409-projection-bifrost-skip branch May 29, 2026 13:18
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