scene-capability-engine 3.4.6 → 3.5.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/CHANGELOG.md +20 -0
- package/README.md +4 -1
- package/README.zh.md +4 -1
- package/docs/command-reference.md +37 -1
- package/lib/adoption/adoption-strategy.js +1 -0
- package/lib/adoption/detection-engine.js +1 -0
- package/lib/adoption/file-classifier.js +2 -1
- package/lib/adoption/smart-orchestrator.js +1 -0
- package/lib/commands/studio.js +269 -18
- package/lib/studio/spec-intake-governor.js +992 -0
- package/lib/workspace/takeover-baseline.js +56 -0
- package/package.json +1 -1
- package/template/.sce/config/studio-intake-policy.json +68 -0
- package/template/.sce/config/takeover-baseline.json +88 -1
|
@@ -87,6 +87,37 @@ const PROBLEM_CLOSURE_POLICY_DEFAULTS = Object.freeze({
|
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
89
|
|
|
90
|
+
const STUDIO_INTAKE_POLICY_DEFAULTS = Object.freeze({
|
|
91
|
+
schema_version: '1.0',
|
|
92
|
+
enabled: true,
|
|
93
|
+
auto_create_spec: true,
|
|
94
|
+
force_spec_for_studio_plan: true,
|
|
95
|
+
prefer_existing_scene_spec: true,
|
|
96
|
+
related_spec_min_score: 45,
|
|
97
|
+
allow_new_spec_when_goal_diverges: true,
|
|
98
|
+
divergence_similarity_threshold: 0.2,
|
|
99
|
+
goal_missing_strategy: 'create_for_tracking',
|
|
100
|
+
question_only_patterns: [
|
|
101
|
+
'how', 'what', 'why', 'when', 'where', 'which', 'can', 'could', 'should', 'would',
|
|
102
|
+
'是否', '怎么', '如何', '为什么', '吗', '么'
|
|
103
|
+
],
|
|
104
|
+
change_intent_patterns: [
|
|
105
|
+
'implement', 'build', 'create', 'add', 'update', 'upgrade', 'refactor', 'fix', 'stabilize',
|
|
106
|
+
'optimize', 'deliver', 'release', 'bootstrap', 'repair', 'patch',
|
|
107
|
+
'新增', '增加', '实现', '构建', '开发', '修复', '优化', '重构', '发布', '改造', '完善', '增强'
|
|
108
|
+
],
|
|
109
|
+
spec_id: {
|
|
110
|
+
prefix: 'auto',
|
|
111
|
+
max_goal_slug_tokens: 6
|
|
112
|
+
},
|
|
113
|
+
governance: {
|
|
114
|
+
auto_run_on_plan: true,
|
|
115
|
+
max_active_specs_per_scene: 3,
|
|
116
|
+
stale_days: 14,
|
|
117
|
+
duplicate_similarity_threshold: 0.66
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
|
|
90
121
|
const TAKEOVER_DEFAULTS = Object.freeze({
|
|
91
122
|
autonomous: {
|
|
92
123
|
enabled: true,
|
|
@@ -137,6 +168,22 @@ const TAKEOVER_DEFAULTS = Object.freeze({
|
|
|
137
168
|
block_on_high_governance_alerts: true
|
|
138
169
|
}
|
|
139
170
|
},
|
|
171
|
+
studio_intake: {
|
|
172
|
+
enabled: true,
|
|
173
|
+
auto_create_spec: true,
|
|
174
|
+
force_spec_for_studio_plan: true,
|
|
175
|
+
prefer_existing_scene_spec: true,
|
|
176
|
+
related_spec_min_score: 45,
|
|
177
|
+
allow_new_spec_when_goal_diverges: true,
|
|
178
|
+
divergence_similarity_threshold: 0.2,
|
|
179
|
+
goal_missing_strategy: 'create_for_tracking',
|
|
180
|
+
governance: {
|
|
181
|
+
auto_run_on_plan: true,
|
|
182
|
+
max_active_specs_per_scene: 3,
|
|
183
|
+
stale_days: 14,
|
|
184
|
+
duplicate_similarity_threshold: 0.66
|
|
185
|
+
}
|
|
186
|
+
},
|
|
140
187
|
debug_policy: {
|
|
141
188
|
prioritize_root_cause_fix: true,
|
|
142
189
|
max_direct_fix_rounds_before_debug: 2,
|
|
@@ -406,6 +453,7 @@ async function applyTakeoverBaseline(projectPath = process.cwd(), options = {})
|
|
|
406
453
|
const specDomainPolicyPath = path.join(sceRoot, 'config', 'spec-domain-policy.json');
|
|
407
454
|
const problemEvalPolicyPath = path.join(sceRoot, 'config', 'problem-eval-policy.json');
|
|
408
455
|
const problemClosurePolicyPath = path.join(sceRoot, 'config', 'problem-closure-policy.json');
|
|
456
|
+
const studioIntakePolicyPath = path.join(sceRoot, 'config', 'studio-intake-policy.json');
|
|
409
457
|
const reportPath = path.join(sceRoot, 'reports', 'takeover-baseline-latest.json');
|
|
410
458
|
|
|
411
459
|
const existingAdoption = await _readJsonSafe(adoptionPath, fileSystem);
|
|
@@ -415,6 +463,7 @@ async function applyTakeoverBaseline(projectPath = process.cwd(), options = {})
|
|
|
415
463
|
const existingSpecDomainPolicy = await _readJsonSafe(specDomainPolicyPath, fileSystem);
|
|
416
464
|
const existingProblemEvalPolicy = await _readJsonSafe(problemEvalPolicyPath, fileSystem);
|
|
417
465
|
const existingProblemClosurePolicy = await _readJsonSafe(problemClosurePolicyPath, fileSystem);
|
|
466
|
+
const existingStudioIntakePolicy = await _readJsonSafe(studioIntakePolicyPath, fileSystem);
|
|
418
467
|
|
|
419
468
|
const desiredAdoption = _buildAdoptionConfig(existingAdoption, nowIso, sceVersion);
|
|
420
469
|
const desiredAutoConfig = _buildAutoConfig(existingAuto);
|
|
@@ -423,6 +472,7 @@ async function applyTakeoverBaseline(projectPath = process.cwd(), options = {})
|
|
|
423
472
|
const desiredSpecDomainPolicy = _deepMerge(existingSpecDomainPolicy || {}, SPEC_DOMAIN_POLICY_DEFAULTS);
|
|
424
473
|
const desiredProblemEvalPolicy = _deepMerge(existingProblemEvalPolicy || {}, PROBLEM_EVAL_POLICY_DEFAULTS);
|
|
425
474
|
const desiredProblemClosurePolicy = _deepMerge(existingProblemClosurePolicy || {}, PROBLEM_CLOSURE_POLICY_DEFAULTS);
|
|
475
|
+
const desiredStudioIntakePolicy = _deepMerge(existingStudioIntakePolicy || {}, STUDIO_INTAKE_POLICY_DEFAULTS);
|
|
426
476
|
|
|
427
477
|
const fileResults = [];
|
|
428
478
|
fileResults.push(await _reconcileJsonFile(adoptionPath, desiredAdoption, {
|
|
@@ -460,6 +510,11 @@ async function applyTakeoverBaseline(projectPath = process.cwd(), options = {})
|
|
|
460
510
|
apply,
|
|
461
511
|
fileSystem
|
|
462
512
|
}));
|
|
513
|
+
fileResults.push(await _reconcileJsonFile(studioIntakePolicyPath, desiredStudioIntakePolicy, {
|
|
514
|
+
projectPath,
|
|
515
|
+
apply,
|
|
516
|
+
fileSystem
|
|
517
|
+
}));
|
|
463
518
|
fileResults.push(await _reconcileSteeringContract(projectPath, {
|
|
464
519
|
apply,
|
|
465
520
|
fileSystem
|
|
@@ -510,5 +565,6 @@ module.exports = {
|
|
|
510
565
|
SPEC_DOMAIN_POLICY_DEFAULTS,
|
|
511
566
|
PROBLEM_CLOSURE_POLICY_DEFAULTS,
|
|
512
567
|
PROBLEM_EVAL_POLICY_DEFAULTS,
|
|
568
|
+
STUDIO_INTAKE_POLICY_DEFAULTS,
|
|
513
569
|
applyTakeoverBaseline
|
|
514
570
|
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "1.0",
|
|
3
|
+
"enabled": true,
|
|
4
|
+
"auto_create_spec": true,
|
|
5
|
+
"force_spec_for_studio_plan": true,
|
|
6
|
+
"prefer_existing_scene_spec": true,
|
|
7
|
+
"related_spec_min_score": 45,
|
|
8
|
+
"allow_new_spec_when_goal_diverges": true,
|
|
9
|
+
"divergence_similarity_threshold": 0.2,
|
|
10
|
+
"goal_missing_strategy": "create_for_tracking",
|
|
11
|
+
"question_only_patterns": [
|
|
12
|
+
"how",
|
|
13
|
+
"what",
|
|
14
|
+
"why",
|
|
15
|
+
"when",
|
|
16
|
+
"where",
|
|
17
|
+
"which",
|
|
18
|
+
"can",
|
|
19
|
+
"could",
|
|
20
|
+
"should",
|
|
21
|
+
"would",
|
|
22
|
+
"是否",
|
|
23
|
+
"怎么",
|
|
24
|
+
"如何",
|
|
25
|
+
"为什么",
|
|
26
|
+
"吗",
|
|
27
|
+
"么"
|
|
28
|
+
],
|
|
29
|
+
"change_intent_patterns": [
|
|
30
|
+
"implement",
|
|
31
|
+
"build",
|
|
32
|
+
"create",
|
|
33
|
+
"add",
|
|
34
|
+
"update",
|
|
35
|
+
"upgrade",
|
|
36
|
+
"refactor",
|
|
37
|
+
"fix",
|
|
38
|
+
"stabilize",
|
|
39
|
+
"optimize",
|
|
40
|
+
"deliver",
|
|
41
|
+
"release",
|
|
42
|
+
"bootstrap",
|
|
43
|
+
"repair",
|
|
44
|
+
"patch",
|
|
45
|
+
"新增",
|
|
46
|
+
"增加",
|
|
47
|
+
"实现",
|
|
48
|
+
"构建",
|
|
49
|
+
"开发",
|
|
50
|
+
"修复",
|
|
51
|
+
"优化",
|
|
52
|
+
"重构",
|
|
53
|
+
"发布",
|
|
54
|
+
"改造",
|
|
55
|
+
"完善",
|
|
56
|
+
"增强"
|
|
57
|
+
],
|
|
58
|
+
"spec_id": {
|
|
59
|
+
"prefix": "auto",
|
|
60
|
+
"max_goal_slug_tokens": 6
|
|
61
|
+
},
|
|
62
|
+
"governance": {
|
|
63
|
+
"auto_run_on_plan": true,
|
|
64
|
+
"max_active_specs_per_scene": 3,
|
|
65
|
+
"stale_days": 14,
|
|
66
|
+
"duplicate_similarity_threshold": 0.66
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -18,7 +18,94 @@
|
|
|
18
18
|
"spec_domain_policy": {
|
|
19
19
|
"closed_loop_research_required": true,
|
|
20
20
|
"coverage_validation_required": true,
|
|
21
|
-
"fail_on_gap_default": true
|
|
21
|
+
"fail_on_gap_default": true,
|
|
22
|
+
"problem_contract_required": true,
|
|
23
|
+
"ontology_axes_required": [
|
|
24
|
+
"entity",
|
|
25
|
+
"relation",
|
|
26
|
+
"business_rule",
|
|
27
|
+
"decision_policy",
|
|
28
|
+
"execution_flow"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"problem_evaluation": {
|
|
32
|
+
"enabled": true,
|
|
33
|
+
"mode": "required",
|
|
34
|
+
"enforce_on_stages": [
|
|
35
|
+
"plan",
|
|
36
|
+
"generate",
|
|
37
|
+
"apply",
|
|
38
|
+
"verify",
|
|
39
|
+
"release"
|
|
40
|
+
],
|
|
41
|
+
"block_on_stages": [
|
|
42
|
+
"apply",
|
|
43
|
+
"release"
|
|
44
|
+
],
|
|
45
|
+
"problem_contract_required_stages": [
|
|
46
|
+
"plan",
|
|
47
|
+
"generate",
|
|
48
|
+
"apply",
|
|
49
|
+
"verify",
|
|
50
|
+
"release"
|
|
51
|
+
],
|
|
52
|
+
"problem_contract_block_stages": [
|
|
53
|
+
"plan",
|
|
54
|
+
"apply",
|
|
55
|
+
"release"
|
|
56
|
+
],
|
|
57
|
+
"ontology_alignment_required_stages": [
|
|
58
|
+
"plan",
|
|
59
|
+
"generate",
|
|
60
|
+
"apply",
|
|
61
|
+
"verify",
|
|
62
|
+
"release"
|
|
63
|
+
],
|
|
64
|
+
"ontology_alignment_block_stages": [
|
|
65
|
+
"apply",
|
|
66
|
+
"release"
|
|
67
|
+
],
|
|
68
|
+
"convergence_required_stages": [
|
|
69
|
+
"verify",
|
|
70
|
+
"release"
|
|
71
|
+
],
|
|
72
|
+
"convergence_block_stages": [
|
|
73
|
+
"release"
|
|
74
|
+
],
|
|
75
|
+
"max_failed_rounds_before_debug": 2
|
|
76
|
+
},
|
|
77
|
+
"problem_closure": {
|
|
78
|
+
"enabled": true,
|
|
79
|
+
"governance_report_path": ".sce/reports/interactive-governance-report.json",
|
|
80
|
+
"verify": {
|
|
81
|
+
"require_problem_contract": true,
|
|
82
|
+
"require_domain_validation": true,
|
|
83
|
+
"require_domain_coverage": true
|
|
84
|
+
},
|
|
85
|
+
"release": {
|
|
86
|
+
"require_problem_contract": true,
|
|
87
|
+
"require_domain_validation": true,
|
|
88
|
+
"require_domain_coverage": true,
|
|
89
|
+
"require_verify_report": true,
|
|
90
|
+
"require_governance_report": false,
|
|
91
|
+
"block_on_high_governance_alerts": true
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"studio_intake": {
|
|
95
|
+
"enabled": true,
|
|
96
|
+
"auto_create_spec": true,
|
|
97
|
+
"force_spec_for_studio_plan": true,
|
|
98
|
+
"prefer_existing_scene_spec": true,
|
|
99
|
+
"related_spec_min_score": 45,
|
|
100
|
+
"allow_new_spec_when_goal_diverges": true,
|
|
101
|
+
"divergence_similarity_threshold": 0.2,
|
|
102
|
+
"goal_missing_strategy": "create_for_tracking",
|
|
103
|
+
"governance": {
|
|
104
|
+
"auto_run_on_plan": true,
|
|
105
|
+
"max_active_specs_per_scene": 3,
|
|
106
|
+
"stale_days": 14,
|
|
107
|
+
"duplicate_similarity_threshold": 0.66
|
|
108
|
+
}
|
|
22
109
|
},
|
|
23
110
|
"debug_policy": {
|
|
24
111
|
"prioritize_root_cause_fix": true,
|