# Validate a sample price batch

This offline example uses **synthetic financial records**, not FMP market data.
It runs the public `pycharter.Validator` API from PyPI release **0.0.67**.
No API key, database, account, scheduler, MCP server, or coding-agent plugin is
needed. Installation needs access to PyPI; validation itself runs locally.

## Reproduce

Use Python 3.13 (the tested interpreter) in a new directory/environment:

```sh
python3.13 -m venv .venv
# macOS / Linux:
source .venv/bin/activate
# Windows PowerShell: .venv\Scripts\Activate.ps1
python -m pip install -r requirements.txt
python verify.py --check
```

The dependency versions in requirements.txt are the tested environment snapshot.
The command prints **fresh local results** and compares them to evidence.json.
Exit 0 means the three recorded outcomes were reproduced, including the expected
rejection. It does not mean every input record passed. A changed input, contract,
diagnostic, or incompatible dependency causes a nonzero comparison result.

## What the files mean

- `contract.json`: version 1.0.0; a price must be greater than zero, volume
  nonnegative, and symbol/date present. The date pattern checks shape, not a
  trading calendar. The contract does not check OHLC relationships, source
  coverage, freshness, duplicates, adjustments, currencies, or financial truth.
- `valid.json`: two valid synthetic records, also the known reference fixture.
- `rejected.json`: the same batch with SAMPLE's close changed to -8.25.
- `corrected.json`: the original batch restored from valid.json. This is a
  demonstrated transcription repair against a known reference, not an inferred
  market price. When the correct value is unknown, retain the failed evidence
  and seek review; never invent a value or relax the rule just to pass.
- `correction.diff`: the exact input change; the contract remains unchanged.
- `evidence.json`: recorded outputs, original diagnostics, and input/contract
  SHA-256 fingerprints. Counts are computed by verify.py from actual validation
  results. These are record checks, not full pipeline or batch-quality proof.
- `verify.py`: the actual public-API call, independent of the website and agent.

Expected valid/invalid counts: **valid 2/0; rejected 1/1; corrected 2/0**.
The browser selects recorded fixtures; it does not execute Python or contact FMP.
No database write, authorization decision, persistent quarantine, durable run
history, retry, lineage store, or scheduled pipeline is implemented by this
example. The files are ordinary reviewable files that can be committed to Git;
Git and deployment remain the user's responsibility.

## Use with a coding agent

Ask: "Use this pinned PyCharter example to validate the sample price batch.
Run verify.py --check, inspect the rejected record and contract, and explain the
correction against valid.json. Keep the contract and original failure intact.
Do not connect to FMP or a database."

The agent needs a Python-capable environment and your permission to run commands.
This is an ordinary prompt, not evidence that an Optophi coding-agent plugin is
released or automatically selected. The intended larger FMP workflow adds source
and destination configuration, feasible schedules, guarded publication, durable
state, and independent monitoring as those capabilities are verified.
