@hongmaple0820/scale-engine 0.38.0 → 0.40.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 (87) hide show
  1. package/README.md +15 -0
  2. package/dist/api/cli.js +142 -40
  3. package/dist/api/cli.js.map +1 -1
  4. package/dist/api/doctor.js +1 -1
  5. package/dist/api/doctor.js.map +1 -1
  6. package/dist/bootstrap/DependencyBootstrap.d.ts +22 -1
  7. package/dist/bootstrap/DependencyBootstrap.js +427 -33
  8. package/dist/bootstrap/DependencyBootstrap.js.map +1 -1
  9. package/dist/bootstrap/DependencyBootstrapRenderer.d.ts +3 -0
  10. package/dist/bootstrap/DependencyBootstrapRenderer.js +140 -0
  11. package/dist/bootstrap/DependencyBootstrapRenderer.js.map +1 -0
  12. package/dist/cli/gateStatusCommands.d.ts +1 -0
  13. package/dist/cli/gateStatusCommands.js +52 -0
  14. package/dist/cli/gateStatusCommands.js.map +1 -0
  15. package/dist/cli/phaseCommands.js +15 -3
  16. package/dist/cli/phaseCommands.js.map +1 -1
  17. package/dist/cli/promptCommands.d.ts +1 -0
  18. package/dist/cli/promptCommands.js +57 -0
  19. package/dist/cli/promptCommands.js.map +1 -0
  20. package/dist/cli/scoreCommands.d.ts +1 -0
  21. package/dist/cli/scoreCommands.js +112 -0
  22. package/dist/cli/scoreCommands.js.map +1 -0
  23. package/dist/codegraph/CodeIntelligence.js +1 -1
  24. package/dist/codegraph/CodeIntelligence.js.map +1 -1
  25. package/dist/context/SessionStartSequence.js +13 -4
  26. package/dist/context/SessionStartSequence.js.map +1 -1
  27. package/dist/core/ExternalCommand.js +18 -4
  28. package/dist/core/ExternalCommand.js.map +1 -1
  29. package/dist/env/EnvironmentDoctor.d.ts +66 -0
  30. package/dist/env/EnvironmentDoctor.js +365 -0
  31. package/dist/env/EnvironmentDoctor.js.map +1 -0
  32. package/dist/i18n/Language.d.ts +9 -0
  33. package/dist/i18n/Language.js +38 -0
  34. package/dist/i18n/Language.js.map +1 -0
  35. package/dist/index.d.ts +1 -0
  36. package/dist/index.js +1 -0
  37. package/dist/index.js.map +1 -1
  38. package/dist/memory/MemoryProviders.d.ts +8 -0
  39. package/dist/memory/MemoryProviders.js +217 -16
  40. package/dist/memory/MemoryProviders.js.map +1 -1
  41. package/dist/prompts/PromptOptimizer.d.ts +42 -0
  42. package/dist/prompts/PromptOptimizer.js +309 -0
  43. package/dist/prompts/PromptOptimizer.js.map +1 -0
  44. package/dist/setup/SetupWizard.d.ts +42 -0
  45. package/dist/setup/SetupWizard.js +156 -0
  46. package/dist/setup/SetupWizard.js.map +1 -0
  47. package/dist/skills/SkillRepository.js +2 -2
  48. package/dist/skills/SkillRepository.js.map +1 -1
  49. package/dist/testing/DiffTestSelector.js +1 -1
  50. package/dist/testing/DiffTestSelector.js.map +1 -1
  51. package/dist/tools/ToolCapabilityRegistry.d.ts +4 -0
  52. package/dist/tools/ToolCapabilityRegistry.js +11 -6
  53. package/dist/tools/ToolCapabilityRegistry.js.map +1 -1
  54. package/dist/workflow/CommitDiscipline.js +8 -7
  55. package/dist/workflow/CommitDiscipline.js.map +1 -1
  56. package/dist/workflow/CrossRepoOrchestrator.js +15 -7
  57. package/dist/workflow/CrossRepoOrchestrator.js.map +1 -1
  58. package/dist/workflow/GateCatalog.d.ts +61 -0
  59. package/dist/workflow/GateCatalog.js +212 -0
  60. package/dist/workflow/GateCatalog.js.map +1 -0
  61. package/dist/workflow/GovernanceTemplatePacks.js +19 -4
  62. package/dist/workflow/GovernanceTemplatePacks.js.map +1 -1
  63. package/dist/workflow/SessionPreamble.js +7 -2
  64. package/dist/workflow/SessionPreamble.js.map +1 -1
  65. package/dist/workflow/TaskScoreEngine.d.ts +42 -0
  66. package/dist/workflow/TaskScoreEngine.js +181 -0
  67. package/dist/workflow/TaskScoreEngine.js.map +1 -0
  68. package/dist/workflow/WorkspaceTopology.d.ts +3 -0
  69. package/dist/workflow/WorkspaceTopology.js +40 -3
  70. package/dist/workflow/WorkspaceTopology.js.map +1 -1
  71. package/dist/workflow/gates/GateSystem.js +2 -2
  72. package/dist/workflow/gates/GateSystem.js.map +1 -1
  73. package/dist/workflow/index.d.ts +2 -0
  74. package/dist/workflow/index.js +2 -0
  75. package/dist/workflow/index.js.map +1 -1
  76. package/docs/CODE_INTELLIGENCE.md +27 -2
  77. package/docs/MEMORY_FABRIC.md +22 -1
  78. package/docs/THIRD_PARTY_SKILLS.md +50 -1
  79. package/docs/guides/GETTING_STARTED.md +24 -0
  80. package/docs/start/quickstart.md +103 -76
  81. package/docs/workflow/GATES_AND_SCORE.md +56 -0
  82. package/docs/workflow/PROMPT_OPTIMIZATION.md +44 -0
  83. package/docs/workflow/README.md +7 -0
  84. package/docs/workflow/node-library.md +3 -3
  85. package/package.json +12 -5
  86. package/scripts/workflow/provider-rehearsal.mjs +516 -0
  87. package/scripts/workflow/setup-smoke.mjs +299 -0
