@hongmaple0820/scale-engine 0.40.2 → 0.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. package/README.md +30 -2
  2. package/dist/api/cli.js +19 -0
  3. package/dist/api/cli.js.map +1 -1
  4. package/dist/api/quickstart.d.ts +11 -0
  5. package/dist/api/quickstart.js +98 -1
  6. package/dist/api/quickstart.js.map +1 -1
  7. package/dist/artifact/fsmDefinitions.js +15 -2
  8. package/dist/artifact/fsmDefinitions.js.map +1 -1
  9. package/dist/artifact/types.d.ts +1 -1
  10. package/dist/artifact/types.js.map +1 -1
  11. package/dist/cache/ScanCache.d.ts +41 -0
  12. package/dist/cache/ScanCache.js +120 -0
  13. package/dist/cache/ScanCache.js.map +1 -0
  14. package/dist/capabilities/BrowserQACapability.d.ts +14 -0
  15. package/dist/capabilities/BrowserQACapability.js +94 -0
  16. package/dist/capabilities/BrowserQACapability.js.map +1 -1
  17. package/dist/cli/autofixCommands.d.ts +22 -0
  18. package/dist/cli/autofixCommands.js +32 -0
  19. package/dist/cli/autofixCommands.js.map +1 -0
  20. package/dist/cli/cortexCommands.d.ts +71 -0
  21. package/dist/cli/cortexCommands.js +335 -0
  22. package/dist/cli/cortexCommands.js.map +1 -0
  23. package/dist/cli/costCommands.d.ts +13 -0
  24. package/dist/cli/costCommands.js +48 -0
  25. package/dist/cli/costCommands.js.map +1 -0
  26. package/dist/cli/orchCommands.d.ts +43 -0
  27. package/dist/cli/orchCommands.js +135 -0
  28. package/dist/cli/orchCommands.js.map +1 -0
  29. package/dist/cli/phaseCommands.js +1 -2
  30. package/dist/cli/phaseCommands.js.map +1 -1
  31. package/dist/cli/qaCommands.d.ts +22 -0
  32. package/dist/cli/qaCommands.js +84 -0
  33. package/dist/cli/qaCommands.js.map +1 -0
  34. package/dist/cli/quickstartCommands.d.ts +17 -0
  35. package/dist/cli/quickstartCommands.js +47 -0
  36. package/dist/cli/quickstartCommands.js.map +1 -0
  37. package/dist/cli/shieldCommands.d.ts +30 -0
  38. package/dist/cli/shieldCommands.js +212 -0
  39. package/dist/cli/shieldCommands.js.map +1 -0
  40. package/dist/cli/tuiCommands.d.ts +7 -0
  41. package/dist/cli/tuiCommands.js +33 -0
  42. package/dist/cli/tuiCommands.js.map +1 -0
  43. package/dist/config/profiles.js +26 -0
  44. package/dist/config/profiles.js.map +1 -1
  45. package/dist/cortex/GovernanceMetrics.d.ts +66 -0
  46. package/dist/cortex/GovernanceMetrics.js +230 -0
  47. package/dist/cortex/GovernanceMetrics.js.map +1 -0
  48. package/dist/cortex/InstinctExtractor.d.ts +61 -0
  49. package/dist/cortex/InstinctExtractor.js +184 -0
  50. package/dist/cortex/InstinctExtractor.js.map +1 -0
  51. package/dist/cortex/InstinctStore.d.ts +54 -0
  52. package/dist/cortex/InstinctStore.js +266 -0
  53. package/dist/cortex/InstinctStore.js.map +1 -0
  54. package/dist/cortex/ReflexionEngine.d.ts +34 -0
  55. package/dist/cortex/ReflexionEngine.js +157 -0
  56. package/dist/cortex/ReflexionEngine.js.map +1 -0
  57. package/dist/cortex/SessionInjector.d.ts +44 -0
  58. package/dist/cortex/SessionInjector.js +127 -0
  59. package/dist/cortex/SessionInjector.js.map +1 -0
  60. package/dist/cortex/adapters/ClaudeAdapter.d.ts +17 -0
  61. package/dist/cortex/adapters/ClaudeAdapter.js +61 -0
  62. package/dist/cortex/adapters/ClaudeAdapter.js.map +1 -0
  63. package/dist/cortex/adapters/CodexAdapter.d.ts +10 -0
  64. package/dist/cortex/adapters/CodexAdapter.js +52 -0
  65. package/dist/cortex/adapters/CodexAdapter.js.map +1 -0
  66. package/dist/cortex/adapters/CursorAdapter.d.ts +10 -0
  67. package/dist/cortex/adapters/CursorAdapter.js +46 -0
  68. package/dist/cortex/adapters/CursorAdapter.js.map +1 -0
  69. package/dist/cortex/adapters/GeminiAdapter.d.ts +11 -0
  70. package/dist/cortex/adapters/GeminiAdapter.js +48 -0
  71. package/dist/cortex/adapters/GeminiAdapter.js.map +1 -0
  72. package/dist/eval/BenchmarkPublisher.d.ts +25 -0
  73. package/dist/eval/BenchmarkPublisher.js +27 -0
  74. package/dist/eval/BenchmarkPublisher.js.map +1 -0
  75. package/dist/guardrails/DependencyAuditor.js +10 -1
  76. package/dist/guardrails/DependencyAuditor.js.map +1 -1
  77. package/dist/orchestrator/OrchestratorDaemon.d.ts +44 -0
  78. package/dist/orchestrator/OrchestratorDaemon.js +150 -0
  79. package/dist/orchestrator/OrchestratorDaemon.js.map +1 -0
  80. package/dist/orchestrator/PolicyLoader.d.ts +80 -0
  81. package/dist/orchestrator/PolicyLoader.js +229 -0
  82. package/dist/orchestrator/PolicyLoader.js.map +1 -0
  83. package/dist/orchestrator/ReconciliationLoop.d.ts +71 -0
  84. package/dist/orchestrator/ReconciliationLoop.js +266 -0
  85. package/dist/orchestrator/ReconciliationLoop.js.map +1 -0
  86. package/dist/orchestrator/TrackerAdapter.d.ts +60 -0
  87. package/dist/orchestrator/TrackerAdapter.js +147 -0
  88. package/dist/orchestrator/TrackerAdapter.js.map +1 -0
  89. package/dist/orchestrator/WorkspaceManager.d.ts +66 -0
  90. package/dist/orchestrator/WorkspaceManager.js +257 -0
  91. package/dist/orchestrator/WorkspaceManager.js.map +1 -0
  92. package/dist/qa/BrowserDaemon.d.ts +23 -0
  93. package/dist/qa/BrowserDaemon.js +79 -0
  94. package/dist/qa/BrowserDaemon.js.map +1 -0
  95. package/dist/qa/E2ETestOrchestrator.d.ts +14 -0
  96. package/dist/qa/E2ETestOrchestrator.js +19 -0
  97. package/dist/qa/E2ETestOrchestrator.js.map +1 -0
  98. package/dist/review/CrossModelReviewer.d.ts +35 -0
  99. package/dist/review/CrossModelReviewer.js +75 -0
  100. package/dist/review/CrossModelReviewer.js.map +1 -0
  101. package/dist/review/ReviewAggregator.d.ts +13 -0
  102. package/dist/review/ReviewAggregator.js +28 -0
  103. package/dist/review/ReviewAggregator.js.map +1 -0
  104. package/dist/review/reviewCommands.d.ts +15 -0
  105. package/dist/review/reviewCommands.js +24 -0
  106. package/dist/review/reviewCommands.js.map +1 -0
  107. package/dist/routing/LocalModelProvider.d.ts +11 -0
  108. package/dist/routing/LocalModelProvider.js +21 -0
  109. package/dist/routing/LocalModelProvider.js.map +1 -0
  110. package/dist/routing/ModelRouter.d.ts +12 -0
  111. package/dist/routing/ModelRouter.js +31 -4
  112. package/dist/routing/ModelRouter.js.map +1 -1
  113. package/dist/runtime/AiOsRuntime.d.ts +1 -0
  114. package/dist/runtime/AiOsRuntime.js +15 -0
  115. package/dist/runtime/AiOsRuntime.js.map +1 -1
  116. package/dist/runtime/CostAnalyzer.d.ts +53 -0
  117. package/dist/runtime/CostAnalyzer.js +160 -0
  118. package/dist/runtime/CostAnalyzer.js.map +1 -0
  119. package/dist/runtime/CostOptimizer.d.ts +11 -0
  120. package/dist/runtime/CostOptimizer.js +21 -0
  121. package/dist/runtime/CostOptimizer.js.map +1 -0
  122. package/dist/shield/PolicyCompiler.d.ts +70 -0
  123. package/dist/shield/PolicyCompiler.js +540 -0
  124. package/dist/shield/PolicyCompiler.js.map +1 -0
  125. package/dist/shield/ProtectedPaths.d.ts +39 -0
  126. package/dist/shield/ProtectedPaths.js +179 -0
  127. package/dist/shield/ProtectedPaths.js.map +1 -0
  128. package/dist/shield/ShieldProtocol.d.ts +50 -0
  129. package/dist/shield/ShieldProtocol.js +103 -0
  130. package/dist/shield/ShieldProtocol.js.map +1 -0
  131. package/dist/skills/SkillMdStandard.d.ts +33 -0
  132. package/dist/skills/SkillMdStandard.js +88 -0
  133. package/dist/skills/SkillMdStandard.js.map +1 -0
  134. package/dist/skills/SkillRegistry.d.ts +9 -1
  135. package/dist/skills/SkillRegistry.js +20 -0
  136. package/dist/skills/SkillRegistry.js.map +1 -1
  137. package/dist/skills/interop/GStackInterop.d.ts +15 -0
  138. package/dist/skills/interop/GStackInterop.js +34 -0
  139. package/dist/skills/interop/GStackInterop.js.map +1 -0
  140. package/dist/skills/interop/OMCInterop.d.ts +15 -0
  141. package/dist/skills/interop/OMCInterop.js +34 -0
  142. package/dist/skills/interop/OMCInterop.js.map +1 -0
  143. package/dist/tui/TuiDashboard.d.ts +3 -0
  144. package/dist/tui/TuiDashboard.js +120 -0
  145. package/dist/tui/TuiDashboard.js.map +1 -0
  146. package/dist/workflow/GateCatalog.d.ts +2 -0
  147. package/dist/workflow/GateCatalog.js +59 -3
  148. package/dist/workflow/GateCatalog.js.map +1 -1
  149. package/dist/workflow/GovernanceTemplatePacks.d.ts +1 -1
  150. package/dist/workflow/GovernanceTemplatePacks.js +15 -0
  151. package/dist/workflow/GovernanceTemplatePacks.js.map +1 -1
  152. package/dist/workflow/TddLoop.d.ts +2 -0
  153. package/dist/workflow/TddLoop.js +2 -0
  154. package/dist/workflow/TddLoop.js.map +1 -1
  155. package/dist/workflow/UpgradeManager.d.ts +10 -1
  156. package/dist/workflow/UpgradeManager.js +55 -0
  157. package/dist/workflow/UpgradeManager.js.map +1 -1
  158. package/dist/workflow/VerificationProfile.d.ts +8 -0
  159. package/dist/workflow/VerificationProfile.js +61 -0
  160. package/dist/workflow/VerificationProfile.js.map +1 -1
  161. package/dist/workflow/VerificationSchema.d.ts +46 -0
  162. package/dist/workflow/VerificationSchema.js +97 -0
  163. package/dist/workflow/VerificationSchema.js.map +1 -0
  164. package/dist/workflow/autofix/AutoFixEngine.d.ts +37 -0
  165. package/dist/workflow/autofix/AutoFixEngine.js +169 -0
  166. package/dist/workflow/autofix/AutoFixEngine.js.map +1 -0
  167. package/dist/workflow/execution/RalphEngine.d.ts +18 -0
  168. package/dist/workflow/execution/RalphEngine.js +22 -0
  169. package/dist/workflow/execution/RalphEngine.js.map +1 -1
  170. package/dist/workflow/gates/EnhancedGates.d.ts +74 -0
  171. package/dist/workflow/gates/EnhancedGates.js +653 -0
  172. package/dist/workflow/gates/EnhancedGates.js.map +1 -0
  173. package/dist/workflow/gates/GateSystem.d.ts +3 -0
  174. package/dist/workflow/gates/GateSystem.js +94 -1
  175. package/dist/workflow/gates/GateSystem.js.map +1 -1
  176. package/dist/workflow/types.d.ts +1 -1
  177. package/docs/README.md +3 -0
  178. package/docs/guides/DEVELOPMENT_WORKFLOW.md +28 -9
  179. package/docs/guides/GETTING_STARTED.md +19 -0
  180. package/docs/guides/MIGRATION.md +119 -0
  181. package/docs/workflow/GATES_AND_SCORE.md +34 -1
  182. package/docs/workflow/README.md +58 -10
  183. package/package.json +5 -17
  184. package/docs/ACTIVE_SECURITY_VISUAL_GATES.md +0 -87
  185. package/docs/AI_ENGINEERING_OS_POSITIONING.md +0 -607
  186. package/docs/BACKGROUND_HUNTER.md +0 -62
  187. package/docs/CODE_INTELLIGENCE.md +0 -180
  188. package/docs/CONTEXT_BUDGET.md +0 -165
  189. package/docs/DEPENDENCY_AUDIT.md +0 -118
  190. package/docs/EVOLUTION_SHADOW_MODE.md +0 -63
  191. package/docs/GITLAB_FLOW.md +0 -125
  192. package/docs/GOVERNANCE_DASHBOARD.md +0 -92
  193. package/docs/MEMORY_BRAIN.md +0 -104
  194. package/docs/MEMORY_FABRIC.md +0 -161
  195. package/docs/RESOURCE_GOVERNANCE.md +0 -92
  196. package/docs/RUNTIME_EVIDENCE.md +0 -101
  197. package/docs/WORKFLOW_EVAL.md +0 -151
  198. package/image/wechat-public.jpg +0 -0
  199. package/image/wxPay.jpg +0 -0
  200. package/image/zfb.jpg +0 -0
@@ -10,10 +10,11 @@ Use `scale gates status` to inspect the active gate catalog.
10
10
  scale gates status --json
11
11
  ```
12
12
 
13
- The report separates three concepts that were previously easy to confuse:
13
+ The report separates four concepts that were previously easy to confuse:
14
14
 
15
15
  - Core gates: `G0-G8`, used by workflow verification, preflight, and product smoke profiles.
16
16
  - Meta-governance gates: `G9-G15`, used by `scale meta-governance`.
17
+ - Enhanced gates: `G16-G22`, covering commit discipline, doc hygiene, runtime evidence, code review, supply chain, context budget, and session health.
17
18
  - Extension gates: policy-backed checks such as engineering standards, product smoke policy, and tool evidence.
18
19
 
19
20
  `scale gates status` is intentionally read-only. It does not execute checks; it explains which checks exist and which policies are blocking.
@@ -28,6 +29,38 @@ Architecture and engineering standards are driven by project configuration:
28
29
 
29
30
  Preflight now uses changed-file standards scope when the target is inside a Git worktree. Non-Git projects keep the old full-scan behavior so bootstrap and fixture projects still get complete feedback.
30
31
 
32
+ ## Enhanced Gates (G16-G22)
33
+
34
+ Added in v0.41.0, these gates cover commit discipline, runtime quality, and session hygiene:
35
+
36
+ | Gate | Name | Blocking | Description |
37
+ | --- | --- | --- | --- |
38
+ | G16 | Commit Discipline | ✅ | Uncommitted file count (warn=10, block=25), time since last commit (warn=60min, block=180min), staged files >1MB, whitespace errors |
39
+ | G17 | Documentation Hygiene | — | Changed markdown files must have valid internal links |
40
+ | G18 | Runtime Evidence | ✅ | Task must have recorded runtime evidence with matching exit codes |
41
+ | G19 | Code Review | ✅ (L/CRITICAL) | L and CRITICAL tasks require reviewed changes with resolved findings |
42
+ | G20 | Supply Chain | ✅ | No CRITICAL/HIGH vulnerabilities; lock file must be consistent |
43
+ | G21 | Context Budget | — | Advisory check on context token usage against configured budget |
44
+ | G22 | Session Health | — | Advisory check on stale worktrees and session state consistency |
45
+
46
+ Run enhanced gates individually:
47
+
48
+ ```bash
49
+ bash scripts/gates/G16-verify.sh # Commit Discipline
50
+ bash scripts/gates/G17-verify.sh # Documentation Hygiene
51
+ bash scripts/gates/G18-verify.sh # Runtime Evidence
52
+ bash scripts/gates/G19-verify.sh # Code Review
53
+ bash scripts/gates/G20-verify.sh # Supply Chain
54
+ bash scripts/gates/G21-verify.sh # Context Budget
55
+ bash scripts/gates/G22-verify.sh # Session Health
56
+ ```
57
+
58
+ Or run all gates including enhanced:
59
+
60
+ ```bash
61
+ bash scripts/gates/all.sh --all
62
+ ```
63
+
31
64
  ## Task Score
32
65
 
33
66
  Use `scale score task` to produce an algorithmic completion score.
@@ -23,6 +23,25 @@ scale score task --changed --json
23
23
  scale prompt optimize --input "raw coding request" --json
24
24
  ```
