Build, Test, and Verify (TTA.dev)
Validate code changes to ensure they meet quality standards before committing.
Process
Execute the following steps in order. Do not skip steps.
Orient (before writing any code): search the codebase for the target function/class, analyze its callers and dependencies, and assess complexity/risk level. Use available code analysis tools if configured; otherwise proceed with manual review.
Format: Apply Ruff formatting (100-char line length).
uv run ruff format .Lint: Run Ruff linter with auto-fix.
uv run ruff check . --fixType Check: Run Pyright in basic mode.
uvx pyright ttadev/Run Tests: Execute the pytest suite (100% coverage required for new code).
uv run pytest -v --tb=short -m "not integration and not slow and not external"Full coverage (when adding new code):
uv run pytest --cov=ttadev --cov-report=htmlValidate in sandbox (when adding or changing Python code): run the identified tests inside a clean sandbox environment if available (e.g. E2B). If unavailable, fall back to local pytest and note the deviation.
Common Issues
- Type errors: Ensure all new functions have strict type annotations (
str | None, notOptional[str]). - Test failures: Fix the implementation, never comment out tests. Follow the AAA pattern (Arrange-Act-Assert).
- Import errors: All primitives imports must use
from ttadev.primitives.X— neverfrom primitives.X. - Quarantined tests: Tests marked
@pytest.mark.quarantineare auto-skipped unless selected with-m quarantine.
Deep Reference
For full testing patterns, markers, CI pipeline details, and MockPrimitive API, see
docs/agent-guides/testing-architecture.md.