Skip to content

chore(types): 7 個核心檔補 type hints#10

Merged
MakiDevelop merged 1 commit into
mainfrom
chore/type-hints
May 31, 2026
Merged

chore(types): 7 個核心檔補 type hints#10
MakiDevelop merged 1 commit into
mainfrom
chore/type-hints

Conversation

@MakiDevelop
Copy link
Copy Markdown
Owner

config/ingest/embed/enrich/score/search/serve 全部函式簽名補上參數+回傳型別,加 from __future__ import annotations。純標注、零行為改變。

  • ruff clean + pytest 64 passed(不變)
  • 非嚴格 mypy 抽驗浮現 8 個既有 | None 流問題(serve.py global-None 模式 5 + enrich.py 回傳/索引可能 None 3)— hints 揭露的既有 type 鬆散,非本次引入,列 follow-up

🤖 Generated with Claude Code

config/ingest/embed/enrich/score/search/serve 全部函式簽名補上參數+回傳
型別,加 from __future__ import annotations,精準型別優先於 Any
(sqlite3.Connection / Path / list[dict] 等)。純標注、零行為改變。

驗證: ruff clean + pytest 64 passed(不變)。
非嚴格 mypy 抽驗浮現 8 個既有 | None 流問題(serve.py global-None 模式 5 個
+ enrich.py 回傳/索引可能 None 3 個)— 這些是 hints 揭露的既有 type 鬆散,
非本次引入;列 follow-up(mypy 全綠是獨立一筆債)。

Constraint: 純加法 annotations,不改 logic/control flow,不重構
Directive: 先補 hints 讓型別可見;mypy strict-clean 另開 task(會改 None 守衛=行為)
Rejected: Grok Build 原派此任務 | headless 兩次 exit=1(mem0:8791 MCP 噪音燒
  turn + 找不存在的 pyproject + max_turns 爆),circuit breaker 換 Codex
Not-tested: mypy strict(刻意,本次只補 hints)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@MakiDevelop MakiDevelop merged commit e1df539 into main May 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant