{
  "name": "Dynamo-NTS CI/CD Pipeline",
  "outputDir": "./logs/cicd-pipeline",
  "timing": {
    "stepTimeout": "10m",
    "teeMaxRuntime": "10m",
    "stepCooldown": "1s"
  },
  "log": {
    "runtimeMaxBytes": 5242880,
    "trimCheckEveryN": 1000
  },
  "versionBump": {
    "enabled": false
  },
  "report": {
    "fileName": "cicd-report.json",
    "includeLogTail": true,
    "logTailLines": 10000,
    "includeStepLogs": false
  },
  "steps": [
    {
      "_comment": "FR-171 (2026-06-13) — auto-introspect ALL steps' condition.envSet + command ${VAR} refs. Reports PRESENT/MISSING env-vars + which downstream steps will silent-skip. Warning-only by default; fail-fast on the `requireSet` list. Goal: never again silent-skip discord/hot-update without surfacing the missing env at step #1.",
      "label": "validate-secrets",
      "type": "validate-secrets",
      "fatal": false,
      "discord": {
        "emoji": "🔐",
        "name": "Secrets Check",
        "group": "preflight",
        "groupName": "Pre-flight Check",
        "groupEmoji": "🔐"
      },
      "settings": {
        "requireSet": [
          "NPM_TOKEN"
        ]
      }
    },
    {
      "label": "discord-start",
      "command": "dc ci-dn-s '{\"appName\":\"Dynamo-NTS\",\"appEmoji\":\"💽\",\"commitMessage\":\"$COMMIT_MESSAGE\",\"branchName\":\"$GITHUB_REF_NAME\",\"author\":\"$GITHUB_ACTOR\",\"runNumber\":\"$GITHUB_RUN_NUMBER\",\"runId\":\"$GITHUB_RUN_ID\",\"repository\":\"$GITHUB_REPOSITORY\",\"eventName\":\"$GITHUB_EVENT_NAME\",\"eventDateTime\":\"$EVENT_DATETIME\"}'",
      "fatal": false,
      "discord": {
        "hide": true
      },
      "condition": {
        "envSet": [
          "DISCORD_WEBHOOK_ID"
        ]
      }
    },
    {
      "label": "pre-flight",
      "type": "pre-flight-check",
      "fatal": true,
      "discord": {
        "emoji": "🔐",
        "name": "Pre-flight Check",
        "group": "preflight",
        "groupName": "Pre-flight Check",
        "groupEmoji": "🔐"
      },
      "settings": {
        "requiredEnvVars": [
          "NPM_TOKEN"
        ]
      }
    },
    {
      "label": "install",
      "command": "pnpm i",
      "fatal": true,
      "discord": {
        "hide": true
      }
    },
    {
      "label": "check-dev-leftovers",
      "type": "check-dev-leftovers",
      "fatal": false,
      "discord": {
        "emoji": "🔍",
        "name": "Dev Leftovers Check",
        "group": "preflight"
      },
      "settings": {
        "checks": [
          {
            "type": "TSCONFIG_PATHS",
            "directory": "."
          },
          {
            "type": "PACKAGE_VERSIONS",
            "directory": ".",
            "packages": [
              "@futdevpro/fsm-dynamo"
            ]
          }
        ],
        "fix": true,
        "patchOnly": true
      }
    },
    {
      "label": "build",
      "command": "npx rimraf ./build && npx tsc",
      "fatal": true,
      "discord": {
        "emoji": "🏗️",
        "name": "Build",
        "group": "build-test",
        "groupName": "Build and Test",
        "groupEmoji": "🏗️"
      }
    },
    {
      "label": "test",
      "command": "npx jasmine",
      "fatal": true,
      "discord": {
        "emoji": "🧪",
        "name": "Tests",
        "group": "build-test"
      },
      "errorExcludePatterns": [
        "Error handleMessage: Error: Test error",
        "getDataByDependencyId failed, dependencyKey is missing"
      ]
    },
    {
      "label": "npm-publish",
      "type": "npm-publish",
      "fatal": false,
      "discord": {
        "emoji": "📦",
        "name": "NPM Publish"
      },
      "condition": {
        "branchMatch": [
          "master"
        ],
        "allPassed": [
          "build",
          "test"
        ]
      },
      "settings": {
        "directory": ".",
        "skipIfPublished": true,
        "retryAttempts": 3,
        "retryDelaySeconds": 30
      }
    },
    {
      "label": "pipeline-report",
      "command": "fdp pipeline-report --report ./logs/cicd-pipeline/cicd-report.json --overseer-secret $OVERSEER_SECRET_KEY --branch $GITHUB_REF_NAME",
      "fatal": false,
      "always": true,
      "discord": {
        "emoji": "📊",
        "name": "Build Report"
      },
      "condition": {
        "envSet": [
          "OVERSEER_SECRET_KEY"
        ]
      }
    },
    {
      "label": "discord-result",
      "command": "fdp pipeline-notify --report ./logs/cicd-pipeline/cicd-report.json --config ./pipeline.cicd.config.json --app-name Dynamo-NTS --app-emoji 💽 --webhook-id $DISCORD_WEBHOOK_ID --webhook-token $DISCORD_WEBHOOK_TOKEN",
      "fatal": false,
      "retryOnFail": 2,
      "retryDelaySec": 5,
      "always": true,
      "discord": {
        "hide": true
      },
      "condition": {
        "envSet": [
          "DISCORD_WEBHOOK_ID"
        ]
      }
    }
  ]
}