25
25
 
26
+ ### SCALE 2.0 引擎命令
27
+
28
+ ```bash
29
+ # Scale Shield — 钩子拦截
30
+ scale shield compile # 编译策略 + 安装 hook
31
+ scale shield status # 验证 hook 注册 + .scale/ 完整性
32
+ scale shield test # 运行 allow/block 测试
33
+
34
+ # Scale Orchestrator — 编排守护进程
35
+ scale orch start # 启动 daemon
36
+ scale orch status # 查看状态 + workspace 列表
37
+
38
+ # Scale Cortex — 持续进化
39
+ scale cortex evolve # 完整进化周期
40
+ scale cortex extract # 提取 Instincts
41
+ scale cortex inject --minimal # 预览 SessionStart 注入
42
+ scale cortex metrics --days 30 # 治理 ROI 报告
43
+ ```
44
+
26
45
  PowerShell:
27
46
 
28
47
  ```powershell
@@ -35,16 +54,45 @@ See [PROMPT_OPTIMIZATION.md](PROMPT_OPTIMIZATION.md) for the deterministic promp
35
54
 
36
55
  ## 门禁说明
37
56
 
38
- | Gate | 作用 |
39
- | --- | --- |
40
- | G1 | 探索是否记录到状态文件,且至少读了 3 个文件 |
41
- | G2 | 计划是否包含边界、异常、回滚、现实校验 |
42
- | G3 | `src/` 行为改动是否伴随测试改动 |
43
- | G4 | workflow 脚本是否可解析 |
44
- | G5 | `lint + typecheck + test + build` 是否通过 |
45
- | G6 | 任务证据和 `git diff --check` 是否通过 |
46
- | G7 | 安全面是否通过 |
47
- | G8 | Markdown 与工作流文档是否符合基础卫生规则 |
57
+ SCALE 2.0 23 个门禁,分三层:核心门禁(G0-G8)、元治理门禁(G9-G15)、增强门禁(G16-G22)。
58
+
59
+ ### 核心门禁(G0-G8)
60
+
61
+ | Gate | 作用 | 默认 | 阻断 |
62
+ | --- | | --- | --- |
63
+ | G0 | 构建命令或配置的验证命令必须通过 | | |
64
+ | G1 | 探索是否记录到状态文件,且至少读了 3 个文件 | | — |
65
+ | G2 | 计划是否包含边界、异常、回滚、现实校验 | ✅ | — |
66
+ | G3 | `src/` 行为改动是否伴随测试改动 | ✅ | ✅ |
67
+ | G4 | lint 命令必须通过 | ✅ | ✅ |
68
+ | G5 | 测试命令必须通过 | ✅ | ✅ |
69
+ | G6 | 覆盖率、任务证据和 diff hygiene 必须满足当前 profile | profile | ✅ |
70
+ | G7 | 安全和依赖风险检查必须通过 | profile | ✅ |
71
+ | G8 | 产品冒烟命令必须通过 | profile | ✅ |
72
+
73
+ ### 元治理门禁(G9-G15)
74
+
75
+ | Gate | 作用 | 默认 | 阻断 |
76
+ | --- | | --- | --- |
77
+ | G9 | 知识库和 recall 能力是否被使用 | ✅ | — |
78
+ | G10 | 改进候选是否有证据支撑 | — | — |
79
+ | G11 | 护栏结果是否可见且可操作 | ✅ | — |
80
+ | G12 | 工作流阶段和制品是否完整 | ✅ | — |
81
+ | G13 | 多 Agent 协作是否有协调证据 | — | — |
82
+ | G14 | 必需 skill 是否被选择和验证 | — | — |
83
+ | G15 | 经验教训是否安全进入学习循环 | — | — |
84
+
85
+ ### 增强门禁(G16-G22)
86
+
87
+ | Gate | 作用 | 默认 | 阻断 |
88
+ | --- | | --- | --- |
89
+ | G16 | 未提交文件数量和大文件阈值检查 | ✅ | ✅ |
90
+ | G17 | 变更的文档链接有效性检查 | ✅ | — |
91
+ | G18 | 运行时证据记录和退出码匹配 | ✅ | ✅ |
92
+ | G19 | L/CRITICAL 任务需要代码审查记录 | profile | ✅ |
93
+ | G20 | 无 CRITICAL/HIGH 漏洞;lock 文件一致性 | ✅ | ✅ |
94
+ | G21 | 上下文 token 预算检查(advisory) | ✅ | — |
95
+ | G22 | 会话健康检查:worktree 泄露和状态一致性 | ✅ | — |
48
96
 
49
97
  ## 分支策略
50
98
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hongmaple0820/scale-engine",
3
- "version": "0.40.2",
3
+ "version": "0.43.0",
4
4
  "description": "Executable AI agent governance with workflow gates, evidence, skill/tool orchestration, and traceable HTML artifacts",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,28 +25,13 @@
25
25
  "files": [
26
26
  "dist",
27
27
  "docs/README.md",
28
- "docs/AI_ENGINEERING_OS_POSITIONING.md",
29
- "docs/CODE_INTELLIGENCE.md",
30
- "docs/CONTEXT_BUDGET.md",
31
- "docs/BACKGROUND_HUNTER.md",
32
- "docs/DEPENDENCY_AUDIT.md",
33
- "docs/ACTIVE_SECURITY_VISUAL_GATES.md",
34
- "docs/EVOLUTION_SHADOW_MODE.md",
35
- "docs/WORKFLOW_EVAL.md",
36
28
  "docs/SKILL_RADAR.md",
37
29
  "docs/SKILL-REPOSITORY.md",
38
- "docs/THIRD_PARTY_SKILLS.md",
39
30
  "docs/EXTERNAL_REFERENCES.md",
40
- "docs/MEMORY_BRAIN.md",
41
- "docs/GOVERNANCE_DASHBOARD.md",
42
- "docs/GITLAB_FLOW.md",
43
- "docs/MEMORY_FABRIC.md",
44
- "docs/RUNTIME_EVIDENCE.md",
45
- "docs/RESOURCE_GOVERNANCE.md",
31
+ "docs/THIRD_PARTY_SKILLS.md",
46
32
  "docs/guides",
47
33
  "docs/start",
48
34
  "docs/workflow",
49
- "image",
50
35
  "examples/demo-projects/agent-governance-demo",
51
36
  "scripts/workflow/lib",
52
37
  "scripts/workflow/setup-smoke.mjs",
@@ -89,6 +74,9 @@
89
74
  "type-is": "2.0.1",
90
75
  "qs": "6.15.2"
91
76
  },
77
+ "optionalDependencies": {
78
+ "playwright": "^1.50.0"
79
+ },
92
80
  "devDependencies": {
93
81
  "@types/better-sqlite3": "^7.6.0",
94
82
  "@types/js-yaml": "^4.0.9",
@@ -1,87 +0,0 @@
1
- # Active Security And Visual Gates
2
-
3
- SCALE V2 adds two optional verification layers for projects that can provide a runnable local target:
4
-
5
- - `ActiveRedTeam`: bounded dynamic security probes for configured HTTP targets.
6
- - `VisualGate`: structured visual review evidence for UI routes and UI specs.
7
-
8
- Both are conditional. A library or backend project with no runtime target should not pay the cost.
9
-
10
- ## Active Security
11
-
12
- Active security is configured under `.scale/verification.json`:
13
-
14
- ```json
15
- {
16
- "security": {
17
- "active": {
18
- "enabled": true,
19
- "baseUrl": "http://localhost:3000",
20
- "startCommand": "npm run dev",
21
- "targets": ["/api/login", "/api/users"],
22
- "timeoutMs": 5000,
23
- "maxRequests": 20
24
- }
25
- }
26
- }
27
- ```
28
-
29
- Behavior:
30
-
31
- - missing or disabled config returns `SKIPPED`
32
- - invalid enabled config returns `FAILED` before sending probes
33
- - probes are capped by `maxRequests`
34
- - every request has a timeout
35
- - reflected probe payloads are `HIGH` findings and block
36
- - request errors and server errors are recorded as findings, but only configured blocker severity should fail the gate
37
-
38
- The first implementation exposes `runActiveRedTeam()` as a library API. It does not start a server by itself yet. CLI orchestration can wire `startCommand` later, but startup failure must become a `FAILED` result when that runner is added.
39
-
40
- ## Visual Gate
41
-
42
- Visual verification is configured under `.scale/verification.json`:
43
-
44
- ```json
45
- {
46
- "visual": {
47
- "enabled": true,
48
- "baseUrl": "http://localhost:5173",
49
- "specPath": "docs/ui/UI-SPEC.md",
50
- "routes": ["/", "/settings"],
51
- "reportPath": "docs/worklog/tasks/TASK-123/visual-report.json",
52
- "blockingSeverities": ["critical", "high"]
53
- }
54
- }
55
- ```
56
-
57
- `VisualGate` consumes a structured report:
58
-
59
- ```json
60
- {
61
- "screenshots": [
62
- { "route": "/", "path": "screenshots/home.png" }
63
- ],
64
- "findings": [
65
- {
66
- "severity": "high",
67
- "route": "/",
68
- "message": "Primary action overlaps the navigation bar.",
69
- "evidence": "overlap ratio 0.42"
70
- }
71
- ]
72
- }
73
- ```
74
-
75
- Behavior:
76
-
77
- - missing or disabled config passes with a `Visual gate skipped` evidence item
78
- - enabled config requires `baseUrl`, `specPath`, `routes`, and `reportPath`
79
- - missing or invalid visual report fails
80
- - default blockers are `critical` and `high`
81
- - VLM comments may be recorded in the report, but the gate blocks only on structured severity thresholds
82
-
83
- ## Gate Numbering
84
-
85
- `VisualGate` uses `G9` when explicitly registered. It is not registered by default because meta governance also uses the G9-G15 range. Projects should register it only in UI verification profiles or dedicated task flows.
86
-
87
- Active security remains a security sub-check instead of a fractional gate number. It belongs under the broader G7 security lifecycle when wired into a concrete workflow.