Private preview. Daggry is not publicly released.Roadmap
Skip to content

Module contracts ​

Reference

You can replace any module of Daggry with your own, and a replacement must behave like the module it replaces. A contract is the published interface between two modules: a file, a protocol or a document with a fixed form. This page lists the seven modules and their limits, every contract, what can replace each module and how a replacement is tested. Read it if you extend Daggry or replace a module. If you only run workflows, you can skip it.

For a shorter account of the modules, read The modules and where they run.

The modules and their limits ​

Each module has one job and a list of things it never does. The table lists both. The runner has two rows, one for each of the two ways it runs a step.

ModuleIts one jobWhat it never does
ConductorOrders the steps of a run and schedules job attempts across runners.Holds a key, seals a record or runs a step's work.
Control planeThe one backend: holds the keys, seals, judges, serves the API and keeps tenant state. It runs the built-in validators.Runs a command or an agent, or seals a claim that code has not checked.
Runner, as the deterministic runnerRuns commands and script validators.Starts a model.
Runner, as the agent runnerRuns the work of an agent step through an engine adapter.Judges its own work, or changes what instructs, constrains or judges it.
EngineThe coding-agent program that does the work of an agent step.Seals a record or reaches the signing key.
ForgeKeeps the workspace and its work items, and takes the result.Seals a record or judges a result.
StoreKeeps the trail and each tenant's state.Changes or removes a sealed entry.
ValidatorsJudge the work in code.Read anything but their inputs, or start a model.
Open formats · the files the modules read and writeTenant confighow the factory worksWorkflowthe work, as stepsProject configtrue of one projectEvidencesigned, linked recordsConductororders steps · schedules job attemptsLeasesthe one authority on livenessnever holds a keynever seals a recordnever runs a step's workDeterministic runnercommands · script validatorsnever starts a modelAgent runneragentic or model-generated workEngine · any agent, by its adapterControl planeseals · holds the keysValidatorscheck as code · add your ownStorethe trail · tenant statea claim becomes evidenceForgework in · result outThe seven modules you set up as your factorylimits · agentsstepsvalidators · protected pathswritesjob attemptunder a leasejob attemptunder a leaseclaimsclaims
The seven modules and the four open formats they read and write. The runner is drawn twice, because it runs a step as a script or with an agent. The conductor hands a job attempt to a runner, the runner sends back claims, validators check each claim as code, and the control plane seals it as evidence in the store. The forge sends work in and takes the result. You can add your own validators: a script, or a native validator in any language.

The diagram shows the four open formats and the modules. Three modules run a job: the conductor, the runner, drawn as the two ways it runs a step, and the control plane. The conductor reads the tenant config and the workflow and hands each job attempt to a runner. The runner reads the project config and sends claims to the control plane. The control plane writes evidence. Script validators run in the deterministic runner, and built-in and native validators judge beside the control plane. The forge and the store are drawn as modules of their own.

Replace a module ​

A replacement is a module that passes the tests of every contract it implements. It changes no other contract. The table lists what you can replace and the contract that makes it possible.

You bringIt replacesContract
An engine for another coding-agent programThe engineEngine interface. The agent runner knows an engine adapter, not an engine.
A forge for another source of workThe forgeForge and effect interface
A store for another databaseThe storeStore interfaces
A runner for another execution environmentThe runnerRunner protocol. A runner that accepts a job attempt and keeps its lease can be scheduled, whether it runs in a pod, a virtual machine or a process.
A scheduler of your ownThe conductorConductor interface
A validator in any languageNo module: you add itValidator contract

Daggry as shipped is one implementation of these contracts. Nothing in a contract depends on its language, its database or its cluster. Another implementation can write the same four formats and produce evidence that the same tools verify. See Conformance.

The contracts ​

The table lists each contract once. A module is replaceable when it passes the tests of every contract it implements. See Conformance.

