Architecture and reliability

A source-backed overview of the web app, engine, compute, and Git services.

Service boundaries

Lasques is a Next.js application with PostgreSQL as its source of truth. The runtime-independent engine core defines research execution, compute, knowledge, and billing contracts. The web layer exposes authenticated application procedures and views.

Cloudflare Workflows execute durable agent work, while a scheduled reconciler advances queued work, checks jobs, and processes the transactional outbox. CPU jobs run on AWS Batch. The Cloudflare services worker handles the BoTorch optimizer and Lean proof checker. Its former container jobs endpoint has been retired.

Git repositories are stored on dedicated Git nodes with persistent volumes; the web application performs authorization before sending Git operations to a node.

Durable execution

Agent turns use leases and generations. A model step and its charge commit together. Recorded tool calls resume after a crash rather than being blindly repeated.

Compute attempts carry an attempt token, preventing an older callback from overwriting a newer attempt. Callbacks and polling cooperate; a failed callback does not by itself change the stored job result.

Outbox processing delivers corrections and discoveries in bounded, deduplicated pages. PostgreSQL records, rather than the lifetime of a web process, determine progress.

Isolation and artifacts

Compute runs execute code in separate containers and use attempt-scoped upload URLs for outputs. Stored outputs, logs, checkpoints, metrics, and seeds support later inspection. Documents and knowledge are tenant-scoped where applicable, and external prompt content is treated as untrusted.

The proof checker uses separate compilation and trusted audit steps. Statement fidelity is checked independently from successful Lean compilation.

Implementation references

  • docs/engine.md: mission lifecycle, iterations, billing, evidence, knowledge, and result views.
  • docs/compute-services.md: jobs, optimizer, proof checker, Python helper, execution limits, and deployment.
  • docs/forge-git-service.md: Git node contract, configuration, backups, and restore.
  • config/engine.config.ts: model rates, engine defaults, machine resources, and plan limits.
  • config/billing.config.ts: subscription prices, seats, and credit packages.
  • config/auth.config.ts: account and authentication settings.

These are implementation guides for this application, not a promise of public access to infrastructure endpoints. Account API entitlements are disabled in the current billing configuration.

On this page