Skip to content

[BREAKING][misc] refactor: remove unused APIs and drop unused runtime dependencies - #328

Merged
JoyboyBrian merged 3 commits into
mainfrom
brian/remove-unused-surface
Aug 27, 2026
Merged

[BREAKING][misc] refactor: remove unused APIs and drop unused runtime dependencies#328
JoyboyBrian merged 3 commits into
mainfrom
brian/remove-unused-surface

Conversation

@JoyboyBrian

@JoyboyBrian JoyboyBrian commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

What

  • Remove unused public types: MessageResult, GraderInitRequest / GraderInitResponse, and the RolloutDriver ABC (HttpRolloutDriver remains the concrete driver).
  • Drop unused helpers and single-caller wrappers (Trajectory.has_multimodal_content, ListColumn.plain, Console.spinner, OutputContext.schema_version, resolve_workspace_directory_from_cwd, Harbor pre-v0.3 constructor shims, write_scaffold kwargs).
  • Inline one-call-site modules and twins (rollout/utils/messages.py, harbor/bundling.py, eval/train path-validation and next-steps helpers, template recipe boilerplate, platform HTTP/download setup).
  • Drop unused runtime dependencies from the base install: requests, platformdirs, toml, tqdm (GitHub fetches use urllib; cache paths are stdlib; rubric progress uses Rich). osmosis_ai.packaging is importable without Harbor extras.
  • Update developer docs and wheel-install checks to match. JSON envelopes still emit schema_version: 1.

Why

These symbols and wrappers had no remaining production callers, and the four libraries were only imported to support that unused surface or a one-line helper. Removing them shrinks the published API and the base install without changing CLI JSON output or supported rollout flows. Pre-v0.3 Harbor constructor kwargs now fail as ordinary unexpected-keyword TypeErrors instead of a custom migration error.

Migration: stop importing MessageResult, GraderInitRequest, GraderInitResponse, and RolloutDriver. Use OperationResult for CLI messages, HttpRolloutDriver for eval-facing runs, and resolve_workspace_directory() for workspace lookup.

How to Test

  • uv run ruff check . && uv run ruff format --check .
  • uv run pyright osmosis_ai/
  • uv run --no-editable pyright --verifytypes osmosis_ai --ignoreexternal
  • uv run pytest tests/unit/cli/output tests/unit/rollout/test_driver.py tests/unit/rollout/test_http_driver.py tests/unit/rollout/test_harbor_backend.py tests/unit/rollout/test_trajectory_atif.py tests/unit/rollout/integrations/test_strands_messages.py tests/unit/platform/cli/test_eval_config.py tests/unit/platform/cli/test_training_config.py tests/unit/platform/cli/test_workspace_directory_contract.py tests/unit/platform/cli/test_workspace_directory_setup.py tests/unit/platform/cli/test_workspace_repo.py tests/unit/templates tests/unit/test_public_api_imports.py tests/unit/test_rubric_engine.py tests/unit/eval
  • rg -n 'MessageResult|GraderInitRequest|class RolloutDriver' osmosis_ai/ tests/ — no matches

Checklist

  • PR title follows [module] type: description format
    (labels are derived from it automatically — no need to add them by hand)
  • ruff check . and ruff format --check . pass
  • pyright osmosis_ai/ passes
  • pytest passes (new tests added if applicable)
  • Public API changes are documented
  • No secrets or credentials included

Summary by cubic

Removes unused public APIs and drops unused runtime dependencies (requests, platformdirs, toml, tqdm) from the base install; CLI JSON output still emits schema_version: 1.

Migration

  • MessageResult is gone — use OperationResult for CLI messages.
  • GraderInitRequest and GraderInitResponse are removed.
  • The RolloutDriver ABC is removed — use HttpRolloutDriver directly.
  • resolve_workspace_directory_from_cwd is gone — use resolve_workspace_directory().
  • Pre-v0.3 HarborBackend constructor kwargs now raise a normal unexpected-keyword TypeError.

Refactors

  • Rubric progress uses Rich instead of tqdm.
  • GitHub fetches use httpx with guarded redirects; template downloads use urllib with encoded refs.
  • osmosis_ai.packaging is importable without the harbor extra.
  • Inlined single-call-site helper modules, removed dead wrappers, and dropped the litellm re-export layer.

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

Review in cubic

… dependencies

Delete unused public types and single-caller wrappers, and stop shipping runtime libraries the base install no longer imports. JSON envelopes still emit schema_version: 1.
@JoyboyBrian
JoyboyBrian requested a review from BaiqingL as a code owner August 27, 2026 07:23
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@github-actions github-actions Bot added breaking Breaking changes refactor Code refactoring labels Aug 27, 2026
@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.79167% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
osmosis_ai/templates/source.py 81.81% 2 Missing ⚠️
osmosis_ai/eval/rubric/engine.py 90.00% 0 Missing and 1 partial ⚠️
osmosis_ai/platform/api/download.py 96.15% 0 Missing and 1 partial ⚠️
osmosis_ai/rollout/http_driver.py 80.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@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.

All reported issues were addressed across 65 files

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread osmosis_ai/packaging.py Outdated
Comment thread .github/scripts/verify-wheel-install.py Outdated
Comment thread osmosis_ai/platform/cli/workspace_repo.py Outdated
Comment thread osmosis_ai/packaging.py Outdated
Comment thread osmosis_ai/packaging.py Outdated
Comment thread osmosis_ai/templates/source.py
Comment thread osmosis_ai/rollout/integrations/agents/strands.py
Comment thread docs/rollout-sdk.md Outdated
Comment thread osmosis_ai/rollout/integrations/agents/strands.py
Comment thread osmosis_ai/templates/catalog.py Outdated

@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.

All reported issues were addressed across 65 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread osmosis_ai/platform/cli/workspace_repo.py Outdated
Comment thread osmosis_ai/templates/source.py

@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.

No issues found across 65 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@JoyboyBrian
JoyboyBrian merged commit f01cb25 into main Aug 27, 2026
20 checks passed
@JoyboyBrian
JoyboyBrian deleted the brian/remove-unused-surface branch August 27, 2026 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking changes refactor Code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant