mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-04 23:17:20 +08:00
test(architecture): record direct adapter imports
This commit is contained in:
@@ -74,8 +74,8 @@ G-ARCH 只有在以下条件全部满足后才可完成:
|
||||
|---|---|---|---|
|
||||
| S0-L1 可信基线恢复 | `DELIVERED` | 无 | `5df388719`:交付架构审计/路线图,修复 `ARCH-001` 两个 mypy 增量错误;远端 `0/0` |
|
||||
| S0-L2.1 Host Oper/UoW 规范 | `DELIVERED` | S0-L1 | `3bf94ffed`:宿主无 Session Oper 规范债务归零,远端 `0/0` |
|
||||
| S0-L2.2 完整宿主 SCC policy | `VERIFIED` | S0-L2.1 | 完整宿主 SCC 全部精确分类;Chain 临时债务和 TMDB containment 分离 |
|
||||
| S0-L2.3 Adapter 直连事实 | `PLANNED` | S0-L2.1 | 收集 Application/Chain 的原始 Adapter import,不因父包展开重复计数 |
|
||||
| S0-L2.2 完整宿主 SCC policy | `DELIVERED` | S0-L2.1 | `a884ab5c2`:完整宿主 SCC 精确 policy 生效,远端 `0/0` |
|
||||
| S0-L2.3 Adapter 直连事实 | `VERIFIED` | S0-L2.1 | 收集 Application/Chain 的原始 Adapter import,不因父包展开重复计数 |
|
||||
| S0-L2.4 Adapter zero-growth | `PLANNED` | S0-L2.3 | 当前直连均登记迁移 owner,新增/替换失败,删除后要求清理陈旧 policy |
|
||||
| S0-L2.5 Event consumer 识别 | `PLANNED` | S0-L2.1 | consumer 只识别可静态证明的 EventManager 注册,动态误报归零 |
|
||||
| S0-L2.6 事实源与 CI 投影 | `PLANNED` | S0-L2.2,S0-L2.4,S0-L2.5 | fixture/policy/overview 职责固定,CI 分开报告语义 policy 与快照一致性 |
|
||||
@@ -153,42 +153,46 @@ G-ARCH 只有在以下条件全部满足后才可完成:
|
||||
|
||||
## 4. 当前活动叶子
|
||||
|
||||
### S0-L2.2 完整宿主 SCC policy
|
||||
### S0-L2.3 Adapter 直连事实
|
||||
|
||||
**Status:** `VERIFIED`(本地验收完成,等待提交、推送和远端一致性确认)
|
||||
|
||||
**Outcome**
|
||||
|
||||
让完整宿主静态依赖图中的每个 SCC 都有精确、人工审查的分类;生成快照只记录事实,
|
||||
不能通过刷新 baseline 自动批准新环。
|
||||
用原始 AST import 记录 Application/Chain 到 Adapter 的稳定直连事实,不把父包初始化边、
|
||||
导入符号、行号、TYPE_CHECKING 或动态字符串导入混入治理面。
|
||||
|
||||
**Ownership**
|
||||
|
||||
- `tests/test_architecture_dependencies.py` 的统一图算法和完整 SCC 语义门禁。
|
||||
- `tests/fixtures/architecture/dependency-policy.json` 的精确人工 policy。
|
||||
- `docs/rules/05-architecture.md` 与 `docs/architecture-overview.md` 的事实/policy 边界。
|
||||
- `scripts/architecture/baseline.py` 的 direct Adapter import collector。
|
||||
- `tests/test_architecture_adapter_imports.py` 的 AST 语义和当前 28 条事实断言。
|
||||
- `tests/fixtures/architecture/dependency-baseline.json` 的 schema v2 生成字段。
|
||||
- 本路线图的叶子状态和交付记录。
|
||||
|
||||
**Excluded**
|
||||
|
||||
- 不在本叶消除 Chain SCC;由 `ARCH-107`/S2-L2 删除包根环和临时 policy。
|
||||
- 不拆分 TMDB 移植包,不把普通单向包外依赖误判为 SCC 成员扩张。
|
||||
- 不修改 `app/plugins/**`、运行时代码或独立插件仓。
|
||||
- 不批准当前直连、不写 owner、不建立豁免;这些属于紧随其后的 S0-L2.4。
|
||||
- 不修改现有完整依赖图、SCC、digest、`app/plugins/**` 或运行时代码。
|
||||
- 不把 `app.db.adapters`、SDK、插件副本或第三方 HTTP egress 混入本字段。
|
||||
|
||||
**Acceptance**
|
||||
|
||||
```bash
|
||||
.venv/bin/python -m pytest \
|
||||
tests/test_architecture_adapter_imports.py \
|
||||
tests/test_architecture_contract_baseline.py \
|
||||
tests/test_architecture_dependencies.py \
|
||||
tests/test_architecture_baseline_cli.py -q
|
||||
.venv/bin/python scripts/architecture/baseline.py --check-host --diagnostics
|
||||
.venv/bin/python scripts/architecture/ruff_ratchet.py
|
||||
.venv/bin/python scripts/architecture/mypy_ratchet.py
|
||||
.venv/bin/pylint tests/test_architecture_dependencies.py
|
||||
.venv/bin/pylint scripts/architecture/baseline.py \
|
||||
tests/test_architecture_adapter_imports.py \
|
||||
tests/test_architecture_contract_baseline.py
|
||||
git diff --check
|
||||
```
|
||||
|
||||
**Delivery**
|
||||
|
||||
- 单一提交主题:建立完整宿主 SCC policy 与 zero-growth 语义门禁。
|
||||
- 单一提交主题:生成并锁定 Adapter 原始直连事实。
|
||||
- 推送 `origin/v3` 后确认提交祖先关系、远端 SHA 和 ahead/behind `0/0`。
|
||||
|
||||
Reference in New Issue
Block a user