8 Commits

Author SHA1 Message Date
DDSRem
2de976f6b3 Merge pull request #7050 from DDSRem-Dev/codex-comment-migration
docs: 统一全项目中文注释和结构化契约说明
2026-10-17 19:26:29 +08:00
jxxghp
0404779a8c refactor(types): preserve optional module reload labels 2026-10-17 04:58:55 +08:00
jxxghp
9ad0c10115 refactor(types): describe sync and async configuration reload callbacks 2026-10-16 16:28:47 +08:00
freeman
f3ad81b39e style: apply safe ruff auto-fixes and exempt startup late imports
Run `ruff check app tests scripts --fix` with the configured rule set
(E4/E7/E9/F/I): import sorting (I001), f-strings without placeholders
(F541), lambda/variable/unused-import cleanups that ruff marks safe.
Nine files whose only ruff debt sits next to pre-existing pylint
import-resolution errors (lazy exports, sys.path script imports) or
whose "unused" imports are reached through attribute access by tests are
left untouched so the changed-file pylint gate and the benchmark tests
stay green; their diagnostics remain in the baseline.

app/startup/lifecycle/__init__.py and app/main.py import business
modules after cache composition, import-path and stdio setup on purpose
(the source comments document the contract), so declare E402
per-file-ignores for them instead of adding per-line noqa.

Ruff ratchet watermark drops from 498 to 100; sync the baseline fixture
and the optimization checklist figure.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-09 13:29:09 +08:00
thsrite
4a66d43366 fix(types): 补齐模块基类注解,消除新模块的类型门禁失败
Architecture Contract Gate 的 mypy ratchet 报出新模块两条错误,根因都在基类:

- ConfigReloadMixin.__init_subclass__ 缺注解,导致所有继承它的模块在类型化
  上下文中被判 no-untyped-call
- _ModuleBase.init_setting 的返回注解为 Tuple[...],与其文档说明的
  「不实现该方法或返回 None 代表不使用开关」矛盾,子类如实声明 Optional
  就会被判 override 不兼容

两处均为纯注解修正,无行为变化。全量 mypy 错误由 9,496 降至 9,441(净减 55,
未新增任何错误),出错文件 514 → 513;同步固化 mypy 低水位与架构清单中的计数。
2026-09-07 14:33:01 +08:00
InfinityPacer
24671f8f18 refactor(runtime): lazily activate host modules (#6331) 2026-08-16 16:07:38 +08:00
jxxghp
4858f4652b fix(runtime): 修复 ConfigReloadMixin 事件处理器因 __name__ 未同步被静默跳过,配置变更不再触发模块重载 (#6329) 2026-08-15 21:27:59 +08:00
jxxghp
369d7d6448 refactor: reorganize backend module boundaries 2026-08-14 19:53:33 +08:00