Skip to content
Reproducible offline example · PyCharter 0.0.67

Validate a price batch.
Keep the evidence.

Run a real local record check with synthetic financial data. Inspect a versioned contract, a rejected price, and a correction against a known reference.

No FMP key, database, account, plugin, or MCP server is required. Installation uses PyPI; validation runs locally.

01 / SET UP

Unzip into a new directory.

Open a terminal in the extracted price-batch-v1 directory. Python 3.13 is the tested interpreter. Use a fresh virtual environment with the dependency versions supplied in requirements.txt.

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

For an existing project, run this sample in a separate virtual environment first. Add the contract and supported API call to your project after reviewing its requirements; the example does not modify your repository or database.

02 / VERIFY

Reproduce all three outcomes.

The script calls the public Validator.from_file and validate_batch APIs, prints fresh results, and compares them with evidence.json, including exact input and contract fingerprints.

Expected counts from the pinned sample
InputValidInvalid
valid.json20
rejected.json11
corrected.json20

Exit 0 means these expected outcomes were reproduced, including the rejection. It does not mean every record passed. A mismatch exits nonzero; inspect changed files, dependencies, and diagnostics before accepting new evidence.

03 / REVIEW

Use a known source for the correction.

The rejected batch has -8.25 in row index 1, field close. The contract requires a value greater than zero. correction.diff restores 8.25 from valid.json, the supplied synthetic reference. corrected.json is checked separately; the contract and original failed result remain intact.

If the correct value is unknown, keep the failure unresolved and request source evidence. An agent must not infer a financial value or weaken an approved rule just to produce a pass.

04 / ASK YOUR AGENT

The same files work with a coding agent.

Give a Python-capable agent the extracted directory and this prompt. Let it request any permissions required by your environment.

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.

This example runs directly in Python. The separately verified Codex validation plugin pilot adds installation, discovery and resumption in Codex. You can inspect and run every file without an agent.

Scope of this proof: Synthetic record validation only. It does not extract FMP data, authenticate a protected write, publish to a database, persist quarantine/history, prove financial truth, or operate a schedule. The date pattern checks shape, not a trading calendar. Source coverage, freshness, adjustments, currencies, duplicate handling, retries, durable recovery, and monitoring need their own implementation and verification.
05 / NEXT STEP

Choose what to try next.

The sample above is offline record validation. Local setup is a separate step; live FMP ingestion and scheduling need their own qualified runtime, provider access, destination and operating checks.

Feedback