@@ -1,12 +1,15 @@
1
1
  # 3 分钟快速开始
2
2
 
3
- 目标:在一个空目录中安装 SCALE 治理工作流,并看到可验证的项目产物。
3
+ 目标:在一个项目里安装 SCALE 工作流,完成依赖检查,并看到可验证的治理产物。
4
4
 
5
5
  ## 前置条件
6
6
 
7
- - Node.js 20 或更高版本。
8
- - 已安装 npm
9
- - Windows PowerShell、Git Bash、macOS/Linux shell 都可以执行。
7
+ - Node.js 20+
8
+ - npm
9
+ - Git
10
+ - Windows PowerShell、Git Bash、macOS/Linux shell 均可
11
+
12
+ Python、Bun、Rust/Cargo、uv/pipx 不是启动 SCALE 的硬要求。只有启用 Graphify、GBrain、RTK 等第三方能力时,安装器才会提示缺少哪些运行时以及可执行的修复命令。
10
13
 
11
14
  ## 1. 安装 CLI
12
15
 
@@ -15,13 +18,13 @@ npm install -g @hongmaple0820/scale-engine
15
18
  scale --version
16
19
  ```
17
20
 
18
- 如果你在开发 `scale-engine` 本仓库,也可以用本地构建后的命令:
21
+ 本仓库开发时也可以直接运行源码入口:
19
22
 
20
23
  ```bash
21
- node E:/project/scale-engine/dist/api/cli.js --help
24
+ node --import tsx E:/project/scale-engine/src/api/cli.ts --help
22
25
  ```
23
26
 
24
- ## 2. 初始化一个空项目
27
+ ## 2. 初始化项目
25
28
 
26
29
  ```bash
27
30
  mkdir scale-demo
@@ -29,56 +32,93 @@ cd scale-demo
29
32
  scale init --governance-pack standard
