Maintenance Guide¶
Dependency Updates¶
- Vulnerability scanning:
pip-auditruns in CI (.github/workflows/) on every push. Failures block the build. - Outdated dependencies: Review with
pip list --outdatedbefore each release. Pin upper bounds inpyproject.tomlonly when known incompatibilities exist. - Lockfile:
uv.lockis committed. Regenerate withuv lockafter changingpyproject.toml. - Pre-commit hooks: Defined in
.pre-commit-config.yaml. Runpre-commit autoupdatemonthly.
Security Patching¶
- SAST:
banditruns in CI (tool.banditconfig inpyproject.tomlexcludestests/,.venv,.tox; skipsB101— assert allowed in non-test code). - Critical CVEs: Trigger an immediate patch release. Process:
- Fix in a branch
- Add regression test in
tests/test_security*.pyor relevant test file - Run
lint.sh && test.sh(ormake lint test) - Tag
v{patch}.{minor}.{patch+1} - Update
CHANGELOG.mdunder### Security - Secrets: No credentials, tokens, or private keys are committed. The
.envfile is gitignored.Configuration.to_dict()redacts every secret-shaped field across every config section.
Technical Debt Management¶
Tracked in docs/REFACTORING_PLAN.md and docs/ROADMAP.md. v0.9 hardening landed; remaining v1.0 deferrals are itemised in the Roadmap.
Before each release, run ruff check underwrite/ tests/ and mypy underwrite/ tests/ to prevent regression. Current ruff config: select = ["E", "F", "I", "UP", "B"], line length 120. mypy runs against both underwrite/ and tests/ with strict typing — no ignore_errors safety net.
Test Maintenance¶
- Pre-release: Run
pytest tests/ -q(1276 tests as of v0.9). All tests must pass. - Coverage: Run
pytest --cov=underwrite tests/— keep coverage ≥ 80% (gate enforced in CI). - Regression tests: Every bug fix must include a test that fails before the fix and passes after.
- Mutation testing:
mutmut run(config inpyproject.toml: paths["underwrite"], runnerpython -m pytest tests/ -x --timeout=30). Run before major releases. - Stress/concurrency tests: 30+ concurrency stress tests already in
tests/test_concurrency.py,tests/test_concurrency_faults.py, and the per-service fault-injection suites. Add more as needed.
Documentation Maintenance¶
- docs/: Update when adding new features, services, event types, or configuration options.
- mkdocs.yml: Keep the
navsection consistent with thedocs/directory structure. Currently only 4 entries innav— expand as files are added. - README.md: Keep the description, quickstart, and badge list current.
- CHANGELOG.md: Every release gets an entry under
## [version]with### Added,### Changed,### Fixed,### Securitysections.
Deprecation Policy¶
- Mark deprecated APIs with a
.. deprecated::directive in the docstring and add awarnings.warn(..., DeprecationWarning)call. - Keep the deprecated API for 2 minor versions (e.g. deprecated in v0.4.0, removed in v0.6.0).
- Document the removal in
CHANGELOG.mdunder### Changedwith a migration note.
Upgrade Paths¶
- Breaking changes are documented in
CHANGELOG.mdwith a### Changedentry describing the migration. - The
version.pyfile is auto-generated bysetuptools-scmfrom git tags — always tag releases. - For database schema changes, use
MigrationPlaninmigrate.pyand test withtest_migrate.py.