Skip to content

[BREAKING][misc] refactor: modularize SDK dependencies - #270

Open
JoyboyBrian wants to merge 6 commits into
mainfrom
brian/osm-1655-sdk-split-cli-and-rollout-dependencies
Open

[BREAKING][misc] refactor: modularize SDK dependencies#270
JoyboyBrian wants to merge 6 commits into
mainfrom
brian/osm-1655-sdk-split-cli-and-rollout-dependencies

Conversation

@JoyboyBrian

@JoyboyBrian JoyboyBrian commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

What

  • Keep a single osmosis-ai distribution whose bare install includes the CLI and framework-neutral rollout core.
  • Move server, Strands, OpenAI Agents, Harbor, rubric, and Parquet dependencies into server, strands, openai-agents, harbor, rubric, and parquet extras; make full aggregate them.
  • Replace eager package facades with leaf-level lazy exports, framework-explicit integration modules, star-safe core exports, and actionable missing-extra errors.
  • Make generic trajectory persistence Harbor-independent with SDK-owned ATIF v1.7 models and serialization.
  • Retire Daytona from the dependency graph. The Harbor extra installs plain Harbor plus its Dockerfile parser; SkyPilot remains runtime-provided.
  • Add exact wheel metadata checks and eight clean-install smoke scenarios, plus updated scaffold, preflight, docs, and migration coverage.

Why

Implements OSM-1655. Default users still get the complete everyday CLI, while unrelated framework, backend, server, rubric, and dataset-validation dependency closures no longer install or import by accident.

This intentionally accepts 0.3 breaking changes: server and framework integrations now use explicit module paths, the old platform and published dev extras are removed, and development tools live in the dev dependency group.

NativeHarborBackend is intentionally out of scope so the existing brian/harbor work can be rebased and refactored separately.

How to Test

  • uv sync --locked --all-extras --group dev
  • uv run pytest — 1,804 passed
  • uv run ruff check .
  • uv run ruff format --check .
  • uv run pyright osmosis_ai/
  • Build one wheel and run clean installs for bare, server, strands, openai-agents, harbor, rubric, parquet, and full; all eight pass uv pip check, import/API checks, dependency ownership checks, and sandbox-package prohibitions.

Checklist

  • Tests cover dependency isolation, lazy exports, optional dependency messages, ATIF parity, and submit preflight.
  • User and developer documentation reflects the new extras and canonical imports.
  • Breaking changes are called out in the title and migration-facing docs.
  • Daytona and SDK-installed SkyPilot are absent from the lockfile and clean wheel closures.
  • Existing NativeHarborBackend work was not modified.

Summary by cubic

Refactors the SDK into a single osmosis-ai with opt‑in extras and strict, lazy exports; the rollout core stays framework‑neutral and integrations move to extras, implementing OSM‑1655. Adds SDK‑owned ATIF v1.7 models and formatter under osmosis_ai.rollout.trajectory.atif, hardens optional dependency boundaries, and extends CI to verify isolated wheels and full extra membership.

  • New Features

    • Extras: server, strands, openai-agents, harbor, rubric, parquet; full aggregates all.
    • osmosis_ai.rollout exports only framework‑neutral core; integrations live under osmosis_ai.rollout.integrations.agents.*; server/Harbor load via explicit modules with actionable “install the extra” errors; OpenAI Agents warns if litellm is missing.
    • ATIF v1.7 models and JSON formatter live at osmosis_ai.rollout.trajectory.atif; trajectory saving is backend‑agnostic and rejects non‑finite values.
    • CI adds an isolated wheel verifier, validates full extra membership and clean core imports, and normalizes colored smoke output; Daytona removed, Harbor’s skypilot remains runtime‑provided.
    • Scaffolds pin osmosis-ai[server]>=0.3.0rc1,<0.4.
  • Migration

    • Update imports:
      • Server: from osmosis_ai.rollout.server import create_rollout_server, ControllerAuth
      • Harbor: from osmosis_ai.rollout.backend.harbor import HarborBackend, OsmosisInstalledAgent
      • Strands: from osmosis_ai.rollout.integrations.agents.strands import ...
      • OpenAI Agents: from osmosis_ai.rollout.integrations.agents.openai_agents import ...
    • Install only what you need: pip install "osmosis-ai[server]", "osmosis-ai[strands]", "osmosis-ai[openai-agents]", "osmosis-ai[harbor]", "osmosis-ai[rubric]", "osmosis-ai[parquet]", or "osmosis-ai[full]".
    • The old platform and published dev extras are removed; use the parquet extra for dataset validation and the dev dependency group (e.g., uv sync --all-extras --group dev or python -m pip install -e ".[full]" --group dev).

Written for commit f9854d2. Summary will update on new commits.

Review in cubic

@JoyboyBrian
JoyboyBrian requested a review from BaiqingL as a code owner July 29, 2026 08:57
@JoyboyBrian JoyboyBrian added breaking Breaking changes ci CI/CD related dependencies Dependency updates refactor Code refactoring rollout Remote Rollout module cli CLI related labels Jul 29, 2026
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

cubic analysis

3 issues found and verified against the latest diff

Confidence score: 3/5

  • In osmosis_ai/rollout/trajectory/_atif.py, allowing llm_call_count on user/system steps can produce trajectories that violate ATIF v1.7 and may persist invalid data that downstream tooling misinterprets — add llm_call_count to the agent-only validation list.
  • In tests/unit/test_public_api_imports.py, the (osmosis_ai.rollout.integrations.openai_agents, OsmosisAgent, agents, openai-agents) case depends on raise_optional_dependency_error preserving ModuleNotFoundError.exc.name == "agents"; if that wrapping behavior changes, the test may fail for exception-shape reasons rather than true import regressions — assert the intended error contract explicitly in the helper or relax the test to the user-facing message.
  • In CONTRIBUTING.md, documenting pip install ... --group dev will fail at the command line because --group is uv-only, creating immediate setup friction for contributors — update the pip instructions to a pip-compatible dev-dependency install path (or switch the command to uv consistently).
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="CONTRIBUTING.md">

<violation number="1" location="CONTRIBUTING.md:22">
P0: `pip install` does not support `--group dev` — this flag is uv-only and will error at the command line. Replace the pip-based instructions to either remove the `--group dev` part and tell users to install dev deps manually, add a `dev` extra under `[project.optional-dependencies]`, or (simplest) remove the pip instructions and point pip users toward uv.</violation>
</file>

<file name="osmosis_ai/rollout/trajectory/_atif.py">

<violation number="1" location="osmosis_ai/rollout/trajectory/_atif.py:185">
P2: User and system steps can currently carry `llm_call_count`, although its ATIF v1.7 semantics apply to agent steps. Include it in the existing agent-only validation list to prevent invalid persisted trajectories.</violation>
</file>

<file name="tests/unit/test_public_api_imports.py">

<violation number="1" location="tests/unit/test_public_api_imports.py:174">
P2: Test case (osmosis_ai.rollout.integrations.openai_agents, OsmosisAgent, agents, openai-agents) relies on the re-raised ModuleNotFoundError preserving exc.name == 'agents'. Check that raise_optional_dependency_error preserves the original exc.name attribute on the re-raised exception, otherwise the assertion fails.</violation>
</file>

Linked issue analysis

Linked issue: OSM-1655: [SDK] Split CLI and rollout dependencies

Status Acceptance criteria Notes
Define supported extras and make the default osmosis-ai distribution include the CLI + framework‑neutral rollout core (extras: server, strands, openai‑agents, harbor, rubric, parquet, full) README, docs, and pyproject.toml were updated to document and wire the new extras and the default distribution intent.
Move heavy/server/framework/back-end dependencies into extras and update dependency groups (remove/replace legacy extras) so CLI/rollout installs don't pull unrelated heavy deps pyproject.toml and uv.lock were modified and new dependency-group semantics are introduced; CONTRIBUTING and docs reflect the group/install changes.
Replace eager package facades with leaf-level lazy exports and surface actionable missing‑extra errors New lazy-export helpers and many __getattr__/resolve_lazy_export patterns were added; modules now raise informative missing‑extra errors on import when optional deps are absent.
Make trajectory persistence backend‑agnostic by adding SDK‑owned ATIF v1.7 models and serializer and update converter/save to use them A new ATIF model module and serializer were added, and converter/save were updated to use the SDK-owned models; tests were added to lock the contract.
⚠️ Add exact wheel metadata checks and eight clean‑installation smoke scenarios (clean‑wheel install verification) A substantial verify-wheel-install script was added and the PR documents clean-install testing steps, but I can't verify from the diff that the eight smoke scenarios are fully wired into CI or unit tests—script exists, workflow changes touch installs but don't explicitly run the new verifier in the shown workflow patch.
Update scaffold, preflight, docs, and migration guidance and call out breaking changes Templates, docs, READMEs, and CONTRIBUTING were updated and the PR title includes [BREAKING]; migration notes and scaffolding reflect the new module paths and extras.

Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.

Fix all with cubic | Re-trigger cubic

Comment thread CONTRIBUTING.md
Comment thread osmosis_ai/rollout/trajectory/atif.py
Comment thread osmosis_ai/rollout/trajectory/_atif.py Outdated
Comment thread tests/unit/test_public_api_imports.py Outdated
- keep agent integrations under their canonical integrations.agents paths
- validate full-extra membership and clean core imports in wheel smoke tests
- provide an actionable error when OpenAI Agents lacks LiteLLM
- document migration steps and cap generated rollouts below 0.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking changes ci CI/CD related cli CLI related dependencies Dependency updates refactor Code refactoring rollout Remote Rollout module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant