@hongmaple0820/scale-engine 0.26.0 → 0.27.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.
- package/README.en.md +19 -3
- package/README.md +19 -3
- package/dist/api/cli.js +57 -9
- package/dist/api/cli.js.map +1 -1
- package/dist/cli/phaseCommands.js +8 -8
- package/dist/cli/phaseCommands.js.map +1 -1
- package/dist/context/ContextBudget.d.ts +14 -0
- package/dist/context/ContextBudget.js +50 -14
- package/dist/context/ContextBudget.js.map +1 -1
- package/dist/context/ContextCompiler.d.ts +34 -0
- package/dist/context/ContextCompiler.js +120 -0
- package/dist/context/ContextCompiler.js.map +1 -0
- package/dist/eval/WorkflowEval.js +4 -6
- package/dist/eval/WorkflowEval.js.map +1 -1
- package/dist/governance/GovernanceRoi.d.ts +6 -1
- package/dist/governance/GovernanceRoi.js +32 -0
- package/dist/governance/GovernanceRoi.js.map +1 -1
- package/dist/guardrails/DependencyAuditor.js +38 -0
- package/dist/guardrails/DependencyAuditor.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/runtime/AiOsRuntime.d.ts +53 -0
- package/dist/runtime/AiOsRuntime.js +142 -0
- package/dist/runtime/AiOsRuntime.js.map +1 -0
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/index.js.map +1 -1
- package/dist/skills/routing/SkillPlanner.js +91 -3
- package/dist/skills/routing/SkillPlanner.js.map +1 -1
- package/dist/skills/routing/SkillRoutingTypes.d.ts +17 -0
- package/dist/tools/SafeCommandRunner.d.ts +16 -0
- package/dist/tools/SafeCommandRunner.js +83 -0
- package/dist/tools/SafeCommandRunner.js.map +1 -0
- package/dist/workflow/gates/GateSystem.js +3 -9
- package/dist/workflow/gates/GateSystem.js.map +1 -1
- package/docs/AI_ENGINEERING_OS_POSITIONING.md +462 -0
- package/docs/CONTEXT_BUDGET.md +43 -1
- package/docs/DEPENDENCY_AUDIT.md +29 -0
- package/docs/MEMORY_FABRIC.md +2 -0
- package/docs/README.md +1 -0
- package/docs/SKILL_RADAR.md +13 -0
- package/package.json +9 -2
package/README.en.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="https://img.shields.io/badge/version-0.
|
|
2
|
+
<img src="https://img.shields.io/badge/version-0.27.0-orange?style=flat-square" alt="version" />
|
|
3
3
|
<img src="https://img.shields.io/badge/platforms-22-blue?style=flat-square" alt="platforms" />
|
|
4
4
|
<img src="https://img.shields.io/badge/agents-12-blue?style=flat-square" alt="agents" />
|
|
5
5
|
<img src="https://img.shields.io/badge/workflows-10-green?style=flat-square" alt="workflows" />
|
|
6
6
|
<img src="https://img.shields.io/badge/detectors-19-red?style=flat-square" alt="detectors" />
|
|
7
7
|
<img src="https://img.shields.io/badge/tests-verified-brightgreen?style=flat-square" alt="tests" />
|
|
8
|
-
<img src="https://img.shields.io/badge/npm-0.
|
|
8
|
+
<img src="https://img.shields.io/badge/npm-0.27.0-cb3837?style=flat-square&logo=npm" alt="npm" />
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
|
-
# SCALE Engine v0.
|
|
11
|
+
# SCALE Engine v0.27.0
|
|
12
12
|
|
|
13
13
|
SCALE Engine makes AI coding agents follow engineering rules through executable workflow gates, evidence files, and review constraints instead of relying on prompt discipline alone. It helps humans see what the agent explored, planned, verified, skipped, and why a task is or is not ready to ship.
|
|
14
14
|
|
|
@@ -17,6 +17,22 @@ Mirror: https://gitee.com/hongmaple/scale-engine
|
|
|
17
17
|
npm: https://www.npmjs.com/package/@hongmaple0820/scale-engine
|
|
18
18
|
Language: [English](README.en.md) | [Chinese](README.md)
|
|
19
19
|
|
|
20
|
+
## 0.27.0 AI OS Runtime
|
|
21
|
+
|
|
22
|
+
0.27.0 turns the AI Engineering OS direction into one executable entry point: `scale ai-os plan`. It creates a unified task plan with progressive governance mode, Context Compiler budget output, Memory Provider recall, Skill Routing execution steps, and Governance ROI. An agent can see which context to load, which capabilities to use, what evidence is required, and which risks escalate gates before it starts the task.
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
scale ai-os plan \
|
|
26
|
+
--task-id TASK-123 \
|
|
27
|
+
--task "Fix OAuth callback auth token handling and verify browser callback flow" \
|
|
28
|
+
--level L \
|
|
29
|
+
--files src/auth/oauth.ts,src/ui/callback.tsx \
|
|
30
|
+
--budget 8000 \
|
|
31
|
+
--json
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
This is not a claim that SCALE replaces human judgment. It is the first testable, explainable, and measurable runtime planning layer for the AI Engineering OS direction.
|
|
35
|
+
|
|
20
36
|
## Community
|
|
21
37
|
|
|
22
38
|
SCALE Engine is an engineering workflow governance project for real AI-agent delivery. Contributions, issues, PRs, governance-pack ideas, and field reports are welcome through the source repositories. Chinese users can also follow the WeChat public account for updates, examples, and community entry points.
|
package/README.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="https://img.shields.io/badge/version-0.
|
|
2
|
+
<img src="https://img.shields.io/badge/version-0.27.0-orange?style=flat-square" alt="version" />
|
|
3
3
|
<img src="https://img.shields.io/badge/platforms-22-blue?style=flat-square" alt="platforms" />
|
|
4
4
|
<img src="https://img.shields.io/badge/agents-12-blue?style=flat-square" alt="agents" />
|
|
5
5
|
<img src="https://img.shields.io/badge/workflows-10-green?style=flat-square" alt="workflows" />
|
|
6
6
|
<img src="https://img.shields.io/badge/detectors-19-red?style=flat-square" alt="detectors" />
|
|
7
7
|
<img src="https://img.shields.io/badge/tests-verified-brightgreen?style=flat-square" alt="tests" />
|
|
8
|
-
<img src="https://img.shields.io/badge/npm-0.
|
|
8
|
+
<img src="https://img.shields.io/badge/npm-0.27.0-cb3837?style=flat-square&logo=npm" alt="npm" />
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
|
-
# SCALE Engine v0.
|
|
11
|
+
# SCALE Engine v0.27.0
|
|
12
12
|
|
|
13
13
|
SCALE Engine 让 AI Agent 不再只靠“自觉”遵守工程规范。它把探索、规划、实现、验证、评审、发版这些要求变成可执行的命令、门禁和证据文件,让人类可以看见 Agent 做了什么、跳过了什么、为什么能交付或不能交付。
|
|
14
14
|
|
|
@@ -17,6 +17,22 @@ SCALE Engine 让 AI Agent 不再只靠“自觉”遵守工程规范。它把探
|
|
|
17
17
|
npm:https://www.npmjs.com/package/@hongmaple0820/scale-engine
|
|
18
18
|
语言:[中文](README.md) | [English](README.en.md)
|
|
19
19
|
|
|
20
|
+
## 0.27.0 AI OS Runtime
|
|
21
|
+
|
|
22
|
+
0.27.0 把战略方向落成了一个可执行入口:`scale ai-os plan`。它会在一次命令里同时生成风险治理模式、Context Compiler 预算结果、Memory Provider 召回结果、Skill Routing 执行计划和 Governance ROI,让 Agent 在开始任务前就知道应该加载什么上下文、调用什么能力、补什么证据、哪些风险会升级门禁。
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
scale ai-os plan \
|
|
26
|
+
--task-id TASK-123 \
|
|
27
|
+
--task "修复 OAuth callback auth token 并验证浏览器回调流程" \
|
|
28
|
+
--level L \
|
|
29
|
+
--files src/auth/oauth.ts,src/ui/callback.tsx \
|
|
30
|
+
--budget 8000 \
|
|
31
|
+
--json
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
这不是“完全替代人类判断”的声明;它是把 AI Engineering OS 的核心闭环先做成可测试、可解释、可度量的运行时规划层。
|
|
35
|
+
|
|
20
36
|
## 先怎么学
|
|
21
37
|
|
|
22
38
|
如果你第一次接触 SCALE,不要从完整命令列表开始读。按这个顺序更容易掌握:
|
package/dist/api/cli.js
CHANGED
|
@@ -60,11 +60,12 @@ import { evaluateToolEvidenceGate } from '../tools/ToolEvidenceGate.js';
|
|
|
60
60
|
import { ToolEvidenceStore } from '../tools/ToolEvidenceStore.js';
|
|
61
61
|
import { ToolOrchestrator } from '../tools/ToolOrchestrator.js';
|
|
62
62
|
import { loadToolPolicy, toolPolicyTemplate } from '../tools/ToolPolicy.js';
|
|
63
|
+
import { runSafeCommand } from '../tools/SafeCommandRunner.js';
|
|
63
64
|
import { doctorHtmlArtifacts, renderHtmlArtifact, resolveHtmlArtifactForOpen, settleHtmlArtifacts, } from '../output/HTMLArtifactLayer.js';
|
|
64
65
|
import { renderGovernanceDashboard } from '../output/GovernanceDashboard.js';
|
|
65
66
|
import { cleanupWorkspaceLifecycle, inspectWorkspaceLifecycle, } from '../workflow/WorkspaceLifecycle.js';
|
|
66
67
|
import { inspectWorkspaceSafety } from '../workflow/WorkspaceSafety.js';
|
|
67
|
-
import { RuntimeEvidenceLedger, SessionLedger, doctorRuntimeEvidence, evaluateFinalReportReadiness, } from '../runtime/index.js';
|
|
68
|
+
import { RuntimeEvidenceLedger, SessionLedger, createAiOsPlan, doctorRuntimeEvidence, evaluateFinalReportReadiness, } from '../runtime/index.js';
|
|
68
69
|
import { MemoryFabric, MemoryBrain, doctorMemoryFabric, renderContextPackMarkdown, renderMemoryLearningCandidateMarkdown, inspectMemoryProviders, recallMemoryProviders, settleMemoryLearning, writeMemoryProvidersConfig, } from '../memory/index.js';
|
|
69
70
|
import { resolveWorkspaceTopology, workspaceTopologyPath, workspaceTopologyTemplate, } from '../workflow/WorkspaceTopology.js';
|
|
70
71
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
@@ -663,14 +664,13 @@ const verifyTask = defineCommand({
|
|
|
663
664
|
};
|
|
664
665
|
// Helper: run command and capture exit code
|
|
665
666
|
const runCmd = async (cmd) => {
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
});
|
|
667
|
+
try {
|
|
668
|
+
const result = await runSafeCommand(cmd);
|
|
669
|
+
return { exitCode: result.exitCode, output: [result.stdout, result.stderr].filter(Boolean).join('\n') };
|
|
670
|
+
}
|
|
671
|
+
catch (error) {
|
|
672
|
+
return { exitCode: 1, output: error instanceof Error ? error.message : String(error) };
|
|
673
|
+
}
|
|
674
674
|
};
|
|
675
675
|
// Run build
|
|
676
676
|
if (!args['skip-build']) {
|
|
@@ -2907,6 +2907,53 @@ const governance = defineCommand({
|
|
|
2907
2907
|
meta: { name: 'governance', description: 'Governance template pack tools' },
|
|
2908
2908
|
subCommands: { diff: governanceDiff, mode: governanceModeCommand, roi: governanceRoiCommand },
|
|
2909
2909
|
});
|
|
2910
|
+
const aiOsPlanCommand = defineCommand({
|
|
2911
|
+
meta: { name: 'plan', description: 'Create a unified AI OS runtime plan for governance, context, memory, skills, and ROI' },
|
|
2912
|
+
args: {
|
|
2913
|
+
dir: { type: 'string', default: PROJECT_DIR, description: 'Project directory' },
|
|
2914
|
+
'task-id': { type: 'string', description: 'Task id' },
|
|
2915
|
+
task: { type: 'string', required: true, description: 'Task or requirement description' },
|
|
2916
|
+
level: { type: 'string', default: 'M', description: 'Task level: S, M, L, or CRITICAL' },
|
|
2917
|
+
files: { type: 'string', description: 'Comma-separated changed or target files' },
|
|
2918
|
+
services: { type: 'string', description: 'Comma-separated affected services' },
|
|
2919
|
+
budget: { type: 'string', description: 'Maximum estimated tokens for the context compiler' },
|
|
2920
|
+
'requested-mode': { type: 'string', description: 'Requested governance mode: minimal, standard, expanded, or critical' },
|
|
2921
|
+
json: { type: 'boolean', default: false },
|
|
2922
|
+
},
|
|
2923
|
+
async run({ args }) {
|
|
2924
|
+
const projectDir = resolve(String(args.dir ?? PROJECT_DIR));
|
|
2925
|
+
const scaleDir = resolveScaleDirForProject(projectDir);
|
|
2926
|
+
const plan = await createAiOsPlan({
|
|
2927
|
+
projectDir,
|
|
2928
|
+
scaleDir,
|
|
2929
|
+
taskId: args['task-id'] ? String(args['task-id']) : undefined,
|
|
2930
|
+
task: String(args.task),
|
|
2931
|
+
level: normalizeTaskArtifactLevel(args.level),
|
|
2932
|
+
files: parseCommaList(args.files),
|
|
2933
|
+
services: parseCommaList(args.services),
|
|
2934
|
+
budget: parsePositiveIntArg(args.budget, '--budget'),
|
|
2935
|
+
requestedMode: normalizeGovernanceMode(args['requested-mode']),
|
|
2936
|
+
});
|
|
2937
|
+
if (args.json) {
|
|
2938
|
+
console.log(JSON.stringify(plan, null, 2));
|
|
2939
|
+
return;
|
|
2940
|
+
}
|
|
2941
|
+
console.log('SCALE AI OS Runtime Plan');
|
|
2942
|
+
console.log(` Version: ${plan.version}`);
|
|
2943
|
+
console.log(` Task: ${plan.task.taskId ?? 'n/a'} ${plan.task.task}`);
|
|
2944
|
+
console.log(` Governance: ${plan.governance.effectiveMode}`);
|
|
2945
|
+
console.log(` Context: ${plan.context.totalEstimatedTokens}/${plan.context.task.budget} tokens; saved ${plan.context.compiler?.estimatedTokenSavings ?? 0}`);
|
|
2946
|
+
console.log(` Memory: ${plan.memory.items.length} item(s); providers ${plan.memory.providerOrder.join(' -> ')}`);
|
|
2947
|
+
console.log(` Skill steps: ${plan.skillPlan.executionPlan.steps.length}`);
|
|
2948
|
+
console.log(` ROI: ${plan.roi.summary.recommendation}`);
|
|
2949
|
+
for (const recommendation of plan.recommendations)
|
|
2950
|
+
console.log(` recommendation: ${recommendation}`);
|
|
2951
|
+
},
|
|
2952
|
+
});
|
|
2953
|
+
const aiOs = defineCommand({
|
|
2954
|
+
meta: { name: 'ai-os', description: 'AI Engineering OS runtime planning and governance orchestration' },
|
|
2955
|
+
subCommands: { plan: aiOsPlanCommand },
|
|
2956
|
+
});
|
|
2910
2957
|
// ============================================================================
|
|
2911
2958
|
// upgrade command - Safe workflow/template/capability update planning
|
|
2912
2959
|
// ============================================================================
|
|
@@ -5437,6 +5484,7 @@ const main = defineCommand({
|
|
|
5437
5484
|
preflight,
|
|
5438
5485
|
upgrade,
|
|
5439
5486
|
governance,
|
|
5487
|
+
'ai-os': aiOs,
|
|
5440
5488
|
codegraph,
|
|
5441
5489
|
eval: evalCommand,
|
|
5442
5490
|
artifact,
|