Docs menu

Examples

Four reference domains. Each version is a complete set of structure documents, and from the version that introduces behaviour, a behaviour document beside them.

Checkout, origination, diligence, and agent registration are the corpus the core schemas are held to. A version folder is the full set of documents for that version, not a diff. The excerpts below are taken from the latest version of each domain at build time.

Checkout

A shop sells through a cart and an order. Commerce, fulfilment, payments, and parties are separate vocabularies. From v3 the same versions carry behaviour: checkout, payment, shipment, and the policies that decide them.

Latest in this build: checkout/v4

Demonstrates

  • structure/v1 domains that use each other (commerce uses parties)
  • A cart line as an entity, because the connection carries quantity and price
  • behaviour/v1 actions with transitions, and policies over them

From examples/checkout/v4/commerce.json

              {
  "dna": "structure/v1",
  "id": "commerce",
  "name": "Commerce",
  "description": "What is sold and how an order is assembled. Cart lines, prices, and the two addresses on an order live here. Parties live in the parties vocabulary this domain uses.",
  "uses": [
    "parties"
  ],
  "entities": [
    {
      "id": "product",
      "name": "Product",
      "description": "Something in the catalog.",
      "attributes": [
        {
          "name": "name",
          "type": "string"
        },
        {
          "name": "listPrice",
          "type": "number",
          "description": "The amount of money. Currency is the next attribute."
        },
        {
          "name": "currency",
          "type": "string",
          "description": "The currency of listPrice."
        }
      ]
    }
  ]
}
            

From examples/checkout/v4/commerce.behaviour.json

              {
  "dna": "behaviour/v1",
  "id": "commerce-behaviour",
  "name": "Commerce behaviour",
  "description": "What a shopper and a merchant do with a cart and an order, and the purchase they both follow from an open cart to a final state. Payment and shipping are performed through the payments and fulfilment behaviour this document uses.",
  "domain": "commerce",
  "uses": [
    "payments-behaviour",
    "fulfilment-behaviour"
  ],
  "actions": [
    {
      "id": "add-line",
      "entity": "cart-line",
      "name": "Add line",
      "description": "Put a quantity of a product variant in an open cart. Storefronts call this at volume; a retry under the same idempotency key adds the line once.",
      "input": [
        {
          "name": "cart",
          "type": "reference",
          "entity": "cart"
        },
        {
          "name": "product",
          "type": "reference",
          "entity": "product"
        },
        {
          "name": "variant",
          "type": "string"
        },
        {
          "name": "quantity",
          "type": "integer"
        }
      ]
    }
  ]
}
            

Origination

A lender takes an application through credit, appraisal, and closing to a funded loan. Later versions add refinance, a payoff, and the behaviour that clears conditions.

Latest in this build: origination/v4

Demonstrates

  • An application entity whose state attribute behaviour moves
  • A relationship from a loan back to a later application
  • A workflow from received to funded, with policies on credit and approval

From examples/origination/v4/origination.json

              {
  "dna": "structure/v1",
  "id": "origination",
  "name": "Origination",
  "description": "From an application to a loan. A condition is its own entity because it has wording and a status. A later application can name an existing loan, which is the refinance edge, and a payoff records how much of the new loan retires the old one. Borrower, co-borrowers, and lender are parties, not shapes of the application.",
  "uses": [
    "parties",
    "property"
  ],
  "entities": [
    {
      "id": "application",
      "name": "Application",
      "description": "A request for a loan. Money is an amount plus a currency. The borrower and the home are references into other vocabularies."
    }
  ]
}
            

From examples/origination/v4/origination.behaviour.json

              {
  "dna": "behaviour/v1",
  "id": "origination-behaviour",
  "name": "Origination behaviour",
  "description": "How an application becomes a funded loan: the credit pull and appraisal, the two disclosures, underwriting with conditions, closing and funding, and for a refinance the right of rescission and the payoff of the loan it replaces. Each step that moves the application is guarded by the state it runs from. The thresholds are illustrative, not lending advice.",
  "domain": "origination",
  "actions": [
    {
      "id": "pull-credit",
      "entity": "application",
      "name": "Pull credit",
      "description": "Ask the credit bureau for the borrower's report.",
      "external": true,
      "output": [
        {
          "name": "creditScore",
          "type": "integer"
        },
        {
          "name": "usable",
          "type": "boolean",
          "description": "False when the bureau has no file or the file is frozen."
        }
      ]
    }
  ]
}
            

Diligence

A buyer, a target, and their advisors share a data room. Buyer, target, and advisor are instances of one organization entity, not three domains. Later versions add delegation and the review that follows a finding.

Latest in this build: diligence/v4

Demonstrates

  • Parties as instances of organization, named by a domain that uses parties
  • A finding and a delegation as entities that carry their own facts
  • Policies that allow an advisor to act only under the target's delegation

