Platform

Loops

Edit this page

Loops

Loops are the atomic unit of the Better Data platform: governed operational loops with actor attribution, guard enforcement, evidence, and an audit trail.

What is a loop?

A loop is a finite state machine with governed transitions. Every transition:

  • Names the actor responsible (human | automation | ai-agent)
  • Evaluates guard policies before the transition is allowed
  • Attaches structured evidence (documents, scans, confidence scores)
  • Emits an immutable audit event (who / what / when / correlation id)

Guards are enforced in the runtime and policy layer — not by prompt instructions alone.

Agents and Loop Engine (C12)

Agents (in the commerce sense) are not a separate product or autonomous AI platform. They use Loop Engine to govern decisions after Registry discovery and Gateway execution — the same governed decision path as human and automation actors.

  • Never describe agents as an “agent system” separate from the gateway, or as a standalone agent product.
  • Always tie agent behavior to Registry → Gateway → Loop Engine and, for illustration, Commerce Demo governed mode or Build an agent.

Hosted loop engine

Better Data operates a hosted loop runtime at loops.betterdata.co. Compared to self-hosting @loop-engine/sdk, hosted adds:

  • Multi-tenant organization isolation
  • Metering aligned to loop outcomes
  • Industry Pack policy overlays
  • TenantCapabilitySnapshot-driven RBAC
  • Drift detection workers
  • Outbox relay for cross-module delivery
  • Managed upgrades and SLA

OSS: loopengine.io · @loop-engine/sdk
Hosted: Hosted Loop Engine · hello@betterdata.co

Loop types in the CCO platform

| Loop ID | Module | What it governs | | ------- | ------ | ---------------- | | scm.procurement | SCM | PO lifecycle, receipts, invoice alignment | | scm.fulfillment | SCM | Reservation → pick/pack/ship | | scm.quality | SCM | Inspection, deviation, disposition | | scm.replenishment | SCM | Demand-driven reorder | | dcm.demand | DCM | Demand signals and replenishment triggers | | dcm.order | DCM | Order confirmation, allocation, shipment | | dcm.returns | DCM | RMA, receipt, credit, restock |

Canonical IDs and events ship in @betterdata/loop-definitions.

Actors and guards

Each transition declares:

  • allowedActors — who may initiate or approve
  • guards — e.g. confidence thresholds, human-only steps, evidence-required gates

When a guard fails, the loop does not advance; the runtime records the denial for audit.

Audit trail

Each transition emits a LoopTransitionedEvent-shaped record: actor, signal, from/to state, evidence payload, timestamp, correlationId.
The hosted platform aggregates these into operational dashboards and compliance exports.

Audit trail

Self-host vs hosted

| | OSS | Hosted | | - | --- | ------ | | Runtime | @loop-engine/sdk | loops.betterdata.co | | Contact | loopengine.io | hello@betterdata.co |