Skip to content

feat: 拆分 detect_lang.py 职责边界 + manifest bundle 测试动态化 (v0.6.1) - #5

Merged
loong10k merged 2 commits into
mainfrom
feat/detect-lang-splits-v0.6.1
Sep 22, 2026
Merged

loong10k merged 2 commits into
mainfrom
feat/detect-lang-splits-v0.6.1

Conversation

@loong10k

Copy link
Copy Markdown
Contributor

What

  • 新增 scripts/paths.py(仅 ensure_user_path)
  • 新增 scripts/user_config.py(load_user_config / load_project_overrides / get_overrides)
  • scripts/detect_lang.py 401 → 301 行;外部 API 不变;hooks↔scripts 跨社区边从 19 降至 ≤4
  • test_plugin_manifests.py 的硬编码 68 改为 lock_union ∪ plugin-local ∪ on-disk 动态断言

Why

code-review-graph 已记录 hooks↔scripts 高耦合告警(19 条 CALLS);detect_lang.py 三职责合一让任意改动都击穿 hooks 全集。manifest 测试的硬编码 68 在 bump 上游快照时给出弱错误信号。

Verification

  • unittest 14/14
  • run_all 141/141/0
  • openspec strict 5/5
  • git diff --check clean
  • ruff: 4 errors, all in pre-existing territory (BLE001 fail-open convention / PLW1510 subprocess style / EXE001-002 shebang); no new issues from this PR

Spec

  • ADDED language-gate-commands (3 Requirements)
  • ADDED plugin-manifest-contracts (1 Requirement)
  • OpenSpec changes archived: openspec/changes/archive/2026-09-22-add-detect-lang-splits/, ...add-manifest-bundle-dynamic/

add-detect-lang-splits:
- 新增 scripts/paths.py(仅 ensure_user_path)
- 新增 scripts/user_config.py(load_user_config / load_project_overrides / get_overrides)
- scripts/detect_lang.py 顶部 re-export 上述符号,删除实现正文;外部 API 不变
- 401 行 → 301 行;hooks↔scripts 跨社区边应从 19 降至 ≤4

add-manifest-bundle-dynamic:
- test_plugin_manifests.py 的硬编码 '68' 改为 lock_union ∪ plugin-local 与 on-disk 一致
- 测试名去数字,错误信号强(带 symmetric-set diff)

测试:unittest 14/14 + run_all 141/141/0 + openspec strict 5/5 + diff --check 干净
spec: language-gate-commands / plugin-manifest-contracts 已合入
@loong10k loong10k added the enhancement New feature or request label Sep 22, 2026
@loong10k
loong10k merged commit 9df5c43 into main Sep 22, 2026
1 check passed
@loong10k
loong10k deleted the feat/detect-lang-splits-v0.6.1 branch September 22, 2026 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant