chore(仓库对齐): 文档库结构治理 + IM/插件线落地
build / build-and-scan (push) Canceled after 0s

文档库:目录改为编号制(01-规范/02-架构设计/03-数据库/04-调整方案/
05-交接单/06-ops/07-scripts/08-skills/09-archive),顶层散文件归入 01-规范/;
INDEX.md 与 docs-manifest.json 重刷(档案 146 篇);旧目录名引用全量对齐。

IM 线:src/im/**(SDK / hub / store / presence / ws / gateway-token)、
src/web/routes/im.ts、src/db/plugin-data/**、src/supervisor/plugin-assembly.ts
及对应 test/**。

插件线:poc/{im-agent-bridge,im-connection-gateway,im-conversation-tabs,
business-plugins-im,carbon-mcp-probe}、src/web/routes/{sessions,overlay-device}.ts、
src/net/relay/{device-grant,instance-credential}.ts。

仓库卫生:清出 40 个历史误入库 / 已改名文件(34 个交接单归档 + 6 个旧结构,
本地均有副本);dsh-server-docs/.gitignore 补 tmp/;交接单不入库(政策)。
This commit is contained in:
admin committed 2026-09-24 07:25:16 +08:00
1 parent 3d8f50e366
commit e6207aa691
239 files changed
+34477 -14633

No files matched your search

+11 -1
View File
@@ -35,12 +35,22 @@ function layerOf(file) {
const p = posixify(file)
if (p === 'src/cli.ts' || p.startsWith('src/web/')) return 1
if (p.startsWith('src/domain/')) return 2
if (/^src\/(supervisor|db|fs|worker|net|nginx)\//.test(p)) return 3
if (/^src\/(supervisor|db|fs|worker|net|nginx|im)\//.test(p)) return 3
if (/^src\/(config|crypto|isolation|index)\.ts$/.test(p)) return 4
return null // 未归类 ⇒ 新增目录必须先想清"它属于哪一层"
}
const NAME = { 1: '①入口', 2: '②领域', 3: '③能力', 4: '④基础' }
// 定层留痕(2026-09-22 补 · `src/im` 曾长期"未归类" ⇒ 分层检查对它静默不判)
// ─────────────────────────────────────────────────────────────────────────
// `src/im/**`(含 `src/im/sdk/**`)定 **③能力层**,依据 = 实测依赖方向:
// · 只 import `../db/{connection,schema}.js` ⇒ ③→③ **同层**(R2 允许)
// · 零 `../web/` `../domain/` 引用 ⇒ **无回指**,符合 R1
// · 反向扇入 3 处(`web/server.ts` 挂载 · `supervisor/{orchestrator,remote-spawner}`
// 的 `import type`)⇒ 全是**上层依赖下层**,符合 R1 方向
// · 反向扇入 `web/server.ts` 是层①,`supervisor/*` 与自身同为层③ ⇒ 无越层
// ⚠️ 若将来 `src/im` 需要 import `../web/**` ⇒ 定层即错,必须改为"由层①注入依赖"。
function walk(dir) {
const out = []
for (const e of readdirSync(dir)) {