Private beta, by invitation. It may change without warning. While the beta lasts, some paid features are free. See pricing

trumlyspec GitHub
Try trumly

Conformance cases /

ex-ops-api

A worked example: a whole project with its expected result.

Our implementation passes this case when its check --json output for the input below equals the expected output.

Input

nodes/acceptance-criterion-jobs-listed.md
---
id: acceptance-criterion-jobs-listed
type: acceptance-criterion
title: Jobs listed
plane: def--requirements
fields:
  given: A job has just changed state
  when: Ops staff open the job list
  then: The job and its new state are shown within 60 seconds
  method: test
---
nodes/actor-ops-staff.md
---
id: actor-ops-staff
type: actor
title: Ops staff
plane: def--capabilities
links:
  - type: uses
    to: component-ops-api
---
nodes/capability-view-job-status.md
---
id: capability-view-job-status
type: capability
title: View job status
plane: def--capabilities
fields:
  statement: view the current status of every job
  scope: in
  priority: must
  status: proposed
links:
  - type: performed-by
    to: actor-ops-staff
  - type: derives-from
    to: goal-timely-visibility
---
nodes/component-ops-api.md
---
id: component-ops-api
type: component
title: Ops API
plane: dsn--design
fields:
  kind: service
  owner: Platform
  status: planned
links:
  - type: satisfies
    to: requirement-list-jobs
  - type: writes
    to: datastore-ops-db
  - type: runs-in
    to: environment-production
---

Serves the list of jobs and their status to operations staff.
nodes/datastore-ops-db.md
---
id: datastore-ops-db
type: datastore
title: Ops db
plane: dsn--design
fields:
  kind: relational
  owner: Platform
---

Holds every job and its latest status.
nodes/decision-fastapi.md
---
id: decision-fastapi
type: decision
title: FastAPI
plane: gov--decisions
fields:
  status: proposed
links:
  - type: governs
    to: component-ops-api
---

Build the Ops API with the FastAPI framework.
nodes/decision-postgres.md
---
id: decision-postgres
type: decision
title: Postgres
plane: gov--decisions
fields:
  status: proposed
links:
  - type: governs
    to: datastore-ops-db
---

Use PostgreSQL for the operations database.
nodes/environment-production.md
---
id: environment-production
type: environment
title: Production
plane: dsn--design
fields:
  kind: production
---

The live system that operations staff use.
nodes/goal-timely-visibility.md
---
id: goal-timely-visibility
type: goal
title: Timely ops visibility
plane: def--intent
fields:
  statement: Operations staff see the state of every job within a minute.
  status: proposed
links:
  - type: measured-by
    to: metric-status-freshness
---
nodes/increment-live-status.md
---
id: increment-live-status
type: increment
title: Live job status
plane: pln--plan
fields:
  status: planned
links:
  - type: enables
    to: capability-view-job-status
---

The first slice: staff can see live job status.
nodes/metric-status-freshness.md
---
id: metric-status-freshness
type: metric
title: Job status age
plane: def--intent
fields:
  kind: success
  unit: seconds
  direction: lower-is-better
  target: 60
  how-measured: Age of the newest status for each job, sampled every minute
---
nodes/overview.md
---
id: overview
type: overview
title: Ops API
plane: abt--about
fields:
  purpose: A status API so operations staff can see what every job is doing.
  audience: The build team and operations staff
  owner: Platform
  stage: design
---
nodes/requirement-list-jobs.md
---
id: requirement-list-jobs
type: requirement
title: List jobs
plane: def--requirements
fields:
  statement: The system shall list every job with its current status.
  kind: functional
  priority: must
  status: proposed
links:
  - type: verified-by
    to: acceptance-criterion-jobs-listed
  - type: derives-from
    to: capability-view-job-status
---
nodes/team-dev.md
---
id: team-dev
type: team
title: Dev
plane: pln--plan
fields:
  kind: agent
  focus: Implements work packages for review
---

An AI agent that writes code and hands it to people to review.
nodes/team-platform.md
---
id: team-platform
type: team
title: Platform
plane: pln--plan
fields:
  kind: human
  focus: Builds and runs the platform
---

The people who own the system.
nodes/work-package-build-status-api.md
---
id: work-package-build-status-api
type: work-package
title: Build status API
plane: pln--plan
fields:
  status: planned
links:
  - type: owned-by
    to: team-dev
  - type: reviewed-by
    to: team-platform
  - type: delivers
    to: component-ops-api
  - type: part-of
    to: increment-live-status
---

Build the service that lists job status.
nodes/work-package-provision-database.md
---
id: work-package-provision-database
type: work-package
title: Provision database
plane: pln--plan
fields:
  status: planned
