epythet.validation.core¶
The validate orchestrator: resolve the package, run the levels, build the report.
This module is the single source of truth every surface calls. It returns a
Report (JSON-able via to_dict), never
prints and never exits, so the CLI, a future MCP tool or an HTTP endpoint all
wrap the same function.
Seams (one keyword argument each, as in decision D8):
backend=— the build backend for level 1; defaults toSphinxBackend. Levels 0 and 0.5 nevertouch it.
ledger=— the rule catalog;Noneis the bundled ledger, a directory is a package-local overlay.
Level 2 (render) reuses the backend through its render method (a
RenderBackend) and level 3 (review) reads
what level 2 rendered, so a tier-4 run builds exactly once.
Functions
|
Turn |
|
Validate a package's documentation and return a |
Classes
|
Where the package's source lives and which project it belongs to. |
- class epythet.validation.core.ResolvedPackage(name, package_dir, project_dir, version=None)[source]¶
Bases:
objectWhere the package’s source lives and which project it belongs to.
- epythet.validation.core.resolve_package(package)[source]¶
Turn
<package_dir_or_import_name>into aResolvedPackage.Accepts a project root (contains
pyproject.toml/setup.cfg), a package directory (contains__init__.py) or an importable name.- Return type:
- epythet.validation.core.validate(package, *, level=1, levels=None, ledger=None, backend=None, fail_on='error', napoleon=True, style='google', ignore=(), observe=True, observations_path=None, linters=True, snapshot=False, update_snapshots=False, snapshot_dir=None, render_dir=None, review_pages='changed', review_sample=8, screenshots=False, packet_dir=None, review_reply=None)[source]¶
Validate a package’s documentation and return a
Report.- Parameters:
package (
str|PathLike) – A project root, a package directory, or an importable name.level (
int) – The CLI tier:0lint only,1lint + parse (default),2adds the Sphinx build,3the rendered-output checks,4the review packet.levels (
Optional[Iterable[float]]) – An explicit set of levels ([0.5]for a parse-only sweep); overrideslevelwhen given.ledger (
Ledger|str|PathLike|None) –Nonefor the bundled rules, or a directory overlay.backend – The build backend for level 1 (default:
SphinxBackend()).fail_on (
str) – Severity threshold recorded on the report for exit codes.napoleon (
bool) – Pre-process Google/NumPy sections the way the fleet’sconf.pydoes. SetFalsefor a package built without napoleon.style (
str) – Docstring convention passed to ruff and pydoclint.ignore (
Iterable[str]) – Path substrings to skip, asepythet quickstart --ignore.observe (
bool) – Append findings to the observations JSONL (outside the repo).observations_path (
str|PathLike|None) – Override the observations file (tests use this).linters (
bool) – Level 0: shell out to ruff and pydoclint (Falsekeeps the coverage detectors only; the fleet sweep uses it).snapshot (
bool) – Level 2: diff the-b textrender against the stored snapshots.update_snapshots (
bool) – Level 2: re-baseline the snapshots instead of diffing.snapshot_dir (
str|PathLike|None) – Where snapshots live (default<docsrc>/_snapshots/text).render_dir (
str|PathLike|None) – Keep level 2’s rendered output here instead of a temp dir.review_pages (
str) – Level 3:changed(against the snapshot, else a sample),sampleorallpages into the packet.review_sample (
int) – How many pagessampletakes.screenshots (
bool) – Level 3: add Playwright screenshots when it is installed.packet_dir (
str|PathLike|None) – Level 3: write the packet here instead of the user data dir.review_reply (
str|PathLike|None) – Level 3: areview.jsonto ingest as level-3 findings.
- Return type: