docs: epythet 0.2 documentation sweep (WP6) - #10
Merged
Merged
Conversation
…ctions Mechanical rewrite by `epythet repair qh --write` (epythet 0.2.9): 38 docstrings in 14 files. Level 0.5 validate errors 15 -> 0 (DR008 x12, DR003 x3, DR014 x2).
Regenerated on demand by epythet quickstart; a stale committed copy predates the epythet 0.2.9+ repair fixes. Also gitignore the sweep venv.
epythet repair --write: blank lines before doctests/lists in app.py and stores_qh.py; raw-string the openapi.py docstring using backslash escapes for RST cross-references (needed a hand, non-raw would have changed the escapes). testing.py: quick_test's Raises section claimed requests.HTTPError, but fastapi.testclient.TestClient is httpx-based (confirmed via MRO), so the raise_for_status() call actually raises httpx.HTTPStatusError. Left over from a prior, unreviewed pass on this branch.
mk_app, get_task_result, use_au_backend, create_method_endpoint: the docstring now names the exception the body actually raises, verified by reading each function.
get_python_type_name's Examples claimed list[int] -> "list[int]" and
Optional[str] -> "Optional[str]"; verified against the running code
(Python 3.10+) both actually return the bare name ("list", "Optional")
because typing/builtin generic aliases now carry __name__, short-
circuiting the bracketed-args branch. Replaced with a runnable doctest
and an accurate Returns section. Also added Returns to
parse_function_name and get_task_result (DOC201).
InMemoryTaskStore, ThreadPoolTaskExecutor, ProcessPoolTaskExecutor override abstract methods whose contract is on the base class; each override now gets a one-line pointer plus what's implementation-specific (thread pool vs process pool, in-memory storage), verified by reading the bodies.
run_app, test_app, serve_app yield but lacked a Generator[...] return annotation, which pydoclint needs to recognize the Yields section as matching a real yield statement.
client.py: session Args described how it's used (reuse vs create) rather than repeating its Optional[requests.Session] annotation, verified against `session or requests.Session()`. au_integration.py delete_task: replaced the name-restating summary with what it actually does, verified against the body.
TaskConfig, RouteConfig, AppConfig, TypeRegistry, RuleChain: these are the
concepts the package's own module docstring names as central ("a rule
chain and a type registry decide where each parameter lives"), so they
get a runnable example; each was executed first (DQ002). The other ~19
DQ002 entry-point findings (simple dataclasses, ABC method contracts
already documented on the base class, and internal building blocks) are
declined for this pass -- see PR report.
epythet ai-readme-check --write, per the maintainer's local policy (agentic_aspects=add, agents-first, humor on).
TaskManager.cancel_task, parse_function_name, validate_route_config, build_request_body_schema, get_python_type_name, extract_function_signature, Rule.match, RuleChain.match, register_json_type: each parameter name verified against the actual signature. AppRunner.__init__ is left as-is -- its Args are already complete, but pydoclint's convention expects them on the class docstring (DOC301) while also flagging __init__ (D107/DOC101) if they're not duplicated there; a genuine ledger rule conflict, noted in the PR report rather than resolved by picking a side inside this repo.
- service_running: prose claimed the launched service is torn down on exit; the Note two paragraphs below already correctly said the opposite (the finally-block is a no-op). Made the prose match reality instead of contradicting the Note. - mk_app: Raises section only listed TypeError, but validate_route_config can also raise ValueError for an invalid per-function route config. - TypeRegistry: its own docstring attributed the module-level register_type function to the instance's own registry; register_type (and register_json_type) mutate the separate global registry, not the instance -- verified against register_type's implementation.
Unrelated to the docs sweep, but blocks CI entirely as of this session: starlette (now at 1.x) requires the separate httpx2 package for TestClient, which qh.testing (test_app, quick_test, AppRunner) needs at runtime, not just in tests. Verified: pytest collection fails with "RuntimeError: The starlette.testclient module requires the httpx2 package" without this; passes with it. CI installs base dependencies only (no [dev] extra), so this has to be a base dependency, not a dev one.
11 of 20 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Epythet 0.2 documentation sweep for
qh(i2mint/epythet#16 WP6). Builds on aprevious session's unreviewed WIP already committed to this branch; that diff
was reviewed line by line against the behaviour-claim policy, one wrong claim
was found and fixed (see below), and its committed
docsrc/scaffold wasremoved.
Tests and doctests
pytest -q: 165 passed, 1 skipped -- unchanged before/after (no testbehaviour was touched).
pytest --doctest-modules -q qh: 183 -> 188 passed, 12 skipped (5 newrunnable doctests added on
TaskConfig,RouteConfig,AppConfig,TypeRegistry,RuleChain, plus a corrected one onget_python_type_name).epythet validate --level 2 qh -i tests/ scrap/ examples/All 15 master errors were level-0.5 (
DR003/DR008, rendering-breaking:blank lines missing before lists/doctests); the prior WIP session's
epythet repair --writealready cleared those. 0 Level 0.5 errors, theWP6 acceptance line.
Remaining 204 findings, all info/warning, none blocking:
D212+ 18D412: docstring blank-line conventions that directlyconflict with
epythet repair's own output (repair adds a blank lineafter
Examples:/Returns:before a doctest/list to fix Sphinxrendering; ruff's
D412then flags that same blank line as wrong).Filing a ledger-conflict issue against epythet with one of these
docstrings as a fixture.
DOC108: pydoclint's--arg-type-hints-in-signature=falseoption(hardcoded in
epythet/validation/lint.py) fires on every function thatdoes have type-annotated signatures -- which is this repo's (and
epythet's own stated) convention. Same issue: filing against epythet,
cannot be fixed from inside a target repo.
D107vs 6DOC301: pydocstyle wants every__init__to have its owndocstring; pydoclint's Google convention wants
__init__to have noseparate docstring, merged into the class. Mutually exclusive; left as
documented in the PR commits, noted for the same ledger-conflict issue.
DR034: Sphinx warnings fromstarlette's optional-import stubs(
python_multipart,itsdangerousnot installed in the doc build env)and one README code-block lexed as Python that isn't; cosmetic, not
ours to fix without adding unused deps.
D202,D205,D209): a handful of blank-line/formatting nits, left for a future pass.
Coverage / correctness / completeness
(
InMemoryTaskStore,ThreadPoolTaskExecutor,ProcessPoolTaskExecutoroverrides of
TaskStore/TaskExecutor).objects_undocumented: 9 -> 0.policy):
quick_test'sRaisessection saidrequests.HTTPError;fastapi.testclient.TestClientis httpx-based (confirmed via its MRO), so it actually raises
httpx.HTTPStatusError.get_python_type_name's inline "Examples" (not a real doctest) claimedlist[int] -> "list[int]"andOptional[str] -> "Optional[str]"; runningthe code (Python 3.10+) shows both return the bare name (
"list","Optional"), because builtin/typing generic aliases now carry__name__and short-circuit the bracketed-args branch. Replaced with arunnable doctest and an accurate description.
Raises:sections for 4 undocumented exceptions (mk_app,get_task_result,use_au_backend,create_method_endpoint), andReturns:/Args:for 13 more functions/methods where pydoclint found asignature/docstring mismatch -- every name checked against the real
signature.
classes the package's own module docstring names as central concepts
(
TaskConfig,RouteConfig,AppConfig,TypeRegistry,RuleChain).The other ~19
DQ002"entry point has no example" findings (simpledataclasses,
Enums, ABC implementations already covered by base-classdocs) are declined for this pass to avoid filler -- no example was added
without first running it.
Theme
Left
theme = "auto", which currently resolves tosphinxawesome_theme;no
[tool.epythet]override written.docsrc/The prior session committed a generated
docsrc/scaffold (predates theepythet 0.2.9+ repair fixes). Removed from git, added
docsrc/to.gitignore(regenerated on demand byepythet quickstart). No legacyepythet make . githubCI step or trackeddocs/build output existed tomigrate.
README
Added the "For AI agents" section via
epythet ai-readme-check --write,per the maintainer's local policy (agentic_aspects=add, agents-first,
humor on).
epythet ai-readme-check .now passes clean.Claims declined
AppRunner.__init__'sArgsare already complete and accurate, but leftas-is rather than moved to the class docstring -- see the
D107/DOC301conflict above.
DQ002entry points listed above.New epythet ledger-conflict issue
Filing i2mint/epythet with three fixtures from this repo: the
D412-vs-repairblank-line conflict, theDOC108type-hints-in-signature falsepositive, and the
D107-vs-DOC301__init__docstring conflict.Filed: i2mint/epythet#31