Skip to content

Coding standards

Enforced on every task in the local MVP lane.

Rules

Rule Meaning
Atomic functions One responsibility; ~30 lines max
Chunk + test pytest green before next task
Protocols typing.Protocol for parsers — no vendor imports in core/
Registry Plugins register in plugins/__init__.py only
Stable contracts Return core/models.py types from all plugins
Fail closed Missing creds → enabled=False, never silent wrong API
No PHI in logs Log job_id, parser_id, confidence only
No Elation HTTP in MVP elation_adapter builds JSON preview only

Test layout

tests/
  test_core_models.py
  test_registry.py
  test_plugins_gcp.py      # @pytest.mark.gcp skips without creds
  test_orchestrator.py
  test_api.py
  test_elation_adapter.py

Adding code checklist

  1. Implement smallest unit
  2. Write test
  3. Run pytest
  4. Update MkDocs page for the area you changed
  5. Entry in .cursor/memory/CHANGELOG.md (no PHI)