links:
  - type: owned-by
    to: team-platform
  - type: delivers
    to: datastore-ops-db
  - type: part-of
    to: increment-live-status
---

Create the operations database.

Expected output

0 ghosts · 0 load errors · 17 nodes · 0 results

expected.json
{
 "ghosts": [],
 "load_errors": [],
 "nodes": [
  {
   "body": "",
   "fields": {
    "given": "A job has just changed state",
    "method": "test",
    "then": "The job and its new state are shown within 60 seconds",
    "when": "Ops staff open the job list"
   },
   "id": "acceptance-criterion-jobs-listed",
   "links": [],
   "parent": null,
   "plane": "def--requirements",
   "title": "Jobs listed",
   "type": "acceptance-criterion"
  },
  {
   "body": "",
   "fields": {},
   "id": "actor-ops-staff",
   "links": [
    {
     "to": "component-ops-api",
     "type": "uses"
    }
   ],
   "parent": null,
   "plane": "def--capabilities",
   "title": "Ops staff",
   "type": "actor"
  },
  {
   "body": "",
   "fields": {
    "priority": "must",
    "scope": "in",
    "statement": "view the current status of every job",
    "status": "proposed"
   },
   "id": "capability-view-job-status",
   "links": [
    {
     "to": "actor-ops-staff",
     "type": "performed-by"
    },
    {
     "to": "goal-timely-visibility",
     "type": "derives-from"
    }
   ],
   "parent": null,
   "plane": "def--capabilities",
   "title": "View job status",
   "type": "capability"
  },
  {
   "body": "Serves the list of jobs and their status to operations staff.",
   "fields": {
    "kind": "service",
    "owner": "Platform",
    "status": "planned"
   },
   "id": "component-ops-api",
   "links": [
    {
     "to": "requirement-list-jobs",
     "type": "satisfies"
    },
    {
     "to": "datastore-ops-db",
     "type": "writes"
    },
    {
     "to": "environment-production",
     "type": "runs-in"
    }
   ],
   "parent": null,
   "plane": "dsn--design",
   "title": "Ops API",
   "type": "component"
  },
  {
   "body": "Holds every job and its latest status.",
   "fields": {
    "kind": "relational",
    "owner": "Platform"
   },
   "id": "datastore-ops-db",
   "links": [],
   "parent": null,
   "plane": "dsn--design",
   "title": "Ops db",
   "type": "datastore"
  },
  {
   "body": "Build the Ops API with the FastAPI framework.",
   "fields": {
    "status": "proposed"
   },
   "id": "decision-fastapi",
   "links": [
    {
     "to": "component-ops-api",
     "type": "governs"
    }
   ],
   "parent": null,
   "plane": "gov--decisions",
   "title": "FastAPI",
   "type": "decision"
  },
  {
   "body": "Use PostgreSQL for the operations database.",
   "fields": {
    "status": "proposed"
   },
   "id": "decision-postgres",
   "links": [
    {
     "to": "datastore-ops-db",
     "type": "governs"
    }
   ],
   "parent": null,
   "plane": "gov--decisions",
   "title": "Postgres",
   "type": "decision"
  },
  {
   "body": "The live system that operations staff use.",
   "fields": {
    "kind": "production"
   },
   "id": "environment-production",
   "links": [],
   "parent": null,
   "plane": "dsn--design",
   "title": "Production",
   "type": "environment"
  },
  {
   "body": "",
   "fields": {
    "statement": "Operations staff see the state of every job within a minute.",
    "status": "proposed"
   },
   "id": "goal-timely-visibility",
   "links": [
    {
     "to": "metric-status-freshness",
     "type": "measured-by"
    }
   ],
   "parent": null,
   "plane": "def--intent",
   "title": "Timely ops visibility",
   "type": "goal"
  },
  {
   "body": "The first slice: staff can see live job status.",
   "fields": {
    "status": "planned"
   },
   "id": "increment-live-status",
   "links": [
    {
     "to": "capability-view-job-status",
     "type": "enables"
    }
   ],
   "parent": null,
   "plane": "pln--plan",
   "title": "Live job status",
   "type": "increment"
  },
  {
   "body": "",
   "fields": {
    "direction": "lower-is-better",
    "how-measured": "Age of the newest status for each job, sampled every minute",
    "kind": "success",
    "target": 60,
    "unit": "seconds"
   },
   "id": "metric-status-freshness",
   "links": [],
   "parent": null,
   "plane": "def--intent",
   "title": "Job status age",
   "type": "metric"
  },
  {
   "body": "",
   "fields": {
    "audience": "The build team and operations staff",
    "owner": "Platform",
    "purpose": "A status API so operations staff can see what every job is doing.",
    "stage": "design"
   },
   "id": "overview",
   "links": [],
   "parent": null,
   "plane": "abt--about",
   "title": "Ops API",
   "type": "overview"
  },
  {
   "body": "",
   "fields": {
    "kind": "functional",
    "priority": "must",
    "statement": "The system shall list every job with its current status.",
    "status": "proposed"
   },
   "id": "requirement-list-jobs",
   "links": [
    {
     "to": "acceptance-criterion-jobs-listed",
     "type": "verified-by"
    },
    {
     "to": "capability-view-job-status",
     "type": "derives-from"
    }
   ],
   "parent": null,
   "plane": "def--requirements",
   "title": "List jobs",
   "type": "requirement"
  },
  {
   "body": "An AI agent that writes code and hands it to people to review.",
   "fields": {
    "focus": "Implements work packages for review",
    "kind": "agent"
   },
   "id": "team-dev",
   "links": [],
   "parent": null,
   "plane": "pln--plan",
   "title": "Dev",
   "type": "team"
  },
  {
   "body": "The people who own the system.",
   "fields": {
    "focus": "Builds and runs the platform",
    "kind": "human"
   },
   "id": "team-platform",
   "links": [],
   "parent": null,
   "plane": "pln--plan",
   "title": "Platform",
   "type": "team"
  },
  {
   "body": "Build the service that lists job status.",
   "fields": {
    "status": "planned"
   },
   "id": "work-package-build-status-api",
   "links": [
    {
     "to": "team-dev",
     "type": "owned-by"
    },
    {
     "to": "team-platform",
     "type": "reviewed-by"
    },
    {
     "to": "component-ops-api",
     "type": "delivers"
    },
    {
     "to": "increment-live-status",
     "type": "part-of"
    }
   ],
   "parent": null,
   "plane": "pln--plan",
   "title": "Build status API",
   "type": "work-package"
  },
  {
   "body": "Create the operations database.",
   "fields": {
    "status": "planned"
   },
   "id": "work-package-provision-database",
   "links": [
    {
     "to": "team-platform",
     "type": "owned-by"
    },
    {
     "to": "datastore-ops-db",
     "type": "delivers"
    },
    {
     "to": "increment-live-status",
     "type": "part-of"
    }
   ],
   "parent": null,
   "plane": "pln--plan",
   "title": "Provision database",
   "type": "work-package"
  }
 ],
 "results": [],
 "structure": {
  "errors": [],
  "warnings": [
   {
    "kind": "undeclared_plane",
    "node": "acceptance-criterion-jobs-listed",
    "ref": "def--requirements"
   },
   {
    "kind": "undeclared_plane",
    "node": "actor-ops-staff",
    "ref": "def--capabilities"
   },
   {
    "kind": "undeclared_plane",
    "node": "capability-view-job-status",
    "ref": "def--capabilities"
   },
   {
    "kind": "undeclared_plane",
    "node": "component-ops-api",
    "ref": "dsn--design"
   },
   {
    "kind": "undeclared_plane",
    "node": "datastore-ops-db",
    "ref": "dsn--design"
   },
   {
    "kind": "undeclared_plane",
    "node": "decision-fastapi",
    "ref": "gov--decisions"
   },
   {
    "kind": "undeclared_plane",
    "node": "decision-postgres",
    "ref": "gov--decisions"
   },
   {
    "kind": "undeclared_plane",
    "node": "environment-production",
    "ref": "dsn--design"
   },
   {
    "kind": "undeclared_plane",
    "node": "goal-timely-visibility",
    "ref": "def--intent"
   },
   {
    "kind": "undeclared_plane",
    "node": "increment-live-status",
    "ref": "pln--plan"
   },
   {
    "kind": "undeclared_plane",
    "node": "metric-status-freshness",
    "ref": "def--intent"
   },
   {
    "kind": "undeclared_plane",
    "node": "overview",
    "ref": "abt--about"
   },
   {
    "kind": "undeclared_plane",
    "node": "requirement-list-jobs",
    "ref": "def--requirements"
   },
   {
    "kind": "undeclared_plane",
    "node": "team-dev",
    "ref": "pln--plan"
   },
   {
    "kind": "undeclared_plane",
    "node": "team-platform",
    "ref": "pln--plan"
   },
   {
    "kind": "undeclared_plane",
    "node": "work-package-build-status-api",
    "ref": "pln--plan"
   },
   {
    "kind": "undeclared_plane",
    "node": "work-package-provision-database",
    "ref": "pln--plan"
   }
  ]
 }
}