Appearance
Conformance
Reference
A tool of your own is useful only if it reads Daggry's files and its trail the same way Daggry does. This page says what a tool must do to conform, at three levels, with a checklist for each. It also says which of Daggry's choices are its own policy, and which choices on the reference pages are not confirmed. Read it if you build a verifier, a signer, a factory or a module of your own. If you only use Daggry, you can skip it.
An implementation conforms when it accepts, refuses and produces what the rules on this page say, and passes the published test vectors. The work can be of any kind. For the four formats, see Open formats.
The one rule
Every level and every contract keeps one rule: code runs every validator and judges every result, and no agent and no model grades its own work. A model produces a validator's input only when a person or a rule that code derives bounds what the model can say. The judged fact class is admitted by a person's approval only. See Validators.
The rules an implementation follows
Every level rests on the same five rules of the evidence format. Each is defined in full in Evidence record format.
| Rule | What it fixes | Defined in |
|---|---|---|
| Envelope | The fields of a sealed artifact, which of them a draft holds, and the refusal of unknown fields and unknown format majors. | Fields |
| Canonical JSON | The exact bytes of an artifact: no whitespace, keys sorted by UTF-8 bytes, integers only. | Canonical JSON |
| Digest | SHA-256 of the canonical bytes of every field except digest and signature, as 64 lowercase hex digits. | Digest |
| Chain link | SHA-256 of the 32 bytes of prev followed by the 32 bytes of the digest. The first prev is the genesis digest. | Chain link |
| Signature | An Ed25519 signature over the 32 bytes of the link, checked strictly, with a key id derived from the public key. | Signature and key id |
Kinds follow one naming rule: <namespace>/<name>@<major>. See Kinds.
Test vectors
An implementation proves the five rules against the published vectors. They are on the Evidence record format page.
| Vector | Proves | Where |
|---|---|---|
| Canonical JSON vectors | An input gives the exact canonical bytes and their SHA-256. A non-integer number is refused. | Canonical JSON |
| Two-entry chain | Two digests, two links, the chain head, the key id and two signatures, from a published test-only key. | Worked example |
The signing key in the chain vector is for tests only. It signs nothing real.
Kinds
The table lists the rules for kinds.
| Rule | Detail |
|---|---|
| Form | <namespace>/<name>@<major>. A breaking change to a kind is a new major. |
The evidence namespace | Holds the kinds of the standard: plan, measurement, verdict and approval. An implementation uses them unchanged and adds none. |
| A factory's own kinds | Live in the factory's own namespace, as Daggry's live in daggry. |
| Schemas | Every kind an implementation seals has a published JSON Schema (draft 2020-12) for its body, with the kind as its $id. |
| Unknown kinds | A reader that has no schema for a kind still verifies the envelope, the digest, the link and the signature. It does not judge the body. |
The schemas of the standard's kinds and of Daggry's own are in Record kinds.
Conformance levels
There are three levels. Each level includes the one before it.
| Level | Name | What the implementation does |
|---|---|---|
| 1 | Verifier | Reads a chain and says whether it holds. |
| 2 | Signer | Produces a chain that any verifier accepts. |
| 3 | Factory | Runs work from the same workflow, project config and tenant config, and produces such a chain. |
Level 1: verifier
A verifier reads a log and checks it. It needs the public key and no secret.
- Reads the envelope and refuses an unknown top-level field.
- Refuses a missing
format, a malformed one and a major it does not know. - Refuses hex that is uppercase or of the wrong length.
- Writes canonical JSON by the rules, and refuses a number that is not an integer.
- Recomputes each artifact digest from the covered fields, with
metaincluded only when it is present. - Recomputes each link from
prevand the digest, starting from the genesis digest. - Derives the key id from the public key, and checks each Ed25519 signature strictly over the 32 bytes of the link.
- Checks each entry in the order link, digest, signature, and stops at the first failure.
- Re-hashes every referenced blob and compares it with its digest.
- Passes the canonical JSON vectors and the two-entry chain vector.
Level 2: signer
A signer seals artifacts and appends them to a chain.
- Meets every item of level 1.
- Accepts a draft that holds
kind,idandbodyonly, and adds every other field in code. - Validates
bodyagainst the kind's schema before it seals. - Stamps
metaby the rules: namespaced keys, scalar values, at most 4096 canonical bytes, absent when empty. - Keeps one chain for each tenant and only appends to it.
- Signs the link of each entry with an Ed25519 key, and names the key by its key id.
- Keeps the signing key away from whatever produced the draft.
- Gives a verifier the public key for a key id.
- Uses the
evidencekinds unchanged and puts its own kinds in its own namespace. - Publishes a JSON Schema for every kind it seals.
- Reproduces the digests, links, head and signatures of the two-entry chain vector from the vector's test key.
Level 3: factory
A factory runs work and seals what the work produced.
- Meets every item of level 2.
- Reads a workflow by the Workflow file reference: the same keys, the same refusals, the same strict YAML subset. Refuses a missing
formatand an unknown major. - Reads a gate by the grammar in Gate expressions, and lets a gate read derived fields only.
- Reads a Project config from the baseline, and refuses a missing
formatand an unknown major. - Looks up every area name that a step, the tenant config or a run request gives in the project config of the baseline, and refuses the run when a name is unknown.
- Reads a Tenant config, and refuses a missing
formatand an unknown major. - Implements the validator contract: resolves every reference a
verifystep names, runs script validators on a clean copy of the workspace, runs built-in and native validators over sealed inputs only, and derives every verdict in code. - Admits a validator by name and version: a native validator by name, version and digest, and a project's script validator only when the tenant admits it.
- Reads a script validator's output by its result contract:
exit-code, a result document or a registered adapter. Refuses any other contract, and seals each result as a measurement. - Applies the precedence tenant, then project, then workflow, and lets only a person widen a rule.
- Follows the extension rule in all three documents: ignores and preserves a namespaced key it does not know, and refuses an unknown key without a namespace.
- Runs each step in what its kind names, the deterministic runner, the agent runner or the control plane, and refuses a kind that is not registered.
- Takes a credential by reference only.
- Seals a record only after code has checked it.
Contracts as conformance surfaces
Every row of the table in Module contracts is a conformance surface. A module is replaceable when it passes the published tests of each contract it implements: a conductor, a runner, an engine adapter, a validator, an adapter, a store or a forge. A replacement changes no other contract.
What is not standard
The standard says how to write things down. It does not say what a factory must decide. Each row of the table is one factory's policy, and a factory conforms whatever it chooses.
| Policy | Daggry's choice | Read more |
|---|---|---|
| The always-protected paths | The always-protected set, such as .daggry/** and agent instruction files. | Protected paths |
| The validators a factory ships and admits | The built-in validators. | Validators |
| The bindings a factory offers | The software binding. | Bindings |
| A factory's own kinds | The four kinds in the daggry namespace. | Record kinds |
| The values in a tenant config | The limits, the agents, the engines and the approval points. | Tenant config |
| Where keys are kept and who holds them | The control plane holds the signing key. It never enters a pod. | The modules and where they run |
| How a verifier gets the public key | A route of the HTTP API. | HTTP API |
| Where it runs and where it stores | The installation's choice of runners, log store and blob store. | Install Daggry |
| The interfaces | The daggry commands and the HTTP routes. | CLI |
| The text of an error message | The messages on the reference pages. The cases that are refused are standard. The wording is not. | Verification errors |
Specification choices not confirmed
The reference pages are complete, so they make a choice where the design gives a direction and no detail. The table lists those choices. Each one is inferred and not confirmed, and each can change before it is built. For build status, see the Roadmap.
| Choice | What the reference pages state | Where |
|---|---|---|
| The validator protocol and the native interface | Two operations, describe and validate, with JSON bodies, and the in-process form of the interface. | Write a native validator |
The facts of daggry/result-gate | findings_fail, findings_error, findings_skip and thresholds_missed. | Built-in validators |
| The conductor, runner, forge and store contracts | The rules of each interface and the conformance test named for each. | Module contracts |
projects[].binding | A project entry names its binding, and the key is optional when the tenant registers one binding. | projects |
| The version of a script validator | A project's script is versioned by the baseline, and a tenant's by source.revision. | Versioning |
| The forms of a finding id | threshold:<read> for a threshold, and uncovered: <id>, removed: <id> and newly skipped: <id> in a verdict. | Threshold findings |
| The outcomes of the SARIF adapter | A result at level error is a fail, and every other level is a pass. | Adapters |
Next steps
The list names the pages to read next.
- For every field and rule of a record, see Evidence record format.
- For the kinds and their schemas, see Record kinds.
- For every contract and what can replace each module, see Module contracts.
- For the two configuration files, see Project config and Tenant config.