Skip to content

[misc] refactor: simplify internal implementation - #334

Merged
JoyboyBrian merged 3 commits into
mainfrom
brian/simplify-internal-code
Aug 30, 2026
Merged

[misc] refactor: simplify internal implementation#334
JoyboyBrian merged 3 commits into
mainfrom
brian/simplify-internal-code

Conversation

@JoyboyBrian

@JoyboyBrian JoyboyBrian commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

What

  • Simplify duplicated CLI output, authentication, dataset upload, rollout, and template internals without changing public symbols or supported output contracts.
  • Consolidate redundant eval and rubric tests while retaining each distinct behavioral assertion.
  • Strengthen exact rich-output, JSON key-order, upload cleanup, and cancellation regression coverage.

Why

Reduce internal duplication and maintenance cost while preserving UI/UX, public APIs, trust-boundary validation, recovery behavior, and CLI stdout, stderr, exit codes, and error text.

How to Test

  • uv run pytest tests/unit/cli tests/unit/platform/cli tests/unit/cli_services tests/unit/test_cli.py tests/unit/test_rubric_cli_command.py -q
  • uv run pytest --cov=osmosis_ai --cov-branch --cov-report=term-missing --cov-report=xml
  • uv run ruff check .
  • uv run ruff format --check .
  • uv run pyright osmosis_ai/
  • Run the repository's CI-filtered pyright --verifytypes check; type completeness remains 100% with only the existing Harbor baseline.
  • Byte-compare HEAD and this branch for representative JSON, plain, rich, help, version, validation-error, and unknown-command invocations; stdout, stderr, and exit codes match.

Checklist

  • Tests added or updated
  • Documentation updated if needed
  • Public API changes are documented (none)
  • Self-reviewed

Summary by cubic

Refactors internal implementation across CLI output, authentication, dataset upload, rollout, and template handling without changing public symbols or supported output contracts. Also preserves template wildcard expansion (e.g. configs/*/*.toml) after simplifying catalog path construction.

  • Removes duplicated helper functions and flattens conditional branches where it simplifies reading.
  • Unifies the simple and multipart dataset upload paths into one flow with identical abort and cleanup behavior.
  • Inlines save_trajectory so diagnostics and trajectory writes share a single error-handling path, preserving trajectory failure logs.
  • Drops the redundant auth-token assertion from the rollout listener; create_callback_app still validates it.
  • Preserves exact CLI stdout, stderr, exit codes, error text, and JSON key order.

Test coverage

  • Merges duplicated eval, rubric, and upload tests while retaining every distinct behavioral assertion.
  • Strengthens regression coverage for exact rich output, JSON key order, upload interruption cleanup, cancelled concurrency waiters, and template non-terminal wildcard expansion.

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

Review in cubic

@JoyboyBrian
JoyboyBrian requested a review from BaiqingL as a code owner August 30, 2026 09:50
@github-actions github-actions Bot added the refactor Code refactoring label Aug 30, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 30, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-08-30T09:53:45.084703Z 275d66b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codecov

codecov Bot commented Aug 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.00000% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
osmosis_ai/rollout/utils/http.py 33.33% 1 Missing and 1 partial ⚠️
osmosis_ai/platform/auth/flow.py 66.66% 0 Missing and 1 partial ⚠️

📢 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 25 files

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

Fix all with cubic | Re-trigger cubic

Comment thread osmosis_ai/templates/registry.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.

No issues found across 25 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 1bb60da into main Aug 30, 2026
19 checks passed
@JoyboyBrian
JoyboyBrian deleted the brian/simplify-internal-code branch August 30, 2026 19:00
JoyboyBrian added a commit that referenced this pull request Sep 1, 2026
## What

- Set `PACKAGE_VERSION` to `0.3.2`.
- Add the 0.3.2 stable changelog entry covering the complete user-facing
change set since `v0.3.1`
([#327](#327),
[#328](#328),
[#330](#330),
[#331](#331),
[#332](#332),
[#335](#335),
[#337](#337)).
- Collapse the 0.3.2rc1–rc3 changelog entries into links to their GitHub
prerelease notes, matching the 0.3.0rcN convention.

## Why

The 0.3.2 release line has been exercised through three release
candidates (rc1–rc3); this promotes it to the stable release. The stable
entry is written against `v0.3.1` so it covers the complete delta since
the last stable release, with internal-only changes (#329, #334) and
version bumps omitted per the changelog conventions.

## How to Test

- `uv run pytest` (3036 passed, 1 skipped)
- `uv run ruff check .` and `uv run ruff format --check .`
- `uv run pyright osmosis_ai/` (0 errors)
- Verify the changelog comparison link `v0.3.1...v0.3.2` and the three
rc release-notes links resolve.

## Checklist

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

---

<a
href="https://app.devin.ai/review/osmosis-ai/osmosis-sdk-python/pull/339"
target="_blank">
  <picture>
<source media="(prefers-color-scheme: dark)"
srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=3">
<img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=3"
alt="Devin Review">
  </picture>
</a>
<!-- devin-review-badge-end -->

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Promotes the 0.3.2 release line to stable after three release
candidates.

- Bumps `PACKAGE_VERSION` from `0.3.2rc3` to `0.3.2`.
- Adds the stable changelog entry covering all user-facing changes since
`v0.3.1`, including removed APIs and dependency changes.
- Collapses the rc1–rc3 changelog entries into links to their GitHub
prerelease notes, matching the convention used for 0.3.0rcN.

<sup>Written for commit 0bfbc43.
Summary will update on new commits.</sup>

<a
href="https://cubic.dev/pr/Osmosis-AI/osmosis-sdk-python/pull/339?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>

<!-- End of auto-generated description by cubic. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant