Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docker/runners/runner-image.lock.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"base_image_digest": "sha256:3ba65aa20f86a0fad9df2b2c259c613df006b2e6d0bfcc8a146afb8c525a9751",
"gh_version": "2.67.0",
"identity_digest": "b733067d7533a7fce63acebc1f515516",
"identity_digest": "c896b6c2d2ea576b7056c2d57f0e4d0f",
"image_version": 7,
"kubectl_version": "1.32.1",
"python_version": "3.12",
"runner_version": "2.336.0",
"shared_env_digest": "dd7bb511ac7aa391164c1927",
"shared_env_digest": "af3a810f5ded3d0f4612a34c",
"shared_env_install_args": "--frozen --all-extras --all-groups --no-install-project",
"uv_version": "0.6.14"
}
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ delegate = "omnibase_infra.cli.cli_delegate:delegate_command"
kafka = "omnibase_infra.cli.cli_kafka:kafka"
node = "omnibase_infra.cli.cli_node:run_node_by_name"
occ = "omnibase_infra.cli.cli_occ:occ"
run = "omnibase_infra.cli.cli_node:run_node_by_name"
skill = "omnibase_infra.cli.cli_skill:run_skill_by_name"

[project.entry-points."onex.backends"]
Expand Down
2 changes: 1 addition & 1 deletion src/omnibase_infra/cli/model_receipt_runtime_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

"""Typed receipt ``result`` payload for runs without a handler result (OMN-13094).

When ``onex node``/``onex run`` executes in ``--output receipt`` mode, the
When ``onex node`` executes in ``--output receipt`` mode, the
receipt's ``result`` field carries the node's full handler result whenever one
exists. Runs that produce no handler result (event-only orchestrations) or
that fail carry this summary model instead, so the receipt's ``result`` is
Expand Down
4 changes: 2 additions & 2 deletions src/omnibase_infra/cli/omnimarket_drift_guard.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
short-circuited to a silent no-op, so the exact regression this module
exists to catch -- ``omnimarket`` silently reverting from a git co-install to
completely absent -- fell through the guard undetected. The only symptom was
a generic, unhelpful ``onex skill``/``onex run`` "Unknown node" error with no
a generic, unhelpful ``onex skill``/``onex node`` "Unknown node" error with no
pointer back to this module or the repair command (the OMN-13829 ->
OMN-14060 -> OMN-14531 recurrence: each time, the venv drifted from
"installed" to "absent", not merely "stale", and the pre-flight guard's
Expand Down Expand Up @@ -189,7 +189,7 @@ def check_omnimarket_drift(
"omnimarket is NOT INSTALLED from git in this interpreter "
"(absent, or installed from PyPI/a non-VCS source), but a "
f"canonical clone exists at $OMNI_HOME/omnimarket (HEAD "
f"{canonical[:12]}). 'onex skill'/'onex run'/'onex delegate' "
f"{canonical[:12]}). 'onex skill'/'onex node'/'onex delegate' "
"dispatch for market-provided nodes (e.g. node_aislop_sweep) "
"will fail with 'Unknown node'. Repair with: "
"scripts/install-node-skill-package.sh --execute (or "
Expand Down
2 changes: 1 addition & 1 deletion src/omnibase_infra/cli/receipt_mode.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: 2025 OmniNode.ai Inc.
# SPDX-License-Identifier: MIT

"""Receipt-mode execution for ``onex node`` / ``onex run`` (OMN-13094).
"""Receipt-mode execution for ``onex node`` (OMN-13094).

Layer A of the skill-output-suppression slice
(``docs/plans/2026-06-12-skill-output-suppression-plan.md``, Phase 2 item 1):
Expand Down
9 changes: 4 additions & 5 deletions tests/unit/cli/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
Restores the complete process environment after every CLI test because CLI tests
exercise process-wide runtime configuration in-process (OMN-15572).

Neutralizes the ``onex node``/``onex run`` omnimarket pre-flight drift guard
Neutralizes the ``onex node`` omnimarket pre-flight drift guard
(OMN-14560, mirroring OMN-14531's ``onex skill`` fix) so CLI-wiring tests
across this directory stay hermetic regardless of the ambient developer
shell's ``$OMNI_HOME`` and whether this test venv happens to have omnimarket
co-installed. Three files invoke ``run_node_by_name`` (directly or via the
``onex run`` alias): ``test_cli_node.py``, ``test_cli_node_receipt.py``, and
``test_onex_run.py`` -- a per-file fixture would have to be duplicated three
times, so it lives here instead.
co-installed. Two files invoke ``run_node_by_name``: ``test_cli_node.py`` and
``test_cli_node_receipt.py`` -- a per-file fixture would have to be duplicated
twice, so it lives here instead.

The guard's own behavior (fail-open vs. raise) is tested directly in
``test_omnimarket_drift_guard.py``, which imports ``check_omnimarket_drift``
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/cli/test_cli_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def test_input_file_not_found_surfaces_cli_error(tmp_path: Path) -> None:
def test_drift_guard_fires_before_unknown_node_lookup(
monkeypatch: pytest.MonkeyPatch,
) -> None:
"""OMN-14560: ``onex node``/``onex run`` now call the same drift guard
"""OMN-14560: ``onex node`` now calls the same drift guard
``onex skill`` was fixed to call under OMN-14531.

Before this fix, ``run_node_by_name`` had ZERO drift-guard wiring: a
Expand Down
102 changes: 0 additions & 102 deletions tests/unit/cli/test_onex_run.py

This file was deleted.

90 changes: 90 additions & 0 deletions tests/unit/cli/test_onex_run_alias_retired.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# SPDX-FileCopyrightText: 2025 OmniNode.ai Inc.
# SPDX-License-Identifier: MIT

"""The legacy ``onex run`` alias must stay retired (OMN-16761).

