Skip to content

Portable experiments and replay

The commands on this page are in the development checkout, not published Core 0.2.0. Prefix them with uv run when working from source.

A comparison report is a shareable summary. A portable experiment bundle includes the exact frozen source, private instance inputs and raw recorded evidence needed to inspect a terminal run and repeat supported native experiments without the original project folder. It does not contain a Python interpreter, installed packages, global resource leases or credentials.

Review and export

First inspect the scope of one completed, failed or cancelled run:

optpilot experiment bundle-preview RUN_ID --project ./my-experiment

The preview lists file paths, version/trial counts and how many instance definitions contain private values, without printing the values or file contents. It also identifies omitted dependencies. Inspect the source and raw evidence before sharing a bundle; arbitrary project files and tool output can contain private information even when no Instance is marked private.

optpilot experiment bundle RUN_ID --project ./my-experiment \
  --output comparison.optpilot.zip --include-private

The explicit --include-private flag is required because a runnable snapshot contains full inputs and evidence. Use experiment report when you want a summary that omits this content by default. Export never overwrites an existing file and refuses a run that is still queued, running or waiting. It reads one consistent database snapshot. On supported filesystems, the completed ZIP is published atomically with private creation permissions.

The bundle contains one selected run/review, their frozen dependency closure, derivation ancestors, recorded trials/attempts/generations, resource receipts retained in that ledger, replay traces and imported results. Unrelated runs and source versions are omitted. Derived query indexes and migration history are rebuilt on restore rather than supplied as executable SQL.

Validate and restore without executing code

optpilot experiment bundle-inspect comparison.optpilot.zip
optpilot experiment bundle-restore comparison.optpilot.zip --destination ./restored-records

Validation checks the supported format, content hashes, saved version/review identities, dependency completeness and safe saved file paths. ZIP members are not extracted to arbitrary paths. Duplicate members, symlinks, unexpected files, oversized data and unsupported future versions are rejected. Restore uses the receiving Core's own SQLite schema and parameterized inserts, checks integrity and creates a new ledger directory; it never merges with or overwrites another ledger.

Neither operation executes bundled project code. Content hashes establish integrity, not the identity or trustworthiness of the bundle's author. Review the saved files before running code from another person:

optpilot experiment detail RUN_ID --store ./restored-records
optpilot experiment version VERSION_ID --store ./restored-records
optpilot experiment version-file VERSION_ID FILE_PATH --store ./restored-records

The restore response includes the original reviewId. After reviewing the code and preparing the required environment, submit that frozen review as a new run:

optpilot experiment run --review REVIEW_ID --store ./restored-records

Omitting --run-id gives the execution a new identity and preserves the original result. The installed offline document-search demo can be replayed this way after deleting its original project directory. No source checkout or service account is required once Core is installed.

Dependencies and limitations

Native replay executes trusted source with worker permissions. It is not a sandbox or a guarantee of identical behavior. The receiving environment still needs the project's Python dependencies and any external prerequisites. Observe the saved review's runner, resource requirements and SSH target before executing it: restoring a review does not convert a remote, manual or Harbor evaluation into a local Python evaluation.

New local/SSH Python attempts record allowlisted runtime receipts before importing project code. Reports summarize observed Python, platform, Core worker identity and bounded installed-distribution metadata. Older runs, imported records, manual work and Harbor jobs may have no such receipt; the reporting client does not invent one. Package metadata is not a lockfile or proof of which code was loaded. Compare receipts and keep dependency locks with authored projects when stronger repeatability is required.

Bundles preserve the experiment ledger's resource receipts, but do not restore the user's global resource registry or live reservations. Restored Harbor metadata is disconnected from the source machine's job folder; external job files and container images are not copied. Generated-version provenance may refer to earlier runs outside the selected bundle. Use a broader coordinated backup for full project/registry/runner recovery.

The format limits decompressed bundle content to 512 MiB, record metadata to 64 MiB, each frozen source file to 32 MiB, and members to 20,000. Oversized exports fail explicitly; they do not silently omit evidence. Format versions are independent of Core's package version. Architecture and upgrade recovery ยท Diagnostics and reports