Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

附录 B:配置参考

本附录列出 OpenMatrix 的配置选项。

B.1 质量等级配置

strict 模式

{
  "quality": "strict",
  "tdd": true,
  "minCoverage": 80,
  "strictLint": true,
  "securityScan": true,
  "e2eTests": false,
  "aiReview": true
}

balanced 模式

{
  "quality": "balanced",
  "tdd": false,
  "minCoverage": 60,
  "strictLint": false,
  "securityScan": true,
  "e2eTests": false,
  "aiReview": true
}

fast 模式

{
  "quality": "fast",
  "tdd": false,
  "minCoverage": 0,
  "strictLint": false,
  "securityScan": false,
  "e2eTests": false,
  "aiReview": false
}

B.2 执行模式配置

interactive 模式

  • 每步确认
  • 全部审批
  • 适合学习和调试

semi-auto 模式

  • 关键点确认
  • 关键审批
  • 适合生产开发

full-auto 模式

  • 无交互
  • 无审批
  • 适合 CI/CD

B.3 质量门禁配置

{
  "gates": {
    "build": {
      "enabled": true,
      "command": "npm run build"
    },
    "test": {
      "enabled": true,
      "command": "npm test",
      "framework": "vitest"
    },
    "coverage": {
      "enabled": true,
      "threshold": {
        "line": 80,
        "function": 80,
        "branch": 70
      },
      "exclude": [
        "**/*.d.ts",
        "**/dist/**",
        "**/node_modules/**"
      ]
    },
    "lint": {
      "enabled": true,
      "command": "npm run lint",
      "strict": true,
      "ignore": [".git", "node_modules"]
    },
    "security": {
      "enabled": true,
      "command": "npm audit",
      "maxVulnerabilities": {
        "critical": 0,
        "high": 0,
        "moderate": 5
      }
    },
    "e2e": {
      "enabled": false,
      "command": "npm run e2e",
      "tool": "playwright"
    }
  }
}

B.4 Git 配置

{
  "git": {
    "autoCommit": true,
    "commitPrefix": true,
    "commitFormat": "<type>(TASK-XXX): <subject>",
    "types": ["feat", "fix", "test", "refactor", "docs", "chore"]
  }
}

B.5 重试配置

{
  "retry": {
    "maxRetries": 3,
    "backoffStrategy": "exponential",
    "baseDelay": 1000,
    "maxDelay": 30000
  }
}

B.6 超时配置

{
  "timeouts": {
    "tdd": {
      "low": 180000,
      "medium": 300000,
      "high": 600000
    },
    "develop": {
      "low": 300000,
      "medium": 600000,
      "high": 1200000
    },
    "verify": 300000,
    "accept": 180000
  }
}

B.7 存储配置

{
  "storage": {
    "basePath": ".openmatrix",
    "lockTimeout": 30000,
    "backup": {
      "enabled": true,
      "maxBackups": 5
    }
  }
}

B.8 完整配置示例

{
  "quality": "balanced",
  "mode": "semi-auto",
  "gates": {
    "build": { "enabled": true },
    "test": { "enabled": true },
    "coverage": {
      "enabled": true,
      "threshold": { "line": 60 }
    },
    "lint": { "enabled": true },
    "security": { "enabled": true }
  },
  "git": {
    "autoCommit": true
  },
  "retry": {
    "maxRetries": 3
  },
  "storage": {
    "basePath": ".openmatrix"
  }
}