{
  "name": "naming",
  "version": "0.2.0",
  "description": "How things are named: name patterns that write down each naming convention, filled from fields on the nodes themselves (an environment's code, a region's short code, a component's short name). One rule: every environment has a code. Other packs ship naming patterns and calculate names with derived definitions, and every calculated name is called `handle`, so one label choice shows them all.",
  "license": "Apache-2.0",
  "publisher": "trumly",
  "namespace": "nam",
  "tier": "verified",
  "deprecated": {
    "since": "2026-12-03",
    "replaced-by": "design",
    "note": "names are now calculated by derived fields in each pack; the environment code and its rule moved to design"
  },
  "role": "enrichment",
  "useWhen": "When names follow a scheme (cloud resources, environments, tables) and people and agents should name new things the same way first time.",
  "enriches": [
    "about",
    "design"
  ],
  "requires": [
    "core@^1.0.0",
    "about@^1.1.0"
  ],
  "optional": [
    "design@^1.0.0"
  ],
  "includes": [],
  "sha256": "4fe0baf9c9a3c4aac87326cd3926619750450917f7ce7d785b0de27b84516768",
  "files": [
    [
      "nam--derived-handle",
      "---\nid: nam--derived-handle\ntype: derived\ntitle: Environment handle\nfields:\n  name: handle\n  label: Environment handle\n  description: The short code of an environment, from its code field.\n  template: '{code}'\n  applies_to:\n    type: environment\n  enabled: true\n  pack: naming@0.2.0\n---\nEach environment shows its `code` (`prd`, `dev`), so it can be labelled and searched by it. Set `code` on the environment; until then it is reported as incomplete.\n"
    ],
    [
      "nam--names",
      "---\nid: nam--names\ntype: plane\ntitle: Names\nfields:\n  order: 1\n  stack: Naming\n  shapes:\n    name-pattern: document\n  pack: naming@0.2.0\n---\nHow things in the system are named: the patterns names follow, filled from fields on the nodes they name. People and agents follow the patterns when naming things; where a name can be worked out from the graph, a calculated `handle` shows it.\n"
    ],
    [
      "nam--pack",
      "---\nid: nam--pack\ntype: pack\ntitle: Naming\nfields:\n  name: naming\n  namespace: nam\n  version: 0.2.0\n  license: Apache-2.0\n  publisher: trumly\n  role: enrichment\n  enriches:\n  - about\n  - design\n  description: 'How things are named: name patterns that write down each naming convention, filled from fields\n    on the nodes themselves (an environment''s code, a region''s short code, a component''s short name). One rule:\n    every environment has a code. Other packs ship naming patterns and calculate names with derived definitions,\n    and every calculated name is called `handle`, so one label choice shows them all.'\n  use-when: When names follow a scheme (cloud resources, environments, tables) and people and agents should\n    name new things the same way first time.\n  requires:\n  - core@^1.0.0\n  - about@^1.1.0\n  optional:\n  - design@^1.0.0\n---\n\n"
    ],
    [
      "nam--rule-environment-code",
      "---\nid: nam--rule-environment-code\ntype: rule\ntitle: Environments have a code\nfields:\n  name: Environments have a code\n  statement: Every environment has a short code for use in names\n  severity: warn\n  applies_to:\n    type: environment\n  check:\n    require_fields:\n    - code\n  pack: naming@0.2.0\n---\n**Why:** calculated names (cloud resources, namespaces, hostnames) read the environment's code. Without it every name for that environment is left unworked out.\n\n**Fix:** set `code` on the environment, for example `prd`, `dev`, `sit` or `stg`.\n"
    ],
    [
      "nam--type-name-pattern",
      "---\nid: nam--type-name-pattern\ntype: type\ntitle: name-pattern\nfields:\n  name: name-pattern\n  plane: nam--names\n  shape: document\n  description: 'Use for the template one kind of thing is named by, such as Azure resources or storage accounts. Write the value as ordinary text and put a name in curly brackets wherever something from the node should go, the same way a calculated value reads it: {field}, {link/field}, {^link/field}, {@type/name}. Attach it with describes to the types, plane or nodes it names.'\n  fields:\n  - name: scope\n    kind: text\n    label: What it names\n    required: true\n  - name: pattern\n    kind: text\n    label: 'Pattern, e.g. {title}-{runs-in/code}'\n    required: true\n  - name: example\n    kind: text\n    label: Example name\n    required: true\n  - name: case\n    kind: choice\n    values:\n    - lower\n    - upper\n    - kebab\n    - snake\n    - camel\n    - pascal\n  - name: max-length\n    kind: number\n    label: Maximum length of the calculated name\n  pack: naming@0.2.0\n---\n**Ask:** What would someone, or an agent, need to know to name a new one of these correctly first time?\n\nOne pattern per kind of thing. Write the value as ordinary text and put a name in curly brackets wherever something from the node should go: `{title}` is the node's own field (`title`, `id` or any field it has); `{runs-in/code}` follows the `runs-in` link and takes the `code` field of the node reached; `{^runs-in/code}` follows links that point at this node; `{@type/name}` reads from the node's type definition. Parts that never change for one kind of thing (`db`, `psql`, `ix`) are written straight into the text; parts that change from node to node are fields on the node (an environment's `code`, a region's `short`, a component's `short-name`). If a link reaches several nodes you get one value for each. Because it is written the way a derived value reads, a pattern can be carried out by a `derived` definition with the same text. Use `describes` to attach it to what it names, so an agent about to create one is shown it.\n\n**Calculated names.** Where a name can be worked out from the graph, a `derived` definition called `handle` carries the pattern out and `details` it, so every node it applies to shows its handle and can be found by it. A pattern with no definition is guidance only, for example where the title already is the name. A node whose real name breaks the pattern sets `overrides` rather than changing the pattern.\n\n**Watch:** limits the platform imposes belong in the fields, not just the body. `max-length` is the most characters the calculated name may have. It limits the result, it is not part of working the name out, and a rule can hold the calculated `handle` to it.\n"
    ],
    [
      "examples/ops-api-names/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-names/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-names/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-names/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-names/cloud-provider-aws",
      "---\nid: cloud-provider-aws\ntype: cloud-provider\ntitle: AWS\nplane: hst--hosting\nfields:\n  kind: public-cloud\n  account: ops-production\nlinks:\n- type: details\n  to: environment-production\n---\nThe account that hosts production.\n"
    ],
    [
      "examples/ops-api-names/cloud-service-fargate",
      "---\nid: cloud-service-fargate\ntype: cloud-service\ntitle: ECS Fargate\nplane: hst--hosting\nfields:\n  service: ECS Fargate\n  kind: compute\nlinks:\n- type: runs-in\n  to: cloud-provider-aws\n- type: details\n  to: component-ops-api\n- type: in-region\n  to: region-london\n---\nRuns the API service.\n"
    ],
    [
      "examples/ops-api-names/cloud-service-rds",
      "---\nid: cloud-service-rds\ntype: cloud-service\ntitle: RDS for PostgreSQL\nplane: hst--hosting\nfields:\n  service: RDS for PostgreSQL\n  kind: database\nlinks:\n- type: runs-in\n  to: cloud-provider-aws\n- type: details\n  to: datastore-ops-db\n- type: in-region\n  to: region-london\n---\nManaged database that holds the operations data.\n"
    ],
    [
      "examples/ops-api-names/component-ops-api",
      "---\nid: component-ops-api\ntype: component\ntitle: Ops API\nplane: dsn--design\nfields:\n  short-name: ops\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: placed-in\n  to: zone-private\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-names/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-names/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-names/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-names/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-names/datastore-ops-db",
      "---\nid: datastore-ops-db\ntype: datastore\ntitle: Ops db\nplane: dsn--design\nfields:\n  short-name: ops\n  kind: relational\n  owner: Platform\nlinks:\n- type: placed-in\n  to: zone-private\n- type: runs-in\n  to: environment-production\n---\n\nHolds every job and its latest status.\n"
    ],
    [
      "examples/ops-api-names/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 reports would need joins in code.\n"
    ],
    [
      "examples/ops-api-names/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-names/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 the reports need joins.\n"
    ],
    [
      "examples/ops-api-names/derived-aws-name-db",
      "---\nid: derived-aws-name-db\ntype: derived\ntitle: AWS database handle\nfields:\n  name: aws-handle-db\n  field-name: handle\n  label: AWS database handle\n  template: '{details/short-name}-{details/runs-in/code}-{details/runs-in/in-region/short}-db'\n  applies_to:\n    type: cloud-service\n    kind: database\n  enabled: true\nlinks:\n- type: details\n  to: names-aws\n---\nThe workload short name, the environment code, the region short code and `db`, all read from the design node this cloud service details. Set `short-name` on the component or datastore, `code` on the environment and `short` on the region. Every cloud service of kind database gets this one.\n"
    ],
    [
      "examples/ops-api-names/derived-aws-name-svc",
      "---\nid: derived-aws-name-svc\ntype: derived\ntitle: AWS service handle\nfields:\n  name: aws-handle-svc\n  field-name: handle\n  label: AWS service handle\n  template: '{details/short-name}-{details/runs-in/code}-{details/runs-in/in-region/short}-svc'\n  applies_to:\n    type: cloud-service\n    kind: compute\n  enabled: true\nlinks:\n- type: details\n  to: names-aws\n---\nThe workload short name, the environment code, the region short code and `svc`, all read from the design node this cloud service details. Set `short-name` on the component or datastore, `code` on the environment and `short` on the region. Every cloud service of kind compute gets this one.\n"
    ],
    [
      "examples/ops-api-names/environment-production",
      "---\nid: environment-production\ntype: environment\ntitle: Production\nplane: dsn--design\nfields:\n  kind: production\n  code: prd\nlinks:\n- type: in-region\n  to: region-london\n---\n\nThe live system that operations staff use.\n"
    ],
    [
      "examples/ops-api-names/example",
      "---\nid: example\ntype: example\ntitle: Naming the ops API on AWS\nfields:\n  title: Naming the ops API on AWS\n  description: 'Environment codes and AWS naming in use: production shows prd, and the RDS database and\n    the Fargate services get their calculated handles (ops-prd-euw2-db, ops-prd-euw2-svc).'\n  use: starter\n  requires:\n  - naming\n  - hosting\n  - core\n---\n\n"
    ],
    [
      "examples/ops-api-names/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-names/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-names/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-names/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-names/names-aws",
      "---\nid: names-aws\ntype: name-pattern\ntitle: AWS resources\nplane: nam--names\nfields:\n  scope: AWS resources (databases, services, queues)\n  pattern: <workload>-<environment>-<region>-<kind>\n  example: ops-prd-euw2-db\n  case: kebab\n  max-length: 63\nlinks:\n- type: describes\n  to: hst--type-cloud-service\n---\nThe workload part is `ops`, the `short-name` of the design node. The last part says what the resource is for in the design, not which AWS product it is.\n"
    ],
    [
      "examples/ops-api-names/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-names/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-names/region-london",
      "---\nid: region-london\ntype: region\ntitle: London\nplane: hst--topology\nfields:\n  provider: AWS\n  code: eu-west-2\n  short: euw2\n---\n"
    ],
    [
      "examples/ops-api-names/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-names/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-names/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-names/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-names/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"
    ],
    [
      "examples/ops-api-names/zone-private",
      "---\nid: zone-private\ntype: network-zone\ntitle: Private zone\nplane: hst--topology\nfields:\n  exposure: private\nlinks:\n- type: in-region\n  to: region-london\n---\n"
    ],
    [
      "patterns/naming-environment-codes/codes",
      "---\nid: codes\ntype: name-pattern\ntitle: Environment codes\nplane: nam--names\nfields:\n  scope: The short code for each environment, used inside other names\n  pattern: '{code}'\n  example: prd\n  case: lower\n  max-length: 3\nlinks:\n- type: describes\n  to: dsn--type-environment\n---\nUse these codes and no others: `prd` production, `stg` staging, `sit` system integration test, `dev` development. Set the code on each environment with the `code` field; every pattern that names something by environment reads it from there. Three characters, lower case.\n"
    ],
    [
      "patterns/naming-environment-codes/pattern",
      "---\nid: pattern\ntype: pattern\ntitle: Naming – Environment codes\nfields:\n  title: Naming – Environment codes\n  description: A short code for each environment (prd, dev, sit, stg) that every other name pattern uses for its\n    environment-code part. Set it as the `code` field on each environment; the naming pack shows it as the\n    environment's handle so it can be labelled and searched.\n  use: starter\n  requires:\n  - naming\n  optional:\n  - design\n  root: codes\n  prefix: env\n---\n\n"
    ]
  ]
}
