{
  "name": "design",
  "version": "1.0.0",
  "description": "How the system is built, with no technology chosen: components, datastores, queues, interfaces, externals and the environments they run in. Enrichment packs (API detail, hosting, containers and the rest) attach to these nodes with details.",
  "license": "Apache-2.0",
  "publisher": "trumly",
  "namespace": "dsn",
  "tier": "verified",
  "role": "core",
  "useWhen": "When you are deciding how the system is put together: its parts, where data lives and what it talks to.",
  "enriches": [],
  "requires": [
    "links@^1.0.0",
    "define@^1.0.0"
  ],
  "optional": [],
  "includes": [],
  "sha256": "adf2faf6f2e63cc3b38d8a6b7d9126d6da347845cefbc250eb13376df92d6334",
  "files": [
    [
      "dsn--design",
      "---\nid: dsn--design\ntype: plane\ntitle: Design\nfields:\n  order: 2\n  stack: Design\n  stack_at:\n  - 3\n  - 0\n  shapes:\n    component: square\n    datastore: database\n    environment: folder\n    external: cloud\n    interface: hexagon\n    queue: pipe\n  pack: design@1.0.0\n---\nThe parts of the system, what it depends on, where its data lives, how the parts talk, and the named places it runs. Technology-neutral: vendor, cloud and product detail goes in an enrichment stack.\n"
    ],
    [
      "dsn--link-type-consumes",
      "---\nid: dsn--link-type-consumes\ntype: link-type\ntitle: consumes\nfields:\n  name: consumes\n  description: Use to say that something relies on an interface, queue, external service or piece of configuration\n    to do its job.\n  inverse: consumed by\n  from: []\n  to: []\n  pack: design@1.0.0\n---\n"
    ],
    [
      "dsn--link-type-publishes",
      "---\nid: dsn--link-type-publishes\ntype: link-type\ntitle: publishes\nfields:\n  name: publishes\n  description: Use to say which component puts messages on a queue.\n  inverse: published to by\n  from:\n  - component\n  to:\n  - queue\n  pack: design@1.0.0\n---\n"
    ],
    [
      "dsn--link-type-reads",
      "---\nid: dsn--link-type-reads\ntype: link-type\ntitle: reads\nfields:\n  name: reads\n  description: Use to say which component reads data from a datastore.\n  inverse: read by\n  from:\n  - component\n  to:\n  - datastore\n  pack: design@1.0.0\n---\n"
    ],
    [
      "dsn--link-type-subscribes",
      "---\nid: dsn--link-type-subscribes\ntype: link-type\ntitle: subscribes\nfields:\n  name: subscribes\n  description: Use to say which component takes messages from a queue.\n  inverse: subscribed to by\n  from:\n  - component\n  to:\n  - queue\n  pack: design@1.0.0\n---\n"
    ],
    [
      "dsn--link-type-uses",
      "---\nid: dsn--link-type-uses\ntype: link-type\ntitle: uses\nfields:\n  name: uses\n  description: 'Use to say who or what calls on a component or interface: a person in a role, or an outside\n    system.'\n  inverse: used by\n  from:\n  - actor\n  - external\n  to:\n  - component\n  - interface\n  pack: design@1.0.0\n---\n"
    ],
    [
      "dsn--link-type-writes",
      "---\nid: dsn--link-type-writes\ntype: link-type\ntitle: writes\nfields:\n  name: writes\n  description: Use to say which component changes data in a datastore.\n  inverse: written by\n  from:\n  - component\n  to:\n  - datastore\n  pack: design@1.0.0\n---\n"
    ],
    [
      "dsn--pack",
      "---\nid: dsn--pack\ntype: pack\ntitle: Design\nfields:\n  name: design\n  namespace: dsn\n  version: 1.0.0\n  description: 'How the system is built, with no technology chosen: components, datastores, queues, interfaces,\n    externals and the environments they run in. Enrichment packs (API detail, hosting, containers and\n    the rest) attach to these nodes with details.'\n  license: Apache-2.0\n  publisher: trumly\n  role: core\n  use-when: 'When you are deciding how the system is put together: its parts, where data lives and what\n    it talks to.'\n  requires:\n  - links@^1.0.0\n  - define@^1.0.0\n---\n"
    ],
    [
      "dsn--rule-component-owner",
      "---\nid: dsn--rule-component-owner\ntype: rule\ntitle: Components have an owner\nfields:\n  name: Components have an owner\n  statement: Every component has an owner\n  severity: error\n  applies_to:\n    type: component\n  check:\n    require_fields:\n    - owner\n  pack: design@1.0.0\n---\n**Why:** someone has to answer for it when it breaks or needs to change.\n\n**Fix:** set owner.\n"
    ],
    [
      "dsn--rule-component-runs",
      "---\nid: dsn--rule-component-runs\ntype: rule\ntitle: Components run somewhere\nfields:\n  name: Components run somewhere\n  statement: Every component runs in an environment\n  severity: warn\n  applies_to:\n    type: component\n  check:\n    require_link:\n      min: 1\n      node_type: environment\n      type: runs-in\n  pack: design@1.0.0\n---\n**Why:** a part that runs nowhere cannot be built or tested. Libraries and functions are the exception; they are shipped inside another component, so turn this off or ignore it for them.\n\n**Fix:** add a `runs-in` link to an environment.\n"
    ],
    [
      "dsn--rule-component-satisfies",
      "---\nid: dsn--rule-component-satisfies\ntype: rule\ntitle: Components serve a need\nfields:\n  name: Components serve a need\n  statement: Every component satisfies at least one requirement\n  severity: warn\n  applies_to:\n    type: component\n  check:\n    require_link:\n      min: 1\n      node_type: requirement\n      type: satisfies\n  pack: design@1.0.0\n---\n**Why:** a part that satisfies no requirement is either missing its requirement or not needed.\n\n**Fix:** add a `satisfies` link to a requirement, or write the missing requirement.\n"
    ],
    [
      "dsn--rule-datastore-owner",
      "---\nid: dsn--rule-datastore-owner\ntype: rule\ntitle: Data stores have an owner\nfields:\n  name: Data stores have an owner\n  statement: Every datastore has an owner\n  severity: error\n  applies_to:\n    type: datastore\n  check:\n    require_fields:\n    - owner\n  pack: design@1.0.0\n---\n**Why:** data without an owner has nobody deciding retention, backup and access.\n\n**Fix:** set owner.\n"
    ],
    [
      "dsn--rule-datastore-written",
      "---\nid: dsn--rule-datastore-written\ntype: rule\ntitle: Data stores are written to\nfields:\n  name: Data stores are written to\n  statement: Every datastore is written by a component\n  severity: warn\n  applies_to:\n    type: datastore\n  check:\n    require_link:\n      dir: in\n      min: 1\n      node_type: component\n      type: writes\n  pack: design@1.0.0\n---\n**Why:** a store nothing writes to is either unused or has an undrawn writer.\n\n**Fix:** add a `writes` link from the component that fills it.\n"
    ],
    [
      "dsn--rule-depends-on-acyclic",
      "---\nid: dsn--rule-depends-on-acyclic\ntype: rule\ntitle: No circular dependencies\nfields:\n  name: No circular dependencies\n  statement: Dependencies do not form a loop\n  severity: error\n  applies_to:\n    type: component\n  check:\n    acyclic: depends-on\n  pack: design@1.0.0\n---\n**Why:** if A needs B and B needs A, neither can start first.\n\n**Fix:** break the loop, usually by introducing a queue or moving shared logic into a third component.\n"
    ],
    [
      "dsn--rule-environment-used",
      "---\nid: dsn--rule-environment-used\ntype: rule\ntitle: Environments host something\nfields:\n  name: Environments host something\n  statement: Every environment hosts something\n  severity: warn\n  applies_to:\n    type: environment\n  check:\n    require_link:\n      dir: in\n      min: 1\n      type: runs-in\n  pack: design@1.0.0\n---\n**Why:** an environment nothing runs in is an unused place.\n\n**Fix:** add `runs-in` from the components, datastores or queues that run there.\n"
    ],
    [
      "dsn--rule-external-owner",
      "---\nid: dsn--rule-external-owner\ntype: rule\ntitle: Externals have an owner\nfields:\n  name: Externals have an owner\n  statement: Every external names who owns it\n  severity: error\n  applies_to:\n    type: external\n  check:\n    require_fields:\n    - owner\n  pack: design@1.0.0\n---\n**Why:** when it fails you need someone to ask.\n\n**Fix:** set owner.\n"
    ],
    [
      "dsn--rule-interface-exposed",
      "---\nid: dsn--rule-interface-exposed\ntype: rule\ntitle: Interfaces have a provider\nfields:\n  name: Interfaces have a provider\n  statement: Every interface is exposed by a component\n  severity: error\n  applies_to:\n    type: interface\n  check:\n    require_link:\n      dir: in\n      min: 1\n      node_type: component\n      type: exposes\n  pack: design@1.0.0\n---\n**Why:** an interface nobody offers cannot be called.\n\n**Fix:** add an `exposes` link from the component that offers it.\n"
    ],
    [
      "dsn--rule-interface-protocol",
      "---\nid: dsn--rule-interface-protocol\ntype: rule\ntitle: Interfaces name a protocol\nfields:\n  name: Interfaces name a protocol\n  statement: Every interface names its protocol\n  severity: error\n  applies_to:\n    type: interface\n  check:\n    require_fields:\n    - protocol\n  pack: design@1.0.0\n---\n**Why:** the protocol family decides what can talk to it.\n\n**Fix:** set protocol.\n"
    ],
    [
      "dsn--rule-must-requirement-satisfied",
      "---\nid: dsn--rule-must-requirement-satisfied\ntype: rule\ntitle: Musts are designed for\nfields:\n  name: Musts are designed for\n  statement: Every accepted must-have requirement is satisfied by a design node\n  severity: warn\n  applies_to:\n    priority: must\n    status: accepted\n    type: requirement\n  check:\n    require_link:\n      dir: in\n      min: 1\n      type: satisfies\n  pack: design@1.0.0\n---\n**Why:** an accepted must-have that nothing in the design satisfies is a promise nobody is keeping.\n\n**Fix:** add a `satisfies` link from the component, interface or datastore that delivers it.\n"
    ],
    [
      "dsn--rule-queue-ends",
      "---\nid: dsn--rule-queue-ends\ntype: rule\ntitle: Queues have both ends\nfields:\n  name: Queues have both ends\n  statement: Every queue has a publisher and a subscriber\n  severity: warn\n  applies_to:\n    type: queue\n  check:\n    require_link:\n    - dir: in\n      node_type: component\n      type: publishes\n    - dir: in\n      node_type: component\n      type: subscribes\n  pack: design@1.0.0\n---\n**Why:** a queue nobody writes to never delivers; one nobody reads from fills up.\n\n**Fix:** add `publishes` from the sending component and `subscribes` from the receiving one.\n"
    ],
    [
      "dsn--rule-service-in-use",
      "---\nid: dsn--rule-service-in-use\ntype: rule\ntitle: Services are in use\nfields:\n  name: Services are in use\n  statement: Every service is used, depended on or exposes something\n  severity: warn\n  applies_to:\n    kind: service\n    type: component\n  check:\n    any_of:\n    - require_link:\n        type: exposes\n    - require_link:\n        dir: in\n        type: uses\n    - require_link:\n        dir: in\n        type: depends-on\n    - require_link:\n        dir: in\n        type: consumes\n  pack: design@1.0.0\n---\nA service nothing calls and that offers nothing may be dead.\n\n**Fix:** link it with `exposes`, `uses`, `depends-on` or `consumes`, or remove it.\n"
    ],
    [
      "dsn--type-component",
      "---\nid: dsn--type-component\ntype: type\ntitle: component\nfields:\n  name: component\n  plane: dsn--design\n  description: 'Use for a part of the system that does work and that someone owns: a service, an app,\n    a scheduled job, a library or a function. Every component should satisfy a requirement.'\n  shape: square\n  fields:\n  - name: kind\n    kind: choice\n    required: true\n    values:\n    - service\n    - app\n    - job\n    - library\n    - function\n  - name: owner\n    kind: text\n    required: true\n  - name: status\n    kind: choice\n    required: true\n    values:\n    - proposed\n    - planned\n    - built\n  - name: body\n    kind: text\n    label: Description\n    required: true\n  pack: design@1.0.0\n---\n**Ask:** What are the separate parts that do the work? Who looks after each one?\n\nSplit by what changes together and who owns it, not by technology. Use `parent` to nest a part inside a bigger one when you need more detail. A component is not a Docker container: that is an `image` run as a `container`. Keep the title to a short label and say the rest in the description.\n\n**Watch:** a component with no owner, no requirement it satisfies, or nowhere it runs.\n"
    ],
    [
      "dsn--type-datastore",
      "---\nid: dsn--type-datastore\ntype: type\ntitle: datastore\nfields:\n  name: datastore\n  plane: dsn--design\n  description: 'Use for somewhere data lives between runs: a database, a cache, an object store, a search\n    index or a file area.'\n  shape: database\n  fields:\n  - name: kind\n    kind: choice\n    required: true\n    values:\n    - relational\n    - document\n    - key-value\n    - object\n    - search\n    - cache\n    - file\n  - name: owner\n    kind: text\n    required: true\n  - name: body\n    kind: text\n    label: Description\n    required: true\n  pack: design@1.0.0\n---\n**Ask:** Where does data live between runs? Who owns it? What would hurt to lose?\n\nOne datastore per thing with its own owner and lifecycle. The tables and fields inside it go in the data model enrichment stack.\n\n**Watch:** a datastore nothing writes to, or that two teams both think they own.\n"
    ],
    [
      "dsn--type-environment",
      "---\nid: dsn--type-environment\ntype: type\ntitle: environment\nfields:\n  name: environment\n  plane: dsn--design\n  description: Use for a named place the system runs, such as production, staging or a developer's machine.\n  shape: folder\n  fields:\n  - name: kind\n    kind: choice\n    required: true\n    values:\n    - production\n    - staging\n    - development\n    - test\n  - name: body\n    kind: text\n    label: Description\n    required: true\n  pack: design@1.0.0\n---\n**Ask:** Where does it run? Production, a test copy, a developer's machine?\n\nAn environment is a named place, not a technology. Which cloud, cluster or laptop realises it is described in a hosting enrichment stack.\n\n**Watch:** a component that runs nowhere.\n"
    ],
    [
      "dsn--type-external",
      "---\nid: dsn--type-external\ntype: type\ntitle: external\nfields:\n  name: external\n  plane: dsn--design\n  description: Use for a system or service outside this design that it depends on or that depends on it,\n    such as a payment provider or the company's sign-in service.\n  shape: cloud\n  fields:\n  - name: owner\n    kind: text\n    required: true\n  - name: body\n    kind: text\n    label: Description\n    required: true\n  pack: design@1.0.0\n---\n**Ask:** What do we rely on that we do not build or run? Who owns it?\n\nName an owner so there is someone to ask when it fails. An outside system that calls us is also an external, linked with `uses`.\n\n**Watch:** an external with no owner or no plan for when it is down.\n"
    ],
    [
      "dsn--type-interface",
      "---\nid: dsn--type-interface\ntype: type\ntitle: interface\nfields:\n  name: interface\n  plane: dsn--design\n  description: 'Use for a boundary other things talk to: an API, an event feed, a file format or a command\n    line.'\n  shape: hexagon\n  fields:\n  - name: protocol\n    kind: choice\n    required: true\n    values:\n    - http\n    - grpc\n    - graphql\n    - event\n    - file\n    - cli\n    - other\n  - name: body\n    kind: text\n    label: Description\n    required: true\n  pack: design@1.0.0\n---\n**Ask:** What do other things talk to? Who calls it, and in what style?\n\nThis is only the boundary: its name, who offers it and the protocol family. Endpoints, payloads and auth go in the API enrichment stack, linked with `details`.\n\n**Watch:** an interface nobody exposes, or two components talking with no interface between them.\n"
    ],
    [
      "dsn--type-queue",
      "---\nid: dsn--type-queue\ntype: type\ntitle: queue\nfields:\n  name: queue\n  plane: dsn--design\n  description: 'Use for a buffer or stream that carries messages between components without the sender\n    waiting: a queue, a topic or an event stream.'\n  shape: pipe\n  fields:\n  - name: kind\n    kind: choice\n    required: true\n    values:\n    - queue\n    - topic\n    - stream\n  - name: delivery\n    kind: choice\n    required: true\n    values:\n    - at-least-once\n    - at-most-once\n    - exactly-once\n  - name: body\n    kind: text\n    label: Description\n    required: true\n  pack: design@1.0.0\n---\n**Ask:** What needs to be handed from one part to another without waiting for an answer?\n\nA queue sits between a publisher and a subscriber. Say how delivery behaves, because it decides whether consumers must cope with duplicates.\n\n**Watch:** a queue with no publisher or no subscriber.\n"
    ],
    [
      "examples/ops-api-design/acceptance-criterion-status-shown",
      "---\nid: acceptance-criterion-status-shown\ntype: acceptance-criterion\ntitle: Status shown\nplane: def--requirements\nfields:\n  given: A job has just changed state\n  when: Operations staff open the job list\n  then: The new state is shown within 60 seconds\n  method: test\n---\n"
    ],
    [
      "examples/ops-api-design/actor-ops-staff",
      "---\nid: actor-ops-staff\ntype: actor\ntitle: Operations staff\nplane: def--capabilities\nlinks:\n- type: uses\n  to: component-ops-api\n---\n"
    ],
    [
      "examples/ops-api-design/assumption-job-volume",
      "---\nid: assumption-job-volume\ntype: assumption\ntitle: Job volume stays modest\nplane: def--intent\nfields:\n  statement: No more than 5,000 jobs run each night.\n  how-to-check: Count the nightly jobs for a month\n  owner: Platform team\n  state: open\n---\n"
    ],
    [
      "examples/ops-api-design/capability-view-job-status",
      "---\nid: capability-view-job-status\ntype: capability\ntitle: View job status\nplane: def--capabilities\nfields:\n  statement: view the current status of every job\n  scope: in\n  priority: must\n  status: proposed\nlinks:\n- type: derives-from\n  to: goal-timely-visibility\n- type: performed-by\n  to: actor-ops-staff\n- type: refers-to\n  to: concept-job\n- type: relies-on\n  to: assumption-job-volume\n---\n"
    ],
    [
      "examples/ops-api-design/component-ops-api",
      "---\nid: component-ops-api\ntype: component\ntitle: Ops API service\nplane: dsn--design\nfields:\n  kind: service\n  owner: Platform team\n  status: planned\nlinks:\n- type: exposes\n  to: interface-ops-api\n- type: writes\n  to: datastore-ops-db\n- type: publishes\n  to: queue-job-events\n- type: runs-in\n  to: environment-production\n- type: satisfies\n  to: requirement-status-freshness\n---\nServes job status to operations staff and records state changes.\n"
    ],
    [
      "examples/ops-api-design/component-ops-report",
      "---\nid: component-ops-report\ntype: component\ntitle: Nightly report job\nplane: dsn--design\nfields:\n  kind: job\n  owner: Platform team\n  status: planned\nlinks:\n- type: subscribes\n  to: queue-job-events\n- type: reads\n  to: datastore-ops-db\n- type: runs-in\n  to: environment-production\n- type: satisfies\n  to: requirement-status-freshness\n---\nBuilds the overnight summary from the recorded events.\n"
    ],
    [
      "examples/ops-api-design/concept-job",
      "---\nid: concept-job\ntype: concept\ntitle: Job\nplane: def--capabilities\nfields:\n  definition: A scheduled piece of work run for a customer.\n---\n"
    ],
    [
      "examples/ops-api-design/constraint-uk-eu-data",
      "---\nid: constraint-uk-eu-data\ntype: constraint\ntitle: Data stays in UK/EU\nplane: def--intent\nfields:\n  statement: Customer data stays in the UK or the EU.\n  kind: legal\n  source: Customer contracts\n  status: proposed\nlinks:\n- type: governs\n  to: capability-view-job-status\n---\n"
    ],
    [
      "examples/ops-api-design/datastore-ops-db",
      "---\nid: datastore-ops-db\ntype: datastore\ntitle: Operations database\nplane: dsn--design\nfields:\n  kind: relational\n  owner: Platform team\n---\nHolds every job and its latest status.\n"
    ],
    [
      "examples/ops-api-design/environment-production",
      "---\nid: environment-production\ntype: environment\ntitle: Production\nplane: dsn--design\nfields:\n  kind: production\n---\nThe live system that operations staff use.\n"
    ],
    [
      "examples/ops-api-design/example",
      "---\nid: example\ntype: example\ntitle: The ops API as components\nfields:\n  title: The ops API as components\n  description: Two components, the database they share, a queue between them, the interface and where\n    they run, each satisfying a requirement.\n  use: starter\n  requires:\n  - design\n  - define\n---\n"
    ],
    [
      "examples/ops-api-design/goal-timely-visibility",
      "---\nid: goal-timely-visibility\ntype: goal\ntitle: Timely visibility\nplane: def--intent\nfields:\n  statement: Operations staff see the state of every job within a minute.\n  status: proposed\nlinks:\n- type: measured-by\n  to: metric-status-freshness\n---\n"
    ],
    [
      "examples/ops-api-design/interface-ops-api",
      "---\nid: interface-ops-api\ntype: interface\ntitle: Ops API\nplane: dsn--design\nfields:\n  protocol: http\n---\nThe boundary operations tools call to read job status.\n"
    ],
    [
      "examples/ops-api-design/metric-status-freshness",
      "---\nid: metric-status-freshness\ntype: metric\ntitle: Job status age\nplane: def--intent\nfields:\n  kind: success\n  unit: seconds\n  direction: lower-is-better\n  target: 60\n  how-measured: Age of the newest status for each job, sampled every minute\n---\n"
    ],
    [
      "examples/ops-api-design/question-report-recipients",
      "---\nid: question-report-recipients\ntype: question\ntitle: Report recipients\nplane: def--intent\nfields:\n  state: open\n  raised-by: agent\nlinks:\n- type: about\n  to: capability-view-job-status\n---\nWho should receive the nightly report, and should it also be emailed?\n"
    ],
    [
      "examples/ops-api-design/queue-job-events",
      "---\nid: queue-job-events\ntype: queue\ntitle: Job events\nplane: dsn--design\nfields:\n  kind: queue\n  delivery: at-least-once\n---\nAnnounces each job state change so other parts can react.\n"
    ],
    [
      "examples/ops-api-design/requirement-status-freshness",
      "---\nid: requirement-status-freshness\ntype: requirement\ntitle: Status is fresh\nplane: def--requirements\nfields:\n  statement: The system shall show each job status no more than 60 seconds old.\n  kind: functional\n  priority: must\n  status: accepted\n  accepted-by: Mat\n  accepted-on: '2026-11-03'\nlinks:\n- type: derives-from\n  to: capability-view-job-status\n- type: verified-by\n  to: acceptance-criterion-status-shown\n---\n"
    ]
  ]
}
