{
  "name": "runtime",
  "version": "0.3.0",
  "description": "How the system behaves under load and failure: service level objectives, the capacity it is sized for and how it can fail. Rules are errors: a service with an objective needs a way to know it is missed, and every failure mode needs a mitigation.",
  "license": "Apache-2.0",
  "publisher": "trumly",
  "namespace": "sdr",
  "tier": "verified",
  "role": "enrichment",
  "useWhen": "When you need to say how well the system must behave: its objectives, the load it is sized for and how it can fail.",
  "enriches": [
    "component"
  ],
  "requires": [
    "core@^1.0.0"
  ],
  "optional": [
    "hosting@^0.2.0",
    "resilience@^0.3.0"
  ],
  "includes": [],
  "sha256": "0ebf1aa0fcd2ea26b207e5b96c189bed8f1f6ea4e6122f4a23cbe863e6c41253",
  "files": [
    [
      "sdr--behaviour",
      "---\nid: sdr--behaviour\ntype: plane\ntitle: Behaviour\nfields:\n  order: 1\n  pack: runtime@0.3.0\n  stack: Runtime\n---\n\nWhat we promise, what we sized for and how it breaks.\n"
    ],
    [
      "sdr--link-type-fails-by",
      "---\nid: sdr--link-type-fails-by\ntype: link-type\ntitle: fails-by\nfields:\n  name: fails-by\n  description: The component can fail this way.\n  inverse: failure of\n  from:\n  - component\n  to:\n  - failure-mode\n  pack: runtime@0.3.0\n---\n"
    ],
    [
      "sdr--link-type-guarantees",
      "---\nid: sdr--link-type-guarantees\ntype: link-type\ntitle: guarantees\nfields:\n  name: guarantees\n  description: The component promises this objective.\n  inverse: guaranteed by\n  from:\n  - component\n  to:\n  - slo\n  pack: runtime@0.3.0\n---\n"
    ],
    [
      "sdr--link-type-mitigated-by",
      "---\nid: sdr--link-type-mitigated-by\ntype: link-type\ntitle: mitigated-by\nfields:\n  name: mitigated-by\n  description: This failure is handled by.\n  inverse: mitigates\n  from:\n  - failure-mode\n  to:\n  - component\n  - queue\n  - datastore\n  pack: runtime@0.3.0\n---\n"
    ],
    [
      "sdr--link-type-sized-for",
      "---\nid: sdr--link-type-sized-for\ntype: link-type\ntitle: sized-for\nfields:\n  name: sized-for\n  description: The component is sized for this load.\n  inverse: sizes\n  from:\n  - component\n  to:\n  - capacity\n  pack: runtime@0.3.0\n---\n"
    ],
    [
      "sdr--pack",
      "---\nid: sdr--pack\ntype: pack\ntitle: Runtime\nfields:\n  name: runtime\n  namespace: sdr\n  version: 0.3.0\n  description: 'How the system behaves under load and failure: service level objectives, the capacity it is sized for and how it can fail. Rules are errors: a service with an objective needs\n    a way to know it is missed, and every failure mode needs a mitigation.'\n  license: Apache-2.0\n  publisher: trumly\n  role: enrichment\n  enriches:\n  - component\n  use-when: 'When you need to say how well the system must behave: its objectives, the load it is sized\n    for and how it can fail.'\n  requires:\n  - core@^1.0.0\n  optional:\n  - hosting@^0.2.0\n  - resilience@^0.3.0\n---\n"
    ],
    [
      "sdr--rule-capacity-sizes-component",
      "---\nid: sdr--rule-capacity-sizes-component\ntype: rule\ntitle: Capacity belongs to component\nfields:\n  name: Capacity belongs to component\n  statement: Every capacity plan is for a component\n  severity: warn\n  applies_to:\n    type: capacity\n  check:\n    any_of:\n    - require_link:\n        min: 1\n        type: sized-for\n        dir: in\n        node_type: component\n  pack: runtime@0.3.0\n---\n**Why:** a capacity plan nothing points at sizes nothing.\n\n**Fix:** link the component to it with `sized-for`.\n"
    ],
    [
      "sdr--rule-failure-attached",
      "---\nid: sdr--rule-failure-attached\ntype: rule\ntitle: Failures belong to a component\nfields:\n  name: Failures belong to a component\n  statement: Every failure mode belongs to a component\n  severity: error\n  applies_to:\n    type: failure-mode\n  check:\n    require_link:\n      type: fails-by\n      dir: in\n      node_type: component\n  pack: runtime@0.3.0\n---\n"
    ],
    [
      "sdr--rule-failure-mitigated",
      "---\nid: sdr--rule-failure-mitigated\ntype: rule\ntitle: Failures have a mitigation\nfields:\n  name: Failures have a mitigation\n  statement: Every failure mode has a mitigation\n  severity: error\n  applies_to:\n    type: failure-mode\n    impact: outage\n  check:\n    require_link:\n      type: mitigated-by\n  pack: runtime@0.3.0\n---\n"
    ],
    [
      "sdr--rule-service-capacity",
      "---\nid: sdr--rule-service-capacity\ntype: rule\ntitle: Services state their size\nfields:\n  name: Services state their size\n  statement: Every service says what it is sized for\n  severity: warn\n  applies_to:\n    type: component\n    kind: service\n  check:\n    require_link:\n      type: sized-for\n      node_type: capacity\n  pack: runtime@0.3.0\n---\n"
    ],
    [
      "sdr--rule-service-slo",
      "---\nid: sdr--rule-service-slo\ntype: rule\ntitle: Services have an objective\nfields:\n  name: Services have an objective\n  statement: Every service has an objective\n  severity: warn\n  applies_to:\n    type: component\n    kind: service\n  check:\n    require_link:\n      type: guarantees\n      node_type: slo\n  pack: runtime@0.3.0\n---\n"
    ],
    [
      "sdr--rule-slo-alert",
      "---\nid: sdr--rule-slo-alert\ntype: rule\ntitle: Objectives name an alert\nfields:\n  name: Objectives name an alert\n  statement: Every objective names the alert that fires when it is missed\n  severity: error\n  applies_to:\n    type: slo\n  check:\n    require_fields:\n    - alert\n  pack: runtime@0.3.0\n---\n"
    ],
    [
      "sdr--rule-slo-fields",
      "---\nid: sdr--rule-slo-fields\ntype: rule\ntitle: Objectives have a target\nfields:\n  name: Objectives have a target\n  statement: Every objective states a target and a window\n  severity: error\n  applies_to:\n    type: slo\n  check:\n    require_fields:\n    - objective\n    - window\n  pack: runtime@0.3.0\n---\n"
    ],
    [
      "sdr--rule-slo-owned",
      "---\nid: sdr--rule-slo-owned\ntype: rule\ntitle: Objectives have a guarantor\nfields:\n  name: Objectives have a guarantor\n  statement: Every objective is guaranteed by a component\n  severity: error\n  applies_to:\n    type: slo\n  check:\n    require_link:\n      type: guarantees\n      dir: in\n      node_type: component\n  pack: runtime@0.3.0\n---\n"
    ],
    [
      "sdr--type-capacity",
      "---\nid: sdr--type-capacity\ntype: type\ntitle: capacity\nfields:\n  name: capacity\n  plane: sdr--behaviour\n  description: What load a component is sized for.\n  shape: triangle 2d\n  fields:\n  - name: assumption\n    kind: text\n    required: true\n  - name: headroom\n    kind: text\n  pack: runtime@0.3.0\n---\n"
    ],
    [
      "sdr--type-failure-mode",
      "---\nid: sdr--type-failure-mode\ntype: type\ntitle: failure-mode\nfields:\n  name: failure-mode\n  plane: sdr--behaviour\n  description: A way a component can fail.\n  shape: octagon 2d\n  fields:\n  - name: likelihood\n    kind: choice\n    values:\n    - rare\n    - possible\n    - likely\n  - name: impact\n    kind: choice\n    values:\n    - minor\n    - degraded\n    - outage\n  pack: runtime@0.3.0\n---\n"
    ],
    [
      "sdr--type-slo",
      "---\nid: sdr--type-slo\ntype: type\ntitle: SLO\nfields:\n  name: slo\n  plane: sdr--behaviour\n  description: A promise about how well a component performs.\n  shape: shield\n  fields:\n  - name: objective\n    kind: text\n    required: true\n  - name: window\n    kind: text\n    required: true\n  - name: alert\n    kind: text\n  pack: runtime@0.3.0\n---\n"
    ],
    [
      "examples/ops-api-behaviour/acceptance-criterion-jobs-listed",
      "---\nid: acceptance-criterion-jobs-listed\ntype: acceptance-criterion\ntitle: Jobs listed\nplane: def--requirements\nfields:\n  given: A job has just changed state\n  when: Ops staff open the job list\n  then: The job and its new state are shown within 60 seconds\n  method: test\n---\n"
    ],
    [
      "examples/ops-api-behaviour/actor-ops-staff",
      "---\nid: actor-ops-staff\ntype: actor\ntitle: Ops staff\nplane: def--capabilities\nlinks:\n- type: uses\n  to: component-ops-api\n---\n"
    ],
    [
      "examples/ops-api-behaviour/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\n  state: open\n---\n"
    ],
    [
      "examples/ops-api-behaviour/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: performed-by\n  to: actor-ops-staff\n- type: derives-from\n  to: goal-timely-visibility\n- type: refers-to\n  to: concept-job\n- type: relies-on\n  to: assumption-job-volume\n---\n"
    ],
    [
      "examples/ops-api-behaviour/capacity-ops",
      "---\nid: capacity-ops\ntype: capacity\ntitle: Nightly volume\nplane: sdr--behaviour\nfields:\n  assumption: 5,000 jobs a night\n  headroom: 5x\n---\n"
    ],
    [
      "examples/ops-api-behaviour/component-ops-api",
      "---\nid: component-ops-api\ntype: component\ntitle: Ops API\nplane: dsn--design\nfields:\n  kind: service\n  owner: Platform\n  status: planned\nlinks:\n- type: satisfies\n  to: requirement-list-jobs\n- type: writes\n  to: datastore-ops-db\n- type: runs-in\n  to: environment-production\n- type: exposes\n  to: interface-ops-api\n- type: guarantees\n  to: slo-status-availability\n- type: sized-for\n  to: capacity-ops\n- type: fails-by\n  to: fail-db-down\n---\n\nServes the list of jobs and their status to operations staff.\n"
    ],
    [
      "examples/ops-api-behaviour/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-behaviour/consequence-one-engine",
      "---\nid: consequence-one-engine\ntype: consequence\ntitle: Vertical scaling\nplane: gov--decisions\nfields:\n  effect: negative\n---\nThe database scales up before it scales out, so growth in jobs costs more.\n"
    ],
    [
      "examples/ops-api-behaviour/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-behaviour/convention-short-titles",
      "---\nid: convention-short-titles\ntype: convention\ntitle: Short titles\nplane: abt--about\nlinks:\n- type: describes\n  to: overview\n---\nKeep a title to a short label and put the long text in the description.\n"
    ],
    [
      "examples/ops-api-behaviour/datastore-ops-db",
      "---\nid: datastore-ops-db\ntype: datastore\ntitle: Ops db\nplane: dsn--design\nfields:\n  kind: relational\n  owner: Platform\n---\n\nHolds every job and its latest status.\n"
    ],
    [
      "examples/ops-api-behaviour/decision-option-document-store",
      "---\nid: decision-option-document-store\ntype: decision-option\ntitle: Managed document store\nplane: gov--decisions\nfields:\n  chosen: false\n  summary: Documents, managed\n---\nScales out easily but the job list would need joins in code.\n"
    ],
    [
      "examples/ops-api-behaviour/decision-option-managed-postgres",
      "---\nid: decision-option-managed-postgres\ntype: decision-option\ntitle: Managed PostgreSQL\nplane: gov--decisions\nfields:\n  chosen: true\n  summary: Relational, managed\n---\nJoins and constraints come for free; scaling is mostly vertical.\n"
    ],
    [
      "examples/ops-api-behaviour/decision-use-postgres",
      "---\nid: decision-use-postgres\ntype: decision\ntitle: Database choice\nplane: gov--decisions\nfields:\n  status: accepted\n  accepted-by: Mat\n  accepted-on: '2026-11-03'\n  review-by: '2027-05-01'\nlinks:\n- type: considers\n  to: decision-option-managed-postgres\n- type: considers\n  to: decision-option-document-store\n- type: has-consequence\n  to: consequence-one-engine\n- type: governs\n  to: datastore-ops-db\n- type: derives-from\n  to: requirement-list-jobs\n- type: complies-with\n  to: principle-prefer-managed\n- type: relies-on\n  to: assumption-job-volume\n---\nUse a managed relational database. Job data is highly structured and listing jobs needs joins.\n"
    ],
    [
      "examples/ops-api-behaviour/environment-production",
      "---\nid: environment-production\ntype: environment\ntitle: Production\nplane: dsn--design\nfields:\n  kind: production\n---\n\nThe live system that operations staff use.\n"
    ],
    [
      "examples/ops-api-behaviour/example",
      "---\nid: example\ntype: example\ntitle: How the ops API must behave\nfields:\n  title: How the ops API must behave\n  description: An objective with the alert that fires when it is missed, the load the service is sized\n    for, and one way it can fail and what handles it.\n  use: starter\n  requires:\n  - runtime\n  - core\n---\n"
    ],
    [
      "examples/ops-api-behaviour/fail-db-down",
      "---\nid: fail-db-down\ntype: failure-mode\ntitle: Database down\nplane: sdr--behaviour\nfields:\n  likelihood: rare\n  impact: outage\nlinks:\n- type: mitigated-by\n  to: component-ops-api\n---\nWhen the database does not answer, the API returns a clear error instead of hanging, so staff see the fault at once.\n"
    ],
    [
      "examples/ops-api-behaviour/goal-timely-visibility",
      "---\nid: goal-timely-visibility\ntype: goal\ntitle: Timely ops 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-behaviour/increment-live-status",
      "---\nid: increment-live-status\ntype: increment\ntitle: Live job status\nplane: pln--plan\nfields:\n  status: planned\nlinks:\n- type: enables\n  to: capability-view-job-status\n---\n\nThe first slice: staff can see live job status.\n"
    ],
    [
      "examples/ops-api-behaviour/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-behaviour/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-behaviour/overview",
      "---\nid: overview\ntype: overview\ntitle: Ops API\nplane: abt--about\nfields:\n  purpose: A status API so operations staff can see what every job is doing.\n  audience: The build team and operations staff\n  owner: Platform\n  stage: design\nlinks:\n- type: starts-at\n  to: goal-timely-visibility\n---\n"
    ],
    [
      "examples/ops-api-behaviour/principle-prefer-managed",
      "---\nid: principle-prefer-managed\ntype: principle\ntitle: Prefer managed services\nplane: gov--decisions\nfields:\n  statement: Prefer managed services over running our own.\n  status: accepted\n  accepted-by: Mat\n  accepted-on: '2026-11-03'\n---\nWe would rather pay for a managed service than operate one ourselves.\n"
    ],
    [
      "examples/ops-api-behaviour/requirement-list-jobs",
      "---\nid: requirement-list-jobs\ntype: requirement\ntitle: List jobs\nplane: def--requirements\nfields:\n  statement: The system shall list every job with its current status.\n  kind: functional\n  priority: must\n  status: proposed\nlinks:\n  - type: verified-by\n    to: acceptance-criterion-jobs-listed\n  - type: derives-from\n    to: capability-view-job-status\n---\n"
    ],
    [
      "examples/ops-api-behaviour/risk-job-volume-growth",
      "---\nid: risk-job-volume-growth\ntype: risk\ntitle: Job volume growth\nplane: pln--plan\nfields:\n  likelihood: medium\n  impact: high\n  mitigation: Recount nightly jobs every month\n  state: open\nlinks:\n- type: owned-by\n  to: team-platform\n- type: about\n  to: assumption-job-volume\n- type: arises-from\n  to: assumption-job-volume\n---\nIf job volume grows past the assumption, the database may need a bigger plan.\n"
    ],
    [
      "examples/ops-api-behaviour/slo-status-availability",
      "---\nid: slo-status-availability\ntype: slo\ntitle: Status availability\nplane: sdr--behaviour\nfields:\n  objective: 99.9% of status calls succeed\n  window: 30 days\n  alert: status-error-rate-high\n---\n"
    ],
    [
      "examples/ops-api-behaviour/team-dev",
      "---\nid: team-dev\ntype: team\ntitle: Dev\nplane: pln--plan\nfields:\n  kind: agent\n  focus: Implements work packages for review\n---\n\nAn AI agent that writes code and hands it to people to review.\n"
    ],
    [
      "examples/ops-api-behaviour/team-platform",
      "---\nid: team-platform\ntype: team\ntitle: Platform\nplane: pln--plan\nfields:\n  kind: human\n  focus: Builds and runs the platform\n---\n\nThe people who own the system.\n"
    ],
    [
      "examples/ops-api-behaviour/work-package-build-status-api",
      "---\nid: work-package-build-status-api\ntype: work-package\ntitle: Build status API\nplane: pln--plan\nfields:\n  status: planned\nlinks:\n  - type: owned-by\n    to: team-dev\n  - type: reviewed-by\n    to: team-platform\n  - type: delivers\n    to: component-ops-api\n  - type: part-of\n    to: increment-live-status\n---\n\nBuild the service that lists job status.\n"
    ]
  ]
}
