# FT-N-01 — 350 m outlier injection tolerance

**Task**: AZ-424_ft_n_01_outlier_tolerance
**Name**: Tolerate up to 350 m outliers between consecutive frames; tilt up to ±20° (AC-3.1, RESTRICT-CAM-1)
**Description**: Implement FT-N-01 — Derkachi replay with `outlier-injection-derkachi` injector (medium density); SUT detects outlier; rejects from anchor; estimate continues from prior valid state; covariance grows monotonically; per-frame error_after_outlier ≤ error_before_outlier + 50 m.
**Complexity**: 3 points
**Dependencies**: AZ-406, AZ-407, AZ-408
**Component**: Blackbox Tests / Negative (epic AZ-262)
**Tracker**: AZ-424
**Epic**: AZ-262 (E-BBT)

## Problem

Outlier tolerance (AC-3.1) is the project's primary failure-mode robustness measurement. Without this scenario the matcher's outlier-rejection is unmeasured.

## Outcome

- pytest scenario at `e2e/tests/negative/test_ft_n_01_outlier_tolerance.py`.
- Replays Derkachi with the `outlier.py --density medium` injector (every 10th frame replaced).
- For each non-outlier frame: computes `error_per_frame = vincenty(estimate, GT)`; tracks `error_before_outlier` and `error_after_outlier`.
- For each outlier event: asserts `error_after_outlier ≤ error_before_outlier + 50 m`.
- Tracks `cov_semi_major_m` across outlier events; asserts monotonic growth across the event.

## Scope

### Included
- `medium`-density injection.
- Per-frame error computation against GT.
- Per-event drift bound assertion.
- Per-event covariance-monotonic assertion.

### Excluded
- `light` and `heavy` densities — `medium` is the AC-3.1 canonical envelope.
- Tilt envelope assertion (camera ±20°) — derived directly from `RESTRICT-CAM-1` and verified at fixture-validation time, NOT exercised in this scenario.

## Acceptance Criteria

**AC-1: medium-density injection active**
Given the injector is configured `--density medium`
Then ≥10 outlier frames are injected over the Derkachi 8-min replay (1 in 10 ≈ 1470 frames / 10).

**AC-2: drift bound per outlier**
Given each outlier event
Then `error_after_outlier ≤ error_before_outlier + 50 m`.

**AC-3: covariance monotonic**
Given the per-frame `cov_semi_major_m` stream
Then for every outlier event, `cov_semi_major_m` is non-decreasing across the 3-frame window centred on the outlier.

**AC-4: parameterization**
Given conftest parameterization
Then the scenario runs per `(fc_adapter, vio_strategy)`.

## System Under Test Boundary

End-to-end through public boundaries.

- **Allowed**: outbound estimate stream, FDR per-frame records.
- **Forbidden**: importing C3 matcher state, stubbing the outlier-detection threshold.

## Constraints

- The injector's per-frame replacement is geo-located via the tile-cache GT; ≥99 % of replacements are >350 m from the original frame's GT centre (per AZ-408 AC-2).

## Document Dependencies

- `_docs/02_document/tests/blackbox-tests.md` § FT-N-01
- `_docs/02_document/tests/test-data.md` § Resilience (FT-N-01 row)
