harbor run -t openthoughts/tasktrove-mix-h4-binary-easy-mix-h4-binary-easy-0361harbor download openthoughts/tasktrove-mix-h4-binary-easy-mix-h4-binary-easy-0361Task: Implement a lightweight Optuna-like API as a Python package at /app/optuna (with submodule optuna.trial), providing just-enough functionality to satisfy the given pytest tests.
What you must build
A. Submodule optuna.trial
B. Top-level API in optuna (exposed from /app/optuna/init.py) Provide the following API, matching how the tests call it (including keyword argument names and expected behavior):
class Trial
Notes:
class Study
Functions (module-level, in optuna package)
When calling create_study(storage=..., study_name=...), a study is created/initialized for that storage.
study.optimize(objective, n_trials=20) should run 20 trials, each time:
Study.trials should return a list of FrozenTrial objects representing all completed trials (ordered by trial number). Tests expect:
In test_loaded_trials:
In test_multiprocess:
Actionable deliverable
Note: Implementations should avoid requiring the real Optuna library; this task is to provide a minimal, self-contained substitute API that the given tests can exercise in a multiprocessing context. The implementation goes in /app/optuna.py or, preferably, in /app/optuna/ as a package.