LRE (Long Run Engine)

LRE is the universal engine Metnos uses for work that is too long or too broad to remain attached to a single chat turn. The workload is recorded, divided into verifiable units, and handed to a supervised worker. Chat immediately returns a receipt; execution continues independently and can resume after a restart.

One engine, multiple kinds of work

The LRE core knows nothing about images, mail, databases, or other domains. It consumes registered plans that declare sources, dependencies, output schemas, resources, limits, timeouts, and failure behaviour. A new task type is added as a verified registration; it does not add a special branch to the engine.

The first distributed registration processes image collections and produces questions, solutions, notes, and a formula reference. It is a tested use of the general path, not the definition of LRE. Other workloads can use the same engine once they have equivalent contracts and evidence.

What happens after a request

  1. Admission. Metnos recognises a registered profile, verifies that LRE is enabled, and checks authority, sources, plan, and budget.
  2. Sealed inventory. Sources receive stable identities and ordering, making the denominator verifiable.
  3. Persistent planning. Stages and units are stored in an immutable revision.
  4. Governed execution. The coordinator proposes ready units; the central scheduler assigns resources and concurrency.
  5. Consolidation. Hierarchical reductions avoid loading an entire corpus into memory or a single prompt.
  6. Completion. LRE reports completion only after accounting for all units and validating required artifacts.

There is no hidden 98- or 980-item corpus ceiling. Each revision does, however, have finite and visible limits consistent with its admitted resources. Large collections advance in batches and reductions instead of accumulating without bounds. If a budget is exhausted, the workload exposes a structured state rather than pretending that coverage is complete.

Local, remote, and intelligent executors

Each stage declares where and how it may run. A local executor runs on the server; a remote executor runs on a paired device. Either can be deterministic or use a language or vision model. Placement does not determine intelligence: they are independent properties.

Independent units may run in parallel, but they do not create private pools of threads or processes. All concurrency passes through the central scheduler, which enforces global, owner, workload, model, and device limits. “Maximum concurrency” is a ceiling, not a promise to occupy every slot at all times.

Interruptions, retries, and duplicates

SituationLRE behaviour
Worker or computer restartsState remains in persistent storage; expired leases and unfinished units are reconciled in bounded batches.
A recoverable attempt is interruptedIt may be attempted at least once again, with the delay and attempt number recorded.
Two attempts finish for the same unitFencing and conditional commit admit one result only for that unit and revision.
The same HTTP request is redelivered with the same idempotency keyIt returns the same workload instead of creating a second revision or corpus.
An external effect has an ambiguous outcomeIt is not retried automatically unless it is idempotent or reconcilable; human attention is required.

The precise guarantee. LRE uses at-least-once attempts and admits one valid commit per unit. It can make an observable effect effectively once when the operation is pure, idempotent, or reconcilable. It does not promise universal exactly once semantics across databases, filesystems, providers, and remote devices.

Consistency as a workload evolves

The admitted plan, inventory, and executor or model bindings are frozen in the revision. An incompatible change creates a new revision instead of silently altering half of a running workload. Results may be reused only when dependency digests match. When one source changes, LRE invalidates that unit and its descendants, not independent siblings.

Pausing prevents new claims while allowing a commit already in flight to finish safely. Cancellation is cooperative and prevents new units from being claimed. Pause, resume, cancel, and error-resolution commands carry both an expected version and an idempotency key, so redelivering a command does not multiply its effects.

How to use it

  1. Under System → Services, check that the LRE worker is healthy and enable the feature. It is disabled by default on new installations.
  2. Describe the desired outcome in chat and identify authorised sources. Metnos can admit registered profiles only.
  3. Keep the receipt containing the workload_id and open /agent/workloads.
  4. Inspect state, denominator, budget, stages, and events. Use a control only when it is enabled for the current state.
  5. On completion, check artifact digests and validation before downloading them.

Disabling the feature stops new submissions but does not delete history or artifacts. Data deletion follows the owner's lifecycle and retention rules. Downloads and views remain scoped to the authorised identity.

When progress stops

The LRE console

The real LRE console, showing workload list, detail, digests, budget, and stages in an Italian-language instance.
A completed pilot workload: the console exposes the real denominator, admitted limits, and plan composition.
  1. General navigation. The LRE console uses the same structure as the administrative HTTP UI.
  2. Workload list. State and progress remain available after refresh, logout, or restart.
  3. Workload facts. Priority, state, accounted units, and creation time.
  4. Revision digests. Identify the plan and inventory that were actually admitted.
  5. Admitted budget. Ceilings for units, attempts, duration, bytes, tokens, artifacts, and concurrency.
  6. Stages. Each stage reports executor, progress, timeout, requirement status, and resources.

The displayed corpus is synthetic and non-sensitive; its operational identifier contains no personal data.