# Test And Validation

Use this to select tests after document-type or API changes.

## Test Mapping

- Parser and diagnostics: `tests/test_field_extraction.py`
- Business rules: `tests/test_rules.py`
- Reliability: `tests/test_reliability.py`
- API catalog: `tests/test_api_supported_types.py`
- Validate endpoint: `tests/test_api_validate.py`
- Pipeline integration: `tests/test_pipeline.py`
- Shared fixtures: `tests/conftest.py`
- Real non-sensitive PDFs: slow regression or smoke script

## Command Sets

Core focused:

```bash
pytest tests/test_field_extraction.py tests/test_rules.py tests/test_reliability.py -m "not slow"
```

API:

```bash
pytest tests/ -m api
```

Broad non-slow:

```bash
pytest tests/ -m "not slow"
```

Fast non-API:

```bash
pytest tests/ -m "not slow and not api"
```

## Acceptance Checklist

Before closing a change:

- requested behavior implemented;
- legacy behavior preserved unless explicitly changed;
- parser returns all expected fields;
- diagnostics exist for every expected field;
- dates are ISO;
- issue schema remains stable;
- API catalog and tests match supported types;
- CLI choices/info match supported types;
- README and local docs updated;
- no sensitive data committed or logged;
- user told to restart API/server if runtime code changed.
