Plesty Documentation

Quantum Gates (7–11 + d1)

The full verification tier — test coverage, security audit, docs build, and the device pipeline gate.

These gates complete the full local verification. Run them before tagging a release. Network access is required for Gate 10 (CVE database query).

quantum [SDK+CI] Gate 7 — Automated Test Coverage
Runs pytest --cov with a minimum coverage threshold of 80%. Measures line coverage across the entire source package. Tests in tests/ are excluded from the coverage measurement. The same threshold is enforced in CI in a clean install environment.
quantum [SDK+CI] Gate 8 — Semantic Versioning
Advisory gate (non-fatal): if commits exist since the last git tag, reminds you to create a release. In CI, runs an API-level diff against the published PyPI release to detect breaking changes that should bump the major version.
quantum [SDK+CI] Gate 9 — Licensing Compliance
LICENSE and COPYING files must be present. The license field must be declared in pyproject.toml. Both are generated by plesty init and set to LGPL-3.0-or-later.
quantum [SDK+CI] Gate 10 — Vulnerability Audit
Queries the OSV database via pip-audit for known CVEs in all declared dependencies. A CVE blocks the push. Fix by upgrading the affected package: uv lock --upgrade-package <package> && uv sync.
quantum [SDK] Gate 11 — Docs Build
Runs a full Sphinx documentation build and requires zero errors and zero warnings. Automatically skipped when the environment variable CI=true is set — in CI, docs are built by the deploy-docs component in gate 12 instead. To test locally: unset CI && uv run plesty check.
device only [Device] Gate d1 — Device API Pipeline
Requires all eight DevicePipeline mock-gate test functions to be present in the test suite and passing. Activated only when module_type = "device" in [tool.plesty]. Runs without hardware — uses a mock solver that generates schema-valid responses. See Gate d1 guide for the complete test file.

Coverage below 80%

The most common quantum failure on first attempt. Check the coverage report:

uv run pytest --cov=plesty/power_meter --cov-report=term-missing

The MISS column shows uncovered lines. Focus on branches in _write_, _query_, and check_errors — these are often missing from the scaffolded smoke tests.

CI=true and Gate 11

If you run plesty check in a CI environment (where CI=true is set by GitLab automatically), Gate 11 is skipped. This is intentional — the Sphinx build is done by the dedicated deploy-docs job in Gate 12 instead, which has access to the full CI environment and docs deployment credentials.