Use this page as the spec-style contract summary for day-to-day integration, automation wiring, and runbook checks.
Stable command names and required flag posture are documented in
stability-guarantees.md.
- core loop:
suggest,ingest,status,demo - lifecycle ops:
cancel,retire,heartbeat - support ops:
import-observations,export-observations,report,reset,list-archives,restore,prune-archives,health,metrics,validate,doctor
suggest: emits one trial proposal by default, or a locked batch when--count N/bo_config.batch_sizerequests more than one suggestion.- evaluator: runs externally using
params; Looptimum does not execute your workload. ingest: validates trial identity and payload shape, then clears pending and appends observation.status: reports run headline state (observations,pending,best,next_trial_id, and related metadata).
Objective contract note:
objective_schema.jsondefines a requiredprimary_objective, optionalsecondary_objectives, and optionalscalarizationpolicy.
Optional hard-feasibility contract:
constraints.json: validated byvalidateand enforced bysuggest
Single-suggestion output (count == 1) is the canonical object:
schema_version: semver string emitted by runtimetrial_id: unique integer identifier in run scopeparams: exact parameter payload for external evaluationsuggested_at: suggestion timestamplease_token: optional opaque worker-claim token when leases are enabled
Batch output (count > 1) defaults to:
schema_versioncountsuggestions: array of canonical suggestion objects
--jsonl emits the same suggestion objects one per line for worker handoff.
Constraint note:
- if constraints eliminate all sampled attempts,
suggestexits nonzero, creates no pending trial, and records the failure inacquisition_log.jsonl - if
max_pending_trialswould be exceeded, the whole requested batch is rejected before pending state is mutated
Required:
trial_id: must match a currently pending trialparams: must exactly match suggested paramsobjectives: map containing every configured objective namestatus:ok,failed,killed, ortimeout
Rules:
status: okrequires numeric finite values for all configured objectives.- non-
okstatus requiresnullfor all configured objectives. - optional
terminal_reason(short string) is recommended for non-okoutcomes. - optional
penalty_objectiveis allowed for non-okoutcomes. schema_versionis emitted by runtime and remains optional in the ingest schema.- when a pending trial carries
lease_token, the CLI requires matching--lease-tokenoningest; the token is not embedded in the ingest payload
bestranking uses onlystatus: "ok"observations and the configured objective policy.- multi-objective campaigns preserve raw
objective_vectorvalues and scalarized ranking metadata in status/manifests/reports. penalty_objectiveis never used forbestranking.- non-
okpayloads without an explicit reason are normalized toterminal_reason: "status=<status>". - identical duplicate ingest replay is accepted as explicit no-op success.
- conflicting duplicate ingest replay is rejected with mismatch details.
import-observations --input-file <path>accepts canonical JSONL observation objects or flat CSV rows withparam_*/objective_*columns.--import-mode strictis all-or-nothing;--import-mode permissiveapplies valid rows, rejects invalid rows, and writes a machine-readable report understate/import_reports/.- imported rows require zero live pending trials, receive fresh local
trial_idvalues fromstate.next_trial_id, and preserve anysource_trial_idonly as provenance. - imported observations are first-class terminal observations: manifests,
best,next_trial_id,observations.csv, and laterreportoutputs are updated from authoritative state. export-observations --output-file <path>writes the same canonical JSONL or flat CSV observation surface for reuse in future campaigns.
Default file-backed artifacts under each template's state/ path:
bo_state.json: authoritative resumable state (schema_version, observations, pending, best, counters)observations.csv: flattened observation exportacquisition_log.jsonl: append-only suggestion-decision traceevent_log.jsonl: append-only lifecycle/ops traceimport_reports/*.json: permissive warm-start import summaries plus rejected row detailstrials/trial_<id>/manifest.json: per-trial manifest/audit recordreport.jsonandreport.md: explicitreportcommand outputs, including objective-config and Pareto summaries for multi-objective campaigns
The public starter-kit modules under client_harness_template/ are optional
wrappers around the same file-backed runtime:
starterkit_queue_worker.py,starterkit_airflow.py, andstarterkit_slurm.pywrap the canonicalsuggest -> run_one_eval.py -> ingestflow for common scheduler topologiesstarterkit_config.pyplusstarterkit_events.pynormalizestate/event_log.jsonlinto webhook-sidecar payloads without coupling network delivery into mutating CLI commandsstarterkit_mlflow.pyandstarterkit_wandb.pyread canonical state/report artifacts post-hoc and do not mutate optimizer state
Reference assets:
docs/integration-starter-kit.mddocs/examples/starterkit/README.md
service/is a preview-only local FastAPI wrapper over the same file-backed runtime and is not part of the stablev0.4.xcompatibility surface.- campaign registration requires
feature_flags.enable_service_api_preview = trueinside the target campaign'sbo_config.json. - the service registry stores campaign id, label, root path, and created-at metadata only; optimizer state remains authoritative in the campaign root.
- current preview endpoints cover
GET /health, campaign create/read/detail, read-onlystatus/report, and mutatingsuggest/ingest/reset/restore. reportstays artifact-backed: the preview endpoint reads existingstate/report.jsonand does not generate reports implicitly.- preview auth is optional; when enabled,
GET /healthstays unauthenticated, all other routes require auth, campaign roots must opt in withfeature_flags.enable_auth_preview = true, and the service writesservice_state/auth_audit_log.jsonlfor authz failures and privileged actions. - preview coordination is optional; when the service runs with
LOOPTIMUM_SERVICE_COORDINATION_MODE=sqlite_lease, campaign roots must also setfeature_flags.enable_multi_controller_preview = true, and coordinatedsuggest/ingest/reset/restoreacquire a service-owned controller lease before entering the existing runtime file lock. - role matrix:
viewer: read-only API, dashboard, and exportsoperator:viewerplussuggestandingestadmin:operatorplus campaign registration,reset, andrestore
Reference assets:
docs/service-api-preview.mddocs/dashboard-preview.mddocs/auth-preview.mddocs/coordination-preview.mddocs/examples/service_api_preview/README.mddocs/examples/dashboard_preview/README.mddocs/examples/auth_preview/README.mddocs/examples/coordination_preview/README.md
Dashboard companion note:
/dashboardand/dashboard/campaigns/{campaign_id}are preview-only operator routes mounted from the service stack- campaign-bound dashboard routes require both
feature_flags.enable_service_api_preview = trueandfeature_flags.enable_dashboard_preview = true - the dashboard remains read-only and consumes the service read-model/export endpoints rather than reading state files directly
health [--strict]is the read-only machine-readable health surface; it combines validate-aligned hard errors/warnings, path presence, lock state, and governance findings.metricsis the read-only machine-readable metrics surface; it adds counts, pending-age buckets, suggest-latency summaries, and governance totals.bo_config.jsoncan setgovernance.allowed_statuses,retention.archives.max_count,retention.archives.max_age_seconds,retention.archives.max_total_bytes,retention.logs.event_log_max_bytes, andretention.logs.acquisition_log_max_bytes.- Retention is warn-first: Looptimum surfaces policy breaches but does not auto-prune archives or rotate append-only logs.
- Mutating commands append
governance_override_usedwhen the runtime itself emits a terminal status outsidegovernance.allowed_statuses, andgovernance_violations_detectedwhen observed statuses or retention footprints breach configured policy.
- for direct CLI/file-backed operation, one controller/writer per state path is required; multi-controller writes to the same state path are unsupported outside the explicit preview service coordination mode.
- mutating commands (
suggest,ingest,import-observations, lifecycle ops,report,reset,restore,prune-archives,export-observations) run under exclusive file lock semantics. - batch allocation is atomic under that lock: contention or validation failure rejects the whole batch with no partial pending creation.
resetremoves runtime artifacts with confirmation; archive is enabled by default unless--no-archiveis passed.list-archivesis read-only and inventoriesstate/reset_archives/, including legacy manifest-less archives and any integrity warnings.restore --archive-id <id> --yesrehydrates archived runtime artifacts with integrity checks and all-or-nothing overwrite behavior.prune-archives --keep-last N --older-than-seconds S --yesdeletes only archives that match the requested retention policy; legacy archives with unknown age are never pruned by age alone.- stale pending handling can be automated via configured age policy or manual
retire. - interruption recovery runbook:
recovery-playbook.md.
Constraint pointers:
search-space.md: parameter types,scale, andwhenconstraints.md: hard-constraint DSL and troubleshooting
v0.2.xstate withoutschema_version(or with0.2.x) is upgraded in-memory and persisted on the next mutating command.- current
v0.4.xstate artifacts still persistschema_version: "0.3.0"because the on-disk state-file series did not change in this line. - earlier
v0.3.xstate is required to load transparently inv0.4.x. - deprecation and compatibility policy:
stability-guarantees.md.
- algorithm behavior and determinism boundaries:
how-it-works.md. - benchmark evidence and reproducibility protocol:
../benchmarks/README.md. - CI and operational runbook policy:
ci-knob-tuning.md.