30
33
  ```
31
34
 
32
- 这一步会生成:
35
+ 初始化会生成 `.scale/`、`docs/`、`scripts/` 以及对应 Agent 入口文件。已有项目升级不要盲目重跑 `init`,优先使用:
36
+
37
+ ```bash
38
+ scale upgrade check --dir . --lang zh
39
+ scale upgrade plan --dir . --html --lang zh
40
+ ```
41
+
42
+ ## 3. 交互式安装第三方能力
43
+
44
+ 默认输出语言是中文。需要英文时加 `--lang en`,也可以设置 `SCALE_LANG=en`。
45
+
46
+ 推荐先只查看计划:
47
+
48
+ ```bash
49
+ scale setup --pack full
50
+ ```
33
51
 
34
- ```text
35
- .scale/
36
- docs/
37
- scripts/
38
- AGENTS.md 或对应 Agent 入口文档
52
+ 确认后安装:
53
+
54
+ ```bash
55
+ scale setup --pack full --yes
56
+ ```
57
+
58
+ 机器可读输出:
59
+
60
+ ```bash
61
+ scale setup --pack full --json
62
+ ```
63
+
64
+ `setup` 和 `bootstrap deps` 都会输出 `runtimeChecks`。如果机器缺少 `python`、`bun`、`cargo`、`uv/pipx`、`node/npm/npx`,会先显示缺失项和修复建议,再决定是否执行 `--yes` 或 `--apply`,避免安装中途卡住。
65
+
66
+ 记忆供应商可以在安装入口直接切换,不需要手改 `.scale/memory-providers.json`:
67
+
68
+ ```bash
69
+ scale setup --pack memory --memory-provider scale-local --json
70
+ scale setup --pack memory --memory-provider gbrain --memory-mode external-first --json
39
71
  ```
40
72
 
41
- 重点看这些文件:
73
+ 第三方能力的职责边界:
42
74
 
43
- | 文件 | 用途 |
44
- | --- | --- |
45
- | `.scale/verification.json` | 本地验证 profile 和服务矩阵 |
46
- | `.scale/skills.json` | Agent 应该如何选择 skills,以及哪些需要证据 |
47
- | `.scale/tools.json` | CLI、MCP、浏览器、桌面自动化等工具使用策略 |
48
- | `.scale/resource-policy.json` | 文档、报告、截图、脚本、临时产物的生命周期规则 |
49
- | `.scale/engineering-standards.json` | 日志、安全、ORM、框架、测试、部署等工程规范 |
50
- | `docs/workflow/templates/` | M/L 任务使用的标准 artifact 模板 |
75
+ | 能力 | 默认定位 | 关键验证 |
76
+ | --- | --- | --- |
77
+ | `awesome-design-md` | 品牌、视觉语言、`DESIGN.md` 来源 | 是否同步上游 DESIGN.md catalog |
78
+ | `ui-ux-pro-max` | UX、状态、可访问性、响应式验收 | 是否通过官方 `uipro-cli` 安装 |
79
+ | `frontend-design` | 可选实现灵感,不再是 UI 默认必装项 | 需要时显式 `--include frontend-design` |
80
+ | `rtk` | CLI proxy/token 节省能力 | `rtk gain` 和 `rtk init -g --codex` |
81
+ | `gbrain` | 默认记忆供应商 | 检查 brain 是否已配置且连接/schema 可用,未初始化会提示 `gbrain init --pglite` |
82
+ | `graphify` | 知识图谱产物供应商 | `graphify install --platform codex` 和 `graphify-out/graph.json` |
83
+ | `codegraph` | 代码结构索引供应商 | `codegraph init -i` 和 `.codegraph/` |
51
84
 
52
- ## 3. 跑第一轮本地检查
85
+ 低层命令仍可直接使用:
86
+
87
+ ```bash
88
+ scale bootstrap deps --profile advanced --governance-pack frontend-app --lang zh
89
+ scale bootstrap deps --profile advanced --governance-pack frontend-app --apply --lang zh
90
+ ```
91
+
92
+ ## 4. 验证闭环
53
93
 
54
94
  ```bash
55
- scale bootstrap deps --pack external-cli --json
56
95
  scale doctor
57
96
  scale preflight --preflight-profile quick
58
97
  scale status
59
98
  scale assets scan --dir .
60
99
  scale standards scan --dir .
61
100
  scale runtime doctor --level S
101
+ scale memory provider status --json
102
+ scale codegraph status --json
62
103
  ```
63
104
 
64
- 预期效果:
65
-
66
- - `preflight` 能说明当前治理文件是否完整。
67
- - `bootstrap deps` 会告诉你第三方 skills、RTK、记忆/知识图谱依赖哪些已经装好,哪些只是治理规则已经生成。
68
- - `status` 会告诉 Agent 下一步应该做什么。
69
- - `assets scan` 会把文档、模板、脚本、报告等资源分类。
70
- - `standards scan` 会扫描日志噪音、敏感信息、危险输入、测试和架构风险。
71
- - `runtime doctor` 会检查本地运行时证据目录和最终交付证据状态。
72
-
73
- 建议再跑一次 `scale doctor`。现在它会按当前 profile 输出 `bootstrap` 建议,并把 `gbrain / codegraph / graphify` 的状态一起列出来。
105
+ 未运行验证,不要声称通过。`setup --json` 和 `bootstrap deps --json` 只代表依赖计划可解析,不等于第三方服务已经可用。
74
106
 
