Incomplete type annotations on public methods degrade generated API docs and expose undeclared internal API
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 22/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- python
- 领域
- backend, documentation
调研方向
Start by running uv run python tooling/docs-autogen/build.py and grepping for "No type" to reproduce the griffe warnings. The listed members are in mellea.stdlib.session (MelleaSession.reset, powerup), mellea.stdlib.components (Instruction.parts, RichDocument.to_markdown, Table.parts), and the mellea.backends.* modules (processing, post_processing). Before annotating anything, a maintainer must decide which symbols are public, since that choice determines whether to annotate or hide them.
由索引模型根据 Issue 内容生成。
描述
The generated API reference docs for several public classes are missing type
information because the underlying source lacks return-type and parameter
annotations. At the same time, the doc generator surfaces a number of
methods that appear to be internal backend-protocol details rather than
intentional user-facing API — raising a broader question about which symbols
are genuinely exported and which are implementation accidents.
Observed behaviour
Running the autogen pipeline (uv run python tooling/docs-autogen/build.py)
emits griffe warnings for every unannotated public member:
WARNING: No type or annotation for returned value (mellea.stdlib.session.MelleaSession.reset)
WARNING: No type or annotation for returned value (mellea.stdlib.session.MelleaSession.powerup)
WARNING: No type or annotation for returned value (mellea.stdlib.components.instruction.Instruction.parts)
WARNING: No type or annotation for returned value (mellea.stdlib.components.docs.richdocument.RichDocument.to_markdown)
WARNING: No type or annotation for returned value (mellea.stdlib.components.docs.richdocument.Table.parts)
Backend protocol methods are also affected across all providers:
| Module | Affected members |
|---|---|
mellea.backends.huggingface |
LocalHFBackend.processing (params: input_ids, seed), post_processing — 9 issues |
mellea.backends.ollama |
OllamaModelBackend.is_model_available (param + return), processing, post_processing — 5 issues |
mellea.backends.openai |
OpenAIBackend.processing, post_processing (params: thinking, seed) — 4 issues |
mellea.backends.litellm |
LiteLLMBackend.processing, post_processing (param: thinking) — 3 issues |
mellea.backends.watsonx |
WatsonxAIBackend.processing, post_processing (param: seed) — 3 issues |
mellea.backends.adapters |
AdapterMixin.add_adapter, load_adapter, unload_adapter returns — 3 issues |
mellea.backends.tools |
add_tools_from_model_options, add_tools_from_context_actions returns — 2 issues |
mellea.formatters.granite |
ElasticsearchRetriever and related — 27 issues |
mellea.telemetry.backend_instrumentation |
start_generate_span, instrument_generate_from_raw — 2 issues |
Because griffe documents anything not prefixed with _, the published API
reference currently includes all of these, with incomplete type information.
Expected behaviour
The API reference accurately reflects the intended public contract:
- Methods that are part of the user-facing surface (
MelleaSession, component
classes, public backend helpers) should have complete type annotations so the
generated docs show full signatures. - Methods that are internal backend-protocol details (
processing,
post_processing) should either be annotated (if truly public) or excluded
from the generated docs (if internal).__all__declarations and/or a
leading underscore convention would make the distinction machine-checkable.
Broader concern: what is the public API?
The project does not currently declare __all__ in most modules, so griffe
documents every non-underscore symbol it finds. This means the published API
reference includes implementation details that are not part of the stable
contract — processing() and post_processing() on backend classes are the
clearest example. Users reading the docs cannot tell which methods are safe to
call and which are framework-internal.
Deciding and encoding the public surface (via __all__, underscore prefixes, or
a similar mechanism) would:
- shrink the generated docs to the intended contract
- eliminate the griffe warnings as a side-effect
- make it easier to apply the docstring quality gate (
--fail-on-quality) to
the right set of symbols
Reproduction
uv sync --all-extras --group dev
uv run python tooling/docs-autogen/build.py 2>&1 | grep "No type"
- 主要语言
- Python
- 星标
- 1.8k
- 派生
- 161
- 平均合并
- 4 天 3 小时
- 30 天内合并 PR
- 45
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
generative-computing/mellea 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
generative-computing/mellea#1864 ·
维护者通常 3 天内回复
-
bug: instruct() and react() replay tool-call turns without tool_calls可能已有人在做 @simonyang08 于 21 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 85/100
generative-computing/mellea#1784 · 1 条评论 ·
维护者通常 3 天内回复
-
Silently mangled docstrings: lone backslash line-continuations in non-raw docstrings collapse command examples可能已有人在做 @madhusudhan1260 于 18 天前认领。 未关闭good first issue p2
难度 2/5 1-3 小时 新手友好度 82/100
generative-computing/mellea#1780 · 2 条评论 · 已指派 1 人 ·
维护者通常 3 天内回复
-
area/telemetry enhancement p2
难度 2/5 1-3 小时 新手友好度 66/100
generative-computing/mellea#1210 ·
维护者通常 3 天内回复
-
area/requirement area/stdlib enhancement p2
难度 2/5 1-3 小时 新手友好度 62/100
generative-computing/mellea#31 · 2 条评论 ·
维护者通常 3 天内回复
查看 generative-computing/mellea 的全部 Issue
相似的 Issue
-
flaky: test_fire_returns_thread_per_http_entry_on_head waits 5 s per dispatch worker on busy shards未关闭status/accepted type/bug
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
bug vector-store
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
EverMind-AI/Raven#1413 ·
维护者通常 1 天内回复
-
Tests: parallel pyinstallcheck runs oversubscribe the machine through nested TBB and BLAS pools可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 86/100
ACCESS-NRI/containerised-environments-infra#143 ·
维护者通常 2 天内回复