Skip to content

Develop#43

Merged
gowthamrao merged 10 commits into
mainfrom
develop
Jan 23, 2026
Merged

Develop#43
gowthamrao merged 10 commits into
mainfrom
develop

Conversation

@gowthamrao
Copy link
Copy Markdown
Contributor

No description provided.

gitvishalshetty and others added 10 commits January 20, 2026 00:50
* feat: Implement Core Data Models, Loader, and Strategies

- Added `OptimizerConfig` for configuration.
- Defined core interfaces (`Construct`, `LLMClient`, `Metric`, `PromptOptimizer`).
- Implemented `TrainingExample` and `OptimizedManifest` data models.
- Implemented `Dataset` loader for CSV and JSONL with splitting logic.
- Implemented `RandomSelector` and `IdentityMutator` strategies.
- Added comprehensive tests achieving high coverage.
- Configured project dependencies and resolved `mypy` issues.

2a9f34a
* feat: implement Metric Adapter and standard metrics

- Added `src/coreason_optimizer/core/metrics.py` with `ExactMatch`, `F1Score`, and `MetricFactory`.
- Implemented text normalization logic (SQuAD style).
- Added comprehensive tests in `tests/core/test_metrics.py`.
- Satisfies AUC-4 of the implementation plan.

287bd97
* feat: implement BootstrapFewShot strategy

- Add BootstrapFewShot class in `strategies/bootstrap.py`
- Implement compilation loop for mining successful traces
- Add comprehensive tests in `tests/strategies/test_bootstrap.py`
- Ensure 100% test coverage including edge cases and logger initialization

* feat: implement BootstrapFewShot strategy

- Add BootstrapFewShot class in `strategies/bootstrap.py`
- Implement compilation loop for mining successful traces
- Add comprehensive tests in `tests/strategies/test_bootstrap.py`
- Add complex scenario tests in `tests/strategies/test_bootstrap_complex.py`
- Ensure 100% test coverage including edge cases and logger initialization

7659b26
)

- Create professional README.md with required badges and content
- Generate requirements.txt
- Update docstrings for all python files to Google Style Guide
- Ensure code passes ruff format/check and pre-commit hooks

504589a
…ecks (#33) (#34)

- Add `docs/product_requirements.md` with PRD content.
- Update `README.md` with project details, badges, and usage examples.
- Generate `requirements.txt` based on source code analysis.
- Add Google-style docstrings to all public modules and classes.
- Ensure code quality with `ruff` and `pre-commit`.
* Refactor Core Logic to Async-Native with Sync Facade

- Updated `pyproject.toml` with `anyio`, `httpx`, `aiofiles`.
- Refactored `src/coreason_optimizer/core/client.py`:
  - Created `OpenAIClientAsync` and `OpenAIEmbeddingClientAsync` as Async-Native cores.
  - Created `OpenAIClient` and `OpenAIEmbeddingClient` as Sync Facades using `anyio.run`.
  - Updated BudgetAware wrappers to be compatible (async wrappers created, sync wrappers preserved).
- Updated `src/coreason_optimizer/core/interfaces.py` to include Async protocols.
- Updated tests in `tests/core/test_client.py` and `tests/core/test_client_embedding.py` to verify both Async and Sync behavior using `AsyncMock` and `pytest-asyncio`.
- Verified no `threading.local` usage.
- Ensured strict lifecycle management with `__aenter__` and `__enter__`.

* Fix poetry.lock and Refactor Core Logic

- Ran `poetry lock` to synchronize `poetry.lock` with `pyproject.toml` changes (added `anyio`, `httpx`, `aiofiles`).
- Refactored `src/coreason_optimizer/core/client.py`:
  - Created `OpenAIClientAsync` and `OpenAIEmbeddingClientAsync` as Async-Native cores.
  - Created `OpenAIClient` and `OpenAIEmbeddingClient` as Sync Facades using `anyio.run`.
  - Updated BudgetAware wrappers to be compatible (async wrappers created, sync wrappers preserved).
- Updated `src/coreason_optimizer/core/interfaces.py` to include Async protocols.
- Updated tests in `tests/core/test_client.py` and `tests/core/test_client_embedding.py` to verify both Async and Sync behavior.

* Fix CI issues and Async Mocking

- Added `pytest-asyncio` to `pyproject.toml` dev dependencies and regenerated `poetry.lock`.
- Updated `tests/core/test_client_edge_cases.py` to use `AsyncMock` for `OpenAIClient` (which uses `AsyncOpenAI` internally) and support async/await patterns properly.
- Updated `tests/test_readme_usage.py` to patch `AsyncOpenAI` instead of `OpenAI` and properly mock async responses.
- Verified local tests pass with `pytest-asyncio` mode auto.

93770a1
* Fix merge conflicts and pre-commit errors

Resolves merge conflicts in:
- src/coreason_optimizer/core/config.py
- src/coreason_optimizer/core/metrics.py
- src/coreason_optimizer/main.py
- src/coreason_optimizer/strategies/bootstrap.py
- src/coreason_optimizer/strategies/mutator.py
- src/coreason_optimizer/strategies/selector.py

Added missing fields to OptimizerConfig and created src/coreason_optimizer/utils/exceptions.py to fix imports.
Updated tests to match API changes and removed obsolete test_main.py.
Fixes mypy errors and pre-commit hooks.

9e3111c
@gowthamrao gowthamrao merged commit 965adce into main Jan 23, 2026
18 checks passed
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

3 participants