75
- 如果你确认要补环境依赖,再显式执行安装:
107
+ 真实第三方能力需要单独跑回放验证。默认命令会把未配置的远端能力标记为 `blocked`,但不会让本地发布门禁误失败;需要作为强制门禁时使用对应 npm script 或加 `--require-*`。
76
108
 
77
109
  ```bash
78
- scale bootstrap deps --profile advanced --governance-pack frontend-app --apply
110
+ npm run smoke:providers
111
+ npm run smoke:gbrain
112
+ npm run smoke:graphify -- --large-project /path/to/large-project
79
113
  ```
80
114
 
81
- ## 4. 建立第一个任务上下文
115
+ 验证语义:
116
+
117
+ - `smoke:gbrain` 会先确认 gbrain 已配置且召回关键健康检查可用,通过后写入一个临时记忆页,再用独立 CLI 进程 `get/query/search` 回放,证明不是本地 mock。
118
+ - `smoke:graphify` 默认对真实项目执行 `graphify update <project> --no-cluster`,走 AST/Python 无模型路径,检查 `graph.json`,再执行 `graphify query`;只有显式 `--semantic-extract` 才允许语义模型提取。
119
+ - `graphify-out/` 是生成产物,不应该提交到 Git;长期知识沉淀应进入经过评审的 `memory/`、docs 或规则文件。
120
+
121
+ ## 5. 建立任务上下文
82
122
 
83
123
  ```bash
84
124
  scale context init --name "Scale Demo"
@@ -88,14 +128,7 @@ scale diagnose plan --task-id 2026-05-18-oauth-hardening --symptom "callback 在
88
128
  scale tdd slice --task-id 2026-05-18-oauth-hardening --behavior "拒绝过期 OAuth state" --public-interface "GET /oauth/callback" --failing-test "expired state returns 401" --test-file tests/oauth.test.ts --impl-files src/oauth.ts
89
129
  ```
90
130
 
91
- 这些命令的目的不是替代人类判断,而是把 Agent 必须做的思考显式记录下来:
92
-
93
- - `context grill`:逼 Agent 先澄清上下文、成功标准和风险。
94
- - `diagnose plan`:遇到问题先诊断,不允许盲修。
95
- - `tdd slice`:把行为、公共接口、失败测试和实现文件绑定成一个可检查切片。
96
- - `runtime start`:建立会话 ledger,后续命令、工具和验证证据可以绑定到同一个任务。
97
-
98
- 完成真实验证后记录运行时证据:
131
+ 任务完成后记录验证证据并沉淀候选经验:
99
132
 
100
133
  ```bash
101
134
  scale runtime record --title "quick preflight" --kind command --status passed --command "scale preflight --preflight-profile quick" --exit-code 0 --summary "quick preflight passed"
@@ -104,51 +137,45 @@ scale memory pack --task-id 2026-05-18-oauth-hardening --session-id 2026-05-18-o
104
137
  scale memory settle --task-id 2026-05-18-oauth-hardening --session-id 2026-05-18-oauth-hardening --task "继续加固 OAuth callback" --level M
105
138
  ```
106
139
 
107
- `memory pack` 用来恢复上下文,`memory settle` 用来在任务结束后生成学习候选。候选位于 `.scale/memory/learning-candidates/`,默认本地保留,确认稳定后再人工提升到知识库、规范或模块文档。
140
+ `memory settle` 默认只生成学习候选,不会自动把一次会话判断提升成长线规则。存在失败证据时,候选会要求先解决失败,避免把未闭环问题沉淀成经验。
141
+
142
+ ## 6. MOE/多仓工作区
108
143
 
109
- ## 5. 生成 HTML 交付视图
144
+ 多仓项目使用:
110
145
 
111
146
  ```bash
112
- scale artifact render --task-id 2026-05-18-oauth-hardening --artifact-dir docs/worklog/tasks/2026-05-18-oauth-hardening
113
- scale artifact doctor --artifact-dir docs/worklog/tasks/2026-05-18-oauth-hardening
114
- scale artifact open --task-id 2026-05-18-oauth-hardening --artifact-dir docs/worklog/tasks/2026-05-18-oauth-hardening
147
+ scale init --governance-pack moe-workspace
115
148
  ```