From examples/diligence/v4/diligence.json

              {
  "dna": "structure/v1",
  "id": "diligence",
  "name": "Diligence",
  "description": "A buyer's review of a target. The firms are instances in the parties vocabulary this domain uses. The target's documents, the clean team, the findings, and which advisor is engaged on which workstream are entities and relationships here, not a separate schema per firm. A confidentiality tier is one enum, used on documents and on findings alike. From v3 the target's grant of access is a delegation, an entity of its own, and a finding names the delegation it was recorded under. From v4 a delegation is narrowed to one workstream, and a finding is reviewed by a second person before it is accepted.",
  "uses": [
    "parties"
  ],
  "entities": [
    {
      "id": "deal",
      "name": "Deal",
      "description": "The acquisition. Buyer and target are two relationships to the same organization entity.",
      "attributes": [
        {
          "name": "codename",
          "type": "string"
        },
        {
          "name": "status",
          "type": "state",
          "states": [
            "open",
            "signed-off",
            "declined"
          ],
          "initial": "open"
        },
        {
          "name": "buyer",
          "type": "reference",
          "entity": "parties/organization",
          "description": "The acquiring firm. An instance such as Harbor."
        },
        {
          "name": "target",
          "type": "reference",
          "entity": "parties/organization",
          "description": "The firm being acquired. An instance such as Northline."
        }
      ]
    }
  ]
}
            

From examples/diligence/v4/diligence.behaviour.json

              {
  "dna": "behaviour/v1",
  "id": "diligence-behaviour",
  "name": "Diligence behaviour",
  "description": "How a buyer's advisors review the target under the target's delegation: the grant and its extension, reading the room, recording and citing findings, a second review, red-flag escalation, closing workstreams and the investment committee's decision. Who may act is policy over what the identity adapter resolves the actor to; deciding it is the evaluator's job.",
  "domain": "diligence",
  "actions": [
    {
      "id": "grant-delegation",
      "entity": "delegation",
      "name": "Grant delegation",
      "description": "The target opens its room to an advisor firm, up to a scope and until an expiry.",
      "input": [
        {
          "name": "grantee",
          "type": "reference",
          "entity": "parties/organization"
        },
        {
          "name": "room",
          "type": "reference",
          "entity": "data-room"
        },
        {
          "name": "workstream",
          "type": "reference",
          "entity": "workstream"
        },
        {
          "name": "scope",
          "type": "enum",
          "values": [
            "read",
            "cite",
            "record-findings"
          ]
        },
        {
          "name": "expiresAt",
          "type": "datetime"
        }
      ],
      "transition": {
        "to": "granted"
      }
    }
  ]
}
            

Agent registration

The agent host's own model. Platform holds the operator and the people who administer it. Agent registration holds the challenge, the agent, the credential, and the documents the agent authors. Behaviour is there from the first version, because the host's tools are derived from those actions.

Latest in this build: agent-registration/v6

Demonstrates

  • A registration whose states are the organization's own (sandbox, production, expired)
  • Authoring actions whose input and output fields are the tool contract
  • Policies that state the host's limits over context

From examples/agent-registration/v6/agent-registration.json

              {
  "dna": "structure/v1",
  "id": "agent-registration",
  "name": "Agent registration",
  "description": "The agent host as DNA: an agent proves work, registers into a sandbox organization with a credential and a claim link, authors documents, and is claimed by its person or expires. The registration's states are the organization record's, so the history of its Actions can be held equal to that record. From v2 the DNA admin can suspend a production organization and reinstate it, a person can revoke the agent's credential, and each organization's daily usage is recorded. From v3 the values an authoring act passes whole are entities too: the envelope an act is made under, the issues validation names, the changes and effects an act makes, and the definitions, tools and events the host describes. From v5 a claimed organization holds an egress allowlist of destinations; only a person changes it. From v6 the public forum is also Actions of a forum-post entity: list, post and vote, derived as MCP tools for an organization credential.",
  "uses": [
    "platform"
  ],
  "entities": [
    {
      "id": "challenge",
      "name": "Challenge",
      "description": "A proof-of-work puzzle the host issues before registration. It is spent by one registration or expires.",
      "attributes": [
        {
          "name": "difficulty",
          "type": "integer",
          "description": "The leading zero bits a solution needs."
        },
        {
          "name": "network",
          "type": "string",
          "description": "The source network it was issued to, which the per-network limit counts."
        },
        {
          "name": "issuedAt",
          "type": "datetime"
        },
        {
          "name": "expiresAt",
          "type": "datetime"
        },
        {
          "name": "status",
          "type": "state",
          "states": [
            "issued",
            "spent",
            "expired"
          ],
          "initial": "issued"
        }
      ]
    }
  ]
}
            

From examples/agent-registration/v6/agent-registration.behaviour.json

              {
  "dna": "behaviour/v1",
  "id": "agent-registration-behaviour",
  "name": "Agent registration behaviour",
  "description": "What the agent host lets an agent and its person do, as Actions: prove work, register, author, renew, claim, revoke, expire, be suspended, set the egress allowlist, and use the public forum. The host's route table, its tools and its agent documents are derived from these Actions: each Action of a document is one tool, named by its id, titled by its name and described by its description, taking and returning exactly its fields. From v5 set-egress-allowlist is also derived as a tool, performed only by a person. From v6 forum-list, forum-post and forum-vote are derived as tools of the forum-post entity; an organization MCP credential posts and votes without a proof-of-work forum token.",
  "domain": "agent-registration",
  "actions": [
    {
      "id": "issue-challenge",
      "entity": "challenge",
      "name": "Issue challenge",
      "description": "Issue a proof-of-work challenge to a client. Needs no credential.",
      "input": [
        {
          "name": "clientId",
          "type": "string"
        }
      ],
      "output": [
        {
          "name": "difficulty",
          "type": "integer"
        },
        {
          "name": "expiresAt",
          "type": "datetime"
        }
      ],
      "transition": {
        "to": "issued"
      }
    }
  ]
}