API and compatibility policy¶
OptPilot is pre-1.0. Public documentation describes the development checkout unless a feature is explicitly associated with a published release. A module being present in the wheel does not by itself make every function in it a supported extension point.
Supported entry points¶
| Surface | Contract |
|---|---|
optpilot / python -m optpilot |
Commands and exit statuses documented in the CLI reference. Inspection/execution operations return JSON; demo, init and human-mode doctor use readable text. |
optpilot.experiment |
Documented discovery, review, execution, cancellation, saved-version and read-projection operations. Prefer the bounded browsing APIs for applications and the explicit complete operations for export. |
optpilot.experiment_bundle |
preview, export, inspect and restore for versioned portable run bundles. Restore never executes project code. |
optpilot.optuna_generator.propose |
Optional native parameter-generator adapter documented in the Optuna guide; installing the extra is required, and reproducibility also depends on the Optuna version. |
| Project authoring | optpilot.experiment.yaml, packaged JSON Schema and semantic validation; candidate and generator protocols. |
| External results | The versioned input format and binding behavior in external results. Imported claims remain distinct from observed managed execution. |
Read architecture for owners and query performance for cursor, truncation and evidence-loading rules. Runtime receipt, diagnostic, comparison-report and bundle documents carry explicit schema/format identifiers. Do not infer a format version from the package version.
experiment.selection_for_run(store, run_id) is the explicit full-selection read
for editing a saved run's settings. It reconstructs the effective selection from
the complete frozen review, including fixed candidates, generator/budget, cases,
execution settings, SSH target and resource budgets. It returns no trial records,
logs, evidence or private input values. The result is not the original authored
syntax: it keeps the shortest explicit instance prefix that, with the frozen
suites and deduplication, preserves the reviewed instance order. Suite-only
selections remain suite-only. Missing or inconsistent frozen reviews are errors;
clients must not fall back to clipped graph membership or current project files.
Changing a contract¶
Patch releases should preserve documented commands, parameter meanings, existing result fields and persisted identities. Adding optional fields is compatible: clients should read the fields they need and tolerate additional result fields. Deliberate breaking changes belong in a minor release with a changelog entry, affected examples and a migration or recovery path where stored data is involved. Pre-1.0 status does not justify silently discarding evidence.
Input validation may reject unsupported fields rather than silently ignoring them. CLI options, IPC requests, imported bundles and database schemas have different trust boundaries; compatibility does not require accepting malformed data. Cursor tokens are opaque and query/ledger-specific. They are continuation state, not durable identifiers to save across schema changes or copy between projects.
Frozen version IDs, content hashes, review identities and recorded attempt evidence are persisted contracts. Changes to canonical JSON, hashing domains or serialized inputs require explicit compatibility review. The shared primitives now live in _content_identity.py; realm.refs forwards the same objects for retained callers. Golden vectors from the previous release and old-ledger replay tests protect their bytes.
Database migrations are appended in order. Published SQL and checksums are immutable; never edit them to make a failing old store appear current. Newer incompatible stores must be refused before mutation. Raw SQLite tables are an internal persistence format, not a general extension API; use the documented operations rather than writing application rows directly.
Retained and private implementation¶
Underscore-prefixed modules, worker wire frames, derived query indexes and internal controller methods may be refactored while preserving their public and persisted contracts. The older Realm/retained-study Python paths remain distributed for existing consumers and tests. They are not automatically deleted or advertised as the current command line. Deprecating one requires a caller inventory and a separate compatibility decision.
test_active_architecture.py follows local static imports from active CLI/API and worker entry points and rejects dependencies on retained Realm controllers. It also checks hash compatibility and retained forwarding imports. This guard covers static imports and explicitly registered standalone workers; it does not prove the absence of arbitrary dynamic imports or establish that all unreached code can be removed.
New features should extend an existing owner, expose a small documented contract and include a real failure/recovery test. Keep dependency changes optional when only one integration needs them. Do not introduce a second execution engine or a parallel source-of-truth store just to simplify one adapter.