116
149
 
117
- 规则:
150
+ MOE 默认把子工程配置为兄弟仓库或绝对路径,不建议把独立 Git 子工程放在主工程根目录下。`.scale/workspace.json` 中的典型写法:
118
151
 
119
- - Markdown 是长期维护源文件。
120
- - HTML 是给评审、对比、状态汇报、交付和发版使用的可视化产物。
121
- - `artifact doctor` 会检查 HTML 是否可追溯、是否引用远程资源、是否可能包含敏感信息。
152
+ ```json
153
+ {
154
+ "topology": "moe",
155
+ "repositories": [
156
+ { "name": "root", "path": ".", "role": "root", "required": true },
157
+ { "name": "api", "path": "../api", "role": "external", "required": true, "remote": "origin" }
158
+ ]
159
+ }
160
+ ```
122
161
 
123
- ## 6. 下一步
162
+ 这样可以避免子工程 Git 状态、分支、提交和主工程互相污染。
124
163
 
125
- 如果你只是试用,到这里已经能看到 SCALE 的价值:它把 Agent 的工作过程变成了可以审计的证据链。
164
+ ## 7. 安装烟测
126
165
 
127
- 如果你要接入真实项目,按项目类型选择 governance pack:
166
+ 仓库开发和发版前可以一键验证安装入口:
128
167
 
129
168
  ```bash
130
- scale init --governance-pack node-library
131
- scale init --governance-pack frontend-app
132
- scale init --governance-pack go-service-matrix
133
- scale init --governance-pack moe-workspace
134
- scale init --governance-pack resource-governance
169
+ npm run smoke:setup
170
+ npm run smoke:providers
171
+ make setup-smoke
135
172
  ```
136
173
 
137
- 已有项目升级工作流时不要盲目重跑 `scale init`。先走受保护的升级链路:
174
+ `smoke:setup` 只验证安装计划、双语输出、运行时依赖诊断、记忆供应商切换和 CodeGraph/Graphify 状态路径,不会执行真实第三方安装。
175
+ `smoke:providers` 会执行真实供应商回放;未配置 gbrain 或 graphify 时输出 `blocked` 和修复命令,只有 `smoke:gbrain`/`smoke:graphify` 或显式 `--require-*` 才会失败退出。
138
176
 
139
- ```bash
140
- scale upgrade check --dir . --lang zh
141
- scale upgrade plan --dir . --html --lang zh
142
- scale upgrade apply --dir . --confirm --lang zh
143
- ```
144
-
145
- 如果升级计划提示 AI OS runtime 尚未接入,用一键接入命令生成运行态目录、首份 dry-run、benchmark 和 doctor 报告:
177
+ 遇到跨系统命令兼容、PATH 或运行时依赖问题时,先导出环境诊断:
146
178
 
147
179
  ```bash
148
- scale ai-os adopt --dir . --task "接入 AI OS runtime" --lang zh
180
+ scale doctor env --json
149
181
  ```