ContractBetweenDirection and transportDefined inWhat you can add or replaceConformance test
Workflow documentThe tenant and the conductor.A file, read once when a run starts.Workflow fileYour own workflows, step kinds and extension keys. Another conductor that reads the same file.The published schema and the refusal cases.
Evidence envelope and kindsThe control plane and any verifier.A file or a JSON response: sealed artifacts in a signed chain.Evidence record format, Record kindsYour own kinds in your own namespace. Another signer or verifier.The canonical JSON vectors and the two-entry chain vector.
Validator contractThe control plane and a validator.A function call in-process, or a request and a response with JSON bodies.ValidatorsScript validators and native validators, in any language.Equal verdicts for equal inputs, over the published input sets.
Result document and adaptersA script validator or an adapter, and the deterministic runner.A file or standard output, written once when the process ends.Project config, BindingsAny tool that writes the document. An adapter for any other format.The published schema and the refusal cases.
Project configA project and a factory.A file in the workspace, read from the baseline.Project configYour own validators, areas and extension keys. Another factory that reads the same file.The published schema and the refusal cases.
Tenant configA tenant and the control plane.A document the control plane holds.Tenant configYour own catalogue, limits, bindings and admitted validators.The published schema and the refusal cases.
Conductor interfaceThe conductor and the control plane.Request and response over HTTP with JSON.Conductor interfaceAnother conductor, with another way to order and place work.The same sealed chain for the same workflow and the same step results.
Runner protocolA runner and the conductor.Request and response over HTTP with JSON. The runner calls.Runner protocolAnother runner, on another kind of machine or isolation.A claimed attempt is reported, kept alive and released by the rules.
Engine interfaceThe agent runner and an engine.A process protocol: the runner starts the engine and offers it tools.Engine interfaceAnother engine for each tenant, through an engine adapter.The same prompt, tools and hand-in for every engine.
Forge and effect interfaceThe control plane and the place work comes from and goes to.Request and response over HTTP with JSON. The control plane calls.Forge and effect interface, BindingsAnother source of work items and another way to deliver a change.An effect is idempotent, and a change is rechecked from the store's own view.
Store interfacesThe control plane and its storage.A storage interface for the log and one for blobs.Store interfacesAnother log store and another blob store.An appended chain reads back unchanged and verifies.
Identity and credential referencesA tenant, the control plane and a secret store.A token on each request, and a name in a document.Identity and credential referencesAnother identity provider and another secret store.No document and no pod holds a secret value or the signing key.

Conductor interface ​

The conductor orders the steps of a run and leases job attempts to runners. It holds no key and seals nothing. The table lists its rules.

The conductorRule
ReadsThe workflow, the tenant's orchestration limits and the sealed state of the run.
DecidesThe next step, which job it belongs to and when a new attempt starts.
LeasesOne attempt to one runner for a limited time. The lease is the one authority on liveness.
Hands overEach step to what its kind names: the deterministic runner, the agent runner or the control plane.
NeverSeals an artifact, judges a result or holds a signing key.

Runner protocol ​

A runner claims an attempt, runs its steps and reports. The deterministic runner and the agent runner speak the same protocol and implement different step kinds. The table lists the operations.

OperationRule
ClaimA runner asks for an attempt and receives a lease, the steps to run and the version of the workspace to start from.
HeartbeatThe runner renews the lease while it works. A lease that lapses ends the attempt, and a new attempt starts from the last sealed version.
ReportThe runner hands in each step's records as drafts. The control plane checks and seals them.
ReleaseThe runner gives the attempt back when its steps end or when a step waits for a person.

The table lists what each runner implements.

RunnerImplementsNever
Deterministic runnercommand and verify steps, script validators and adapters.Starts a model or holds a model credential.
Agent runneragent steps, through an engine adapter.Judges its own work.

Engine interface ​

An engine does the work of an agent step. The agent runner drives every engine the same way, through an engine adapter, so an engine is replaceable for each tenant. The table lists what the adapter gives the engine.

The adapter gives the engineRule
A promptThe step's instructions, in a file the engine cannot change.
Toolssubmit, to hand in a record, and validate, to preview a validator.
A working copyThe workspace, inside the step's scope.
A credentialBy reference, from the tenant config.

Whatever the engine hands in is a claim. An engine never seals, and never reaches the signing key.

Forge and effect interface ​

The forge is the module that reads work items and delivers a change. An effect is one operation it offers. In the software binding the forge is a git host. The table lists the operations.

OperationRule
Read a work itemThe control plane fetches the request a run is for and seals it as a work-item.
Store a versionA runner hands a change to the workspace store with a credential scoped to one workspace.
RecheckThe control plane reads the change back from the store's own view before it accepts a step.
EffectAn idempotent side effect that an effect step names. The idempotency key is the run id plus the step id.

Store interfaces ​

The control plane keeps two stores, and the table gives the rule for each.

StoreHoldsRule
LogThe chain of sealed entries, one chain for each tenant.Append only. An entry is never changed or removed.
BlobsBytes named by the SHA-256 of their content, such as a workflow file.A blob read back hashes to its name.

Identity and credential references ​

The table lists the rules for identity, credentials and the signing key.

ItemRule
Tenant identityEach request carries a tenant token. A token reaches one tenant.
Author of an approvalThe identity of the token that approved.
CredentialA document names a stored secret by reference. No document holds a secret value.
Signing keyThe control plane holds it. It never enters a pod. A verifier needs the public key only.

Next steps ​

The list names the pages to read next.

  • For what an implementation does to conform, see Conformance.
  • For the validator contract in full, see Validators.
  • For the four formats the modules read and write, see Open formats.
  • For what one kind of work adds, see Bindings.

Sponsored by