{
 "version": 1,
 "about": "The plain-language contract for text a person has to read on Stuckbot: ticket titles and summaries, questions, choices, steps, comments and approval requests. The server refuses text that breaks it with 422 not_plain when the org policy plain_language is on (the default). Exact commands, paths, ids and logs belong in the technical fields: scope.commands, scope.resources, evidence, stuck_reason, attempts, context, and the command of a human_steps entry.",
 "max_sentence_words": 30,
 "skip": "https?://\\S+|\\b[\\w.+-]+@[\\w-]+\\.[\\w.]+|\\b[\\w-]+(?:\\.[\\w-]+)*\\.(?:com|org|net|io|dev|app|gov|us)\\b(?:/\\S*)?|\\bSB-\\d+\\b",
 "shapes": [
  {
   "re": "(?<![\\w.])~?\\.{0,2}/(?:[\\w.-]+/)+[\\w.-]*",
   "what": "a file path"
  },
  {
   "re": "\\b[A-Za-z_]\\w*/[A-Za-z_]\\w*/[A-Za-z_]\\w*",
   "what": "words joined by slashes"
  },
  {
   "re": "\\b[\\w-]+\\.(?:py|php|js|ts|json|sh|sql|md|conf|ya?ml|service|timer|db|csv|nft|env|log|txt|ini|toml|lock|html|css|xml|pem)\\b",
   "what": "a file name"
  },
  {
   "re": "\\b[A-Za-z]+_[A-Za-z0-9_]+\\b",
   "what": "a code name"
  },
  {
   "re": "\\b\\w+\\(\\)",
   "what": "a function name"
  },
  {
   "re": "(?:^|\\s)--?[a-z][\\w-]*",
   "what": "a command flag"
  },
  {
   "re": "`[^`]*`?",
   "what": "code in backticks"
  },
  {
   "re": "\\$[A-Za-z_]\\w*|\\$\\{",
   "what": "a code variable"
  },
  {
   "re": "\\b(?=[0-9a-f]*\\d)(?=[0-9a-f]*[a-f])[0-9a-f]{7,}\\b",
   "what": "a code id (hash)"
  },
  {
   "re": "\\b\\d{1,3}(?:\\.\\d{1,3}){3}\\b",
   "what": "a network address"
  }
 ],
 "jargon": [
  {
   "re": "\\blanded\\b|\\bto land\\b|\\bbob-land\\b",
   "say": "went live"
  },
  {
   "re": "\\bcommits?\\b",
   "say": "saved change"
  },
  {
   "re": "\\bmerg(?:e|ed|es|ing)\\b",
   "say": "combine"
  },
  {
   "re": "\\b(?:re)?deploy(?:s|ed|ing|ment|ments)?\\b",
   "say": "put live"
  },
  {
   "re": "\\b(?:e|in)gress\\b",
   "say": "outgoing or incoming traffic"
  },
  {
   "re": "\\broll(?:ed|ing|s)?[ -]?backs?\\b",
   "say": "undo"
  },
  {
   "re": "\\brevert(?:s|ed|ing)?\\b",
   "say": "undo"
  },
  {
   "re": "\\bpipelines?\\b",
   "say": "the chain of steps"
  },
  {
   "re": "\\bcontainers?\\b|\\bdocker\\b",
   "say": "a boxed-off program"
  },
  {
   "re": "\\bworkers?\\b",
   "say": "background program or helper machine"
  },
  {
   "re": "\\bgates?\\b|\\bgateway\\b",
   "say": "the program that checks or passes on requests"
  },
  {
   "re": "\\bguards?\\b",
   "say": "safety check"
  },
  {
   "re": "\\bhooks?\\b",
   "say": "automatic check"
  },
  {
   "re": "\\bgit\\b|\\brepos?\\b|\\brepositor(?:y|ies)\\b",
   "say": "the code folder"
  },
  {
   "re": "\\bbranch(?:es)?\\b|\\bmain branch\\b|\\b(?:on|into|onto|than) (?:Bob's )?main\\b(?!\\s+[a-z])|\\bBob's main\\b(?!\\s+[a-z])",
   "say": "the live copy of the code"
  },
  {
   "re": "\\brebas(?:e|ed|ing)\\b|\\bworktrees?\\b|\\bcherry-pick\\w*|\\bpull requests?\\b|\\bPRs?\\b|\\bupstream\\b|\\bdownstream\\b",
   "say": "say what happened to the code in everyday words"
  },
  {
   "re": "\\bdiffs?\\b",
   "say": "list of changes"
  },
  {
   "re": "\\bcron(?:job)?s?\\b|\\bsystemd\\b|\\bdaemons?\\b",
   "say": "scheduled or background job"
  },
  {
   "re": "\\bsymlinks?\\b|\\bstd(?:out|err)\\b|\\bregex(?:es|p)?\\b|\\bpayloads?\\b|\\bmiddleware\\b|\\bruntime\\b|\\bnamespaces?\\b|\\bmutex\\b|\\bcallbacks?\\b|\\bhandlers?\\b|\\bartifacts?\\b|\\bbinar(?:y|ies)\\b|\\bstack ?traces?\\b|\\bexit codes?\\b|\\bPIDs?\\b|\\bOOM\\b|\\bkernel\\b|\\bSIG(?:HUP|KILL|TERM|INT)\\b|\\bidempoten\\w+|\\brace conditions?\\b|\\brefactor\\w*|\\bbacktracking\\b|\\bfalse (?:positive|negative)s?\\b|\\blint\\w*\\b|\\bpars(?:e|ed|er|es|ing)\\b|\\bbool(?:ean)?s?\\b|\\bnull\\b|\\bhypervisor\\b|\\bshards?\\b|\\breplicas?\\b",
   "say": "say what it means for the person in everyday words"
  },
  {
   "re": "\\bendpoints?\\b|\\bwebhooks?\\b|\\bAPIs?\\b",
   "say": "the connection to another service"
  },
  {
   "re": "\\benv(?:ironment)? var(?:iable)?s?\\b|\\bconfigs?\\b|\\bconfiguration\\b",
   "say": "settings"
  },
  {
   "re": "\\bsudo\\b|\\broot access\\b|\\bas root\\b",
   "say": "full admin rights"
  },
  {
   "re": "\\bSSH\\b",
   "say": "remote login"
  },
  {
   "re": "\\bLXC\\b|\\bWSL\\b|\\bVMs?\\b",
   "say": "say what kind of machine it is"
  },
  {
   "re": "\\bnginx\\b|\\bphp-fpm\\b|\\bvhosts?\\b",
   "say": "the web server"
  },
  {
   "re": "\\bpostgres(?:ql)?\\b|\\bSQL\\b",
   "say": "the database"
  },
  {
   "re": "\\bschemas?\\b|\\bmigrations?\\b",
   "say": "database change"
  },
  {
   "re": "\\bJSON\\b|\\bYAML\\b|\\bCLI\\b|\\bLLMs?\\b|\\bCI\\b|\\bOAuth\\b",
   "say": "say it in everyday words"
  },
  {
   "re": "\\bbackend\\b|\\bfrontend\\b|\\bprod\\b|\\bstaging\\b",
   "say": "the live site or the test copy"
  },
  {
   "re": "\\bhash(?:es|ed)?\\b|\\bchecksums?\\b",
   "say": "fingerprint of the file"
  },
  {
   "re": "\\bcerts?\\b|\\bcreds\\b|\\bauth\\b",
   "say": "certificate, passwords or sign-in"
  }
 ],
 "explained": "^[\\w' -]{0,40}?\\s*\\((?=[^)]*\\s[^)]*\\s)[^)]{8,200}\\)",
 "ticket": {
  "limits": {
   "title": 80,
   "reason": 600,
   "problem": 300,
   "cause": 300,
   "impact": 200,
   "next_step": 200,
   "outcome": 400,
   "recommendation": 400,
   "after": 300,
   "done": 300,
   "label": 60,
   "detail": 140,
   "step": 300,
   "where": 120,
   "warning": 300,
   "comment": 1500
  }
 },
 "approval": {
  "fields": {
   "action": "What the agent wants to do, in one short line.",
   "summary": "Why: the problem this solves.",
   "risk_if_waiting": "What happens if the person says no or waits.",
   "risk_if_done": "What could go wrong if the person approves, and how bad that would be.",
   "rollback_plan": "Can it be undone? Starts with Yes, No or Partly, then how, and what is lost for good.",
   "recommendation": "Starts with Approve, Reject or Investigate, then one short reason.",
   "risk_tier": "How bad the worst realistic outcome is: low (minor), medium (moderate), high (serious) or critical."
  },
  "limits": {
   "action": 120,
   "summary": 300,
   "risk_if_waiting": 200,
   "risk_if_done": 400,
   "rollback_plan": 300,
   "recommendation": 200
  },
  "min_words": {
   "action": 3,
   "summary": 6,
   "risk_if_waiting": 4,
   "risk_if_done": 6,
   "rollback_plan": 4,
   "recommendation": 4
  },
  "undo": [
   "Yes",
   "No",
   "Partly"
  ],
  "recommend": [
   "Approve",
   "Reject",
   "Investigate"
  ],
  "risk": {
   "low": "Minor",
   "medium": "Moderate",
   "high": "Serious",
   "critical": "Critical"
  },
  "serious_categories": [
   "data",
   "security",
   "money",
   "production",
   "legal"
  ]
 },
 "danger": [
  {
   "key": "deletes",
   "re": "\\brm\\b|\\brmdir\\b|\\bunlink\\b|\\bdelete\\w*\\b|\\bdel\\b|\\bdrop\\b|\\btruncate\\b|\\bdestroy\\w*\\b|\\bwipe\\w*\\b|\\bpurge\\w*\\b|\\bprune\\b|\\bmkfs\\b|\\bshred\\b|\\bdelsnapshot\\b|\\bremove\\w*\\b|reset --hard|\\bclean -\\w*f|\\berase\\w*\\b|\\bformat\\b",
   "flag": "delete or erase something",
   "words": "delet|eras|remov|los[et]|gone|wip|clear|destroy|drop",
   "undo_not_yes": true,
   "min_risk": "medium"
  },
  {
   "key": "admin",
   "re": "\\bsudo\\b|\\bsu -|\\bdoas\\b|\\brunas\\b",
   "flag": "run with full admin rights on the machine",
   "words": "",
   "min_risk": "medium"
  },
  {
   "key": "security",
   "re": "\\b(?:ufw|iptables|nft|firewall-cmd|firewalld)\\b|authorized_keys|\\bsshd?_config\\b|\\bsudoers\\b|\\bvisudo\\b|\\bpasswd\\b|\\bchmod\\b|\\bchown\\b|\\bsetfacl\\b|\\bssh-keygen\\b|\\buseradd\\b|\\busermod\\b|approval[_-]guard|approval[_-]policy|bob[_-]approval\\w*\\.py|\\b(?:2fa|mfa)\\b",
   "flag": "change security or access settings",
   "words": "secur|access|sign|log ?in|firewall|permission|password|key|protect|expos|open|lock|safety|approv|\\bown",
   "min_risk": "medium"
  },
  {
   "key": "stops",
   "re": "\\bshutdown\\b|\\bpoweroff\\b|\\breboot\\b|\\bhalt\\b|--shutdown\\b|--terminate\\b|\\bsystemctl\\s+(?:stop|disable|mask|restart|kill)\\b|\\bkill(?:all)?\\b|\\bpkill\\b|\\b(?:pct|qm|docker|podman)\\s+(?:stop|shutdown|reboot|restart)\\b|\\bstop-(?:vm|service|computer)\\b",
   "flag": "stop, restart or power off something",
   "words": "stop|restart|turn|shut|power|\\boff\\b|down|interrupt|reboot|clos|paus|unavailable|offline",
   "min_risk": "medium"
  },
  {
   "key": "money",
   "re": "\\bstripe\\b|\\bcheckout\\b|\\bpurchase\\b|\\bbuy\\b|\\bsubscri\\w+|\\bbilling\\b|\\binvoice\\b|\\bcharge\\b|\\bpay(?:ment)?\\b",
   "flag": "spend money or change billing",
   "words": "\\$|cost|pay|charg|spend|money|bill|price|fee|free",
   "min_risk": "medium"
  },
  {
   "key": "database",
   "re": "\\bpsql\\b|\\bmysql\\b|\\bsqlite3?\\b|\\bpg_restore\\b|\\balter\\s+table\\b|\\bupdate\\s+\\w+\\s+set\\b|\\binsert\\s+into\\b|\\brestore\\b",
   "flag": "change a live database",
   "words": "data|record|row|table|restor|sav",
   "min_risk": "medium"
  },
  {
   "key": "sends",
   "re": "\\bsendmail\\b|\\bmailx?\\b|\\bpublish\\b|\\bgit\\s+push\\b|\\btwine\\b",
   "flag": "send or publish something outside",
   "words": "send|publish|post|email|public|upload|share|mail",
   "min_risk": "low"
  },
  {
   "key": "overwrites",
   "re": "(?<![>=<-])(?:&>|>&(?![0-9-])|>\\|?)(?![>&])\\s*[\"']?(?:~/|/(?!dev/(?:(?:null|stdout|stderr|tty)\\b|fd/)|tmp/(?![^\\s|&;<>\"']*\\.\\.)))[^\\s|&;<>]",
   "bare": "(?<![>=<-])(?:&>|>&(?![0-9-])|>\\|?)(?![>&])\\s*(?!/dev/(?:(?:null|stdout|stderr|tty)\\b|fd/)|/tmp/(?![^\\s|&;<>]*\\.\\.))[^\\s|&;<>()]",
   "flag": "write over a file",
   "words": "writ|replac|eras|empt|sav|stor|put|creat|chang|updat",
   "min_risk": "low"
  },
  {
   "key": "hidden",
   "re": "\\$\\((?!(?:cat\\s+|<\\s*)[^\\s$`;&|()<>'\\\"]+\\))|`|<<<|[<>]\\(|\\beval\\b|\\bbase64\\s+(?:-\\w*d\\w*|--decode)\\b|\\|\\s*(?:sudo\\s+)?(?:\\S*/)?(?:ba|da|z|k|c|tc|fi)?sh\\b|\\bsource\\s+/dev/stdin\\b|(?:^\\s*|[\\n;&|(]\\s*|\\bsudo\\s+)\\$\\{?[A-Za-z_]\\w*\\}?(?=[$\\s{;&|)]|$)",
   "flag": "contain hidden or generated commands",
   "words": "",
   "min_risk": "medium"
  }
 ]
}
