Contribute to OptPilot Core¶
The public repository contains the experiment runtime, CLI, schemas, project files and documentation sites. Run the checks from its root with Python 3.10+ and uv. Start with the contribution guide for issue and pull-request expectations.
Desktop source is maintained in a separate private repository. Core contributors can work on this repository without access to Desktop. If a Core change affects the Desktop integration, describe that contract change and any integration validation you could not run.
Find the implementation behind a public feature¶
| To change… | Start in… |
|---|---|
| The public experiment API or a CLI command | src/optpilot/experiment.py and src/optpilot/experiment_cli.py |
| Manifest validation, saved files or study selection | src/optpilot/schemas/, _experiment_catalog.py and _experiment_study.py in the package |
| Run execution or the recorded result | _experiment_execution.py and _experiment_store.py in the package |
| Resource admission or measurement records | experiment_resource_plan.py and experiment_resources.py in the package |
| A runnable example | The manifest, grader and declared files together in the corresponding catalog/ directory |
| The offline first experiment | src/optpilot/starter.py and the bundled files under src/optpilot/_starter/document_search/ |
When changing the supported workflow, follow the public entry point through validation, review, execution and result inspection. Some tests also exercise the project's earlier runtime. Use a versioned example to check user-visible behavior. Experiment design and terminology
Run the checks¶
uv sync
uv run --locked --group quality ruff check
uv run python -m unittest discover -s tests/core -p 'test_*.py'
./scripts/smoke_test.sh
uv run --group docs mkdocs build --strict
The smoke test validates document search and runs both candidates across all five instances in a temporary store. If a change affects a model provider, remote worker or external runner, also exercise that integration in its own environment. Record the actual outcome, including failures. Repository instructions
Ruff currently gates the active runtime paths listed in pyproject.toml; it does
not claim that the retained implementation has been migrated to the same rules.
Format new modules with uv run --group quality ruff format PATH and keep broad
format-only changes separate from behavioral fixes. The API policy
defines supported and persisted contracts; the architecture test guards their
static dependency boundary and content-identity compatibility.
Preview documentation changes¶
Open the URL printed by MkDocs. Edit the technical manual in docs/ and its navigation in mkdocs.yml. For a tutorial, run the commands from the specified working directory with a fresh ledger and check the resulting measurements. Keep dependencies and credentials specific to the examples that need them.
Mark unreleased commands explicitly. The repository documentation follows development, while PyPI packages and Desktop installers only gain those commands when a release is published. Avoid adding a one-line install command that assumes a future package already exists.
The public website lives under website/. For changes to product copy, verify both English and Chinese builds from that directory:
GitHub Pages serves the website at the project root and this manual under /reference/. Website development guide
English website pages live in website/content/docs/; Chinese counterparts live in website/i18n/zh-CN/docusaurus-plugin-content-docs/current/. Keep installation, first-run outcomes and release status aligned in both. Homepage messages are translated in website/i18n/zh-CN/code.json. The technical reference is currently in English; label links accordingly from Chinese pages.
Check a Core distribution¶
Before publishing a Core release, check that the versions in pyproject.toml and src/optpilot/__init__.py agree. Inspect the packaged wheel and source distribution with:
Test a new first-run command from an installed wheel in a fresh virtual environment and an empty working directory. A checkout can hide missing packaged resources. Review license/notice files and avoid including test ledgers, caches or credentials in distributions.
Run scripts/check_platform_install.py with that fresh environment's Python. The script clears PYTHONPATH, uses a temporary working directory and isolated resource registry, then runs the bundled demo, reads retained evidence, exports a report and checks diagnostics. CI runs this installed-wheel path on Linux, macOS and Windows; the full Linux suite also covers Python 3.10–3.12.
Core CI also resolves the declared base dependencies independently with
lowest-direct and highest on Python 3.10 and 3.12, then exercises an installed
wheel's offline example, schema references, report, diagnostics and bundle replay.
The normal suite still uses the lockfile. The jsonschema>=4.18 floor is required
by the referencing-registry API; earlier 4.x releases do not accept it.
PyYAML>=6.0.1 avoids the 6.0 source-build failure on Python 3.12 and supplies
wheels for that interpreter. Keep the Asteria example's lockfile synchronized
when Core dependency metadata changes. This matrix covers base runtime
dependencies, not every optional example dependency.
The PyPI publishing workflow is manually dispatched from main with an existing release_tag, such as v0.2.1. It checks that the tag matches the package version and names a commit on main, builds the distributions, tests the exact wheel and passes those artifacts to the trusted publisher. Creating a tag or changing a version does not publish a release by itself. Maintainers must review the platform results and configure the PyPI environment before publication.
For the release process and current priorities, see the changelog and roadmap. Security reports follow the security policy.
External Actions are pinned to commit SHAs and checked by
uv run python scripts/check_workflow_pins.py. For distribution signatures,
source-tag attestations and their limits, see release provenance.