When a gate fails, plesty check prints an error message explaining what went wrong. This guide covers the most common failures and how to fix them.
Gate 1: Metadata & Namespace
Common failures:
pyproject.tomlis missing required fields (name, version, description)- Package name doesn't follow the
plesty-convention - Python module path doesn't use underscores
Fix:
# Check pyproject.toml has all required fields
cat pyproject.toml
# Ensure package name follows convention
# Correct: plesty-my-device
# Module path: plesty/my_device/
Gate 2: Code Hygiene & Tooling
Common failures:
- Ruff lint errors
- Ruff format differences
- Mypy type errors
Fix:
# Format the code
uv run ruff format --config $(uv run python -c "from importlib.resources import files; print(files('plesty.sdk').joinpath('assets/ruff.toml'))") .
# Run lint and fix what you can
uv run ruff check --fix
# Run mypy and fix type annotations
uv run mypy plesty/
Gate 3: API Interface Matching
Common failures:
- Device class doesn't inherit from
BaseDeviceSyncModel - Missing mandatory methods (
connect,disconnect,identity, etc.)
Fix:
Ensure your class inherits from the correct base class and implements all required methods:
from plesty.lib.device import BaseDeviceSyncModel
class MyDevice(BaseDeviceSyncModel):
def connect(self) -> bool:
...
def disconnect(self) -> None:
...
def identity(self) -> str:
...
Gate 5: Documentation Completeness
Common failures:
docs/index.mdis missing or emptyCHANGELOG.mdhasn't been updated
Fix:
# Create or update docs/index.md
touch docs/index.md
# Update CHANGELOG.md with your changes
Gate 6: Dependency Coexistence
Common failures:
- A dependency uses
==exact version pinning
Fix:
Replace exact pins with range constraints:
# Wrong
dependencies = ["numpy==1.26.0"]
# Correct
dependencies = ["numpy>=1.26.0,<2.0.0"]
Gate 7: Test Coverage
Common failures:
- Test coverage is below 80%
Fix:
Add more tests to cover untested code paths:
# Run tests with coverage to see what's missing
uv run pytest --cov=plesty --cov-report=term-missing
Gate 10: Vulnerability Audit
Common failures:
- A dependency has a known CVE
Fix:
# Upgrade the affected package
uv lock --upgrade-package <package>
uv sync
Gate d1: Device API Pipeline
Common failures:
- Schema JSON is malformed
- Mock solver fails for some parameters
identity()returns an empty stringcheck_errors()doesn't return[]on healthy mock
Fix:
Check each sub-gate's error message and fix the corresponding issue in your device implementation.
General tips
- Run
plesty check --standard pixelfirst to catch fast failures - Fix gates in order — later gates often depend on earlier ones passing
- Use the error message to locate the exact file and line number
Next steps
- Now that you can fix failures, learn to build a device
- Understand the quality gates in detail