150
-
151
- 需要英文输出时把 `--lang zh` 换成 `--lang en`。干净的 SCALE 受管文件可以自动刷新;已有本地改动的文件会进入人工审阅,不会被自动覆盖。
152
-
153
- 继续阅读 [官方 Demo Walkthrough](agent-governance-demo.md),看一个真实任务如何从需求到验证证据。
154
-
@@ -0,0 +1,56 @@
1
+ # Gates and Task Score
2
+
3
+ This document records the first deterministic optimization layer for gate visibility, architecture conformance, and task scoring.
4
+
5
+ ## Gate Status
6
+
7
+ Use `scale gates status` to inspect the active gate catalog.
8
+
9
+ ```bash
10
+ scale gates status --json
11
+ ```
12
+
13
+ The report separates three concepts that were previously easy to confuse:
14
+
15
+ - Core gates: `G0-G8`, used by workflow verification, preflight, and product smoke profiles.
16
+ - Meta-governance gates: `G9-G15`, used by `scale meta-governance`.
17
+ - Extension gates: policy-backed checks such as engineering standards, product smoke policy, and tool evidence.
18
+
19
+ `scale gates status` is intentionally read-only. It does not execute checks; it explains which checks exist and which policies are blocking.
20
+
21
+ ## Architecture Standards Gate
22
+
23
+ Architecture and engineering standards are driven by project configuration:
24
+
25
+ - `.scale/verification.json` controls whether `engineeringStandardsGate` is `off`, `warn`, or `block`.
26
+ - `.scale/engineering-standards.json` controls standards rules and baselines.
27
+ - `.scale/frameworks.json` records project-specific framework and architecture conventions.
28
+
29
+ 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
+ ## Task Score
32
+
33
+ Use `scale score task` to produce an algorithmic completion score.
34
+
35
+ ```bash
36
+ scale score task --changed --json
37
+ scale score task --task-id TASK-123 --level L --changed-files src/api/foo.ts,src/workflow/bar.ts
38
+ ```
39
+
40
+ The score is computed from evidence, not from a model:
41
+
42
+ - Verification: recent gate pass rate.
43
+ - Architecture standards: deterministic standards doctor result.
44
+ - Evidence completeness: persisted gate evidence records.
45
+ - Context and memory: CodeGraph/code intelligence readiness and memory provider readiness.
46
+ - Cost efficiency: governance ROI and cache/context savings.
47
+ - Risk control: task level, blocking standards, and blocking extension gates.
48
+
49
+ Default thresholds:
50
+
51
+ - `S`: 65
52
+ - `M`: 75
53
+ - `L`: 85
54
+ - `CRITICAL`: 90
55
+
56
+ Use `--warn-only` when the score should be reported without failing the command.
@@ -0,0 +1,44 @@
1
+ # Prompt Optimization
2
+
3
+ `scale prompt optimize` is the deterministic pre-execution prompt rewrite layer for coding tasks. It turns a raw user instruction into a structured, professional, executable prompt before the workflow asks an agent to plan or implement.
4
+
5
+ ## Why It Exists
6
+
7
+ - Reduce model ambiguity before expensive model calls.
8
+ - Preserve the user's real intent instead of inventing a new requirement.
9
+ - Add missing execution structure: objective, context, boundaries, acceptance criteria, validation, deliverables, and risks.
10
+ - Make `scale define` start from a higher-quality requirement, so downstream planning and verification have clearer input.
11
+
12
+ ## CLI
13
+
14
+ ```bash
15
+ scale prompt optimize --input "Build a CLI prompt optimizer that rewrites raw coding requests" --json
16
+ ```
17
+
18
+ Useful options:
19
+
20
+ - `--language auto|zh|en`: choose output language. `auto` detects Chinese vs English.
21
+ - `--title "Prompt Optimizer"`: add a task title to the optimized objective.
22
+ - `--files "src/api/cli.ts,src/prompts/PromptOptimizer.ts"`: add known file scope.
23
+ - `--service "api,workflow"`: add known service scope.
24
+ - `--success-criteria "structured prompt,preserves intent,validation evidence"`: seed acceptance criteria.
25
+
26
+ ## Workflow Integration
27
+
28
+ `scale define` now runs prompt optimization before ambiguity scoring and spec creation:
29
+
30
+ ```bash
31
+ scale define "Prompt Optimizer" \
32
+ --description "用户输入后自动整理成专业 coding prompt,要保留真实意图" \
33
+ --success-criteria "生成结构化提示词,保留用户原始意图,输出验收标准" \
34
+ --json
35
+ ```
36
+
37
+ The JSON result includes `promptOptimization`, and `spec.payload.what` stores the optimized prompt used by the rest of the workflow.
38
+
39
+ ## Governance Rules
40
+
41
+ - The optimizer is algorithmic and does not call a model.
42
+ - It must not silently change the user's scope.
43
+ - It may add generic execution standards, validation requirements, and clarification questions.
44
+ - Vague input is still accepted, but the `quality.missingInfo` list must expose missing acceptance criteria, affected scope, or constraints.
@@ -18,6 +18,9 @@ make explore FILES='AGENTS.md CLAUDE.md README.md package.json' MSG='main contra
18
18
  make gate-workflow
19
19
  make gate-quality
20
20
  make verify PROFILE=default
21
+ scale gates status --json
22
+ scale score task --changed --json
23
+ scale prompt optimize --input "raw coding request" --json
21
24
  ```
22
25
 
23
26
  PowerShell:
@@ -26,6 +29,10 @@ PowerShell:
26
29
  powershell -NoProfile -ExecutionPolicy Bypass -File scripts/workflow/verify.ps1 -Profile default
27
30
  ```
28
31
 
