refactor: 拆分应用平台服务职责并固化无环边界

将工作流查询、配置、执行、差异、调试、目录和 DataLink 记录、表达式、审计分别归位。
门面保留显式导出,消除 tracker 及分支类型经聚合出口形成的循环,补充文件级循环检查。
同步总纲、层级文档与接口源码索引,交付完整整改报告。

验证:943 项测试通过,类型、版本和 README 审计通过;二进制和插件构建、验证与打包通过。
81 个迁移函数体保持一致,公共 SDK 导出名和三份生成规范与原始基线一致。
This commit is contained in:
gitea committed 2026-10-30 17:05:20 +08:00
1 parent 4e03c9bcd7
commit a2cdefb322
27 files changed
+2811 -2511

No files matched your search

+6 -3
View File
@@ -90,13 +90,15 @@ describe("Architecture Layering Boundaries", () => {
});
test("platform submodules respect ownership and have no cross-module cycles", () => {
const graph = new Map<string, Set<string>>(), violations: string[] = [];
const graph = new Map<string, Set<string>>(), fileGraph = new Map<string, Set<string>>(), violations: string[] = [];
for (const file of collectTsFiles(join(SRC_ROOT, "domains", "platform"))) {
const from = relative(SRC_ROOT, file).replaceAll("\\", "/").replace(/\.ts$/, "");
const source = platformModule(from);
fileGraph.set(from, new Set());
for (const specifier of extractImportSpecifiers(readFileSync(file, "utf8"))) {
const target = resolveImportRelativeToSrc(file, specifier);
if (!target) continue;
if (target.startsWith("domains/platform/")) fileGraph.get(from)!.add(target);
if (platformDependencyViolation(from, target)) violations.push(`${from} -> ${target}`);
const destination = platformModule(target);
if (source && destination && source !== destination) {
@@ -107,6 +109,7 @@ describe("Architecture Layering Boundaries", () => {
}
expect(violations).toEqual([]);
expect(findCycles(graph)).toEqual([]);
expect(findCycles(fileGraph)).toEqual([]);
});
test("bill Session HTTP calls stay in the transport module", () => {
@@ -131,8 +134,8 @@ describe("Architecture Layering Boundaries", () => {
}
expect(violations).toEqual([]);
});
test("workflow imports use the module directories after the platform migration", () => {
const legacy = /domains\/platform\/(?:analysis|workflow-(?:alert-store|branch|nodes|script|state|watch))$/;
test("platform imports use owned submodules and reject retired private paths", () => {
const legacy = /^(?:domains\/datalink(?:\/|$)|domains\/platform\/(?:api|services|types|execution-context|analysis|workflow-(?:alert-store|branch|nodes|script|state|watch))$)/;
const violations: string[] = [];
for (const file of collectTsFiles(SRC_ROOT, true)) {
for (const specifier of extractImportSpecifiers(readFileSync(file, "utf8"))) {