Background. OMN-8938 renamed this repo's node runner ``onex run`` -> ``onex node``
and left ``run`` behind as an alias pointing at the *identical* callable. The
alias was never retired. omnibase_core 0.46.13 (OMN-16677) then legitimately
reused the freed name for a different command -- the tier-0 local workflow
harness -- and core's built-in wins the entry-point race:

onex.cli extension 'run' conflicts with an existing command, skipping

That warning printed on every single CLI invocation in any environment with both
packages installed, and ``onex run <node>`` silently stopped running nodes.

``run`` now belongs to omnibase_core. This repo owns ``node``. These tests pin
that boundary from the side this repo actually controls: they assert what
``omnibase_infra`` *declares*, not how core's harness behaves. Asserting core's
flag surface from here would couple this repo to core's CLI internals and break
on every unrelated harness change -- core tests core's command.
"""

from __future__ import annotations

import tomllib
from pathlib import Path

import pytest

pytestmark = pytest.mark.unit

_REPO_ROOT = Path(__file__).resolve().parents[3]
_NODE_RUNNER_TARGET = "omnibase_infra.cli.cli_node:run_node_by_name"


def _onex_cli_entry_points() -> dict[str, str]:
"""Return this repo's declared ``onex.cli`` entry-point table."""
data = tomllib.loads((_REPO_ROOT / "pyproject.toml").read_text(encoding="utf-8"))
entry_points = data["project"]["entry-points"]["onex.cli"]
assert isinstance(entry_points, dict)
return entry_points


def test_infra_does_not_declare_an_onex_cli_run_entry_point() -> None:
"""OMN-16761 AC1: no ``run`` entry point, so no collision warning.

This is the whole defect in one assertion. omnibase_core owns ``onex run``;
a ``run`` key here is shadowed by core's built-in and only produces noise.
"""
entry_points = _onex_cli_entry_points()
assert "run" not in entry_points, (
"omnibase_infra must not declare an 'onex.cli' entry point named 'run' -- "
"omnibase_core 0.46.13+ ships a built-in 'onex run' (the tier-0 workflow "
"harness) that always wins the entry-point race, so this declaration is "
"dead weight that emits "
"\"onex.cli extension 'run' conflicts with an existing command, skipping\" "
f"on every CLI invocation. Use 'onex node'. Got: {entry_points!r}"
)


def test_infra_still_declares_the_node_entry_point() -> None:
"""OMN-16761 AC3: retiring the alias must not disturb ``onex node``.

``node`` is the canonical name from OMN-8938 and the only surviving route to
this repo's node runner. core ships no built-in ``node``, so nothing shadows it.
"""
entry_points = _onex_cli_entry_points()
assert entry_points.get("node") == _NODE_RUNNER_TARGET, (
f"'onex node' must resolve to {_NODE_RUNNER_TARGET!r}; got "
f"{entry_points.get('node')!r}"
)


def test_node_runner_is_reachable_under_exactly_one_name() -> None:
"""No second alias may reintroduce the collision under a different key.

Guards the *class* of defect, not just the one instance: any future entry
point re-pointed at the node runner would recreate an OMN-8938-style alias.
"""
aliases = sorted(
name
for name, target in _onex_cli_entry_points().items()
if target == _NODE_RUNNER_TARGET
)
assert aliases == ["node"], (
"the node runner must be reachable under exactly one 'onex.cli' name "
f"('node'); found {aliases!r}. Aliasing one callable under two CLI names "
"is what produced the OMN-16761 collision in the first place."
)
Loading