32
+ See [GATES_AND_SCORE.md](GATES_AND_SCORE.md) for gate catalog visibility, architecture standards gate scope, and deterministic task scoring.
33
+
34
+ See [PROMPT_OPTIMIZATION.md](PROMPT_OPTIMIZATION.md) for the deterministic prompt rewrite layer used by `scale prompt optimize` and `scale define`.
35
+
29
36
  ## 门禁说明
30
37
 
31
38
  | Gate | 作用 |
@@ -28,7 +28,7 @@ powershell -NoProfile -ExecutionPolicy Bypass -File scripts/workflow/verify.ps1
28
28
  ## Default Verification Matrix
29
29
 
30
30
  - quick loop: `npm run build`, `npm run lint`, `npm test`
31
- - release loop: add `npm run typecheck`, `git diff --check`, and `npm pack --dry-run`
31
+ - release loop: run `npm run release:check` when available; otherwise add `npm run typecheck`, `npm run smoke:setup`, `npm audit --omit=dev`, `git diff --check`, and `npm pack --dry-run`
32
32
  - product smoke: enable a real probe in `.scale/product-smoke.json` instead of treating a health endpoint as completion proof
33
33
 
34
34
  ## Branch Policy
@@ -47,6 +47,6 @@ Before a package release or demo handoff:
47
47
 
48
48
  1. Run `bash scripts/preflight/all.sh` or the PowerShell equivalent.
49
49
  2. Run `scale preflight --preflight-profile full --json`.
50
- 3. Run `npm pack --dry-run`.
51
- 4. Run `git diff --check`.
50
+ 3. Run `npm run release:check` when the package exposes it, or run the equivalent build/test/smoke/audit/pack commands explicitly.
51
+ 4. Run `git diff --check` if it is not already included in the release command.
52
52
  5. Confirm runtime evidence and review artifacts for M/L/CRITICAL work.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hongmaple0820/scale-engine",
3
- "version": "0.38.0",
3
+ "version": "0.40.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",
@@ -47,7 +47,9 @@
47
47
  "docs/start",
48
48
  "docs/workflow",
49
49
  "image",
50
- "examples/demo-projects/agent-governance-demo"
50
+ "examples/demo-projects/agent-governance-demo",
51
+ "scripts/workflow/setup-smoke.mjs",
52
+ "scripts/workflow/provider-rehearsal.mjs"
51
53
  ],
52
54
  "publishConfig": {
53
55
  "access": "public"
@@ -55,10 +57,15 @@
55
57
  "scripts": {
56
58
  "build": "tsc",
57
59
  "dev": "bun --watch src/api/cli.ts",
58
- "test": "vitest run --reporter dot --pool=forks --poolOptions.forks.maxForks=1 --poolOptions.forks.minForks=1",
60
+ "test": "vitest run --reporter dot --pool=forks --maxWorkers=4 --minWorkers=1",
61
+ "test:serial": "vitest run --reporter dot --pool=forks --poolOptions.forks.maxForks=1 --poolOptions.forks.minForks=1",
59
62
  "typecheck": "tsc --noEmit",
60
63
  "lint": "eslint src/**/*.ts",
61
- "release:check": "npm run typecheck && npm run lint && npm test && npm run build && npm audit --omit=dev && npm pack --dry-run",
64
+ "smoke:setup": "node scripts/workflow/setup-smoke.mjs",
65
+ "smoke:providers": "node scripts/workflow/provider-rehearsal.mjs",
66
+ "smoke:gbrain": "node scripts/workflow/provider-rehearsal.mjs --skip-graphify --require-gbrain",
67
+ "smoke:graphify": "node scripts/workflow/provider-rehearsal.mjs --skip-gbrain --require-graphify",
68
+ "release:check": "npm run typecheck && npm run lint && npm test && npm run smoke:setup && npm run build && npm audit --omit=dev && git diff --check && npm pack --dry-run",
62
69
  "mcp": "node dist/api/mcp.js",
63
70
  "serve": "node dist/api/http.js"
64
71
  },
@@ -88,7 +95,7 @@
88
95
  "@typescript-eslint/parser": "^8.59.3",
89
96
  "eslint": "^9.0.0",
90
97
  "tsx": "^4.21.0",
91
- "typescript": "^5.5.0",
98
+ "typescript": "^5.9.3",
92
99
  "vitest": "^2.0.0"
93
100
  },
94
101
  "engines": {