docs: epythet sweep (rendering repair, docstring coverage, README rewrite) - #12
Merged
Merged
Conversation
Fixes all epythet validate level-0.5 errors (unbalanced markup, malformed field lists, doctest glued to prose, colon-role breaking docutils parsing). Adds a docstring to every previously-undocumented public class/method/function (0 undocumented objects, down from 50), including executed and verified doctests for the entry points that had none. Fixes a stale docstring claim in get_mongo_collection_pymongo_obj (wrong default db/collection name). Ignores the generated docsrc/ directory.
The README's quick-start example used py2store and a MongoCollectionReaderBase class that no longer exist. Replaced with a minimal runnable example against the current mongodol/dol API, verified by execution. Added the epythet- generated "For AI agents" section (llms.txt, mongodol.md, objects.inv).
- get_key_value_specs: don't claim a purpose with zero verified callers, don't
claim a return shape the dict-data_fields branch can't produce (it raises
UnboundLocalError; noted, not silently "fixed" since that's a behaviour
change out of scope for a docs sweep).
- projection_union: the summary said "OR-ing shared fields", but every field
is OR-ed against a forced True default, so a field present in only one dict
(or False in one) still comes out True. Verified with real calls.
- MongoCollectionPersister.append/extend: said "merged with this store's
filter", but _build_doc actually uses on_write_filter when set. Verified
by reading _build_doc.
- README quick start: len(s) == 0 only holds on a fresh collection; added an
explicit delete_many({}) so the example is reproducible regardless of
what's already in the default test collection.
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
WP6 epythet documentation sweep for this repository (one repo, one PR, per the sweep's own rules).
epythet validate(level 0/0.5/1,-i tests/ scrap/ examples/)All level-0.5 (parse) errors are fixed: unbalanced
**/backtick markup, malformed:raises:fieldlists, a doctest glued to prose, a bracket typo in a docstring, and a continuation line starting
with a
:role:that broke docutils indentation parsing (mongodol/views.py). Sphinx build nowsucceeds with only pre-existing, unrelated warnings (see "Declined" below).
Tests and doctests
pytest -qpytest --doctest-modules -q mongodolNo doctest needed skipping; none failed on master, and a local MongoDB was reachable, so every
new example was written against real, verified output (not mocked).
Coverage
Public surface: 108 objects checked. 50 undocumented before, 0 after. Every previously-undocumented
public class, method and function in
mongodol/{base,stores,trans,util,add_ons,tracking_methods,tests/util}.pynow has at least a one-line, source-verified summary. All 14 of the package's
__init__.pyentrypoints now have a docstring; the 6 that had none also gained a doctest, executed against a live
local MongoDB and pasted verbatim.
Correctness
get_mongo_collection_pymongo_obj: said the defaultconnects to
{DFLT_TEST_DB}/test; it actually connects tomongodol/mongodol_test."""docstring"""statement left insideadd_clear_method(a leftover of an earlier edit — never rendered, just dead code).
disallow_sourced_interval_overlaps's:return:line.Completeness (entry points)
MongoCollectionUniqueDocPersister,MongoCollectionFirstDocPersister,MongoCollectionMultipleDocsPersister,MongoCollectionFirstDocReader,MongoCollectionMultipleDocsReader,get_mongo_collection_pymongo_obj,mk_dflt_mgc,MongoClientReader,MongoDbReader: each gained an executed, verified doctest showingits distinguishing behaviour (e.g. "first match wins, no uniqueness check" vs. "raises on ambiguous key").
README
Rewritten. The previous quick-start example imported
py2storeand aMongoCollectionReaderBaseclass that no longer exist in this codebase — actively misleading for a human or an agent. Replaced
with a minimal example against the current API, executed and verified. Added the epythet-generated
"For AI agents" section (
~/.config/epythet/config.toml: add, humour on, agents-first placement) —this repo has no skills/subagents/instruction files, so the section documents only the published
llms.txt/mongodol.md/objects.inv.Theme
Left
theme = "auto"(no[tool.epythet]override) — nothing about this package (branding, ML/datafocus, notebook-heavy content, or a ≤5-page site) calls for a different theme per the decision procedure.
docsrc/Was already removed from git history before this sweep (commit
d60da1b); now also added to.gitignoreso a localepythet quickstart/makebuild doesn't show as untracked. CI already usesthe standard
i2mint/epythet/actions/publish-github-pagesjob (.github/workflows/ci.yml), no legacyepythet make . githubstep or trackeddocs/build output existed.Declined (behaviour not changed without verification)
mongodol/utils/werk_local.py:161—LocalProxy.__init__'s type hint references aLocalclassthat isn't defined anywhere in this vendored file, producing a
sphinx_autodoc_typehints.forward_referencewarning (3 occurrences, pre-existing). Left as is: this is a real code-level bug (a broken forward
reference), not a docstring/rendering issue, and fixing it would mean either inventing a
Localclass or changing the annotation's meaning — out of scope for a docs-only sweep.
epythet validatefindings (level 0/1, all warning/info):D205/D415/D200(blank-lineand punctuation formatting on docstrings that already have a real summary — cosmetic, no meaning
change),
D105(missing docstring on magic methods — explicitly lower priority than entry pointsper the sweep's rubric).
New artifact classes seen (proposed ledger rules)
None beyond what's already in the bundled ledger; every finding hit in this repo matched an existing rule.
Test plan
pytest -qgreen (31 passed, 1 xfailed)pytest --doctest-modules -q mongodolgreen (53 passed, 1 xfailed), including every new/edited doctest run against a real local MongoDBepythet validate mongodol -i tests/ scrap/ examples/ --level 2: 0 errors (was 6, including 5 at level 0.5)epythet ai-readme-check .:okepythet make . html) succeedsClaude-Session: https://claude.ai/code/session_01DRUfyM2tZNoZ9znKX5mmKY