# Quality, validation, and drift

Makra measures whether stored structural knowledge covers the current page, records extraction degradation, and can compare candidate output with a screenshot. Applications still need an acceptance policy.

## Cold, warm, and drifted runs

A cold run learns a page class. A warm run reuses stored bindings when they cover the live structure. A drifted run identifies uncovered nodes and learns that region with a small amount of representative context.

Coverage is independent of your current query. It asks whether stored knowledge accounts for the rendered page, not only whether it can find the two fields you requested. This lets a later schema reuse learned fields without turning every new request into a cold start.

Structural memory is not permanent truth. Stored entries can expire, become incompatible with a storage generation, or fail to fit a layout variant. Those cases trigger relearning and should appear in warnings or telemetry rather than masquerading as ordinary warm hits.

## Validation modes

`repair` lets validation apply corrections to a candidate result. `observe` reports findings while leaving candidate data unchanged.

```python
from makra import ExtractOptions, Makra, ValidationModes

options = ExtractOptions(validation_mode=ValidationModes.OBSERVE)

with Makra() as client:
    response = client.extract(
        ["https://shop.example/products/atlas-lamp"],
        {"price": "The current selling price"},
        config=options,
    )
```

Use `observe` when downstream review or your own validator should decide whether to change data. Use `repair` when you accept the service's correction policy. Do not treat either mode as proof that every field was visually verified.

## Evidence can degrade

Long pages, partial screenshots, model request limits, and unavailable visual evidence can reduce validation quality. Link fields are excluded because a resolved URL is not visible in a screenshot. The workflow reports degraded evidence through warnings.

Current repair behavior can operate with text-only evidence. For high-risk data, reject or quarantine repaired results when warnings show that visual evidence was unavailable.

## Build an acceptance policy

Classify fields by consequence. Missing article subtitles may be tolerable. Misaligned prices and quantities may not be.

```python
from typing import Any, Mapping

REJECT_WARNING_NAMES = {
    "ARRAY_COORDINATE_DEGRADED",
    "SIBLING_ALIGNMENT_DEGRADED",
    "VALIDATION_EVIDENCE_UNAVAILABLE",
}


def accepted(response: Mapping[str, Any]) -> bool:
    if response.get("status") != "succeeded":
        return False
    for warning in response.get("warnings") or []:
        if isinstance(warning, Mapping) and warning.get("name") in REJECT_WARNING_NAMES:
            return False
    return True
```

Warning fields can evolve. Inspect real response shapes in your environment before fixing a parser to one spelling.

Test page variants, sparse rows, and drift. A quality policy exercised only against one full page is not a production policy.

Next, read [Limits, safety, and cost](/markdown/makra-sdk/v0.0.4-beta/production/limits-safety-and-cost).
