scene-capability-engine 3.6.50 → 3.6.51
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 +5 -0
- package/README.md +2 -2
- package/README.zh.md +2 -2
- package/docs/command-reference.md +2 -2
- package/docs/multi-agent-coordination-guide.md +2 -2
- package/docs/releases/v3.6.51.md +18 -0
- package/docs/zh/releases/v3.6.51.md +18 -0
- package/lib/workspace/takeover-baseline.js +57 -6
- package/package.json +1 -1
- package/template/.sce/README.md +2 -2
- package/template/.sce/steering/CORE_PRINCIPLES.md +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [3.6.51] - 2026-03-15
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- Added a new core steering baseline rule requiring rewrite-style changes to remove obsolete code, dead branches, abandoned adapters, and stale references in the same change unless an explicit temporary compatibility plan exists.
|
|
14
|
+
|
|
10
15
|
## [3.6.50] - 2026-03-14
|
|
11
16
|
|
|
12
17
|
### Changed
|
package/README.md
CHANGED
package/README.zh.md
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# v3.6.51 Release Notes
|
|
2
|
+
|
|
3
|
+
Release date: 2026-03-15
|
|
4
|
+
|
|
5
|
+
## Highlights
|
|
6
|
+
|
|
7
|
+
- Added a new SCE core principle that requires rewrite-style feature, UI, and module changes to remove obsolete implementations in the same change instead of leaving dead code behind.
|
|
8
|
+
- Extended takeover baseline repair so adopted projects automatically regain this obsolete-code-cleanup principle if their steering baseline drifts.
|
|
9
|
+
- Synced package and documentation version metadata for the new release, including runtime/template README footers and current-version guide headers.
|
|
10
|
+
|
|
11
|
+
## Validation
|
|
12
|
+
|
|
13
|
+
- `npx jest tests/unit/workspace/takeover-baseline.test.js --runInBand`
|
|
14
|
+
|
|
15
|
+
## Release Notes
|
|
16
|
+
|
|
17
|
+
- This patch tightens SCE's default governance against AI-generated garbage code by making dead-code cleanup an explicit baseline requirement rather than an optional style preference.
|
|
18
|
+
- The rule applies across all SCE-managed projects and clarifies that temporary retention is allowed only when compatibility or rollback constraints are documented with a concrete cleanup plan.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# v3.6.51 发布说明
|
|
2
|
+
|
|
3
|
+
发布日期:2026-03-15
|
|
4
|
+
|
|
5
|
+
## 重点变化
|
|
6
|
+
|
|
7
|
+
- 新增一条 SCE 核心原则:功能、UI 或模块发生重写/替换时,失效旧实现必须在同一轮变更中清理,不能继续把废弃代码留在仓库里。
|
|
8
|
+
- 扩展 takeover baseline 修复逻辑;接管项目若缺失这条“清理废弃代码”原则,SCE 会自动补齐基线。
|
|
9
|
+
- 同步更新本次版本的包信息和文档版本元数据,包括运行时/模板 README 尾注以及当前版本说明文档。
|
|
10
|
+
|
|
11
|
+
## 验证
|
|
12
|
+
|
|
13
|
+
- `npx jest tests/unit/workspace/takeover-baseline.test.js --runInBand`
|
|
14
|
+
|
|
15
|
+
## 发布说明
|
|
16
|
+
|
|
17
|
+
- 这个补丁版把“禁止 AI 制造垃圾代码并把旧实现遗留在仓库里”提升为 SCE 的默认治理要求,而不再只是编码习惯建议。
|
|
18
|
+
- 若确实因为兼容、灰度或回滚需要临时保留旧实现,也必须明确说明保留理由、适用边界、退出条件和后续清理计划。
|
|
@@ -48,6 +48,18 @@ const BACKEND_API_PRECEDENCE_CORE_PRINCIPLE_SECTION = [
|
|
|
48
48
|
'- 除非明确要求新建接口或修改后端接口,否则禁止为了迁就前端错误调用去随意改后端实现或契约。',
|
|
49
49
|
'- 默认优先修正前端请求、映射、类型和兼容处理,使其与后端接口保持一致;若怀疑后端契约错误,应先确认再改。'
|
|
50
50
|
].join('\n');
|
|
51
|
+
const DELIVERY_SYNC_CORE_PRINCIPLE_HEADING = '## 6. 测试、文档、代码必须同步闭环';
|
|
52
|
+
const DELIVERY_SYNC_REQUIRED_LINES = Object.freeze([
|
|
53
|
+
'- 代码变更必须跑相关验证;发布前不得忽略失败。',
|
|
54
|
+
'- 重要功能、命令、配置变化必须同步更新 README、用户文档或发布说明。',
|
|
55
|
+
'- 功能修改、UI 重写、模块替换时,已失效的旧实现、旧样式、死分支、失效适配层和无效引用必须在同一轮变更中清理,不得继续留作“保险”。',
|
|
56
|
+
'- 若因兼容、灰度或回滚必须暂时保留旧实现,必须明确保留理由、适用边界、退出条件和后续清理计划。'
|
|
57
|
+
]);
|
|
58
|
+
const DELIVERY_SYNC_CORE_PRINCIPLE_SECTION = [
|
|
59
|
+
DELIVERY_SYNC_CORE_PRINCIPLE_HEADING,
|
|
60
|
+
'',
|
|
61
|
+
...DELIVERY_SYNC_REQUIRED_LINES
|
|
62
|
+
].join('\n');
|
|
51
63
|
const LARGE_FILE_REFACTOR_CORE_PRINCIPLE_HEADING = '## 15. 单文件规模过大必须触发重构评估,禁止无限堆积';
|
|
52
64
|
const LARGE_FILE_REFACTOR_CORE_PRINCIPLE_SECTION = [
|
|
53
65
|
LARGE_FILE_REFACTOR_CORE_PRINCIPLE_HEADING,
|
|
@@ -59,6 +71,10 @@ const LARGE_FILE_REFACTOR_CORE_PRINCIPLE_SECTION = [
|
|
|
59
71
|
'- 行数阈值只是强触发信号,不代表低于阈值就可以忽略耦合、职责混杂、测试失控和理解成本问题;若复杂度已明显失控,应提前启动重构。'
|
|
60
72
|
].join('\n');
|
|
61
73
|
const REQUIRED_CORE_PRINCIPLE_SECTIONS = Object.freeze([
|
|
74
|
+
{
|
|
75
|
+
heading: DELIVERY_SYNC_CORE_PRINCIPLE_HEADING,
|
|
76
|
+
section: DELIVERY_SYNC_CORE_PRINCIPLE_SECTION
|
|
77
|
+
},
|
|
62
78
|
{
|
|
63
79
|
heading: CLARIFICATION_FIRST_CORE_PRINCIPLE_HEADING,
|
|
64
80
|
section: CLARIFICATION_FIRST_CORE_PRINCIPLE_SECTION
|
|
@@ -658,22 +674,54 @@ async function _reconcileSteeringContract(projectPath, options = {}) {
|
|
|
658
674
|
};
|
|
659
675
|
}
|
|
660
676
|
|
|
677
|
+
function _appendLinesToSection(content, heading, lines) {
|
|
678
|
+
if (!content || !heading || !Array.isArray(lines) || lines.length === 0) {
|
|
679
|
+
return content;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
const startIndex = content.indexOf(heading);
|
|
683
|
+
if (startIndex === -1) {
|
|
684
|
+
return content;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
const sectionBodyStart = startIndex + heading.length;
|
|
688
|
+
const nextHeadingIndex = content.indexOf('\n## ', sectionBodyStart);
|
|
689
|
+
const sectionEnd = nextHeadingIndex === -1 ? content.length : nextHeadingIndex;
|
|
690
|
+
const section = content.slice(startIndex, sectionEnd).trimEnd();
|
|
691
|
+
const missingLines = lines.filter((line) => !section.includes(line));
|
|
692
|
+
|
|
693
|
+
if (missingLines.length === 0) {
|
|
694
|
+
return content;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
const updatedSection = `${section}\n${missingLines.join('\n')}`;
|
|
698
|
+
return `${content.slice(0, startIndex)}${updatedSection}${content.slice(sectionEnd)}`;
|
|
699
|
+
}
|
|
700
|
+
|
|
661
701
|
async function _reconcileCorePrinciplesBaseline(projectPath, options = {}) {
|
|
662
702
|
const { apply, fileSystem } = options;
|
|
663
703
|
const corePrinciplesPath = path.join(projectPath, SCE_STEERING_DIR, DEFAULT_LAYER_FILES.core_principles);
|
|
664
704
|
const exists = await fileSystem.pathExists(corePrinciplesPath);
|
|
665
705
|
const existingContent = exists ? await fileSystem.readFile(corePrinciplesPath, 'utf8') : '';
|
|
666
706
|
const missingSections = REQUIRED_CORE_PRINCIPLE_SECTIONS.filter(({ heading }) => !existingContent.includes(heading));
|
|
667
|
-
const
|
|
707
|
+
const missingDeliverySyncLines = existingContent.includes(DELIVERY_SYNC_CORE_PRINCIPLE_HEADING)
|
|
708
|
+
? DELIVERY_SYNC_REQUIRED_LINES.filter((line) => !existingContent.includes(line))
|
|
709
|
+
: [];
|
|
710
|
+
const changed = missingSections.length > 0 || missingDeliverySyncLines.length > 0;
|
|
668
711
|
|
|
669
712
|
if (apply && changed) {
|
|
670
|
-
|
|
713
|
+
let nextContent = `${existingContent || ''}`.trimEnd();
|
|
671
714
|
const appendedSections = missingSections.map((item) => item.section).join('\n\n');
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
715
|
+
if (appendedSections) {
|
|
716
|
+
nextContent = nextContent
|
|
717
|
+
? `${nextContent}\n\n${appendedSections}`
|
|
718
|
+
: appendedSections;
|
|
719
|
+
}
|
|
720
|
+
if (missingDeliverySyncLines.length > 0) {
|
|
721
|
+
nextContent = _appendLinesToSection(nextContent, DELIVERY_SYNC_CORE_PRINCIPLE_HEADING, missingDeliverySyncLines);
|
|
722
|
+
}
|
|
675
723
|
await fileSystem.ensureDir(path.dirname(corePrinciplesPath));
|
|
676
|
-
await fileSystem.writeFile(corePrinciplesPath, nextContent
|
|
724
|
+
await fileSystem.writeFile(corePrinciplesPath, `${nextContent}\n`, 'utf8');
|
|
677
725
|
}
|
|
678
726
|
|
|
679
727
|
return {
|
|
@@ -684,6 +732,7 @@ async function _reconcileCorePrinciplesBaseline(projectPath, options = {}) {
|
|
|
684
732
|
managed_by: 'takeover-baseline',
|
|
685
733
|
details: {
|
|
686
734
|
missing_required_headings_before: missingSections.map((item) => item.heading),
|
|
735
|
+
missing_delivery_sync_lines_before: missingDeliverySyncLines,
|
|
687
736
|
required_headings: REQUIRED_CORE_PRINCIPLE_SECTIONS.map((item) => item.heading)
|
|
688
737
|
}
|
|
689
738
|
};
|
|
@@ -923,6 +972,8 @@ module.exports = {
|
|
|
923
972
|
STEERING_CHANGE_EVALUATION_CORE_PRINCIPLE_SECTION,
|
|
924
973
|
BACKEND_API_PRECEDENCE_CORE_PRINCIPLE_HEADING,
|
|
925
974
|
BACKEND_API_PRECEDENCE_CORE_PRINCIPLE_SECTION,
|
|
975
|
+
DELIVERY_SYNC_CORE_PRINCIPLE_HEADING,
|
|
976
|
+
DELIVERY_SYNC_REQUIRED_LINES,
|
|
926
977
|
LARGE_FILE_REFACTOR_CORE_PRINCIPLE_HEADING,
|
|
927
978
|
LARGE_FILE_REFACTOR_CORE_PRINCIPLE_SECTION,
|
|
928
979
|
REQUIRED_CORE_PRINCIPLE_SECTIONS,
|
package/package.json
CHANGED
package/template/.sce/README.md
CHANGED
|
@@ -243,6 +243,6 @@ A Spec is a complete feature definition with three parts:
|
|
|
243
243
|
---
|
|
244
244
|
|
|
245
245
|
**Project Type**: Spec-driven development
|
|
246
|
-
**sce Version**: 3.6.
|
|
247
|
-
**Last Updated**: 2026-03-
|
|
246
|
+
**sce Version**: 3.6.51
|
|
247
|
+
**Last Updated**: 2026-03-15
|
|
248
248
|
**Purpose**: Guide AI tools to work effectively with this project
|