Skip to content

v0.8.0-alpha

This alpha release packages the changes landed after v0.7.9-alpha.

Use it if you need database migrations, the Agent REST control facade, the operator console, campaign programs, or the failed-candidate repair pool.

Highlights

  • Native data-preserving database migrations now upgrade existing schema version 5 (v0.7.9-alpha) databases to schema version 12. Operators can run uv run loreley db current, uv run loreley db migrate, and uv run loreley db validate; API, scheduler, and worker startup can also auto-migrate when DB_AUTO_MIGRATE=true.
  • The Agent REST control facade is available under /api/v1/agent. It exposes capabilities, agent-oriented status, next actions, audited dry-run and execute actions with idempotency, required LORELEY_AGENT_API_TOKEN bearer auth, and job/commit feedback endpoints.
  • The Streamlit operator console now includes Campaign and Repair Pool pages, background baseline ensure tasks, repair-pool listing/actions, repair schedule-one, single job retry, and failed-stale bulk retry.
  • Failed candidates are now stored in a separate repair ledger with structured evaluation attempts and sanitized DiagnosticCapsule evidence. They do not create CommitCard rows, enter the MAP-Elites archive, or appear in normal sampler inputs.
  • Campaign programs can be declared in loreley.program.md and propagated through planning, evaluator payloads, baseline comparability, provenance, and worker scope checks.
  • Evaluator-declared evaluation artifacts now have bounded diagnostics, visibility controls, worker-managed payload storage, database rows, UI API listing/download routes, and agent-visible feedback projections.

Upgrade Notes

Database migration required

This release bumps INSTANCE_SCHEMA_VERSION from 5 to 12. Take a Postgres backup before upgrading a non-disposable database, then run:

uv run loreley db migrate
uv run loreley db validate

When DB_AUTO_MIGRATE=true, API, scheduler, and worker startup run the same migration path automatically. When DB_AUTO_MIGRATE=false, run uv run loreley db migrate before starting those processes. Use uv run loreley reset-db --yes only for disposable local databases.

New authentication requirements

Set these tokens before enabling write-capable API or agent workflows:

  • LORELEY_API_WRITE_TOKEN for UI API POST routes and Streamlit operator actions.
  • LORELEY_AGENT_API_TOKEN for /api/v1/agent routes.

If LORELEY_AGENT_API_TOKEN is unset, agent routes return agent_auth_not_configured. API preflight reports missing write and agent tokens as warnings without blocking read-only API startup.

New configuration knobs

Review these settings before enabling the new flows:

  • DB_AUTO_MIGRATE
  • LORELEY_API_WRITE_TOKEN
  • LORELEY_AGENT_API_TOKEN
  • FAILED_CANDIDATE_REPAIR_ENABLED
  • FAILED_CANDIDATE_REPAIR_NORMAL_JOBS_PER_TOKEN
  • FAILED_CANDIDATE_REPAIR_MAX_TOKENS
  • FAILED_CANDIDATE_REPAIR_MAX_ACTIVE_JOBS
  • BASELINE_BOOTSTRAP_POLICY
  • CAMPAIGN_PROGRAM_CHANGE_POLICY

See Configuration for details.

Operator workflow changes

  • Streamlit operator write buttons require an explicit per-action confirmation checkbox before enabling Campaign baseline ensure, Jobs retry, Repair Pool schedule-one, and Repair Pool candidate state actions.
  • Manual repair scheduling from the UI API and scheduler repair dispatch now serialize cap and repair-token budget checks with the scheduling mutation.
  • Automatic scheduler repair dispatch uses the persisted token budget, so a scheduler restart keeps already earned repair capacity.
  • Repair scheduling is one-generation for this release. Only original failed candidates with failed_depth=0 and no repair_source_candidate_id are eligible.
  • CAMPAIGN_PROGRAM_CHANGE_POLICY=approve is rejected until an approval workflow exists. Use locked or auto.

Fixes

  • Failure persistence now disambiguates evaluator artifact keys that collide with the worker's synthetic evaluation_failure record, so the collision cannot roll back structured failed-candidate state.
  • GET /api/v1/jobs and GET /api/v1/jobs/page now apply candidate_fate and evidence=has_evidence|agent_visible|none filters in SQL, avoiding unbounded application-layer scans for sparse projection filters.
  • Baseline ensure from the Operator console reruns failed or degraded same-key baseline rows while still reusing valid rows.
  • UI API startup marks only stale pending/running baseline ensure tasks failed, leaving recent active tasks alone for multi-process API deployments.

Validation

  • CI continues to run uv run pytest.
  • Local validation for this release candidate: 682 passed, 4 skipped in 14.21s.
  • Add native database migrations from schema version 5 to 12, with explicit loreley db commands and optional startup auto-migration.
  • Add the Agent REST control facade, token-protected write APIs, and a broader Streamlit operator console.
  • Add campaign programs, failed-candidate repair ledgers, and evaluator artifact feedback paths for safer operator and agent workflows.