Skip to content

docs: epythet sweep (rendering repair, docstring coverage, README rewrite) - #12

Merged
thorwhalen merged 3 commits into
masterfrom
docs/epythet-sweep
Sep 15, 2026
Merged

thorwhalen merged 3 commits into
masterfrom
docs/epythet-sweep

Conversation

@thorwhalen

Copy link
Copy Markdown
Member

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/)

error warning info objects_undocumented findings
before 6 126 72 50 204
after 0 26 48 0 74

All level-0.5 (parse) errors are fixed: unbalanced **/backtick markup, malformed :raises: field
lists, 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 now
succeeds with only pre-existing, unrelated warnings (see "Declined" below).

Tests and doctests

before after
pytest -q 31 passed, 1 xfailed 31 passed, 1 xfailed (unchanged)
pytest --doctest-modules -q mongodol 44 passed, 1 xfailed 53 passed, 1 xfailed

No 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}.py
now has at least a one-line, source-verified summary. All 14 of the package's __init__.py entry
points now have a docstring; the 6 that had none also gained a doctest, executed against a live
local MongoDB and pasted verbatim.

Correctness

  • Fixed a stale/wrong docstring claim in get_mongo_collection_pymongo_obj: said the default
    connects to {DFLT_TEST_DB}/test; it actually connects to mongodol/mongodol_test.
  • Removed a dead, unreachable second """docstring""" statement left inside add_clear_method
    (a leftover of an earlier edit — never rendered, just dead code).
  • Fixed a bracket/backtick typo in 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 showing
its distinguishing behaviour (e.g. "first match wins, no uniqueness check" vs. "raises on ambiguous key").

README

Rewritten. The previous quick-start example imported py2store and a MongoCollectionReaderBase
class 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/data
focus, 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
.gitignore so a local epythet quickstart/make build doesn't show as untracked. CI already uses
the standard i2mint/epythet/actions/publish-github-pages job (.github/workflows/ci.yml), no legacy
epythet make . github step or tracked docs/ build output existed.

Declined (behaviour not changed without verification)

  • mongodol/utils/werk_local.py:161 — LocalProxy.__init__'s type hint references a Local class
    that isn't defined anywhere in this vendored file, producing a sphinx_autodoc_typehints.forward_reference
    warning (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 Local
    class or changing the annotation's meaning — out of scope for a docs-only sweep.
  • Remaining epythet validate findings (level 0/1, all warning/info): D205/D415/D200 (blank-line
    and 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 points
    per 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 -q green (31 passed, 1 xfailed)
  • pytest --doctest-modules -q mongodol green (53 passed, 1 xfailed), including every new/edited doctest run against a real local MongoDB
  • epythet validate mongodol -i tests/ scrap/ examples/ --level 2: 0 errors (was 6, including 5 at level 0.5)
  • epythet ai-readme-check .: ok
  • Sphinx build (epythet make . html) succeeds

Claude-Session: https://claude.ai/code/session_01DRUfyM2tZNoZ9znKX5mmKY

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.
@thorwhalen
thorwhalen merged commit d5502c0 into master Sep 15, 2026
10 checks passed
@thorwhalen
thorwhalen deleted the docs/epythet-sweep branch September 15, 2026 13:32
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