# ACF conformance fixtures

Fixtures for the Agent Correction Format (ACF), captured from the
reference implementation and pinned to the behavior described in
`../agent-correction-format-v0.1.md` (the version the reference
implementation emits today) and `../agent-correction-format-v0.2.md`
(the discussion draft these fixtures also project onto).

## Running the checks

```
python3 standards/validate_fixtures.py   # needs: pip install jsonschema
```

The validator checks the v0.1 verdict invariants for every fixture,
mechanically projects each fixture to the v0.2 reshaped form (failing
dimensions become `messages[]` entries in the host's shape with
`com.provecart.conformity.*` codes and JSONPath paths; the
correction's expected/actual/action ride as extension fields; one
namespaced conformity object carries the verdict and bindings),
validates each projected message and the conformity object against
`../acf-v0.2.schema.json`, and writes the projections to
`projections/`. Also in the package: `../reference-consumer.py`, a
platform-side sample consumer that acts on the output per the v0.2
consumer rules (its captured run is
`../reference-consumer-output.txt`), and
`../profile-declaration-example.json`. Third parties can also run
the reference implementation's own batteries, which exercise the
same code paths end to end: `api/test_api.py` (carts) and
`eval3/test_endpoints.py` (bookings and reservations).

Regenerate the captures with `standards/generate_fixtures.py` (boots
a local test instance of the API; nothing touches production).

## The fixtures

| Fixture | Kind | Verdict | What it pins |
|---|---|---|---|
| f01-cart-match | cart | MATCH | Positive: conforming subject, no corrections array |
| f02-cart-block-price-quantity-item | cart | BLOCK | Negative: three corrections (reduce_total, reduce_quantity, replace_item) on one response |
| f03-cart-review-indeterminate-item | cart | REVIEW | Negative: indeterminate determination routes to REVIEW, correction carries the instructed value |
| f04-booking-block-wrong-date | booking | BLOCK | Negative: change_travel_date with expected/actual dates (the example shape inlined in the UCP discussion draft) |
| f05-booking-corrected-resubmission-match | booking | MATCH | Positive loop closure: corrected resubmission against the same instruction, chained by previous_record_id; the blocked record is not rewritten |
| f06-reservation-block-time-outside-tolerance | reservation | BLOCK | Negative: change_time where a stated tolerance exists and the submitted start is outside it |
| f07-cart-block-excluded-merchant-noncorrectable | cart | BLOCK | Negative, non-correctable: failing dimension marked correctable: false, no correction emitted, corrections null |
| f08-consumer-unknown-code-and-action | consumer behavior | REVIEW | Hand-authored (labeled as such in the file): an unknown code/action with requires_buyer_approval set — the consumer must not auto-apply, guess, or treat it as a pass |

All buyers, travelers, items and businesses in the fixtures are
synthetic. Verdict tokens are elided (they are signed by a throwaway
test secret). In f07 the engine returns `corrections: null`; the spec
treats null and absent identically.
