// Canonical example for the book: ADRs, requirements, and policies.

system = kind "System"

shop = system "Shop" {
  description "Example shop system for governance artifacts"
}

DB_Choice = adr "Database Selection" {
  status "Accepted"
  context "Choose between Postgres and Mongo"
  decision "Use Postgres for relational needs"
  consequences "Reliable ACID; more ops complexity"
}

R1 = requirement functional "System must process orders"
R2 = requirement nonfunctional "System must be maintainable and extensible"
R3 = requirement constraint "Must use PostgreSQL database"
R4 = requirement performance "API must respond in under 200ms"
R5 = requirement security "All data must be encrypted at rest"

SecurityPolicy = policy "Encrypt data at rest" {
  category "security"
  enforcement "required"
}

NoExtToDb = policy "External APIs must not call databases" {
  category "architecture"
  rule deny edge from { kind "external_api" } to { kind "database" }
}

R1 -> shop "Defines core capability"
R2 -> shop "Quality goals"
R3 -> DB_Choice "Constrains decision"
R4 -> shop "Performance constraint"
R5 -> shop "Security requirement"
DB_Choice -> shop "Documents"
