Skip to content
Edit this page

Engineering standards

Keep code small, typed, documented, and tied to a current application requirement. Use uv for Python environments, dependencies, lockfiles, and package builds. GNU Make provides the canonical repository commands.

Python

  • Support Python 3.12 and the versions listed in pyproject.toml.
  • Use UTF-8, LF endings, four-space indentation, and an 80-column limit.
  • Use absolute imports, explicit exports, and complete type annotations.
  • Use snake_case for functions, methods, and attributes.
  • Keep Ruff linting and formatting enabled, including naming checks.
  • Keep Pyright strict. Document narrow third-party typing boundaries.
  • Give each module, class, function, method, fixture, and test a physically multiline Google-style docstring.
  • Comment on non-obvious decisions, invariants, ownership, or error recovery.

Dependencies

Prefer delegation to an established library. Verify the public API and the exact version in uv.lock before depending on it. Add a runtime dependency only when retained code imports and requires it. Keep development tools out of the runtime package.

Tests and coverage

Test observable behavior through the supported public API. Use actual dependencies for integration boundaries. Keep unit and integration tests separate where that clarifies ownership. Do not preserve tests for removed features or add artificial coverage.

The minimum statement coverage is 95%, branch coverage is 90%, and changed-source coverage is 95%. Never lower a threshold or weaken an assertion to make a check pass.

Documentation

Document only behavior supported by code and meaningful tests. Mark planned work as planned. Keep examples executable, use direct American English, and update the navigation in docs/zensical.toml when pages change. Preserve the site theme, branding, and deployment configuration.

Security and repository policy

Treat external input and configuration as untrusted. Keep credentials and private data out of source and logs. Preserve license and attribution. CI must keep applicable quality and security checks independently visible and fail closed. Never force-push or rewrite repository history.