{
  "name": "resilience",
  "version": "0.3.0",
  "description": "Surviving loss: recovery objectives, backups and fallbacks. Rules are errors: every datastore has a recovery objective, and every datastore that holds data that cannot be rebuilt has a backup. A cache is rebuilt, so it needs no backup.",
  "license": "Apache-2.0",
  "publisher": "trumly",
  "namespace": "sdz",
  "tier": "verified",
  "role": "enrichment",
  "useWhen": "When you need to say how the system survives loss: recovery objectives, backups and fallbacks.",
  "enriches": [
    "datastore",
    "component"
  ],
  "requires": [
    "core@^1.0.0"
  ],
  "optional": [
    "hosting@^0.2.0",
    "data-model@^0.5.0"
  ],
  "includes": [],
  "sha256": "3ad5dc1fd9530e8ca4941289bcc5f2051e09b5122e1810aebcd54591dbee9694",
  "files": [
    [
      "sdz--link-type-backed-up-by",
      "---\nid: sdz--link-type-backed-up-by\ntype: link-type\ntitle: backed-up-by\nfields:\n  name: backed-up-by\n  description: The datastore is copied by this backup.\n  inverse: backs up\n  from:\n  - datastore\n  to:\n  - backup\n  pack: resilience@0.3.0\n---\n"
    ],
    [
      "sdz--link-type-falls-back-to",
      "---\nid: sdz--link-type-falls-back-to\ntype: link-type\ntitle: falls-back-to\nfields:\n  name: falls-back-to\n  description: When this dependency fails, use this instead.\n  inverse: fallback for\n  from:\n  - component\n  to:\n  - fallback\n  pack: resilience@0.3.0\n---\n"
    ],
    [
      "sdz--link-type-recovers-to",
      "---\nid: sdz--link-type-recovers-to\ntype: link-type\ntitle: recovers-to\nfields:\n  name: recovers-to\n  description: The datastore or component must recover within this objective.\n  inverse: recovery target of\n  from:\n  - datastore\n  - component\n  to:\n  - recovery-objective\n  pack: resilience@0.3.0\n---\n"
    ],
    [
      "sdz--pack",
      "---\nid: sdz--pack\ntype: pack\ntitle: Resilience\nfields:\n  name: resilience\n  namespace: sdz\n  version: 0.3.0\n  description: 'Surviving loss: recovery objectives, backups and fallbacks. Rules are errors: every datastore has a recovery objective, and every datastore that holds data that cannot be rebuilt has a backup. A cache is rebuilt, so it needs no backup.'\n  license: Apache-2.0\n  publisher: trumly\n  role: enrichment\n  enriches:\n  - datastore\n  - component\n  use-when: 'When you need to say how the system survives loss: recovery objectives, backups and fallbacks.'\n  requires:\n  - core@^1.0.0\n  optional:\n  - hosting@^0.2.0\n  - data-model@^0.5.0\n---\n"
    ],
    [
      "sdz--recovery",
      "---\nid: sdz--recovery\ntype: plane\ntitle: Recovery\nfields:\n  order: 1\n  pack: resilience@0.3.0\n  stack: Resilience\n---\n\nWhat we do when things are lost.\n"
    ],
    [
      "sdz--rule-backup-protects-store",
      "---\nid: sdz--rule-backup-protects-store\ntype: rule\ntitle: Backups protect a datastore\nfields:\n  name: Backups protect a datastore\n  statement: Every backup is the backup of a datastore\n  severity: warn\n  applies_to:\n    type: backup\n  check:\n    any_of:\n    - require_link:\n        min: 1\n        type: backed-up-by\n        dir: in\n        node_type: datastore\n  pack: resilience@0.3.0\n---\n**Why:** a backup nothing points at protects nothing.\n\n**Fix:** link the datastore it protects to it with `backed-up-by`.\n"
    ],
    [
      "sdz--rule-backup-tested",
      "---\nid: sdz--rule-backup-tested\ntype: rule\ntitle: Backups are restore-tested\nfields:\n  name: Backups are restore-tested\n  statement: Every backup has had a restore tested\n  severity: warn\n  applies_to:\n    type: backup\n  check:\n    field_is:\n      restore_tested:\n        in:\n        - true\n  pack: resilience@0.3.0\n---\n"
    ],
    [
      "sdz--rule-objective-applies",
      "---\nid: sdz--rule-objective-applies\ntype: rule\ntitle: Objectives apply to a node\nfields:\n  name: Objectives apply to a node\n  statement: Every recovery objective is set for a datastore or component\n  severity: warn\n  applies_to:\n    type: recovery-objective\n  check:\n    any_of:\n    - require_link:\n        min: 1\n        type: recovers-to\n        dir: in\n        node_type: datastore\n    - require_link:\n        min: 1\n        type: recovers-to\n        dir: in\n        node_type: component\n  pack: resilience@0.3.0\n---\n**Why:** an objective with nothing it applies to cannot be checked or met.\n\n**Fix:** link the datastore or component to it with `recovers-to`.\n"
    ],
    [
      "sdz--rule-objective-fields",
      "---\nid: sdz--rule-objective-fields\ntype: rule\ntitle: Objectives state RTO and RPO\nfields:\n  name: Objectives state RTO and RPO\n  statement: Every recovery objective states time and data loss\n  severity: error\n  applies_to:\n    type: recovery-objective\n  check:\n    require_fields:\n    - rto\n    - rpo\n  pack: resilience@0.3.0\n---\n"
    ],
    [
      "sdz--rule-store-backup",
      "---\nid: sdz--rule-store-backup\ntype: rule\ntitle: Data stores have a backup\nfields:\n  name: Data stores have a backup\n  statement: Every datastore that holds data that cannot be rebuilt has a backup\n  severity: error\n  applies_to:\n    type: datastore\n    kind:\n    - relational\n    - document\n    - key-value\n    - object\n    - search\n    - file\n  check:\n    require_link:\n      type: backed-up-by\n      node_type: backup\n  pack: resilience@0.3.0\n---\n"
    ],
    [
      "sdz--rule-store-objective",
      "---\nid: sdz--rule-store-objective\ntype: rule\ntitle: Data stores have an objective\nfields:\n  name: Data stores have an objective\n  statement: Every datastore has a recovery objective\n  severity: error\n  applies_to:\n    type: datastore\n  check:\n    require_link:\n      type: recovers-to\n      node_type: recovery-objective\n  pack: resilience@0.3.0\n---\n"
    ],
    [
      "sdz--type-backup",
      "---\nid: sdz--type-backup\ntype: type\ntitle: backup\nfields:\n  name: backup\n  plane: sdz--recovery\n  description: A copy of data kept to restore from.\n  shape: database up\n  fields:\n  - name: frequency\n    kind: text\n    required: true\n  - name: retention\n    kind: text\n  - name: restore_tested\n    kind: boolean\n  pack: resilience@0.3.0\n---\n"
    ],
    [
      "sdz--type-fallback",
      "---\nid: sdz--type-fallback\ntype: type\ntitle: fallback\nfields:\n  name: fallback\n  plane: sdz--recovery\n  description: What happens instead when a dependency is down.\n  shape: chevron 2d\n  pack: resilience@0.3.0\n---\n"
    ],
    [
      "sdz--type-recovery-objective",
      "---\nid: sdz--type-recovery-objective\ntype: type\ntitle: recovery-objective\nfields:\n  name: recovery-objective\n  plane: sdz--recovery\n  description: How much data and time we can afford to lose.\n  shape: shield 2d\n  fields:\n  - name: rto\n    kind: text\n    required: true\n  - name: rpo\n    kind: text\n    required: true\n  pack: resilience@0.3.0\n---\n"
    ],
    [
      "examples/ops-api-recovery/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-recovery/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-recovery/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-recovery/backup-ops-db",
      "---\nid: backup-ops-db\ntype: backup\ntitle: Nightly backup\nplane: sdz--recovery\nfields:\n  frequency: daily\n  retention: 30 days\n  restore_tested: true\n---\n"
    ],
    [
      "examples/ops-api-recovery/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-recovery/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---\n\nServes the list of jobs and their status to operations staff.\n"
    ],
    [
      "examples/ops-api-recovery/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-recovery/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-recovery/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-recovery/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-recovery/datastore-ops-db",
      "---\nid: datastore-ops-db\ntype: datastore\ntitle: Ops db\nplane: dsn--design\nfields:\n  kind: relational\n  owner: Platform\nlinks:\n- type: backed-up-by\n  to: backup-ops-db\n- type: recovers-to\n  to: rec-ops-db\n---\n\nHolds every job and its latest status.\n"
    ],
    [
      "examples/ops-api-recovery/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-recovery/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-recovery/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-recovery/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-recovery/example",
      "---\nid: example\ntype: example\ntitle: Surviving a lost database\nfields:\n  title: Surviving a lost database\n  description: A backup that has had a restore tested, and the time and data loss the database may suffer.\n  use: starter\n  requires:\n  - resilience\n  - core\n---\n"
    ],
    [
      "examples/ops-api-recovery/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-recovery/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-recovery/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-recovery/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-recovery/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-recovery/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-recovery/rec-ops-db",
      "---\nid: rec-ops-db\ntype: recovery-objective\ntitle: Database recovery\nplane: sdz--recovery\nfields:\n  rto: 1 hour\n  rpo: 15 minutes\n---\n"
    ],
    [
      "examples/ops-api-recovery/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-recovery/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-recovery/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-recovery/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-recovery/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"
    ]
  ]
}
